// addLoadEvent, for queuing window.onload init functions
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		};
	};
};

// son of suckerfish hover, emulates element hovering in IE 5 & 6
// only invoked by IE 5 & 6 but included in the global js for simplicity
function sfHover() {
	var sfEls = document.getElementById('menuList').getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			
			if(document.getElementById("menu_iframe")) {
          		var iframe = document.getElementById("menu_iframe");

          		var submenu = this.getElementsByTagName("UL");
          		if(submenu.length) {
            		iframe.style.top = submenu[0].offsetTop + this.offsetTop + 10;
            		iframe.style.left = submenu[0].offsetLeft + this.offsetLeft + 20;
            		iframe.style.width = submenu[0].scrollWidth - 60;
            		iframe.style.height = submenu[0].clientHeight - 40;
            		iframe.style.display = "inline";
          		}
        	}

		};
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			
			if(document.getElementById("menu_iframe")) {
          		var iframe = document.getElementById("menu_iframe");
          		iframe.style.display = "none";
       		}

		};
	};
};