
var duyurushow = new Class({

              Implements: [Options, Events],
              hedef:null,
              slides:[],
              startIndex:0,
              current:null,
              options: {
  
              },

              initialize: function(el,options){
                      this.hedef=$(el);    
                      this.setOptions(options);

                      $$('.duyuru').each(function(slide){
                        this.slides.include($(slide));
                }, this);
                 this.goster(0);
                 this.ileri.periodical(10000,this);          
              },
              
              
              ileri: function(){

                if($chk(this.now) && this.now < this.slides.length-1) this.goster(this.now+1);
                else if ((this.now)) this.goster(0);
                else if(!$defined(this.now)) this.goster(this.startIndex);

              },
        
              goster: function(iToShow){
                var now = this.now;            
                var currentSlide = this.slides[now];
                var slide = this.slides[iToShow]; 
                var fadeIn = function (s){
                        s.setStyles({
                                display:'block',
                                visibility: 'visible',
                                opacity: 0
                        });
                        s.get('tween').start('opacity', 1);              
                }.bind(this);
                if(slide) {
                        if($chk(now) && now != iToShow){
                                currentSlide.get('tween').start('opacity', 0).chain(function(){
                                        currentSlide.setStyle('display', 'none');
                                        fadeIn(slide);
                                }.bind(this));
                        } else fadeIn(slide);
                        this.now = iToShow;
                }
              }
                 
  });
