function AJAXRequestClass(sURL, sMethod){

	this.Init();
	this.SetURL(sURL);
	this.SetMethod(sMethod);
}

AJAXRequestClass.prototype.Init=function(){
	this.oXHR=null;
	this.fCallback=null;
	this.sURL='';
	this.sMethod='GET';
	this.sParams=null;
	
	// Mozilla/Safari
	if(window.XMLHttpRequest){
		this.oXHR = new XMLHttpRequest();
		if(this.oXHR.overrideMimeType)
			this.oXHR.overrideMimeType('text/xml');
	}
	// IE
	else if(window.ActiveXObject){
		this.oXHR = new ActiveXObject("Microsoft.XMLHTTP");
	}
}

AJAXRequestClass.prototype.SetURL=function(sURL){
	this.sURL=sURL;
}

AJAXRequestClass.prototype.SetMethod=function(sMethod){
	this.sMethod=(sMethod) ? sMethod : 'GET';
}

AJAXRequestClass.prototype.SetParams=function(oParams){
	if(oParams){
		this.sParams='';
		for(var prop in oParams)
			this.sParams+=prop + '=' + escape(oParams[prop]) + '&';
		this.sParams = (this.sParams) ? this.sParams.substr(0, this.sParams.length - 1) : null;
	}
	else{
		this.sParams=null;
	}
}

AJAXRequestClass.prototype.SetCallback=function(fCallback){
	this.fCallback=fCallback;
}

AJAXRequestClass.prototype.Load=function(sURL, sMethod, oParams, fCallback){
	if(sURL)
		this.SetURL(sURL);
	if(sMethod)
		this.SetMethod(sMethod);
	if(oParams)
		this.SetParams(oParams);
	if(fCallback)
		this.SetCallback(fCallback);
	
	
	this.oXHR.open(this.sMethod, this.sURL, true);
	
	var _XHR = this.oXHR;
	var _me = this;
	this.oXHR.onreadystatechange=function(){
		if(_XHR.readyState == 4){
			if(_me.fCallback)
				_me.fCallback(_XHR);
			else
				alert('Document successfully loaded');
		}
	}
	
	if(this.sParams)
		this.oXHR.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
	this.oXHR.send(this.sParams);
}