var xmlHttp = createXmlHttpRequestObject();

function createXmlHttpRequestObject()
	{
	var xmlHttp;
	
	// IE
	if(window.ActiveXObject)
		{
		try
			{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
		catch (e)
			{
			xmlHttp = false;
			}
		
		}
	else
		{
	// other
		try
			{
			xmlHttp = new XMLHttpRequest();
			}
		catch (e)
			{
			xmlHttp = false;
			}
		}
	
	if(!xmlHttp)
		{
		alert("Error creating the XMLHttpRequest object.");
		}
	else
		{
		return xmlHttp;
		}
	}
