/*
 * menuExpandable.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, value) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;
	if (value == 1) menu.style.display = "block";
	if (value == 0) menu.style.display = "none";

    // function to be called when click on menu
    actuator.onclick = function() {
        var display = menu.style.display;
        menu.style.display = (display == "block") ? "none" : "block";
        return false;
    }
}

function setMenuSelection(anchorId) {
    var menu = document.getElementById(anchorId);
    if (menu == null) return;
    menu.style.color = "white";
    menu.style.backgroundColor = "black";
    return false;
}

