$(document).ready(function(){
		
	$('img.bgimg').maxImage({
		isBackground: true,
		slideShow: true,
		verticalAlign: 'top',
		slideShowTitle: false,
		slideDelay: 10,
		maxFollows: 'height'
	 });
	
    $("#logo").click(function () {
		hideAll();
    });
    
    $(".klanten").click(function () {
		hideAll();
		$("#klanten").fadeToggle();
    });
	
	$(".contact").click(function () {
		hideAll();
	    $("#contact").fadeToggle();
    });
    
    $(".over").click(function () {
    	hideAll();
	    $("#over").fadeToggle();
    });
    
    $(".photos").click(function () {
    	hideAll();
	    $("#photos").fadeToggle();
    });
    
    function hideAll(){
    	$("#klanten").fadeOut();
    	$("#photos").fadeOut();
    	$("#over").fadeOut();
    	$("#contact").fadeOut();
    }
    
    // standard dim div
    $("#dim").css("height", $(document).height());
    // gallery dim div's
    $("#dimportrait").css("height", $(document).height());
    
    // standard dim trigger
    $(".alert").click(function(){
    	$("#dim").fadeIn();
    	return false;
    });
    
    // gallery dim triggers
    $(".portrait").click(function(){
    	$("#dimportrait").fadeIn();
    	return false;
    });
    $(".urban").click(function(){
    	$("#dimurban").fadeIn();
    	return false;
    });
    
    $(".close").click(function(){
    	$("#dim").fadeOut();
    	$("#photos").fadeOut();
    	return false;
    });
    
    $("#dim").click(function(){ 
   		$("#photos").fadeOut(500);
   		$("#dim").fadeOut(1000);
    	return false;
    });
        
    $(".closeurban").click(function(){
    	$("#dimurban").fadeOut();
    	return false;
    });
    
	$(".closeportrait").click(function(){
		$("#dimportrait").fadeOut();
		return false;
	});
    
	// custom function to toggle the fade effect for the menuitems
	jQuery.fn.fadeToggle = function(speed, easing, callback) {
		return this.animate({opacity: 'toggle'}, speed, easing, callback);
	};
	
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	//Vertical Sliding
	//Caption Sliding (Partially Hidden to Visible)
	$('.boxgrid.caption').hover(function(){
		$(".cover", this).stop().animate({top:'20px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'75px'},{queue:false,duration:160});
	});
	
		
});

$(window).bind("resize", function(){
 	$("#dim").css("height", $(window).height());
});

Shadowbox.init({
	adapter: 'jquery',
    language: 'en',
    players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv'],
	overlayColor: '#333333',
	continuous: true,
	animateFade: true,
	animate: true,
	overlayOpacity: 1
});

function galleryWedding(){
    Shadowbox.open({
        player:     'swf',
        content:    'showcase_new.swf',
        height:		500,
        width:		948
    });
}