﻿/*
	author:			jake williamson - emedia
	
	description:	flash version and build detection using mootools
	
					if the required version is not installed, an update message is displayed at the top of the page

	dependencies:	mootools
	
					the following html placed on the page:
					
					<div id="divFlashDetectionMsg" class="flash_warning">
						<asp:HyperLink ID="hlFlashWarning" runat="server" NavigateUrl="http://get.adobe.com/flashplayer/" Target="_blank" />
					</div>
					
					the following css and image:
					
					.flash_warning {
						display: none;
						width: 100%;
						height: 26px;
						background-color: #FFFFCC;
						border-bottom: solid 1px #666666;
					}
					.flash_warning a {
						display: block;
						width: 890px;
						height: 26px;
						margin: 0 auto;
						background: url(../_images/chrome/flash_warning.gif) no-repeat left 5px;
					}
					
	change log:		date		who		description
					27/07/2011	jake	created
*/
window.addEvent("domready", function(){

	if ($chk($('divFlashDetectionMsg'))) {

		var blnValid = false;
								
		//if the user has the required version or above
		if (Browser.Plugins.Flash.version >= 8) {
		
			blnValid = true;
		
			//if they have version 8, check that it's the correct revision
			if ((Browser.Plugins.Flash.version == 8) && (Browser.Plugins.Flash.build < 24)) {

				blnValid = false;
			}
		}
				
		//if the user doesnt have required version
		if (!blnValid) {

			//show the message	
			$('divFlashDetectionMsg').setStyle('display', 'block');
		}
	}

});
