
// Top menu ------------------------------------------------------------------

// Hide the currently displayed menu element(s) and display a new one:
function switchtopmenu (id) {
  hidealltopmenu ();
  showmenu (id);
}

// Hide the currently displayed menu element(s):
function hidealltopmenu () {
  // Loop through the array and hide each menu element by id:
  for (var i = 0; i < topMenuSubs.length; i++)
    hidemenu (topMenuSubs[i]);
}

// Hide a specific element:
function hidemenu (id) {
  // Safe function to hide an element with a specified id
  if (document.getElementById)
    document.getElementById(id).style.display = 'none';
  else
    alert ('Your browser is too old to support this code.');
    // (I.e. Netscape 4, IE4 or worse)
}

// Show a specific element:
function showmenu (id) {
  // Safe function to show an element with a specified id
  if (document.getElementById)
    document.getElementById(id).style.display = 'block';
  else
    alert ('Your browser is too old to support this code.');
    // (I.e. Netscape 4, IE4 or worse)
}

// Left hand side menu -------------------------------------------------------

// Hide the currently displayed menu element(s):
function hideallleftmenu () {
  // Loop through the array and hide each menu element by id:
  for (var i = 0; i < leftMenuSubs.length; i++)
    hidemenu (leftMenuSubs[i]);
}

// Hide the currently displayed menu element(s) and display a new one:
function switchleftmenu (id) {
  hideallleftmenu ();
  showmenu (id);
}

// Content page menu ---------------------------------------------------------

// Hide the currently displayed menu element(s):
function hideallcontentmenu () {
  // Loop through the array and hide each menu element by id:
  for (var i = 0; i < contentMenuSubs.length; i++)
    hidemenu (contentMenuSubs[i]);
}

// Hide the currently displayed menu element(s) and display a new one:
function switchcontentmenu (id) {
  hideallcontentmenu ();
  showmenu (id);
}

// EOF
