function AjaxFramework()
{
	var protocol = null;
	var handler = null;
	var response = null;
	var parent = this;

	try
	{
		protocol = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			protocol = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(ex)
		{
			protocol = null;
		}
	}
	
	if (protocol == null && typeof XMLHttpRequest != "undefined")
	{
		protocol = new XMLHttpRequest();
	}
	
	if (protocol == null)
	{
		alert("Error: Unable to initiate AJAX XML Http Request object.");
	}
	

	this.sendRequest = function(requestUrl)
	{
		if (protocol != null)
		{
			protocol.onreadystatechange = callback; 
			protocol.open("GET", requestUrl, true);
			protocol.send(null);
		}
	}

	function callback()
	{
		if (protocol.readyState == 4)
		{
			if (protocol.status == 200)
			{
				parent.response = protocol.responseText;
				
				if (parent.response != null)
				{
					parent.response = parent.response.replace("\r\n", "");
					parent.response = parent.response.replace("\r\n\r\n", "");
					
					eval(handler + "();");
				}
				else
				{
					alert("There was a problem receiving data: " + protocol.statusText);
				}
			}
		}
	}
	
	this.setCallback = function (handle)
	{
		if (handle == "callback")
		{
			alert("Warning: callback is a reserved function name.");
		}
		
		handler = handle;
	}
}
