var promoElement = document.getElementById('Promo');
replaceWithFlash(promoElement);
function replaceWithFlash(promoNode)
{
	var width = "550";
	var height = "260";
	var movie = "../Assets/Images/OMF.swf";
	var version = 4;
	var useNetscapePlugins = navigator.plugins && navigator.mimeTypes.length;
	
	if (detectFlash())
	{
		promoNode.innerHTML = createMovieHtml();
	}
	
	function createMovieHtml()
	{
		var sizeAttributes = "width=\"550\" height=\"260\"";
		return useNetscapePlugins ?
			"<embed type=\"application/x-shockwave-flash\" src=\"" + movie + "\" " + sizeAttributes + "></embed>"
			:
			"<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" " + sizeAttributes + "><param name=\"movie\" value=\"" + movie + "\" /></object>";
	}
	
	function detectFlash()
	{
		return getFlashVersion() >= version;

		function getFlashVersion()
		{
			if (useNetscapePlugins)
			{
				var plugin = navigator.plugins["Shockwave Flash"];
				if(plugin && plugin.description)
				{
					var description = plugin.description;
   					return description.charAt(description.indexOf('.')-1);
				}
			} 
			else
			{
				var version = 0;
				for(var i = 4; i >= 3; i--)
				{
					var testObject;
					try
					{
						testObject = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." +  i);
					}
					catch(e)
					{
						continue;
					}
					return i;
   				}
			}
			return 0;
		}
	}
}
