
function httpRequest() {

	this.http = null;
}

httpRequest.prototype.sendRequest = function(method,url,callback,params) {
	this.http = null;
	
	if(window.XMLHttpRequest)
	{
		this.http = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		this.http = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	if(this.http != null)
	{
		var httpptr = this.http;
		
		if(method == "GET")
		{
			httpptr.open("GET",url,true);
			httpptr.onreadystatechange = callback;
			httpptr.send(null);
		}
		else if(method == "POST")
		{
			httpptr.open("POST",url,true);
			httpptr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
			httpptr.setRequestHeader("Content-length",params.length);
			httpptr.setRequestHeader("Connection","close");
			httpptr.onreadystatechange = callback;
			httpptr.send(params);
		}
	}
}

