// show/hide an element
function toggleElement(id) {
  var element = document.getElementById(id);
  if (element == null) return;
  if (element.style.display == 'none') {
    if (element.oldDisplay != undefined)
      element.style.display = element.oldDisplay;
    else
      element.style.display = 'block';
  }
  else {
    element.oldDisplay = element.style.display;
    element.style.display = 'none';
  }
}

function toggleAccountMenu() {
  toggleElement('accountMenu');
  mb = document.getElementById('accountMenuButton');
  mbOn = document.getElementById('onAccount');
  if (mb)
    mb.id = 'onAccount';
  if (mbOn)
    mbOn.id = 'accountMenuButton';
}
