

// run this script on every page
$(document).ready(function() {

	// Make the nav have rollovers
	$("#nav ul li a").onedotRollover({over_lbl: "-over"});
	$("#nav ul li").append('<img src="images/nav-arrow.gif" alt="" class="arrow" />');
	$("#nav ul li img.arrow").css({opacity: 0});
	$("#nav ul li a").hover(
		function() {
			$link = $(this);
			if(!$link.hasClass('stuck')) {
				$arrow = $(this).siblings('img.arrow');
				$arrow.stop().animate({left: $link.width()+5, opacity: 1}, 250);
			}
		},
		function() {
			$link = $(this);
			if(!$link.hasClass('stuck')) {
				$arrow = $(this).siblings('img.arrow');
				$arrow.stop().animate({left: $link.width()-$arrow.width(), opacity: 0}, 250);
			}
		}
	)
});

$(window).load(function() {
	
	$("#nav ul li a").each(function() {
		$link = $(this);
		$arrow = $(this).siblings('img.arrow');
		if($link.hasClass('stuck')) {
			$arrow.css({left: $link.width()+5, opacity: 1});
		} else {
			$arrow.css('left', $link.width() - $arrow.width());
		}
	});
	
	

});

