var div = null;

document.observe("dom:loaded", function() {
	lichtkrant = new lichtkrant();
	lichtkrant.setDiv('lichtkrant');
	lichtkrant.move();
});

function lichtkrant(){
	loop = true;
	scrollLeft = 0;	
	timer = 0.05;
	steps = 2;

		this.setDiv = function(divID){
			div = $(divID);
		}
		
		this.setLeftDirection = function() {
			if(div.scrollLeft != 924){
				div.scrollLeft += steps;
			}else{
				//console.log('else');
					if(loop){
						//console.log('loop');
						div.scrollLeft = 0;
					}					
			}
									
		}
				
		this.move = function() {
			div.scrollLeft = 0;
			new PeriodicalExecuter(this.setLeftDirection, timer);
		}
		
}

