var xmlhttp;

function apriMenu(sez)
{
xmlhttp=GetXmlHttpObject();

	  if (xmlhttp==null)
	  {
	  alert ("Browser does not support HTTP Request");
	  return;
	  }
	  
	var url="caricaVoci.php";
	url=url+"?sez="+sez;
	chiamaFunzione = eval('stateChanged'+sez)
	xmlhttp.onreadystatechange=chiamaFunzione;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}
function stateChanged1()
{
	if (xmlhttp.readyState==4){
		document.getElementById('sottoMenu1').innerHTML = xmlhttp.responseText;
		document.getElementById('sottoMenu2').innerHTML = '';
		document.getElementById('sottoMenu3').innerHTML = '';
	}
}
function stateChanged2()
{
	if (xmlhttp.readyState==4){
		document.getElementById('sottoMenu1').innerHTML = '';
		document.getElementById('sottoMenu2').innerHTML = xmlhttp.responseText;
		document.getElementById('sottoMenu3').innerHTML = '';
	}
}
function stateChanged3()
{
	if (xmlhttp.readyState==4){
		document.getElementById('sottoMenu1').innerHTML = '';
		document.getElementById('sottoMenu2').innerHTML = '';
		document.getElementById('sottoMenu3').innerHTML = xmlhttp.responseText;
		}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject('Microsoft.XMLHTTP');
  }
return null;
}
function selectMenu(sez){
	document.getElementById('menu'+sez).className = 'menuSel';
}
