/*
	PhotoBooth Memories App.
	Ryan Rampersad, MooTools Core, More and Forge.
*/

var App = {};
App.Instances = {};

App.Carousel = new Class({
	Implements: [Options],
	options: {
		period: 4200,
		scroll: {
			duration: 850
		}
	},
	initialize: function(target, options) {
		this.setOptions(options);
		this.element = document.id(target);
		this.carousel = new Fx.Scroll.Carousel(this.element, this.options.scroll);
		
		this.refresh = this.slide.periodical(this.options.period, this);
	},
	slide: function() {
		this.carousel.toNext();
	}
});

window.addEvent("domready", function(){
	var CarouselTarget = document.id("horizontal");
	if ( CarouselTarget ) App.Instances.Carousel = new App.Carousel(CarouselTarget);
});
