ho inserito in un sito un menù di quelli tipo gestione risorse. tutto funziona bene ma volevo sapere se è possibile modificare una cosa.
ho delle categorie principali e ognuna ha un sottomenu. quando clicco su una categoria il menu si espande ma quando clicco su una delle sottocategorie si richiude. io vorrei che invece rimanesse aperto in modo da avere sempre aperte le sottocategorie quando ho aperto una categoria.
questo è il codice:


<script type="text/javascript">

function mmenu(ID) {
var menu = document.getElementById(ID);
var display = menu.style.display;
menu.style.display = (display == "block") ? "none" : "block";

// ID <- td <- tr <- tbody <- table principale
var nodoUL=document.getElementById(ID).parentNode.pare ntNode.parentNode.parentNode;

// figli del tbody (tr)
var nodo=nodoUL.childNodes[0].childNodes

// ciclo trai tr saltando i pari
for (var k=1;k<nodo.length;k+=2){
// setto nascosto il primo figlio (table) del primo figlio (td) del tr
var c=nodo[k].childNodes[0].childNodes[0]
// se non ha l' id che è stato passato alla funzione
if(c.id!=ID) c.style.display = 'none'
}
}


/* inizializzazione del menu */

window.onload = function() {
var uls = document.getElementsByTagName("TABLE");
for (i=0;i<uls.length;i++) {
if(uls[i].getAttribute("id") && uls[i].getAttribute("id").search("submenu-")!=-1) uls[i].style.display = "none";
}
}

</script>

<table border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td class="menu-navir1">Binocoli</td>
</tr>
<tr>
<td> <table width="131" border="0" cellpadding="3" cellspacing="0" class="submenu" id="submenu-1">
<tr>

<td class="menu-navir"> <a href="../italiano/super40red.htm">Super 40
Red</a></td>
</tr>
<tr>

<td class="menu-navir"><a href="../italiano/special50yellow.htm">Special
50 Yellow</a></td>
</tr>
<tr>

<td class="menu-navir"> <a href="../italiano/special40green.htm">Special
40 Green</a></td>
</tr>
<tr>

<td class="menu-navir"><a href="../italiano/special40black.htm">Special
40 Black</a></td>
</tr>
<tr>

<td class="menu-navir"><a href="../italiano/special50black.htm">Special
50 Black</a></td>
</tr>
<tr>
<td class="menu-navir">Super 60 Black</td>
</tr>
<tr>

<td class="menu-navir">Super 40 T</td>
</tr>
<tr>

<td class="menu-navir">Panorama</td>
</tr>
</table></td>
</tr>
<tr>
<td class="menu-navir1"><a href="javascript:mmenu('submenu-2')">Bug
Viewers</a></td>
</tr>
<tr>
<td> <table width="131" border="0" cellpadding="3" cellspacing="0" class="submenu" id="submenu-2">
<tr>
<td class="menu-navir"> World's Best Bug Viewer</td>
</tr>
<tr>
<td class="menu-navir"> Triple Bug Viewer</td>
</tr>
<tr>
<td class="menu-navir"> Super Bug Viewer</td>
</tr>
<tr>
<td class="menu-navir">Triple Bug Viewer T</td>
</tr>
<tr>
<td class="menu-navir">Super Bug Viewer T</td>
</tr>
</table></td>
</tr>
<tr>
<td class="menu-navir1">Microscopi</td>
</tr>
<tr>
<td><table width="131" border="0" cellpadding="3" cellspacing="0" class="submenu" id="submenu-3">
<tr>
<td class="menu-navir"> Spider Eye</td>
</tr>
<tr>
<td class="menu-navir"> Zoomscope</td>
</tr>
<tr>
<td class="menu-navir"> Spider Eye T</td>
</tr>
<tr>
<td class="menu-navir">Zoomscope T</td>
</tr>
</table></td>
</tr>
<tr>
<td class="menu-navir1"><a href="javascript:mmenu('submenu-4')">Optic
Wonders</a></td>
</tr>
<tr>
<td><table width="131" border="0" cellpadding="3" cellspacing="0" class="submenu" id="submenu-4">
<tr>
<td class="menu-navir"> Optic Wonder</td>
</tr>
<tr>
<td class="menu-navir"> Optic Wonder Plus</td>
</tr>
<tr>
<td class="menu-navir"> Optic Wonder T</td>
</tr>
<tr>
<td class="menu-navir">Super Optic Wonder</td>
</tr>
<tr>
<td class="menu-navir">Super Optic Wonder Plus</td>
</tr>
<tr>
<td class="menu-navir">Super Optic Wonder Plus T</td>
</tr>
</table></td>
</tr>
<tr>
<td class="menu-navir1"><a href="javascript:mmenu('submenu-5')">Lenti
d'ingrandimento</a></td>
</tr>
<tr>
<td><table width="131" border="0" cellpadding="3" cellspacing="0" class="menu-navir" id="submenu-5">
<tr>
<td class="menu-navir"> Magnifyng Lens</td>
</tr>
<tr>
<td class="menu-navir"> Megalens</td>
</tr>
</table></td>
</tr>
<tr>
<td class="menu-navir1">Giroscopi</td>
</tr>
<tr>
<td><table width="131" border="0" cellpadding="3" cellspacing="0" class="menu-navir" id="submenu-6">
<tr>
<td class="menu-navir"> Space Wonder</td>
</tr>
<tr>
<td class="menu-navir"> Mini Space Wonder</td>
</tr>
</table></td>
</tr>
<tr>
<td class="menu-navir1">Telescopi</td>
</tr>
<tr>
<td><table width="131" border="0" cellpadding="3" cellspacing="0" class="menu-navir" id="submenu-7">
<tr>
<td class="menu-navir"> Explorer</td>
</tr>
<tr>
<td class="menu-navir"> Explorer T</td>
</tr>
</table></td>
</tr>
<tr>
<td class="menu-navir1">Periscopi</td>
</tr>
<tr>
<td><table width="131" border="0" cellpadding="3" cellspacing="0" class="menu-navir" id="submenu-8">
<tr>
<td class="menu-navir"> Expanding Periscope</td>
</tr>
<tr>
<td class="menu-navir"> Spyscope</td>
</tr>
<tr>
<td class="menu-navir">Spyscope T</td>
</tr>
<tr>
<td class="menu-navir">Giraf</td>
</tr>
</table></td>
</tr>
<tr>
<td class="menu-navir1">Proiettori</td>
</tr>
<tr>
<td><table width="131" border="0" cellpadding="3" cellspacing="0" class="menu-navir" id="submenu-9">
<tr>
<td class="menu-navir"> Craft Master 75 Watt</td>
</tr>
<tr>
<td class="menu-navir"> Craft Master 60 Watt</td>
</tr>
</table></td>
</tr>