var mt = 0;
var st = 0;
var pl = 0;
var lopend = 0; // -1 = vast, 0 = springen, 1 = lopend

function plcMnu() { // menu `lopend` of `springend` op z'n plaats brengen
	if (lopend == 0) {
		mt = st;
	}
	
	if (document.getElementById) {
		document.getElementById('mnu').style.top = mt;
	} else if (document.all) {
		document.all('mnu').style.top = mt;
	}
	
	if (lopend == 1) {
		if (mt < st) {
			mt = mt + 20;
			if (mt > st) {
				mt = st;
			}
		} else if (mt > st) {
			mt = mt - 20
			if (mt < st) {
				mt = st;
			}
		}
		pl = setTimeout('plcMnu()', 10);
	}
}

function setMnu() {
	st = document.body.scrollTop;
	yc = 100; // y correctie: menu pas naar beneden als `bovenste bruine balk + middelse 3 blokjes` uit beeld zijn
	if (st >= yc) {
		st = st - yc;
	} else if (st < yc) {
		st = 0;
	}
	
	if (mt != st) {
		clearTimeout(pl);
		plcMnu();
	}
	
	setTimeout('setMnu()', 1000);
}
if ( ( (document.body.scrollTop) || (document.body.scrollTop >= 0) ) && (lopend != -1) ) {
	if (document.getElementById) {
		mt = document.getElementById('mnu').style.top;	
	} else if (document.all) {
		mt = document.all('mnu').style.top;
	} else {
		mt = 'null';
	}
	
	if (mt != 'null') {
		if (mt == '') {
			mt = 0;
		} else if (mt.indexOf('px') > -1) {
			mt = mt.substring(0, mt.length - 2);
		}
		
		tehoog = true;
		if (screen.height) {
			if (screen.height >= 600) {
				tehoog = false;
			}
		}
		if ( (!tehoog) && (document.body.scrollHeight) ) {
			if (document.body.scrollHeight > 365) {
				tehoog = false;
			} else {
				tehoog = true;
			}
		}
		if (!tehoog) {
			setMnu();
		}
	}
}