<!--
// Utah State University Flash Plugin Inspector
// Author: Orion J. Espino
// Date: 12/07/00
// Description: Determine Flash player existence and version number, if applicable.
// 		Also to redirect user if they do not have the version necessary.
//
// Version Number	Modified By		Modified Date	Reason for Modification
//
// 1.0.0			oriesp			12/07/00		Launch Version
// 1.1.0			stemed			01/10/01		FlashMaster's Voodoo magic
// 1.2.0			charlest		01/18/02		www.usu.edu reconfig
//

var flashVersion = 0;
var maxVersion = 6;
var flash6Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash3Installed = false;
var flash2Installed = false;


// Write vbscript detection if we're NOT on mac, and we ARE using IE.
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

if(isIE && isWin){ // don't write vbscript tags on anything but Windows IE 
	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('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script

	// loop through all versions we're checking and set flashVersion to the highest detected version
	for (var i = 2; i <= maxVersion; i++) {	
		if (eval("flash" + i + "Installed") == true) flashVersion = i;
	}
}


// This function will do the detction for IE on a Mac and all Netscape browsers (any platform)
// The function is written here so that it loads completely and is called later from the main body
function detectFlash(){
	if (navigator.plugins){			
		if (navigator.plugins["Shockwave Flash 2.0"]	// Is Flash 2.0 Installed?
		|| navigator.plugins["Shockwave Flash"]){	// Is Flash 3.0+ Installed?

			var flVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flDescription = navigator.plugins["Shockwave Flash" + flVer2].description;
			// a flash plugin-description looks like 'Shockwave Flash 4.0 r5' so grab the character before the period for major version
			flashVersion = parseInt(flDescription.charAt(flDescription.indexOf(".") -1));
		}
	}
}

// -->