/* Widget mechanism in Javascript */
var shown=0;

function show(id) {
  if ( shown == id ) return;

  var d = document.getElementById('submenu'+id);
  var m = document.getElementById('mbutton_ll'+shown);
  if ( m ){
    m.style.background=
      'url("/images/decorations/menu-border-ll.png") 0 100% no-repeat';
    document.getElementById('mbutton_lr'+shown).style.background=
      'url("/images/decorations/menu-border-lr.png") 100% 100% no-repeat';
    document.getElementById('mbutton_bottom'+shown).style.background=
      'url("/images/decorations/menu-border-bottom.png") 0 100% repeat-x';
    document.getElementById('menulink'+shown).style.color='#000000';
    document.getElementById('menulink'+shown).style.textShadow='#00a0a0 1px 1px 1px';
  }
  m = document.getElementById('submenu'+shown);
  if ( m ){
    document.getElementById('submenu'+shown).style.display='none';
  }
  if (d) {
    d.style.display='block';
    m = document.getElementById('mbutton_ll'+id);
    if ( m ) {
      m.style.background=
        'url("/images/decorations/menu-border-ll-on.png") 0 100% no-repeat';
      document.getElementById('mbutton_lr'+id).style.background=
        'url("/images/decorations/menu-border-lr-on.png") 100% 100% no-repeat';
      document.getElementById('mbutton_bottom'+id).style.background=
        'url("/images/decorations/menu-border-bottom-on.png") 0 100% repeat-x';
      document.getElementById('menulink'+id).style.color='#0000a0';
      document.getElementById('menulink'+id).style.textShadow='#00ffff 1px 1px 1px';
    }
  }
  shown = id;
}
