var scrolling = false;
var scrollUp = false;

function startScrollUp() {
	scrolling = true;
	scrollUp = true;
	doScroll();
}

function startScrollDown() {
	scrolling = true;
	scrollUp = false;
	doScroll();
}

function endScroll() {
	scrolling = false;
}

function doScroll() {
	if (scrolling) {
		e = document.getElementById("scroller").firstChild;
		margin = parseInt(e.style.marginTop) || 0;

		if (scrollUp) {
			scrollerHeight = document.getElementById("scroller").offsetHeight;
			if (e.lastChild.offsetHeight > Math.abs(margin) + scrollerHeight - 40)
				e.style.marginTop = (margin - 10) + "px";
			else
				return;
		} else {
			if (margin < 0)
				e.style.marginTop = (margin + 10) + "px";
			else
				return;
		}
		setTimeout('doScroll()', 50);
	}
}