// Flash detection script.
// Retrieves the version of the Flash Player - if they have less than the minimum required player, it redirects.
// If they have the correct version of the player, it stays put and plays the movie...

//var noFlashPg = "noFlash/noFlash.html";
var gotFlash6 = false;
var gotFlash7 = false;
var gotFlash8 = false;
var gotFlash9 = false;

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;   
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

// need to write out VBScript block if on IE as the Flash player is an ActiveX control, not a plugin.
if(isIE && isWin)
{
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');  
  document.write('gotFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n'); 
  document.write('gotFlash7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n'); 
  document.write('gotFlash8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n'); 
  document.write('gotFlash9 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n'); 
  document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

function getFlashVersion()
{
	// do the NetScape bit
	if(navigator.plugins && navigator.plugins["Shockwave Flash"])
	{
		// if supports plugins array
		var flashDesc = navigator.plugins["Shockwave Flash"].description;
		var flashVer = parseInt(flashDesc.charAt(flashDesc.indexOf(".") - 1));
		
		if (flashVer == 6) gotFlash6 = true;
		if (flashVer == 7) gotFlash7 = true;
		if (flashVer == 8) gotFlash8 = true;
		if (flashVer == 9) gotFlash9 = true;		
	}
	// now have collected versions, redirect as appropriate.

	if (gotFlash6 == false && gotFlash7 == false && gotFlash8 == false && gotFlash9 == false)
	{
		//document.location.href = "index.jsp?hasflash=0";
		document.location.href = "index.jsp";
	}
	else
	{
		// have a compliant version of Flash, so go to the main homepage:
		document.location.href = "index.jsp";
		//document.location.href = "index.jsp?hasflash=0";
	}
}

