/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* LAYER FUCTIONALITY */
function hideAllMenues() {
	hideAllSubMenues();
	for (i=1; i<=4; i++) {	
		obj = document.getElementById("SubMenu"+i);
		obj.style.visibility = "hidden";
	}
}

function hideAllSubMenues() {
	objLayers = new Array("subSubMenu2_0", "subSubMenu2_1", "subSubMenu2_2", "subSubMenu3_0", "subSubMenu3_2", "subSubMenu4_0");
	for (var x = 0; x<objLayers.length; x++) { 
		obj = document.getElementById(objLayers[x]);
		obj.style.visibility = "hidden";
	}
}
 
function showMenu() {
	var nroSeccion = readSelectedMenu();
	obj = document.getElementById("SubMenu"+nroSeccion).style;
	obj.visibility = "visible";	
}

function showSubMenu() {
	var nroSeccion = readSelectedMenu();
	alert(nroSeccion);
}

function hideMenu() {
	ini = readSelectedMenu();
	obj = document.getElementById("SubMenu"+ini);
	obj.style.visibility = "hidden";	
}

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* CROSS SELECTION FUCTIONALITY */
function storeSelectedMenu(obj) {
	document.getElementById("nroSeccion").value = obj;
}

function readSelectedMenu() {
	var result = document.getElementById("nroSeccion").value;
	if (result) {
		return result;
	}
}

function clearSelectedMenu() {
	document.getElementById("nroSeccion").value = "0";
}

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* BUTTONS FUCTIONALITY */
function mOver(obj, obj_bool) {
	hideAllMenues();
	var aux = obj.substr(10, 10);	
	over(obj);
	storeSelectedMenu(aux);
	showMenu();
}

function mOut(obj) {
	out(obj);
}

function mClick(url) {
	hideAllMenues();
	window.location = url;
}

function mOverSub(obj, obj_bool) {
	var aux = obj.id;	
	index_a = aux.indexOf("subSubM");
	index_b = aux.indexOf("2_");
	if (!(index_a != -1)) {	
		hideAllSubMenues();
		var subobj = eval("arrow_"+aux);
		obj.className='nav_menu_over';
	} else {
		obj.className='nav_submenu_over';	
	}
	if (obj_bool) {
		if (!(index_b != -1)) {		
			subobj.src = "../images/nav/ico_subitem_right.gif"; 
		} else {
			subobj.src = "../images/nav/ico_subitem_left.gif"; 		
		}
		var subMenu = eval("sub"+aux);
		subMenu.style.visibility = "inherit";
	}
}

function mOutSub(obj, obj_bool, obj_end) {
	var aux = obj.id;	
	index_a = aux.indexOf("subSubMenu");
	if (!(index_a != -1)) {	
		obj.className='nav_menu';
	} else {
		var flag = true;
		obj.className='nav_submenu';	
	}
	if (obj_bool) {
		var subobj = eval("arrow_"+aux);	
		subobj.src = "../images/comunes/spacer.gif"; 
	}	
	if (obj_end) {
//		hideAllMenues();
	}
}


/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
