(function ($) {

	// SCROLL MENU
	Drupal.behaviors.scrollMenu = {
		attach: function(context, settings) {
			$(window).load(function(){
			
				$('a[href=#]').click(function(){
						$('html, body').animate({scrollTop:0}, 'fast');
						return false;
				});
				
				$('#navigation ul.menu li a').click(function(){
						var link = $(this).attr("href").replace("/", "");
						$('html, body').animate({scrollTop: $(link).offset().top}, 'fast');
						return false;
				});
				
			
			});			
    }
  }
	
	
// SHOW HIDE  SOCIAL MENU
	Drupal.behaviors.socialshowhide = {
		attach: function(context, settings) {
			$(window).load(function(){
															
				$('.region-social ul.menu li').each(function() {
					$(this).attr('breedte',$(this).width()).width('28px').find('a').attr("target", "_blank");																													 
				})
				$('.region-social ul.menu li').hover( function () {
						$(this).addClass('over').animate({ 
							width: $(this).attr('breedte')
						}, 200 );
					}, function () {
						$(this).removeClass('over').animate({ 
							width: "28px"
						}, 200 );
					}
				);
				
			});			
    }
  }
	
	

	
// ADAPT BACKGROUND-IMAGE-SIZE
	Drupal.behaviors.backgroundSize = {
		attach: function(context, settings) {
			$(window).load(function(){
					
					setIzaImage();
					
					$(window).resize(function() {
						setIzaImage();
					});	
					
	    function setIzaImage() {
				if($(window).height() < 686){
					$(".background-image").css('top', 0);
					}
				else if($(window).height() > 686){
					$(".background-image").css('top', 'auto').css('bottom', 0);
					}
    		}
			
			});

					
    }
  }
	
	
	
	
})(jQuery);;

