// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 115;
// -----------------------------------------------------------------------------

function insertGame() {

	if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		if(hasRightVersion) {  // if we've detected an acceptable version
			// embed the flash movie
			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
				'width', '910',
				'height', '570',
				'src', 'http://mutinybay.interactive.altontowers.com/battlegalleons/PirateGameLoader',
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'align', 'left',
				'play', 'true',
				'loop', 'true',
				'scale', 'noscale',
				'wmode', 'transparent',
				'devicefont', 'false',
				'id', 'loader',
				'bgcolor', '#ffffff',
				'name', 'PirateGame',
				'menu', 'true',
				'allowScriptAccess','always',
				'allowFullScreen','true',
				'movie', 'http://mutinybay.interactive.altontowers.com/battlegalleons/PirateGameLoader',
				'salign', 'lt'
				); //end AC code
		} else {  // flash is too old or we can't detect the plugin
			var alternateContent = '<div style="width:280px;padding-top:100px;margin-left:auto;margin-right:auto"><a href="http://www.macromedia.com/go/getflash/" target="_blank"><img src="no-flash.png" border="0" height="330" width="278" />'
				+ '</a></div>';
			document.write(alternateContent);  // insert non-flash content
		}
	}	
}
