<?ggf
/*
	Create the form in the HTML dialog box
*/
	form.addColorButton("textcolor","Text Color","#000000");
	form.addColorButton("bgcolor","Background Color","#ffffff");
	form.addLine();
	form.addCheckBox("showuserdata","Show User Data Table",true);
	form.addColorButton("tablebordercolor","Table Border Color","#777777");
	form.addColorButton("tabletextcolor","Table Text Color","#000000");
	form.addColorButton("tablebgcolor","Table Background Color","#dddddd");
	form.addLine();
	form.addText('Create the necessary code to embed a panoramic video.');
	form.addFileNameInput("videofile","Panorama Video File","Panorama Video File","Flash Video (*.flv *.f4v *.mp4)");
	form.addLine();
	form.addText('Advanced Options:');
	form.addCheckBox("parseanchor","Direct node access",false);
	form.addCheckBox("externalinterface","Enable JavaScript Interface",false);
	
	// define possible output formats
	form.addOutputFormat("HTML (.html)","html");
	form.addOutputFormat("HTML (.htm)","htm");
	
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
		<title><?ggs document.writeEncoded(document.expandVariables(config.userdata.title)); ?></title>
<?ggs
	document.addfile("../3rdparty/swfobject/swfobject.js","swfobject.js");
?>
		<script type="text/javascript" src="swfobject.js">
		</script>
		<style type="text/css" title="Default">
			body, div, h1, h2, h3, span, p {
				font-family: Verdana,Arial,Helvetica,sans-serif;
				color: <?ggs document.write(formvalue["textcolor"]); ?>; 
			}
			body {
			  font-size: 10pt;
			  background : <?ggs document.write(formvalue["bgcolor"]); ?>; 
			}
			table,tr,td {
				font-size: 10pt;
				border-color : <?ggs document.write(formvalue["tablebordercolor"]); ?>;
				background : <?ggs document.write(formvalue["tablebgcolor"]); ?>; 
				color: <?ggs document.write(formvalue["tabletextcolor"]); ?>; 
				border-style : solid;
				border-width : 1px;
			}
			h1 {
				font-size: 18pt;
			}
			h2 {
				font-size: 14pt;
			}
			.warning {
				font-weight: bold;
			}
		</style>	
	</head>
	<body>
		<h1><?ggs document.writeEncoded(document.expandVariables(config.userdata.title)); ?></h1>
		<p>
		<script type="text/javascript">
<!--
<?ggs if (formvalue["parseanchor"]=="true") {  ?>
			var startNode=document.location.hash.substring(1);
	
			if (("onhashchange" in window) && (!(/MSIE (\d+\.\d+);/.test(navigator.userAgent)))) {
				window.onhashchange = function () {
					pano.openNext('{' + window.location.hash.substring(1) + '}');
				}
			} else {
				var lastHash = window.location.hash;
				window.setInterval(function () {
					if (window.location.hash != lastHash) {
						lastHash = window.location.hash;
						pano.openNext('{' + window.location.hash.substring(1) + '}');
					}
				}, 100);
			}
<?ggs } ?>	
			var flashvars = {};
			var params = {};
<?ggs
	var flashversion=output.version;
	if (flashversion<8) flashversion=8;
	
	if (formvalue["videofile"]!="") {
		// absolut path to the file
		videofile=document.expandFilename(formvalue["videofile"]);
		// extract just the name part
		id=videofile.lastIndexOf('/');
		videofilename=videofile.substring(id+1);
		document.addfile(videofile,videofilename);
?>
			video='<video url="<?ggs document.write(document.encodeUrl(videofilename)); ?>"/>';
			flashvars.video=escape(video);
<?ggs }  ?>
<?ggs if (formvalue["parseanchor"]=="true") {  ?>
			if (startNode.length>0) {
				flashvars.startnode=startNode;
			}
<?ggs }  ?>
<?ggs
	if ((formvalue["externalinterface"]=="true") || (formvalue["parseanchor"]=="true")) {
?>
				// enable javascript interface
				flashvars.externalinterface="1";
<?ggs
	}	
	if (formvalue["_gg_panorama"]) {
			panostr=formvalue["_gg_panorama"].toString();
			panostr=panostr.split("'").join("&#39;"); // workaround for .replace
			panostr=panostr.split("\n").join("';\n\t\t\tpanorama+='");
?>
				// embedded panorama data 
			panorama='<?ggs document.write(panostr); ?>';
			flashvars.panorama=escape(panorama);
<?ggs
	}	
	if (formvalue["_gg_skin"]) {
			skinstr=formvalue["_gg_skin"].toString();
			skinstr=skinstr.split("'").join("&#39;"); // workaround for .replace
			skinstr=skinstr.split("\n").join("';\n\t\t\tskin+='");
?>
				// embedded skin data 
			skin='<?ggs document.write(skinstr); ?>';
			flashvars.skin=escape(skin);
<?ggs
	}
?>
			params.quality = "high";
			params.bgcolor = "<?ggs document.write(formvalue["bgcolor"]); ?>";
			params.allowscriptaccess = "sameDomain";
			params.allowfullscreen = "true";
			params.base="<?ggs document.write(outputbase); ?>";
			var attributes = {};
			attributes.id = "pano";
			attributes.name = "pano";
			attributes.align = "middle";
			swfobject.embedSWF(
				"<?ggs document.write(document.encodeUrlUtf8(outputfile)); ?>", "flashContent", 
				"<?ggs document.write(output.windowWidth); ?>", "<?ggs document.write(output.windowHeight); ?>", 
				"9.0.0", "expressInstall.swf", 
				flashvars, params, attributes);

//-->
		</script>
		<div id="flashContent">
			<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
		</div>
<?ggs
	if (formvalue["showuserdata"]=="true") { 
?>		
		<p>
		<table cellpadding="5" cellspacing="0">
			<tr>
				<td><b>Description</b></td>
				<td><?ggs document.writeEncoded(document.expandVariables(config.userdata.description)); ?></td>
			</tr>
			<tr>
				<td><b>Author</b></td>
				<td><?ggs document.writeEncoded(document.expandVariables(config.userdata.author)); ?></td>
			</tr>
			<tr>
				<td><b>Date/Time</b></td>
				<td><?ggs document.writeEncoded(document.expandVariables(config.userdata.dateTime)); ?></td>
			</tr>
			<tr>
				<td><b>Copyright</b></td>
				<td><?ggs document.writeEncoded(document.expandVariables(config.userdata.copyright)); ?></td>
			</tr>
		</table>
		</p>	
<?ggs
}
?>
	</body>
</html>
