// JavaScript Document
var xmlHttp
var id
function MakeXmlHttpObject(){
	var xmlHttp=null;
	try{
		// XmlHttpRequest para Firefox,Opera, Safari e derivados.
		xmlHttp = new XMLHttpRequest();
	}
	catch (e){
		// XmlHttpRequest para InternetExplorer.
		try{
			// Internet Explorer 6.0+
			xmlHttp = new
			ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			// Internet Explorer.
			xmlHttp = new
			ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function stateChanged() {
	if (xmlHttp.readyState==4){
		document.getElementById("divRetorno").innerHTML=xmlHttp.responseText;
	}
}
function esconde(int){
	document.getElementById("divRetorno").innerHTML = "";
	document.getElementById("btcadastro").style.cursor="pointer";
	clearInterval (intervalo);
}

function showHint(str,doc){
 if (document.getElementById("divRetorno").innerHTML==""){
	 document.getElementById("divRetorno").innerHTML= '<img src="'+Url+'images/loadingAnimation.gif" >'
	 	document.getElementById("btcadastro").style.cursor="default";
	xmlHttp=MakeXmlHttpObject()
	if (xmlHttp==null){
		alert ("O browser não suporta AJAX!");
	return ;
	}	
	rand=Math.floor(Math.random( ) * (999999999+1));
	var pedido=Url+doc+".php"+"?email="+str+"&rand="+rand;
	xmlHttp.onreadystatechange = stateChanged;
	xmlHttp.open("GET",pedido,true);
	xmlHttp.send(null);
	intervalo =   setInterval("esconde(intervalo)",2200);
 }
	
	
}