var xmlHttp;

function stateChanged() 
{ 
	//alert('stateChanged called');

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		if(xmlHttp.responseText.length)
		{
			//Action if there is a xmlHttp.responseText via AJAX
			ifAJAX();
		}
		else
		{
			//Action if there is NOT a xmlHttp.responseText via AJAX
			elseAJAX();
		}
	}
}

function GetXmlHttpObject()
{
	var xmlHttp=null;

	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		//Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}

	return xmlHttp;
}
