// 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, b0, b1;

 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="images/butt_company_off1.gif"; a1 = new Image(); a1.src="images/butt_company_on1.gif";

  b0 = new Image(); b0.src="images/butt_products_off1.gif"; b1 = new Image(); b1.src="images/butt_products_on1.gif";

  c0 = new Image(); c0.src="images/butt_services_off1.gif"; c1 = new Image(); c1.src="images/butt_services_on1.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='#cccccc' 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"



// COMPANY

aMenu = new Array(3)

aMenu.id = "aMenu"

aMenu.imgname = "a"

aMenu[0] = new menuLink("&nbsp;History &nbsp;", "company-history.html")

aMenu[1] = new menuLink("&nbsp;Our Management Team &nbsp;", "company-management.html")

aMenu[2] = new menuLink("&nbsp;Our Vision &nbsp;", "company-vision.html")


//-->



// PRODUCTS

bMenu = new Array(4)

bMenu.id = "bMenu"

bMenu.imgname = "b"

bMenu[0] = new menuLink("&nbsp;Aviation Refuelling &nbsp;", "products-aircraff.html")

bMenu[1] = new menuLink("&nbsp;Ground Support Equipments &nbsp;", "products-ground.html")

bMenu[2] = new menuLink("&nbsp;Equipments Products &nbsp;", "products-defence.html")

bMenu[3] = new menuLink("&nbsp;Precision Engineering Products &nbsp;", "products-precision.html")

//-->



// SERVICES

cMenu = new Array(4)

cMenu.id = "cMenu"

cMenu.imgname = "c"

cMenu[0] = new menuLink("&nbsp;General Services &nbsp;", "services-general.html")

cMenu[1] = new menuLink("&nbsp;Trade Services &nbsp;", "services-trade.html")

cMenu[2] = new menuLink("&nbsp;Distributorship &nbsp;", "services-distributor.html")

cMenu[3] = new menuLink("&nbsp;Representation &nbsp;", "services-representation.html")

//-->



<!--

document.write(menuMaker("aMenu"))

document.write(menuMaker("bMenu"))

document.write(menuMaker("cMenu"))

//-->



