// JavaScript Document

/* BASIS VOOR BACKGROUND */
(function(a){a(document).ready(function(){a("body").prepend('<div id="supersized-loader"></div>').append('<div id="supersized"></div>')});a.supersized=function(b){var d={start_slide:1,vertical_center:1,horizontal_center:1,min_width:0,min_height:0,fit_portrait:0,fit_landscape:0,image_protect:1};var c=a("#supersized");if(b){var b=a.extend(d,b)}else{var b=a.extend(d)}if(b.start_slide){var f=b.start_slide-1}else{var f=Math.floor(Math.random()*b.slides.length)}a("<img/>").attr("src",b.slides[f].image).appendTo(c);c.hide();a(document).ready(function(){e()});a(window).load(function(){a("#supersized-loader").hide();c.fadeIn(3000);e()});a(window).resize(function(){e()});function e(){return c.each(function(){var g=a("img",c);a(g).each(function(){var i=(a(this).height()/a(this).width()).toFixed(2);thisSlide=a(this);var h=a(window).width();var k=a(window).height();var l;if((k<=b.min_height)&&(h<=b.min_width)){if((k/h)>i){b.fit_landscape&&i<=1?j(true):m(true)}else{b.fit_portrait&&i>1?m(true):j(true)}}else{if(h<=b.min_width){if((k/h)>i){b.fit_landscape&&i<=1?j(true):m()}else{b.fit_portrait&&i>1?m():j(true)}}else{if(k<=b.min_height){if((k/h)>i){b.fit_landscape&&i<=1?j():m(true)}else{b.fit_portrait&&i>1?m(true):j()}}else{if((k/h)>i){b.fit_landscape&&i<=1?j():m()}else{b.fit_portrait&&i>1?m():j()}}}}function j(n){if(n){if(thisSlide.width()<h||thisSlide.width()<b.min_width){if(thisSlide.width()*i>=b.min_height){thisSlide.width(b.min_width);thisSlide.height(thisSlide.width()*i)}else{m()}}}else{if(b.min_height>=k&&!b.fit_landscape){if(h*i>=b.min_height||(h*i>=b.min_height&&i<=1)){thisSlide.width(h);thisSlide.height(h*i)}else{if(i>1){thisSlide.height(b.min_height);thisSlide.width(thisSlide.height()/i)}else{if(thisSlide.width()<h){thisSlide.width(h);thisSlide.height(thisSlide.width()*i)}}}}else{thisSlide.width(h);thisSlide.height(h*i)}}}function m(n){if(n){if(thisSlide.height()<k){if(thisSlide.height()/i>=b.min_width){thisSlide.height(b.min_height);thisSlide.width(thisSlide.height()/i)}else{j(true)}}}else{if(b.min_width>=h){if(k/i>=b.min_width||i>1){thisSlide.height(k);thisSlide.width(k/i)}else{if(i<=1){thisSlide.width(b.min_width);thisSlide.height(thisSlide.width()*i)}}}else{thisSlide.height(k);thisSlide.width(k/i)}}}if(b.horizontal_center){a(this).css("left",(h-a(this).width())/2)}if(b.vertical_center){a(this).css("top",(k-a(this).height())/2)}});if(b.image_protect){a("img",c).bind("contextmenu",function(){return false});a("img",c).bind("mousedown",function(){return false})}return false})}}})(jQuery);


/* INSTELLINGEN BACKGROUND */

jQuery(function($){
				
				$.supersized({
				
					// Functionality
					start_slide             :   0,			// Start slide (0 is random)
					new_window				:	1,			// Image links open in new window/tab
					image_protect			:	1,			// Disables image dragging and right click with Javascript
															   
					// Size & Position						   
					min_width		        :   0,			// Min width allowed (in pixels)
					min_height		        :   0,			// Min height allowed (in pixels)
					vertical_center         :   1,			// Vertically center background
					horizontal_center       :   1,			// Horizontally center background
					fit_always				:	0,			// Image will never exceed browser width or height (Ignores min. dimensions)
					fit_portrait         	:   0,			// Portrait images will not exceed browser height
					fit_landscape			:   0,			// Landscape images will not exceed browser width
															   
					// Components
					slides 					:  	[			// Slideshow Images
{image : 'images/bg1.jpg'},
{image : 'images/bg2.jpg'},  
{image : 'images/bg3.jpg'},
{image : 'images/bg4.jpg'},
{image : 'images/bg5.jpg'},  
{image : 'images/bg6.jpg'},
{image : 'images/bg7.jpg'},
{image : 'images/bg8.jpg'},  
{image : 'images/bg9.jpg'},
{image : 'images/bg10.jpg'}
												]
					
				});
		    });
			
/* WITTE DIV LATEN INSCROLLEN */

$(document).ready(function () {
	
	$('#wit').delay(750).hide().slideDown(500);
	
	$('#inhoud').delay(850).hide().slideDown(750);
	
	$('#menu').delay(1000).fadeIn({
		'filter': "0",
		},250);
	
	//$('#mainmenu_index').delay(750).fadeIn(500);
	/*
top-center
top-center_overons
top-center_mog
top-center_contac
	*/

	
/************DIT WERKT**************************/
	$("#mainmenu_index").delay(750).animate({
   
  marginRight:"24px",

	
  }, 1000, 'easeInOutElastic' );
	
/********************************************/


	/* Mainmenu */
	$('#top-center').hover(function(){
		         $(this).children('.front').stop().animate({'top' : '-20px'}, 200);
		 }, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 100);});
		 
	$('#top-center_overons').hover(function(){
		         $(this).children('.front').stop().animate({'top' : '-20px'}, 200);
		 }, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 100);});	 
	
	$('#top-center_mog').hover(function(){
		         $(this).children('.front').stop().animate({'top' : '-20px'}, 200);
		 }, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 100);});	 	    

	$('#top-center_contact').hover(function(){
		         $(this).children('.front').stop().animate({'top' : '-20px'}, 200);
		 }, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 100);});	 	    


});	



