/* FILE ARCHIVED ON 1:02:31 Nov 3, 2016 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 16:07:15 Jun 24, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ // This javascript controls the menuing actions on the client. This code is responsible // for: preloading menu images, showing the selected image when a main menu item is selected and also shows the correct // submenu for the selected menu item. On mouseout events and upon entering a page, this code // will re-display the selected image, show the corresponding submenu and highlight the actual // submenu item that corresponds to the page being displayed function isMobile() { if (typeof isMobileBrowser=="undefined") { return false; } return isMobileBrowser; } // Method to preload menu images which increases performance function preLoadMenuImages() { if (isMobile()) return; var doc = document; if (doc.images) { if (!doc.imgPreloadArray) { doc.imgPreloadArray = new Array(); var i, j = doc.imgPreloadArray.length, args = preloadImages.arguments; for (i = 0; i < args.length; i++) { if (args[i].indexOf("#") != 0) { doc.imgPreloadArray[j] = new Image; doc.imgPreloadArray[j++].src = args[i]; alert("here"); } } } } } /** * Preloads all named images for the page on which it is called. Use this function to * increase performance by preloading all images to be used for the given page, Thus * reducing the time required to find and load the images when they are needed. * * @param args A comma-delimited list of fully-qualified image names. These names * may use either absolute or relative path names. * * Example: */ function preloadImages() { // v3.0 var doc = document; if (doc.images) { if (!doc.imgPreloadArray) { doc.imgPreloadArray = new Array(); var i, j = doc.imgPreloadArray.length, args = preloadImages.arguments; for (i = 0; i < args.length; i++) { if (args[i].indexOf("#") != 0) { doc.imgPreloadArray[j] = new Image; doc.imgPreloadArray[j++].src = args[i]; } } } } } // Method that loops through array of images and calls method to preload images function bldPreLoadImages() { for ( var i = 1; i < menu.length; i++) { preloadImages(menu[i].selectedImg); preloadImages(menu[i].unselectedImg); } } // Method that will be called by body-onload and mouseout. This method will call the // 'private' method to display the proper mainmenu, submenu and submenuitem. function showMenuForPage() { if (isMobile()) return; privateShowMenuForPage(currentMainMenuItemName, currentSubMenuItemName); } // Method to add elements to the structure. function addMenuData(amainmenuIdName, aselectedImg, aunselectedImg, asubmenuDivName) { if (isMobile()) return; menu[menu.length] = { mainmenuIdName: amainmenuIdName, selectedImg: aselectedImg, unselectedImg: aunselectedImg, submenuDivName: asubmenuDivName} ; } // Method to show image for selected main menu item and the submenu for that main menu function showMainmenu(selectedMenuItem) { if (isMobile()) return; // First turn off any timers that may be turned on from a mouseout event if(timerID) { clearTimeout(timerID); timerID = 0; } // Loop and set all main menu images to unselected, set all submenus invisible, // and get the numeric value needed for the index from the string passed in for ( var i = 1; i < menu.length; i++) { if (document.getElementById(menu[i].mainmenuIdName) !=null) document.getElementById(menu[i].mainmenuIdName).src=menu[i].unselectedImg; if (document.getElementById(menu[i].submenuDivName) !=null) document.getElementById(menu[i].submenuDivName).style.visibility = 'hidden'; // Save 'i' if this is the selected item if ( menu[i].mainmenuIdName == selectedMenuItem) var found = i; } // Now 'turn on' the selected main and submenu if ( document.getElementById(menu[found].mainmenuIdName) != null) document.getElementById(menu[found].mainmenuIdName).src=menu[found].selectedImg; if (document.getElementById(menu[found].submenuDivName) !=null) document.getElementById(menu[found].submenuDivName).style.visibility = 'visible'; } // Method to show image for selected main menu item, submenu for that main menu item // AND highlight the actual submenu item that corresponds to the page we are on function privateShowMenuForPage(mainMenuItemName, subMenuItemName) { // Call showMainmenu to handle the highlight of mainmenu item and display the correct submenu showMainmenu(mainMenuItemName); // Now use the subMenuItemName to highlight the actual page we are on if (document.getElementById(subMenuItemName) !=null) { //document.getElementById(subMenuItemName).className='currentsubmenu'; } } // Method to turn on the timer which will invoke a method after // so many seconds that will return the highlighting to the current page function timeron() { if (isMobile()) return; timerID = setTimeout("showMenuForPage()",5000) ; }