
            var SimpleSlideshow = new Class({
                options: {
                    showControls: true,
                    showDuration: 5000,
                    showTOC: true,
                    tocWidth: 16,
                    tocClass: 'STOC',
                    tocActiveClass: 'STOX'
                },
                Implements: [Options,Events],
                initialize: function(container,elements,options) {
                    //settings
                    this.container = $(container);
                    this.elements = $$(elements);
                    this.currentIndex = 0;
                    this.interval = '';
                    if(this.options.showTOC) this.toc = [];
                    //assign
                    this.elements.each(function(el,i){
                        if(this.options.showTOC) {
                            this.toc.push(new Element('a',{
                                title: el.getAttribute('zyx_tt'),
                                href: '#',
                                'class': this.options.tocClass + '' + (i == 0 ? ' ' + this.options.tocActiveClass : ''),
                                events: {
                                    click: function(e) {
                                        if(e) e.stop();
                                        this.stop();
                                        this.show(i);
                                    }.bind(this)
                                },
                                styles: {
                                    right: ((i + 1) * (this.options.tocWidth + 0) + 20)
                                }
                            }).inject(this.container));
                        }
                        if(i > 0) el.set('opacity',0);
                    },this);
                    
                    //next,previous links
                    if(this.options.showControls) {
                        this.createControls();
                        
                    }
                    //events
                    this.container.addEvents({
                        mouseenter: function() { 
                            this.stop();
                            $('SWND_STOP').className = 'fired';
                        }.bind(this),
                        mouseleave: function() {
                            this.start();
                            $('SWND_STOP').className = '';
                        }.bind(this)
                    });
                },
                show: function(to) {
                    this.elements[this.currentIndex].fade('out');
                    if(this.options.showTOC) this.toc[this.currentIndex].removeClass(this.options.tocActiveClass);
                    this.elements[this.currentIndex = ($defined(to) ? to : (this.currentIndex < this.elements.length - 1 ? this.currentIndex+1 : 0))].fade('in');
                    if(this.options.showTOC) this.toc[this.currentIndex].addClass(this.options.tocActiveClass);
                },
                start: function() {
                    this.interval = this.show.bind(this).periodical(this.options.showDuration);
                },
                stop: function() {
                    $clear(this.interval);
                },
                //"private"
                createControls: function() {
                    var play = new Element('a',{
                        href: '#',
                        id: 'SWND_PLAY',
                        title: '>>',
                        events: {
                            click: function(e) {
                                if(e) e.stop();
                                this.stop(); 
                                this.show();
                            }.bind(this)
                        },
                        styles: {
                            right: (20)
                        }
                    }).inject(this.container);
                    var halt = new Element('a',{
                        href: '#',
                        id: 'SWND_STOP',
                        title: '<<',
                        events: {
                            click: function(e) {
                                if(e) e.stop();
                                this.stop(); 
                            }.bind(this)
                        },
                        styles: {
                            right: (4)
                        }
                    }).inject(this.container);
                }
            });


