$(window).bind("load", function() {
	$("#slider").slideView({
		easeFunc: "easeInOutCirc",
		easeTime: 500
	});
});
$(document).ready(function(){
	defkwick = $('.kwicks > li').index($('.kwicks > li.active'));
	if(defkwick >= 0){}
	else
	{
		defkwick = 0;
	}
	$('.kwicks').kwicks({
		min : 54,
		spacing : 0,
		sticky: true,
		defaultKwick: defkwick
	});
	$('.kwicks > li').hover(function(){
		$('.kwicks > li').removeClass("kleur1 kleur2 kleur3 kleur4 kleur5");
		var eqindex = $('.kwicks > li').index(this);
		$(this).addClass("kleur1");
		var eqindexprev = eqindex-1;
		var kleur = 2;
		while(eqindexprev>=0)
		{
			$('.kwicks > li').eq(eqindexprev).addClass("kleur"+kleur);
			eqindexprev = eqindexprev-1;
			kleur = kleur+1;
		}
		var eqindexnext = eqindex+1;
		var kleur = 2;
		while(eqindexnext<=4)
		{
			$('.kwicks > li').eq(eqindexnext).addClass("kleur"+kleur);
			eqindexnext = eqindexnext+1;
			kleur = kleur+1;
		}
	}).filter('.active').trigger('hover');

	$('.rubriek').each(function(){
		$(this).children('a:even').css('margin-right','16px');
	});
	$('#contentbottom .medewerker:nth-child(3n+1)').css('margin-right','0px');
	
        $('a.thumbs').mouseover(function(){
            $(this).children("img.hover").show();
            //$(this).children("img.hover").stop();
        });
        $('a.thumbs').mouseout(function(){
           // $(this).children("img.hover").stop();
            $(this).children("img.hover").hide();
        });
		
	/*TARGET BLANK*/
	$("a[href^='http://'],a[href^='www.'],a[rel='external']").not("a[href^='http://www.krbreclame.nl'],a[href^='http://krbreclame.nl']").attr('target','_blank');
	/*EINDE TARGET BLANK*/
	
	$("#contentright .thumbs").each(function(){
		$(this).attr('href',$(this).attr('href')+'#werk');
	});
	
	$(".kwicks img").show();

        $(".kwickcontent").each(function(){
            if($(this).children("img").length > 1){
                $(this).addClass("hover");
                $(this).children("img").hide();
                $(this).children(".first").show();
            }
        });
        $(".hover").mouseenter(function(){
            $(this).children("img").hide();
            $(this).children(".second").show();
        });
        $(".hover").mouseleave(function(){
            $(this).children("img").hide();
            $(this).children(".first").show();
        });

});


