/*
	Universal AJAX Script (5.8.2008)
	-- Maximum browser compatibility
	-- Minimum built-in exception handling
	-- Safely allows unlimited simultaneous requests
*/







////////////////////////////////////////////////////////////////////////////////
//     DO NOT EDIT BELOW THIS LINE!          DO NOT EDIT BELOW THIS LINE!     //
////////////////////////////////////////////////////////////////////////////////

function processChange(response)
{
// Response has been loaded.
//	try
//	{
		with (response)
		{
			if (readyState == 4 || readyState == 'complete')
			{
			// Response has no errors.
				if (status == 200)
				{
					processResponse(response);
				}
				else
				{
					alert('Problem retrieving data: ' + statusText);
				}
			}
		}
//	}
//	catch (exception)
//	{
//		alert('Exception: ' + exception.description);
//	}
}

function processRequest(mode, url, query, asXML)
{
	var request;
// Object for Internet Explorer 7 and up
	if (window.XMLHttpRequest)
	{
		request = new XMLHttpRequest();
	// MIME type must be overridden for XML response under Firefox 1.5 and up
		if (asXML)
		{
			with (request)
			{
				if (overrideMimeType)
				{
					overrideMimeType('text/xml');
				}
			}
		}
	}
// Object for Internet Explorer 5.5 to 6
	else if (window.ActiveXObject)
	{
		try
		{
			request = new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch (exception)
		{
			try
			{
				request = new ActiveXObject('Microsoft.XMLHTTP');
			}
			catch (exception)
			{
				alert('Exception: ' + exception.description);
			}
		}
	}
	if (request)
	{
		with (request)
		{
		// Set HTTP request callback function. Use anonymous function to prevent race condition and allow simultaneous requests.
			onreadystatechange = function() { processChange(request); };
		// Specific headers must be set for code-generated XML under Internet Explorer.
			if (asXML)
			{
				setRequestHeader('Content-Type', 'application/xml');
				setRequestHeader('Cache-Control', 'no-cache');
			}
			if (mode == 'POST')
			{
				setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				open(mode, url, true);
				send(query);
			}
			else
			{
			// Open in the given mode a file asynchronously.
			// To prevent caching of results to string queries, append to query: '&sid=' + Math.random();
				if (query)
				{
					open(mode, url + '?' + query + '&sid=' + Math.random(), true);
alert(url + '?' + query + '&sid=' + Math.random());
				}
				else
				{
					open(mode, url, true);
				}
				if (window.ActiveXObject)
				{
				// don't send null for GET with ActiveX
					send();
				}
				else
				{
				// send null for GET with native object
					send(null);
				}
			}
		}
	}
	else
	{
		alert('Browser does not support AJAX.');
	}
}