function fixLinks() {
	if ( document.getElementById( "tabPanel" ) == null ) { return; }
	
	var server = document.location.hostname;
	var anchors = document.getElementById( "tabPanel" ).getElementsByTagName( "a" );
	
	for( var i = 0; i < anchors.length; i++ ) {
		var a = anchors[ i ];
		var href = a.href;
		var id = a.id;
		var title = a.title;
		
		if ( ( href.indexOf( "#" ) != -1 ) && ( href.indexOf( "filler" ) == -1 ) ) { // jump ref
			var index = href.indexOf( "#" ) + 1;
			href = "javascript:show('" + href.substring( index ) + "');";
			a.setAttribute( "href", href );
		}
		
		if ( href.indexOf( "#filler" ) != -1 ) {
			a.href = "#";
		}
	}
}

function hideDivs( exempt ) {

	if ( !document.getElementsByTagName ) return null;
	if ( !exempt ) exempt = "";
	var divs = document.getElementById( "tabPanel" ).getElementsByTagName( "div" );
	
  	for( var i = 0; i < divs.length; i++ ) {
		var div = divs[ i ];
		var id = div.id;
		var tabId = document.getElementById( id + "Nav" );
		
		// hide irrelevant tabs
		if ( id != exempt && id.indexOf( "tab_" ) != -1 ) {
			div.className = "hidden";
			tabId.className = "";
		}
	}
	
}

function show( what ) {

	if ( document.getElementById( "tabPanel" ) == null ) { return; }

	// set default tab value
	if ( !what ) what = "tab_Gameinfo";
	
	showWhat = document.getElementById( what );
	showWhat.className = "";
	
	tabId = document.getElementById( what + "Nav" );
	tabId.className = "selected";
	
	hideDivs( what );
	
}