// JavaScript Document






var requiredVersion = 7;//set the version that is required by users

var flash2Installed = false;//set all versions false until we check them
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var flash7Installed = false;
var flash8Installed = false;

var maxVersion = 8;  //highest version to count to 
var actualVersion = 0; //set version to 0 until we check them


var hasRightVersion = false; 

function goMac(){
	window.open('http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','macromedia','width=750,height=550,toolbar=yes,scrollbars=yes,location=yes');
}





var isIE = (navigator.appVersion.indexOf("MSIE") != -1);//if user is using IE - will set to TRUE - false otherwise
var isWin = (navigator.appVersion.indexOf("Windows") != -1);//if user is using Windoes - will set to TRUE - false otherwise


if (isIE && isWin){//if user is using windows & IE then write vbscript win javascript
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n')
	document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n')//will = true if able to create object for  
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n')//this plugin version
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n')
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n')
	document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n')
	document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n')
	document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n')
	document.write('</SCR' + 'IPT\> \n');
	
	}
	
	



function detectFlash(){
	
	if (navigator.plugins){//if supports plugins
		
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]){//if shockwave object exists
				var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";//if version 2 put 2.0 else leave blank
				var flashDescription = (navigator.plugins["Shockwave Flash" + isVersion2].description)//get plug in description
				var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
				
				
			flash2Installed = flashVersion == 2;
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion == 6;
			flash7Installed = flashVersion == 7;
			flash8Installed = flashVersion >= 8;
			
			//alert("flash6Installed" + flash6Installed)
			
			
		}
	}
	//alert ("maxVersion: " + maxVersion)
	for (var i = 2; i <= maxVersion; i++){
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
			
	}
	
	//alert ("version detected: " + actualVersion);
	
	if (actualVersion >= requiredVersion){
		hasRightVersion = true;
	}else{
		hasRightVersion = false;
	}
	
}	
	detectFlash();
	
	




