function goToByScroll(id){
			$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
			// return false so that the href is not followed
			return false;
}

$(function () {
  
  var msie6 = $.browser == 'msie' && $.browser.version < 7;
  
  if (!msie6) {
    var top = $('#nav').offset().top - parseFloat($('#nav').css('margin-top').replace(/auto/, 0));
    $(window).scroll(function (event) {
      // what the y position of the scroll is
      var y = $(this).scrollTop();
      
      // whether that's below the form
      if (y >= top) {
        // if so, ad the fixed class
        $('#nav').addClass('fixed');
      } else {
        // otherwise remove it
        $('#nav').removeClass('fixed');
      }
    });
  }  
});

$(document).ready(function() {

	$("a[rel=gallery_nieuws]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
	});		
		
	$("a[rel=gallery_historie]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
	});

	$("a[rel=gallery_oudefotos]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
	});

	$("a[rel=gallery_bouw]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
	});

	$("a[rel=gallery_opening]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
	});

	$("a[rel=gallery_ongeval]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
	});

	$("a[rel=gallery_station]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
	});

	$("a[rel=gallery_stichting]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
	});

	$("a[rel=gallery_stationsomgeving]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
	});

	$("a[rel=gallery_restauratie]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
	});

});
