/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch(afb_nr) {
	num_afb = afb_nr+1;
	
	
	if (num_afb == 1) {
		kleur = "#43170a";
	}
	
	if (num_afb == 2) {
		kleur = "#495e6f";
	}
	
	if (num_afb == 3) {
		kleur = "#523c13";
	}
	
	if (num_afb == 4) {
		kleur = "#e40641";
	}
	
	if (num_afb == 5) {
		kleur = "#61868f";
	}
	
	if (num_afb == 6) {
		kleur = "#9cb4c0";
	}
	
	
	
	var $active = $('#background_home IMG.active');

    if ( $active.length == 0 ) $active = $('#background_home IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $('#background_home IMG.afb'+num_afb);

    // uncomment the 3 lines below to pull the images in random order
    
    // 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');
    });
    $('#home').animate({ backgroundColor: kleur }, 1000);
        
}

