// Scroll.js : scrolling for the gallery

var elemIntUp;
var elemIntDown;
var rawId;

function scrollWindow(id, direct) {
	objId = document.getElementById(id);
	rawId = id;
	if ( direct == 'down' ) {
		elemIntDown = window.setInterval("scrollDown()", 40);
	} else if ( direct == 'up' ) {
		elemIntUp = window.setInterval("scrollUp()", 40);
	}
}

function scrollDown() {
	document.getElementById(rawId).scrollTop += 5;
}

function scrollUp() {
		document.getElementById(rawId).scrollTop -= 5;
}
	
function clearIntUp() {
	window.clearInterval(elemIntUp);
}

function clearIntDown() {
	window.clearInterval(elemIntDown);
}
