

<!--

var Opera = window.opera ? true : false;

var IE = (document.all && document.getElementById) ? true:false;

var mouseX;
var mouseY;
var nowId;
var aLnk = "";

function getMouseXY(e) {
	if (IE) { // grab the x-y pos.s if browser is IE
		mousex = event.clientX + document.body.scrollLeft;
		mousey = event.clientY + document.body.scrollTop;
	}
	else {  // grab the x-y pos.s if browser is not IE
		mousex = e.pageX;
		mousey = e.pageY;
	}
}

// Function captureMouse()
// Purpose : triggers the function getMouseXY() on initialisation of the body
function captureMouse(){
	if (!IE) document.captureEvents(Event.MOUSEMOVE)
	document.onmousemove = getMouseXY;
}

//Thanx Alex Vincent (http://www.codingforums.com/showthread.php?t=7028)
var notWhitespace = /\S/;

function cleanWhitespace(node) {
  for (var x = 0; x < node.childNodes.length; x++) {
    var childNode = node.childNodes[x]
    if ((childNode.nodeType == 3)&&(!notWhitespace.test(childNode.nodeValue))) {
// that is, if it's a whitespace text node
      node.removeChild(node.childNodes[x])
      x--
    }
    if (childNode.nodeType == 1) {
// elements can have text child nodes of their own
      cleanWhitespace(childNode)
    }
  }
}

function initMenuBehavior(){ 
	var x = document.getElementById('menu');
	if (!x) return;
	var y = x.getElementsByTagName('a');
	for (var i=0;i<y.length;i++){
		if(y[i].id.indexOf('menu-') != -1){
			y[i].onmouseover = triggerMenu;
			y[i].onmouseout = checkMenu;
		} 
	}
}

function triggerMenu(){
	cleanWhitespace(this.parentNode);
	if(this.nextSibling && this.nextSibling.className.indexOf('sub-menu') !=-1){
		openMenu(this);
	} else if (aLnk != ""){			//RS 27-07-2005 : toegevoegd om dropdown-menu ook te sluiten wanneer muis over top-menuitem zonder submenu-items gaat
		setTimeout('hideIt(aLnk);', 10);	
	}
}

function checkMenu(){
	cleanWhitespace(this.parentNode);
	if(this.nextSibling && this.nextSibling.className.indexOf('sub-menu') !=-1){
		if(this.id == aLnk){
			this.className = "over";
		} else {
			this.className = "out";
		}
	}
}

// --- NAVIGATIE ---

function openMenu(thisRef){
	var x = 0;
	var y = 0;
	nowId = thisRef.id;
	var tempRef = thisRef;
	while( tempRef.offsetParent != null ) {
		y +=tempRef.offsetTop;
		x += tempRef.offsetLeft;
		tempRef = tempRef.offsetParent;
    }
	setTimeout('checkMousePos("' + thisRef.id + '","' + x + '","' + y + '");', 10);
}

function checkMousePos(thisId, varX, varY){
	if(thisId == nowId){
		w = document.getElementById(thisId).offsetWidth + 2;		//27-07-2005 RS: + 2px omdat offsetWidth/offsetHeight anders niet precies het hele menu-item omvat
		h = document.getElementById(thisId).offsetHeight + 2;
		if(mousey > parseInt(varY-1) && mousey < (parseInt(varY) + h) && mousex > parseInt(varX-1) && mousex < (parseInt(varX) + w)){	//01-08-2005 RS: varX en varY - 1px om ook in Firefox juist menugedrag te krijgen (geen nadelig impact voor IE)
			onlyOpen(thisId, varX, varY);
			setTimeout('closeMenu("'+ thisId + '");', 1500);
		}
	}
}

function onlyOpen(thisId, varX, varY){
	var w;
	var l;
	var h;
	var x = 0;
	var y = 0;
	var r = document.getElementById(thisId);
	
	if ((aLnk != thisId) && (aLnk != "")){
		hideIt(aLnk);
	}
	
	aLnk = thisId;

	x = parseInt(varX);
	y = parseInt(varY);
	
	h = r.offsetHeight;
 	
	if(Opera){	
		r.nextSibling.style.left = x + 'px !important'; 
		r.nextSibling.style.top = (y + h) + 'px !important'; 
	} else {
		r.nextSibling.style.left = x + 'px'; 
		r.nextSibling.style.top = (y + h) + 'px'; 
	}
}

function closeMenu(thisId){
	var r = document.getElementById(thisId);
	
	var l = r.nextSibling.offsetLeft;
	var w = r.nextSibling.offsetWidth + l;
	var hLnk = document.getElementById(thisId).offsetHeight;
	var t =  r.nextSibling.offsetTop - hLnk;
	var h =  r.nextSibling.offsetHeight + hLnk + t;
	
	if(mousex > w || mousex < l || mousey > h || mousey < t){
		hideIt(thisId);
	} else {
		setTimeout('closeMenu("'+ thisId + '");', 1500);
	}

}

function hideIt(thisId){
	document.getElementById(thisId).className = "out"
	document.getElementById(thisId).nextSibling.style.left = '-999em';
}

function init(){
	initMenuBehavior();
	captureMouse();
	preloadImages('images/menubar_mo.gif', 'images/menubar_selected.gif');
	externalLinks();
}


//-->