<%!
	
	int getNThumbs() {
		return nThumbs == void ? 7 : nThumbs;
	}

	String relPage(int rel) {
		int i = imageNum-1+rel;
		if (i<0) i = 0;
		if (i>=files.length) i = files.length-1;
		Map vars = (Map)fileVariables.get(files[i]);
		return vars.get("currentPage");
	}

	void makeThumbLinks() {
		nThumbs = getNThumbs();
		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++) {
//			out.print(i + " ");
			Map vars = (Map)fileVariables.get(files[i]);
			out.println("<td align=\"center\" height=\"68\"><a href=\"" + vars.get("currentPage") + "\">" +
			 "<img border=0 src=\"" + vars.get("thumbPath") + "\"" +
			 " width=\"" + thumbWidth/2 + "\" height=\"" +thumbHeight/2 + "\" vspace=\"2\"" +
			 " alt=\"\"></a></td>");
		}

	}
%>
<!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=$textEncoding">
<title>wedding</title>
<link href="$stylePath" rel="stylesheet" type="text/css">
</head>

<body>
<table border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td><img width=190 height=1 src="$resPath/dot.gif" alt=""></td>
		<td>
			<table border=0 cellpadding=0 cellspacing=0>
        <tr>
          <td height=30></td>
        </tr>
        <tr>
          <td colspan=3><table width="100%" border=0 align="center">
              <tr>
                <td align="right" valign="middle"><a href="<%=relPage(-getNThumbs())%>"><img border=0 src="$resPath/prev.gif" alt="$text.previousSet" width="38" height="29"></a></td>
                <%=makeThumbLinks() %>
                <td align="left" valign="middle"><a href="<%=relPage(getNThumbs())%>"><img border=0 src="$resPath/next.gif" alt="$text.nextSet" width="38" height="29"></a></td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td height=5 colspan=3></td>
        </tr>
        <tr>
          <td colspan=3><table width="100%" border=0 cellpadding=0 cellspacing=0>
              <tr>
                <td align="left"><img src="$resPath/ornament_left.gif" width=34 height=22 alt="Previous"></td>
                <td align="right"><img src="$resPath/ornament_right.gif" width=34 height=22 alt="Next"></td>
              </tr>
              <tr>
                <td bgcolor="#B7B7B7" height="1" colspan="2"></td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td height=10 colspan=3></td>
        </tr>
        <tr>
        	<td colspan=3><table cellpadding=0 cellspacing=0><tr>
          <td valign="middle">

			<ja:if exists="previousPage">
				<a href="$previousPage">
			</ja:if>
			<ja:else>
				<a href="$lastPage">
			</ja:else>
			<img src="$resPath/prev.gif" alt="$text.previousPage" width="38" height="29" border=0></a>

          </td>
          <td valign="top">
          	<ja:if exists=originalPath><a target="_blank" title="$text.originalImage" href="$originalPath"></ja:if>
          <img src="$imagePath" width="$imageWidth" height="$imageHeight" border=0 alt="$label"><ja:if exists=originalPath></a></ja:if>
          
          </td>
          <td valign="middle">

			<ja:if exists="nextPage">
				<a href="$nextPage">
			</ja:if>
			<ja:else>
				<a href="$firstPage">
			</ja:else>
			<img src="$resPath/next.gif" alt="$text.nextPage" width="38" height="29" border=0></a>

          </td>
          </tr></table></td>
        </tr>
        <tr>
          <td height=10 colspan=3></td>
        </tr>
        <tr>
          <td></td>
          <td align="center"><span class="text">$imageNum/$totalImages</span></td>
          <td></td>
        </tr>
<ja:if exists="comment">
        <tr>
          <td></td>
          <td height=1 bgcolor="#666666"></td>
          <td></td>
        </tr>
        <tr>
          <td></td>
          <td class="textBig">$comment</td>
          <td></td>
        </tr>
        <tr>
          <td></td>
          <td height=1 bgcolor="#666666"></td>
          <td></td>
        </tr>
</ja:if>
        <tr>
			<td colspan=3 align="center"><a href="../$indexPage"><img src="$resPath/back.gif" border=0 alt="$text.indexPage"></a></td>
 		</tr>
 	  </table>
	</tr>
</table>

&nbsp;<span class="textSmall"><a target="_blank" href="$generatorUrl">$generator</a> | Lantz Design | Sponsor <a target="_blank" title="$text.sponsorToolTip" href="http://www.casinoeuro.com/?from=jalbum&amp;skin=Wedding">CE</a></span>

</body>
</html>
