(function($) {
	
	$('div.poetry-book ul.sub-pages.media-nav li:last').css('marginRight', 0);
	
	$('.archive-nav li:first').addClass('hide');
	$('body.archive ul.archive-nav li:eq(1) a').css('color', '#A2C2C8').click(function(e) {
		e.preventDefault();
	});

	
	//Add link highlight color to news archive years
	var arr = window.location.pathname.split('/');	
	var year = arr[1];
	
	$('ul.archives-years li a').each(function() {
	if (this.title === year) {
		$(this).css('color', '#A2C2C8');
	}
	});
	
	//highlight second year on news-archives page
	$('body.news-archive ul.archives-years li:eq(1) a').css('color', '#A2C2C8');
		
	// css3 transition fallback
    var thisStyle = document.body.style,
    supportsTransition = thisStyle.WebkitTransition !== undefined ||
        thisStyle.MozTransition !== undefined ||
        thisStyle.OTransition !== undefined ||
        thisStyle.transition !== undefined;

    if ( ! supportsTransition ) {
        var defaultCSS = {
            color: '#c3c1c1'
        },
        hoverCSS = {
            color: '#667a4b'
        };

        $('ul#menu-nav li a').each(function() {
            
            var $subtle = $(this);
            $subtle.bind('mouseenter focus', function() {
            	$(this).stop();
                $subtle.animate(hoverCSS, 1000, 'swing' );
            });

            $subtle.bind('mouseleave blur', function(ev) {
                if ( ev.type == 'mouseleave' && ev.target == document.activeElement ) return false;
				$(this).stop();
                $subtle.animate(defaultCSS, 1000, 'swing' );
            });

        });
    }
	
	
})(jQuery)
