$(function(){
	/* The following displays an alert for links that aren't set properly during development. */
	$('a.todo').click(function(e){
		alert('Link not properly configured at this time');
	});

	$('ul.sf-menu').superfish({
		delay: 0, // half a second delay on mouseout
		animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation
		speed: 'fast', // faster animation speed
		autoArrows: false, // disable generation of arrow mark-up
		dropShadows: false // disable drop shadows
	});

	// current environmental initiative tabbed nav
	$('.tab_content_wrapper > div').each(function() {
		if ($(this).hasClass('active')) {
			$(this).show();
		} else {
			$(this).hide();
		}
	});

	$('.tab_nav li a').click(function() {
		$('.tab_nav li').removeClass('active');

		$('.tab_content_wrapper > div').hide();
		$('.tab_content_wrapper > div').removeClass('active');

		tab_id = $(this).parent().attr('id');

		// This line assigns the action of the Tab List Item clicked, and then cuts off ("_tab" to know which content ID to show)
		tab_id = '#' + tab_id.substring(0, tab_id.length - 4);
		$(tab_id).show();
		$(tab_id).addClass('active');

		$(this).parent().addClass('active');

		return false;

	});

	$('#torso h1:not(#homepage h1)').wrapInner('<span />');

	$("#footer li:last-child").addClass('last-child');


});

