/* Ehsan Darrudi
Iran National Science Foundation
www.insf.org
(c) 2005-2010

Some of the codes have been borrowed from tutorial websites. 
In this case the name of the original author and/or the 
copyright notice proceed the code. */

// General Functions ------------------------------------------------------------------

var http = null;

if(navigator.appName == "Microsoft Internet Explorer") 
{
	 http = new ActiveXObject("Microsoft.XMLHTTP");
} 
else 
{
	http = new XMLHttpRequest();
} 

function AjaxGet(uri, callback) 
{
	if (!http)
		return "";

	http.abort();
	
	http.open("GET", uri, true);
	http.onreadystatechange = function()
	{
		if (http.readyState == 4)
		{
			if (http.status == 200)
				callback(http.responseText);
			else
				callback("");
		}
	}
	
	http.send(null);
}

//---------------------------------------------------------------------------------------------------------