/*
 * menuExpandable3.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 (window.opera) return; // I'm too tired

    actuator.parentNode.style.backgroundImage = "url(/images/interface/nav_plus.gif)";
	actuator.parentNode.style.backgroundRepeat = 'no-repeat';
    actuator.onclick = function() {
        var display = menu.style.display;
        this.parentNode.style.backgroundImage =
            (display == "block") ? "url(/images/interface/nav_plus.gif)" : "url(/images/interface/nav_minus.gif)";
		this.parentNode.style.backgroundRepeat = 'no-repeat';
        menu.style.display = (display == "block") ? "none" : "block";

		if(actuator.href != location.href) location.href = actuator.href;

        return false;
    }
}

function explodeMenu(menuId){
	var menu = document.getElementById(menuId);
	if (menu == null) return;

	var display = menu.style.display;
	//menu.style.backgroundImage = "url(/images/interface/nav_minus.gif)";
	menu.style.backgroundRepeat = 'no-repeat';
	menu.style.display = "block";

	return false;
}