(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
;
jQuery(document).ready(function () {
  var top = jQuery('#navigation').offset().top - parseFloat(jQuery('#navigation').css('marginTop').replace(/auto/, 0));
	
  jQuery(window).scroll(function (event) {
	  
	  // what the y position of the scroll is
	  var y = jQuery(this).scrollTop();
			
	  // whether that's below the form
	  if (y >= top) {
		jQuery('#nav-shadow').css("display", "block");
		  
		// if so, ad the fixed class
		//jQuery('#navigation').addClass('fixed');
		jQuery('#navigation').css("position", "fixed");
		jQuery('#navigation').css("margin-top", (top * -1));
		//jQuery('#navigation').css("margin-top", top);
	  } else {
		jQuery('#nav-shadow').css("display", "none");
		// otherwise remove it
		jQuery('#navigation').css("margin-top", "0px");
		jQuery('#navigation').css("position", "relative");
	  }
   });
});;

