var panels = new Array('panel1', 'panel2');

function showPanel(tab, panelName)
{
	var panelToShow = document.getElementById(panelName);

	for(i = 0; i< panels.length; i++)
	{
		// Get the current panel
		var curPanel = document.getElementById(panels[i]);

		// If it exists, hide it
		if (curPanel != null)
			curPanel.style.display = 'none';
	}

	// This line works around a display bug in Gecko-based browsers
	panelToShow.style.display = 'inline';

	// Show the panel
	panelToShow.style.display = 'block';

	return false;
}