//-- javascript menu.jvs //-- objects to work with MENU and SUB-MENU window.onerror = null; var menuActive = 0; // 0 = NO SUB-MENU ACTIVATED var onLayer; // NAME OF THE ACTIVATED SUB-MENU var timeOn = null; var bNN4 = (navigator.appName == "Netscape" && parseInt( navigator.appVersion) >= 4); var itemNameLast= null var menuColor = "#ffffff" // MENU COLOR TD BG - DEFA LEFT MENU var menuBGcol = "#669999" // MENU COLOR TABLE BG - DEFA LEFT MENU var menuClass = "menusub" // MENU TEXT - DEFA LEFT MENU var menuBorder= "border-bottom:1px solid white" var menuTarget= "right" // MENU TARGET - DEFA LEFT MENU var menuWidth = 202 // MENU WIDTH - DEFA LEFT MENU var menuHeigth= 18 // MENU HEIGTH - DEFA LEFT MENU var mMarkN = "afbeeldingen/markernone.gif" var z0, z1, zMenu //-- NAVIGATION MENU SUB-ITEM DEFINITION zMenu = new Array(5) zMenu.id = "zMenu" zMenu.imgname = "z" zMenu[0] = new menuLink( "Kenniscentrum" , "p-ken-fb.htm") zMenu[1] = new menuLink( "Uw RPV" , "p-uwr-fb.htm") zMenu[2] = new menuLink( "Monitoring" , "p-mon-fb.htm") zMenu[3] = new menuLink( "Activiteitenplan" , "p-wpl-fb.htm") zMenu[4] = new menuLink( "Organisatie POV" , "p-org-fb.htm") //-- NAVIGATION MENU MAIN IMAGES BUTTONS PRECACHE function LoadNav(){ z0 = new Image(); z0.src= "afbeeldingen/menu-0.jpg"; z1 = new Image(); z1.src= "afbeeldingen/menu-1.jpg"; } //-- LAYER SWITCHING CODE FOR CROSS BROWSER USE if (bNN4) { layerStyleRef="layer."; layerRef="document.layers"; styleSwitch=""; } else { layerStyleRef="layer.style."; layerRef="document.all"; styleSwitch=".style"; } //-- ACTION MENU ROLLOVER function change(elementName, itemName, No) { if (bNN4) { document[elementName].document.images[itemName].src = eval(itemName + No + ".src") } else { document.all[itemName].src = eval(itemName + No + ".src") } return true; } //-- ACTION MENU MouseOut function btnTimer() { timeOn = setTimeout( "btnOut()", 500) } //-- ACTION FOLLWING MENU MouseOut function btnOut(layerName) { if ( menuActive == 0) { hideLayer( onLayer) } } //-- SHOW MENU-SUB ITEMS function showLayer( layerName){ if (timeOn != null) { clearTimeout( timeOn) hideLayer( onLayer) } eval( layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"'); onLayer = layerName } //-- HIDE MENU-SUB ITEMS function hideLayer( layerName){ if (layerName!= null) { if ( menuActive == 0) { eval( layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"'); } } } //-- ACTION MENU-SUB Click HREF CHANGE DEPENDS ON MENU TYPE function menuRun( strURL, strLocation) { if (strLocation== "right") { parent.nFrameRight.location.href= strURL } if (strLocation== "self") { location.href= strURL } if (strLocation== "_parent") { parent.location.href= strURL } } //-- ACTION MENU-SUB MouseOver function menuOver( itemName) { clearTimeout( timeOn) if ( itemName >= "p0" ) { // MARKER CHOICE mMark = "afbeeldingen/bullet-wit.gif" } else { mMark = "afbeeldingen/bullet2.gif" } menuActive = 1 if ( itemNameLast != null) { // REMOVE LAST MARKER if (bNN4) { document[onLayer].document.images[itemNameLast].src = mMarkN } else { document.all[itemNameLast].src = mMarkN } } if (bNN4) { // SET NEW MARKER document[onLayer].document.images[itemName].src = mMark } else { document.all[itemName].src = mMark } itemNameLast= itemName } //-- ACTION MENU-SUB MouseOut function menuOut(itemName) { menuActive = 0 timeOn = setTimeout( "hideLayer(onLayer)", 500) } //-- CREATES LINK IN SUB-MENU function menuLink(title, url) { this.title = title this.url = url } //-- BUILD MENU-SUB TABLE WITH ALL OPTIONS function menuMaker( menuArray) { n = "" if ( eval( menuArray+ ".id")== "zMenu") { // SET FOR NAV MENU mColor = "#669999" mBGcol = "#ffffff" mClass = "menusub1" mBorder= menuBorder mWidth = 100 mHeigth= 18 mLoca = "_parent" } else { // SET FOR OTHER MENU mColor = menuColor mBGcol = menuBGcol mClass = menuClass mBorder= menuBorder mWidth = menuWidth mHeigth= menuHeigth mLoca = menuTarget } j = eval(menuArray + ".length") - 1; n = "" return n }