function highlightTopic(id){
if (document.getElementById)
   {
   var nodeObj = document.getElementById(id)
   nodeObj.style.fontWeight = 'bold';
   nodeObj.style.background = '#FFFFCC'; 
   nodeObj.style.color = '#000000';
   }
}

function showMenu(id) {
	var menuDisplay = document.getElementById(id)
	menuDisplay.style.display = "block"
}

function hideMenu() {
        var x = document.getElementsByTagName('ul');
        for (var i=0;i<x.length;i++)
        {		
			if (x[i].className == 'menu' || x[i].className == 'submenu')
			x[i].style.display = "none";
        }
		menuStyle();
}  

function menuStyle() {
	
	if (document.title == "Mycology - Animal Interactions - Introduction") {											
	highlightTopic("introduction");	
	}	
	
	if (document.title == "Mycology - Animal Interactions - Symbiotic Interactions") {
	showMenu("symbiontsMenu");
	showMenu("symbioticMenu");						
	highlightTopic("symbiotic");			
	}	

	if (document.title == "Mycology - Animal Interactions - Fungi of the GIT") {
	showMenu("symbiontsMenu");	
	showMenu("git_fungiMenu");						
	highlightTopic("git_fungi");			
	}
	
	if (document.title == "Mycology - Animal Interactions - Commensals") {
	showMenu("symbiontsMenu");	
	showMenu("commensalsMenu");						
	highlightTopic("commensals");			
	}	

	if (document.title == "Mycology - Animal Interactions - Yeasts and Frogs") {
	showMenu("symbiontsMenu");						
	highlightTopic("yeasts");			
	}
	
	if (document.title == "Mycology - Animal Interactions - Fungicides") {
	showMenu("diseaseMenu");
	showMenu("fungicidesMenu");						
	highlightTopic("fungicides");			
	}

	if (document.title == "Mycology - Animal Interactions - Human Disease") {
	showMenu("diseaseMenu");	
	showMenu("humanDiseaseMenu");						
	highlightTopic("humanDisease");			
	}	

	if (document.title == "Mycology - Animal Interactions - Nyastin") {
	showMenu("diseaseMenu");						
	highlightTopic("nyastin");			
	}	

	if (document.title == "Mycology - Animal Interactions - Toxins") {
	showMenu("toxinsMenu");						
	highlightTopic("toxins");			
	}
	
	if (document.title == "Mycology - Animal Interactions - Toxic and Hallucinogenic Fungi") {
	showMenu("toxinsMenu");						
	highlightTopic("toxins");			
	}		
	
	if (document.title == "Mycology - Animal Interactions - Mycophagy") {
	showMenu("animalsFungiMenu");	
	showMenu("mycophagyMenu");						
	highlightTopic("mycophagy");			
	}	

	if (document.title == "Mycology - Animal Interactions - Nutritive Value of Fungi") {
	showMenu("animalsFungiMenu");	
	showMenu("nutritiveMenu");						
	highlightTopic("nutritive");			
	}
	
	if (document.title == "Mycology - Animal Interactions - Dung Fungi") {
	showMenu("animalsFungiMenu");	
	showMenu("dungMenu");						
	highlightTopic("dung");			
	}	
		
	}	

/*
 * 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.onclick = function() {
        var display = menu.style.display;
        menu.style.display = (display == "block") ? "none" : "block";

        return false;
    }
}
