tiempoLife = 90;
function updateTime(){
	tiempoLife--;
	texto = "Dispone de " + tiempoLife + " segundos para acceder al videoChat";
	var obj = document.getElementById("tiempo");
	obj.innerHTML = texto;
	if ( tiempoLife  !=  0 ) setTimeout('updateTime()',1000);
	else tiempUp();
}

function tiempUp(){
	texto = "Tiempo superado. Pulse el enlace para recargar.";
	enlace = "<a href=\"javascript:window.location = 'acceso-Telefono.php'\" class='base'> Pulse Aqui </a>";
	var objTexto = document.getElementById("tiempo");
	var objTexto1 = document.getElementById("telefono");
	var objIframe = document.getElementById("iframe");
	objTexto.innerHTML = texto;
	objTexto1.innerHTML = enlace;
	objIframe.src = "limpia803.php?tiempUP=si";
	
}


function getHTTPObject()
{
	var xmlhttp;

	/*@cc_on @*/
	/*@if (@_jscript_version >=5) 
	//El codigo se ejecutara si la version de internet explorer es la 5 o superior.
	//Se utiliza para evitar problemas con versiones atiguas de explorer
	
	var ids = ["Microsoft.XMLHTTP","Msxm12.XMLHTTP.5.0","Msxm12.XMLHTTP.4.0","Msxm12.XMLHTTP.3.0","Msxm12.XMLHTTP"];
	
	for (var i=0;!xmlhttp && i<ids.length;i++)
	{
		try{
				xmlhttp = new ActiveXObject(ids[i]);
		}catch(ex){
				xmlhttp = false;
		}
	}
	
	@end @*/
	
	//Ahora solo falta controlar los demas navegadores
	
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
		xmlhttp = new XMLHttpRequest();
	}
	
	return xmlhttp;
}

function send(xmlhttp,metodo,url,async)
{
	//alert(xmlhttp);
	//Envio de datos a la url de forma  async(como indique esta variable)
	xmlhttp.open(metodo,url,async);
	// onreadystatechange es el evento de objeto xmlhttp que se ejecuta cuando hay un cambio en la url
//	xmlhttp.onreadystatechange = function (){
//	/*readyState atributo que contiene el estado en el que se encuentra la url hay cuatro estado 1-4
//	4: la pagina se ha cargado por completo
//	*/
//		alert("Me voy a cagar en toooooooooo");
//		if (xmlhttp.readyState == 4) 
//		{
//			receiveData(xmlhttp);
//		}
//	}//fin function
	xmlhttp.send(null);
	
}


function notificarSalida()
{
	//alert("Esto parece increible");
	var xmlhttp = getHTTPObject();
	
/*	var valor = document.getElementById("dato").value;
	send(xmlhttp,"GET","serv.php?valor="+encodeURIComponent(valor),true);*/

	send(xmlhttp,"GET","limpia803.php",false);
}

