window.addEvent('domready',function() {
    /* settings */
    var showDuration = 8000;
    var container = $('bannercont');
    var images = container.getElements('div');
    images.shuffle();
    var currentIndex = 0;
    var interval;
    /* opacity and fade */
    images[0].set('opacity',1);
    images.each(function(img,i){
      if(i > 0) {
        img.set('opacity',0);
      }
      img.set('tween', {duration: 'long'});
    });
    /* worker */
    var show = function() {
      images[currentIndex].fade('out');
      images[currentIndex = currentIndex < images.length - 1 ? currentIndex+1 : 0].fade('in');
    };
    /* start once the page is finished loading */
    interval = show.periodical(showDuration);
});

