function Scroller() {
	window['scroller'] = this;
	window['panel'] = document.getElementById('panel');
	this.panel = window['panel'];
	this.btnUp = document.getElementById('btnUp');
	this.btnDown = document.getElementById('btnDown');

	this.btnUp.onmousedown = function() { scroller.scrollUp(); }
	this.btnUp.onmouseup = function() { scroller.cancelScroll(); }
	this.btnDown.onmousedown = function() { scroller.scrollDown(); }
	this.btnDown.onmouseup = function() { scroller.cancelScroll(); }
	
	this.offsetHeight = this.panel.offsetHeight;
	this.step = 5;
	this.delay = 30;
	this.elementHeight = 360;
	
	this.scrollTimer = null;
	
	this.getPosY = function() {
		return this.panel.offsetTop;
	}
	
	this.scrollDown = function() {
		var newPos = this.getPosY() - step;
		if(newPos <= -(this.offsetHeight - this.elementHeight) ) {
			this.cancelScroll();
			return false;
		}
		this.panel.style.top = newPos + "px";
		this.scrollTimer = setTimeout("this.scrollDown()", this.delay);
	}
	
	this.scrollUp = function() {
		var newPos = this.getPosY() + step;
		if(newPos >= step) {
			this.cancelScroll();
			return false;
		}
		this.panel.style.top = newPos + "px";
		this.scrollTimer = setTimeout("this.scrollUp()", this.delay);
	}
	
	this.cancelScroll = function() {
		clearTimeout(this.scrollTimer);
		this.scrollTimer = null;
	}
}

addEvent(window, "load", Scroller);