function AjaxRequest(url,target,initFunc,compFunc,arguments)
{
	var tempString = '';

	if(typeof url == 'string')
		this._url = url;
	else
		return false;
	this._target = target;
	if(typeof initFunc == 'function')
		this._initFunc = initFunc;
	else
		this._initFunc = null;
	if(typeof compFunc == 'function')
		this._compFunc = compFunc;
	else
		this._compFunc = null;
	if(typeof arguments == 'object' && arguments != null)
	{
		for(var i in arguments)
			tempString += i + '=' + arguments[i] + '&';
		if(tempString[tempString.length - 1] == '&')
			tempString = tempString.substr(0,tempString.length - 2);
		this._arguments = tempString;
	} else {
		this._arguments = arguments;
	}
	this._ajaxFunction.call(this);
	
}
AjaxRequest.prototype._url;
AjaxRequest.prototype._target;
AjaxRequest.prototype._initFunc;
AjaxRequest.prototype._compFunc;
AjaxRequest.prototype._arguments;
AjaxRequest.prototype._response;
AjaxRequest.prototype._xml;

AjaxRequest.prototype._ajaxFunction = function()
{
	var xmlHttp;
	var requestUrl;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	} catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	function stateChange ()
	{
		if(xmlHttp.readyState==2 && this._initFunc != null)
			this._initFunc.call(this);
		if(xmlHttp.readyState==4 && this._compFunc != null)
		{
			this._response = xmlHttp.responseText;
			this._xml = xmlHttp.responseXML;
			this._compFunc.call(this);
		}
	}
	function createBoundedWrapper (object, method) {
		return function() {
			return method.apply(object, arguments);
		};
	}
	stateChangeBound = createBoundedWrapper(this,stateChange);

	xmlHttp.onreadystatechange = stateChangeBound;

	requestUrl = this._url;
	if(this._arguments != null)
		requestUrl += '?' + this._arguments;
	xmlHttp.open("GET",requestUrl,true);
	xmlHttp.send(null);
}
