var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);

var NS6 = (bName == "Netscape" && bVer >=5 && bVer < 7); //alternativa check su getElementById
var NS4 = document.layers;
var IE4 = document.all;

//LAYER SWITCHING CODE

if (NS4) {
	layerStyleRef="layer.";
	layerRef="document.layers[";
	styleSwitch="]"; layerDoc=".document."
}
else if (IE4) {
	layerStyleRef="layer.style.";
	layerRef="document.all[";
	styleSwitch="].style"; layerDoc=".";
}
else if (NS6) { 
	layerStyleRef="style.";
	layerRef="document.getElementById(";
	styleSwitch=").style"; layerDoc=".";
}	
else {
	//vedi un po' tu che vuoi fare. Se uno ha un browser per conto suo?
}

menutop = new Array ()
menutop[0]="menuopenhome";
menutop[1]="menuopeninfo";
menutop[2]="menuopenattivita";
menutop[3]="menuopenrubriche";
menutop[4]="menuopenservizi";
menutop[5]="menuopencommunity";
menutop[6]="menuopencontattaci";
menutop[7]="Pmenuopenhome";
menutop[8]="Pmenuopeninfo";
menutop[9]="Pmenuopenattivita";
menutop[10]="Pmenuopenrubriche";
menutop[11]="Pmenuopenservizi";
menutop[12]="Pmenuopencommunity";
menutop[13]="Pmenuopencontattaci";

function showLayer(layerName){
        if (NS4 || IE4 || NS6) {
                eval(layerRef+'"'+layerName+'"'+styleSwitch+'.visibility="visible"');
        }       
}
        
function hideLayer(layerName) {
	if (NS4 || IE4 || NS6) {
		eval(layerRef+'"'+layerName+'"'+styleSwitch+'.visibility="hidden"');
	}       
}
		
function hideAll () {
	for (i_loc=0; i_loc < menutop.length; i_loc ++) {
		hideLayer (menutop[i_loc]);
	}
	return false;
}
