var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
<!-- 
	function killErrors() {
	return true;
	}
	window.onerror = killErrors;
// -->
	function resizeToWin(tW, tH) {
		resizeTo(tW, tH);
	}
	function moveToWin(tX, tY) {
		moveTo(tX, tY);
	}
	function moveByWin(tX, tY) {
		moveBy(tX, tY);
	}
	function getWinFocus() {
		window.focus();
	}
	function getScreenSize(){
		var sW = screen.availWidth;
		var sH = screen.availHeight;
		main.SetVariable("_screenX", sW);
		main.SetVariable("_screenY", sH);
	}
	function resizeCenWin(tW, tH){
		var tX = (screen.availWidth - tW)/2;
		var tY = (screen.availHeight - tH)/2;
		var tW = tW + 10;
		var tH = tH + 29;
		
		moveToWin(tX,tY);
		resizeToWin(tW,tH);
	}

function main_DoFSCommand(command, args) {
		if(command == "getScreenSize"){
			getScreenSize();
		}
		if(command == "openNewWindow"){
			var pos = args.split("|");
			var winName = String(pos[0]);
			var xpos = Number(pos[1]);
			var ypos = Number(pos[2]);
			window.open(winName,'','width=xpos, height=ypos, fullscreen=0');
		}
		if(command == "Offset"){
			var x_offset = window.pageXOffset;
			var y_offset = window.pageYOffset;
			main.SetVariable("x_offset", x_offset);
			main.SetVariable("y_offset", y_offset);
		}
		if(command == "moveTo") {
			var pos = args.split("|");
			var xpos = Number(pos[0]);
			var ypos = Number(pos[1]);
			moveToWin(xpos, ypos);
			}
		if(command == "move") {
			var pos = args.split("|");
			var xpos = Number(pos[0]);
			var ypos = Number(pos[1]);
			moveByWin(xpos,ypos);
			}
		if(command == "resize") {
			var pos = args.split("|");
			var width = Number(pos[0]);
			var height = Number(pos[1]);
			resizeToWin(width+10,height+29);
			}
		if(command == "resizeCenWin"){
			args_array = args.split("|");
			resizeCenWin(Number(args_array[0]),Number(args_array[1]));
		}
}
// Hook for Internet Explorer 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub main_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call main_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}