var xmlHttp;
var aux;
var aux_tipo_relacao;



// função para as list box
function pesquisa_showitem(str,idioma,modelo,tipo_pesquisa)
{



if (tipo_pesquisa==null){
	tipo_pesquisa=2
}
	
	
	
if (str!=0){
    
	aux="pesquisa" 
	document.getElementById(aux).innerHTML="<img src='/web1/zp/tpl1/imagens/loader.gif' border=0>"	
	
	xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
      {
      alert ("Your browser does not support AJAX!");
      return;
      }  

    var url="/web1/zp/tpl1/id1/automoveis/pesquisa/listar_marcas.asp";
    url=url+"?P_cod_marca="+str+"&P_idioma="+idioma+"&P_cod_modelo=" + modelo + "&P_tipo_pesquisa=" + tipo_pesquisa;
    url=url+"&sid="+Math.random();
    
    xmlHttp.onreadystatechange=stateChanged;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    }
 else{  
   // document.getElementById("P_cod_modelo_pesquisa").disabled=true;  
 }
}
// coloca dentro do div o conteudo
function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{

document.getElementById(aux).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;
}
 






