<?ggf
/*
	Create the form in the HTML dialog box
*/
	form.addColorButton("textcolor","Text Color","#000000");
	form.addColorButton("bgcolor","Background Color","#ffffff");
	form.addCheckBox("borderless","Borderless Fullscreen",false);
	form.addCheckBox("showcontroller","Show QuickTime Controller",true);
	form.addCheckBox("usedevalvr",'Use <a href="http://www.devalvr.com/">DevalVR</a>',false);
	form.addLine();
	form.addText('Embed a mp3 file with <a href="http://musicplayer.sourceforge.net/">XSPF Web Music Player</a>.');
	form.addFileNameInput("soundfile","Embed Sound File","Sound File","MP3 (*.mp3)");
	form.addLineEdit("soundtitle","Sound Title");
	// 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("../common/p2q_embed_object.js","p2q_embed_object.js");
?>
		<script type="text/javascript" src="p2q_embed_object.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"]); ?>; 
			}
<?ggs if (formvalue["borderless"]=="true") {  ?>
			/* fullscreen */
			body {
				margin: 0px;
				overflow:hidden; /* disable scrollbars */
			}
<?ggs }  ?>
			html, body {
				height:100%;
				font-size: 10pt;
				background : <?ggs document.write(formvalue["bgcolor"]); ?>; 
			}
			h1 {
				font-size: 18pt;
			}
			h2 {
				font-size: 14pt;
			}
			.warning {
				font-weight: bold;
			}
		</style>	
	</head>
	<body>
		<script type="text/javascript">
<!--
			if ((window.p2q_Version) && (window.p2q_Version>=2.0)) {
				// Check to see if the version meets the requirements for playback
<?ggs
	if (formvalue["usedevalvr"]=="true") { 
		document.write("\t\t\t\tp2q_EmbedDevalVR('" + document.encodeUrlUtf8(outputfile) + "','100%','95%'");
		document.write(",'bgcolor','" + formvalue["bgcolor"] + "'");
		document.writeln(");");
	} else {
		document.write("\t\t\t\tp2q_EmbedQuicktime('" + document.encodeUrlUtf8(outputfile) + "','100%','95%'");
		document.write(",'bgcolor','" + formvalue["bgcolor"] + "'");
		document.write(",'scale','tofit'");
		document.write(",'controller','" + formvalue["showcontroller"] + "'");
		document.writeln(");");
	}
?>			
			} else {
				document.writeln('<p class="warning">p2q_embed_object.js is not included or it is too old! Please copy this file into your html directory.<\/p>');
			}	
//-->
		</script>
		<noscript>
			<p class="warning">Please enable Javascript!</p>
		</noscript>
<?ggs 
	if (formvalue["borderless"]=="false") {
?>
		<p align="center">
<?ggs
	// Embed a sound file
	if (formvalue["soundfile"]!="") {
		playerfile='xspf_player_slim.swf';
		playerwidth=400;
		playerheight=15;
		document.addfile("../3rdparty/xspf_player/" + playerfile,playerfile);
		// absolut path to the file
		soundfile=document.expandFilename(formvalue["soundfile"]);
		// extract just the name part
		id=soundfile.lastIndexOf('/');
		soundfilename=soundfile.substring(id+1);
		document.addfile(soundfile,soundfilename);
?>
		<script type="text/javascript">
<?ggs 
		parameter="song_url=" + document.encodeUrl(soundfilename);
		if (formvalue["soundtitle"]!="") {
			parameter+="&song_title=" + document.encodeUrl(formvalue["soundtitle"]);
		}
		parameter+="&autoplay=true";
		document.writeln("\t\t\tp2q_EmbedFlash('" + playerfile + "?" + parameter + "','" + playerwidth + "','" + playerheight + "');");
?>
		</script>
<?ggs 
		}
?>
			<a href="javascript:close();">close</a>
		</p>	
<?ggs 
	}
?>
	</body>
</html>
