function GetXmlHttpObject2(handler)
{
   var objXMLHttp2=null
   if (window.XMLHttpRequest)
   {
       objXMLHttp2=new XMLHttpRequest()
   }
   else if (window.ActiveXObject)
   {
       objXMLHttp2=new ActiveXObject("Microsoft.XMLHTTP")
   }
   return objXMLHttp2
}

function stateChanged2(proceso, caja)
{
   if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
   {
//    document.getElementById(caja).innerHTML= xmlHttp.responseText;
	document.getElementById(caja).innerHTML=proceso
   }
   else {
     //alert(xmlHttp.status);
	 document.getElementById(caja).innerHTML = '<div style="width:16px; margin:auto"><img src="images/ajax-loader.gif" width="16" height="16"></div>';
   }
}

// Will populate data based on input
function htmlData2(url, caja, qStr)
{
   if (url.length==0)
   {
       document.getElementById(caja).innerHTML="";
       return;
   }
   xmlHttp2=GetXmlHttpObject2()
   if (xmlHttp2==null)
   {
       alert ("Su navegador no soporta este tipo de procedimiento, por favor actualice el mismo.");
       return;
   }
   
   url=url+"?"+qStr;
   url=url+"&sid="+Math.random();
//   xmlHttp.onreadystatechange=stateChanged;
   xmlHttp2.onreadystatechange=function() { stateChanged2( xmlHttp2.responseText, caja); }   
   
   xmlHttp2.open("GET",url,true) ;
   xmlHttp2.send(null);
}
