/**
 * In The Name of Allah, The Most Gracious, The Most Merciful
 */
/*
function RemoteCheck(Element)
{
	if (divRemote)
		divRemote.innerHTML = "";
	//-----------------------------------------
	URL = "remote.php?Value=" + Element.value;
	return Remote(URL);
}
*/
//------------------------------------------------------------------------------------------------------------
var Result = new Array(), req;
//var Result__ = new Array();
var Params_ = new Array();
function Remote(URL)
{
	//-------------------------------------------------------	Internet Explorer
	try
	{
		req = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			req = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			req = null;
		}
	}
	//-------------------------------------------------------	Mozailla / Safari
	if (!req && typeof(XMLHttpRequest) != "undefined")
	{
		req = new XMLHttpRequest();
	}
	//-------------------------------------------------------
	if (req != null)
	{
		req.onreadystatechange = RemoteChange;
		req.open("GET", URL, false);
		req.send(null);
		return true;
	}
	//-------------------------------------------------------
}
//------------------------------------------------------------------------------------------------------------
function RemoteChange()
{
	if (req.readyState == 4 && req.status == 200)
	{
		if (hidRemote = document.getElementById("hidRemote"))
			hidRemote.value = req.responseText;
		else
		{
			//alert('Response = ' + req.responseText);
			//Result__ = eval(req.responseText);
			Result = eval(req.responseText);
		}
	}
}
// ----------------------------------------------------
function _Remote(URL, _function, Params)
{
	//-------------------------------------------------------	Internet Explorer
	try
	{
		_req = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			_req = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			_req = null;
		}
	}
	//-------------------------------------------------------	Mozailla / Safari
	if (!_req && typeof(XMLHttpRequest) != "undefined")
	{
		_req = new XMLHttpRequest();
	}
	//-------------------------------------------------------
	if (_req != null)
	{
		//_req._params = Params;
		Params_[_function + '_params'] = Params;
		//alert(Params_[_function + '_params']);
		_req.onreadystatechange = eval(_function);
		_req.open("GET", URL, true);
		_req.send(null);
		return true;
	}
	//-------------------------------------------------------
}
//------------------------------------------------------------------------------------------------------------
function _RemoteChange(_function)
{
	if (_req.readyState == 4 && _req.status == 200)
	{
		_function(_req.responseText);
	}
}

//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------
//-------------- by majidi----------------------------------------------------------------------------------------------
function __Remote(URL)
{
	//-------------------------------------------------------	Internet Explorer
	try
	{
		req = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			req = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			req = null;
		}
	}
	//-------------------------------------------------------	Mozailla / Safari
	if (!req && typeof(XMLHttpRequest) != "undefined")
	{
		req = new XMLHttpRequest();
	}
	//-------------------------------------------------------
	if (req != null)
	{
		req.onreadystatechange = RemoteChange;
		req.open("GET", URL, true);
		req.send(null);
		return true;
	}
	//-------------------------------------------------------
}
//------------------------------------------------------------------------------------------------------------


