/**
 * Javascript om het menu te fixen.
 * In IE < 6 is het script nodig omdat IE6 geen :hover ondersteunt
 * In de overige browsers is het niet nodog, maar het zorgt wel voor een
 * kleine delay bij het inklappen van het menu.
 */
var __activenode = false;
function initMenu() {
	var menu = document.getElementById('nav');
	var node;
	if(menu.firstChild) {
		node = menu.firstChild;
		do {
			if(node.nodeName == 'LI') {
				addEvents(node);
			}
			node = node.nextSibling;
		} while(node);
	}
}
function addEvents(node) {
	node.onmouseover = function() {
		if(this.hideTimeout) { clearTimeout(this.hideTimeout); }
		if(__activenode && __activenode != this) { __activenode.hide(); }
		__activenode = this;
		this.className = 'hover';
	}
	node.onmouseout = function() {
		this.hideTimeout = setTimeout(function(){node.hide()}, 500);
	}
	node.hide = function() {
		this.className = '';
		if(__activenode == this) {
			__activenode = false;
		} 
	}
}
window.onload = initMenu;
