
  var agt = navigator.userAgent.toLowerCase();
  var appVer = navigator.appVersion.toLowerCase();

  var is_minor = parseFloat(appVer);
  var is_major = parseInt(is_minor);

  var is_opera = (agt.indexOf("opera") != -1);

  var is_mac = (agt.indexOf("mac")!=-1);
  var iePos  = appVer.indexOf('msie');
  if (iePos !=-1) {
	if(is_mac) {
		var iePos = agt.indexOf('msie');
		is_minor = parseFloat(agt.substring(iePos+5,agt.indexOf(';',iePos)));
	}
	else is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
	is_major = parseInt(is_minor);
  }

  var is_konq = false;
  var kqPos = agt.indexOf('konqueror');
  if (kqPos !=-1) {                 
	is_konq = true;
	is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));
	is_major = parseInt(is_minor);
  }                                 

  var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;
  var is_khtml = (is_safari || is_konq);

  var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;
  var is_gver = 0;
  if (is_gecko) is_gver=navigator.productSub;

  var is_fb = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (is_gecko) && (navigator.vendor=="Firebird"));

  var is_fx = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (is_gecko) && ((navigator.vendor=="Firefox")||(agt.indexOf('firefox')!=-1)));

  var is_moz = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (is_gecko) && (!is_fb) && (!is_fx) && ((navigator.vendor=="")||(navigator.vendor=="Mozilla")||(navigator.vendor=="Debian")));

  if ((is_moz)||(is_fb)||(is_fx)) {
	var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;
	if (is_fx&&!is_moz_ver) {
		is_moz_ver = agt.indexOf('firefox/');
		is_moz_ver = agt.substring(is_moz_ver+8);
		is_moz_ver = parseFloat(is_moz_ver);
	}
	if (!(is_moz_ver)) {
		is_moz_ver = agt.indexOf('rv:');
		is_moz_ver = agt.substring(is_moz_ver+3);
		is_paren   = is_moz_ver.indexOf(')');
		is_moz_ver = is_moz_ver.substring(0,is_paren);
	}
	is_minor = is_moz_ver;
	is_major = parseInt(is_moz_ver);
  }
  var is_fb_ver = is_moz_ver;
  var is_fx_ver = is_moz_ver;

  var is_ie = ((iePos!=-1) && (!is_opera) && (!is_khtml));

  var is_ie6 = (is_ie && is_major == 6);
  var is_ie6up = (is_ie && is_minor >= 6);

  var is_ie7 = (is_ie && is_major == 7);
  var is_ie7up = (is_ie && is_minor >= 7);

  var is_all = (document.all) ? "true" : "false";
  var is_getElementById = (document.getElementById) ? "true" : "false";


  var bName = navigator.appName;
  var bVer = parseInt(navigator.appVersion);
  var NS6 = (bName == "Netscape" && bVer >= 5);
  var NS4 = (bName == "Netscape" && bVer >= 4 && bVer < 5);
  var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
  var NS3 = (bName == "Netscape" && bVer < 4);
  var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
  var fxpx = ""; if (is_fx == true) { fxpx = "px"; }
  window.onerror = null;
  var menuActive = 0;
  var menuOn = 0;
  var onLayer;
  var timeOn = null;

// LAYER SWITCHING CODE
  if (NS4 || IE4 || NS6) {
	if (navigator.appName == "Netscape" && !document.getElementById) {
		layerStyleRef="layer.";
		layerRef="document.layers";
		styleSwitch="";
		layerVis="show";
		layerHid="hide";
	}
	else if (!document.all && document.getElementById) {
		layerStyleRef="layer.style.";
		layerRef="document.getElementById";
		styleSwitch=".style";
		layerVis="visible";
		layerHid="hidden";
	}
	else {
		layerStyleRef="layer.style.";
		layerRef="document.all";
		styleSwitch=".style";
		layerVis="visible";
		layerHid="hidden";
	}
  }

// SHOW MENU
function shLayer(layerName) {
  img = getImage("imgTabs");
  x = getImagePageLeft(img);
  y = getImagePageTop(img);// alert(bName + " " + bVer + is_ie + is_fx + IE4 + NS6 + " " + x + " " + y);
  menuTop = y + 23; // LAYER TOP POSITION
  aboutL = x + 32;
  eventsL = x + 146;
  constructionL = x + 238;
  travelL = x + 357;
  shuttleL = x + 507;

if (NS4 || IE4 || NS6) {
  if (timeOn != null) {
	clearTimeout(timeOn);
	hideLayer(onLayer);
  }
  if ((NS4 || IE4) && is_fx == false) {
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top="'+menuTop+'"');
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
  } 
  if (NS6 || is_fx == true) {
	eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerVis+'"');
	eval(layerRef+'("'+layerName+'")'+styleSwitch+'.top="'+menuTop+fxpx+'"');
	eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+fxpx+'"');
  } 
  onLayer = layerName;
  }
}

// HIDE MENU
function hideLayer(layerName) {
  if (menuActive == 0) {
	if (NS4 || IE4) {
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
	}
	if (NS6) {
		eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerHid+'"');
	}
  }
}

// TIMER FOR BUTTON MOUSE OUT
function btnTimer() { timeOn = setTimeout("btnOut()",20); }

// BUTTON MOUSE OUT
function btnOut(layerName) {
  if (menuActive == 0) { hideLayer(onLayer); }
}

// MENU MOUSE OVER 
function menuOver(itemName) {
  clearTimeout(timeOn);
  menuActive = 1;
}

// MENU MOUSE OUT 
function menuOut(itemName) {
  menuActive = 0;
  timeOn = setTimeout("hideLayer(onLayer)", 100);
}

function getImage(name) {
  if (NS4 || NS6) { return findImage(name, document); }
  if (IE4 || NS6) 
	return eval('document.all.' + name);
  return null;
}

function findImage(name, doc) {
  var i, img;
  for (i = 0; i < doc.images.length; i++)
    if (doc.images[i].name == name)
      return doc.images[i];
  for (i = 0; i < doc.layers.length; i++)
    if ((img = findImage(name, doc.layers[i].document)) != null) {
      img.container = doc.layers[i];
      return img;
    }
  return null;
}

function getImagePageLeft(img) {
  var x, obj;// alert(is_fx + " " + x);
  if ((NS4 || NS6) && is_fx == false) {
    if (img.container != null)
      return img.container.pageX + img.x - 1;
    else
      return img.x - 1;
  }
  if (IE4 || is_fx == true) {
    x = 0;
    obj = img;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}

function getImagePageTop(img) {
  var y, obj;
  if ((NS4 || NS6) && is_fx == false) {
    if (img.container != null)
      return img.container.pageY + img.y;
    else
      return img.y;
  }
  if (IE4 || is_fx == true) {
    y = 0;
    obj = img;
    while (obj.offsetParent != null) {
      y += obj.offsetTop;
      obj = obj.offsetParent;
    }
    y += obj.offsetTop;
    return y;
  }
  return -1;
}


var soundArray = new Array("images/buttons/ding.wav");
//soundArray[0] = "images/buttons/ding.wav";

document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE") != -1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload = auPreload;

function auPreload() {
  if (!ver4) return;
  if (NS) auEmb = new Layer(0,window);
  else {
	Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
	document.body.insertAdjacentHTML("BeforeEnd", Str);
  }
  var Str = '';
  for (i=0; i<soundArray.length; i++);
  Str += "<EMBED SRC='" + soundArray[i] + "' AUTOSTART='FALSE' HIDDEN='TRUE' VOLUME=50 width=1 height=1>";
  if (IE) auEmb.innerHTML = Str;
  else {
	auEmb.document.open();
	auEmb.document.write(Str);
	auEmb.document.close();
  }
  auCon = IE? document.all.auIEContainer:auEmb;
  auCon.control = auCtrl;
}

function auCtrl(whSound,play) {
  if (IE) this.src = play? soundArray[whSound]:'';
  else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"));
}

function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }


function message(txt) { window.status = txt; }
function remove_message() { window.status = ""; }

