var xmlHttp

<!-- Mostrar datos del cliente -->
function mostrarcliente(str)
{ 
if (str.length > 0)
   {            
   var url="cliente.php?id=" + str
   xmlHttp=GetXmlHttpObject(stateChangedcliente)
   xmlHttp.open("GET", url , true)
   xmlHttp.send(null)
   } 
   else
   { 
   document.getElementById("txtHint").innerHTML="Cliente no encontrado"
   } 
} 

function stateChangedcliente() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   { 
   document.getElementById("clienten").innerHTML=xmlHttp.responseText 
   } 
} 

<!-- Mostrar lista de clientes -->
function mostrarclientelista()
{ 
   var url="listaclientes.php" 
   xmlHttp=GetXmlHttpObject(stateChangedLista)
   xmlHttp.open("GET", url , true)
   xmlHttp.send(null)
} 

function stateChangedLista() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   { 
   document.getElementById("clienten").innerHTML=xmlHttp.responseText 
   } 
}


<!-- Mostrar datos del contacto -->
function mostrarcontacto(str)
{ 
if (str.length  > 0)
   {            
   var url="contacto.php?id=" + str + "&cid=" + document.getElementById("cliente").value 
   xmlHttp=GetXmlHttpObject(stateChangedcontacto)
   xmlHttp.open("GET", url , true)
   xmlHttp.send(null)
   } 
   else
   { 
   document.getElementById("contacton").innerHTML="Contacto no encontrado"
   } 
} 

function stateChangedcontacto() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   { 
   document.getElementById("contacton").innerHTML=xmlHttp.responseText 
   } 
} 


<!-- Mostrar lista de contactos -->
function mostrarcontactolista()
{ 
   var url="listacontactos.php?id=" + document.getElementById("cliente").value 
   xmlHttp=GetXmlHttpObject(stateChangedListaC)
   xmlHttp.open("GET", url , true)
   xmlHttp.send(null)
} 

function stateChangedListaC() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   { 
   document.getElementById("contacton").innerHTML=xmlHttp.responseText 
   } 
}




<!-- Mostrar datos del responsable -->
function mostrarresponsable(str)
{ 
	if (str.length  > 0)
   {            
   var url="responsable.php?id=" + str
   xmlHttp=GetXmlHttpObject(stateChangedR)
   xmlHttp.open("GET", url , true)
   xmlHttp.send(null)
   } 
   else
   { 
   document.getElementById("responsablen").innerHTML="Responsable no encontrado"
   } 
} 


<!-- Mostrar lista de responsables -->
function mostrarresponsablelista()
{ 
   var url="listaresponsable.php"
   xmlHttp=GetXmlHttpObject(stateChangedR)
   xmlHttp.open("GET", url , true)
   xmlHttp.send(null)
} 

function stateChangedR() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   { 
   document.getElementById("responsablen").innerHTML=xmlHttp.responseText 
   } 
}


<!-- Mostrar equipo -->
function mostrarequipo(str)
{ 
	if (str.length  > 0)
   {     
   var url="equipo.php?id=" + str
   xmlHttp=GetXmlHttpObject(stateChangedE)
   xmlHttp.open("GET", url , true)
   xmlHttp.send(null)
	}
   else
   { 
   document.getElementById("equipon").innerHTML="Equipo no encontrado en la base de datos"
   } 
} 

function stateChangedE() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   { 
   document.getElementById("equipon").innerHTML=xmlHttp.responseText 
   } 
}

<!-- Mostrar lista de equipo-->
function mostrarlistaequipo(str)
{ 
   var url="listaequipo.php" 
   xmlHttp=GetXmlHttpObject(stateChangedE)
   xmlHttp.open("GET", url , true)
   xmlHttp.send(null)
} 


<!-- Mostrar equipo -->
function mostrarfecha(str)
{ 
   var url="fecha.php?fecha=" + str
   xmlHttp=GetXmlHttpObject(stateChangedF)
   xmlHttp.open("GET", url , true)
   xmlHttp.send(null)
} 

function stateChangedF() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   { 
   document.getElementById("f").innerHTML=xmlHttp.responseText 
   } 
}





<!-- no tocar -->

function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null

if (navigator.userAgent.indexOf("Opera")>=0)
   {
    alert("Este ejemplo no es funcional en OPERA, lo sentimos, le recomendamos use Mozilla Firefox o MS Explorer") 
    return;  
   }
if (navigator.userAgent.indexOf("MSIE")>=0)
   { 
   var strName="Msxml2.XMLHTTP"
   if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
      {
      strName="Microsoft.XMLHTTP"
      } 
   try
      { 
      objXmlHttp=new ActiveXObject(strName)
      objXmlHttp.onreadystatechange=handler 
      return objXmlHttp
      } 
   catch(e)
      { 
      alert("Error. Scripting for ActiveX might be disabled") 
      return 
      } 
    } 
if (navigator.userAgent.indexOf("Mozilla")>=0)
   {
   objXmlHttp=new XMLHttpRequest()
   objXmlHttp.onload=handler
   objXmlHttp.onerror=handler 
   return objXmlHttp
   }
} 