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

function initializeExMenu(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/symbol_sm_on.gif)";
    actuator.onclick = function() {
		resetAll(this.id);
		var display = menu.style.display;
        this.parentNode.style.backgroundImage =
            (display == "block") ? "url(images/symbol_sm_on.gif)" : "url(images/symbol_sm_on.gif)";
        menu.style.backgroundImage = "url(images/symbol_sm_on.gif)";
        menu.style.display = (display == "block") ? "none" : "block";

        return false;
    }
}

function initializeItem(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/symbol_sm.gif)";
    //actuator.onclick = function() {
		//resetAll(this.id);
		//this.parentNode.style.backgroundImage = "url(images/symbol_sm_on.gif)";
    //}
}

function resetAll(actuatorId) {
	if(actuatorId=="ex01Actuator") {
	} else {
	  resetMenu("ex01Menu", "ex01Actuator");
	}
	if(actuatorId=="ex02Actuator") {
	} else {
	  resetMenu("ex02Menu", "ex02Actuator");
	}
	if(actuatorId=="ex03Actuator") {
	} else {
	  resetMenu("ex03Menu", "ex03Actuator");
	}
	if(actuatorId=="ex04Actuator") {
	} else {
	  resetMenu("ex04Menu", "ex04Actuator");
	}
	if(actuatorId=="ex05Actuator") {
	} else {
	  resetMenu("ex05Menu", "ex05Actuator");
	}
	if(actuatorId=="ex06Actuator") {
	} else {
	  resetMenu("ex06Menu", "ex06Actuator");
	}
}

function resetMenu(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/symbol_sm.gif)";
    var display = menu.style.display;
    menu.style.display = "none";
}

function selectExMenu(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/minus.gif)";
//	actuator.style.backgroundImage =  "url(images/symbol_sm_on.gif)";
	actuator.parentNode.style.backgroundImage = "url(images/symbol_sm_on.gif)";
	actuator.style.color = "#E88700";
//    menu.style.backgroundImage = "url(images/symbol_sm_on.gif)";
//	var display = menu.style.display;
//	actuator.parentNode.style.backgroundImage =
//		(display == "block") ? "url(images/symbol_sm.gif)" : "url(images/symbol_sm_on.gif)";
//	menu.style.display = (display == "block") ? "none" : "block";
}