function init() {
	var menuID = ["m1","m2","m3","m4","m5","m6", "m7", "m8", "m9"];
	for (var i in menuID)
	document.getElementById("s-" + menuID[i]).style.display = "none";
  }
function mostra(id) {
	if (document.getElementById("s-"+id).style.display == "none") {
		init();
		document.getElementById("s-"+id).style.display = "block";
	}
	else init()
}
window.onload = function(e) { init() } 

var myRequest= new Array(10);
function CreateXmlHttpReq2(handler) {
    var xmlhttp = null;
    try { 
    		clearTimeout(anti_session_scadence);
    		anti_session_scadence=setTimeout("document.location='/'",1740000);
    } catch(e) {
	a=0;
    };

    try {
	  xmlhttp = new XMLHttpRequest();
    } catch(e) {
	  try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	  } catch(e) {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  }
    }
    if(xmlhttp) xmlhttp.onreadystatechange = handler;
    return xmlhttp;
}

var contaRequest="";
function contalo(x)
{
	contaRequest = CreateXmlHttpReq2(mostraContatore);
	if(contaRequest) {
		contaRequest.open("POST","/contalo/contalo.php");
		contaRequest.setRequestHeader("content-type", "application/x-www-form-urlencoded");
		contaRequest.send("url="+x);
	} 
} 

function mostraContatore( x )
{
	if(contaRequest.readyState === 4) 
	{
		if(contaRequest.status == 200) 
		{
			document.getElementById('numero').innerHTML=contaRequest.responseText;
		}
	}
}

