function initPage() {
/* TOPMENU */
  assignEvent( 'click',     '*.menu', 
                applyToDescendants, '*.dropdown', toggleClass, "hidden" );

  assignEvent( 'mouseover', '*.menu', 
                applyToDescendants, '*.dropdown', removeClass, "hidden" );

  assignEvent( 'mouseout',  '*.menu', 
                applyToDescendants, '*.dropdown', addClass,    "hidden" );



  assignEvent( 'mouseover', '*.menu li, *.menu h3', 
                applyToThis, null, addClass,    "hover" );

  assignEvent( 'mouseout',  '*.menu li, *.menu h3', 
                applyToThis, null, removeClass, "hover" );



  assignEvent( 'mouseover', '*.menu li.flyout-trigger', 
                applyToDescendants, '> *.submenu', removeClass, "hidden" );

  assignEvent( 'mouseout',  '*.menu li.flyout-trigger', 
                applyToDescendants, '> *.submenu', addClass,    "hidden" );
  }

addEvent(window,'unload',purgeAllEvents);
addEvent(window,'load',initPage)
  
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

