

	var headerBusy = false;
	var headerZoomout = false;
	var headerDirection = '';
	var headerPercentage = 0.0;
	var headerTimer = null;
	var headerRun = true ;

	var submenus = Array( Array('submenu1', null, 0.0, false), Array('submenu2', null, 0.0, false), 
		Array('submenu3', null, 0.0, false), Array('submenu4', null, 0.0, false),
		Array('submenu5', null, 0.0, false), Array('submenu6', null, 0.0, false),
		Array('submenu7', null, 0.0, false), Array('submenu8', null, 0.0, false) );
	
	
	
	function runOnLoadHomePage () {
		rollHeader('in', false);
		headerRun=false;
	}
	
	function rollTimer() {
		var obj;
		var strTemp;
		
		headerTimer = null;
		
		if (headerDirection == 'in') {
			headerPercentage += 0.07;
			
			if (headerPercentage >= 1.0) {
				headerBusy = false;
				headerPercentage = 1.0;
				
				if (headerZoomout) {
					headerDirection = 'out';
					headerTimer = setTimeout(rollTimer, 1500);
					headerBusy = true;
				}
			} else {
				headerTimer = setTimeout(rollTimer, 30);
			}
		} else {
			headerZoomout = false;
			headerPercentage -= 0.07;
			
			if (headerPercentage <= 0.0) {
				headerPercentage = 0.0;
				headerBusy = false;
			} else {
				headerBusy = true;
				headerTimer = setTimeout(rollTimer, 30);
			}
		}
		
		//if (!headerBusy)
		//	window.status = '';

		obj = document.getElementById("headerimg");
		obj.style.height = 139 + (250 - 139) * Math.pow(headerPercentage, 2) + 'px';
		
		strTemp = 340 + (354 - 340) * Math.pow(headerPercentage, 2) + 'px ';
		strTemp += -161 + 161 * Math.pow(headerPercentage, 2) + 'px';
		obj = document.getElementById("bodytext");
		obj.style.backgroundPosition = strTemp;
		
		obj = document.getElementById("menu");
		obj.style.margin = 0 * Math.pow(headerPercentage, 2) + 'px 0px -10px 0px';
	}

	function rollHeader(richting, boolNoAction) {
		if (headerRun) {
			if (richting == "in" && headerDirection != "in") {
				if (!boolNoAction) {
					headerBusy = true;
					headerDirection = richting;
					headerZoomout = false;
					headerTimer = setTimeout(rollTimer, 100);
				}
			} else {
				if (!headerBusy || (headerPercentage == 1.0)) {
					headerBusy = true;
					headerDirection = richting;
					
					if (!headerTimer && !headerZoomout) {
						headerTimer = setTimeout(rollTimer, 1500);
					}
				} else {
					headerZoomout = true;
				}
			}
		}
		
		//window.status = 'dir=' + richting + ' zo=' + headerZoomout;
	}

	function showsubmenu(intWhich) {
		// 'submenu1', null, 0, false
		submenus[intWhich][3] = true;
		if (!submenus[intWhich][1])
			submenus[intWhich][1] = setTimeout('showsubmenuTimer(' + intWhich + ')', 100);
	}
	
	function hidesubmenu(intWhich) {
		if (submenus[intWhich][3]) {
			submenus[intWhich][3] = false;
			if (!submenus[intWhich][1])
				submenus[intWhich][1] = setTimeout('showsubmenuTimer(' + intWhich + ')', 100);
		}
	}
	
	function showsubmenuTimer(intWhich) {
		var obj, loop, pos;
		obj = document.getElementById(submenus[intWhich][0]);
		
		if (obj) {
			if (submenus[intWhich][3])
				pos = submenus[intWhich][2] + 0.08;
			else
				pos = submenus[intWhich][2] - 0.08;
			
			if (pos > 1.0)
				pos = 1.0;
			if (pos < 0.0)
				pos = 0.0;
				
			submenus[intWhich][2] = pos;
			
			pos = 50 - 50 * Math.pow(1.0 - pos, 2);
		
			obj = obj.getElementsByTagName("div");
			
			if (obj.length > 1) {
				for (loop = 0; loop < obj.length; loop++) {
					obj[loop].style.paddingTop = pos * (obj.length - loop - 1) + 'px';
				}
			} else {
				obj.style.paddingTop = pos * (obj.length - loop - 1) + 'px';
			}
			
			clearTimeout(submenus[intWhich][1]);
			submenus[intWhich][1] = null;
			
			if ( (submenus[intWhich][3] && (submenus[intWhich][2] < 1.0))
				|| (!submenus[intWhich][3] && (submenus[intWhich][2] > 0.0)) ) {
					submenus[intWhich][1] = setTimeout('showsubmenuTimer(' + intWhich + ')', 40);
			}
		}
	}
	
	function rollerke(dePic, deSrc, srcEl) {
		var objStr,obj;
		var destPic = null;
		var x,y;
		
		if(document.images) {
			if (typeof(dePic) == 'string') {
				objStr = 'document.' + dePic;
				destPic = eval(objStr);
				destPic.src = deSrc;
			} else if ((typeof(dePic) == 'object') && daImage && dePic.src) {
				destPic = dePic;
				destPic.src = deSrc;
			}
			
			obj = document.getElementById('wijzer');
			if (srcEl) {
				x = 0; 
				y = 0;
				var objprop = destPic;
		
				if (objprop) {	
					x = objprop.offsetLeft;
					y = objprop.offsetTop;
					
					x += objprop.scrollLeft;
					y += objprop.scrollTop;
					
					while (objprop.offsetParent != null) {
				      objprop = objprop.offsetParent;
					  
				      x += objprop.offsetLeft;
				      y += objprop.offsetTop;
					  
				      x += objprop.scrollLeft;
				      y += objprop.scrollTop;
					  
				      if (objprop.tagName == 'BODY') break;
				    }
				}
				if (y == 0) {
					obj.style.left = x - 80;
					obj.style.top = y;
					obj.style.display = '';
				}
			} else {
				obj.style.display = 'none';
			}
		}
	}


	function buttonOver(el) {
		var obj = document.getElementById(el);
		
		if (obj)
			obj.className = 'button-over';
	}
	
	function buttonOut(el) {
		var obj = document.getElementById(el);
		
		if (obj)
			obj.className = 'button';
	}	

