I am making an IE / Mozilla compatible site. The menu system utilizes the "display" property of DIV blocks. What I want to have is when a user clicks on the main link, the sub-link menu pops up underneath.

function toggleMenu(event,contextid) {
  var divEl;
  divEl = document.getElementById(contextid);
// If the menu is open, close all menus
  if (divEl.style.display == "") {
// If the menu is closed, close all menus and open the selected menu
  else {
	divEl.style.display = "";
  return false;
function closeAllMenus() {
//closes all menus
	indexmenuDIV.style.display = "none";
	gallerymenuDIV.style.display = "none";
	forummenuDIV.style.display = "none";
	membersmenuDIV.style.display = "none";
	profilemenuDIV.style.display = "none";
	messagingmenuDIV.style.display = "none";
	submitmenuDIV.style.display = "none";
	helpmenuDIV.style.display = "none";
  return false;
This code works for IE6 but not Mozilla 1.5. I've narrowed the problem down to the closeAllMenus function and the call to it in the else statement in the toggleMenu function, but I can't see why nothing happens when I run the script in Mozilla.