<!--
/*****************************************************
 *                     (modified)                    *
 *              Flash Plugin Check v1.03             *
 *                                                   *
 *              Written by Steve Vachon              *
 *                  (a.k.a Prometh)                  *
 *                                                   *
 *              www.svachon.com/scripts              *
 *                                                   *
 *****************************************************/

var hasFlash6 = false,
    hasActiveX = false,
    fscommand = "",
    popupWindow = false,
    navPlugins = (navigator.plugins.length > 0),
    isIE = (navigator.appVersion.indexOf("MSIE") > -1),
    ieVer = parseFloat(navigator.appVersion.split("MSIE")[1]),
    isWin = (navigator.appVersion.indexOf("Windows") > -1),
    isMac = (navigator.appVersion.indexOf("Mac") > -1);

if(location.search.split('?')[1] != "hasFlash6=1") {
	if(navPlugins || (isIE && isMac && ieVer >= 5)) {
		var plugin = navigator.plugins["Shockwave Flash"];
		var pluginDescription = plugin.description.split(" ");
		for(i=0; i<pluginDescription.length; i++) {
			if(!isNaN(parseInt(pluginDescription[i]))) {
				var pluginVersion = parseFloat(pluginDescription[i]);
				break;
			}
		}
		if(pluginVersion >= 6) hasFlash6 = true;
	}
	else if(isWin && isIE) {
		document.write('<script language=VBScript\>\n');
		document.write('function isHere(chk)\n');
		document.write('  isHere = false\n');
		document.write('  on error resume next\n');
		document.write('  if ScriptEngineMajorVersion > 1 then\n');
		document.write('    isHere = IsObject(CreateObject(chk))\n');
		document.write('  end if\n');
		document.write('end function\n');
		document.write('sub swf_FSCommand(ByVal command, ByVal args)\n');
		document.write('  call swf_doFSCommand(command, args)\n');
		document.write('end sub\n');
		document.write('</script\>');

		try {
			hasActiveX = isHere("msxml");
			if(!hasActiveX) hasActiveX = isHere("Microsoft.ActiveXPlugin.1");
		} catch(e) {
			hasActiveX = false;
		}
		if(hasActiveX) {
			function swf_doFSCommand(cmd, arg) {
				if(cmd == "status") window.status = arg;
				else if(cmd == "colorDialog") colorDialog(arg);
				else if(cmd == "close") window.close();
			}
			if(isHere("ShockwaveFlash.ShockwaveFlash.6")) hasFlash6 = true;
			fscommand = "&FSis=enabled";
		}
	} else {
		hasFlash6 = false;
	}
}
