
//-------------------------------------------------------------------------------------------------------------------------------------
//-- Write Flash Player to Screen
//-------------------------------------------------------------------------------------------------------------------------------------

	// url, width, height, version, show error if not detected
	function JS_Flash_Write ( str_URL, n_Width, n_Height, n_Version, b_ShowError, str_AlternativeOutput, str_AdditionalText, str_BackgroundColour )
	{
	
		//-------------------------------------------------------------------------------------------------------------------------------------
		//-- Globals
		//-------------------------------------------------------------------------------------------------------------------------------------
	
		// Major version of Flash required
		var requiredMajorVersion = n_Version;
		// 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 ( str_URL );
	
		//-------------------------------------------------------------------------------------------------------------------------------------
		//-- 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 ( ( str_BackgroundColour == null ) || ( str_BackgroundColour == "" ) ) str_BackgroundColour = "#FFFFFF";
		
		if ( hasRightVersion ) {  // if we've detected an acceptable version
			var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ 'width="' + n_Width + '" height="' + n_Height + '"'
			+ 'codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" alt="Flash" id="FlashFile">'
			+ '<param name="movie" value="' + str_URL + '" />'
			+ '<param name="quality" value="high" />'
			//+ '<param name="bgcolor" value="' + str_BackgroundColour + '" />'
			+ '<param name="menu" value="false" />'
			+ '<param name="wmode" value="transparent" />'
			+ '<embed src="' + str_URL + '" quality="high" '
			//+ 'bgcolor="' + str_BackgroundColour + '" '
			+ 'width="' + n_Width + '" height="' + n_Height + '" name="player" 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 ( str_AdditionalText != false ) oeTags += str_AdditionalText; // add additional text if any
			
			document.write(oeTags);   // embed the flash movie
		}
		else 
		{
			if ( b_ShowError )
			{
				// 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(str_AlternativeOutput)
			}
		}
	
		//-------------------------------------------------------------------------------------------------------------------------------------
		//-------------------------------------------------------------------------------------------------------------------------------------
	
	}	

//-------------------------------------------------------------------------------------------------------------------------------------
//-- Wrapper for the flash
//-------------------------------------------------------------------------------------------------------------------------------------

	function JS_Flash_OpenFlashHolder ()
	{
		document.write('<div class="FlashHolder">');
			document.write('<div class="Flash">');	
	}
	
	function JS_Flash_CloseFlashHolder ()
	{
			document.write("</div>");
		document.write("</div>");	
	}
	
	function JS_Flash_OpenFlashHolderDiagram ()
	{
		document.write('<div class="FlashHolderDiagram">');
			document.write('<div class="FlashDiagram">');	
	}

//-------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------


