
jQuery(document).ready(function($) {
	$("#main-nav a").hover(function() {
		var $this = $(this),
			$tt = $("#menu-tooltip"),
			t = $this.attr("rel"),
			p = $this.position(),
			w = $this.innerWidth();
		
		$tt.stop(true, true).find("span").html(t);
		$tt.css({
			left: p.left + (w - $tt.innerWidth()) * 0.5,
			top: p.top - 40
		});
		$tt.delay(100).fadeTo(400, 1.0);
	}, function() {
		$("#menu-tooltip").stop(true, true).fadeTo(200, 0.0, function() {
			$(this).hide();
		});
	});
});

