// detects what version of the Flash plugin is installed
function detectFlashVersion() {
	var axo;
	var V;
	var e;
	// for IE
	try {
		try {
			axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
			try {
				axo.AllowScriptAccess = 'always';
			}
			catch (e) {
				return '6,0,0';
			}
		}
		catch (e) {
		}
		V = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
		return V.replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
	}
	// other browsers
	catch (e) {
		try {
			if (navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
				V = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]);
				return V.description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
			}
		}
		catch (e) {
		}
	}
	return '0,0,0';
}
// flash version, as an integer
function flashVersionInt() {
	return 0+detectFlashVersion().split(',').shift(); 
}
// hides the game div if Flash version is too low
function needFlashVersion(N, Gd, Bd) {
	var V = flashVersionInt();
	var tooLow = (V < N ? true : false);
	var goodDiv = this.document.getElementById(Gd);
	var badDiv = this.document.getElementById(Bd);
	if (tooLow) {
		goodDiv.style.display = 'none';
		badDiv.style.display = 'block';
	}
}
