var name = "#navigation";
var menuYloc = null;

$(document).ready(function () { <!-- handles movement of menu -->
	menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px") ) )
	$(window).scroll(function () {
		var offset = menuYloc+$(document).scrollTop()+"px";
		$(name).animate( {top:offset},{duration:300,queue:false} );
	}); 
});
$(document).ready(function () { <!-- This handles opening and closing -->
	$(function () { //When you mouse over the trigger, display menu after .1s and hide on mouse out after .5s
		menuReveal = {
			sensitivity: 1,
			interval: 100,
			timeout: 500,
			over: function() {
				$("#menu").show("fast");
			},
			out: function() {
				$("#menu").hide("fast");
			}
		};
	$("#navigation").hoverIntent(menuReveal)
	}); //hoverIntent function end
}); //document.ready

