var xmlHttp

function showHint(str){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url=str;
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-Type", "text/html; charset=iso-8859-1");
xmlHttp.send(null);
} 


function showHint4(arquivo){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null) {  alert ("Your browser does not support AJAX!");  
   return;
  } 
 var url=arquivo;
 url=url+"&q="+arquivo;
 url=url+"&sid="+Math.random();
 xmlHttp.onreadystatechange=statechang; 
 xmlHttp.open("GET",url,true);
 xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 xmlHttp.setRequestHeader("Content-Type", "text/html; charset=iso-8859-1");
 xmlHttp.send(null);
}

function stateChanged(){
if (xmlHttp.readyState==1){ document.getElementById("hintText").innerHTML="<div align=center>Loading ...</div>";  } 	
if (xmlHttp.readyState==4){ 
if (xmlHttp.status == 200){
document.getElementById("hintText").innerHTML=xmlHttp.responseText; //responseText;
}
}
}


function showHint2(str){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url=str;
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-Type", "text/html; charset=iso-8859-1");
xmlHttp.send(null);
} 

function stateChanged2(){ 
if (xmlHttp.readyState==1){ document.getElementById("hintText2").innerHTML="<div align=center>Loading ...</div>";  } 	
if (xmlHttp.readyState==4){ 
if (xmlHttp.status == 200){
document.getElementById("hintText2").innerHTML=xmlHttp.responseText;
} }
}

function lerId(arquivo) {
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null) {
  alert ("Your browser does not support AJAX!");
  return; } 
var url = arquivo +"?busca="+document.getElementById("id").value;	
 xmlHttp.onreadystatechange=statechang;
 xmlHttp.open("GET",url,true);
 xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 xmlHttp.setRequestHeader("Content-Type", "text/html; charset=iso-8859-1");
 xmlHttp.send(null);
}
 
function statechang(){
if (xmlHttp.readyState==1){ document.getElementById("hintText").innerHTML="<div align=center>Loading ...</div>"; } 	
if (xmlHttp.readyState==4){ 
if (xmlHttp.status == 200){
document.getElementById("hintText").innerHTML=xmlHttp.responseText;}
} }

function statechang2(){
if (xmlHttp.readyState==1){ document.getElementById("hintText2").innerHTML="<div align=center>Loading ...</div>"; } 	
if (xmlHttp.readyState==4){ 
if (xmlHttp.status == 200){
document.getElementById("hintText2").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;
}


function fechajan(){
document.getElementById('progada').style.visibility = "hidden";
}
