// Menu functionality Script // Invensys Menu Data // Menu Data alter the following data to change the menu items. // Replace ITEM1, ITEM2, etc. with the item names, and URL1, URL2, etc. with the location of the target page. // arMenu1 - 5 refer to the five menus displayed. // Any items that are empty strings mean that they are using default values as set in the script below. // A list of argument values which may need to be changed are shown below: // arMenu[ref] = new Array("[width]","[x position]","[y position]","","","","","","","[item name]","[item url]",0, [add as many items as required] ); // We've got problems with the menus so I've copied in one that I think works for checking. arMenu1 = new Array("",80,85,"","","","","","","What's new","/DEPT/Marketing/common/datasheets.nsf/sundry+information/new?opendocument",0,"IRSE News","/wsa/pageswest.nsf/pages/irse.htm",0,"Press Releases","/DEPT/Marketing/common/datasheets.nsf/pressviewdoc?openpage",0,"Coming Events","/DEPT/Marketing/common/datasheets.nsf/comingviewdoc?openpage",0); arMenu2 = new Array("",175,85,"","","","","","","Company profile","/wsa/pageswest.nsf/pages/FoxT_profile.htm",0,"Conditions","/wsa/pageswest.nsf/pages/conditions.htm",0); arMenu3 = new Array(150,270,85,"","","","","","","Overview","/wsa/pageswest.nsf/pages/FoxT_systems.htm",0,"RailSCADA","/wsa/pageswest.nsf/pages/FoxT_SCADA.htm",0,"Power Remote Control","/wsa/pageswest.nsf/pages/FoxT_PRC.htm",0,"Integrated Control Centres","/wsa/pageswest.nsf/pages/FoxT_ICS.htm",0,"Data & Infomation","/FXT/FoxTDynamicWeb.nsf/DataSheetsViewDoc?OpenPage",0); arMenu4 = new Array(130,380,85,"","","","","","","Overview","/wsa/pageswest.nsf/pages/FoxT_Solutions.htm",0,"Systems","/wsa/pageswest.nsf/pages/FoxT_Systems.htm",0,"Case studies","/FXT/FoxTDynamicWeb.nsf/CaseStudyViewDoc?OpenPage",0,"Technical papers","/FXT/FoxTDynamicWeb.nsf/PapersViewDoc?Openpage",0,"Data & Infomation","/FXT/FoxTDynamicWeb.nsf/DataSheetsViewDoc?OpenPage",0); arMenu5 = new Array("",500,85,"","","","","","","Contact details","/wsa/pageswest.nsf/pages/FoxT_contacts.htm",0,"Job Opportunities","/DEPT/Marketing/common/datasheets.nsf/PositionsViewDoc?Openpage",0,"Links","/wsa/pageswest.nsf/pages/links.htm",0); arMenu6 = new Array("",0,85,"","","","","","","Control Group","/wsa/pageswest.nsf/pages/FoxT_home.htm",0,"Signal Group","/wsa/pageswest.nsf/pages/WSA_index.htm",0,"IRSA","/wsa/pageswest.nsf/pages/index.htm",0,"IRS","\http://www.invensysrail.com",0,"Invensys","http://www.invensys.com",0); // Menu display variables // The menu system has been changed so that the static menu item "MENU1", "MENU2", etc., below are now hyperlinks to section pages // rather than null links as before. So a menu item "Products" would link to a "Product Overview" page from which all the menu items // in the Products menu are also linked. We strongly urge site owners to use this feature to ensure compatibility with all browsers // and all search engine spiders (including the Invensys search engine). // For an example of how this works visit: www.invensys.com and click on any of the top menu links (rather than a drop-down link). var displaymenu=""; displaymenu+=""; displaymenu+=""; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; // Removed customer service from here displaymenu+=" "; displaymenu+=" "; displaymenu+="
"; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+=" "; displaymenu+="
"; // Null function to prevent href links function nullLink(){ } // Default menu settings //Modified by Xavier Flix - xFX JumpStart (http://www.xfx.net) var BV=parseInt(navigator.appVersion); var BN=window.navigator.appName; var IsWin=(navigator.userAgent.indexOf('Windows')!=-1)?true:false; var OP=(navigator.userAgent.indexOf('Opera')!=-1&&BV>=4)?true:false; var NS4=(BN.indexOf('Netscape')!=-1&&(BV==4)&&!OP)?true:false; var SM=(BN.indexOf('Netscape')!=-1&&(BV>=5)||OP)?true:false; var IE4=(BN.indexOf('Explorer')!=-1&&(BV>=4)||SM)?true:false; isMac = (navigator.appVersion.indexOf("Mac") != -1); isMIE = (navigator.appName == "Microsoft Internet Explorer"); isMenu = (NS4 || (IE4 && !isMac)); ver4 = (NS4 || IE4); var pMenu4SM; function displayMenu(){return}; function hideMenu(){return}; if(!ver4) event = null; // code altered by Keith Harris on 28.9.00 // if brackets commented out to // help fail-safe on Mac browsers // if(isMenu) { menuVersion = 3; menuWidth = 90; childOverlap = 50; childOffset = 5; perCentOver = null; secondsVisible = .3; fntCol = "#ffffff"; fntSiz = "7"; fntBold = true; fntItal = false; fntFam = "verdana"; backCol = "#0071BA"; overCol = "#999999"; overFnt = "#0071BA"; borWid = 0; borCol = "black"; borSty = "solid"; itemPad = 3; imgSrc = ""; imgSiz = 10; separator = 0; separatorCol = "#999999"; isFrames = false; navFrLoc = "left"; keepHilite = true; NSfontOver = true; clickStart = false; clickKill = false; // } // Main code loader = (isFrames)?((NS4)?parent:parent.document.body):window; loader.onload = startIt; if(NS4){ origWidth = loader.innerWidth; origHeight = loader.innerHeight; loader.onresize = reDo; } isLoaded = false; NSresized = false; if(!window.menuVersion) clickKill = showVisited = NSfontOver = keepHilite = clickStart = false; if(!window.imgHspace) imgHspace=0; isWin = (navigator.appVersion.indexOf("Win") != -1) if(!isWin && !isMac) NSfontOver = showVisited = false; mSecsVis = secondsVisible*1000; isRight = (window.navFrLoc && navFrLoc == "right"); imgSuf = (isRight)?">" :" ALIGN=RIGHT>"; imgStr = ""+ imgStr +""; areCreated = false; menuLoc = null; function initVars() { if(areCreated) { for(i=1; i 1)?menu.item:null; itemName = "item" + menuCount + "_" + menu.itemCount; menu.item = makeElement(itemName,null,null,menu); menu.item.prevItem = prevItem; menu.item.setup = itemSetup; menu.item.setup(menu.itemCount,menu.array); if(menu.item.hasMore) { makeMenuNS(true,menuCount + "_" + menu.itemCount,menu,menu.item); menu = menu.parentMenu; } } menu.lastItem = menu.item; menu.setup(isChild,parMenu,parItem); } function findTree(men){ foundTree = false; for(i=11;i" + htmStr + "
"; cmdTop += 18; if(hasMore) { makeMenuIE(true,menuCount + "_" + menu.itemCount,menu); menu = menu.parentMenu; } } menu.innerHTML = menu.itemStr; if(SM) { var j=0; pMenu4SM = menu; itemColl = menu.childNodes; for(i=0; i"; menuLoc.document.body.insertAdjacentHTML("BeforeEnd",elStr); } if(isFrames) eval(whichEl + "= menuLoc." + whichEl); } return eval(whichEl); } function itemSetup(whichItem,whichArray) { this.onmouseover = itemOver; this.onmouseout = itemOut; this.container = NS4?this.parentLayer:(SM?pMenu4SM:this.offsetParent); arrayPointer = (this.container.hasParent)?(whichItem-1)*3:((whichItem-1)*3)+9; this.dispText = whichArray[arrayPointer]; this.linkText = whichArray[arrayPointer + 1]; this.hasMore = whichArray[arrayPointer + 2]; if(IE4 && this.hasMore) { this.child = eval("Menu" + this.id.substr(4)); this.child.parentMenu = this.container; this.child.parentItem = this; } if(this.linkText) { if(NS4) { this.captureEvents(Event.MOUSEUP) this.onmouseup = linkIt; } else { this.onclick = linkIt; this.style.cursor = SM?"default":"hand"; } } if(NS4) { htmStr = this.dispText; if(fntBold) htmStr = htmStr.bold(); if(fntItal) htmStr = htmStr.italics(); htmStr = "" + htmStr+ ""; this.htmStrOver = htmStr.fontcolor(this.container.menuFontOver); this.htmStr = htmStr.fontcolor(this.container.menuFontColor); if(this.hasMore) { this.document.write(imgStr); this.document.close(); } this.visibility = "inherit"; this.bgColor = this.container.menuBGColor; if(whichItem == 1) { this.top = borWid + itemPad; } else { this.top = this.prevItem.top + this.prevItem.clip.height + separator; } this.left = borWid + itemPad; this.clip.top = this.clip.left = -itemPad; this.clip.right = this.container.menuWidth-(borWid*2)-itemPad; maxTxtWidth = this.container.menuWidth-(borWid*2)-(itemPad*2); if(this.container.isTree) maxTxtWidth-=(fullImgSize); this.txtLyr = new Layer(maxTxtWidth,this); if(isRight && this.container.isTree) this.txtLyr.left = fullImgSize; this.txtLyr.document.write(this.htmStr); this.txtLyr.document.close(); this.txtLyr.visibility = "inherit"; this.clip.bottom = this.txtLyr.document.height+itemPad; this.dummyLyr = new Layer(100,this); this.dummyLyr.left = this.dummyLyr.top = -itemPad; this.dummyLyr.clip.width = this.clip.width; this.dummyLyr.clip.height = this.clip.height; this.dummyLyr.visibility = "inherit"; } else { with(this.style) { padding = itemPad; if(this.container.isTree && !this.hasMore) { if(isRight) paddingLeft = itemPad+fullImgSize; else paddingRight = itemPad+fullImgSize; } color = this.container.menuFontColor; fontSize = fntSiz + "pt"; fontWeight = fntBold?"bold":"normal"; fontStyle = fntItal?"italic":"normal"; fontFamily = fntFam; borderBottomWidth = separator + "px"; borderBottomColor = this.container.menuSeparatorCol; borderBottomStyle = "solid"; backgroundColor = this.container.menuBGColor; } } } function menuSetup(hasParent,openCont,openItem) { this.onmouseover = menuOver; this.onmouseout = menuOut; this.showIt = showIt; this.keepInWindow = keepInWindow; this.hideTree = hideTree this.hideParents = hideParents; this.hideChildren = hideChildren; this.hideTop = hideTop; this.hasChildVisible = false; this.isOn = false; this.hideTimer = null; this.childOverlap = (perCentOver != null)?((perCentOver/100) * this.menuWidth):childOverlap; this.currentItem = null; this.hideSelf = hideSelf; if(hasParent) { this.hasParent = true; this.parentMenu = openCont; if(NS4) { this.parentItem = openItem; this.parentItem.child = this; } } else this.hasParent = false; if(NS4) { this.bgColor = this.menuBorCol; this.fullHeight = this.lastItem.top + this.lastItem.clip.bottom + borWid; this.clip.right = this.menuWidth; this.clip.bottom = this.fullHeight; } else { with(this.style) { width = this.menuWidth; borderWidth = borWid; borderColor = this.menuBorCol; borderStyle = borSty; zIndex = topZ; } this.lastItem.style.border=""; this.fullHeight = this.scrollHeight; this.showIt(false); this.onselectstart = cancelSelect; this.moveTo = moveTo; this.moveTo(0,0); } } function displayMenu(e,menuName){ if(isMac && isMIE) return; if(NS4 && NSresized) startIt(); if(!isLoaded) return; linkEl = (NS4||SM)?e.target:event.srcElement; if(clickStart) linkEl.onclick = popMenu; if(!beingCreated && !areCreated) startIt(); linkEl.menuName = menuName; if(!clickStart) popMenu(e); } function popMenu(e){ if(!isLoaded || !areCreated) return true; eType = (NS4||SM)?e.type:event.type; if(clickStart && eType != "click") return true; hideAll(); linkEl = (NS4||SM)?e.target:event.srcElement; if(SM) currentMenu = menuLoc.document.getElementById(linkEl.menuName); else currentMenu = eval(linkEl.menuName); currentMenu.hasParent = false; currentMenu.treeParent.startChild = currentMenu; if(IE4) menuLocBod = menuLoc.document.body; if(!isFrames) { xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?e.pageX:(event.clientX + menuLocBod.scrollLeft); yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?e.pageY:(event.clientY + menuLocBod.scrollTop); } else { switch(navFrLoc) { case "left": xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?menuLoc.pageXOffset:menuLocBod.scrollLeft; yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?(e.pageY-pageYOffset)+menuLoc.pageYOffset:event.clientY + menuLocBod.scrollTop; break; case "top": xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?(e.pageX-pageXOffset)+menuLoc.pageXOffset:event.clientX + menuLocBod.scrollLeft; yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?menuLoc.pageYOffset:menuLocBod.scrollTop; break; case "bottom": xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?(e.pageX-pageXOffset)+menuLoc.pageXOffset:event.clientX + menuLocBod.scrollLeft; yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?menuLoc.pageYOffset+menuLoc.innerHeight:menuLocBod.scrollTop + menuLocBod.clientHeight; break; case "right": xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?menuLoc.pageXOffset+menuLoc.innerWidth:menuLocBod.scrollLeft+menuLocBod.clientWidth; yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?(e.pageY-pageYOffset)+menuLoc.pageYOffset:event.clientY + menuLocBod.scrollTop; break; } } currentMenu.moveTo(xPos,yPos); currentMenu.keepInWindow() currentMenu.isOn = true; currentMenu.showIt(true); return false; } function menuOver(e) { this.isOn = true; isOverMenu = true; currentMenu = this; if(this.hideTimer) clearTimeout(this.hideTimer); } function menuOut() { if(IE4&&!SM) { theEvent = menuLoc.event; if(theEvent.srcElement.contains(theEvent.toElement)) return; } this.isOn = false; isOverMenu = false; menuLoc.status = ""; if(!clickKill) allTimer = setTimeout("currentMenu.hideTree()",10); } function itemOver(e) { if(keepHilite) { if(this.container.currentItem && this.container.currentItem != this) { if(NS4) { this.container.currentItem.bgColor = this.container.menuBGColor; if(NSfontOver) with(this.container.currentItem.txtLyr.document) { write(this.container.currentItem.htmStr) close(); } } else with(this.container.currentItem.style) { backgroundColor = this.container.menuBGColor; color = this.container.menuFontColor; } } } if(IE4) { theEvent=SM?e:menuLoc.event; theEventTarget = SM?theEvent.target.tagName:theEvent.srcElement.tagName; if(theEventTarget == "IMG") return; this.style.backgroundColor = this.container.menuBGOver; this.style.color = this.container.menuFontOver; if(SM) this.style.cursor = "default"; } else { this.bgColor = this.container.menuBGOver; if(NSfontOver) { this.txtLyr.document.write(this.htmStrOver); this.txtLyr.document.close(); } } menuLoc.status = this.linkText; this.container.currentItem = this; if(this.container.hasChildVisible) { this.container.hideChildren(this); } if(this.hasMore) { horOffset = (isRight)?(this.container.childOverlap - this.container.menuWidth):(this.container.menuWidth - this.container.childOverlap); if(NS4) { this.childX = this.container.left + horOffset; this.childY = (this.pageY+this.clip.top) + childOffset; } else { this.childX = this.container.style.pixelLeft + horOffset; this.childY = this.offsetTop + this.container.style.pixelTop + childOffset + borWid; } this.child.moveTo(this.childX,this.childY); this.child.keepInWindow(); this.container.hasChildVisible = true; this.container.visibleChild = this.child; this.child.showIt(true); } } function itemOut(e) { if(IE4) { theEvent=SM?e:menuLoc.event; theEventTarget = SM?theEvent.target:theEvent.srcElement; if(!SM) { //This code is not portable to SeaMonkey DOM if(theEvent.srcElement.contains(theEvent.toElement) || (theEvent.fromElement.tagName=="IMG" && theEvent.toElement.contains(theEvent.fromElement))) return; } if(!keepHilite) { this.style.backgroundColor = this.container.menuBGColor; this.style.color = this.container.menuFontColor; } } else { if(!keepHilite) { this.bgColor = this.container.menuBGColor; if(NSfontOver) { with(this.txtLyr.document) { write(this.htmStr); close(); } } } if(!isOverMenu && !clickKill) { allTimer = setTimeout("currentMenu.hideTree()",10); } } } function moveTo(xPos,yPos) { if(SM) { this.style.left = xPos; this.style.top = yPos; } else { this.style.pixelLeft = xPos; this.style.pixelTop = yPos; } } function showIt(on) { if(NS4) { this.visibility = on?"show":"hide"; if(keepHilite && this.currentItem) { this.currentItem.bgColor = this.menuBGColor; if(NSfontOver) { with(this.currentItem.txtLyr.document) { write(this.currentItem.htmStr); close(); } } } } else { this.style.visibility = on?"visible":"hidden"; if(keepHilite && this.currentItem) { with(this.currentItem.style) { backgroundColor = this.menuBGColor; color = this.menuFontColor; } } } this.currentItem = null; } function keepInWindow() { scrBars = 20; botScrBar = (isFrames && navFrLoc=="bottom")?(borWid*2):scrBars; rtScrBar = (isFrames && navFrLoc=="right")?(borWid*2):scrBars; if(NS4) { winRight = (menuLoc.pageXOffset + menuLoc.innerWidth) - rtScrBar; rightPos = this.left + this.menuWidth; if(rightPos > winRight) { if(this.hasParent) { parentLeft = this.parentMenu.left; newLeft = ((parentLeft-this.menuWidth) + this.childOverlap); this.left = newLeft; } else { dif = rightPos - winRight; this.left -= dif; } } winBot = (menuLoc.pageYOffset + menuLoc.innerHeight) - botScrBar ; botPos = this.top + this.fullHeight; if(botPos > winBot) { dif = botPos - winBot; this.top -= dif; } winLeft = menuLoc.pageXOffset; leftPos = this.left; if(leftPos < winLeft) { if(this.hasParent) { parentLeft = this.parentMenu.left; newLeft = ((parentLeft+this.menuWidth) - this.childOverlap); this.left = newLeft; } else { this.left = 5; } } } else { if(SM) winRight = (menuLoc.pageXOffset + menuLoc.innerWidth) - rtScrBar; else winRight = (menuLoc.document.body.scrollLeft + menuLoc.document.body.clientWidth) - rtScrBar; rightPos = this.style.pixelLeft + this.menuWidth; if(rightPos > winRight) { if(this.hasParent) { parentLeft = this.parentMenu.style.pixelLeft; newLeft = ((parentLeft - this.menuWidth) + this.childOverlap); this.style.pixelLeft = newLeft; } else { dif = rightPos - winRight; this.style.pixelLeft -= dif; } } if(SM) winBot = (menuLoc.pageYOffset + menuLoc.innerHeight) - botScrBar ; else winBot = (menuLoc.document.body.scrollTop + menuLoc.document.body.clientHeight) - botScrBar; botPos = this.style.pixelTop + this.fullHeight; // if(botPos > winBot) { // dif = botPos - winBot; // this.style.pixelTop -= dif; // } if(SM) winLeft = menuLoc.pageXOffset; else winLeft = menuLoc.document.body.scrollLeft; leftPos = this.style.pixelLeft; if(leftPos < winLeft) { if(this.hasParent) { parentLeft = this.parentMenu.style.pixelLeft; newLeft = ((parentLeft+this.menuWidth) - this.childOverlap); this.style.pixelLeft = newLeft; } else { this.style.pixelLeft = 5; } } } } function linkIt() { if(this.linkText.indexOf("javascript:")!=-1) eval(this.linkText) else menuLoc.location.href = this.linkText; } function hideMenu(menuName){ if(!isLoaded || !areCreated) return; if(SM) whichEl = menuLoc.document.getElementById(menuName); else whichEl = eval(menuName); whichEl.isOn = false; if(!clickKill) whichEl.hideTop(); } function hideAll() { for(i=1; i