thats one way of doing it, or have a close all and call the before you "open" the correct menu.
Code:
function change_it(itemID) {
closeEverything();
document.getElementById(itemId).style.display = 'inline';
}
function closeEverything() {
document.getElementById("menu1").style.display = 'none';
document.getElementById("menu2").style.display = 'none';
document.getElementById("menu3").style.display = 'none';
...
}
OR
you can close everything and open the item all within the same method.
Code:
function change_it(itemID) {
switch(itemID)
case 1:
document.getElementById("menu1").style.display = 'inline';
document.getElementById("menu2").style.display = 'none';
document.getElementById("menu3").style.display = 'none';
case 2:
document.getElementById("menu1").style.display = 'none';
document.getElementById("menu2").style.display = 'inline';
document.getElementById("menu3").style.display = 'none';
....
}
I'd do it the first way that I've listed with the close everything of the 3 options listed so far.
Wesley