//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 = flashversion;

// 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 = Number(MM_PluginVersion) >= Number(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." & 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 align="center"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+flashversion+'" ');
	document.write(' ID="" WIDTH="'+mvWidth+'" HEIGHT="'+mvHeight+'" ALIGN="">');
	document.write(' <PARAM NAME=movie VALUE="'+mvName+'"> <PARAM NAME=quality VALUE=high> <param NAME=bgcolor VALUE=#'+mvBGColor+'>  '); 
	document.write(' <EMBED src="'+mvName+'" quality=high bgcolor=#'+mvBGColor+'  ');
	document.write(' swLiveConnect=FALSE WIDTH="'+mvWidth+'" HEIGHT="'+mvHeight+'" NAME="aarp_magazine" ALIGN=""');
	document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
	document.write(' </EMBED>');
	document.write(' </OBJECT></div>');
} else {
	// write out degradation content
	if (redirecturl == "") {
	document.write('<div align="center"><img src="'+FlashDegradationImage+'" alt="'+FlashDegAlt+'" title="'+FlashDegAlt+'" width="'+FlashDegWidth+'" height="'+FlashDegHeight+'" border="0" usemap="#Map" /><map name="Map" id="Map"><area shape="rect" coords="'+FlashDegActionCoords+'" href="http://www.macromedia.com/go/getflashplayer/" target="_new" alt="Click here to install the Flash 6 player." />');
	document.write('<area shape="rect" coords="'+FlashDegActionCoords+'"');
	document.write(" href='javascript:SetCookieType(");
	document.write('"Y"');
	document.write(")' ");
	document.write('alt="Click here to install the Flash X player." /></map></div>');
	} else {		
		location.href=redirecturl;
	}
}

//-->