function get_by_id(id){return document.getElementById(id);}
function get_req()
{
   var xmlHttp;
   try
   {
      xmlHttp = new XMLHttpRequest();
   }
   catch(e)
   {
      var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
      "MSXML2.XMLHTTP.5.0",
      "MSXML2.XMLHTTP.4.0",
      "MSXML2.XMLHTTP.3.0",
      "MSXML2.XMLHTTP",
      "Microsoft.XMLHTTP");
      for (var i = 0; i < XmlHttpVersions.length && ! xmlHttp;
      i ++ )
      {
         try
         {
            xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
         }
         catch (e)
         {
         }
      }
   }
   if ( ! xmlHttp)
   alert("Error creating the XMLHttpRequest object.");
   else
   return xmlHttp;
}
function returnData(URL)
{
xmlReq=get_req();
xmlReq.onreadystatechange = function()
{
   if(xmlReq.readyState == 4)
   {

  return xmlReq.responseText;
   }
}
xmlReq.open ('GET', URL, true);
xmlReq.send (null);

}
function loadData(URL, to_div)
{
// alert(URL);
xmlReq=get_req();
xmlReq.onreadystatechange = function()
{
   if(xmlReq.readyState == 4)
   {
   
   document.getElementById(to_div).innerHTML = "";
      document.getElementById(to_div).innerHTML = xmlReq.responseText;
   }
}

xmlReq.open ('GET', URL, true);
xmlReq.send (null);

}
function postData(URL, to_div,data)
{
xmlReq=get_req();
xmlReq.onreadystatechange = function()
{
   if(xmlReq.readyState == 4)
   {
   // alert(xmlReq.responseText);
      document.getElementById(to_div).innerHTML = "";
      document.getElementById(to_div).innerHTML = xmlReq.responseText;
      
   }
}

xmlReq.open('post', URL, true);
var content_type = 'application/x-www-form-urlencoded';             
xmlReq.setRequestHeader('Content-Type', content_type);
xmlReq.send(data);
}
function send_req(URL)
{

xmlReq=get_req();
xmlReq.open ('GET', URL, true);
xmlReq.send (null);
}

