// moock fpi [f.lash p.layer i.nspector]
// version: 1.3.5
// written by colin moock
// code maintained at: http://www.moock.org/webdesign/flash/detection/moockfpi/
// terms of use posted at: http://www.moock.org/terms/

// # User defined globals.

var requiredVersion = 7;
var useRedirect = false;
                           
var flashPage = "movie.html";
var noFlashPage = "noflash.html";
var upgradePage = "upgrade.html";

// # End globals

// #
// Internal use
// #

// System globals
var flash5Installed = false;
var flash6Installed = false;
var flash7Installed = false;
var maxVersion = 7;
var actualVersion = 0;
var hasRightVersion = false;
var jsVersion = 1.0;


// Check the browser for ie/win
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

// This is a js1.1 code block, so make note that js1.1 is supported.
jsVersion = 1.1;

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if(isIE && isWin){
  document.write('<scr' + 'ipt type=text/vbscript\> \n');
  document.write('on error resume next \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('</scr' + 'ipt\> \n'); // break up end tag so it doesn't end our script
}

// Next standard javascript detection using navigator.plugins array
function detectFlash() {  
  // If navigator.plugins exists...
  if (navigator.plugins) {

    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
    
      // Some version of Flash was found.
      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
 
      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));

      // We found the version
      flash5Installed = flashVersion == 5;
	  flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion >= 7;
	         
    }
  }

  // Set highest detected version.
  for (var i = 5; i <= maxVersion; i++) {  
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
	
  }
 
  // If we're on webtv, don't are
  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;  
  
  // Time to take action.
  // If the user has a new enough version...
  if (actualVersion >= requiredVersion) {
    // redirect unless told not to
    if (useRedirect) {
      // Need javascript1.1 to do location.replace
      if(jsVersion > 1.0) {
        // It's safe to use replace().
        window.location.replace(flashPage);  
      } else {
        // JavaScript version is too old, use .location
        // the flash page.
        window.location = flashPage;
      }
    }
    
    // If we got here, we didn't redirect
    hasRightVersion = true;                
  } else {  
		//Load the appropriate alternate page.
    if (useRedirect) {
      // Do the same .replace() call only if js1.1+ is available.
      if(jsVersion > 1.0) {
        window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
      } else {
        window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
      }
    }
  }
}

detectFlash();  // call our detector

// Illumina specific 26/2/2004

function GetFlastInsert () {
}
