/*====================================================================
	BLL to show and hide tabs. Do NOT edit below this line.
====================================================================*/
$(document).ready(function(){
	$(".tabs ul li a").click(function(event){

		// clear the class of all the tabs
		resetTabs();

		// set the selected tab....
		activateTab($(this).parent().attr("tabNum"));

		// clear the class of all the tabs
		resetContent();

		// set the selected tab....
		activateContent($(this).parent().attr("tabNum"));

		// Stop the link click from doing its normal thing
		return false;
	});

	// show the tab that you want to display onload
	showDefault(DEFAULT_TAB);
});

function resetTabs(){
	// loop over the tabs and set them to 'un-selected'
	jQuery.each( $(".tabs ul li"), function(index, item){
		//alert($(item).attr("id"));
		$(item).attr("class","");
	});
}

function activateTab(tabNum){
	// select the tab
	$("#tab-"+tabNum).attr("class"," active");
}

function resetContent(){
	// loop over the tabs and set them to 'un-selected'
	jQuery.each( $(".fill .body"), function(index, item){
		$(item).hide();
	});
}

function activateContent(tabNum){
	// select the tab
	if (USE_EFFECTS){
		$("#content-"+tabNum).fadeIn(EFFECT_DELAY);
	} else {
		$("#content-"+tabNum).show();
	}
}

function showDefault(num){
	// run the sequence for onload action...
	resetTabs();
	activateTab(num);
	resetContent();
	activateContent(num);
}