var horizontal;
var bottom;
var periodical;

window.addEvent('domready',function(){
	
	horizontal = new Fx.Scroll.Carousel('horizontal',{
		mode: 'horizontal'
	});
			
	//$('loopOnScrollEnd').addEvent('change',function(){
		//var bool = (this.value == 'true') ? true : false;
		horizontal.options.loopOnScrollEnd = true;
	//});
		
	var fx = function() {
		horizontal.toNext();
	}
	
	bottom = new Fx.Scroll.Carousel('bottom',{
		mode: 'horizontal'
	});
			
	//$('loopOnScrollEnd').addEvent('change',function(){
		//var bool = (this.value == 'true') ? true : false;
		bottom.options.loopOnScrollEnd = true;
	//});
		
	var fx = function() {
		horizontal.toNext();
		bottom.toNext();
	}
	
	periodical = fx.periodical(5000);
	
	/*
	$('horizontal').addEvent("mouseenter", function(){
		$clear(periodical);
		
	});
        //this clears the periodical, and highlights the timer bar
	$('horizontal').addEvent("mouseleave", function(){
		fx();
		periodical = fx.periodical(5000);
	});
	
	$('bottom').addEvent("mouseenter", function(){
		$clear(periodical);
		
	});
        //this clears the periodical, and highlights the timer bar
	$('bottom').addEvent("mouseleave", function(){
		fx();
		periodical = fx.periodical(5000);
	});
	*/
});
