// Variable to store the current tab.
var selected_tab = null;

function show_tab(tab, panel_name, func) {
	// Switch the last selected panel back to normal.
	if (selected_tab) {
		selected_tab.className = 'tab';
	}
	selected_tab = tab;
	// Make the new tab selected.
	selected_tab.className = 'tab_selected';
	// Make all the other panels disappear.
	for(i = 0; i < panels.length; i++) {
		document.getElementById(panels[i]).style.display = (panel_name == panels[i]) ? 'block' : 'none';
	}
	// Evaluate any function that might come after.
	if (func) {
		eval(func);
	}
	// Return the function.
	return false;
}