<%!
	// Display floating point numbers with two decimals
	import java.text.*;
	String formatNumber(double num) {
		NumberFormat formatter = new DecimalFormat("####0.##");
		return formatter.format(num);
	}

	void makeThumbLinks() {
		if (nThumbs == void) nThumbs = 5;	// Default
		int curr = imageNum-1;
		int start = 0;
		if (nThumbs < totalImages) {
			start = curr-nThumbs/2;
			if (start < 0) start = 0;
			else if (start+nThumbs >= totalImages) start = totalImages-nThumbs;
		}
		for (int i=start; (i<start+nThumbs) && (i<totalImages); i++) {
			Map vars = (Map)fileVariables.get(files[i]);
			out.println("<a href=\"" + vars.get("currentPage") + "\">" +
			 "<img border=0 src=\"" + vars.get("thumbPath") + "\"" +
			 " width=\"" +  vars.get("thumbWidth")/2.5 + "\" height=\"" + vars.get("thumbHeight")/2.5 + "\" vspace=\"2\"" +
			 "></a>");
		}

	}
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=$textEncoding" >
<title>$title/$label</title>
<link href="$stylePath" rel=stylesheet>
<meta name="Keywords" CONTENT="photo album,gallery,photo gallery,digital,photo,gallery,online">
</head>

<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" style="margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px;">
<ja:if test="<%=!printing.equals("none")%>"><ja:include page="printing.inc" /></ja:if>

<table class="nav" width="100%" cellspacing="6">
<tr>
	<td align="center"><ja:if exists="parentIndexPage"><a href="$parentIndexPage">&nbsp;&nbsp;Up&nbsp;&nbsp;</a></ja:if></td>
	<td align="center"><a href="$link1">&nbsp;&nbsp;$menu1&nbsp;&nbsp;</a></td>
	<td align="center"><a href="$link2">&nbsp;&nbsp;$menu2&nbsp;&nbsp;</a></td>
	<td align="center"><a href="$link3" >&nbsp;&nbsp;$menu3&nbsp;&nbsp;</a></td>
</tr></table>



	<small style="font-size: 7px;">&nbsp;</small>


	<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>

	<td><img src="$resPath/separator.gif" width="35" height="1" alt="" border="0"></td>	<td width="100%" height="43" valign="middle">

	<big><span class="header">$label</span></big><br><span class="subheader"><ja:if exists="comment">$comment</ja:if></span><br>
	</td>

	<td align="right" valign="middle">

	<ja:if test="$thumbsAbove">
		<nobr>	
		<% makeThumbLinks(); %>
		<br><small>
		<!-- Index button -->
		<a href="../$indexPage" title="Thumbnail page">Index</a>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<!-- Previous button -->
		<ja:if exists="previousPage"><a href="$previousPage" title="Previous page">Previous</a>
		</ja:if><ja:else>At first page</ja:else>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<!-- Next button -->
		<ja:if exists="nextPage"><a href="$nextPage" title="Next page">Next</a>
		</ja:if><ja:else>At last page</ja:else>
		</small>
		<br><br>
		</nobr>
	</ja:if>
	</td>
	<td><img src="$resPath/separator.gif" width="35" height="1" alt="" border="0"></td>
	</tr>
	</table>

<map name="ee_multiarea">
	<ja:if exists="previousPage">
		<area alt="Previous photo" coords="0,0,<%=imageWidth/3%>,<%=imageHeight%>" href="$previousPage" style="cursor: w-resize;">
	</ja:if>
	<ja:else>
		<area alt="At first photo" coords="0,0,<%=imageWidth/3%>,<%=imageHeight%>">
	</ja:else>
	<ja:if exists="nextPage">
		<area alt="Next photo" coords="<%=2*imageWidth/3%>,0,<%=imageWidth%>,<%=imageHeight%>" href="$nextPage" style="cursor: e-resize;">
	</ja:if>
	<ja:else>
		<area alt="At last photo" coords="<%=2*imageWidth/3%>,0,<%=imageWidth%>,<%=imageHeight%>">
	</ja:else>
	<area alt="Thumbnail page" coords="<%=imageWidth/3%>,0,<%=2*imageWidth/3%>,$imageHeight" href="../$indexPage" style="cursor: crosshair;">
	<area alt="" coords="0,0,<%=imageWidth%>,<%=imageHeight%>" nohref>
</map>


	<table border="0" cellspacing="0" cellpadding="0"  align="center"><tr>
	<tbody>
	<td><img src="$resPath/separator.gif" width="35" height="1" alt="" border="0"></td>	<td>

	<div align="center">

	<table border="0" cellspacing="0" cellpadding="0">
	<tbody>
		<tr>
			<td background="$resPath/t_l_corner.jpg"><img src="$resPath/fill.gif" alt="" border="0"></td>
			<td background="$resPath/top.jpg"><img src="$resPath/fill.gif" alt="" border="0"></td>
			<td background="$resPath/t_r_corner.jpg"><img src="$resPath/fill.gif" alt="" border="0"></td>
		</tr>
		<tr>
			<td background="$resPath/left.jpg"><img src="$resPath/fill.gif" alt="" border="0"></td>
			<td>
				<ja:if exists=originalPath>
					<a href="$originalPath">
						<img src="$imagePath" width="$imageWidth" height="$imageHeight" STYLE="border-color:#ffffff" usemap="#ee_multiarea" border=0 alt="Click for original image"></a>
				</ja:if>
				<ja:else>
					<img src="$imagePath" width="$imageWidth" height="$imageHeight" STYLE="border-color:#ffffff" title="" usemap="#ee_multiarea">
				</ja:else>

			</td>
			<td background="$resPath/right.jpg"><img src="$resPath/fill.gif" alt="" border="0"></td>
		</tr>
		<tr>
			<td background="$resPath/b_l_corner.jpg"><img src="$resPath/fill.gif" alt="" border="0"></td>
			<td background="$resPath/bottom.jpg"><img src="$resPath/fill.gif" alt="" border="0"></td>
			<td background="$resPath/b_r_corner.jpg"><img src="$resPath/fill.gif" alt="" border="0"></td>
		</tr>
	</tbody>
	</table>
	</div>

	<br>
	<ja:if exists="meta">
	<small>
	<ja:if test="<%=meta.get("Canon Makernote.Owner Name") != null%>"><b>PHOTOGRAPHER</b>: <%=meta.get("Canon Makernote.Owner Name")%><b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	</ja:if>
	<b>DATE:</b> $originalDate <b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	<b>CAMERA:</b> $cameraMake ($cameraModel) <b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	<b>RESOLUTION:</b> $resolution <b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	<b>FLASH:</b> $flash <b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	<b>FOCUS&nbsp;DISTANCE:</b> $focusDistance <b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	<b>EXPOSURE&nbsp;TIME:</b> $exposureTime <b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	<b>SHUTTER&nbsp;SPEED:</b> <%=meta.get("Shutter Speed Value")%> <b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	<b>METERING&nbsp;MODE:</b> $meteringMode <b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	<b>APERTURE:</b> $aperture <b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	<b>FOCAL&nbsp;LENGTH:</b> $focalLength <b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	<ja:if test="<%=meta.get("Canon Makernote.Exposure Mode") != null%>"><b>EXPOSURE&nbsp;MODE</b>: <%=meta.get("Canon Makernote.Exposure Mode")%><b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	</ja:if>
	<ja:if test="<%=meta.get("Canon Makernote.Iso") != null%>"><b>ISO&nbsp;SETTING</b>: <%=meta.get("Canon Makernote.Iso")%><b style="color: Silver;">&nbsp;&nbsp;|&nbsp;&nbsp;</b>
	</ja:if>

	 </small>
		<br><br>
	</ja:if>
	</td>

	<td><img src="$resPath/separator.gif" width="10" height="1" alt="" border="0"></td>	</tr><tr>
	<td><img src="$resPath/separator.gif" width="35" height="1" alt="" border="0"></td>	<td>

	<p>
	<ja:if exists="originalPath">
		<p><a href="$originalPath"><img border="0" src="$resPath/download.gif">Download original image</a> (<%=formatNumber(((float)fileSize)/1024/1024)%> MB)&nbsp;&nbsp;
	</ja:if>
	<!-- On-line image printing service integration -->
	<ja:if test="<%=!printing.equals("none") %>">
		<a href="javascript:submitOrderForm()" ><img src="$resPath/OrderPrints.gif" border="0" alt="Order printing and delivery of this image"> Order prints</a>
	</ja:if>
	</p>
	</td>
	<td><img src="$resPath/separator.gif" width="35" height="1" alt="" border="0"></td>	</tr>
	</tbody>
	</table>

	<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
	<td><img src="$resPath/separator.gif" width="35" height="1" alt="" border="0"></td>	<td valign="top">

		<br>
	<p>
	<ja:include page="footer.html"/>
	</p>
	<div class="generator">
	Generated by <a href="$generatorUrl" title="JAlbum - Freeware web photo album generator" target="_blank">$generator</a>
	&nbsp;&nbsp;Design inspired by <a href="http://photography-on-the.net">Exhibit Engine</a>
	</div>
	</td>
	<td>&nbsp;&nbsp;&nbsp;
	</td>
	<td align="right" valign="top">

	<ja:if test="$thumbsBelow">
		<nobr>
		<% makeThumbLinks(); %>
		<br><small>
		<!-- Index button -->
		<a href="../$indexPage" title="Thumbnail page">Index</a>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<!-- Previous button -->
		<ja:if exists="previousPage"><a href="$previousPage" title="Previous page">Previous</a>
		</ja:if><ja:else>At first page</ja:else>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<!-- Next button -->
		<ja:if exists="nextPage"><a href="$nextPage" title="Next page">Next</a>
		</ja:if><ja:else>At last page</ja:else>
		</small></nobr>
	</ja:if>
	</td>
	<td><img src="$resPath/separator.gif" width="35" height="1" alt="" border="0"></td>
	</tr>
	</table>

<ja:if test="false">	<!-- debug code turned off -->
<pre>
<ja:if exists="meta">
<%=meta%>
</ja:if>
</pre>
</ja:if>
</body>
</html>

