function getHTTPObject() 
{ 
   var xmlhttp;

   if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
   { 
      try 
      { 
         xmlhttp = new XMLHttpRequest(); 
      } 
      catch (e) 
      { 
         xmlhttp = false; 
      } 
   }
   else
   {
      try 
      { 
         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } 
      catch (e) 
      { 
         xmlhttp = false; 
      } 
   }
   return xmlhttp; 
}


// XMLHttp send POST request
function XmlHttpPOST(xmlhttp, url, data, responseFunction, failureFunction)
{
   try
   {
      xmlhttp.open("POST", url, true);
      xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
      xmlhttp.onreadystatechange = responseFunction;
      xmlhttp.send(data);
   }
   catch (ex) 
   {
      failureFunction;
   }
}