// JavaScript Document

function toptabSwitch(new_toptab, new_topcontent) {
	
	document.getElementById('topcontent_1').style.display = 'none';
	document.getElementById('topcontent_2').style.display = 'none';
	document.getElementById('topcontent_3').style.display = 'none';		
	document.getElementById(new_topcontent).style.display = 'block';	
	

	document.getElementById('toptab_1').className = '';
	document.getElementById('toptab_2').className = '';
	document.getElementById('toptab_3').className = '';		
	document.getElementById(new_toptab).className = 'active';		

}

// Ties a set of toptabs and topcontent id's together, and switches between them
// <div id='toptab_1'> and <div id="topcontent_1"> for example
// Usage: toptabswitch(1, 4, 'toptab', 'panel') would switch on toptab_1 and panel_1

function toptabSwitch_2(active, number, toptab_prefix, topcontent_prefix) {
	
	for (var i=1; i < number+1; i++) {
	  document.getElementById(topcontent_prefix+i).style.display = 'none';
	  document.getElementById(toptab_prefix+i).className = '';
	}
	document.getElementById(topcontent_prefix+active).style.display = 'block';
	document.getElementById(toptab_prefix+active).className = 'active';	
	
}
