/* 		ALS DOCUMENT WORDT GELADEN.. */
		
		$(document).ready(function() {
		$("#menu").animate({top: 0}, 2000, "easeOutCubic");
		});
		
		$(".active").live("click", function() {
		$("#content").noop();
		});
		
		$(".active").live("mouseover", function() {
		$(this).noop();
		});
		
		
/* 		HOVER VOOR MENU */
		
		$(document).ready(function(){
		$("#menu ul li").mouseover(function(){
		$(this).stop().animate({paddingLeft:'13px'},{queue:false, duration:300, easing: 'easeOutCubic'})
		});
		$("#menu ul li").mouseout(function(){
		$(this).stop().animate({paddingLeft:'5px'},{queue:false, duration:300, easing: 'easeOutCubic'})
		});
		});
		
/* 		CLICK VOOR MENU */		

		$("#menu ul li").live("click", function() {
		$("#menu ul li").removeClass("active");
		$(this).addClass("active");	
		$("#doos").animate({top: -800}, 600);			
		$("#klantendoos").animate({top: -1000}, 600);
		$("#contactdoos").animate({top: -1000}, 600);
		$("#muziekdoos").animate({top: -1000}, 600);
		$("#muziekplayer").animate({top: -1000}, 600);	
		$("#werkdoos").animate({top: -1000}, 600);
		$("#werkdoos-rechts").animate({top: -1000}, 600);
		$("#awardsdoos").animate({top: -1000}, 600);
		$("#awardsdoos-rechts").animate({top: -1000}, 600);			
		jwplayer().stop();
		setTimeout(function() { $("#doos").show(); }, 600);	
		setTimeout(function() { $("#content-werkdoos").load("werk/leeg.php"); }, 400);	
		});		
			
		
/* 		HOVER OVER MENU-ITEM - OVER GROEN EN KOOL */

		$(".over").live("click", function() {
		window.location.hash = 'over'; 
		$("#subcontent").animate({top: -500}, 600);
		
		setTimeout(function() { $("#bgfade").attr("src", "img/achtergronden/over.jpg"); }, 500);							
		setTimeout(function() { $("#bg").fadeOut (400); }, 1500);		
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/over.jpg"); }, 1800);
		setTimeout(function() { $("#bg").fadeIn(400); }, 2000);	
		
		setTimeout(function() { $("#bglogo").fadeOut (400); }, 1500);				
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/over-logo.png"); }, 1800);
		setTimeout(function() { $("#bglogo").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#content").load("index.php #content > *"); }, 600);
		$("#doos").animate({top: 145}, 1000, "easeOutCubic");	
		$(".pijltje").animate({top: 70}, 600);			
		});
		
/* 		HOVER OVER MENU-ITEM - MISSIE */
				
		$(".missie").live("click", function() {
		window.location.hash = 'missie';	
													
		setTimeout(function() { $("#bgfade").attr("src", "img/achtergronden/missie.jpg"); }, 500);							
		setTimeout(function() { $("#bg").fadeOut (400); }, 1500);		
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/missie.jpg"); }, 1800);
		setTimeout(function() { $("#bg").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#bglogo").fadeOut (400); }, 1500);				
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/missie-logo.png"); }, 1800);
		setTimeout(function() { $("#bglogo").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#content").load("missie.php #content > *"); }, 600);
		$("#doos").animate({top: 185}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 65}, 400)	
		});

/* 		HOVER OVER MENU-ITEM - WERKWIJZE */
				
		$(".werkwijze").live("click", function() {
		window.location.hash = 'werkwijze';	
													
		setTimeout(function() { $("#bgfade").attr("src", "img/achtergronden/werkwijze.jpg"); }, 500);							
		setTimeout(function() { $("#bg").fadeOut (400); }, 1500);		
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/werkwijze.jpg"); }, 1800);
		setTimeout(function() { $("#bg").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#bglogo").fadeOut (400); }, 1500);				
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/werkwijze-logo.png"); }, 1800);
		setTimeout(function() { $("#bglogo").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#content").load("werkwijze.php #content > *"); }, 600);
		$("#doos").animate({top: 140}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 145}, 400);	
		});
						
				
/* 		HOVER OVER MENU-ITEM - KLANTEN */
				
		$(".klanten").live("click", function() {
		window.location.hash = 'klanten';												
		setTimeout(function() { $("#bgfade").attr("src", "img/achtergronden/klanten.jpg"); }, 500);	
		setTimeout(function() { $("#bg").fadeOut (400); }, 1500);		
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/klanten.jpg"); }, 1800);
		setTimeout(function() { $("#bg").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#bglogo").fadeOut (400); }, 1500);				
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/klanten-logo.png"); }, 1800);
		setTimeout(function() { $("#bglogo").fadeIn(400); }, 2000);

		setTimeout(function() { $("#content-klanten").load("klanten.php #content-klanten > *"); }, 600);		
		$("#klantendoos").animate({top: 80}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 240}, 400);			
		});

/* 		HOVER OVER MENU-ITEM - WERK */
				
		$(".werk").live("click", function() {
		window.location.hash = 'werk';	
													
		setTimeout(function() { $("#bgfade").attr("src", "img/achtergronden/werk.jpg"); }, 500);							
		setTimeout(function() { $("#bg").fadeOut (400); }, 1500);		
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/werk.jpg"); }, 1800);
		setTimeout(function() { $("#bg").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#bglogo").fadeOut (400); }, 1500);				
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/werk-logo.png"); }, 1800);
		setTimeout(function() { $("#bglogo").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#content-werk").load("werk.php #content-werk > *"); }, 600);
		$("#werkdoos").animate({top: 180}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 175}, 400);	
		});

/* 		HOVER OVER MENU-ITEM - WIE ZIJN WIJ */
				
		$(".wiezijnwij").live("click", function() {
		window.location.hash = 'wiezijnwij';	
													
		setTimeout(function() { $("#bgfade").attr("src", "img/achtergronden/wiezijnwij.jpg"); }, 500);							
		setTimeout(function() { $("#bg").fadeOut (400); }, 1500);		
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/wiezijnwij.jpg"); }, 1800);
		setTimeout(function() { $("#bg").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#bglogo").fadeOut (400); }, 1500);				
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/wiezijnwij-logo.png"); }, 1800);
		setTimeout(function() { $("#bglogo").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#content").load("wiezijnwij.php #content > *"); }, 600);
		$("#doos").animate({top: 15}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 375}, 400);		
		});	

/* 		HOVER OVER MENU-ITEM - AWARDS */
				
		$(".awards").live("click", function() {
		window.location.hash = 'awards';	
													
		setTimeout(function() { $("#bgfade").attr("src", "img/achtergronden/awards.jpg"); }, 500);							
		setTimeout(function() { $("#bg").fadeOut (400); }, 1500);		
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/awards.jpg"); }, 1800);
		setTimeout(function() { $("#bg").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#bglogo").fadeOut (400); }, 1500);				
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/awards-logo.png"); }, 1800);
		setTimeout(function() { $("#bglogo").fadeIn(400); }, 2000);
		
		$("#awardsdoos").animate({top: 180}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 245}, 400);																			
		setTimeout(function() { $("#content-awards").load("awards.php #content-awards > *"); }, 600);		
		});	


/* 		HOVER OVER MENU-ITEM - MUZIEK */
				
		$(".muziek").live("click", function() {
		window.location.hash = 'muziek';	
													
		setTimeout(function() { $("#bgfade").attr("src", "img/achtergronden/muziek.jpg"); }, 500);							
		setTimeout(function() { $("#bg").fadeOut (400); }, 1500);		
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/muziek.jpg"); }, 1800);
		setTimeout(function() { $("#bg").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#bglogo").fadeOut (400); }, 1500);				
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/muziek-logo.png"); }, 1800);
		setTimeout(function() { $("#bglogo").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#content").load("muziek.php #content > *"); }, 600);
		$("#doos").animate({top: 255}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 205}, 400);			
		$("#muziekdoos").animate({top: 30}, 1000, "easeOutCubic");		
		});	

/* 		HOVER OVER MENU-ITEM - CONTACT */
				
		$(".contact").live("click", function() {
		window.location.hash = 'contact';	
													
		setTimeout(function() { $("#bgfade").attr("src", "img/achtergronden/contact.jpg"); }, 500);							
		setTimeout(function() { $("#bg").fadeOut (400); }, 1500);		
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/contact.jpg"); }, 1800);
		setTimeout(function() { $("#bg").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#bglogo").fadeOut (400); }, 1500);				
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/contact-logo.png"); }, 1800);
		setTimeout(function() { $("#bglogo").fadeIn(400); }, 2000);
		
		setTimeout(function() { $("#content-contact").load("contact.php #content-contact > *"); }, 600);
		$("#contactdoos").animate({top: 125}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 370}, 400);		
		});					
				
/* 		MEER INFORMATIE-BLOKJE SHOWEN/HIDEN */
		
/*
		$(".meermissie").live("click", function() {
		$("#subcontent").animate({top: 280}, 600);
		setTimeout(function() { $("#subcontent").load("missie.php #subcontent > *"); }, 0);
		});
		
		$(".verberg").live("click", function() {
		$("#subcontent").animate({top: -500}, 600);
		});
		
*/

/* 		SHOW MUZIEKPLAYER */
		
		$(".speel").live("click", function() {
		$("#muziekplayer").animate({top: 180}, 600);
		});
				

/* 		SEO OPTIMALISEREN DOOR MIDDEL VAN HASHTAGS */
		
		$(document).ready(function() {
		var hashVal = window.location.hash.split("#")[1];
		
		if(hashVal == 'over') {
		$('li').removeClass("active");
		$('.over').addClass("active");
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/over.jpg"); }, 0);
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/over-logo.png"); }, 0);		
		$("#doos").animate({top: 145}, 1000, "easeOutCubic");	
		$(".pijltje").animate({top: 70}, 600);																		
		setTimeout(function() { $("#content").load("index.php #content > *"); }, 0);
		}
		
		if(hashVal == 'missie') {
		$('li').removeClass("active");
		$('.missie').addClass("active");
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/missie.jpg"); }, 0);					
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/missie-logo.png"); }, 0);			
		$("#doos").animate({top: 185}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 65}, 400);																				
		setTimeout(function() { $("#content").load("missie.php #content > *"); }, 0);
		}
		
		if(hashVal == 'werkwijze') {
		$('li').removeClass("active");
		$('.werkwijze').addClass("active");
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/werkwijze.jpg"); }, 0);					
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/werkwijze-logo.png"); }, 0);			
		$("#doos").animate({top: 140}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 145}, 400);																			
		setTimeout(function() { $("#content").load("werkwijze.php #content > *"); }, 0);
		}

		if(hashVal == 'klanten') {
		$("#doos").hide();		
		$('li').removeClass("active");
		$('.klanten').addClass("active");
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/klanten.jpg"); }, 0);					
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/klanten-logo.png"); }, 0);	
		$("#klantendoos").animate({top: 80}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 240}, 400);		
		setTimeout(function() { $("#content-klanten").load("klanten.php #content-klanten > *"); }, 0);		
		}	

		if(hashVal == 'werk') {
		$("#doos").hide();				
		$('li').removeClass("active");
		$('.werk').addClass("active");
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/werk.jpg"); }, 0);					
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/werk-logo.png"); }, 0);			
		$("#werkdoos").animate({top: 180}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 175}, 400);																			
		setTimeout(function() { $("#content-werk").load("werk.php #content-werk > *"); }, 0);
		}		
		
		if(hashVal == 'wiezijnwij') {
		$('li').removeClass("active");
		$('.wiezijnwij').addClass("active");
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/wiezijnwij.jpg"); }, 0);					
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/wiezijnwij-logo.png"); }, 0);			
		$("#doos").animate({top: 15}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 375}, 400);																				
		setTimeout(function() { $("#content").load("wiezijnwij.php #content > *"); }, 0);
		}	
	
		if(hashVal == 'awards') {
		$("#doos").hide();				
		$('li').removeClass("active");
		$('.awards').addClass("active");
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/awards.jpg"); }, 0);					
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/awards-logo.png"); }, 0);			
		$("#awardsdoos").animate({top: 180}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 245}, 400);																			
		setTimeout(function() { $("#content-awards").load("awards.php #content-awards > *"); }, 0);
		}
		
		if(hashVal == 'muziek') {
		$('li').removeClass("active");
		$('.muziek').addClass("active");
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/muziek.jpg"); }, 0);					
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/muziek-logo.png"); }, 0);			
		$("#doos").animate({top: 255}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 205}, 400);		
		$("#muziekdoos").animate({top: 30}, 1000, "easeOutCubic");																	
		setTimeout(function() { $("#content").load("muziek.php #content > *"); }, 0);
		}

		if(hashVal == 'contact') {
		$("#doos").hide();				
		$('li').removeClass("active");
		$('.contact').addClass("active");
		setTimeout(function() { $("#bg").attr("src", "img/achtergronden/contact.jpg"); }, 0);					
		setTimeout(function() { $("#bglogo").attr("src", "img/achtergronden/contact-logo.png"); }, 0);			
		$("#contactdoos").animate({top: 125}, 1000, "easeOutCubic");
		$(".pijltje").animate({top: 370}, 400);																				
		setTimeout(function() { $("#content-contact").load("contact.php #content-contact > *"); }, 0);
		}	
					
/*
		if(hashVal == 'missie,meer') {
		$('li').removeClass("active");
		$('.missie').addClass("active");
		setTimeout(function() { $("#bg").attr("src", "img/missie.jpg"); }, 600);									
		$("#doos").animate({top: 280}, 1000, "easeOutCubic");					
		setTimeout(function() { $("#content").load("missie.php #content > *"); }, 0);
		$("#subcontent").animate({top: 280}, 2000, "easeOutCubic");
		setTimeout(function() { $("#subcontent").load("missie.php #subcontent > *"); }, 0);		
		}		
*/

		});
		
		
				
/* 		FULLSCREEN BACKGROUND - BIG, BIGGER, BIGGEST */
		
		$(window).load(function() {    
		
		var theWindow        = $(window),
		$bgfade              = $("#bgfade"),
		aspectRatio      = $bgfade.width() / $bgfade.height();
		
		function resizeBg() {
		
		if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
		$bgfade
		.removeClass()
		.addClass('bgheight');
		} else {
		$bgfade
		.removeClass()
		.addClass('bgwidth');
		}
		
		}
		
		theWindow.resize(function() {
		resizeBg();
		}).trigger("resize");
		
		});
		
		$(window).load(function() {    
		
		var theWindow        = $(window),
		$bg              = $("#bg"),
		aspectRatio      = $bg.width() / $bg.height();
		
		function resizeBg() {
		
		if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
		$bg
		.removeClass()
		.addClass('bgheight');
		} else {
		$bg
		.removeClass()
		.addClass('bgwidth');
		}
		
		}
		
		theWindow.resize(function() {
		resizeBg();
		}).trigger("resize");
		
		});
