var prefix = 'pathPrefix=/flash/';

// import classes from unFocus.Flash namespace (in style only of course)
function History_setTitle(args)
{
	document.title = 'Grandover :: ' + args;
}

function History_addHistory(args)
{
	//alert("History_addHistory");
	unFocus.History.addHistory(args);
}

function loadFlashPlayer()
{
	with (unFocus.Flash) {
		//if (Player.getVersion() >= 8) {
		//hasReqestedVersion = false;
		if(hasReqestedVersion){
		
			// variable is declared in the following js file: /global/universal.js			
			document.write('<div class="flash" id="container">');
			
			// output flash html
			flashHTML = new HTML();
			flashHTML.setSrc("/flash/shell.swf");
			flashHTML.setWidth('100%');
			flashHTML.setHeight("100%");
			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.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 = 'Grandover ::  ' + args;
			};	
			
			flashHTML.writeToDocument(document);
			document.write("</div><noscript>");
			window.onresize= flashResize;
			window.onresize();
		
		} 
	
		else
		{
		// else is not displaying if flash is not installed at all
		// variable is declared in the following js file: /global/universal.js
		
			//var test = document.open("file.html");
			//document.write(test);

		}
	}
}
loadFlashPlayer();

function flashResize() 
{
  var containerTemp 	= document.getElementById("container");
  var flashTemp 		= document.getElementById("flashPlayer");
  //containerTemp.style.width = flashTemp.style.width = document.body.clientWidth > 980? document.body.clientWidth +'px'  : "980px";
  containerTemp.style.height = flashTemp.style.height = document.body.clientHeight > 600? document.body.clientHeight +'px'  : "600px";
}