$(document).ready(function(){
    
    $("a.fancy").fancybox();
    $(".teamlid").fancybox({
	'titlePosition' 		: 'inside'
});

        $('.s1').cycle({
				fx:'cover,scrollRight,uncover,scrollHorz',randomizeEffects:true,random:  1 
			});
            
    $(".joetjube").click(function() {
	           $.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
    });
    
    $(".menu_inhoud").hide();

  $(".menu_header").mouseover(function(){ //When mouse over ...
            $(this).find("a.kop").addClass("hover")
            $(this).find(".menu_inhoud").show()
		});

  $(".menu_header").mouseout(function(){ //When mouse over ...
            $(this).find("a.kop").removeClass("hover")
        	$(this).find(".menu_inhoud").hide()
		});
        
        $(".item2plaatje").hide();
        $(".item3plaatje").hide();
        $(".item1plaatje").fadeIn().delay(3100).fadeOut('fast');
        $(".item2plaatje").delay(3000).fadeIn('slow', animationItem2);
        $(".nieuwsblok:first").addClass("blokactief");
        $(this).find(".item1").hide();
        $(this).find(".item1actief").show();
        
        function animationItem1()
        {
            $(".item2plaatje").hide();
            $(".item3plaatje").hide();
            $(".item1plaatje").delay(3100).fadeOut('fast');
            $(".item2plaatje").delay(3000).fadeIn('slow', animationItem2);
            $("body").find(".nieuwsblok_onder").removeClass("blokactief_special");
            $(".nieuwsblok:first").addClass("blokactief");
            $(".item3").show();
            $(".item3actief").hide();
            $(".item1").hide();
            $(".item1actief").show();
        }
        function animationItem2()
        {   
            $(".item1plaatje").hide();
            $(".item3plaatje").hide();
            $(".item2plaatje").delay(3100).fadeOut('fast');
            $(".item3plaatje").delay(3000).fadeIn('slow', animationItem3);
            $("body").find(".nieuwsblok").eq(0).removeClass("blokactief");
            $("body").find(".nieuwsblok").eq(1).addClass("blokactief");
            $(".item1").show();
            $(".item1actief").hide();
            $(".item2").hide();
            $(".item2actief").show();
        }
        
        function animationItem3()
        {   
            $(".item1plaatje").hide();
            $(".item2plaatje").hide();
            $(".item3plaatje").delay(3100).fadeOut('fast');
            $(".item1plaatje").delay(3000).fadeIn('slow', animationItem1);
            $("body").find(".nieuwsblok").eq(1).removeClass("blokactief");
            $("body").find(".nieuwsblok_onder").addClass("blokactief_special");
            $(".item2").show();
            $(".item2actief").hide();
            $(".item3").hide();
            $(".item3actief").show();
        }
        
        

});
