var schedadaaprire = "detect_flash";
var schedadanascondere = "download_flash";

function detectFlash() {
	
	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;
			
			var flashVersion = parseInt(flashDescription.substring(16));
	
			flash2Installed = flashVersion == 2;    
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion == 6;
			flash7Installed = flashVersion == 7;
			flash8Installed = flashVersion == 8;
			flash9Installed = flashVersion >= 9;
		}
	}
  
	for (var i = 2; i <= maxVersion; i++) {  
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}
  
	if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 4;
		
	if (actualVersion >= requiredVersion) {
		  schedadaaprire = "detect_flash";
		  schedadanascondere = "download_flash";
		  activedown();
		  hasRightVersion = true;
	} else {
		  schedadaaprire = "download_flash";
		  schedadanascondere = "detect_flash";
		  activedown();
	}
}


function activedown(){
	if ((document.getElementById(schedadaaprire)) && (document.getElementById(schedadanascondere))) {
		document.getElementById(schedadaaprire).style.display="block";
		document.getElementById(schedadanascondere).style.display="none";
	}
}