$(document).ready(function(){
						   	$(function() {
		$("div#makeMeScrollable").smoothDivScroll({ autoScroll: "onstart", autoScrollDirection: "backandforth", autoScrollStep: 1, autoScrollInterval: 15, startAtElementId: "startAtMe", visibleHotSpots: "always"});
		$("#makeMeScrollable").smoothDivScroll("option","autoScrollDirection","endlessloopright");
	});
						   // Hidden layers bij document ready
	$("#Waas, #WaasTwee, #AuteursHouder, #BoekenHouder, #VerwachtHouder, #AchieversHouder, #AchieversCentered, #BoekCentered, #VerwachtCentered, #TNHouder, #TNCentered, .LeftAbouts, .RightAbouts, .LeftAboutsTN, .RightAboutsTN, .AuteurHouder, .BoekHouder, div.scrollingHotSpotLeft, div.scrollingHotSpotright, .jScrollPaneContainer, .jScrollPaneTrack, #fine_print, .jScrollPaneDrag, .jScrollPaneDragTop, .jScrollPaneDragBottom, .jScrollArrowUp, .jScrollArrowDown, #LaagAchievers").hide();
	
	
	//$("#Waas, #WaasTwee, #AuteursHouder, #BoekenHouder, .AuteurHouder, .BoekHouder, div.scrollingHotSpotLeft, div.scrollingHotSpotright, .jScrollPaneContainer, .jScrollPaneTrack, .jScrollPaneDrag, .jScrollPaneDragTop, .jScrollPaneDragBottom, .jScrollArrowUp, .jScrollArrowDown, #LaagAchievers").hide();
	
	// Button ACTUEEL
																				 
																				 
																				 		
																				 
																				 $("a.ActueelDiv, a.AboutDiv, a.AboutDiv2, a.ContactDiv").click(function(event){ 
event.preventDefault();
		linkLocation = this.href;  
   
   $(".BoekHouder, #AchieversCentered, #BoekCentered, #VerwachtCentered, #AuteursCentered, #TNCentered, #Waas, #WaasTwee, .BoekCover, #makeMeScrollable, .scrollWrapper, .scrollableArea, .MiniBio, .AuteursFoto, div.scrollingHotSpotRight, div.scrollingHotSpotleft, .jScrollPaneContainer, .jScrollPaneTrack, .jScrollPaneDrag, .jScrollPaneDragTop, .jScrollPaneDragBottom, .jScrollArrowUp, .jScrollArrowDown, #LaagAchievers").hide();
	  
	  $("#BoekenHouder,#VerwachtHouder, #AchieversHouder, #AuteursHouder, #TNHouder").animate({'height': '0px'}, 150, 'easeInBounce', redirectPage); 
  
   }); 
																				 
																				 function redirectPage() {
		window.location = linkLocation;
	}
	
	// Button AUTEURS
																				 
																				 $("a.AuteursDiv").click( 
   function() 
   { 	  
   
	$(".BoekHouder, #BoekCentered,#VerwachtCentered, #Waas, #WaasTwee, .BoekCover, #LaagAchievers").hide();
	 
	 $("#BoekenHouder").animate({'height': '0px'}, 150, 'easeInBounce');
	 $("#VerwachtHouder").animate({'height': '0px'}, 150, 'easeInBounce');
	 
   
   $("#fullWidthFooterStuck").animate({'bottom': '-400'}, 300, 'easeOutBounce');
   
   $("#AuteursHouder, #AuteursCentered").animate({'height': '230px'}, 300, 'easeOutBounce');
  
 $("#Waas").show();
   
   $(".AuteurHouder").delay(250).animate({ 
      opacity: 'show',
      height: 'show'
    }, 'slow'); 
 
      
	$("#makeMeScrollable, .scrollWrapper, .scrollableArea, .MiniBio, .AuteursFoto, div.scrollingHotSpotRight, div.scrollingHotSpotleft").delay(500).animate({ 
      opacity: 'show'
    }, 100);

    $("#makeMeScrollable").smoothDivScroll("startAutoScroll");
   
   }); 
			
			
			// Button BOEKEN
																				 
																				 $("a.BoekenDiv").click( 
   function() 
   { 
   
  $(".AuteurHouder, #VerwachtHouder, #Waas, #WaasTwee, div.scrollingHotSpotLeft, div.scrollingHotSpotRight, #makeMeScrollable, .scrollWrapper, .scrollableArea, .AuteurHouder, .MiniBio, .AuteursFoto, #LaagAchievers").hide();
	
	   $("#AuteursHouder").animate({'height': '-1px'}, 150, 'easeInBounce');  
	   
	   $("#fullWidthFooterStuck").animate({'bottom': '-400'}, 300, 'easeOutBounce');

   $("#BoekenHouder, #BoekCentered").delay(500).animate({'height': '580px'}, 300, 'easeOutBounce');
   
   $("#Waas").show();
   
    $(".BoekHouder").delay(750).animate({ 
      opacity: 'show',
      height: 'show'
    }, 'slow');
	
   }); 		
																				 
																				 // Button VERWACHT
																				 
																				 $("a.VerwachtDiv").click( 
   function() 
   { 
   
  $(".AuteurHouder, #BoekenHouder, #Waas, #WaasTwee, div.scrollingHotSpotLeft, div.scrollingHotSpotRight, #makeMeScrollable, .scrollWrapper, .scrollableArea, .AuteurHouder, .MiniBio, .AuteursFoto, #LaagAchievers").hide();
	
	   $("#AuteursHouder").animate({'height': '-1px'}, 150, 'easeInBounce');  
	   
	   $("#fullWidthFooterStuck").animate({'bottom': '-400'}, 300, 'easeOutBounce');

   $("#VerwachtHouder, #VerwachtCentered").delay(500).animate({'height': '410px'}, 300, 'easeOutBounce');
   
   $("#Waas").show();
   
    $(".BoekHouder").delay(750).animate({ 
      opacity: 'show',
      height: 'show'
    }, 'slow');
	
   }); 			
		
		// Button ABOUT
																				 
																			//	 $("a.AboutDiv").click( 
 //  function() 
//   {       
//$(".AuteurHouder, .BoekHouder, #AchieversCentered, #BoekenCentered, .LeftAboutsTN, .RightAboutsTN, #TNCentered, .TopnotchImg, #Waas, #WaasTwee, .BoekCover, div.scrollingHotSpotLeft, div.scrollingHotSpotRight, //#makeMeScrollable, .scrollWrapper, .scrollableArea, .AuteurHouder, .MiniBio, .AuteursFoto").hide();
   
//	   $("#AuteursHouder, #BoekenHouder, #TNHouder").animate({'height': '0px'}, 150, 'easeInBounce');  
   
  //  $("#AchieversHouder, #AchieversCentered").delay(450).animate({'height': '470'}, 1100, 'easeOutBounce');

//$("#fullWidthFooterStuck").animate({'bottom': '-400'}, 600, 'easeOutBounce');

  // $("#Waas").delay(1400).animate({ 
    //  height: 'show'
    //}, 10);
   
	//$(".LeftAbouts, .RightAbouts, .jScrollPaneContainer, .jScrollPaneTrack, #fine_print, .jScrollPaneDrag, .jScrollPaneDragTop, .jScrollPaneDragBottom, .jScrollArrowUp, .jScrollArrowDown").animate({ 
     // opacity: 'show',
     // height: 'show'
   // }, 'fast');

  // }); 
																				 
				
				
				
				// Button ABOUT2
 // 																				 
 // 																				 $("a.AboutDiv2").click( 
    // function() 
 //    {       

   
 // $(".AuteurHouder, .BoekHouder, #AchieversCentered, #BoekenCentered, #Waas, #WaasTwee, .BoekCover, div.scrollingHotSpotLeft, div.scrollingHotSpotRight, #makeMeScrollable, .scrollWrapper, .scrollableArea, .AuteurHouder, .MiniBio, .AuteursFoto, .jScrollPaneContainer, .jScrollPaneTrack, #fine_print, .jScrollPaneDrag, .jScrollPaneDragTop, .jScrollPaneDragBottom, .jScrollArrowUp, .jScrollArrowDown, #LaagAchievers").hide();

 //    $("#AuteursHouder, #BoekenHouder, #AchieversHouder").animate({'height': '0px'}, 150, 'easeInBounce'); 
   
     // $("#TNHouder, #TNCentered").delay(450).animate({'height': '530'}, 1100, 'easeOutBounce');
	
	  // $("#fullWidthFooterStuck").animate({'bottom': '-400'}, 600, 'easeOutBounce');
	
	  // $("#Waas").delay(1400).animate({ 
      //  height: 'show'
     // }, 10);
	
 // 	$('.TopnotchImg').animate({ 
  //      opacity: 'show'
  //    }, 'fast');
	
 // 	$(".LeftAboutsTN, .RightAboutsTN").animate({ 
  //      opacity: 'show',
   //     height: 'show'
   //   }, 'fast');
	
	  
   //  }); 
																				 
				
				
				
				
																				 // Button CONTACT
																				 
																				 $("a.ContactDiv").click( 
   function() 
   {       
   
  $(".BoekHouder, #BoekCentered, #VerwachtCentered, #AuteursCentered, #Waas, #WaasTwee, .BoekCover, #makeMeScrollable, .scrollWrapper, .scrollableArea, .MiniBio, .AuteursFoto, div.scrollingHotSpotRight, div.scrollingHotSpotleft, .jScrollPaneContainer, .jScrollPaneTrack, .jScrollPaneDrag, .jScrollPaneDragTop, .jScrollPaneDragBottom, .jScrollArrowUp, .jScrollArrowDown, #LaagAchievers").hide();
   
    $("#fullWidthFooterStuck").delay(450).animate({'bottom': '0'}, 1100, 'easeOutBounce');	

	   $("#AuteursHouder, #BoekenHouder, #VerwachtHouder, #AchieversHouder, #TNHouder").animate({'height': '0px'}, 150, 'easeInBounce');  
	   
	   $("#LaagAchievers").delay(650).animate({ 
      height: 'show'
    }, 'slow');
	   
	 $("#WaasTwee").delay(1400).animate({ 
      height: 'show'
    }, 10);
	  
   }); 
																				 
																																			
																				 
																				//Stop Auto Scroll Auteurs
																			$("img.AuteursFoto, .MiniBio, a, strong").hover( 
																									function() {
																			$("#makeMeScrollable").smoothDivScroll("stopAutoScroll");
																			});

																			//Restart Auto Scroll Auteurs
																			$("#AuteursHouder").mouseout( 
																									function() {
																			$("#makeMeScrollable").smoothDivScroll("startAutoScroll");
																			});

																			
																			
																				 // Hide: AuterDiv en inhoud en BoekenDiv en Achievers met inhoud Middels hover over Waas
																				  $("#Waas").click( 
   function() 
   {     
   
   $(".BoekHouder, AuteurHouder, #BoekCentered, #VerwachtCentered, #AuteursCentered, .LeftAboutsTN, .RightAboutsTN, #TNCentered, .TopnotchImg, #Waas, #WaasTwee, .BoekCover, #makeMeScrollable, .scrollWrapper, .scrollableArea, .MiniBio, .AuteursFoto, div.scrollingHotSpotRight, div.scrollingHotSpotleft").hide();
	  
	  $("#BoekenHouder, #AuteursHouder, #VerwachtHouder").animate({'height': '0px'}, 150, 'easeInBounce'); 
   
   }); 
																				// Hide: Footer
																				 $("#WaasTwee").click( 
   function() 
   {      
	$("#fullWidthFooterStuck").animate({'bottom': '-400'}, 600, 'easeOutBounce');
   $("#LaagAchievers, #WaasTwee").hide( );
   }); 
																				 
						
						
	// SLIDER					   
  $("#Nieuws-slider").slider({
    animate: true,
    change: handleSliderChange,
    slide: handleSliderSlide
  });
  
  
  
function handleSliderChange(e, ui)
{
  var maxScroll = $("#Nieuws-scroll").attr("scrollWidth") - 
                  $("#Nieuws-scroll").width();
  $("#Nieuws-scroll").animate({scrollLeft: ui.value * 
     (maxScroll / 100) }, 1000);
}

function handleSliderSlide(e, ui)
{
  var maxScroll = $("#Nieuws-scroll").attr("scrollWidth") - 
                  $("#Nieuws-scroll").width();
  $("#Nieuws-scroll").attr({scrollLeft: ui.value * (maxScroll / 100) });
}

//stick the footer at the bottom of the page if we're on an iPad/iPhone due to viewport/page bugs in mobile webkit
if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
{
	 $("#HeaderLeftHouder").css("font-size", "10px");
};
					

});
