Source of initial.js

var topMenuItems = [] ;
 
function addClass(id,sfx) {
  var se = getElement(id) ;
  if (se.className.indexOf(sfx) < 0) se.className = se.className + " " + sfx ;
}
function removeClass(id,sfx) {
  var se = getElement(id) ;
  var i = se.className.indexOf(sfx) ;
  if (i >= 0) se.className = se.className.substr(0,i) ;
}
 
function menuShow(id) {
  var se = getElement(id) ; se.menuActive = true ; 
  showElement(id + "_sub") ; addClass(id+"_main","down"); }
 
function menuHide(id) { 
  var se = getElement(id) ; se.menuActive = false ; 
  hideElement(id + "_sub") ; removeClass(id+"_main","down"); }
 
function menuGo(id,l) { menuHide(id); location.href = l; }
function menuSelect(id) { menuHide(id) ; }
 
function menuClick(id) {
  var i,se ;
  se = getElement(id) ;
  if (se.menuActive) {
    menuHide(id) ; return ;
  }
  for (i = 0 ; i < topMenuItems.length ; i++) {
    if (topMenuItems[i] != id) menuHide(topMenuItems[i]);
  }
  menuShow(id) ;
}
 
function menuRegister(id) { 
  topMenuItems[topMenuItems.length] = id ;
}
 
/** support functions **/
 
function getElement(id) {
  return document.getElementById(id);
}
 
function showElement(id) {
  var e = getElement(id);
  if (e) { e.style.display = "inherit" }
}
 
function hideElement(id) {
  var e = getElement(id);
  if (e) { e.style.display = "none" }
}