function xmlhttprequest ()
{
	this.url = null;
	this.requestmethod = "get";
	this.callback = null;
	this.getParams = new Array ();
	this.postdata = null;
	this.headers = new Array ();
	this.addGet = function (name, value)
	{
		this.getParams [this.getParams.length] = new Array (name, value);
	}
	this.addHeader = function (name, value)
	{
		this.headers [this.headers.length] = new Array (name, value);
	}
	this.send = function ()
	{
		if (window.XMLHttpRequest)
		{
			var ajax = new XMLHttpRequest();
		}
		else if (window.ActiveXObject)
		{
			var ajax = new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		var _callback = this.callback;
		
		ajax.onreadystatechange = function ()
															{
																if (ajax.readyState == 4)
																{
																	if (_callback != null) _callback (ajax.responseText);
																	window.setTimeout ("ajax = null;", 10);
																}
															};
		
		for (i = 0; i != this.getParams.length; i++)
		{
			this.url += ((i == 0 ? "?" : "&") + this.getParams [i] [0] + (this.getParams [i] [1] == null ? "" : "=" + encodeURIComponent (this.getParams [i] [1])));
		}
		
		ajax.open (this.requestmethod.toLowerCase (), this.url, true);
		for (i = 0; i != this.headers.length; i++) ajax.setRequestHeader (this.headers [i] [0], this.headers [i] [1]);
		if (this.requestmethod.toLowerCase () == "post") ajax.setRequestHeader ("Content-Type", "multipart/form-data");
		ajax.send (this.postdata);
	}
}