var xmlHttp
var currCtrl

function showData(urls,ctrl)
{
	if (urls.length==0)
	{ 
		document.getElementById(ctrl).innerHTML="";
		return;
	}
	currCtrl = ctrl;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	var url = urls;
	//url = url+"&sid="+Math.random();
	xmlHttp.onreadystatechange = stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 

function stateChanged()
{ 
	//alert(currCtrl);
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById(currCtrl).innerHTML = bs2str(xmlHttp.responseBody);
		try
		{
		}
		catch (e)
		{
			alert(e);
		}
	}
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
function bs2str(str)
{
	if(!bs2str.ss) bs2str.ss = [];
	return unescape(escape(jsMidb(str,1)).replace(/..(..)(..)/g, "%$2%$1").replace(/%(\D.)%(..)/g,function(a,a1,a2){var s=a1+a2;if(!bs2str.ss[s]) return bs2str.ss[s]=jsChr("&h"+s);return bs2str.ss[s];}));
}
