
function AjaxSender()
{
	this.httpObj=null;
	this.getHTTPObject=function()
	{ 
		if (typeof XMLHttpRequest != 'undefined') 
		{ 
			return new XMLHttpRequest(); 
		}
		try 
		{ return new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) 
		{ 
			try { return new ActiveXObject("Microsoft.XMLHTTP"); }
		 		catch (e) {} 
		} 
		 return false;
	} 
	
	this.SendAjax=function(method, postParam, url, onStateChange)
	{
		
		this.httpObj = this.getHTTPObject();
		if (!this.httpObj)
			return false;
		this.httpObj.open(method, url, true);
		this.httpObj.onreadystatechange = onStateChange;
		this.httpObj.setRequestHeader("x-requested-with", "XMLHttlRequest");
		this.httpObj.setRequestHeader("content-type", "application/x-www-form-urlencoded");
		if (this.httpObj.overrideMimeType) //fix some mozila bug
		{
			this.httpObj.setRequestHeader("connection", "close");
		}
		this.httpObj.send(postParam);
	}
}

