// detection if Flash is installed and available needs to be done first
// inteference with the JavaScript file happens when the unFocus wants to send data but Flash isn't available
// this breaks the JavaScript file, rendering the Flash check around line 70 useless
// this check uses AC_OETags.js
if (!hasReqestedVersion)
{
	var url = window.location.href;
	url = url.split('/')[2];
	document.write(url);
	var home = "about/index.asp"; // this variable needs to be changed for other sites
	window.location.replace("http://"+url+"/"+home);
}

// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------

var prefix = 'pathPrefix=/flash/';

// import classes from unFocus.Flash namespace (in style only of course)
function History_setTitle(args){
	document.title = 'Cogent Research :: ' + args;
}

function History_addHistory(args){
	
	//alert("History_addHistory");
	unFocus.History.addHistory(args);
}

with (unFocus.Flash) {
	if (Player.getVersion() >= 8) {
		// output flash html
		flashHTML = new HTML();
		flashHTML.setSrc("/flash/shell.swf");
		flashHTML.setWidth('100%');
		flashHTML.setHeight(595);
		flashHTML.setAlign("l");
		
		flashHTML.setId('flashPlayer');
		flashHTML.setName('flashPlayer');
		flashHTML.setQuality('high');
		flashHTML.setAllowscriptaccess('always');
		
		flashHTML.setBase(".");
		flashHTML.setMenu(false);
		flashHTML.setSwliveconnect(true);
		flashHTML.setScale("exactfit");
		flashHTML.setPlay(true);
		flashHTML.setWmode("transparent");
		//flashHTML.addFlashvar("pathPrefix", "/flash/");
		flashHTML.setFlashvars(prefix);
		
		// setup flash communicator
		var flashComm = new Communicator(flashHTML, '/flash/_scripting/unfocus/Communicator.swf');
		
		// use the HistoryBridge to add Bookmark functionality to flash
		var flashBridge = new HistoryBridge(flashComm);
		
		flashComm.DoFSCommand = function(cmd, args) {
			if (cmd == 'History.setTitle')
				document.title = 'Cogent Research ::  ' + args;
	};	
		flashHTML.writeToDocument(document);
		
	} else {
		// else is not displaying if flash is not installed at all

	}
}

