<?php

$flash_width = (isset($_GET["Width"]))? filter_var($_GET["Width"],FILTER_SANITIZE_STRING) : -1;	
$flash_height = (isset($_GET["Height"]))? filter_var($_GET["Height"],FILTER_SANITIZE_STRING) : -1;	

if (($flash_width<0)||($flash_height<0)) {
$pageContents = '';
} else {
$pageContents = <<< EOPAGE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" src="rotatetool.js"></script>

</head>

<body style="margin:0;padding:0;">

	<div id="flashborder" style="margin:0 auto;width=${flash_width}px;height=${flash_height}px;">
	  <div id="flashcontent"></div>
	</div>

	<script type="text/javascript">			
			var flashvars = {};
			flashvars.path = "";

			var params = {};
			params.scale = "noScale";
			params.salign = "lt";
			params.allowScriptAccess = "always";
			params.allowFullScreen = "true";

			var attributes = {};
			attributes.id = "myFlash";
			attributes.name = "myFlash";

			swfobject.embedSWF("rotateTool.swf", "flashcontent", "${flash_width}", "${flash_height}", "9.0.0","expressInstall.swf", flashvars, params, attributes);

			var jsParams    = {};
			jsParams.path   = "";
			jsParams.target = "flashcontent";
			jsParams.targetWidth  = "${flash_width}";
			jsParams.targetHeight = "${flash_height}";
			RotateTool.add(jsParams);
	</script>
</body>
</html>
EOPAGE;
}

echo $pageContents;

?>