/************** Simple XMLHttp Object                    **********
   *************  (c) 2006 Horizon Services Group   **********/
function xhttp()
{
  var xmlhttp, varComplete = false;
  try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
  catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
  catch (e) { try { xmlhttp = new XMLHttpRequest(); }
  catch (e) { xmlhttp = false; }}}
  if (!xmlhttp) return null;
  this.connect = function(strURL, strMethod, strArgs, funcDone)
  {
    if (!xmlhttp) return false;
    varComplete = false;
    strMethod = strMethod.toUpperCase();

    try {
      if (strMethod == "GET")
      {
        xmlhttp.open(strMethod, strURL+"?"+strArgs, true);
        strArgs = "";
      }
      else
      {
        xmlhttp.open(strMethod, strURL, true);
        xmlhttp.setRequestHeader("Method", "POST "+strURL+" HTTP/1.1");
        xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
      }
      xmlhttp.onreadystatechange = function(){
        if (xmlhttp.readyState == 4 && !varComplete)
        {
          varComplete = true;
          funcDone(xmlhttp);
        }};
      xmlhttp.send(strArgs);
    }
    catch(z) { return false; }
    return true;
  };
  return this;
}

