
var timer;
var delay = 30;
var scroll = 5;

function scrollDown() {
	container = document.getElementById("scroll_container");
	viewport = document.getElementById("scroll_viewport");
	if (container.offsetTop + container.scrollHeight + 2 < viewport.offsetHeight)
		return;
	container.style.top = (container.offsetTop - scroll) + "px";
	timer = setTimeout("scrollDown()", delay);
}

function scrollUp() {
	container = document.getElementById("scroll_container");
	if (container.offsetTop + 2 > 0)
		return;
	container.style.top = (container.offsetTop + scroll) + "px";
	timer = setTimeout("scrollUp()", delay);
}

function clearScroll() {
	clearTimeout(timer);
}
