/*
 * menuExpandable3.js - implements an expandable menu based on a HTML list
 * Author: Dave Lindquist (dave@gazingus.org)
 */

if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(menuId, actuatorId) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

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

    // if (window.opera) return; // Opera 7 works well, so commenting this

    actuator.parentNode.style.background = "url(/modules/sitemap/plus.gif) no-repeat 0em 0.3em";
    actuator.onclick = function() {
        var display = menu.style.display;
        this.parentNode.style.background =
            (display == "block") ? "url(/modules/sitemap/plus.gif) no-repeat 0em 0.3em" : "url(/modules/sitemap/minus.gif) no-repeat 0em 0.3em";
        menu.style.display = (display == "block") ? "none" : "block";

        return false;
    }
}
