function __scrollTimer(obj) {
	obj.scrolling();
}

function _scrolling() {
	var _this=this;
	if (this.delta<this.direction) this.delta++;
	if (this.delta>this.direction) this.delta--;
	
	cm=parseInt(this.plane.style.marginTop);
	if (isNaN(cm)) cm=0;
	
	if (cm+this.delta<0 && cm+this.delta>-(this.dataHeight-this.cntHeight)) {
		this.plane.style.marginTop=cm+this.delta;
		if (this.isScrolling) setTimeout(function(){_this.scrolling();},50);
	}
}

function _startScrollUp(speed) {
	this.direction=-speed;
	if (this.isScrolling==0) {
		this.isScrolling=1;	
		this.scrolling();
	}
}

function _startScrollDown(speed) {
	this.direction=speed;
	if (this.isScrolling==0) {
		this.isScrolling=1;	
		this.scrolling();
	}
}

function _endScroll() {
	this.isScrolling=0;
	this.delta=0;
}

function divScroller(container,plane) {

	this.cntHeight=parseInt(dojo.byId(container).style.height);
	this.dataHeight=dojo.byId(plane).scrollHeight;
	
//	alert(this.dataHeight);
		
	this.isScrolling=0;
	this.delta=0;
	
	this.plane=dojo.byId(plane);
	
	this.scrolling=_scrolling;
	this.startScrollUp=_startScrollUp;
	this.startScrollDown=_startScrollDown;
	this.endScroll=_endScroll;
}

