/**
 * Custom scripts
 *
 * Requires Prototype 1.6.
 *
 * @author Julien Vignolles <julien@ciblo.net>
 * @legals © 2009 Ciblo SA.
 */

function homepageBackgroundCycle() {
        var images = $$('#header .panoramic a.randomBackground');
        if (0 == images.length) return;
        var len = images.length, index = 0;
        new PeriodicalExecuter(function(pe) {
                images[index].visualEffect('Fade', { duration: 1 });
                index = (index + 1) % len;
                images[index].visualEffect('Appear', { duration: 1 });
        }, 7);
} // homepageBackgroundCycle

document.observe('dom:loaded', function() {
        homepageBackgroundCycle();
});

