/**
 * Code modified from Scott Andrew LePera's web site:
 * http://www.scottandrew.com/weblog/articles/cbs-events
 */
function addEvent(obj, evType, fn, useCapture) {
	if (obj.addEventListener) {
		obj.addEventListener(evType, fn, useCapture);
		return true;
	} else if (obj.attachEvent) {
		var r = obj.attachEvent("on" + evType, fn);
		return r;
	} else {
		globalOnloadEvents[globalOnloadEvents.length] = fn;
		window.onload = executeEvents;
	}
}

function removeEvent(obj, evType, fn, useCapture) {
	if (obj.removeEventListener) {
		obj.removeEventListener(evType, fn, useCapture);
		return true;
	} else if (obj.detachEvent) {
		var r = obj.detachEvent("on" + evType, fn);
		return r;
	}
}

/**
 * Mac IE5 fix
 */
var globalOnloadEvents = new Array();
var executeEvents = function() {
	for (var i = 0; i < globalOnloadEvents.length; i++)
		globalOnloadEvents[i]();
}

/**
 * Code modified from Nick Rigby's article at ALA:
 * http://www.alistapart.com/articles/horizdropdowns/
 */
var quickLinks = function(n) {
	if (document.all && document.getElementById) {
		base = document.getElementById(n);
		navRoot = base.getElementsByTagName("UL")[0];

		base.onmouseover = function() {
			navRoot.className = "hover";
		}
		base.onmouseout = function() {
			navRoot.className = this.className = "";
		}

		for (i = 0; i < navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName == "LI") {
				node.onmouseover = function() {
					this.parentNode.className = "hover";
				}
				node.onmouseout = function() {
					this.parentNode.className = this.className = "";
				}
			}
		}
	}
}