var MoreFlipBooks = new Class({

      	Implements: [Events,Options],
      	
      	getOptions: function () {
      		return {
      			direction: false,
      			pageinfo: false
      		}
      	},
      
      	initialize: function ( element, options ) {
      		this.setOptions( this.getOptions(), options);
      		this.element = element;
      		this.length = this.element.length-1;
      		this.getNext();
      	},
      
      	getNext: function () { 
      		if( this.options.direction == 'left' ) {
      		
          		if( this.element[0].hasClass('active') ) {
          			return false;
          		} else {
          			this.element.each( function(elElement,intIdx) {
          				if( elElement.hasClass('active') ) {
          					this.current = intIdx;
          					this.next = intIdx - 1;
          				}
          			}.bind(this));
          			
          			this.element[this.current].removeClass('active');
				this.element[this.current].addClass('inactive');
  					
      				this.element[this.next].removeClass('inactive');
      				this.element[this.next].addClass('active');
      				
      				var pageinfo = (this.next+1) +' / '+ (this.length+1);
      				$$(this.options.pageinfo)[0].set('html',pageinfo);
          		}
          		
      		} else if( this.options.direction == 'right' ) {
      			
      			if( this.element[this.length].hasClass('active') ) {
          			return false;
          		} else {
          			this.element.each( function(elElement,intIdx) {
          				if( elElement.hasClass('active') ) {
          					this.current = intIdx;
          					this.next = intIdx + 1;
          				}
          			}.bind(this));
          			
          			this.element[this.current].removeClass('active');
				this.element[this.current].addClass('inactive');
  					
      				this.element[this.next].removeClass('inactive');
      				this.element[this.next].addClass('active');
      				
      				var pageinfo = (this.next+1) +' / '+ (this.length+1);
      				$$(this.options.pageinfo)[0].set('html',pageinfo);
      				
          		}
          		
      		}
      	}
});