var ajax = function()
{
	this.xmlHttp = false;
	this.url = "";
	this.updateFun = null;

	this.Create = function(url, updateFun)
	{
		try{
			this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e2){
				this.xmlHttp = false;
			}
		}
		if(!this.xmlHttp&&typeof XMLHttpRequest != 'undefined'){
			this.xmlHttp = new XMLHttpRequest();
		}
		
		this.url = url;
		this.updateFun = updateFun;
	}

	this.Open = function()
	{
		this.xmlHttp.open("GET", this.url, true);
		this.xmlHttp.onreadystatechange = this.updateFun;
		this.xmlHttp.send(null);
	}

	this.GetData = function()
	{
		if(this.xmlHttp.readyState == 4){
			return this.xmlHttp.responseText;
		}
		return null;
	}
}
