// menu.js


<!--
 window.onerror = null;
 var bName = navigator.appName;
 var bPlatform = navigator.platform;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (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 NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
 var menuActive = 0;
 var menuOn = 0;
 var onLayer;
 var timeOn = null;
 var loaded = 0;
 var a0, a1;
 var LayerUsed = null; 
 
// MENU COLOR VARIABLE
var menuColor = "#FFFFFF"
var tc1 = "#FFFFFF"


//PRECACHE IMAGES HERE
function LoadImgs(){
  if (document.images || IE4) {
//  menu1 = new Image(); menu1.src = "pix/tbEdgeL.gif";
//  menu2 = new Image(); menu2.src = "pix/tbMarker.gif";
  a0 = new Image(); a0.src="butt_products_off.gif"; a1 = new Image(); a1.src="butt_products_on.gif";
//h0 = new Image(); h0.src="../aunavgif/h.gif"  ; h1 = new Image(); h1.src="../aunavgif/hx.gif";
  loaded = 1;
  
  
  }
LoadNavImgs();
 }

// 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 (menuActive == 0) {
  hideLayer(onLayer)
  }
}

// MENU MOUSE OVER  
function menuOver(itemName) {
if (loaded == 1)
{
 clearTimeout(timeOn)
 menuActive = 1
 if (NS4 || IE4) {
  
  }
 }
}

// MENU MOUSE OUT 
function menuOut(itemName) {
if (loaded == 1 && onLayer != "")
{
  menuActive = 0 
  if (NS4 || IE4) {
   
  timeOn = setTimeout("hideLayer(onLayer)", 700)
 }
}
}


// 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' BGCOLOR='#00659C' CELLSPACING='1' CELLPADDING='2'>"
 endrow = "</TD></TR>"
 btmTable = "</table></TABLE></div>"
 
// bgnrow = "<TR><TD BGCOLOR='#ffffff'></TD><TD></TD></TR><TR><TD bgcolor='" + menuColor +"'>";

 n += topTable  
 for( var i = 0; i <=j; i++) {
 bgnrow = "<TR><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
}

//Menu Arrays
Array.prototype.id = "aMenu"
Array.prototype.imgname = "a"

// PRODUCTS LIST
aMenu = new Array(20)
aMenu.id = "aMenu"
aMenu.imgname = "a"
aMenu[0] = new menuLink("&nbsp;Lathe Machines &nbsp;", "lathe_machines.htm")
aMenu[1] = new menuLink("&nbsp;Drilling Machines &nbsp;", "drilling_machines.htm")
aMenu[2] = new menuLink("&nbsp;Milling Machines &nbsp;", "milling_machines.htm")
aMenu[3] = new menuLink("&nbsp;Grinding Machines &nbsp;", "grinding_machines.htm")
aMenu[4] = new menuLink("&nbsp;Hacksaw-Slotting-Cutting Machines &nbsp;", "hacksaw_slotting_cutting_machines.htm")
aMenu[5] = new menuLink("&nbsp;Shaping-Planing-Planomiller &nbsp;", "shaping_planing_planomiller.htm")
aMenu[6] = new menuLink("&nbsp;Presses &nbsp;", "presses.htm")
aMenu[7] = new menuLink("&nbsp;Coil Winding Machines &nbsp;", "coil_winding_machines.htm")
aMenu[8] = new menuLink("&nbsp;Welding Machines &nbsp;", "welding_machines.htm")
aMenu[9] = new menuLink("&nbsp;Cutoff Machines &nbsp;", "cutoff_machines.htm")
aMenu[10] = new menuLink("&nbsp;Bolt & Pipe Threading Machines &nbsp;", "bolt_pipe_threading_machines.htm")
aMenu[11] = new menuLink("&nbsp;Sheet Metal Machines &nbsp;", "sheet_metal_machines.htm")
aMenu[12] = new menuLink("&nbsp;Pipe Bending Machines &nbsp;", "pipe_bending_machines.htm")
aMenu[13] = new menuLink("&nbsp;Hand Presses-Tor-Toggle-Rod Cutting Machines", "handpresses_tor_machines.htm")
aMenu[14] = new menuLink("&nbsp;Machine Tools & Milling Accessories &nbsp;", "machinetools_milling_acce.htm")
aMenu[15] = new menuLink("&nbsp;Wood Working Machines &nbsp;", "wood_working_machines.htm")
aMenu[16] = new menuLink("&nbsp;Wire Nail Making Machines &nbsp;", "wirenail_making_machines.htm")
aMenu[17] = new menuLink("&nbsp;Bolt & Screw Making Machines &nbsp;", "bolt_screw_making_machines.htm")
aMenu[18] = new menuLink("&nbsp;Garage Workshop Machines &nbsp;", "garage_workshop_machines.htm")
aMenu[19] = new menuLink("&nbsp;Lathe-Milling Adda-Slotting-Grinders-Rivet", "lathe-milling_adda-slotting.htm")
//-->

<!--
document.write(menuMaker("aMenu"))
//-->

