/* Made by Furu systems - furusystems.com */
var Panes = new Class({
	options : {
		className: 'pane',
		wait: false,
		duration: 2500,
		offset: {'x': 0, 'y': 0},
		transition: Fx.Transitions.Quad.easeInOut,
		width: 0
	},
		
	initialize: function(container, options){
		this.setOptions(options);
		this.container = $(container);
		this.elements = $$('.' + this.options.className);
		this.scroll = new Fx.Scroll(this.container, this.options);
		this.index = 0;
	},
	
	next: function(){
		if((this.index + 1) < this.elements.length){
			this.scrollToElement(this.index+1);
		}else{
			this.scrollToElement(0);
		}
	},
	
	prev: function(){
		if((this.index - 1) >= 0){
			this.scrollToElement(this.index-1);
		}else{
			this.scrollToElement(this.elements.length-1);
		}
	},
	
	scrollToElement: function(element){
		if(this.options.width > 0){
			this.scroll.scrollTo(element*this.options.width, 0);
		}
		this.index = element;
	}
});
Panes.implement(new Events, new Options);	
