$(document).ready(function() {
	//STOCK INFO TABs	
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	$("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("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	
	//STOCK Quote TABs
	$(".tab_sq").hide(); //Hide all content
	$("ul.sqTabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_sq:first").show(); //Show first tab content
	
	$("ul.sqTabs li").click(function() {
								 
		$("ul.sqTabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_sq").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href");//Find the rel attribute value to identify the active tab + content
		$.cookie('sqpageli',this);
		$.cookie('sqpagediv',activeTab);	
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	
	
	//STOCK lookup TABs
	$(".tab_lookup").hide(); //Hide all content
	$("ul.lookTabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_lookup:first").show(); //Show first tab content
	
	$("ul.lookTabs li").click(function() {
		$("ul.lookTabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_lookup").hide(); //Hide all tab content
		var 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;
	});
	
	
	
	
	//OVERVIEW ACCORDION
	$(".accordion h3:first").addClass("active");
	$(".accordion div.accBody:not(:first)").hide();

	$(".accordion h3").click(function(){
		$(this).next("div.accBody").slideToggle("slow")
		.siblings("div.accBody:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});

	
});
