$(document).ready(function() {
	var theLoc = $('#menu').position().top;
	$(window).scroll(function() {
		if(theLoc >= $(window).scrollTop()) {
			if($('#menu').hasClass('fixed')) {
				$('#menu').removeClass('fixed');
			}
		} else { 
			if(!$('#menu').hasClass('fixed')) {
				$('#menu').addClass('fixed');
			}
		}
	});

});

