var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
var afv = 0;
var reqFlashVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

checkFlash();

//var testImg=new Image();
//testImg.src='files/testImg/'+gotflash+'.gif'; 

function checkFlash(){
	if ( plugin ) {
		// Netscape
		//afv = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
		afv = getMajorFlashVersion(plugin.description);
		plugin = afv >= reqFlashVersion;
	} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
		// MSIE & PC
		document.write('<SCRIPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('plugin = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
		document.write('<\/SCRIPT\> \n');
	}
}

function getMajorFlashVersion(pluginstr){
	d = pluginstr.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
	var pv0 = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
	var pv1 = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
	var pv2 = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
	//alert("Major = " + pv0 + ", minor = " + pv1 + ", release = " + pv2);
	return pv0;
}