var ajax = new Object();

ajax.has_xml_http = false;
ajax.xml_http     = null;
ajax.result_cache = new Object();

/****************************************************************************************/
ajax.getXmlHttpObject = function()
{
	var obj = null;

	//get xml object for IE
	try
	{
		obj = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			obj = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e)
		{
			obj = null;
		}
	}

	//get XML object for mozilla
	if (!obj && typeof XMLHttpRequest != "undefined")
	{
		obj = new XMLHttpRequest();
	}

	return obj;
};
ajax.has_xml_http = ajax.getXmlHttpObject() ? true : false;

/****************************************************************************************/
ajax.cacheResults = function(key, value)
{
	ajax.result_cache[key] = value;
};

/****************************************************************************************/
ajax.throwError = function(s)
{
	alert(s);
};

/****************************************************************************************/
ajax.sendRequest = function(url, method, responseFunction)
{
	if (ajax.xml_http && ajax.xml_http.readyState != 0)
	{
		ajax.xml_http.abort()
	}
	ajax.xml_http = ajax.getXmlHttpObject();

	if (ajax.xml_http)
	{
		ajax.xml_http.onreadystatechange = responseFunction;
		ajax.xml_http.open(method, url, true);
		ajax.xml_http.send(null);
	}
};