/*
 * menuExpandable2.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) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;

	if (getCookie(menuId) != null)
	{
    	menu.style.display = getCookie(menuId);
        menu.parentNode.style.backgroundImage =
            (menu.style.display == "block") ? "url(/images/minus.gif)" : "url(/images/plus.gif)";
	}
	
    //if (window.opera) return; // I'm too tired
    actuator.onclick = function() {
        var display = menu.style.display;
        this.parentNode.style.backgroundImage =
            (display == "block") ? "url(/images/plus.gif)" : "url(/images/minus.gif)";
        menu.style.display = (display == "block") ? "none" : "block";

		if (menu.style.display == "block")
			setCookie(menuId,"block");
		else
			setCookie(menuId,"none");

        return false;
    }
}




