// JavaScript Document
//	AUXPA.org Homesite
// 	US Coast Guard Auxiliary

//  Template by Jason Wilson Flotilla 06-04 5th Southern
//  Jason@Jasonwilsondesign.com

//	JQuery Functions

$(document).ready(function()
{
	// hides all DIVs with the CLASS container
	// and displays the one with the ID 'home' only
	$(".featured-item").css("display","none");
	$("#item1").slideDown("slow");
	$("#featured ul li:nth-child(1) a").addClass("current");
	
	// makes the navigation work after all containers have bee hidden 
	showViaLink($(".featured-tab"));
});	

// shows proper DIV depending on link 'href'
function showViaLink(array)
{
	array.each(function(i)
	{	
		$(this).click(function()
		{
			var target = $(this).attr("href");
			$(".featured-item").css("display","none");
			$(".featured-tab").removeClass("current");
			$(target).fadeIn("slow");
			$(".featured-tab[href='" +target + "']").addClass("current");
			return false;
		});
	});
}