/***
    Simple jQuery Slideshow Script
    Tom de Boer
***/

var slideshow_images,
    slideshow_active;

function slideshow_start(){
    slideshow_images = $('#background > *').css('opacity',0);
    slideshow_active = slideshow_images.first().css('opacity',1);
}
function slideshow_next() {

    var $active = slideshow_active;
    var $next = $active.next();
    if (!$next.length) $next = slideshow_images.first();

    //console.log($active,$next);

    $next.animate({opacity: 1}, 2000, 'linear');
    $active.animate({opacity: 0}, 2000, 'linear');

    slideshow_active = $next;
}

$(function() {
    slideshow_start();
    setInterval( "slideshow_next()", 7000 );
});

