var SC = {
	timer:null,
	interval:50,
	step:3,
	elem:null,
	scroll_real_h:NaN,
	scroll_visible_h:NaN,

	set:function(real_h, visible_h, arrows_div) {
		SC.scroll_real_h = real_h;
		SC.scroll_visible_h = visible_h;
		SC.elem.style.position = "absolute";
		SC.elem.style.top = "0px";
		SC.elem.style.left = "0px";
		if ((real_h - visible_h) >= 0)
			$(arrows_div).style.display = "block";
	},

	goScrollDown: function() {
		var diff = SC.scroll_real_h - SC.scroll_visible_h;
		if (diff <= 0)
			return;

		var top = parseInt(SC.elem.style.top, 10);
		if ((top * (-1)) <= diff)
			SC.elem.style.top = parseInt(top - SC.step) + 'px';
	},

	goScrollUp: function() {
		var diff = SC.scroll_real_h - SC.scroll_visible_h;
		if (diff <= 0)
			return;

		var top = parseInt(SC.elem.style.top, 10);
		if (top <= 0)
			SC.elem.style.top = parseInt(top + SC.step) + 'px';
	},

	scrollDown: function() {
		SC.timer = setInterval(SC.goScrollDown, SC.interval);
	},

	scrollUp: function() {
		SC.timer = setInterval(SC.goScrollUp, SC.interval);
	},

	stopScroll: function() {
		clearInterval(SC.timer);
	}
}
