/*******************************************************
FLASH DETECT 3
All code by Ryan Parman and mjac, unless otherwise noted.
(c) 1997-2004 Ryan Parman and mjac
http://www.skyzyx.com
*******************************************************/

// This script will test up to the following version.
flash_versions = 20;

// Initialize variables and arrays
var detect_flash = new Object();
detect_flash.installed=false;
detect_flash.version='0.0';

// Dig through Netscape-compatible plug-ins first.
if (navigator.plugins && navigator.plugins.length) {
	for (x=0; x < navigator.plugins.length; x++) {
		if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
			detect_flash.version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
			detect_flash.installed = true;
			break;
		}
	}
//	flash.activated=(flash.installed && navigator.plugins['Shockwave Flash']);
//	if(flash.installed) alert('flash.installed='+flash.installed);
//	if(flash.activated) alert('flash.activated='+flash.activated);
}

// Then, dig through ActiveX-style plug-ins afterwords
else if (window.ActiveXObject) {
	for (x = 2; x <= flash_versions; x++) {
		try {
			oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
			if(oFlash) {
				detect_flash.installed = true;
				detect_flash.version = x + '.0';
			}
		}
		catch(e) {}
	}
}

// Create sniffing variables in the following style: flash.ver[x]
// Modified by mjac
detect_flash.ver = Array();
for(i = 4; i <= flash_versions; i++) {
	eval("detect_flash.ver[" + i + "] = (detect_flash.installed && parseInt(detect_flash.version) >= " + i + ") ? true : false;");
}

