/** This is the global XHR (XML Http Request) object.
	* 
	* The advantage of only having one object is that it
	* gets recycled effectively by the browser. 
	*
	*/
var xmlHttp = null;

// in milliseconds
var ajax_request_timeout_in_ms = 3000;
var ajax_request_typing_delay_in_ms = 250;
var ajax_request_timeout_timer = undefined;

// this is relative to the current folder
var baseaddr = ".";

/** create_cross_browser_xmlHttp_object()
	*
	* This function should not be called directlym
	* unless you need more than 1 simultaneous request.
	*
	* The "global" instance of browser object is "xmlHttp".
	*
	*/
function create_cross_browser_xmlHttp_object()
{
	var xmlHttp;
	
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	}
	catch( e )
	{
		// Internet Explorer
		try
		{
			xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP" );
		}
		catch( e )
		{
			try
			{
				xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
			}
			catch( e )
			{
				throw( "Your browser does not support AJAX!" );
			}
		}
	}
	
	return xmlHttp;
}

try
{
	xmlHttp = create_cross_browser_xmlHttp_object();
}
catch( e )
{
	if ( e instanceof String )
	{
		alert( e );
	}

	alert( "I cannot create the xmlHttp transport object." );
}		
