function ajaxClass()
{
	this.xmlHttp;
	this.requestAction;
	this.requestId;
	this.targetId;
	
	try { this.xmlHttp = new XMLHttpRequest(); }
	catch (e) { try { this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { try { this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch (e) { alert("Your browser does not support AJAX!"); return; }	} }
	
	var oThis = this;
	this.xmlHttp.onreadystatechange = function()
	{ oThis.myreadystate(); };
}

with (ajaxClass)
{
	prototype.getResult = function(action,value,target)
	{
		requestAction = action;
		requestValue = value;
		targetId = gDoc(target);
	    this.xmlHttp_Get("ajax.inc.php?action=" + requestAction + "&value=" + requestValue);
	}
	
	prototype.xmlHttp_Get = function(url)
	{
	    var requestURL = window.document.location.toString();
	    requestURL = requestURL.substring(0, requestURL.lastIndexOf("/") + 1);

	    this.xmlHttp.open('GET', requestURL + url, true);
	    this.xmlHttp.send(null);
	}
	
	prototype.myreadystate = function()
	{
		targetId.innerHTML = '<div class="ajaxLoading">&nbsp;</div>';
		
		if(this.xmlHttp.readyState == 4 || this.xmlHttp.readyState == "complete")
			targetId.innerHTML = this.xmlHttp.responseText;
	}
}
