menu_status = new Array();
			


function  HideMenu(theid){
    if (document.getElementById) {
    var switch_id = document.getElementById(theid);

        if(menu_status[theid] != 'hide') {
           switch_id.className = 'hide';
           menu_status[theid] = 'hide';
        }
    }
}

function showMenu(theid){
    if (document.getElementById) {
    var switch_id = document.getElementById(theid);

        if(menu_status[theid] != 'show') {
           switch_id.className = 'show';
           menu_status[theid] = 'show';
        }
    }
}

function showHide(theid){
	var ar = document.getElementById("masterdiv").getElementsByTagName("div"); //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].id.lastIndexOf("mymenu")==0 & ar[i].id != theid) //DynamicDrive.com change
				{
				var switch_id = document.getElementById(ar[i].id);
				switch_id.className = 'hide';
				menu_status[ar[i].id] = 'hide';
				}
			}

    if (document.getElementById) {

    var switch_id = document.getElementById(theid);

        if(menu_status[theid] != 'show') {
           switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else{
           switch_id.className = 'hide';
           menu_status[theid] = 'hide';
        }
    }
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="sub") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}

}


 
function HideAll(theid){
	var ar = document.getElementById("masterdiv").getElementsByTagName("div"); //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].id.lastIndexOf("mymenu")==0 & ar[i].id != theid) //DynamicDrive.com change
				{
				var switch_id = document.getElementById(ar[i].id);
				switch_id.className = 'hide';
				menu_status[ar[i].id] = 'hide';
				}
			}
}
