// JavaScript function for switching between journal categories on home page of Desert Sportsman
// Note: Requires JQuery

var CurrentCategory = "ds-journal-all";

function SwitchCategory(CategoryName){
	if(CategoryName != CurrentCategory){
		
		// Remove all of the "current" classes from the tabs
		$("#ds-journal-category-ul li a.current").removeClass("current");
		
		// Hide current category
		$("#"+CurrentCategory).hide();
			
		// Figure out the the new category
		switch (CategoryName) {
			case "ds-journal-fishing":
				CurrentCategory = "ds-journal-fishing";
				// Mark tab as current
				$("#ds-journal-category-fishing > a").addClass("current");
			break;
			case "ds-journal-shooting":
				CurrentCategory = "ds-journal-shooting";
				// Mark tab as current
				$("#ds-journal-category-shooting > a").addClass("current");
			break;
			default: // All
				CurrentCategory = "ds-journal-all";
				// Mark tab as current
				$("#ds-journal-category-all > a").addClass("current");
			break;
		}
		
		// Show the new category
		$("#"+CurrentCategory).fadeIn(300);
		
	}
}