var Scroller = new Class({
	initialize: function(element, interval){
		this.scroll_container 	= $(element);
		this.scroll_elm 		= $(element).getElement('ul');		
		this.height 			= this.scroll_elm.getSize().y;
		this.interval			= interval;
		this.current_top 		= 0;		
		this.afstand			= (Browser.Engine.trident && Browser.Engine.version < 6) ? 162 : 160;		
		this.scroller_fx		= new Fx.Tween(this.scroll_elm, { 
			'property'	: 'top',
			'duration'	: '1000'
		});		
		this.bindActions();		
		this.start();			
	},

	start : function() {		
		this.movement = setInterval(function() {
			this.scroll();
		}.bind(this), this.interval);		
	},
	
	scroll : function() {
		if (this.current_top < -( this.height )) {
			this.current_top = this.afstand;
			this.scroller_fx.set(this.afstand);
		}
		this.current_top -= this.afstand;
		this.scroller_fx.start( this.current_top );
	},
	
	bindActions : function() {
		this.scroll_elm.getElements('li').addEvents({
			'mouseenter' : function() {
				clearInterval(this.movement);
			}.bind(this),
			'mouseleave' : function() {
				this.start();
			}.bind(this)
		});
	}
	
});
