/*
	The following two functions are helper infrastructure to 
	craete a XMLHTTPRequest and register a listner callback function
*/
function newXMLHttpRequest()
{
	var xmlreq = false;
	
	if (window.XMLHttpRequest)
	{
		xmlreq = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject)
	{
    // Try ActiveX
		try 
		{ 
			xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e1)
		{ 
			// first method failed 
			try
			{
				xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e2)
			{
				 // both methods failed 
			} 
		}
 	}
  
	return xmlreq;
} 

/*
*/
function getReadyStateHandler(request, responseXmlHandler) 
{
	return function () 
	{
		if (request.readyState == 4)
		{
			if (request.status == 200)
			{
				responseXmlHandler(request.responseXML);
			} 
			else 
			{
				//alert("error: " + request.status);
			}
  	}
 	}
}