// dit script detecteert flash.. of juist niet
// @@@
// @@ Author: Bas van Dorst
// @@ Date: 2007-02-27
// @@ Last change: 2007-02-27
// @@ Version: 1
// @@ Revision: 0
// @@ Copyright: Ecommany B.V.
// @@ Description: JS: check voor flash
// @@$

// vars
var flash = new Object();
flash.installed=false;
flash.version='0.0';
flash_versions = 20; // gaat 20 versies af

// netscape
if (navigator.plugins && navigator.plugins.length) {
	for (x=0; x < navigator.plugins.length; x++) {
		if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
			flash.version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
			flash.installed = true;
			break;
		}
	}
}

// active-x
else if (window.ActiveXObject) {
	for (x = 2; x <= flash_versions; x++) {
		try {
			oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
			if(oFlash) {
				flash.installed = true;
				flash.version = x + '.0';
			}
		}
		catch(e) {}
	}
}

// var komen te staan als flash.ver[x]
flash.ver = Array();
for(i = 4; i <= flash_versions; i++) {
	eval("flash.ver[" + i + "] = (flash.installed && parseInt(flash.version) >= " + i + ") ? true : false;");
}
