var statoonline=null;
var onlinerichiesta="";
function GetXmlHttpObject()
{
var statoonline=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 statoonline=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  statoonline=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  statoonline=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return statoonline;
}

function show_stato_online(chiamata)
{
onlinerichiesta=chiamata;
statoonline=GetXmlHttpObject();
if (statoonline==null)
 {
 alert ("Browser does not support HTTP Request");
 return
 } 
var url="online.php";
url=url+"?chiamata="+onlinerichiesta;
url=url+"&sid="+Math.random();
statoonline.onreadystatechange=stateChangedonline; 
statoonline.open("GET",url,true);
statoonline.send(null);
}

function stateChangedonline() 
{ 
if (statoonline.readyState==4 || statoonline.readyState=="complete")
 { 
 if(document.getElementById("online"))
 {
 document.getElementById("online").innerHTML='<img src="img/icon_home.gif" width="14" height="13" border="0">&nbsp;On&nbsp;line:&nbsp;'+statoonline.responseText;
 }
 } 
 }
