function slideSwitch() {		
    var $active = $('#slideshow a.active');
    if ( $active.length == 0 ) $active = $('#slideshow a:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow a:first');		
    // haal de onderste 3 commetaren weg om er een random slideshow van te maken.    
     //var $sibs  = $active.siblings();
     //var rndNum = Math.floor(Math.random() * $sibs.length );
     //var $next  = $( $sibs[ rndNum ] );	
    $active.addClass('last-active');	
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });		
	var $next =  $active.next().length ? $('#maskerclick').attr("href", $active.next().attr("href"))
        : $('#maskerclick').attr("href", $('#slideshow a:first').attr("href"));
		
}

function slidepersoon() {		
    var $active = $('#slidepersoon a.active');
    if ( $active.length == 0 ) $active = $('#slidepersoon a:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slidepersoon a:first');		
    // haal de onderste 3 commetaren weg om er een random slideshow van te maken.    
     //var $sibs  = $active.siblings();
     //var rndNum = Math.floor(Math.random() * $sibs.length );
     //var $next  = $( $sibs[ rndNum ] );	
    $active.addClass('last-active');	
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });		
	var $next =  $active.next().length ? $('#maskerclick').attr("href", $active.next().attr("href"))
        : $('#maskerclick').attr("href", $('#slidepersoon a:first').attr("href"));
		
}

function slideSwitch_top() {		
    var $active = $('#slideshow_top a.active');
    if ( $active.length == 0 ) $active = $('#slideshow_top a:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow_top a:first');		
    // haal de onderste 3 commetaren weg om er een random slideshow van te maken.    
     //var $sibs  = $active.siblings();
     //var rndNum = Math.floor(Math.random() * $sibs.length );
     //var $next  = $( $sibs[ rndNum ] );	
    $active.addClass('last-active');	
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });		
	var $next =  $active.next().length ? $('#maskerclick_top').attr("href", $active.next().attr("href"))
        : $('#maskerclick_top').attr("href", $('#slideshow_top a:first').attr("href"));
		
}


$(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( "slidepersoon()", 6000 );
		setInterval( "slideSwitch_top()", 3000 );
	});	
});


