
if (typeof Effect == 'undefined') 
	throw("listslideshow.js requires including script.aculo.us' effects.js library!");

var ListSlideShow = Class.create();
ListSlideShow.prototype = {

	//
	//  Setup the Variables
	//
	showList : null,
	LastList : null,
	duration : null,
	effects : [],
	animating : false,
	
	//  
	//  Initialize the accordions
	//
	initialize: function(container, options) {
		if (!$(container)) {
			throw(container+" doesn't exist!");
			return false;
		}
		
		if (!$(container).down()) {
			throw(container+" doesn't exist!");
			return false;
		}
		
		var slideshowlists = $(container).down().next();
		var LastList = slideshowlists.previous();
		
		this.options = Object.extend({
			durationtime : 8
		}, options || {});
		
		this.duration = this.options.durationtime;
		
		new PeriodicalExecuter(function(pe) {			
			if(slideshowlists){
				Effect.SlideUp(LastList, { duration: 1.0 });
				
				//slideshowlists.show();
				Effect.SlideDown(slideshowlists, { duration: 1.0 });
				
				LastList = slideshowlists;
				slideshowlists = slideshowlists.next('li');				
			}else {
				slideshowlists = $(container).down();
			}
		}, this.duration);
		 
	}	
}
	