/*
 * menuExpandable3.js - implements an expandable menu based on a HTML list
 * Author: Dave Lindquist (http://www.gazingus.org)
 */

if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(menuId, actuatorId, styleId, isSelected, redirect){
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);
    var selector = document.getElementById(styleId);


    if (menu == null || actuator == null) return;

	
	if(isSelected == 1){
		//menu.style.display = "block";
	}
		
    actuator.onclick = function() {
       
		if (redirect){
			window.location=redirect
		}
		else{
		   var display = menu.style.display;
			menu.style.display = (display == "block") ? "none" : "block";
			
			if(menu.style.display == "block"){
				if(selector.className == "menu"){
					selector.className = "menuSel";
				}
				else{
					selector.className = "menu2Sel";
				}
			}
			else{
				if(selector.className == "menuSel"){
					selector.className = "menu";
				}
				else{
					selector.className = "menu2";
				}
			}
		}
        return false;
    }
}




