var AJAX = function()
{
	window.ajax = this;
}

AJAX.prototype.post = function(url, input)
{
	var data = '';
	
	for (var i in input)
	{
		data += i + '=' + escape(input[i]) + '&';	
	}

	data = data.slice(0, -1);

	var httpRequest = this.getHTTPObject();

	httpRequest.onreadystatechange = function()
	{
		if (httpRequest.readyState == 4 && httpRequest.status == 200)
		{
			if (window.ajax.onLoad != undefined) window.ajax.onLoad(httpRequest.responseText);
		}
	}

	httpRequest.open('POST', url, true);
	httpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	httpRequest.setRequestHeader('Content-length', data.length);
	httpRequest.setRequestHeader('Connection', 'close');
	httpRequest.send(data);
}

AJAX.prototype.getHTTPObject = function()
{
	return window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
}