// Start Class Ajax
function AjaxRequest()
{
 this.Http = null;
}
AjaxRequest.prototype.Init = function()
{
 if(window.ActiveXObject)
 {
  try
  {
   this.Http = new ActiveXObject("Microsoft.XMLHTTP");
   return true;
  }
  catch (e)
  {
   return false;
  }
 }
 else
 {
  try
  {
   this.Http = new XMLHttpRequest();
   return true;
  }
  catch (e)
  {
   return false;
  }
 }
}
AjaxRequest.prototype.Request = function(Url, Method, Value)
{
 if(!this.Http)
 {
  this.Init();
 }
 if(!this.StateNotReady())
 {
  this.Http.open(Method, Url, true);
  if(Method == 'GET')
  {
   this.Http.send(null);
  }
  else
  {
   this.Http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
   this.Http.setRequestHeader('Content-length', Value.length);
   this.Http.setRequestHeader('Connection', 'close');
   this.Http.send(Value);
  }
 }
}
AjaxRequest.prototype.StateNotReady = function()
{
 return (this.Http.readyState && (this.Http.readyState < 4));
}
AjaxRequest.prototype.StateReady = function()
{
 return (this.Http.readyState == 4 && this.Http.status == 200) ? true : false;
}
AjaxRequest.prototype.StateChange = function( DoFunction )
{
 if(!this.Http)
 {
  this.Init();
 }
 if(typeof(DoFunction) == 'function')
 {
  this.Http.onreadystatechange = DoFunction;
 }
}
AjaxRequest.prototype.ParseXML = function(TagName)
{
 if(!this.Http)
 {
  this.Init();
 }
 var xml=this.Http.responseXML.documentElement.getElementsByTagName(TagName);
 var _Return = new Array();
 for(i=0; i<xml.length; i++)
  _Return[i] = xml.item(i).firstChild.data;
 return _Return;
}
<!-- End Class -->

