//Eolas-compliant Flash plugin detection v1.0 with optional cookie-based detection-override

<!--
// Set a cookie for optional detection override, reload page.
function SetCookieType(ctype) {
	document.cookie='Aftershock='+ctype+';path=/;'
	if ( navigator.appName.indexOf("Microsoft") != -1 )
		parent.history.go(0);
	else if ( navigator.userAgent.indexOf("Mozilla/2") != -1 )
		parent.location = parent.location;
	else
		parent.location.reload();
}

// Version of Flash we require
var MM_contentVersion = 6;

// Variable to track degraded user override
var shockMode = 0;

// Call this function to set the cookie for the media type
function SetCookieType(ctype) {
	document.cookie='ChooseFlash='+ctype+';path=/;'
	if ( navigator.appName.indexOf("Microsoft") != -1 )
		parent.history.go(0);
	else if ( navigator.userAgent.indexOf("Mozilla/2") != -1 )
		parent.location = parent.location;
	else
		parent.location.reload();
}

// check for cookie override
if (document.cookie && (document.cookie.indexOf("ChooseFlash=Y") >= 0)) {
	shockMode = 1;
}

// Detect Netscape plug-in
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i];
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
// Detect ActiveX control
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." &amp; MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

// Determine whether or not to play Flash content
if ( MM_FlashCanPlay || shockMode) {
	shockMode = 1;
	document.write('<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
	document.write('  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
	document.write(' width="589" height="161" id="Billboard-01" align="middle">');
	document.write(' <param name="wmode" value="transparent" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="/Billboard-01.swf?xmlPath=' + currentXMLfile + '" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" />');
	document.write(' <embed src="/Billboard-01.swf?xmlPath=' + currentXMLfile + '" quality="high" bgcolor="#ffffff" ');
	document.write(' width="589" height="161" name="Billboard-01" align="middle" allowScriptAccess="sameDomain" ');
	document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" />');
	document.write(' </embed>');
	document.write(' </object></div>');
} else {
	// write out degradation content
	var current = 0;
	var tid = 0;

	document.write('<div id="billboard_noflash">');
	document.write('<img name="billboard" src="' + BillboardImage[0][0].src + '" alt="" width="589" height="161" border="0" />');
	document.write('</div>');

	function rotateImage(offset) {
		clearTimeout(tid);
		var index = current + offset;
		if (index != current) {
			if (index < BillboardImage.length) {
				if (index < 0) {
					current = BillboardImage.length - 1;
				} else {
					current = index;
				}
			} else {
				current = 0;
			}
			document.images["billboard"].src = BillboardImage[current][0].src;
		}
		autoRotate();
	}

	function autoRotate() {
		tid = setTimeout('rotateImage(1)',8000);
	}

	autoRotate();
}

//-->