﻿$(document).ready(function(){
	
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	$(".tabs > li").click(function(e){
		switch(e.target.id){
			case "tab1":
				//change status & style menu
				$("#tab1").addClass("active");
				$("#tab2").removeClass("active");
				$("#tab3").removeClass("active");
				$("#tab4").removeClass("active");
				$("#tab5").removeClass("active");
				//display selected division, hide others
				$("div.tab1").fadeIn();
				$("div.tab2").css("display", "none");
				$("div.tab3").css("display", "none");
				$("div.tab4").css("display", "none");
				$("div.tab5").css("display", "none");
			break;
			case "tab2":
				//change status & style menu
				$("#tab2").addClass("active");
				$("#tab1").removeClass("active");
				$("#tab3").removeClass("active");
				$("#tab4").removeClass("active");
				$("#tab5").removeClass("active");
				//display selected division, hide others
				$("div.tab2").fadeIn();
				$("div.tab1").css("display", "none");
				$("div.tab3").css("display", "none");
				$("div.tab4").css("display", "none");
				$("div.tab5").css("display", "none");
			break;
			case "tab3":
				//change status & style menu
				$("#tab3").addClass("active");
				$("#tab1").removeClass("active");
				$("#tab2").removeClass("active");
				$("#tab4").removeClass("active");
				$("#tab5").removeClass("active");
				//display selected division, hide others
				$("div.tab3").fadeIn();
				$("div.tab1").css("display", "none");
				$("div.tab2").css("display", "none");
				$("div.tab4").css("display", "none");
				$("div.tab5").css("display", "none");
			break;
			case "tab4":
				//change status & style menu
				$("#tab4").addClass("active");
				$("#tab1").removeClass("active");
				$("#tab2").removeClass("active");
				$("#tab3").removeClass("active");
				$("#tab5").removeClass("active");
				//display selected division, hide others
				$("div.tab4").fadeIn();
				$("div.tab1").css("display", "none");
				$("div.tab2").css("display", "none");
				$("div.tab3").css("display", "none");
				$("div.tab5").css("display", "none");
			break;
			case "tab5":
				//change status & style menu
				$("#tab5").addClass("active");
				$("#tab1").removeClass("active");
				$("#tab2").removeClass("active");
				$("#tab3").removeClass("active");
				$("#tab4").removeClass("active");
				//display selected division, hide others
				$("div.tab5").fadeIn();
				$("div.tab1").css("display", "none");
				$("div.tab2").css("display", "none");
				$("div.tab3").css("display", "none");
				$("div.tab4").css("display", "none");
			break;
		}
		//alert(e.target.id);
		return false;
	});
});




/*
$(document).ready(function() {

	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("li").attr("id"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		
		return false;
	});
	
	
 

});*/
