Instantly share code, notes, and snippets.
Created
April 16, 2012 02:33
-
Save dgs700/2396079 to your computer and use it in GitHub Desktop.
Some OLD jQueryLESS Javascript that manipulates the DOM and manages events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//creates dynamic dropdown menus | |
//based on Danny Goodman's code appearing in "Javascript&Dhtml Cookbook" - O'Rielly | |
window.phMenuManager = (function(global){ | |
return { | |
// event mgmt functions | |
addEvent: function (elem, evtType, func, capture) { | |
capture = (capture) ? capture : false; | |
if (elem.addEventListener) { | |
elem.addEventListener(evtType, func, capture); | |
} else if (elem.attachEvent) { | |
elem.attachEvent("on" + evtType, func); | |
} else { | |
// for IE/Mac, NN4, and older | |
elem["on" + evtType] = func; | |
} | |
}, | |
removeEvent: function (elem, evtType, func, capture) { | |
capture = (capture) ? capture : false; | |
if (elem.removeEventListener) { | |
elem.removeEventListener(evtType, func, capture); | |
} else if (elem.attachEvent) { | |
elem.detachEvent("on" + evtType, func); | |
} else { | |
// for IE/Mac, NN4, and older | |
elem["on" + evtType] = null; | |
} | |
}, | |
addOnLoadEvent: function (func) { | |
if (global.addEventListener || global.attachEvent) { | |
this.addEvent(global,"load", func, false); | |
} else { | |
var oldQueue = (global.onload) ? global.onload : function() {}; | |
global.onload = function() { | |
oldQueue(); | |
func(); | |
} | |
} | |
}, | |
//menu state | |
menuReady: false, | |
getElementStyle: function (elem, CSSStyleProp) { | |
var styleValue, camel; | |
if (elem) { | |
if (document.defaultView && document.defaultView.getComputedStyle) { | |
// W3C DOM version | |
var compStyle = document.defaultView.getComputedStyle(elem, ""); | |
styleValue = compStyle.getPropertyValue(CSSStyleProp); | |
} else if (elem.currentStyle) { | |
// make IE style property camelCase name from CSS version | |
var IEStyleProp = CSSStyleProp; | |
var re = /-\D/; | |
while (re.test(IEStyleProp)) { | |
camel = IEStyleProp.match(re)[0].charAt(1).toUpperCase(); | |
IEStyleProp = IEStyleProp.replace(re, camel); | |
} | |
styleValue = elem.currentStyle[IEStyleProp]; | |
} | |
} | |
return (styleValue) ? styleValue : null; | |
}, | |
// carry over some critical menu style sheet attribute values | |
CSSRuleValues: { | |
menuItemHeight:"21px", | |
menuWrapperBorderWidth:"0px", | |
menuWrapperPadding:"0px", | |
defaultBodyFontSize:"12px" | |
}, | |
// create hash table-like lookup for menu objects with id string indexes | |
makeHashes: function () { | |
var len = this.menus.length; | |
for (var i = 0; i < len; i++) { | |
this.menus[this.menus[i].elemId] = this.menus[i]; | |
this.menus[this.menus[i].mBarImgId] = this.menus[i]; | |
} | |
}, | |
makeHashes2: function (cnt) { | |
for (var j = 0, len = this.menus[cnt].menuItems.length; j < len; j++) { | |
this.menus[this.menus[cnt].menuItems[j].text] = this.menus[cnt]; | |
} | |
}, | |
// assign menu label image event handlers | |
assignLabelEvents: function () { | |
var elem, | |
len = this.menus.length; | |
for (var i = 0; i < len; i++) { | |
elem = document.getElementById(this.menus[i].mBarImgId); | |
elem.onmouseover = this.swap; | |
elem.onmouseout = this.swap; | |
} | |
}, | |
// invoked from init(), generates the menu div elements and their contents. | |
// all this action is invisible to user during construction | |
makeMenus: function () { | |
var menuDiv, | |
menuItem, | |
itemLink, | |
imgNode, | |
menuItemH = (parseFloat(CSSRuleValues.menuItemHeight)), | |
heightAdjust = parseInt(CSSRuleValues.menuWrapperPadding) + parseInt(CSSRuleValues.menuWrapperBorderWidth); | |
if (navigator.appName == "Microsoft Internet Explorer" && | |
navigator.userAgent.indexOf("Win") != -1 && | |
(typeof document.compatMode == "undefined" || | |
document.compatMode == "BackCompat")) { | |
heightAdjust = -heightAdjust; | |
} | |
// use menus array to drive div creation loop | |
for (var i = 0, len = this.menus.length; i < len; i++) { | |
menuDiv = document.createElement("div"); | |
menuDiv.id = "popupmenu" + i; | |
// preserve menu's ID as property of the menus array item | |
this.menus[i].elemId = "popupmenu" + i; | |
menuDiv.className = "menuWrapper"; | |
if (this.menus[i].menuItems.length > 0) { | |
menuDiv.style.height = (menuItemH * this.menus[i].menuItems.length) - | |
heightAdjust + "px"; | |
} else { | |
// don't display any menu div lacking menu items | |
menuDiv.style.display = "none"; | |
} | |
// define event handlers | |
menuDiv.onmouseover = this.keepMenu; | |
menuDiv.onmouseout = this.requestHide; | |
// set stacking order in case other layers are around the page | |
menuDiv.style.zIndex = 1000; | |
// assemble menu item elements for inside menu div | |
for (var j = 0, len3 = this.menus[i].menuItems.length; j < len3; j++) { | |
menuItem = document.createElement("div"); | |
menuItem.id = "popupmenuItem_" + i + "_" + j; | |
menuItem.className = "menuItem"; | |
menuItem.onclick = this.hideMenus; | |
menuItem.style.top = menuItemH * j + "px"; | |
itemLink = document.createElement("a"); | |
itemLink.href = this.menus[i].menuItems[j].href; | |
itemLink.className = "menuItem"; | |
imgNode = document.createElement("img"); | |
imgNode.src = this.menus[i].menuItems[j].src; | |
imgNode.className = "menuImg"; | |
imgNode.id = this.menus[i].menuItems[j].text; | |
imgNode.onmouseover = this.swap2; | |
imgNode.onmouseout = this.swap2; | |
itemLink.appendChild(imgNode); | |
menuItem.appendChild(itemLink); | |
menuDiv.appendChild(menuItem); | |
} | |
// append each menu div to the body | |
document.body.appendChild(menuDiv); | |
this.makeHashes2(i); | |
} | |
this.makeHashes(); | |
this.assignLabelEvents(); | |
// pre-position menu | |
for (var k = 0, len4 = this.menus.length; k < len4; k++) { | |
this.positionMenu(this.menus[i].elemId); | |
} | |
this.menuReady = true; | |
}, | |
// initialize global that helps manage menu hiding | |
timer: {}, | |
// invoked from mouseovers inside menus to cancel hide | |
// request from mouseout of menu bar image et al. | |
keepMenu: function () { | |
clearTimeout(this.timer); | |
}, | |
cancelAl: function () { | |
this.keepMenu(); | |
this.menuReady = false; | |
}, | |
// invoked from mouseouts to request hiding all menus | |
// in 1/4 second, unless cancelled | |
requestHide: function () { | |
this.timer = setTimeout("hideMenus()", 250); | |
}, | |
// "brute force" hiding of all menus and restoration | |
// of normal menu bar images | |
hideMenus: function () { | |
for (var i = 0, len = this.menus.length; i < len; i++) { | |
document.getElementById(this.menus[i].mBarImgId).src = this.menus[i].mBarImgNormal.src; | |
var menu = document.getElementById(this.menus[i].elemId) | |
menu.style.visibility = "hidden"; | |
} | |
}, | |
// set menu position just before displaying it | |
positionMenu: function (menuId){ | |
// use the menu bar image for position reference of related div | |
var mBarImg = document.getElementById(this.enus[menuId].mBarImgId), | |
offsetTrail = mBarImg, | |
offsetLeft = 0, | |
offsetTop = 0, | |
menuDiv = document.getElementById(menuId); | |
while (offsetTrail) { | |
offsetLeft += offsetTrail.offsetLeft; | |
offsetTop += offsetTrail.offsetTop; | |
offsetTrail = offsetTrail.offsetParent; | |
} | |
if (navigator.userAgent.indexOf("Mac") != -1 && | |
typeof document.body.leftMargin != "undefined") { | |
offsetLeft += document.body.leftMargin; | |
offsetTop += document.body.topMargin; | |
} | |
menuDiv.style.left = offsetLeft + "px"; | |
menuDiv.style.top = offsetTop + mBarImg.height + "px"; | |
}, | |
// display a particular menu div | |
showMenu: function (menuId) { | |
if (this.menuReady) { | |
this.keepMenu(); | |
this.hideMenus(); | |
this.positionMenu(menuId); | |
var menu = document.getElementById(menuId); | |
menu.style.visibility = "visible"; | |
} | |
}, | |
// menu bar image swapping, invoked from mouse events in menu bar | |
// swap style sheets for menu items during rollovers | |
toggleHighlight: function (evt) { | |
evt = (evt) ? evt : ((event) ? event : null); | |
if (typeof menuReady != "undefined") { | |
if (this.menuReady && evt) { | |
var elem = (evt.target) ? evt.target : evt.srcElement; | |
if (elem.nodeType == 3) { | |
elem = elem.parentNode; | |
} | |
if (evt.type == "mouseover") { | |
this.keepMenu(); | |
elem.className ="menuItemOn"; | |
} else { | |
elem.className ="menuItem"; | |
this.requestHide(); | |
} | |
evt.cancelBubble = true; | |
} | |
} | |
}, | |
swap: function (evt) { | |
evt = (evt) ? evt : ((event) ? event : null); | |
if (typeof menuReady != "undefined") { | |
if (evt && (document.getElementById && document.styleSheets) && this.menuReady) { | |
var elem = (evt.target) ? evt.target : evt.srcElement; | |
if (elem.className == "menuImg") { | |
if (evt.type == "mouseover") { | |
this.showMenu(this.menus[elem.id].elemId); | |
elem.src = this.menus[elem.id].mBarImgHilite.src; | |
} else if (evt.type == "mouseout") { | |
this.requestHide(); | |
} | |
evt.cancelBubble = true; | |
} | |
} | |
} | |
}, | |
swap2: function (evt) { | |
evt = (evt) ? evt : ((event) ? event : null); | |
if (typeof menuReady != "undefined") { | |
if (evt && (document.getElementById && document.styleSheets) && this.menuReady) { | |
var elem = (evt.target) ? evt.target : evt.srcElement; | |
if (elem.className == "menuImg") { | |
if (evt.type == "mouseover") { | |
this.showMenu(this.menus[elem.id].elemId); //undef. | |
elem.src = this.imagesHilite[elem.id].src; | |
} else if (evt.type == "mouseout") { | |
elem.src = this.imagesNormal[elem.id].src; | |
this.requestHide(); | |
} | |
evt.cancelBubble = true; | |
} | |
} | |
} | |
}, | |
// create menus only if key items are supported | |
initMenus: function () { | |
if (document.getElementById && document.styleSheets) { | |
setTimeout("makeMenus()", 5); | |
global.onunload = this.cancelAll; | |
} | |
} | |
} | |
})(window); | |
// pre-cache menubar image pairs | |
phMenuManager.preLoadImages = function(){ | |
if (document.images) { | |
var imagesNormal = [], | |
imagesHilite = []; | |
imagesNormal["home"] = new Image(51, 97); | |
imagesNormal["home"].src = "images/buttons_top/home.gif"; | |
imagesNormal["jobseekers"] = new Image(51, 97); | |
imagesNormal["jobseekers"].src = "images/buttons_top/jobseekers.gif"; | |
imagesNormal["employers"] = new Image(51, 97); | |
imagesNormal["employers"].src = "images/buttons_top/employers.gif"; | |
imagesNormal["volunteers"] = new Image(51, 97); | |
imagesNormal["volunteers"].src = "images/buttons_top/volunteers.gif"; | |
imagesNormal["donors"] = new Image(51, 97); | |
imagesNormal["donors"].src = "images/buttons_top/donors.gif"; | |
imagesNormal["events"] = new Image(51, 97); | |
imagesNormal["events"].src = "images/buttons_top/events.gif"; | |
imagesNormal["contactus"] = new Image(51, 97); | |
imagesNormal["contactus"].src = "images/buttons_top/contactus.gif"; | |
//job seekers menu | |
imagesNormal["ourservices"] = new Image(21, 141); | |
imagesNormal["ourservices"].src = "images/buttons_top/jobseekers/ourservices.gif"; | |
imagesNormal["jobopenings"] = new Image(21, 141); | |
imagesNormal["jobopenings"].src = "images/buttons_top/jobseekers/jobopenings.gif"; | |
imagesNormal["applyforservices"] = new Image(21, 141); | |
imagesNormal["applyforservices"].src = "images/buttons_top/jobseekers/applyforservices.gif"; | |
imagesNormal["training"] = new Image(21, 141); | |
imagesNormal["training"].src = "images/buttons_top/jobseekers/training.gif"; | |
imagesNormal["calendar"] = new Image(21, 141); | |
imagesNormal["calendar"].src = "images/buttons_top/jobseekers/calendar.gif"; | |
imagesNormal["testimonials"] = new Image(21, 141); | |
imagesNormal["testimonials"].src = "images/buttons_top/jobseekers/testimonials.gif"; | |
imagesNormal["resources"] = new Image(21, 141); | |
imagesNormal["resources"].src = "images/buttons_top/jobseekers/resources.gif"; | |
imagesNormal["tipsforjobseekers"] = new Image(21, 141); | |
imagesNormal["tipsforjobseekers"].src = "images/buttons_top/jobseekers/tipsforjobseekers.gif"; | |
//Employers menu | |
imagesNormal["HIREDtempsstaffing"] = new Image(21, 141); | |
imagesNormal["HIREDtempsstaffing"].src = "images/buttons_top/employers/HIREDtempsstaffing.gif"; | |
imagesNormal["employerFAQs"] = new Image(21, 141); | |
imagesNormal["employerFAQs"].src = "images/buttons_top/employers/employerFAQs.gif"; | |
imagesNormal["ADAfacts"] = new Image(21, 141); | |
imagesNormal["ADAfacts"].src = "images/buttons_top/employers/ADAfacts.gif"; | |
imagesNormal["hotcandidateslist"] = new Image(21, 141); | |
imagesNormal["hotcandidateslist"].src = "images/buttons_top/employers/hotcandidateslist.gif"; | |
imagesNormal["disabilityetiquette"] = new Image(21, 141); | |
imagesNormal["disabilityetiquette"].src = "images/buttons_top/employers/disabilityetiquette.gif"; | |
imagesNormal["successstories"] = new Image(21, 141); | |
imagesNormal["successstories"].src = "images/buttons_top/employers/successstories.gif"; | |
imagesNormal["diversitypartners"] = new Image(21, 141); | |
imagesNormal["diversitypartners"].src = "images/buttons_top/employers/diversitypartners.gif"; | |
imagesNormal["businessadvisory"] = new Image(21, 141); | |
imagesNormal["businessadvisory"].src = "images/buttons_top/employers/businessadvisory.gif"; | |
//Volunteers Menu | |
imagesNormal["waystovolunteer"] = new Image(21, 141); | |
imagesNormal["waystovolunteer"].src = "images/buttons_top/volunteers/waystovolunteer.gif"; | |
imagesNormal["wishlist"] = new Image(21, 141); | |
imagesNormal["wishlist"].src = "images/buttons_top/volunteers/wishlist.gif"; | |
imagesNormal["monthlycalendar"] = new Image(21, 141); | |
imagesNormal["monthlycalendar"].src = "images/buttons_top/volunteers/monthlycalendar.gif"; | |
imagesNormal["signup"] = new Image(21, 141); | |
imagesNormal["signup"].src = "images/buttons_top/volunteers/signup.gif"; | |
//Donors Menu | |
imagesNormal["ourimpact"] = new Image(21, 141); | |
imagesNormal["ourimpact"].src = "images/buttons_top/donors/ourimpact.gif"; | |
imagesNormal["corporatefoundation"] = new Image(21, 141); | |
imagesNormal["corporatefoundation"].src = "images/buttons_top/donors/corporatefoundation.gif"; | |
imagesNormal["individualdonors"] = new Image(21, 141); | |
imagesNormal["individualdonors"].src = "images/buttons_top/donors/individualdonors.gif"; | |
imagesNormal["wishlist2"] = new Image(21, 141); | |
imagesNormal["wishlist2"].src = "images/buttons_top/donors/wishlist.gif"; | |
imagesNormal["diversitypartners2"] = new Image(21, 141); | |
imagesNormal["diversitypartners2"].src = "images/buttons_top/donors/diversitypartners.gif"; | |
imagesNormal["events2"] = new Image(21, 141); | |
imagesNormal["events2"].src = "images/buttons_top/donors/events.gif"; | |
imagesNormal["howtodonate"] = new Image(21, 141); | |
imagesNormal["howtodonate"].src = "images/buttons_top/donors/howtodonate.gif"; | |
//Events Menu | |
imagesNormal["businessadvisorycouncil"] = new Image(21, 141); | |
imagesNormal["businessadvisorycouncil"].src = "images/buttons_top/events/businessadvisorycouncil.gif"; | |
imagesNormal["monthlycalendar2"] = new Image(21, 141); | |
imagesNormal["monthlycalendar2"].src = "images/buttons_top/events/monthlycalendar.gif"; | |
imagesNormal["harvestmoondinner"] = new Image(21, 141); | |
imagesNormal["harvestmoondinner"].src = "images/buttons_top/events/harvestmoondinner.gif"; | |
imagesNormal["clientholidaypotluck"] = new Image(21, 141); | |
imagesNormal["clientholidaypotluck"].src = "images/buttons_top/events/clientholidaypotluck.gif"; | |
imagesNormal["springbreakfast"] = new Image(21, 141); | |
imagesNormal["springbreakfast"].src = "images/buttons_top/events/springbreakfast.gif"; | |
//Contact Us Menu | |
imagesNormal["address"] = new Image(21, 141); | |
imagesNormal["address"].src = "images/buttons_top/contactus/address.gif"; | |
imagesNormal["email"] = new Image(21, 141); | |
imagesNormal["email"].src = "images/buttons_top/contactus/email.gif"; | |
imagesNormal["drivingdirections"] = new Image(21, 141); | |
imagesNormal["drivingdirections"].src = "images/buttons_top/contactus/drivingdirections.gif"; | |
imagesHilite["home"] = new Image(51, 97); | |
imagesHilite["home"].src = "images/buttons_top/home_RO.gif"; | |
imagesHilite["jobseekers"] = new Image(51, 97); | |
imagesHilite["jobseekers"].src = "images/buttons_top/jobseekers_RO.gif"; | |
imagesHilite["employers"] = new Image(51, 97); | |
imagesHilite["employers"].src = "images/buttons_top/employers_RO.gif"; | |
imagesHilite["volunteers"] = new Image(51, 97); | |
imagesHilite["volunteers"].src = "images/buttons_top/volunteers_RO.gif"; | |
imagesHilite["donors"] = new Image(51, 97); | |
imagesHilite["donors"].src = "images/buttons_top/donors_RO.gif"; | |
imagesHilite["events"] = new Image(51, 97); | |
imagesHilite["events"].src = "images/buttons_top/events_RO.gif"; | |
imagesHilite["contactus"] = new Image(51, 97); | |
imagesHilite["contactus"].src = "images/buttons_top/contactus_RO.gif"; | |
//job seekers menu | |
imagesHilite["ourservices"] = new Image(21, 141); | |
imagesHilite["ourservices"].src = "images/buttons_top/jobseekers/ourservices_RO.gif"; | |
imagesHilite["jobopenings"] = new Image(21, 141); | |
imagesHilite["jobopenings"].src = "images/buttons_top/jobseekers/jobopenings_RO.gif"; | |
imagesHilite["applyforservices"] = new Image(21, 141); | |
imagesHilite["applyforservices"].src = "images/buttons_top/jobseekers/applyforservices_RO.gif"; | |
imagesHilite["training"] = new Image(21, 141); | |
imagesHilite["training"].src = "images/buttons_top/jobseekers/training_RO.gif"; | |
imagesHilite["calendar"] = new Image(21, 141); | |
imagesHilite["calendar"].src = "images/buttons_top/jobseekers/calendar_RO.gif"; | |
imagesHilite["testimonials"] = new Image(21, 141); | |
imagesHilite["testimonials"].src = "images/buttons_top/jobseekers/testimonials_RO.gif"; | |
imagesHilite["resources"] = new Image(21, 141); | |
imagesHilite["resources"].src = "images/buttons_top/jobseekers/resources_RO.gif"; | |
imagesHilite["tipsforjobseekers"] = new Image(21, 141); | |
imagesHilite["tipsforjobseekers"].src = "images/buttons_top/jobseekers/tipsforjobseekers_RO.gif"; | |
//Employers menu | |
imagesHilite["HIREDtempsstaffing"] = new Image(21, 141); | |
imagesHilite["HIREDtempsstaffing"].src = "images/buttons_top/employers/HIREDtempsstaffing_RO.gif"; | |
imagesHilite["employerFAQs"] = new Image(21, 141); | |
imagesHilite["employerFAQs"].src = "images/buttons_top/employers/employerFAQs_RO.gif"; | |
imagesHilite["ADAfacts"] = new Image(21, 141); | |
imagesHilite["ADAfacts"].src = "images/buttons_top/employers/ADAfacts_RO.gif"; | |
imagesHilite["hotcandidateslist"] = new Image(21, 141); | |
imagesHilite["hotcandidateslist"].src = "images/buttons_top/employers/hotcandidateslist_RO.gif"; | |
imagesHilite["disabilityetiquette"] = new Image(21, 141); | |
imagesHilite["disabilityetiquette"].src = "images/buttons_top/employers/disabilityetiquette_RO.gif"; | |
imagesHilite["successstories"] = new Image(21, 141); | |
imagesHilite["successstories"].src = "images/buttons_top/employers/successstories_RO.gif"; | |
imagesHilite["diversitypartners"] = new Image(21, 141); | |
imagesHilite["diversitypartners"].src = "images/buttons_top/employers/diversitypartners_RO.gif"; | |
imagesHilite["businessadvisory"] = new Image(21, 141); | |
imagesHilite["businessadvisory"].src = "images/buttons_top/employers/businessadvisory_RO.gif"; | |
//Volunteers Menu | |
imagesHilite["waystovolunteer"] = new Image(21, 141); | |
imagesHilite["waystovolunteer"].src = "images/buttons_top/volunteers/waystovolunteer_RO.gif"; | |
imagesHilite["wishlist"] = new Image(21, 141); | |
imagesHilite["wishlist"].src = "images/buttons_top/volunteers/wishlist_RO.gif"; | |
imagesHilite["monthlycalendar"] = new Image(21, 141); | |
imagesHilite["monthlycalendar"].src = "images/buttons_top/volunteers/monthlycalendar_RO.gif"; | |
imagesHilite["signup"] = new Image(21, 141); | |
imagesHilite["signup"].src = "images/buttons_top/volunteers/signup_RO.gif"; | |
//Donors Menu | |
imagesHilite["ourimpact"] = new Image(21, 141); | |
imagesHilite["ourimpact"].src = "images/buttons_top/donors/ourimpact_RO.gif"; | |
imagesHilite["corporatefoundation"] = new Image(21, 141); | |
imagesHilite["corporatefoundation"].src = "images/buttons_top/donors/corporatefoundation_RO.gif"; | |
imagesHilite["individualdonors"] = new Image(21, 141); | |
imagesHilite["individualdonors"].src = "images/buttons_top/donors/individualdonors_RO.gif"; | |
imagesHilite["wishlist2"] = new Image(21, 141); | |
imagesHilite["wishlist2"].src = "images/buttons_top/donors/wishlist2_RO.gif"; | |
imagesHilite["diversitypartners2"] = new Image(21, 141); | |
imagesHilite["diversitypartners2"].src = "images/buttons_top/donors/diversitypartners_RO.gif"; | |
imagesHilite["events2"] = new Image(21, 141); | |
imagesHilite["events2"].src = "images/buttons_top/donors/events_RO.gif"; | |
imagesHilite["howtodonate"] = new Image(21, 141); | |
imagesHilite["howtodonate"].src = "images/buttons_top/donors/howtodonate_RO.gif"; | |
//Events Menu | |
imagesHilite["businessadvisorycouncil"] = new Image(21, 141); | |
imagesHilite["businessadvisorycouncil"].src = "images/buttons_top/events/businessadvisorycouncil_RO.gif"; | |
imagesHilite["monthlycalendar2"] = new Image(21, 141); | |
imagesHilite["monthlycalendar2"].src = "images/buttons_top/events/monthlycalendar_RO.gif"; | |
imagesHilite["harvestmoondinner"] = new Image(21, 141); | |
imagesHilite["harvestmoondinner"].src = "images/buttons_top/events/harvestmoondinner_RO.gif"; | |
imagesHilite["clientholidaypotluck"] = new Image(21, 141); | |
imagesHilite["clientholidaypotluck"].src = "images/buttons_top/events/clientholidaypotluck_RO.gif"; | |
imagesHilite["springbreakfast"] = new Image(21, 141); | |
imagesHilite["springbreakfast"].src = "images/buttons_top/events/springbreakfast_RO.gif"; | |
//Contact Us Menu | |
imagesHilite["address"] = new Image(21, 141); | |
imagesHilite["address"].src = "images/buttons_top/contactus/address_RO.gif"; | |
imagesHilite["email"] = new Image(21, 141); | |
imagesHilite["email"].src = "images/buttons_top/contactus/email_RO.gif"; | |
imagesHilite["drivingdirections"] = new Image(21, 141); | |
imagesHilite["drivingdirections"].src = "images/buttons_top/contactus/drivingdirections_RO.gif"; | |
} | |
}; | |
phMenuManager.menus = [ | |
{ | |
mBarImgId:"menuImg_1", | |
mBarImgNormal:imagesNormal["home"], | |
mBarImgHilite:imagesHilite["home"], | |
menuItems:[], | |
elemId:"" | |
}, | |
{ | |
mBarImgId:"menuImg_2", | |
mBarImgNormal:imagesNormal["jobseekers"], | |
mBarImgHilite:imagesHilite["jobseekers"], | |
menuItems:[ | |
{ | |
text:"ourservices", | |
href:"#", | |
src:"images/buttons_top/jobseekers/ourservices.gif" | |
}, | |
{ | |
text:"jobopenings", | |
href:"#", | |
src:"images/buttons_top/jobseekers/jobopenings.gif" | |
}, | |
{ | |
text:"applyforservices", | |
href:"#", | |
src:"images/buttons_top/jobseekers/applyforservices.gif" | |
}, | |
{ | |
text:"training", | |
href:"#", | |
src:"images/buttons_top/jobseekers/training.gif" | |
}, | |
{ | |
text:"calendar", | |
href:"#", | |
src:"images/buttons_top/jobseekers/calendar.gif" | |
}, | |
{ | |
text:"testimonials", | |
href:"#", | |
src:"images/buttons_top/jobseekers/testimonials.gif" | |
}, | |
{ | |
text:"resources", | |
href:"#", | |
src:"images/buttons_top/jobseekers/resources.gif" | |
}, | |
{ | |
text:"tipsforjobseekers", | |
href:"#", | |
src:"images/buttons_top/jobseekers/tipsforjobseekers.gif" | |
} | |
], | |
elemId:"" | |
}, | |
{ | |
mBarImgId:"menuImg_3", | |
mBarImgNormal:imagesNormal["employers"], | |
mBarImgHilite:imagesHilite["employers"], | |
menuItems:[ | |
{ | |
text:"HIREDtempsstaffing", | |
href:"#", | |
src:"images/buttons_top/employers/HIREDtempsstaffing.gif" | |
}, | |
{ | |
text:"employerFAQs", | |
href:"#", | |
src:"images/buttons_top/employers/employerFAQs.gif" | |
}, | |
{ | |
text:"ADAfacts", | |
href:"#", | |
src:"images/buttons_top/employers/ADAfacts.gif" | |
}, | |
{ | |
text:"hotcandidateslist", | |
href:"#", | |
src:"images/buttons_top/employers/hotcandidateslist.gif" | |
}, | |
{ | |
text:"disabilityetiquette", | |
href:"#", | |
src:"images/buttons_top/employers/disabilityetiquette.gif" | |
}, | |
{ | |
text:"successstories", | |
href:"#", | |
src:"images/buttons_top/employers/successstories.gif" | |
}, | |
{ | |
text:"diversitypartners", | |
href:"#", | |
src:"images/buttons_top/employers/diversitypartners.gif" | |
}, | |
{ | |
text:"businessadvisory", | |
href:"#", | |
src:"images/buttons_top/employers/businessadvisory.gif" | |
} | |
], | |
elemId:"" | |
}, | |
{ | |
mBarImgId:"menuImg_4", | |
mBarImgNormal:imagesNormal["volunteers"], | |
mBarImgHilite:imagesHilite["volunteers"], | |
menuItems:[ | |
{ | |
text:"waystovolunteer", | |
href:"#", | |
src:"images/buttons_top/volunteers/waystovolunteer.gif" | |
}, | |
{ | |
text:"wishlist", | |
href:"#", | |
src:"images/buttons_top/volunteers/wishlist.gif" | |
}, | |
{ | |
text:"monthlycalendar", | |
href:"#", | |
src:"images/buttons_top/volunteers/monthlycalendar.gif" | |
}, | |
{ | |
text:"signup", | |
href:"#", | |
src:"images/buttons_top/volunteers/signup.gif" | |
} | |
], | |
elemId:"" | |
}, | |
{ | |
mBarImgId:"menuImg_5", | |
mBarImgNormal:imagesNormal["donors"], | |
mBarImgHilite:imagesHilite["donors"], | |
menuItems:[ | |
{ | |
text:"ourimpact", | |
href:"#", | |
src:"images/buttons_top/donors/ourimpact.gif" | |
}, | |
{ | |
text:"corporatefoundation", | |
href:"#", | |
src:"images/buttons_top/donors/corporatefoundation.gif" | |
}, | |
{ | |
text:"individualdonors", | |
href:"#", | |
src:"images/buttons_top/donors/individualdonors.gif" | |
}, | |
{ | |
text:"wishlist2", | |
href:"#", | |
src:"images/buttons_top/donors/wishlist.gif" | |
}, | |
{ | |
text:"diversitypartners2", | |
href:"#", | |
src:"images/buttons_top/donors/diversitypartners.gif" | |
}, | |
{ | |
text:"events2", | |
href:"#", | |
src:"images/buttons_top/donors/events.gif" | |
}, | |
{ | |
text:"howtodonate", | |
href:"#", | |
src:"images/buttons_top/donors/howtodonate.gif" | |
} | |
], | |
elemId:"" | |
}, | |
{ | |
mBarImgId:"menuImg_6", | |
mBarImgNormal:imagesNormal["events"], | |
mBarImgHilite:imagesHilite["events"], | |
menuItems:[ | |
{ | |
text:"businessadvisorycouncil", | |
href:"#", | |
src:"images/buttons_top/events/businessadvisorycouncil.gif" | |
}, | |
{ | |
text:"monthlycalendar2", | |
href:"#", | |
src:"images/buttons_top/events/monthlycalendar.gif" | |
}, | |
{ | |
text:"harvestmoondinner", | |
href:"#", | |
src:"images/buttons_top/events/harvestmoondinner.gif" | |
}, | |
{ | |
text:"clientholidaypotluck", | |
href:"#", | |
src:"images/buttons_top/events/clientholidaypotluck.gif" | |
}, | |
{ | |
text:"springbreakfast", | |
href:"#", | |
src:"images/buttons_top/events/springbreakfast.gif" | |
} | |
], | |
elemId:"" | |
}, | |
{ | |
mBarImgId:"menuImg_7", | |
mBarImgNormal:imagesNormal["contactus"], | |
mBarImgHilite:imagesHilite["contactus"], | |
menuItems:[ | |
{ | |
text:"address", | |
href:"#", | |
src:"images/buttons_top/contactus/address.gif" | |
}, | |
{ | |
text:"email", | |
href:"#", | |
src:"images/buttons_top/contactus/email.gif" | |
}, | |
{ | |
text:"drivingdirections", | |
href:"#", | |
src:"images/buttons_top/contactus/drivingdirections.gif" | |
} | |
], | |
elemId:"" | |
} | |
]; | |
phMenuManager.preLoadImages(); | |
phMenuManager.addOnLoadEvent(phMenuManager.initMenus); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment