var Ajax = new Object();
Ajax.isUpdating = true;

Ajax.Request = function(method, url, query, callback)
{
	this.isUpdating = true;
	this.callbackMethod = callback;

	try {
		// Firefox, Opera 8.0+, Safari
		this.request=new XMLHttpRequest();
	} catch (e) {
		// Internet Explorer
		try {
			this.request=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				this.request=new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("An Error Occured ");
				return false;
			}
		}
	}
	this.request.onreadystatechange = function() { Ajax.checkReadyState(); };
	if(method.toLowerCase() == 'get') url = url+"?"+query;
	this.request.open(method, url, true);
	this.request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	this.request.send(query);
}
	
Ajax.checkReadyState = function(_id)
{
	this.isUpdating = false;
	this.callbackMethod(this.request.responseText);
}
