///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// MudaBusca
function MudaBusca(Pagina,Acao,Id)
{ 

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Seu browser não suporta AJAX!");
  return;
  } 
	x = document.getElementById(Id);

var url=Pagina+"?Acao="+Acao;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_ajax;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function MudaCorBt(Ativo,Inativo1,Inativo2,Inativo3){

 document.getElementById(Ativo).style.background = "#006A9D";
 document.getElementById(Ativo).style.color = "#ffffff";

 document.getElementById(Inativo1).style.background = "none";
 document.getElementById(Inativo1).style.color = "#353535";

 document.getElementById(Inativo2).style.background = "none";
 document.getElementById(Inativo2).style.color = "#353535";

 document.getElementById(Inativo3).style.background = "none";
 document.getElementById(Inativo3).style.color = "#353535";

}



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Tipo Pesquisa
function TipoPesquisa(TipoPesquisa)
{ 

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Seu browser não suporta AJAX!");
  return;
  } 
	x = document.getElementById('BoxPesquisa');
	var Pagina = "Includes/Pesquisa.asp"

var url=Pagina+"?TipoPesquisa="+TipoPesquisa;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_ajax;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//FUNÇÃO stateChanged_ajax
function stateChanged_ajax() 
{ 
if (xmlHttp.readyState==1)
{ 

x.innerHTML="<div style='float:left;width:670px;height:400px;font-size:7pt;text-align:center;'><IMG SRC='IMAGES/LOADING.GIF' Style='float:center;margin-top:60px;'></div>";
}
if (xmlHttp.readyState==4)
{ 

x.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;
};
