function async(url,fn)
{
//	alert("Get: " + url);

	// Now copy the contents of that url into this document
	var req = false;
	
	// For Safari, Firefox, and other non-MS browsers
	if (window.XMLHttpRequest) 
	{
		try 
		{
			req = new XMLHttpRequest();
		} 
		catch (e) 
		{
			req = false;
		}
	} 
	else if (window.ActiveXObject) 
	{
		// For Internet Explorer on Windows
		try 
		{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try 
			{
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) 
			{
				alert("async exception: Error name: " + e);
				req = false;
			}
		}
	}

	if (req) 
	{
		try
		{
//alert("set callback");
			// Set the callback fn
			req.onreadystatechange = function()
			{
//				alert(req.readyState + ' CALLED');
				if(req.readyState != 4)
					return;
//				alert(req.readyState + ' PROCESSING');

				// Call the main function			
//alert("MAKE CALLBACK: " + req.responseText);

				fn(req);
//alert("CALLBACK COMPLETE");
			}
		 
//alert("make call");
		 	// Make the async call
			req.open('GET', url, true);
			req.send(null)
		}
		catch(e)
		{
			alert("async exception: Error name: " + e);
		}
	} 
	else 
	{
		alert(
			"Sorry, your browser does not support " +
			"XMLHTTPRequest objects. This page requires " +
			"Internet Explorer 5 or better for Windows, " +
			"or Firefox for any system, or Safari. Other " +
			"compatible browsers may also exist."
		);
	}
	
	return req;
}

function sync(url,fn)
{
//	alert("Get: " + url);

	// Now copy the contents of that url into this document
	var req = false;
	
	// For Safari, Firefox, and other non-MS browsers
	if (window.XMLHttpRequest) 
	{
		try 
		{
			req = new XMLHttpRequest();
		} 
		catch (e) 
		{
			req = false;
		}
	} 
	else if (window.ActiveXObject) 
	{
		// For Internet Explorer on Windows
		try 
		{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try 
			{
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) 
			{
				alert("sync exception: Error name: " + e);
				req = false;
			}
		}
	}

	if (req) 
	{
		try
		{
//alert("make call");
		 	// Make the async call
			req.open('GET', url, false);
			req.send(null);
		}
		catch(e)
		{
			alert("sync exception: Error name: " + e);
		}
	} 
	else 
	{
		alert(
			"Sorry, your browser does not support " +
			"XMLHTTPRequest objects. This page requires " +
			"Internet Explorer 5 or better for Windows, " +
			"or Firefox for any system, or Safari. Other " +
			"compatible browsers may also exist."
		);
	}
	
	return req;
}

function stringToBool(str)
{
	str = str.toLowerCase();
	if(str=="true")
		return true;
	else
		return false;
}