// The master lists of menu items.
var masterListMenu = new Array();
var masterListActuator = new Array();
var staticListActuator = new Array();


function initializeStaticMenu(actuatorId) {
	// Register NON-EXPANDING menu items with master list controller.
    staticListActuator[staticListActuator.length] = actuatorId;
 }	

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;

   // actuator.parentNode.style.backgroundImage = "url(/images/plus.gif)";
    
    // Register menu items with master list controller.
    masterListMenu[masterListMenu.length] = menuId;
    masterListActuator[masterListActuator.length] = actuatorId;
    
    
    actuator.onClick = function() {
       
	    var display = menu.style.display;
        
	   // Turn off all the other registered menu items.
       for (ii=0;ii<masterListActuator.length;ii++){
	       var tempActuator = document.getElementById(masterListActuator[ii]);
	       
	       	if (tempActuator!=this){
		       	var tempMenu =  document.getElementById(masterListMenu[ii]);
		    	tempActuator.parentNode.style.backgroundImage =  "url(/images/plus.gif)";
	      		tempMenu.style.display = "none" ;
      		}	
	         
       } 
       
         // Turn off all the other registered NON-EXPANDING menu items.
       for (ii=0;ii<staticListActuator.length;ii++){
	       var tempActuator = document.getElementById(staticListActuator[ii]);
	       
	       	if (tempActuator!=this){
		     //  	alert(staticListActuator[ii]);
		     	tempActuator.parentNode.style.backgroundImage =  "url(/images/clear.gif)";
	     	}	
	         
       } 
       
	    
	   this.parentNode.style.backgroundImage = (display == "block") ? "url(/images/plus.gif)" : "url(/images/minus.gif)";
       menu.style.display = (display == "block") ? "none" : "block";
       return false;
    }   
    
    
    
         
}


	
