var xmlHttp

function showHintEdo(destinotipoid,ctlName,ciudadname, mismoval)
{
document.getElementById(ctlName).innerHTML="";
document.getElementById("div_ciudad").innerHTML="";
destinotipoid = destinotipoid.value;

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="getestado.php";
url=url+"?q1="+destinotipoid;
url=url+"&q2="+ciudadname;
if(mismoval > 0){
	url=url+"&q3="+mismoval;
}
url=url+"&sid="+Math.random();
//xmlHttp.onreadystatechange=stateChanged;

xmlHttp.onreadystatechange=function(){
     if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
            document.getElementById(ctlName).innerHTML=xmlHttp.responseText;
        }
     };

xmlHttp.open("GET",url,true);
xmlHttp.send(null);

} 


function showHint(estadoid,ctlName,ciudadname, mismoval)
{
document.getElementById(ctlName).innerHTML="";
estadoid = estadoid.value;

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="getciudad.php";
url=url+"?q1="+estadoid;
url=url+"&q2="+ciudadname;

xsec = document.form1.x_directorio_destino_tipo_id.value;

if(xsec > 0){
	url=url+"&q3="+xsec;
}else{
	url=url+"&q3=0";	
}
url=url+"&sid="+Math.random();
//xmlHttp.onreadystatechange=stateChanged;

xmlHttp.onreadystatechange=function(){
     if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
            document.getElementById(ctlName).innerHTML=xmlHttp.responseText;
        }
     };

xmlHttp.open("GET",url,true);
xmlHttp.send(null);

} 


function proveedorHint(directoriotipo,ctlName)
{
document.getElementById(ctlName).innerHTML="";
directoriotipo = directoriotipo.value;


if(directoriotipo == 2){
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	
	var url="getproveedortipo.php";
	url=url+"?sid="+Math.random();
	//xmlHttp.onreadystatechange=stateChanged;
	
	xmlHttp.onreadystatechange=function(){
		 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
				document.getElementById(ctlName).innerHTML=xmlHttp.responseText;
				document.getElementById("div_prov_tit").innerHTML="Tipo de servicio:";				
				
			}
		 };
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}else{
	document.getElementById(ctlName).innerHTML="";
	document.getElementById("div_prov_tit").innerHTML="";				
	
}

} 


/*
function stateChanged() 
{ 

if (xmlHttp.readyState==4)
{ 
		document.getElementById("txtHint1").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;
}

