var mog_l;
window.onload = mog_init;

function mog_init() {
  mog_l = document.getElementById('mogrificious');
  mog_hide();
}

function mog_toggle(id) {
  var l = document.getElementById('mog_'+id);
  if (l.style.cssText!='display: block;') {
    mog_hide();
    l.style.cssText = 'display: block;';
  } else {
    mog_hide();
  }
}

function mog_hide() {
  // hide all <ul> children of mog_l
  var c = mog_l.childNodes;
  for (var ii=0;ii<c.length;ii++) {
    if (c[ii].tagName=="UL") {
      c[ii].style.cssText = 'display: none;';
    }
  }
}
