// JavaScript Document

$(document).ready(function() {

	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("a", "ul.tabs li:first").addClass("buygetactive").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("a", "ul.tabs li").removeClass(); //Remove any "active" class
		var activeTab = $(this).find("a").attr("name");
		if(activeTab=="bestselleractive")
			$("a", this).addClass("bestselleractive");
		if(activeTab=="supersaleactive")
			$("a", this).addClass("supersaleactive");
		if(activeTab=="buygetactive")
			$("a", this).addClass("buygetactive");
		if(activeTab=="newproductactive")
			$("a", this).addClass("newproductactive");
		$(".tab_content").hide(); //Hide all tab content
		activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
});
