// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values entered above in "Globals"
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

// Location visited after installation is complete if installation is required
var MMredirectURL = window.location;

// Stored value of document title used by the installation process to close the window that started the installation process
// This is necessary to remove browser windows that will still be utilizing the older version of the player after installation is complete
// DO NOT MODIFY THE FOLLOWING TWO LINES
document.title = document.title.slice(0, 47) + "";
var MMdoctitle = document.title;

function createFlashObject(_swf, _width, _height, _flashvars){
	if ( hasProductInstall && !hasReqestedVersion ) {
		var productInstallOETags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
		+ 'width="' + _width + '" height="' + _height + '"'
		+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+' <param name="wmode" value="transparent" />'
		+ '<param name="movie" value="playerProductInstall.swf?MMredirectURL='+MMredirectURL+'&MMplayerType=ActiveX&MMdoctitle='+MMdoctitle+'" />'
		+ '<param name="quality" value="best" /><param name="bgcolor" value="#FFFFFF" />'
		+ '<embed src="playerProductInstall.swf?MMredirectURL='+MMredirectURL+'&MMplayerType=PlugIn" quality="best" bgcolor="#FFFFFF"'
		+ ' width="' + _width + '" height="' + _height + '" name="detectiontest" aligh="middle"'
		+ ' play="true"'
		+ ' loop="false"'
		+ ' quality="best"'
		+ ' wmode="transparent"'
		+ ' allowScriptAccess="sameDomain"'
		+ ' type="application/x-shockwave-flash"'
		+ ' pluginspage="http://www.macromedia.com/go/getflashplayer">'
		+ '<\/embed>'
		+ '<\/object>';
		document.write(productInstallOETags);   // embed the Flash Product Installation SWF
	} else if (hasReqestedVersion) {  // if we've detected an acceptable version
		with (unFocus.Flash) {
			// output flash html
			testHTML = new HTML();
			testHTML.setSrc(_swf);
			testHTML.setWidth(_width);
			testHTML.setHeight(_height);
			testHTML.setId('aos_swf');
			testHTML.setName('aos_swf');
			testHTML.setSwliveconnect(true);
			testHTML.setMenu(false);
			testHTML.setQuality('best');
			testHTML.setAllowscriptaccess('always');
			testHTML.setPlay(true);
			testHTML.setFlashvars(_flashvars);
			testHTML.setAlign("t");
			testHTML.setWmode("transparent");
			
			testHTML.setBase("/minisites/seduction/");
			
			// setup flash communicator
			//var testComm = new Communicator(testHTML, 'js/unFocus/Flash/Communicator.swf');
			
			// use the HistoryBridge to add Bookmark functionality to flash
			//var testBridge = new HistoryBridge(testComm);
									
			testHTML.writeToDocument(document);
		}
	} else {  // flash is too old or we can't detect the plugin
		var alternateContent = ''
		+ 'You don\'t have the correct version of Flash.';
		document.write(alternateContent);  // insert non-flash content
	}
}