/**
 * @author chrism
 */

$(document).ready(function() {
	
	$('#topnav li:first-child').addClass('style-meta'); //adds text style to menu title & removes left margin

	$("#menu li").click(function(){ window.location=$(this).find("a").attr("href"); return false; }); // makes entire #menu <li> clickable
	
	$('#menu li:even').addClass('bg-even'); // adds blue bg (or vice versa?)
	$('#menu li:odd').addClass('bg-odd'); // adds red bg (or vice versa?)
	
	$('#menu li.page_item:even').append('<span class="nav-cap-even"></span>'); //adds end cap bg to li.bg-even 
	$('#menu li.page_item:odd').append('<span class="nav-cap-odd"></span>'); // adds end cap bg to li.bg-odd

// animates menu background	
	$('#menu li.page_item a').hover(function() {
		$(this).stop().animate({ right: '-18%' });
	}, function() {
		$(this).stop().animate({ right: '-33%' });
	});

// animate opacity of top nav on hover
	$('#topnav-container').addClass('opacity50').delay(2500).toggleClass('opacity50', false);
	$('#topnav-container').hover(function() {
		$(this).toggleClass('opacity50', true);
	}, function() {
		$(this).delay(1500).toggleClass('opacity50', false);
	});
	
});
