/////// ####################################################################################################
/////// WRITTEN BY TECHNICWEB - 11/05
/////// Fully Compliant With:
///////		- Windows XP
///////				- Internet Explorer 6.0
///////				- Mozilla 1.7.12
///////				- Mozilla Firefox 1.0.7
///////				- Netscape 7.2
///////				- Opera 8.5.0
///////		- Windows 2000
///////				- Internet Explorer 5.0
///////				- Netscape 7.2
///////				- Mozilla 1.7.12
///////				- Firefox 1.0.7
///////				- Opera 8.5.0
///////						
///////	Buggy:
///////		- Apple Mac OSX 10
///////				- All browsers
///////
///////	Purpose:
///////		Manager to detect whether the client's browser has a specific version of Macromedia Flash Player installed.
/////// #####################################################################################################

function EstateWeb_Objects_FlashDetectionManager(){
	this.FlashTargetVersion = 4; // The specific flash plugin version you wish to ensure is installed
	this.FlashInstalledVersion = -1; // Once script has run, this will hold the actual version number of plugin
	this.FlashBrowserTag = "";
	this.Detect = __EstateWeb_Objects_FlashDetectionManager_Detect;
}

function __EstateWeb_Objects_FlashDetectionManager_Detect(){
	// attempt to read flash plugin data directly from the browser
	var pluginInfo = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	var result = false;
	if ( pluginInfo ) {
		try{
			var mimeInfo = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < mimeInfo.length; ++i)
			{
				if ( isNaN(parseInt(mimeInfo[i])) )
				continue;
				this.FlashInstalledVersion = parseInt(mimeInfo[i]); 
			}
			result = ( this.FlashInstalledVersion >= this.FlashTargetVersion );
	   }
	   catch (e) { result = false } 
	}else{
		if ( navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1) ){
			try {
   					var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
   					this.FlashInstalledVersion = parseInt(axo.GetVariable("$version").split(" ")[1].split(",")[0]);
   					result = ( this.FlashInstalledVersion >= this.FlashTargetVersion );
			  } 
			 catch (e) { result = false }
		}
	}	
	this.FlashBrowserTag = (navigator.userAgent.indexOf("MSIE") >= 0 ? "MSIE" : "MOZ");
	return result;
}