function ajax()
{
	this.XMLHttp = this.createXMLHttpRequest();
	//this.XMLHttp
}
ajax.prototype.ver = '';
ajax.prototype.createXMLHttpRequest=function(){
	if(window.XMLHttpRequest) 
	{
		this.ver = 'XMLHttpRequest';
		return new XMLHttpRequest();
	}else{
		try
		{
			this.ver = 'MSXML2.XMLHTTP.4.0';
			return new ActiveXObject('MSXML2.XMLHTTP.4.0');
		}catch(e){
			try{
				this.ver = 'MSXML2.XMLHTTP.3.0';
				return new ActiveXObject('MSXML2.XMLHTTP.3.0');
			}catch(e){	
				try{
					this.ver = 'MSXML2.XMLHTTP.2.6';
					return new ActiveXObject('MSXML2.XMLHTTP.2.6');
				}catch(e){
					try{
						this.ver = 'MSXML2.XMLHTTP';
						return new ActiveXObject('MSXML2.XMLHTTP');
					}catch(e){
						try{
							this.ver = 'Microsoft.XMLHTTP';
							return new ActiveXObject('Microsoft.XMLHTTP');
						}catch(e){
							return null;
						}
					}
				}
			}
		}
	}
}

ajax.prototype.ResponseText = '';

ajax.prototype.OnStateChange = function()
{
	try
	{
		if (this.XMLHttp.readyState==4)
		{
			var re = this.XMLHttp.responseText;
			this.ResponseText = unescape(escape(re));
			//alert(this.ResponseText);
		}
	}catch(e)
	{
		//alert('error');
	}
}

ajax.prototype.doPostRequest = function(strUrl,strData)
{
	if (this.XMLHttp)
	{
		//alert(this.ver);
		try{
			if (strUrl.indexOf('?')>0)
			{
				strUrl = strUrl + '&' + (new Date()).toString();
			}
			else
			{
				strUrl = strUrl	+ '?' + (new Date()).toString();
			}
			this.XMLHttp.open("POST",strUrl,false);
			this.XMLHttp.setRequestHeader("Content-Type", "charset=utf-8");
			this.XMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			this.XMLHttp.send(strData);
			this.XMLHttp.onreadystatechange = this.OnStateChange();
		}catch(e){
			//alert('error!');
		}
	}else
	{
		return;	
	}
}


ajax.prototype.doGetRequest = function(strUrl)
{
	if (this.XMLHttp)
	{
		//alert(this.ver);
		try{
			if (strUrl.indexOf('?')>0)
			{
				strUrl = strUrl + '&' + (new Date()).toString();
			}
			else
			{
				strUrl = strUrl	+ '?' + (new Date()).toString();
			}
			this.XMLHttp.open("GET",strUrl,false);
			this.XMLHttp.send(null);
			this.XMLHttp.onreadystatechange = this.OnStateChange();
		}catch(e){
			//alert('error!');
		}
	}
}


