//
// Mark up all of the Tabs in the page to work.
// This depends on the elements used for the tabs having the correct classes and ids
//

$().ready(function()
{
	$('ul.tabset_tabs').each(function(){
		var tabsetId = $(this).attr("id").replace('tabset_', '');
		$('#tabset_' + tabsetId + ' li span.tabrow_content').click(function(){
			var tabId = $(this).attr("id").replace('tab_', '');

			$('#tabcontents_' + tabsetId + ' .tabset_content').hide();
			$('#tabcontents_' + tabsetId + ' #tabcontent_' + tabId).show();

			$('#tabset_' + tabsetId + ' li span.tabrow_content').removeClass("active");
			$(this).addClass("active");
		});
		$('#tabset_' + tabsetId + ' li span.tabrow_content:first').addClass("active");
		$('#tabcontents_' + tabsetId + ' .tabset_content:first').show();
	});
});


