function HTTP()
{
	this.toString = function() { return "HTTP"; }

	this.status = function(_status)
	{
		switch(_status)
		{
		case 200:
			return "HTML";
			break;
		case 0:
			return "success";
			break;
		case 404:
			return "File not found.";
			break;
		default:
			return "HTTP Status: " + _status;
		}
	}
}

function AJAX()
{
	this.toString = function() { return "AJAX"; }
	this.http = new HTTP();
	this.id = '';

	this.makeRequest = function(_method, _url, _callbackMethod, _id)
	{
	    this.id = _id;
		this.request = (window.XMLHttpRequest)? new XMLHttpRequest(): new ActiveXObject("MSXML2.XMLHTTP");
		this.request.onreadystatechange = _callbackMethod;
		this.request.open(_method, _url, true);
		this.request.send(_url);
	}
	
	this.checkReadyState = function(_id, _1, _2, _3)
	{
		switch(this.request.readyState)
		{
		case 1:
			if(_id) document.getElementById(_id).innerHTML = _1;
			break;
		case 2:
			if(_id) document.getElementById(_id).innerHTML = _2;
			break;
		case 3:
			if(_id) document.getElementById(_id).innerHTML = _3;
			break;
		case 4:
			return this.http.status(this.request.status);
		}
	}
}
