// assuming js >= 1.1 and vb >= 2
//************** set Vars
var requiredVersion, actualVersion;
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isMac = (navigator.appVersion.toLowerCase().indexOf("mac") != -1) ? true : false; // true if we're on macintosh
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; // true if we're on windows
var updatePage = "updateFlash.html";


//*************** gotoURL
function setLocation (url) {
		window.location.replace(url);
}

//*************** actual  required Version callBack...
function validateFlashVersion (actual, required) {
  !(actual >= required) ? setLocation(updatePage) : null; 
}

//************** CHECK ON MAC
if (isMac) {
requiredVersion = 7;
	
// make sure there a version
if (navigator.plugins["Shockwave Flash"]) {
		var flashDescription = navigator.plugins["Shockwave Flash"].description;
		// A flash plugin-description looks like this: Shockwave Flash 4.0 r5
		// We can get the major version by grabbing the character before the period
		actualVersion = parseInt(flashDescription.substring(16));
	} else {
	// we have no flash at all
	actualVersion = 0;
	}

validateFlashVersion (actualVersion, requiredVersion);
// end mac detect
};

//************* CHECK ON WIN
if(isWin && isIE) {
requiredVersion = 7;

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.

// set vars and prove otherwise...
var isFlash2 = false; 
var isFlash3 = false;    
var isFlash4 = false;    
var isFlash5 = false;    
var isFlash6 = false;  
var isFlash7 = false;    
var isFlash8 = false;    
var isFlash9 = false;


document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');

document.write('on error resume next \n');
document.write('isFlash2 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
document.write('isFlash3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
document.write('isFlash4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
document.write('isFlash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
document.write('isFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
document.write('isFlash7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
document.write('isFlash8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
document.write('isFlash9 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
document.write('<\/SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
   
  // Loop through all versions we're checking, and
  // set actualVersion to highest version proved true.
  
  for (var i = 2; i <= 9; i++) {  
    if (eval("isFlash" + i) == true) actualVersion = i;
  }

validateFlashVersion (actualVersion, requiredVersion);
// end winie detect
}

