   $(document).ready(function(){
   
   /* This is basic - uses default settings */
   	
   	$("a.single_image").fancybox({
     	'showCloseButton'	: false,
     	'hideOnContentClick': true,
      /*'autoScale': false*/
     });
   	
   	/* Using custom settings */
   	
   	$("a#inline").fancybox({
   		'hideOnContentClick': true
   	});
   
   	/* Apply fancybox to multiple items */
   	
   	$("a.group").fancybox({
   		'transitionIn'	:	'elastic',
   		'transitionOut'	:	'elastic',
   		'speedIn'		:	600, 
   		'speedOut'		:	200, 
   		'overlayShow'	:	false
   	});
   
  $("body#home h2").animate({
    marginLeft: "-150px",
    marginTop: "-200px",
    opacity: 0
  }, 0);

  $("body#home h2").animate({
    marginLeft: "0",
    marginTop: "0",
         opacity: 1
  }, 2500);
  $("body#home h2").animate({
    opacity: 1
  });

  $("body#werk h2").animate({
    marginLeft: "350px",
    marginTop: "100px",
    opacity: 0
  }, 0);
  
  $("body#werk h2").animate({
    marginLeft: "0",
    marginTop: "0",
    opacity: 1
  }, 3000);
  
  $("body#werk h2").animate({
    opacity: 1
  });
  
  $("body#sfeer h2").animate({
    marginLeft: "450px",
    marginTop: "300px",
    opacity: 0
  }, 0);
  
  $("body#sfeer h2").animate({
    marginLeft: "0",
    marginTop: "0",
    opacity: 1
  }, 2500);
  
  $("body#sfeer h2").animate({
    opacity: 1
  });
  
  $("body#contact h2").animate({
    marginLeft: "350px",
    marginTop: "-100px",
    opacity: 0
  }, 0);
  
  $("body#contact h2").animate({
    marginLeft: "0",
    marginTop: "0",
    opacity: 1
  }, 2000);
  
  $("body#contact h2").animate({
    opacity: 1
  });
  
  $("body#team h2").animate({
      marginLeft: "-80px",
      marginTop: "-50px",
      opacity: 0
    }, 0);
  
    $("body#team h2").animate({
      marginLeft: "0",
      marginTop: "0",
           opacity: 1
    }, 2000);
    $("body#team h2").animate({
      opacity: 1
    });
  
  $("body#portfolio h2").animate({
      marginLeft: "-100px",
      marginTop: "-50px",
      opacity: 0
    }, 0);
  
    $("body#portfolio h2").animate({
      marginLeft: "0",
      marginTop: "0",
           opacity: 1
    }, 2000);
    $("body#portfolio h2").animate({
      opacity: 1
    });
    
  
    /*Wordt nu afgevangen door Fancybox*/
    $("#portfolio #content ul li a").click(function(e) {
      e.preventDefault();
      var href=$(this).attr("href");
      $("<img class=\"largeImage\" src=\"" + href + "\" alt=\"image\" />")
      .css("top", 0)
      .css("left", 0)
      .hide()
      .appendTo("#rotatable")
      .fadeIn(500)
      .click(function(e) {
        $(this).fadeOut(500).remove(500);
        
      });
      $(document).keydown(handleEscape);
    });
    
    function handleEscape(e) {
      if (e.keyCode == 27) {
        $(".largeImage").fadeOut(500).remove(500);
      }
    }
 
  
   //team   
   $("#team #content ul li a").click(function(e) {
     e.preventDefault();
     $("h2").hide();
     $(".bio").hide();
     var whichdiv="#bio"+$(this).attr("id");
     $(whichdiv).css({"display":"block"});
   });
   //end team
   
  
});//end document.ready


$.fn.wait = function(time, type) {
    time = time || 1000;
    type = type || "fx";
    return this.queue(type, function() {
        var self = this;
        setTimeout(function() {
            $(self).dequeue();
        }, time);
    });  
};


