/* 
 * Vervang steeds de foto door een nieuwe en neem de volgende deelnemer
 */

function slideSwitch(){
    showNextPhoto();
    showNextPerson();
}
function showNextPhoto(){
    var $active = $('#fader img.active');
    if ( $active.length == 0 ) $active = $('#fader img:last');
    var $next =  $active.next().length ? $active.next(): $('#fader img:first');
    $active.fadeOut().removeClass('active').addClass('inactive');
    $next.fadeIn().removeClass('inactive').addClass('active');
}
function showNextPerson() {
    var $active = $('#etalage div.active');
    if ( $active.length == 0 ) $active = $('#etalage div:last');
    var $next =  $active.next().length ? $active.next(): $('#etalage div:first');
    $active.fadeOut().removeClass('active').addClass('inactive');
    $next.fadeIn().removeClass('inactive').addClass('active');
}
$(document).ready(function () {
     setInterval( "slideSwitch()", 6000 );
});

