window.addEvent('domready', function() { var accordion = new Accordion('h2.menuModule', 'div.menuModule', { opacity: true, onActive: function(toggler, element){ toggler.addClass('menuModuleActive'); if (Browser.Engine.trident4) toggler.getNext().setStyle('display', 'block'); }, onBackground: function(toggler, element){ toggler.removeClass('menuModuleActive'); if (Browser.Engine.trident4) toggler.getNext().setStyle('display', 'none'); } }, $('actionMenu')); // safari fills too much space for some reason accordion.display.delay(100, accordion, ( typeof(gJson.menuIndex) != 'undefined' ? gJson.menuIndex : 0 ) ); $$('a.contactLink').addEvent('click', function(e) { // new Event(e).stop(); var contactInfo = $('contactInformation'); contactInfo.highlight('#85BF19'); return; }); var menuTips = new Tips($$('.menuTip'), { className: 'menuTip', offsets: {'x': -185, 'y': 16} }); }); // domready // Converts a string of "rgb(r, g, b)" to an object of {r, g, b} function convertRgbCallToHex(str) { var vals = str.replace('rgb(', '').replace(')', '').split(', '); var hex = ''; var i; for (i = 0; i < 3; ++i) { vals[i] = parseInt(vals[i]); if (vals[i] == 0 || isNaN(vals[i])) { hex += "00"; continue; } vals[i] = Math.max(0, vals[i]); vals[i] = Math.min(vals[i], 255); vals[i] = Math.round(vals[i]); hex += "0123456789ABCDEF".charAt((vals[i] - vals[i] % 16) / 16) + "0123456789ABCDEF".charAt(vals[i] % 16); } return hex; } // == BEGIN KISTNER CODE == //*** This code is copyright 2003 by Gavin Kistner, gavin@refinery.com //*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt //*** Reuse or modification is free provided you abide by the terms of that license. //*** (Including the first two lines above in your source code satisfies the conditions.) // Cross-browser compatible script for finding the current style applied to an // element, either explicitly or through CSS rules; // Works on IE and Mozilla; always returns 'null' for Safari function currentStyle(el, prop) { var viewCSS = (typeof document.defaultView=='function') ? document.defaultView() : document.defaultView; if (viewCSS && viewCSS.getComputedStyle) { var s = viewCSS.getComputedStyle(el,null); return s && s.getPropertyValue(prop); } return el.currentStyle && (el.currentStyle[prop] || null) || null; } // == END KISTNER CODE ==