/**
 * $Id: scroll.js 8 2009-05-27 13:01:45Z root $
 *
 * Javascript voor het detecteren van de hoogte van het browservenster.
 * Zodra het browservenster kleiner wordt gemaakt dan een bepaalde waarde,
 * worden scroll balken getoond.
 */

function showScroll() {
	var x=0,y=0;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}

	if (x == 0 || y == 0 || ! document.body || ! document.body.style) { return; }
	if (x < 780 || y < 420 && document.documentElement) {
		document.documentElement.style.overflow = 'auto';
	} else {
		document.body.style.overflow = 'visible';
	}
	
}

function fixScroll(div) {
	if (div.childNodes) {
		var s = div.scrollTop;
		div.childNodes[1].focus();
		div.scrollTop = s;
	}
}

window.onload = showScroll;
window.onresize = showScroll;