// In this section we set up the content to be placed dynamically on the page.
// Customize movie tags and alternate html content below.

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"'
		+ 'WIDTH="'
		+ swfWidth
		+ '" HEIGHT="'
		+ swfHeight
		+ '"'
		+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+ '<PARAM NAME="MOVIE" VALUE="'
		+ swfPath
		+ '">'
		+ '<PARAM NAME="PLAY" VALUE="true">'
		+ '<PARAM NAME="LOOP" VALUE="false">'
		+ '<PARAM NAME="QUALITY" VALUE="high">'
		+ '<PARAM NAME="MENU" VALUE="false">'
		+ '<EMBED SRC="'
		+ swfPath
		+ '"'
		+ 'WIDTH="'
		+ swfWidth
		+ '" HEIGHT="'
		+ swfHeight
		+ '"'
		+ 'PLAY="true"'
		+ 'LOOP="false"'
		+ 'QUALITY="high"'
		+ 'MENU="false"'
		+ 'TYPE="application/x-shockwave-flash"'
		+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
		+ '</EMBED>'
		+ '</OBJECT>';
		
		document.write(oeTags);   // embed the flash movie
	} else {  // flash is too old or we can't detect the plugin
		var alternateContent = 'This activity requires the <a target="_blank" href="http://www.macromedia.com/go/getflashplayer/">Flash 5 (or later) plugin</a>.'
		+ 'Pleas visit <a target="_blank" href="http://www.macromedia.com/go/getflashplayer/">Macromedia</a> to download <a target="_blank" href="http://www.macromedia.com/go/getflashplayer/">this free plugin</a>.'
		+ '<br />If you believe you have reached this page in error and DO have the Flash 5 (or later) plugin you may <a href="'
		+ pagePath
		+ '?flashVar=1">continue on and try to load the Flash Activity</a>';
		if (onHomePage) { 
			// If you are at the root of the website then you  will actually get redirected to the 
			// non-flash home page instead of getting the error.  Beacause getting a big error the first time 
			// You visit the site just because you don't have flash would be kinda lame.
			// goto "/catal/top.php?visited=TRUE"
			window.location.href = "http://www.smm.org/catal/top.php?visited=TRUE"
		} else {
			// But anywhere else you will get the error message
			document.write(alternateContent); // insert non-flash content
		}
	}
}
