


function loadMenus(menuIds,widthName) {
    //alert("loadMenus() menuIds = " + menuIds);
    if (menuIds != null) {
	if (document.getElementById && document.styleSheets) {
	
	    //alert("menuIds.length = " + menuIds.length);
	    for (var i = 0; i < menuIds.length; i++) {
		//alert("i = " + i + " id = " + menuIds[i]);

		//alert("i = " + i + " id = " + menuIds[i] + " [ top = " + positionMatrix[i][0] + ", left = " + positionMatrix[i][1] + " ]");
		if (document.getElementById(menuIds[i]) != null) {
		    with (document.getElementById(menuIds[i]).style) {
			visibility = "hidden";
			position = "absolute";
			left = positionMatrix[i][0];
			top = positionMatrix[i][1];
			 switch (widthName) {
			
        		case 'small':
	    		width = "12em";
	    		break;
	    		
	    		case 'medium':
	    		width = "14em";
	    		break;
	    		
	    		case 'large':
	    		width = "28em";
	    		break;
	    		
	    		default:
	    		width = "12em";
	    		break;
	    	}
			
			margin = "0";
			padding = "0";
			zIndex = "3";
		    }
		}

	    }
	}
    }
}


function hideMenus(menuIds) {
    //alert("hideMenus()");
    if (menuIds != null) {
	if (document.getElementById && document.styleSheets) {

	    for (var i = 0; i < menuIds.length; i++) {

		if (document.getElementById(menuIds[i]) != null) {
		    with (document.getElementById(menuIds[i]).style) {
			visibility = "hidden";
		    }
		}

	    }
	}
    }
}


function showMenu(subMenuId, menuIds) {  
    //alert("showMenus()");

    // The following line seems to be understood not too well by MSIE (at least versions < 5.5)
    //if ((subMenuId != null) && (menuIds != null)) {
    if (subMenuId != null) {
	if (menuIds != null) {
	    if (document.getElementById && document.styleSheets) {
		
		hideMenus(menuIds);
		
		if (document.getElementById(subMenuId) != null) {
		    with (document.getElementById(subMenuId).style) {
			visibility = "visible";
		    }
		}
		
	    }
	}
    }
}

    
