var behaviors  = {};
var lastEnigmaID = null;
function InitEnigma(id) {
  // get all list elements
  if ($(id)) {
    // go through each
    $A($(id).childNodes).each(function(child) {
      // looking for an LI
      if (child.nodeName == 'LI') {
        // and if there is a menu
        if ($(child.id+'-menu')) {
          // add behaviors
          eval("Event.observe('"+child.id+"',  'mouseover', function(){ SwapEnigma('"+child.id+"'); });");
        }
      }
    });
  }
}
function SwapEnigma(enigmaID) {
  // highlight menu
  $(enigmaID).addClassName('on');
  // move menu child-contents to screen
  $('enigma-screen').innerHTML = $(enigmaID+'-menu').innerHTML;
  // un-highlight last menu
  if ($(lastEnigmaID) && lastEnigmaID != enigmaID) { $(lastEnigmaID).removeClassName('on'); }
  // set last menu
  lastEnigmaID = enigmaID;
}
