var FS_requiredVersion = 6;        // Version the user needs to view site (max 6, min 2)
var FS_flashInstalled = false;     // boolean. true if flash is installed
var FS_maxVersion = 6;             // highest version we can actually detect
var FS_actualVersion = 0;          // version the user really has
var FS_hasRightVersion = false;    // boolean. true if it's safe to embed the flash movie in the page

function FS_detectRequiredFlash ()
{  

  if (navigator.plugins && (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"])) 
  {
      FS_flashInstalled = true;
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // DEBUGGING: uncomment next line to see the actual description.
      // alert("Flash plugin description: " + flashDescription);
      
      FS_actualVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));   

      if (FS_actualVersion > FS_maxVersion) FS_actualVersion = FS_maxVersion;

  }

  if(navigator.userAgent.indexOf("WebTV") != -1)
  {
     FS_flashInstalled = true;
     FS_actualVersion = 3;  
  }
  
  // DEBUGGING: uncomment next line to display flash version
  // alert("version detected: " + FS_actualVersion);

  // If the user has a new enough version...
  FS_hasRightVersion = (FS_actualVersion >= FS_requiredVersion);
  return FS_hasRightVersion;

} 
  