1<%
2String safeJs(String in) {
3	return in.replaceAll("'", "\\\\\'");
4}
5String userName = licenseManager.getUserName();
6String license = licenseManager.getLicenseCode();
7
8String usingMusic = "";
9if (musicUrl.startsWith("file:")) {
10	URL realURL = new URL(musicUrl);
11	File src = new File(URLDecoder.decode(realURL.getFile(), "UTF-8"));
12	File dest = new File(resDirectory, src.getName());
13	IO.copyFile(src, dest);
14	usingMusic = IO.combinePaths(resPath, dest.getName());
15}
16else {
17	usingMusic = musicUrl;
18}
19int bc = Integer.parseInt(backgroundColor.substring(1), 16);
20
21%>
22<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
23<html xmlns="http://www.w3.org/1999/xhtml">
24	<head>
25		<meta http-equiv="content-type" content="text/html; charset=${textEncoding}" />
26		<title>${title}</title>
27		<script type="text/javascript" src="${rootPath}/res/swfobject.js"></script>
28		<style type="text/css">
29		html { height: 100%; overflow: hidden; }
30		body { height: 100%; color:#<%= Integer.toHexString(bc^0xffffff) %>; margin: 0; padding: 0; background-color: <%= backgroundColor %>;  }
31		u { z-index: 1; }
32		div.top { padding: 8px; }
33		p.bottom { padding: 8px; }
34		div.seothumbs div { float:left; margin:10px; }
35		div.br { clear: both; }
36		a:link { color: #5050ff; }
37		a:visited { color: #1010af; }
38		a:active { color: #eeeeff; }
39		a:hover { color: #ffffff; }
40		</style>
41		<script type="text/javascript">
42		var widgetHeight = 0;
43		var lastWidgetHeight = -1;
44		function makeRoomForWidget() {
45			if (widgetHeight > 0) {
46				var e = document.getElementById("u");
47				if (e != null) {
48					e.height = (document.documentElement.clientHeight - (widgetHeight + 2)) + "px";
49				}
50			}
51		}
52		function checkWidget() {
53			var w = document.getElementById('jalbumwidgetcontainer');
54			if (w != null) {
55				widgetHeight = w.offsetHeight;
56				makeRoomForWidget();
57			}
58		}
59		window.onresize = makeRoomForWidget;
60		window.onload = function() {
61			makeRoomForWidget();
62			setInterval(checkWidget, 150);
63		}
64		</script>
65		</head>
66	<body>
67		<div id="u">
68			<div class="top">
69				<h1><%= albumTitle %></h1>
70				<p><%= albumDescription %></p>
71			</div>
72			<div class="seothumbs">
73			<ja:fileiterator>
74				<div><a href="<%= imagePath %>" title="<%= comment %>"><img src="<%= thumbPath %>" width="<%= thumbWidth %>" height="<%= thumbHeight %>" alt="<%= label %>" border="0" /></a><br /><a href="<%= imagePath %>" title="<%= comment %>"><%= label %></a></div>
75			</ja:fileiterator>
76			</div>
77			<div class="br"></div>
78			<ja:if exists="promotion">
79			<p class="bottom">${promotion}</p>
80			</ja:if>
81		</div>
82		<script type="text/javascript">
83		swfobject.embedSWF("${rootPath}/res/mrburns.swf", "u", "100%", "100%", "10.0.0", null, {
84			registeredTo:'<%= safeJs(userName) %>',
85			registrationKey:'<%= safeJs(license) %>',
86			hasFullscreen:'<%= hasFullscreen %>',
87			bkgColor:'<%= backgroundColor %>',
88			musicUrl:'<%= safeJs(usingMusic)  %>',
89			frameRate:'<%= frameRate  %>',
90			preloadAim:'<%= preloadAim  %>',
91			inOutBias:'<%= inOutBias  %>',
92			zoomDrama:'<%= zoomDrama  %>',
93			appearTime:'<%= appearTime  %>',
94			hangTime:'<%= hangTime  %>',
95			removeTime:'<%= removeTime  %>',
96			skipAllowed:'<%= skipAllowed  %>',
97			autostart:'<%= autostart  %>',
98			hideControlPanel:'<%= hideControlPanel %>',
99			musicPrebufferTime:'<%= musicPrebufferTime %>',
100			textFullscreen:'<%= safeJs(texts.getString("ui.flash.fullscreen")) %>',
101			textAbout:'<%= safeJs(texts.getString("ui.flash.about")) %>',
102			textShowing:'<%= safeJs(texts.getString("ui.flash.showing")) %>',
103			rssSource:'<%= rssSource %>',
104			baseUrl:''
105		}, {
106			wmode:'<%= wmode %>',
107			bgcolor:'<%= backgroundColor %>',
108			quality:'<%= quality %>',
109			allowfullscreen:'true'
110		});
111		</script>
112	</body>
113</html>
114