	var img_path = "../images/global/"
	var root_url = "../"
	var https_root_url = "https://www.v8supercar.com.au/"
	var path = window.location.pathname;
	var file = path.substring(path.lastIndexOf('/') + 1);
	var sign_up_over = new Image();
	sign_up_over.src = img_path + 'btn_sign_up_over.gif';
	var home_over = new Image();
	home_over.src = img_path + 'btn_home_over.gif';
	var display_level = 3;
	if (file == 'spec_check.html' || file == 'spec_check_no_flash.html') display_level = 2.5;
	if (file == 'choose.html' || file == 'choose.aspx') display_level = 2;
	if (file == 'what_you_need.html' || file == 'V8_promo.html' || file == 'season_updates.html' || file == 'what_you_get.html') display_level = 1;

	document.write('<link rel="stylesheet" type="text/css" href="' + root_url + 'css/global.css" />\n');

	function home_btn() {
		document.write(''
			+ '<div id="home_btn"><a href="' + root_url + 'flash/V8_promo.html"><img src="' + img_path + 'btn_home.gif" width="52" height="18" border="0" alt="Home" onmouseover="this.src=\'' + img_path + 'btn_home_over.gif\'" onmouseout="this.src=\'' + img_path + 'btn_home.gif\'" /></a></div>'
			);
	}

	function global_header()
	{

		document.write(''
      + '  <div id="bigPondHeader">\n'
      + '    <div id="bigPondLogo"><a href="http://bigpond.com" target="_blank">\n'
      + '    <img src="../images/BPHeader/gr_bp_logo.gif" width="147" height="45" alt="BigPond" /></a></div>\n'
      + '    <ul class="bigPondLinks">\n'
      + '    	<li class="first"><a href="http://www.bigpond.com/redirecttowebmail/?cid=BP-Channels-Head-Utility-Webmail">WebMail</a></li>\n'
      + '    	<li><a href="http://www.bigpond.com/whybigpond/default.asp/?cid=BP-Channels-Head-Utility-Why Bigpond?">Why BigPond?</a></li>\n'
      + '    	<li><a href="http://www.bigpond.com/internet-plans/joinbroadband/default.asp/?cid=BP-Channels-Head-Utility-Join Bigpond">Join BigPond</a></li>\n'
      + '    	<li><a href="http://www.bigpond.com/mobile/default.asp/?cid=BP-Channels-Head-Utility-Bigpond-On-Mobile">BigPond on Mobile</a></li>\n'
      + '    	<li><a href="http://www.telstra.com/?cid=BP-Channels-Head-Utility-Telstra.com">Telstra.com</a></li>\n'
      + '    </ul>\n'
      + '    <ul id="channelsNav">\n'
      + '      <li><a href="http://bigpondsport.com/?cid=BP-Channels-Head-Tabs-Sport" target="_blank"><img src="../images/BPHeader/bt_sport.gif" width="47" height="30" alt="Sport" /></a></li>\n'
      + '      <li><a href="http://bigpondmovies.com/?cid=BP-Channels-Head-Tabs-Movies" target="_blank"><img  src="../images/BPHeader/bt_movies.gif" width="53" height="30" alt="Movies" /></a></li>\n'
      + '      <li><a href="http://bigpondmusic.com/?cid=BP-Channels-Head-Tabs-Music" target="_blank"><img src="../images/BPHeader/bt_music.gif" width="46" height="30" alt="Music" /></a></li>\n'
      + '      <li><a href="http://bigpondgames.com/?cid=BP-Channels-Head-Tabs-Games" target="_blank"><img src="../images/BPHeader/bt_games.gif" width="53" height="30" alt="Games" /></a></li>\n'
      + '      <li><a href="http://bigpond.com/kids/default.jsp/?cid=BP-Channels-Head-Tabs-Kids" target="_blank"><img src="../images/BPHeader/bt_kids.gif" width="40" height="30" alt="Kids" /></a></li>\n'
      + '      <li><a href="http://bigpond.com/news/?cid=BP-Channels-Head-Tabs-News" target="_blank"><img src="../images/BPHeader/bt_news.gif" width="45" height="30" alt="News" /></a></li>\n'
      + '      <li><a href="http://bigblog.com.au/?cid=BP-Channels-Head-Tabs-BigBlog" target="_blank"><img src="../images/BPHeader/bt_blogs.gif" width="55" height="30" alt="BigBlog" /></a></li>\n'
      + '      <li><a href="http://bigpondtv.com/?cid=BP-Channels-Head-Tabs-Video" target="_blank"><img  src="../images/BPHeader/bt_tv.gif" width="33" height="30" alt="TV" /></a></li>\n'
      + '      <li><a href="http://my.bigpond.com/pond/SecondLife/?cid=BP-Channels-Head-Tabs-2ndLife" target="_blank"><img  src="../images/BPHeader/bt_2ndlife.gif" width="55" height="30" alt="2ndLife" /></a></li>\n'
      + '      <li><a href="http://www.bigpond.com/ipond/?cid=BP-Channels-Head-IPond" target="_blank"><img src="../images/BPHeader/bt_ipond.gif" width="55" height="30" alt="iPond" /></a></li>\n'
      + '    </ul>\n'
      + '    <div id="searchSensis">\n'
	  + '    <form name="searchForm" style="margin:0;" method="get" action="http://www.sensis.com.au/search.do">\n'
      + '     <div id="sensisLogo" onmouseover="this.style.display=\'none\';"></div>\n'
      + '      <label style="display:none;" for="find">Search with Sensis</label>\n'
      + '      <input type="text" name="find" class="sensisSearchButton"  id="findField" value="search the web" style="height: 20px; line-height: 12px; padding: 3px 0px 0px 0px;" />\n'
	  +			'<input type="image" id="searchButton" src="../images/BPHeader/bt_search.gif" alt="search sensis" />\n'
      + '      <input type="hidden" name="partnerId" value="bigpond" id="partnerId"/>\n'
      + '      <input type="hidden" name="location" value="" id="location"/>\n'
      + '      <input type="hidden" name="searchIndex" value="australia" id="searchIndex"/>\n'
	  +	'    </form>\n'
      + '    </div>\n'
      + '  </div>\n');

/*
		document.write(''
			+ '<div id="bigPondHeader">\n'
			+		'<div id="bigPondLogo"><a href="http://bigpond.com"><img src="' + root_url +  'images/header/universal/gr_bp_logo.gif" width="117" height="23" alt="BigPond" /></a></div>\n'
			+			'<ul id="channelsNav">\n'
			+			'<li><a href="http://bigpondsport.com"><img src="' + root_url +  'images/header/universal/bt_sport.gif" width="47" height="23" alt="Sport" /></a></li>\n'
			+			'<li><a href="http://bigpondmovies.com"><img src="' + root_url +  'images/header/universal/bt_movies.gif" width="53" height="23" alt="Movies" /></a></li>\n'
			+			'<li><a href="http://bigpondmusic.com"><img src="' + root_url +  'images/header/universal/bt_music.gif" width="46" height="23" alt="Music" /></a></li>\n'
			+			'<li><a href="http://bigpondgames.com"><img src="' + root_url +  'images/header/universal/bt_games.gif" width="53" height="23" alt="Games" /></a></li>\n'
			+			'<li><a href="http://bigpond.com/kids"><img src="' + root_url +  'images/header/universal/bt_kids.gif" width="40" height="23" alt="Kids" /></a></li>\n'
			+			'<li><a href="http://bigpond.com/news"><img src="' + root_url +  'images/header/universal/bt_news.gif" width="45" height="23" alt="News" /></a></li>\n'
			+			'<li><a href="http://bigblog.com.au"><img src="' + root_url +  'images/header/universal/bt_blogs.gif" width="55" height="23" alt="BigBlog" /></a></li>\n'
			+			'<li><a href="http://bigpondtv.com"><img src="' + root_url +  'images/header/universal/bt_tv.gif" width="33" height="23" alt="TV" /></a></li>\n'
			+			'</ul>\n'
			+		'<div id="searchSensis">\n'
			+		'<form name="searchForm" style="margin:0;" method="get" action="http://www.sensis.com.au/search.do">\n'
			+		'<div id="sensisLogo" onmouseover="this.style.display=\'none\';"></div>\n'
			+			'<label style="display:none;" for="find">Search with Sensis</label>\n'
			+			'<input type="text" name="find" id="find" value="search the web" />\n'
			+			'<input type="image" id="searchButton" src="' + root_url +  'images/header/universal/bt_search.gif" alt="search sensis" />\n'
			+			'<input type="hidden" name="partnerId" value="bigpond" />\n'
			+			'<input type="hidden" name="location" value="" />\n'
			+			'<input type="hidden" name="searchIndex" value="australia" />\n'
			+		'</form>\n'
			+		'</div>\n'
			+ '</div>\n');

*/
	}

	function DITrack()
	{
		var refr=escape(document.referrer); /* get the http referer and encode it */
		var dom=location.hostname; /* get the host domain */
		var stURL="http://au.track.decideinteractive.com/n/16013/16095/v8supercar.bigpond.com/6b0f0336002503000000000600000000036fa1b00000000000000000000000000000000100/i/c?0&1pixgif&referer="
		+ refr;
		if (refr && refr.search(dom) == -1) /* if the referrer is external preload the image request */
		{
			imageTR = new Image();
			imageTR.src = stURL;
		}
	}

	function global_footer()
	{

		document.write('<form name="v8form">');
		document.write('  <div class="footer">');
		document.write('    <div class="links">');
		document.write('      <a href="/content/help/" target="_blank">V8 Supercars Australia - Terms of use</a>&nbsp;|');
		document.write('      <a href="/content/about_avesco/contact_details/" target="_blank">Feedback</a>&nbsp;|');
		document.write('      <a href="#" onclick="popup(\'' + root_url + 'live_race_engine/how_it_works.html\', \'how_it_works\', 790, 650);">How it works</a>&nbsp;|');
//		document.write('      <a href="#" onclick="popup(\'' + root_url + 'chat/chat.html\', \'help\', 625, 390);">Chat</a>');
		document.write('    </div>');
		document.write('    <div class="newsletter">');
		document.write('      <a href="/newsletter/Signup.aspx"><img src="../images/choose/newsletter.gif" alt="newsletter" /></a>');
		document.write('      <input type="text" id="signup" name="signup" />');
		document.write('      <a href="#" onclick="popup(\'' + https_root_url + 'newsletter/signup.aspx?email=\' + document.v8form.signup.value, \'newsletter_signup\', \'450\', \'275\');"><img src="../images/choose/sign_btn.gif" alt="sign up button" style="position:absolute;" /></a>');
		document.write('    </div>');
		document.write('      <div class="btns">');
		document.write('      <a href="/spec_check/spec_check.aspx"><img src="../images/choose/spec_btn.gif" alt="spec check button" /></a>');
		document.write('      <a href="/content/site_help/"><img src="../images/choose/help_btn.gif" alt="help button" /></a>');
		document.write('    </div>');
		document.write('  </div>');
		document.write('</form');


		/*

		document.write('<link rel="stylesheet" type="text/css" href="' + root_url + 'css/global_footer.css" />\n'
			+ '<table width="100%" cellpadding="0" cellspacing="0" border="0">\n'
			+ '<form name="v8form">\n'
			+ '<tr>\n'
			+ '<td width="19"><img src="' + img_path + 'footer_grid_left.gif" width="19" height="25" border="0" /></td>\n'
			+ '<td bgcolor="#2D2D2D" width="601" class="footer">');

			if (display_level < 2)
			{
				document.write('V8 Supercars Australia&nbsp;&nbsp;&nbsp;');
			}
			document.write('<a href="#" onclick="popup_large(\'' + root_url + 'terms_of_use/terms_of_use.html\', \'terms_of_use\', 560, 510);" class="footer">Terms of use</a>');

		if (display_level >= 2) {
			document.write(''
				+ '&nbsp;|&nbsp;'
				+ '<a href="#" onclick="popup_large(\'' + root_url + 'how_to_use_light.html\', \'how_to_use\', 720, 650);" class="footer">How to use Lite</a>'
				+ '&nbsp;|&nbsp;'
				+ '<a href="#" onclick="popup_large(\'' + root_url + 'how_to_use.html\', \'how_to_use\', 720, 650);" class="footer">How to use Max</a>'
				);
		}
		document.write(''
			+ '&nbsp;|&nbsp;'
			+ '<a href="#" onclick="popup(\'' + root_url + 'how_it_works.html\', \'how_it_works\', 790, 650);" class="footer">How it works</a>'
			);
		if (display_level >= 2.5) {
			document.write(''
				+ '&nbsp;|&nbsp;'
				+ '<a href="#" onclick="popup_large(\'' + https_root_url + 'feedback.html\', \'feedback\', 550, 350);" class="footer">Feedback</a>'
				+ '&nbsp;|&nbsp;'
				+ '<a href="#" onclick="popup_large(\'' + root_url + 'help/help.html\', \'help\', 790, 650);" class="footer">Help</a>'
				+ '&nbsp;|&nbsp;'
				+ '<a href="#" onclick="popup(\'' + root_url + 'chat/chat.html\', \'help\', 625, 390);" class="footer">Chat</a>'
				);
		}
		if (display_level >= 3) {
			document.write(''
				+ '&nbsp;|&nbsp;'
				+ '<a href="#" onclick="popup(\'' + root_url + 'poll/poll.aspx\', \'Poll\', 790, 650);" class="footer">Poll</a>'
				+ '&nbsp;|&nbsp;'
				+ '<a href="#" onclick="popup(\'' + root_url + 'weather/weather.html\', \'Weather\', 790, 650);" class="footer">Weather</a>'
				);
		}
		document.write(''
			+ '</td>\n'
			+ '<td bgcolor="#504E4D" width="105"><img src="' + img_path + 'v8_newsletter.gif" width="105" height="25" border="0" alt="V8 Newsletter" /></td>\n'
			+ '<td bgcolor="#504E4D" width="108"><input id="footer_signup" name="signup" type="text" /></td>\n'
			+ '<td bgcolor="#2D2D2D" width="139"><a href="#" onclick="popup(\'' + https_root_url + 'plugins/newsletter/signup.aspx?email=\' + document.v8form.signup.value, \'newsletter_signup\', \'450\', \'275\');">'
			+ '<img src="' + img_path + 'btn_sign_up.gif" width="61" height="25" border="0" alt="Sign Up" onmouseover="this.src=\'' + img_path + 'btn_sign_up_over.gif\'" onmouseout="this.src=\'' + img_path + 'btn_sign_up.gif\'" /></a></td>\n'
			+ '<td bgcolor="#2D2D2D" width="25" align="right"><img src="' + img_path + 'footer_grid_right.gif" width="20" height="25" border="0" /></td>\n'
			+ '</tr>\n'
			+ '</form>\n'
			+ '</table>')

		*/
		/* DNA Tracking Code */
		/* This script tests the ppc parameter in the url. */
		/* URLs submitted for paid campaigns need to have "ppc=y"  to the URL of each landing page.              */
		/* Otherwise, DNA counts the clicks to the paid ads. This code can be pasted to HEAD section or saved as .js include file. */
		var urlparam = document.location.href.split('?');
		if( urlparam[1] )
		{
			var params = urlparam[1].split('&');
			var ppcCheck = 0;
			for( var i = params.length -1; i >= 0; i-- )
			{
				var param = params[i].split('=')[0];
				var value = params[i].split('=')[1];
				if(param == 'ppc' || param == 'PPC')
				{
					if(value == 'y' || value == 'Y')
					{
						ppcCheck = 1;
					}
				}
			}
			if( ppcCheck == 0 )
			{
				DITrack();
			}
		}
		else
		{
			DITrack();
		}
	}

	function popup(url, name, w, h)
	{
		h = (h < 1 ? h = 200 : h);
		w = (w < 1 ? w = 200 : w);
		window.open(url, name, 'scrollbars=0,overflow=auto,toolbar=no,location=no,status=no,menubar=no,resizable=no,width=' + w + ',height=' + h);
	}

	function popup_large(url, name, w, h)
	{
		h = (h < 1 ? h = 200 : h);
		w = (w < 1 ? w = 200 : w);
		window.open(url,name,'width='+w+',height='+h+',status=no,menubar=no,toolbar=no,location=no,resizable=no,scrollbars=1');
	}