
 window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var bPlatform = navigator.platform;
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
 // Special case for explorer 4 on the Mac - it doesn't support Layers well at all!
 if (bPlatform == "MacPPC" && IE4 != "") {
 	IE4 = "";
 }
 var menuActive = 0;
 var menuOn = 0;
 var onLayer;
 var timeOn = null;
 var loaded = 0;
 var a0, a1, b0, b1, c0, c1, d0, d1, e0, e1, f0, f1, g0, g1, h0, h1;
 var LayerUsed = null; 

// MENU COLOR VARIABLE
var menuColor = "#FFFF00"


// LAYER SWITCHING CODE
if (NS4 || IE4) {
 if (navigator.appName == "Netscape") {
  layerStyleRef="layer.";
  layerRef="document.layers";
  styleSwitch="";
  }else{
  layerStyleRef="layer.style.";
  layerRef="document.all";
  styleSwitch=".style";
 }
}
  
// SHOW MENU
function showLayer(layerName){
if (loaded == 1)
{
 if (NS4 || IE4) {
  if (timeOn != null) {
   clearTimeout(timeOn)
   hideLayer(onLayer)
  }
  if (NS4 || IE4) {
   eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
  }   
  onLayer = layerName
  LayerUsed = true;
  }
 }
}

//BUTTON ROLLOVER
function change(Name, No) {
 if (document.images && (loaded == 1)) {
   document[Name].src = eval(Name + No + ".src");
  }
  return true;
}

// HIDE MENU
function hideLayer(layerName){
 if (loaded == 1 && LayerUsed != null)
 {
  if (menuActive == 0) {
   if (NS4 || IE4) {
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
   }
  }
 }
}

// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
 timeOn = setTimeout("btnOut()",1000)
}

// BUTTON MOUSE OUT
function btnOut(layerName) {
 if (loaded == 1 && menuActive == 0) {
  hideLayer(onLayer)
 }
}

// MENU MOUSE OVER  
function menuOver(itemName) {
if (loaded == 1)
{
 clearTimeout(timeOn)
 menuActive = 1
 if (NS4 || IE4) {
  if (NS4) {
    document[onLayer].document.images[itemName].src = menu2.src
   } else {
     document.all[itemName].src = menu2.src
   }
  }
 }
}

// MENU MOUSE OUT 
function menuOut(itemName) {
if (loaded == 1 && onLayer != "")
{
  menuActive = 0 
  if (NS4 || IE4) {
   if (NS4) {
    document[onLayer].document.images[itemName].src = menu1.src
	} else {
     document.all[itemName].src = menu1.src
	}
  }
  timeOn = setTimeout("hideLayer(onLayer)", 400)
 }
}

// Creates menu object
function menuLink(title, url) {
 this.title = title
 this.url = url
}

// Builds menu TABLE
function menuMaker(menuArray) {
 n = ""
 j = eval(menuArray + ".length") - 1;
 topTable = "<div ID='" + eval(menuArray + ".id") + "'><TABLE  BORDER='0' CELLSPACING='0' CELLPADDING='0'>"
 endrow = "</TD><TD></TD></TR>"
 btmTable = "</TABLE></div>"
 
 n += topTable
 for( var i = 0; i <=j; i++) {
  bgnrow = "<TR><TD BGCOLOR='#330099'></TD><TD BGCOLOR='#330099'></TD><TD></TD></TR><TR><TD BGCOLOR='#FFFF00'><IMG src='images/trim.gif' WIDTH=18 HEIGHT=15 ALT='' BORDER='0' name='" + eval(menuArray + ".imgname") + i + "'></TD><TD bgcolor='" + menuColor +"'>";
  n += bgnrow + "<A ID='menuLink' HREF='" + eval(menuArray + "[" + i + "].url") + "' onMouseOver='menuOver(\"" + eval(menuArray + ".imgname") + i + "\")' onMouseOut='menuOut(\"" + eval(menuArray + ".imgname") + i + "\")' class='menus' TARGET='_top'>" + eval(menuArray + "[" + i + "].title") + "</a>" + endrow;
 }
 n += btmTable
 return n
}


