$(document).ready(function() {
	/* Coin-Slider Let op! Als eerste laten initaliseren omdat het laden van de site anders lelijk wordt!*/ 
	$('#coin-slider').coinslider({ 
		width: 1300, 
		navigation: false, 
		delay: 5000, 
		links : false // show images as links
	});

	/* Shadowbox voor area gebieden */
	window.onload = function(){
		Shadowbox.setup($("#verhuurbg area"));
		Shadowbox.setup($("#verhuurverd area"));
		Shadowbox.setup($("#verhuurterrein area"));
    };
    

	/* Speltak menu */ 
	$("#speltakmenu ul li a.hover").switchClass("style1", "style2");
	
	$("#speltakmenu").mouseenter(function () {
		$(this).stop(true,﻿ true).switchClass("close", "open", 700);
		$("#speltakmenu ul li a").stop(true,﻿ true).switchClass("style1", "style2", 700);
	
		$('#pijl-speltakmenu').hide();
	});
	
	$("#speltakmenu").mouseleave(function () {
		$(this).stop(true,﻿ true).switchClass("open", "close", 700);
		$("#speltakmenu ul li a:not(.hover)").stop(true,﻿ true).switchClass("style2", "style1", 350, function(){
			$('#pijl-speltakmenu').show();
		});
	});


	/* Pijlen laten verdwijnen */
	$('.pijl').click(function() {
 	 	$('.pijl').fadeOut("slow");
	});
	
	
	/* Isotope */
	$.Isotope.prototype._positionAbs = function( x, y ) {
  		return { right: x, top: y };
	};

	$('#mainbody').isotope({
		transformsEnabled: false,
 		itemSelector : '.box',
  		layoutMode : 'masonry',
  		masonry: {
    		columnWidth: 1
  		}
	});
	
	if (!$('.box').hasClass('max')){
		$('.box').hide();
		$(".box:eq(0)").show("fast", function () {
	    	/* use callee so don't have to name the function */
	    	$(this).next(".box").show("fast", arguments.callee);
	  	});
	 }
});
