/*
 * 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, currentId) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;
	
	menu.style.display = "none";
	//alert(menu.style.display);

    actuator.parentNode.style.listStyleImage = "url(/images/plus.gif)";
    actuator.onclick = function() {
        var display = menu.style.display;
        this.parentNode.style.listStyleImage = (display == "block") ? "url(../i/Bg/plus.gif)" : "url(../i/Bg/minus.gif)";
        menu.style.listStyleImage = "url(../i/Bg/square.gif)";
        menu.style.display = (display == "block") ? "none" : "block";

        return false;
    }
	if(currentId != "") {
		var selectedMenu = document.getElementById(currentId);
		selectedMenu.style.display = "block";
	}
}


