// inizio codice gestione MenuA (menu a tendina)
//
var vNew = "menuA1_01_";

function mMenuA_MOver(varA) {
	var varX = vNew.length - varA.length;
	if (varX == 1) {
		mMenuA_Hide(vNew);
		varA = varA + "_";
		vNew = varA;	
		mMenuA_Show(vNew);
	}
	if (varX == -2) {
		varA = varA + "_";
		vNew = varA;	
		mMenuA_Show(vNew);
	}
	if (varX == 4) {
		mMenuA_Hide(vNew);
		var varB = vNew.length - 3;
		varB = vNew.substring(0, varB);
		mMenuA_Hide(varB);
		varA = varA + "_";
		vNew = varA;	
		mMenuA_Show(vNew);
	}	
}

function mMenuA_MOut(varA) {
	var varB;
	if (varA.toElement == null) { // per NN
		varB = varA.relatedTarget;
	} else { // per IE
		varB = event.toElement;
	}
	if (varB != null) {
		if (varB.nodeType == 3) {
			varB = varB.parentNode;
		}
		varB = varB.id;
	}
	varB = varB.substring(0, 5);
	if (varB != "menuA") {
		mMenuA_HideAll();
	}
}


function mMenuA_Hide(varMenuToClose) {
	if (document.getElementById(varMenuToClose) != null) {
		document.getElementById(varMenuToClose).style.visibility = "hidden";
	}
}

function mMenuA_Show(varMenuToOpen) {
	if (document.getElementById(varMenuToOpen) != null) {
		document.getElementById(varMenuToOpen).style.visibility = "visible";
	}
}

function mMenuA_Open(varMenu) {
	mMenuA_HideAll();
	if (document.getElementById(varMenu) != null) {
		document.getElementById(varMenu).style.visibility = "visible";
	}
	vNew = varMenu;
}

function mMenuA_HideAll() {
	var varB = vNew.length;
	var varC;
	for (varB; varB > 3; varB = varB - 3) {
		varC = vNew.substring(0, varB);
		mMenuA_Hide(varC);
	}
	vNew = "menuA1_01_";
}
//
// fine codice gestione MenuA (menu a tendina)

function mOutput1(varOutput) {
	document.getElementById("vOutput1").firstChild.nodeValue = varOutput;
}
function mOutput2(varOutput) {
	document.getElementById("vOutput2").firstChild.nodeValue = varOutput;
}

//sotto sezioni

function ShowHide(id, visibility) {
	hideAll();
	if(visibility == 'hidden'){
		disp = "none";
	}else{
		disp = "block";
	}
	obj = document.getElementsByTagName("div");
	obj[id].style.visibility = visibility;
	obj[id].style.display = disp;
}

function hideAll(){
	
	for(x=0;x<arr_menu.length;x++){
		id = arr_menu[x];
		obj = document.getElementsByTagName("div");
		obj[id].style.visibility = 'hidden';
		obj[id].style.display = 'none';
	}
}
//


// altre funzioni utili

function mPiantina_Open() {
  window.open('swf/piantinapopup.htm','','scrollbars=yes,resizable=yes,width=530,height=400');
}
