/*** 
    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 slideSwitch2() {
    var $active = $('.slider IMG.active');

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

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('.slider IMG:first');

    // 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');
        });
}

$(function() {
    setInterval( "slideSwitch2()", 5000 );
});



//Hoogte
function set_hoogte(){

	var hoogte = $("#rechts").height();
	var menuhoogte = $("#menu").height();
	if(hoogte > menuhoogte) {	
		$('#menu').css({
			height: hoogte+250
		}); 
	} else {
		$('#menu').css({
			height: menuhoogte+250
		});
	}
}

function set_hoogte_teams(){
	$('#menu').css({
			height: 700
		});
	var hoogte = $("#rechts").height();
	var menuhoogte = $("#menu").height();
	if(hoogte > menuhoogte) {	
		$('#menu').css({
			height: hoogte+250
		}); 
	} else {
		$('#menu').css({
			height: menuhoogte
		});
	}
}

$(document).ready(function() {
	$(".teams a.teamclick").click(function() {
		$(".submenu").toggle(400);
		setTimeout( "set_hoogte()", 500);
	});
	
	$(".kgt a.kgtclick").click(function() {
		$(".submenukgt").toggle(400);
		setTimeout( "set_hoogte()", 500);
	});
	
	$(".jbs a.jbclick").click(function() {
		$(".submenujb").toggle(400);
		setTimeout( "set_hoogte()", 500);
	});

	$(".lgz a.lgzclick").click(function() {
		$(".submenulgz").toggle(400);
		setTimeout( "set_hoogte()", 500);
	});
	
	$("#accordion h2").click(function(){
		setTimeout( "set_hoogte_teams()", 500);
	});
	
	;
	
	setTimeout( "set_hoogte()", 50);
});
