// version to detect
var detectVersion = 6;
// init vars
var userVersion = 0;
var showFlash = false;
// windows / ie4 check
function Is (){
    var agt = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.ie4up = (this.ie  && (this.major >= 4));
    this.win = ((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1));
}
var is = new Is(); 
// check ie flash versions
function ieCheck (){
	if(is.ie4up && is.win){
		var n = detectVersion;
		eval('ieFlash'+n+'=false');
		document.write('<scr' + 'ipt language="VBScript"\> \n');
		document.write('on error resume next \n');
		document.write('ieFlash'+n+' = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+n+'"))) \n');
		document.write('</scr' + 'ipt\> \n');
		if (eval("ieFlash"+n)){
			userVersion = n;
		}
	}
}
// check netscape flash versions
function nsCheck (){
	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]){
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			userVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
		}
	}
}
// run the detection
function detectFlash (){
	ieCheck();
	nsCheck();
	// set the showFlash variable
	if (userVersion >= detectVersion){
		showFlash = true;
	}
}
detectFlash();
