 
 var XmlHttp;
 
 function XmlHttpRequest (Method, Url)
  {
   this.SetRequestFunction = SetRequestFunction;
   this.Send               = Send;
   this.State              = State;
   this.Status             = Status;
   this.Response           = Response;
   this.ResponseXML        = ResponseXML;
   this.ShowError          = ShowError;
   this.CloseC             = CloseC;
   
   this.XmlHttp = false;

   /*@cc_on @*/
   /*@if (@_jscript_version >= 5)
   try
    {
     this.XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
   catch (e)
    {
     try
      {
       this.XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
     catch (e2) { this.XmlHttp = false; }
    }
   @end @*/

   if (!this.XmlHttp && typeof XMLHttpRequest!='undefined')
    {
     this.XmlHttp = new XMLHttpRequest();
    }

   this.Method = Method;
   this.XmlHttp.open(Method, Url, true);
   
   if (this.Method=="POST")
    { 
     this.XmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
    }
  }


 function SetRequestFunction (Func)
  {
   this.XmlHttp.onreadystatechange = Func;
  }


 function Send (Params)
  {
   if (this.Method=="POST")
    { 
     this.XmlHttp.send(Params);
    }
   else
    {
     this.XmlHttp.send(null);
    }
  }


 function State ()
  {
   switch (this.XmlHttp.readyState)
    {
     case 0: return 'uninitialized'; break;
     case 1: return 'loading';       break;
     case 2: return 'loaded';        break;
     case 3: return 'interactive';   break;
     case 4: return 'completed';     break;
    }
  }


 function Response ()
  {
   return this.XmlHttp.responseText;
  }


 function ResponseXML ()
  {
   return this.XmlHttp.responseXML;
  }

 function Status ()
  {
   return this.XmlHttp.status;
  }


 function ShowError ()
  {
   // alert("wefwf");
   // alert(this.XmlHttp.statusText);
  }

 function CloseC ()
  {
   return this.XmlHttp.abort();
  }

	