function slideShow(box) {
    var active = $('#'+box+' div.active');

    if ( active.length == 0 ) { 
        active = $('#'+box+' div:last');
    }

    var next =  active.next().length ? active.next() : $('#'+box+' div:first');
    active.addClass('last-active');

    next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            active.removeClass('active last-active');
        });
    
}
function startSlideShow (class_name, seconds) {
    $('.'+class_name).each(function () {
        setInterval( "slideShow('"+$(this).attr('id')+"')", seconds * 3000 );
    });
}
$(function() {
    // Send the class name and the seconds. 
    // Right now everything with this class has to have a unique id.
    startSlideShow('slide_show', 2);
});
