/* Copyright 2007 DKOS.IE
 *
 * Developed by www.adecsys.com
 */

function subBg(element) {

    element = $(element);
    element.style.backgroundPosition = "0px -31px";
}

  function startSlideshow() {
    new PeriodicalExecuter(function () {
        var index = $('slideshow').getAttribute('current_index') || 0;
        var images = $$('#slideshow img');
        var nextIndex = ((1+parseInt(index)) >= images.length) ? 0 : (1+ parseInt(index));

        $('slideshow').setAttribute('current_index', nextIndex);

        new Effect.Parallel([
          new Effect.Fade(images[index], {sync:true,transition:Effect.Transitions.sinoidal}),
          new Effect.Appear(images[nextIndex], {sync:true,transition:Effect.Transitions.linear})
        ], { duration:2});
      }, 12);
  }

