window.addEvent(
	'domready', 
	function(){
		new Scroller($('twrss_table').getParent());	
	}
);


function Scroller(el) {
	this.move = function() {
		if (this.moving) {
			if (this.top < -120)
				this.top=120;
			this.inner.setStyle('top',this.top -= 1);
		}
	}
	
	this.setState = function(e,s) {this.moving = s;}

	this.init = function() {
		this.el = el;
		this.top = 120;
		this.inner = this.el.getFirst();
		
		this.moving = true;
		this.move.periodical(40,this);
				
		this.inner.getElements('a').addEvents({
			'mouseenter':this.setState.bindWithEvent(this,0),
			'mouseleave':this.setState.bindWithEvent(this,1)
		});				
	}
	this.init();
}

