function GetXmlHttpObject(handler)
{
   var objXMLHttp=null
   if (window.XMLHttpRequest)
   {
       objXMLHttp=new XMLHttpRequest()
   }
   else if (window.ActiveXObject)
   {
       objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
   }
   return objXMLHttp
}

function stateChanged()
{
   if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   {
//           document.getElementById("calendario_hp").innerHTML= xmlHttp.responseText;
           $("#calendario_hp").html(xmlHttp.responseText);
   }
   else {
           //alert(xmlHttp.status);
   }
}

// Will populate data based on input
function htmlData(url, qStr)
{
   if (url.length==0)
   {
       document.getElementById("calendario_hp").innerHTML="";
       return;
   }
   xmlHttp=GetXmlHttpObject()
   if (xmlHttp==null)
   {
       alert ("Browser does not support HTTP Request");
       return;
   }

   url=url+"?"+qStr;
   url=url+"&sid="+Math.random();
   xmlHttp.onreadystatechange=stateChanged;
   xmlHttp.open("GET",url,true) ;
   xmlHttp.send(null);
}

function stateChangedInterno()
{
   if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   {
//           document.getElementById("calendario_hp").innerHTML= xmlHttp.responseText;
           $("#calendario_interno").html(xmlHttp.responseText);
   }
   else {
           //alert(xmlHttp.status);
   }
}

// Will populate data based on input
function htmlDataInterno(url, qStr)
{
   if (url.length==0)
   {
       document.getElementById("calendario_interno").innerHTML="";
       return;
   }
   xmlHttp=GetXmlHttpObject()
   if (xmlHttp==null)
   {
       alert ("Browser does not support HTTP Request");
       return;
   }

   url=url+"?"+qStr;
   url=url+"&sid="+Math.random();
   xmlHttp.onreadystatechange=stateChangedInterno;
   xmlHttp.open("GET",url,true) ;
   xmlHttp.send(null);
}

