function initMenu() {
  $('#menu ul').hide();
  // if you want to show the first sub menu onLoad uncomment the next two lines
  // $('#menu ul:first').show();
  // switchId('menu1');
  $('#menu li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        return false;
      }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#menu ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  }
$(document).ready(function() {initMenu();});


// if you have something better - use it... this was quick

var ids = new Array('menu1','menu2','menu3','menu4','menu5','menu6');

function hideElement(id) {
	if(document.getElementById) {
	document.getElementById(id).setAttribute('class','rootNavElement');
	}
}

function showElement(id) {
	if(document.getElementById) {
	document.getElementById(id).setAttribute('class','rootNavElementOn');
	}
}

function hideAll() {
	for(var i=0;i<ids.length;i++) {
	if(document.getElementById) {
		hideElement(ids[i]);
		}
	}
}

function switchId(id) {
	hideAll();
	showElement(id);
}