function AJAXEngine_ReturnText(strURL, strData, strMethod, ReturnMethod, strOtherDataToPassToReturnMethod)
{
	// Only proceed when the correct header is passed and the strReturnDataType is xml or text
	if(strMethod.toLowerCase() == "get" || strMethod.toLowerCase() == "post")
	{
		// Instantiate the object for different clients
		var xmlHTTP = GetHTTPObject();
		
		if(!xmlHTTP)
			return;
		
		// The function defined here handles the AJAX response.  When it gets a readyState of 4 and an HTTP status of 200, it will
		// call the strReturnMethod specified and pass the proper object depending on whether or not the user wants xml or text.
		xmlHTTP.onreadystatechange = function()
		{
			if(xmlHTTP.readyState == 4)
			{
				if(xmlHTTP.status == 200)
				{
					ReturnMethod(xmlHTTP.responseText, strOtherDataToPassToReturnMethod);
					xmlHTTP = null;
				}
				else
				{
					ReturnMethod("Error: " + xmlHTTP.responseText, strOtherDataToPassToReturnMethod);
					xmlHTTP = null;
				}
			}
		}
		
		
		// Change the URL for a GET vs. POST
		if(strMethod.toLowerCase() == "get")
		{
			strURL = strURL + "?" + strData;
			strData = null;
		}
		
		
		xmlHTTP.open(strMethod, strURL, true);
		xmlHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHTTP.setRequestHeader("Accept","message/x-jl-formresult");
		xmlHTTP.send(strData);
	}
}



function GetHTTPObject()
{
	var obj;
	
	try
	{
		obj = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			obj = new ActiveXObject("Msxml2.ServerXMLHTTP");
		}
		catch(E)
		{
			obj = false;
		}
	}
	
	if(!obj && typeof XMLHttpRequest != 'undefined')
	{
		try
		{
			obj = new XMLHttpRequest();
			//alert("Got XMLHttpRequest");
		}
		catch(e)
		{
			obj = false;
		}
	}
	
	return obj;
}
