var tabs = [];

//change tab and highlight current tab title
function change(stringref){
	//hide the other tabs
	jQuery('.tab:not(#' + stringref + ')').hide();
	//show proper tab, catch IE6 bug
	if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0")
		jQuery('.tab#' + stringref).show();
	else 
		jQuery('.tab#' + stringref).fadeIn();
	//clear highlight from previous tab title
	jQuery('#tabmenu a:not(#' + stringref + 't)').removeClass('select');
	//highlight currenttab title
	jQuery('#tabmenu a[href=#' + stringref + ']').addClass('select');
}

jQuery(document).ready(function(){
	//initialize tabs, display the current tab
	jQuery(".tab:not(:first)").hide();
	jQuery(".tab:first").show();
	
	//highlight the current tab title
	jQuery('#' + tabs[0] + 't').addClass('select');
	
	//handler for clicking on tabs
	jQuery("#tabmenu a").click(function(){
		//store reference to clicked tab
		stringref = jQuery(this).attr("href").split('#')[1];
		//display referenced tab
		change(stringref);
		return false;
	});
});