var oldsubmenu = '';
var oldbutton  = '';

function show_menu(x) {
  if (document.all) document.all(x).style.visibility="visible";
  else if (document.layers) document.layers[x].visibility="show";
  else if (document.getElementById)	document.getElementById(x).style.visibility = "visible";
}

function hide_menu(x) {
  if (document.all) document.all(x).style.visibility="hidden";
  else if (document.layers) document.layers[x].visibility="hide";
  else if (document.getElementById)	document.getElementById(x).style.visibility = "hidden";
}

function mOver_menu(x,button) {
	if (oldsubmenu != '') {
      hide_menu(oldsubmenu);
	}
	if (oldbutton != '') {
	  changePic(oldbutton,oldbutton+'01');
/*      nereidFade(oldbutton,0,4,10); */
	}
	changePic(button,button+'02');
/*	nereidFade(button,100,4,10); */
    show_menu(x);
    oldsubmenu=x;
	oldbutton=button;
}

function close_all() {
  if (oldsubmenu) hide_menu(oldsubmenu);
  if (oldbutton) changePic(oldbutton,oldbutton+'01');
  memold=oldsubmenu;
  oldsubmenu="";
  oldbutton="";
}

if (document.layers) {
  window.captureEvents(Event.MOUSEDOWN);
  window.onmousedown=close_all;
} else {
  document.onmouseup=close_all;
}


// --- Flash ActionScript 2 Javascript ---//
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

function upper_menu_DoFSCommand(command, args) {
  var upper_menuObj = InternetExplorer ? upper_menu : document.upper_menu;
  if (command == "openMenu") { mOver_menu(args); }
  if (command == "closeAll") { close_all(); }
}

function left_menu_DoFSCommand(command, args) {
  var left_menuObj = InternetExplorer ? left_menu : document.left_menu;
  if (command == "openMenu") { mOver_menu(args); }
  if (command == "closeAll") { close_all(); }
}

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub upper_menu_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call upper_menu_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
	
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub left_menu_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call left_menu_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}
// --- Flash ActionScript 2 Javascript ---//