function startMenu(menuname) { var element; if (menuname != "") { element = document.getElementById('menulink'+menuname); if (element) { openMenu(element); } } return true; } function openMenu(obj) { var parent = obj.parentElement; var childn = parent.childNodes; var child; closeFamily(parent); for (i=1; i < childn.length; i++) { child = childn(i); if (child.nodeName == 'UL') { if (child.style.display.toString().toLowerCase().match('block')) { child.style.display = "none"; } else { child.style.display = "block"; } } } return true; } function closeFamily(obj) { var parent = obj.parentElement; var childn = parent.childNodes; var child, ichild, ichildn; for (i=1; i < childn.length; i++) { child = childn(i); if (child.nodeName == 'LI') { if (child != obj) { ichildn = child.childNodes; for (j=1; j < ichildn.length; j++) { ichild = ichildn(j); if (ichild.nodeName == 'UL') { ichild.style.display = "none"; } } } } } parent.style.display = "block"; if (parent.getAttribute('id') != 'navmenu') { closeFamily(parent.parentElement); } return true; }