/* [INCLUDE FILE] tabnav */
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 );
	
}/* [INCLUDE FILE] ads/monstertruck */
function OAS_AD(position) {
	outputHtml = "";
	
	if(position == "Bottom2") {
		outputHtml = outputHtml + "<a href=\"/games/en/purchase-game.php?id=95\" target=\"_blank\">";
		outputHtml = outputHtml + "<img src='/i/banners/fl/monster-trucks-nitro_728x90_pay.jpg' />";
		outputHtml = outputHtml + "</a>";
	}
	
	if(position == "Middle") {
		advert = "/ads/300x250/monster_trucks_nitro.swf";
		pr_gamewidth = 300;
		pr_gameheight = 250;
		outputHtml = outputHtml + "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + pr_gamewidth + "\" height=\"" + pr_gameheight + "\">";
		outputHtml = outputHtml + "<param name=\"movie\" value=\"" + advert + "\">";
		outputHtml = outputHtml + "<param name=\"quality\" value=\"high\">";
		outputHtml = outputHtml + "<param name=\"menu\" value=\"false\">";
		outputHtml = outputHtml + "<embed src=\"" + advert + "\" quality=\"high\" menu=\"false\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + pr_gamewidth + "\" height=\"" + pr_gameheight + "\"></embed>";
		outputHtml = outputHtml + "</object>";
	}
	document.write(outputHtml);	
}