// In this section we set up the content to be placed dynamically on the page.
// Customize movie tags and alternate html content below.

// added code to catch undefined sFlashVars from pages that do not have the sFlashVars variable declared.
try
{
	var test = sFlashVars;	
}
catch (err)
{
	sFlashVars = '';
}
// end add
if (!useRedirect) {    // if dynamic embedding is turned on
  if(hasRightVersion) {  // if we've detected an acceptable version
 
    var oeTags = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
	+ 'ID="ftrans" ' //this is for ie to allow flash to talk to jumpToTop javascript located in showreels.php
    + 'WIDTH="' + sFlashWidth + '" HEIGHT="' + sFlashHeight + '" '
    + 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> '
    + '<PARAM NAME="MOVIE" VALUE="' + sFlashFile + '"> '
	+ '<param name="flashVars" value="';

	if(sFlashXML!=''){
		oeTags += 'gXMLFilename=' + sFlashXML;
	}
	if(sFlashVars!=''){
		if(sFlashXML!=''){
			oeTags += '&' + sFlashVars;
		} else {
			oeTags += sFlashVars;
		}
	}
	oeTags += '" />'
    + '<PARAM NAME="PLAY" VALUE="true">'
	//test chris
    //+ '<PARAM NAME="wmode" VALUE="transparent">'
    + '<PARAM NAME="LOOP" VALUE="false">'
    + '<PARAM NAME="QUALITY" VALUE="high">'
    + '<PARAM NAME="MENU" VALUE="false">'
	+ '<PARAM NAME="SALIGN" VALUE="tl">'
    + '<EMBED SRC="' + sFlashFile + '"'
    + 'WIDTH="' + sFlashWidth + '" HEIGHT="' + sFlashHeight + '" '
    + 'PLAY="true" '
    //+ 'bgcolor="#81CCC8" ' //added at client's request by cn 160807
    + 'LOOP="false" '
    + 'QUALITY="high" '
	//test chris
	//+ 'WMODE="transparent" '
	+ 'SALIGN="tl" '
    + 'MENU="false" '
    + 'TYPE="application/x-shockwave-flash" '
    + 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" '
	+ 'flashVars="';
	
	if(sFlashXML!=''){
		oeTags += 'gXMLFilename=' + sFlashXML;
	}
	if(sFlashVars!=''){
		if(sFlashXML!=''){
			oeTags += '&' + sFlashVars;
		} else {
			oeTags += sFlashVars;
		}
	}
	
	oeTags += '">'
    + '<\/EMBED>'
    + '<\/OBJECT>';
//	alert (oeTags);
    document.write(oeTags);   // embed the flash movie
  } else {  // flash is too old or we can't detect the plugin
    // NOTE: height, width are required!
    var alternateContent = '<p class="message"><strong>You need Flash Player version 9 or later installed to play video clips and audio files on this website.</strong><br />You can <a href="http://www.adobe.com/products/flashplayer/" title="Download the latest Flash player from the Adobe website" style="color:#000;text-decoration:underline;">download the latest version from the Adobe website</a>.</p>';

    document.write(alternateContent);  // insert non-flash content
  }
}
