
//-------------------------------------------------------------------------------------------------------------------------------------
//-- Write Flash Player to Screen
//-------------------------------------------------------------------------------------------------------------------------------------

	// url, width, height, version, show error if not detected
	function JS_Flash_Write ( strName, strURL, nWidth, nHeight, nVersion, bShowError, strAlternativeOutput, strAdditionalText, strBackgroundColour )
	{		
		//-------------------------------------------------------------------------------------------------------------------------------------
		//-- Globals
		//-------------------------------------------------------------------------------------------------------------------------------------
	
		// Major version of Flash required
		var requiredMajorVersion = nVersion;
		// Minor version of Flash required
		var requiredMinorVersion = 0;
		// Revision of Flash required
		var requiredRevision = 0;
		// the version of javascript supported
		var jsVersion = 1.0;
		
		//-------------------------------------------------------------------------------------------------------------------------------------
		//-------------------------------------------------------------------------------------------------------------------------------------
	
	
		//alert ( strURL );
	
		//-------------------------------------------------------------------------------------------------------------------------------------
		//-- Write Flash Player to screen
		//-------------------------------------------------------------------------------------------------------------------------------------
	
		var hasRightVersion = DetectFlashVer ( requiredMajorVersion, requiredMinorVersion, requiredRevision );
		
		/*
		var version = deconcept.SWFObjectUtil.getPlayerVersion();
		alert(version['major']);
		var hasRightVersion = requiredMajorVersion <= version['major'];
		*/
		
		//if ( ( strBackgroundColour == null ) || ( strBackgroundColour == "" ) ) strBackgroundColour = "#FFFFFF";
		
		if ( hasRightVersion ) {  // if we've detected an acceptable version
			var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ 'width="' + nWidth + '" height="' + nHeight + '"'
			+ 'codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" alt="Flash" id="' + strName +'" >'
			+ '<param name="movie" value="' + strURL + '" />'
			+ '<param name="quality" value="high" />'
			+ '<param name="allowScriptAccess" value="sameDomain" />'
			//+ '<param name="bgcolor" value="' + strBackgroundColour + '" />'
			+ '<param name="menu" value="false" />'
			+ '<param name="wmode" value="transparent" />'
			+ '<embed src="' + strURL + '" quality="high" name="' + strName +'"  '
			//+ 'bgcolor="' + strBackgroundColour + '" '
			+ 'width="' + nWidth + '" height="' + nHeight + '" align="middle" '
			+ 'play="true" '
			+ 'loop="false" '
			+ 'quality="high" '
			+ 'menu="false"'
			+ 'wmode="transparent" '		
			+ 'allowScriptAccess="sameDomain" '
			+ 'type="application/x-shockwave-flash" '
			+ 'pluginspage="https://www.macromedia.com/go/getflashplayer">'
			+ '<\/embed>'
			+ '<\/object>';
			
			if ( strAdditionalText != false ) oeTags += strAdditionalText; // add additional text if any
			
			document.write(oeTags);   // embed the flash movie
		}
		else 
		{
			if ( bShowError )
			{
				// flash is too old or we can't detect the plugin
				var alternateContent = '<div class="Error">Flash Player not detected, or current Player too old.'
				+ 'This content requires the Macromedia Flash Player. '
				+ '<a href=https://www.macromedia.com/go/getflash/ target=_blank>Get Flash</a></div>';
				document.write(alternateContent);  // insert non-flash content
			}
			else
			{
				document.write(strAlternativeOutput)
			}
		}
	
		//-------------------------------------------------------------------------------------------------------------------------------------
		//-------------------------------------------------------------------------------------------------------------------------------------
	
	}	

//-------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------