var xmlHttp
var endereco="http://samuelsantos.awardspace.com/";
var imagem="<img src="+ endereco +"loading.gif>";

function showPais(str)
{
if(str==0){
document.getElementById("txtHinte").style.display = "none";
document.getElementById("txtHinta").style.display = "none";    }else{
document.getElementById("txtHinte").style.display = "block";
document.getElementById("txtHinta").style.display = "block";     }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="ajaxestado1.php"
url=url+"?q="+str
url=url+"&acao=pais"
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedb

xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showUser(str)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="ajaxestado1.php"
url=url+"?q="+str
url=url+"&acao=cidade"
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangeda

xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showSegmentosUm(str)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="ajaxestado1.php"
url=url+"?q="+str
url=url+"&acao=segmentos"  
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedc

xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showCampo(str)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="ajaxestado.php"
url=url+"?q="+str
url=url+"&acao=outrocampo"  
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedd

xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedb(){
if (xmlHttp.readyState==0)
{
document.getElementById("txtHinta").innerHTML="Enviando requisição...";
}
if (xmlHttp.readyState==1)
{
document.getElementById("txtHinta").innerHTML=imagem;
}
if (xmlHttp.readyState==2)
{
document.getElementById("txtHinta").innerHTML="Carregado!";
}
if (xmlHttp.readyState==3)
{
document.getElementById("txtHinta").innerHTML="Pronto!";
}
if (xmlHttp.readyState==4)
{
document.getElementById("txtHinta").innerHTML=xmlHttp.responseText;
}
}

function stateChangeda(){
if (xmlHttp.readyState==0)
{
document.getElementById("txtHinte").innerHTML="Enviando requisição...";
}
if (xmlHttp.readyState==1)
{
document.getElementById("txtHinte").innerHTML=imagem;
}
if (xmlHttp.readyState==2)
{
document.getElementById("txtHinte").innerHTML="Carregado!";
}
if (xmlHttp.readyState==3)
{
document.getElementById("txtHinte").innerHTML="Pronto!";
}
if (xmlHttp.readyState==4)
{
document.getElementById("txtHinte").innerHTML=xmlHttp.responseText;
}
}

function stateChangedc(){
if (xmlHttp.readyState==0)
{
document.getElementById("segmentos").innerHTML="Enviando requisição...";
}
if (xmlHttp.readyState==1)
{
document.getElementById("segmentos").innerHTML=imagem;
}
if (xmlHttp.readyState==2)
{
document.getElementById("segmentos").innerHTML="Carregado!";
}
if (xmlHttp.readyState==3)
{
document.getElementById("segmentos").innerHTML="Pronto!";
}
if (xmlHttp.readyState==4)
{
document.getElementById("segmentos").innerHTML=xmlHttp.responseText;
}
}

function stateChangedd(){
if (xmlHttp.readyState==0)
{
document.getElementById("outrocampo").innerHTML="Enviando requisição...";
}
if (xmlHttp.readyState==1)
{
document.getElementById("outrocampo").innerHTML=imagem;
}
if (xmlHttp.readyState==2)
{
document.getElementById("outrocampo").innerHTML="Carregado!";
}
if (xmlHttp.readyState==3)
{
document.getElementById("outrocampo").innerHTML="Pronto!";
}
if (xmlHttp.readyState==4)
{
document.getElementById("outrocampo").innerHTML=xmlHttp.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
