<!--
/*******************************************************************
 City of Richmond Virginia 2005
 
 Initial Release: March 25 2005, LNDL
 Edits:
 *******************************************************************/
//=== The lowest Flash version we shall accept, LNDL ===
var __requiredVersion = 6;
var __currentUri 	  = document.location.href;

//=== System globals ===
var Flash2Installed 	= false;    // boolean. true if flash 2 is installed
var Flash3Installed 	= false;    // boolean. true if flash 3 is installed
var Flash4Installed 	= false;    // boolean. true if flash 4 is installed
var Flash5Installed 	= false;    // boolean. true if flash 5 is installed
var Flash6Installed 	= false;    // boolean. true if flash 6 is installed
var Flash7Installed 	= false;    // boolean. true if flash 7 is installed
var Flash8Installed		= false;    // boolean. true if flash 8 is installed
var Flash9Installed 	= false;    // boolean. true if flash 9 is installed

var __HighestVersion	= 9;        // highest version one might actually detect.
var __ActualVersion 	= 0;        // version installed in the client's browser.
var __CorrectVersion 	= false;    // Boolean; if true, embed the Flash movie in the page
var __javascriptVersion = 1.0;      // the version of JavaScript supported

//=== Browser Detection ===
var __IsInternetExplorer = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var __IsWindows 		 = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;

//=== A vbscript method to detect Flash on Internet Explorer since that browser does not support regular JavaScript array plugin-detection.
if(__IsInternetExplorer && __IsWindows)
{
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('Flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('Flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('Flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
  document.write('Flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
  document.write('Flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
  document.write('Flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
  document.write('Flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
  document.write('<\/SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

//=========================================================================================
//=== Standard JavaScript detection using the navigator.plugins array. A Flash 
//=== plugin-description appears as this: Shockwave Flash 4.0 r5
//=== One might detect the major version by determining the character before the period.
//===================================================================================LNDL==
function __detectFlash() 
{  
  //=== If navigator.plugins exists ===
  if(navigator.plugins) 
  {
    if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) 
	{
		var __IsFlashVersion2 	  = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
		var __FlashDllDescription = navigator.plugins["Shockwave Flash" + __IsFlashVersion2].description;

		//=== DEBUGGING: uncomment next line to see the actual description. ===
		//alert("Flash plugin description: " + __FlashDllDescription);

      	var flashVersion = parseInt(__FlashDllDescription.substring(16));

		Flash2Installed = flashVersion == 2;    
		Flash3Installed = flashVersion == 3;
		Flash4Installed = flashVersion == 4;
		Flash5Installed = flashVersion == 5;
		Flash6Installed = flashVersion == 6;
		Flash7Installed = flashVersion == 7;
		Flash8Installed = flashVersion == 8;
		Flash9Installed = flashVersion >= 9;
    }
  }
  
  //=== Loop through all versions; set __ActualVersion to highest detected version ===
  for (var i = 2; i <= __HighestVersion; i++) { if (eval("Flash" + i + "Installed") == true) { __ActualVersion = i; }}
  
  //=== DEBUGGING: uncomment next line to display flash version LNDL ===
  // alert("version detected: " + __ActualVersion);

  __CorrectVersion = (__ActualVersion >= __requiredVersion);
}

//=== Invoking the detector ===
__detectFlash(); 


if(!__CorrectVersion) 
{  
	//=== Do not redirect if flash=false is already present LNDL ===
	if(__currentUri.indexOf('flash=') == -1)
	{
	    //=== Flash is either too old or not present - retrieve the non-flash version ===
		var __QueryStringCharacter = __currentUri.indexOf('?') == -1 ? '?' : '&';
		window.location = __currentUri + __QueryStringCharacter + 'flash=false';
	}
}


// -->