var xmlHttp
loadstatus="<center><img src='/_files/images/ajax-loader.gif' /></center>"


function showStat(str) { 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("A böngésző nem támogatja az AJAX-ot!");
  	return;
 	} 
	var url="/_files/ajax/getstat.cgi";
	url=url+"?id="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged() {
	if (xmlHttp.readyState!=4) {
		document.getElementById("light_stat").innerHTML=loadstatus;
	}
	if (xmlHttp.readyState==4) { 
		document.getElementById("light_stat").innerHTML=xmlHttp.responseText;
	}
}

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;
}

