You seem to have 2 divs with the ID masterdiv. What JavaScript is doing is it's looking at only the first div to see if any are currently open, because ID's are unique and there is only suppose to be one unique ID per page.
To fix this, change the second masterdiv to something like masterdiv2. You then need to change the SwitchMenu function to this:
HTML Code:
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
var ar2 = document.getElementById("masterdiv2").getElementsByTagName("span");
if(el.style.display != "block"){ //DynamicDrive.com change
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu") //DynamicDrive.com change
ar[i].style.display = "none";
}
for (var i=0; i<ar2.length; i++){
if (ar2[i].className=="submenu") //DynamicDrive.com change
ar2[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}
Bookmarks