/*
 * 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,active) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;

    //if (window.opera) return; // I'm too tired

if (active) {
    actuator.parentNode.style.listStyleImage = "url(/img/minus.gif)";
    menu.style.display = "block"; 
}
else {
    actuator.parentNode.style.listStyleImage = "url(/img/plus.gif)";
}
    actuator.onclick = function() {
        var display = menu.style.display;
        this.parentNode.style.listStyleImage =
            (display == "block") ? "url(/img/plus.gif)" : "url(/img/minus.gif)";
        menu.style.listStyleImage = "url(/img/square.gif)";
        menu.style.display = (display == "block") ? "none" : "block";

        return true;
    }
    
}


