// page init
jQuery(function() {
	initNavFade();
})

// nav color animation init
function initNavFade() {
	var animSpeed = 250;
	var activeClass = 'active';
	jQuery('#nav li').not('.' + activeClass).each(function() {
		var item = jQuery(this).find('a');
		var def = item.find('span.default');
		var hov = item.find('span.hover').css({opacity: 0}).show();
		item.bind({
			mouseenter: function() {
				hov.stop().animate({opacity: 1}, {
					duration: animSpeed
				})
			},
			mouseleave: function() {
				hov.stop().animate({opacity: 0}, {
					duration: animSpeed
				})
			}
		})
	})
}

// Wait for the document to become ready
$(function() {
    $("a[data-popup]").live('click', function(e) {
        window.open($(this)[0].href);
        // Prevent the link from actually being followed
        e.preventDefault();
    });
});
