var wherearewe = window.location.search;

//alert("document name: " + location.pathname.split("/").pop())

if (wherearewe.substring(0, 1) == '?') {
    wherearewe = wherearewe.substring(1);
  }

window.onload=function() { montre(wherearewe);}

function prendiElementoDaId(id_elemento) {
 // elemento da restituire
 var elemento;
 
 // se esiste il metodo getElementById
 // questo if sarà diverso da false, null o undefined
 // e sarà quindi considerato valido, come un true
 if(document.getElementById)
  elemento = document.getElementById(id_elemento);
 
 // altrimenti è necessario usare un vecchio sistema
 else
  elemento = document.all[id_elemento];

 // restituzione elemento
 return elemento;
}

function montre(id) {
// alert("montre.Valore di id: " + id)

var d = prendiElementoDaId(id);
	// alert("risultato di getElementById: " + d)

	for (var i = 1; i<=3; i++) {
		if (prendiElementoDaId('smenu'+i)) {prendiElementoDaId('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}


