var tmpSax = null;
function Sax()
{
  this.url = null;
  this.xmlHttp = null;  
  this.target = null;
}

function Sax(url_)
{
  this.url = url_;
  this.xmlHttp = null;  
  this.target = null;
}

Sax.prototype.HasResponse = function()
{
  return (null != this.xmlHttp && this.xmlHttp.readyState == 4 && this.xmlHttp.status == 200)
}

Sax.prototype.SendRequest = function()
{
  tmpSax = this;
  setTimeout("Sax_SendRequestHelper(null)", 1);	
}

function Sax_SendRequestHelper(sax_)
{
  if (null == sax_)
  {
    var saxTarget = tmpSax;
    tmpSax = null;
    Sax_SendRequestHelper(saxTarget);
    return;
  }

  if (window.XMLHttpRequest)
	{
		sax_.xmlHttp = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		sax_.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}

  if (sax_.xmlHttp)
	{
		sax_.xmlHttp.open("GET", sax_.url, false);
		sax_.xmlHttp.send(null);
		sax_.OnResponse();		
	}
	else
	{
		alert("could not create a request object");
	}
}

Sax.prototype.OnResponse = function()
{  
  if (null != this.target)
  { 
    this.target(this);
  }
}