
/*******************************************************
FLASH DETECT 2.5
All code by Ryan Parman and mjac, unless otherwise noted.
(c) 1997-2004 Ryan Parman and mjac
http://www.skyzyx.com

07/21/2009 - Found updated version online
Code updated 3/22/09; file updated 7/21/09
*******************************************************/



/**
* Flash detection
*/
 
var flash = {
 
/**
* Internal function that does all of the heavy-lifting.
*
* @returns An associative array containing values for the user-facing functions.
* @type Array
* @private
*/
init: function() {
var v = [];
 
if (navigator.plugins && navigator.plugins.length) {
for (x = 0; x < navigator.plugins.length; x++) {
if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
v['version'] = navigator.plugins[x].description.split('Shockwave Flash ')[1].split(' r').join('.');
v['installed'] = true;
break;
}
}
}
else if (window.ActiveXObject) {
for (x = 1; x <= 20; x++) {
try {
fl = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.' + x);
if (fl) {
v['version'] = x;
v['installed'] = true;
}
}
catch(e) {}
}
}
return v;
},
 
installed: function() {
var v = flash.init();
return v['installed'];
},
 
version: function() {
var v = flash.init();
return v['version'];
},
 
base: function(v) {
return (flash.installed() && parseInt(flash.version()) >= v) ? true:false;
}
};