

// Onderstaande functie niet aanpassen op het onderdeel RANDOM na, deze kun je activeren door de 3 regels eronder actief te maken
function slideSwitch() {
	
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');	
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 3500, function() {
            $active.removeClass('active last-active');
        });
}

function slideAanbieding() {
	
    var $active = $('#slideaanbieding IMG.active');
    if ( $active.length == 0 ) $active = $('#slideaanbieding IMG:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideaanbieding IMG:first');

    $active.addClass('last-active');	
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1722, function() {
            $active.removeClass('active last-active');
        });
}
 
$(document).ready(function() {	
	$("a.single_3").fancybox({
		'overlayShow'			: true,
		'overlayOpacity'		: 0.5,
		'padding'				:	0
	});	
	
	$("a.single_4").fancybox({
		'overlayShow'			: true,
		'overlayOpacity'		: 0.5,
		'padding'				:	0
	});
	
	$(function() {
		setInterval( "slideSwitch()", 5000 );
		setInterval( "slideAanbieding()", 3250);
	});	
});
