﻿var deTimert;
var scrollTot = -1;
var y = height = 0;

function scrollBoven () {
	if (scrollTot == -1) {
		document.getElementById ("buitenste").style.overflow = "auto";
		document.getElementById ("binnenste").style.overflow = "auto";
		scrollTot = document.getElementById ("binnenste").scrollHeight - document.getElementById ("buitenste").offsetHeight;
		document.getElementById ("binnenste").style.overflow = "hidden";
		document.getElementById ("buitenste").style.overflow = "hidden";
	}
	var scrollert = document.getElementById ("binnenste");
	
	deTimert = setTimeout ("scrollBoven ()", 50);

	if (y > -scrollTot) {
	y -= 5;
	height += 5;
	}
	
	scrollert.style.top = y + "px";
	scrollert.style.height = (400 + height) + "px";
}


function scrollOnder () {
	var scrollert = document.getElementById ("binnenste");
	
	deTimert = setTimeout ("scrollOnder ()", 50);
	
	if (y < 0) {
		y += 5;
		height -= 5;
	}
	
	scrollert.style.top = y + "px";
	scrollert.style.height = (400 + height) + "px";
}


function stopScroll () {
	
	clearTimeout (deTimert);
}
