
var lastmenuID= new Array();

function toggleMenu(menuID)
{
  for(var depth= 0, pos= menuID.indexOf('_',pos)+1; pos > 0; pos= menuID.indexOf('_',pos)+1) depth++;
  var link= document.getElementById(menuID+'_a');
  var menu= document.getElementById(menuID);
  var lastlink= document.getElementById(lastmenuID[depth]+'_a');
  var lastmenu= document.getElementById(lastmenuID[depth]);
  if(!(link&&menu)) return false;
  if(link.className == 'selected') // deselect
  { lastlink.className= ''; lastmenu.className= ''; lastmenuID[depth]= null; menu.className= ''; link.className= ''; }
  else
  { 
    if(lastlink) lastlink.className= '';
    if(lastmenu) lastmenu.className= '';
    lastmenuID[depth]= menuID;
    link.className= 'selected';
    menu.className= 'selected';
  }
  return true;
}

function setStyle(style)
{
  if(!document.styleSheets||!document.styleSheets.length) return;
  for(var i= 0; i < document.styleSheets.length; i++)
    document.styleSheets[i].disabled= !(document.styleSheets[i].title == style);
}

function goOption(sel)
{
  var opt= sel.options[sel.selectedIndex];
  sel.selectedIndex= 0;
  if(opt.ondblclick) opt.ondblclick();
  else window.open(opt.value,'_top');
  return false;
}

function initMenu()
{
  if(!document.getElementById) return;
  var nav= document.getElementById('leftnav');
  if(!nav) return;
  var navlinks= nav.getElementsByTagName('A');
  var link, up, uphref_rel;
  var uphref= document.getElementById('link_up');
  if(uphref) uphref= uphref.href;
  for(var i= navlinks.length-1 ; i >= 0; i--)
    if((navlinks[i].href==document.URL)||(navlinks[i].href==window.location.pathname)||(('/'+navlinks[i].href)==window.location.pathname)) 
      { link= navlinks[i]; break; }
    else if((navlinks[i].href==uphref)||('/'+navlinks[i].pathname==uphref))
      { up= navlinks[i]; }
  if(!link) link= up;
  if(!link) return;
  for(var node= link.parentNode; node && node != nav; node=node.parentNode)
  if ((node.tagName=='UL') && (node.id>"")) toggleMenu(node.id);
  link.className= 'selected';
  var submenu= link.nextSibling;
  if(!submenu) return;
  if(submenu.tagName!='UL') return;
  submenu.className= 'selected';
  var menuID= link.nextSibling.id;
  if(!menuID) return;
  for(var depth= 0, pos= menuID.indexOf('_',pos)+1; pos > 0; pos= menuID.indexOf('_',pos)+1) depth++;
  lastmenuID[depth]= menuID;
}

function init()
{
  if(document.cookie.search(/\bstyle=([^;]+)/) > -1) 
    setStyle(unescape(RegExp.$1.replace('+',' ')));
  if(document.layers) return;
  initMenu();
  if(document.cookie.indexOf('noflash=True')>-1) return;
  if(typeof(initHeadBanner)=='function') initHeadBanner();
  if(typeof(initcover)=='function') initcover();
  if(typeof(initapply)=='function') initapply();
}
window.onload= init;
<!--=(F)=-->