function isScreenResolutionCorrect() { return(screen.height >= '768') } function initTransMenu() { //========================================================================================== // if supported, initialize TransMenus //========================================================================================== // Check isSupported() so that menus aren't accidentally sent to non-supporting browsers. // This is better than server-side checking because it will also catch browsers which would // normally support the menus but have javascript disabled. // // If supported, call initialize() and then hook whatever image rollover code you need to do // to the .onactivate and .ondeactivate events for each menu. //========================================================================================== if (TransMenu.isSupported() && isScreenResolutionCorrect()) { TransMenu.initialize(); // hook all the highlight swapping of the main toolbar to menu activation/deactivation // instead of simple rollover to get the effect where the button stays hightlit until // the menu is closed. menu1.onactivate = function() { document.getElementById("ddHome").className = "hover"; }; menu1.ondeactivate = function() { document.getElementById("ddHome").className = ""; }; menu2.onactivate = function() { document.getElementById("ddDistrict").className = "hover"; }; menu2.ondeactivate = function() { document.getElementById("ddDistrict").className = ""; }; menu3.onactivate = function() { document.getElementById("ddResidents").className = "hover"; }; menu3.ondeactivate = function() { document.getElementById("ddResidents").className = ""; }; menu4.onactivate = function() { document.getElementById("ddBusiness").className = "hover"; }; menu4.ondeactivate = function() { document.getElementById("ddBusiness").className = ""; }; menu5.onactivate = function() { document.getElementById("ddVisitors").className = "hover"; }; menu5.ondeactivate = function() { document.getElementById("ddVisitors").className = ""; }; } } // set up drop downs anywhere in the body of the page. I think the bottom of the page is better.. // but you can experiment with effect on loadtime. if (TransMenu.isSupported() && isScreenResolutionCorrect()) { //================================================================================================== // create a set of dropdowns //================================================================================================== // the first param should always be down, as it is here // // The second and third param are the top and left offset positions of the menus from their actuators // respectively. To make a menu appear a little to the left and bottom of an actuator, you could use // something like -5, 5 // // The last parameter can be .topLeft, .bottomLeft, .topRight, or .bottomRight to inidicate the corner // of the actuator from which to measure the offset positions above. Here we are saying we want the // menu to appear directly below the bottom left corner of the actuator //================================================================================================== var ms = new TransMenuSet(TransMenu.direction.down, 1, 0, TransMenu.reference.bottomLeft); //================================================================================================== // create a dropdown menu //================================================================================================== // the first parameter should be the HTML element which will act actuator for the menu //================================================================================================== var menu1 = ms.addMenu(document.getElementById("ddHome")); menu1.addItem("Contact Us", "/contactus.php") menu1.addItem("District", "/district/index.php") menu1.addItem("Residents", "/residents/index.php") menu1.addItem("Business", "/business/index.php") menu1.addItem("Visitors", "/visitors/index.php") menu1.addItem("Mayor's Welcome Message", "/district/welcomemessage.php") menu1.addItem("Travel Press on Ucluelet", "/inthepress.php") menu1.addItem("Site Map", "/sitemap.php") var menu2 = ms.addMenu(document.getElementById("ddDistrict")); menu2.addItem("Mayor & Council", "/district/mayorcouncil.php") menu2.addItem("Council Meetings", "/district/councilmeetings.php") menu2.addItem("Agendas and Minutes", "/district/councilmeetings_agendasandminutes.php") menu2.addItem("Departments", "/district/departments.php") menu2.addItem("Employment Opportunities", "/district/employment.php") menu2.addItem("Bylaws", "/district/bylawspolicies.php") menu2.addItem("Permits & Licensing", "/district/permitslicensing.php") menu2.addItem("Emergency Planning", "/district/communityplan_emergencyplanning.php") menu2.addItem("District Awards", "/district/districtawards.php") menu2.addItem("Elections", "/district/elections.php") var menu2_3 = menu2.addMenu(menu2.items[3]); menu2_3.addItem("Building Inspection/Bylaw Enforcement", "/district/departments_buildinginspection.php") menu2_3.addItem("Planning Services", "/district/departments_planningdepartment.php") menu2_3.addItem("Public Works", "/district/departments_publicworks.php") menu2_3.addItem("Harbour ", "/visitors/marine_harboradvisory.php") var menu2_3_1 = menu2_3.addMenu(menu2_3.items[1]); menu2_3_1.addItem("Planning Principles", "/district/planning.php") menu2_3_1.addItem("Development ", "/district/planning_developmentpermitareas.php") menu2_3_1.addItem("BuildGreen", "/district/departments_variances.php") menu2_3_1.addItem("Official Community Plan", "/district/communityplan.php") menu2_3_1.addItem("Zoning", "/district/planning_zoning.php") menu2_3_1.addItem("Subdivisions", "/district/planning_helpfulhintsaboutsubdivisions.php") menu2_3_1.addItem("Strata Developments", "/district/planning_helpfulhintsaboutstratadevelopments.php") var menu3 = ms.addMenu(document.getElementById("ddResidents")); menu3.addItem("Residents Information", "/residents/residentsinformation.php") menu3.addItem("About Ucluelet", "/residents/about.php") menu3.addItem("Affordable Housing", "/residents/planning.php") menu3.addItem("Parks", "/residents/parks.php") menu3.addItem("Recreation Information", "/residents/parksrec.php") menu3.addItem("Garbage & Recycling", "/district/utilties_garbagerecycling.php") menu3.addItem("Special Events", "/residents/parksrec_events.php") menu3.addItem("Service Organizations", "/residents/communityservices.php") var menu3_0 = menu3.addMenu(menu3.items[0]); menu3_0.addItem("Public Input", "/residents/residentsinformation_publicinput.php") menu3_0.addItem("New Residents", "/residents/newresidents.php") menu3_0.addItem("Schools", "/residents/schooling.php") menu3_0.addItem("Utilities", "/residents/utilities.php") var menu3_1 = menu3.addMenu(menu3.items[1]); menu3_1.addItem("Facts & Statistics", "/residents/about_facts.php") var menu3_4 = menu3.addMenu(menu3.items[4]); menu3_4.addItem("Ucluelet Community Centre ", "/residents/parksrec_communitycentre.php") menu3_4.addItem("Facilities", "/residents/parksrec_facilities.php") menu3_4.addItem("Recreation Programs", "/residents/parksrec_recprograms.php") var menu3_6 = menu3.addMenu(menu3.items[6]); menu3_6.addItem("Ukee Days", "/residents/parksrec_ukeedays.php") menu3_6.addItem("Pacific Rim Whale Festival", "/residents/parksrec_pacificrimwhalefestival.php") var menu4 = ms.addMenu(document.getElementById("ddBusiness")); menu4.addItem("Business Licences", "/business/businesslicenses.php") menu4.addItem("Signage Program", "/business/economicdevelopment.php") menu4.addItem("Chamber of Commerce", "/business/chamberofcommerce.php") menu4.addItem("Planning Info", "/business/planning.php") menu4.addItem("Business Directory", "/business/businessdirectory.php") menu4.addItem("Tenders and Purchasing", "/business/tendersandpurchasing.php") var menu4_3 = menu4.addMenu(menu4.items[3]); menu4_3.addItem("Bylaws", "/business/planning_bylaws.php") menu4_3.addItem("Zoning", "/business/planning_zoning.php") var menu5 = ms.addMenu(document.getElementById("ddVisitors")); menu5.addItem("About Ucluelet", "/visitors/aboutucluelet.php") menu5.addItem("Pacific Rim Visitors Centre", "/visitors/pacificrimvisitorscentre.php") menu5.addItem("Wild Pacific Trail", "/visitors/wildpacifictrail.php") menu5.addItem("Accommodations", "/visitors/accommodations.php") menu5.addItem("Activities", "/visitors/attractions.php") menu5.addItem("Marine Facilities", "/visitors/marinefacilities.php") menu5.addItem("Getting Here", "/visitors/gettinghere.php") menu5.addItem("Photo Tour", "/visitors/phototour.php") var menu5_0 = menu5.addMenu(menu5.items[0]); menu5_0.addItem("Heritage", "/visitors/about_heritage.php") menu5_0.addItem("Climate", "/visitors/about_climate.php") menu5_0.addItem("Nature", "/visitors/about_nature.php") menu5_0.addItem("Marine Ecology", "/visitors/about_marineecology.php") var menu5_4 = menu5.addMenu(menu5.items[4]); menu5_4.addItem("Nature Viewing", "/visitors/attractions_parks.php") menu5_4.addItem("Camping", "/visitors/attractions_camping.php") menu5_4.addItem("Hiking", "/visitors/attractions_hiking.php") menu5_4.addItem("Surfing", "/visitors/attractions_surfing.php") menu5_4.addItem("Fishing", "/visitors/attractions_fishing.php") menu5_4.addItem("Kayaking", "/visitors/attractions_kayaking.php") menu5_4.addItem("Scuba Diving", "/visitors/attractions_scubadiving.php") menu5_4.addItem("Storm Watching", "/visitors/attractions_stormwatching.php") var menu5_6 = menu5.addMenu(menu5.items[6]); menu5_6.addItem("Maps", "/visitors/gettinghere_maps.php") menu5_6.addItem("Transportation", "/visitors/gettinghere_transportation.php") //================================================================================================== // write drop downs into page //================================================================================================== // this method writes all the HTML for the menus into the page with document.write(). It must be // called within the body of the HTML page. //================================================================================================== TransMenu.renderAll(); } document.onload += initTransMenu();