<% 
  // ExhibitPlus V1.3 01.05.2004. Author: Mark Fyvie. Official site: http://www.fyvie.net/photos/info_exhibitplus.html

  // ****************************************************************************************************************
  // Please take note: If you plan to modify this skin, including modifications which may affect the resulting HTML:
  // 
  // The output from this skin has been authored as XHTML 1.0 - this is a very strict DOCTYPE.
  // 
  // Ensure that you do *NOT* use depreciated HTML elements, and that any modifications you make conform to XHTML 1.0
  // If you have modified the skin, please check your generated pages at validator.w3.org to ensure compliance!
  // ****************************************************************************************************************

// Allow variables to be overridden on a per folder basis (see below)
%>
<ja:include page = "variables.inc"></ja:include>
<%
	//Double check and initalise user variables if they are not present (e.g. running from command line, or if some problem  with onload.bsh) 
	if (protectSlideImages == void) protectSlideImages = false;
	if (displayW3CLogosOnSlide == void) displayW3CLogosOnSlide = true;
	if (sameSizeFilterIndex == void) sameSizeFilterIndex = false;
	if (numberOfMiniThumbs == void) numberOfMiniThumbs = 10;
	if (forceLandscapeSlideLayout == void) forceLandscapeSlideLayout = false;
	if (keyboardShortcuts == void) keyboardShortcuts = true;
	if (displayEXIF == void) displayEXIF = "always";
	if (polaroidMode == void) polaroidMode = false;
	if (imagePaddingAdjust == void) imagePaddingAdjust = 100;
	if (shutterfly == void) shutterfly = true;
	if (navigationTop == void) navigationTop = true;
	if (navigationBottom == void) navigationBottom = true;
	if (watermark == void) watermark = "";
	if (watermarkSize == void) watermarkSize = 20;
	if (commentAboveSlide == void) commentAboveSlide = false;
	if (slideShowDelay == void) slideShowDelay = 4;
	if (slideShowContinuous == void) slideShowContinuous = false;
	if (miniThumbAdjust == void) miniThumbAdjust = 25;
  	if (iconSet == void) iconSet = "default";

	buttonSet = (iconSet.equalsIgnoreCase("default") ? album.get("BUTTON_SET") : iconSet);

	if (resSubPath != void) resPath = resPath + "/" + resSubPath;

	import java.util.*;
	 
	float polaroidStretchFactor = 2.5;	// Not a user variable. If Polaroid mode is selected, this is the stretch factor for the bottom of the frame.
 
	// this function was taken from the JAlbum website
	// Strip non-numeric ending on strings and convert result to float
%>
<%!
	float numericPart(String s) {
	 int i;
	 for (i=0; i<s.length(); i++) {
	   char c = s.charAt(i);
	   if (!Character.isDigit(c) && c != '.') break;
	 }
	 return Float.parseFloat(s.substring(0,i));
	}
	 
	String stripFirstChar(String s) {
	 
	   return s.substring(1, s.length());
	}
	 
	// the following functions assume that the meta object exists.
	// this will ususally be the case, as this will only be called if it exists.
	double exifimageWidth() {
	 
	   // exif image width; complete string
	   String eiw = (String) meta.get("Exif Image Width");
	   StringTokenizer t = new StringTokenizer(eiw);
	     // exif image width; just the number
	   String imwStr = t.nextToken();
	     // the width in pixels; integer
	   double imw = Double.parseDouble(imwStr);
	 
	   return imw;
	}
	// the following functions assume that the meta object exists.
	// this will ususally be the case, as this will only be called if it exists.
	double exifimageHeight() {
	 
	   // exif image height; complete string
	   String eih = (String) meta.get("Exif Image Height");
	   StringTokenizer t = new StringTokenizer(eih);
	     // exif image height; just the number
	   String imhStr = t.nextToken();
	     // the height in pixels; integer
	   double imh = Double.parseDouble(imhStr);
	 
	   return imh;
	}
	// return the width of the ccd in mm
	double ccdWidth() {
	 
	   // assume meta exists.
	   String ccdxr = (String) meta.get("Focal Plane X Resolution");
	 
	   // the resolution is a string, containing a fraction
	   // [num]/[den] [unit]
	   // for Canon camera's, [unit] is "inches".
	   // Are there any camera's whose unit is "mm"?
	 
	   StringTokenizer t = new StringTokenizer(ccdxr);
	 
	   // decode the resolution string
	   String numStr = t.nextToken("/");
	   String denStr = stripFirstChar (t.nextToken(" "));
	   String untStr = t.nextToken();
	 
	   double num = Double.parseDouble(numStr);
	   double den = Double.parseDouble(denStr);
	             double w;
	 
	   // convert from inches to mm, if needed.
	   // this is experimental
	   if (untStr.equals("mm")) {
	       w = (double) (num / den * exifimageWidth());
	       out.println("mm");
	   } else {
	       w = (double) (num / den * 25.4 * exifimageWidth());
	   }
	 
	   return w;
	}
	// return the height of the ccd in mm
	double ccdHeight() {
 
	   // assume meta exists.
	   String ccdyr = (String) meta.get("Focal Plane Y Resolution");

 	   // the resolution is a string, containing a fraction
	   // [num]/[den] [unit]
	   // for Canon camera's, [unit] is "inches".
	   // Are there any camera's whose unit is "mm"?
	 
	   StringTokenizer t = new StringTokenizer(ccdyr);
	 
	   // decode the resolution string
	   String numStr = t.nextToken("/");
	   String denStr = stripFirstChar (t.nextToken(" "));
	   String untStr = t.nextToken();
	 
	   double num = Double.parseDouble(numStr);
	   double den = Double.parseDouble(denStr);
	             double h;
	 
	   // convert from inches to mm, if needed.
	   // this is experimental
	   if (untStr.equals("mm")) {
	       h = (double) (num / den * exifimageHeight());
	       out.println("mm");
	   } else {
	       h = (double) (num / den * 25.4 * exifimageHeight());
	   }
 
	   return h;
	}
	// inspired by code taken from the scriptlet website
	int focus35mm() {
	   // problem: if image is already rotated, the ccdWidth will return the
	   //          actual ccdHeight and render the calculation invalid
	   // solution: take height if height > width
	  if(exifimageHeight() > exifimageWidth()) {
	     return (int)(numericPart(focalLength) * 35.0 / ccdWidth() + 0.5);
  	  } else {
	     return (int)(numericPart(focalLength) * 35.0 / ccdWidth() + 0.5);
	  }
	} 
	// 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() {
		int nThumbs = numberOfMiniThumbs; // Default
		if (nthumbs != void) nThumbs = nthumbs;
		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;
		}

		thumbStyle = ( (portraitMode) ? " style=\"display: block\u003b padding-bottom: 2px\u003b \"" : "" );
		for (int i=start; (i<start+nThumbs) && (i<totalImages); i++) {
			Map vars = (Map)fileVariables.get(files[i]);
			if ( sameSizeFilterIndex ) {
			out.println("<a href=\"" + vars.get("currentPage") + "\">" + "<img src=\"" + vars.get("thumbPath") + "\"" + " class=\"minithumb" + ((i == curr)? "Current" : "") + "\"" + " width=\"" +  (int)(vars.get("maxThumbWidth")*((float)miniThumbAdjust/100)) + "\" height=\"" + (int)(vars.get("maxThumbHeight")*((float)miniThumbAdjust/100)) + "\"" + " alt=\"" + vars.get("label") + "\"" + thumbStyle + " title=\"" + vars.get("label") + "\" /></a>");
			} else {
			out.println("<a href=\"" + vars.get("currentPage") + "\">" + "<img src=\"" + vars.get("thumbPath") + "\"" + " class=\"minithumb" + ((i == curr)? "Current" : "") + "\"" + ( portraitMode ? "" : "") + " width=\"" +  (int)(vars.get("thumbWidth")*((float)miniThumbAdjust/100)) + "\" height=\"" + (int)(vars.get("thumbHeight")*((float)miniThumbAdjust/100)) + "\"" + " alt=\"" + vars.get("label") + "\"" + thumbStyle + " title=\"" + vars.get("label") + "\" /></a>");
			}
 		}
	}
%>

<%
	// This routine calculates values to be used later for the padding around the image.It allows for dynamic image sizes, and adjusts the and dimensions automatically
 
	imageDiagonal = Math.sqrt(imageWidth * imageWidth + imageHeight * imageHeight); // Calculate the hypotenuse of the image, this is used for further calculations
	int imagePadding = ((imageDiagonal / 33)*((float)imagePaddingAdjust/100));        // How much padding will we need around the image? It changes according to the size of the image and can also be adjusted via user variable
	if (polaroidMode) {
		imagePaddingBottom = (int)(imagePadding * polaroidStretchFactor); 	// We stretch out the bottom to make the polaroid effect (if selected)
	} else {
		imagePaddingBottom = imagePadding; 				// Because Polaroid mode is not used, all the padding around the edges will be equal
	}
	int imageFrameWidth = imageWidth + (2 * imagePadding) -1;   // We need to setup the background image for the right size under the padded edges
	int imageFrameHeight = imageHeight + (imagePadding + imagePaddingBottom) -1;	// We need to setup the background image for the right size under the padded edges 
%>

<%
	// This routine will determine if the slide is in landscape or portrait mode
	
	portraitMode = false; // Initialise the variable
	landscapeMode = true; // Initialise the variable
	if ( imageHeight > imageWidth ) portraitMode = true;
	if ( forceLandscapeSlideLayout ) portraitMode = false; // User override
	if ( portraitMode ) landscapeMode = false; // makes the syntax easier later on...
%>
<%
	// If a text file with the same name as an image exists, use the contents of this for the image comment instead
  	import se.datadosen.util.*;
  	File cFile = new File(imageDirectory, label+".txt");
  	if (cFile.exists()) {
  	  Map captions = IO.readMapFile(cFile);
  	  String text = (String)captions.get("comment");
  	  if (text != null && text.length()> 0) comment = text;
  	}
%>
<ja:if exists="originalPath">
<%
	String originalPage = originalPath;	// Default if no extra template page
	File template = new File(skinDirectory, "originalslide.htt");
	if (template.exists()) {
		originalPage = "orig_"+label+engine.getPageExtension();
		engine.processTemplateFile(template, new File(outputDirectory,"slides/"+originalPage), current);
	}
%>
</ja:if>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$textEncoding" />
<meta name="Keywords" content="photo album,gallery,photo gallery,digital,photo,gallery,online,exhibitplus_v_onepointthree" />
<title>$label</title>
<link href="<%=resPath%>/basestyle.css" rel="stylesheet" />
<link href="<%=resPath%>/$style" rel="stylesheet" />
<!-- Include styles.inc from root image directory if present -->
<ja:include page="$rootPath/styles.inc"></ja:include>
<ja:if test="<%=keyboardShortcuts%>">
	<script type="text/javascript">
	<!-- 
	var nextPageUrl = "<% if (imageNum == totalImages ) ( (slideShowContinuous) ? out.print("$firstPage") : out.print("#") ); else  out.print("$nextPage");%>";
	var prevPageUrl = "<% if (imageNum == 1 ) ( (slideShowContinuous) ? out.print("$lastPage") : out.print("#") ); else out.print("$previousPage");%>";
	var indexPageUrl = "../" + "$indexPage";
	var firstPageUrl = "$firstPage";
	var lastPageUrl = "$lastPage";
 	var zoomPageUrl = "<ja:if exists="originalPath"><%=originalPage%></ja:if><ja:else>#</ja:else>";
	var isSlideShow = true;
	-->
	</script>
	<script type="text/javascript" src="<%=resPath%>/keyboard.js">
	</script>
	<script type="text/javascript" src="<%=resPath%>/navslide.js">
	</script>
<%= out.print("</" + "head>") %>
<body onload="initPage();initKeyboard();">
</ja:if>
<ja:else>
<%= out.print("</" + "head>") %>
<body onload="initPage();">
</ja:else>

<ja:if exists="next">			
	<script type="text/javascript">
	<!--
		next_image = new Image();
		next_image.src = "<%= next.get("imagePath")%>";
	-->
	</script>
</ja:if>

<!-- Include header.inc from root image directory if present -->
<ja:include page="$rootPath/header.inc"></ja:include>
 
<ja:if test="<%=shutterfly%>"><ja:include page="shutterfly_xhtml.inc" /></ja:if>
 
<ja:if test="<%= displayEXIF.equalsIgnoreCase("userselect") %>">
	<!-- EXIF INFO SCRIPT -->
	<script type="text/javascript">
	<!--
	showing = false;
	function toggleEXIFInfo() {
		if (showing == false) {
			if (document.all || document.getElementById)
				document.getElementById('photoDataPopup').style.visibility="visible";	
			<ja:if test="<%=keyboardShortcuts%>">
				document.getElementById('keyboardDataPopup').style.visibility="hidden";	
			showingKeyboard = false;
			</ja:if>
			showing = true;
		} else {
			if (document.all || document.getElementById)
				document.getElementById('photoDataPopup').style.visibility="hidden";
			showing = false;
		}	
	}
	-->
	</script>
</ja:if>

<ja:if test="<%=keyboardShortcuts%>">
	<!-- KEYBOARD INFO SCRIPT -->
	<script type="text/javascript">
	<!--
	showingKeyboard = false;
	function toggleKeyboardInfo() {
		if (showingKeyboard == false) {
			if (document.all || document.getElementById)
				document.getElementById('keyboardDataPopup').style.visibility="visible";
			<ja:if exists="flash"><ja:if test="<%= displayEXIF.equalsIgnoreCase("userselect") %>">
				document.getElementById('photoDataPopup').style.visibility="hidden";
			showing = false;
			</ja:if></ja:if>
			showingKeyboard = true;
		} else {
			if (document.all || document.getElementById)
				document.getElementById('keyboardDataPopup').style.visibility="hidden";
			showingKeyboard = false;
		}	
	}
	-->
	</script>
</ja:if>
 
<ja:if test="<%=protectSlideImages%>">
	<script type="text/javascript">
	<!--
	var message="$text.noRightClick"; // Message for the alert box 
	function click(e) { 
		if (document.all) { 
			if (event.button == 2) { 
				alert(message); 
				return false; 
			} 
		} 
		if (document.layers) { 
			if (e.which == 3) { 
				alert(message); 
				return false; 
			} 
		} 
	} 
	if (document.layers) { 
		document.captureEvents(Event.MOUSEDOWN); 
	} 
	document.onmousedown=click;
	-->
	</script>
</ja:if>
 
<script type="text/javascript">
<!--
function saveCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000))
		var expires = "; expires="+date.toGMTString()
	}
	else expires = ""
	document.cookie = name+"="+value+expires+"; path=/"
}
function readCookie(name) {
	var nameEQ = name + "="
	var ca = document.cookie.split(';')
	for(var i=0;i<ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length)
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length)
	}
	return '';
}
function setSlideShowCookie() {
	saveCookie('slideShow', 'true');
}
 
function moveOn() {
<%
if (nextPage != void || slideShowContinuous) {
	out.print("	document.location.href = \"");
	if (imageNum == totalImages )  out.print("$firstPage"); else  out.print("$nextPage");	
	out.print("#theSlide" + "\";");
}
%>
}
function stopSlideShow() {
	try {
		clearTimeout(timeout);
	} catch(e) {
	}
	saveCookie('slideShow', '', -1);
}
 
var timeout = null;
function initPage() {
	if (readCookie('slideShow') == 'true') {
	<ja:if test="<%=((imageNum == totalImages) && !(slideShowContinuous)) %>">
			saveCookie('slideShow', '', -1);
	</ja:if>
	<ja:else>
		timeout = setTimeout('moveOn()', <%=slideShowDelay * 1000%>);
	</ja:else>
	}
}
-->
</script>

<div><map name="ee_multiarea" id="ee_multiarea">
	<ja:if exists="previousPage">
		<area alt="Previous photo" title="Previous photo" shape="rect" coords="0,0,<%=imageWidth/3%>,<%=imageHeight%>" href="$previousPage" style="cursor: w-resize;" />
	</ja:if>
	<ja:else>
		<area alt="At first photo" title="At first photo" shape="rect" coords="0,0,<%=imageWidth/3%>,<%=imageHeight%>" />
	</ja:else>
	<ja:if exists="nextPage">
		<area alt="Next photo" title="Next photo" shape="rect" coords="<%=2*imageWidth/3%>,0,<%=imageWidth%>,<%=imageHeight%>" href="$nextPage" style="cursor: e-resize;" />
	</ja:if>
	<ja:else>
		<area alt="At last photo" title="At last photo" shape="rect" coords="<%=2*imageWidth/3%>,0,<%=imageWidth%>,<%=imageHeight%>" />
	</ja:else>
	<ja:if exists="originalPath">
		<area alt="View full size image" title="View full size image" shape="rect" coords="<%=imageWidth/3%>,0,<%=2*imageWidth/3%>,<%= imageHeight %>" href="<%=originalPage%>" style="cursor: crosshair;" />
	</ja:if>
	<ja:else>
		<area alt="Thumbnail page" title="Thumbnail page" shape="rect" coords="<%=imageWidth/3%>,0,<%=2*imageWidth/3%>,<%= imageHeight %>" href="../$indexPage" style="cursor: crosshair;" />
	</ja:else>
</map></div>

<!-- Cut here for nav stuff (begin) -->
 
<div id="centercontent">

<ja:if test="<%=( (navigationTop || portraitMode) && ( navigationTop || navigationBottom ) )%>">

<ja:if test="<%=landscapeMode%>"><div class="minithumbBox"><% makeThumbLinks(); %></div></ja:if>
<ja:if test="<%=portraitMode%>"><div id="buttonbox_portrait"></ja:if>
<!-- First button -->
<ja:if exists="previousPage">
        <a href="$firstPage"><img src="<%=resPath%>/<%=buttonSet%>/first.gif" alt="$text.firstPage" title="$text.firstPage" /></a>
	  <ja:if test="<%=portraitMode%>"><br /></ja:if>
</ja:if>
<ja:else>
	<img src="<%=resPath%>/<%=buttonSet%>/first_disabled.gif" alt="$text.atFirstPage" title="$text.atFirstPage" />
	<ja:if test="<%=portraitMode%>"><br /></ja:if>
</ja:else>
 
<!-- Previous button -->
<ja:if exists="previousPage">
	<a href="$previousPage"><img src="<%=resPath%>/<%=buttonSet%>/previous.gif" alt="$text.previousPage" title="$text.previousPage" /></a>
	<ja:if test="<%=portraitMode%>"><br /></ja:if>
</ja:if>
<ja:else>
	<img src="<%=resPath%>/<%=buttonSet%>/previous_disabled.gif" alt="$text.atLastPage" title="$text.atLastPage" />
	<ja:if test="<%=portraitMode%>"><br /></ja:if>
</ja:else>
 
<!-- Index button -->
<a href="../$indexPage"><img src="<%=resPath%>/<%=buttonSet%>/index.gif" alt="$text.indexPage" title="$text.indexPage" /></a>
<ja:if test="<%=portraitMode%>"><br /></ja:if>
 
<!-- Next button -->
<ja:if exists="nextPage">
	<a href="$nextPage"><img src="<%=resPath%>/<%=buttonSet%>/next.gif" alt="$text.nextPage" title="$text.nextPage" /></a>
	<ja:if test="<%=portraitMode%>"><br /></ja:if>
</ja:if>
<ja:else>
	<img src="<%=resPath%>/<%=buttonSet%>/next_disabled.gif" alt="$text.atLastPage" title="$text.atLastPage" />
	<ja:if test="<%=portraitMode%>"><br /></ja:if>
</ja:else>
 
<!-- Last button -->
<ja:if exists="nextPage">
        <a href="$lastPage"><img src="<%=resPath%>/<%=buttonSet%>/last.gif" alt="$text.lastPage" title="$text.lastPage" /></a>
	  <ja:if test="<%=portraitMode%>"><br /></ja:if>
</ja:if>
<ja:else>
	<img src="<%=resPath%>/<%=buttonSet%>/last_disabled.gif" alt="$text.atLastPage" title="$text.atLastPage" />
	<ja:if test="<%=portraitMode%>"><br /></ja:if>
</ja:else>
 
<!-- Slide show button -->

<ja:if test="<%=!(imageNum == totalImages) || slideShowContinuous %>">
	<script type="text/javascript">
	<!--
	if (readCookie('slideShow') == 'true') {
		document.write("	<a onclick=\"stopSlideShow(); document.location.reload(false); return false;\" href=\"#\"><img src=\"<%=resPath%>/<%=buttonSet%>/slideshowstop.gif\" alt=\"$text.stopSlideShow\" title=\"$text.stopSlideShow\" /></" + "a>");
	} else {
		document.write("	<a onclick=\"setSlideShowCookie();\" href=\"<% if (imageNum == totalImages )  out.print("$firstPage"); else  out.print("$nextPage");%>\"><img src=\"<%=resPath%>/<%=buttonSet%>/slideshowstart.gif\" alt=\"$text.startSlideShow\" title=\"$text.startSlideShow\"/></" + "a>");
	}
	-->
	</script>
	<ja:if test="<%=portraitMode%>"><br /></ja:if>
</ja:if>

<ja:if test="<%=portraitMode%>"></div></ja:if>
<ja:else>
<br /><span class="photoName">$label &nbsp;</span><span class="photoPosition">[$imageNum $text.of $totalImages]</span><br />
 
<br /><br />
<!-- Cut here for nav stuff (end) -->

</ja:else>
</ja:if>

<ja:if test="<%=commentAboveSlide%>"><div class="photoComments" style="position: relative; top: -5px"><ja:if test="<%=(comment != void)%>"><%=comment%></ja:if></div></ja:if>

<ja:if test="<%=portraitMode%>"><div id="photonavbar_inside_portrait"><div class="minithumbBox"><% makeThumbLinks(); %></div></div></ja:if>
 
<div id ="frame" style="width: <%=imageFrameWidth%>px">
	<div id="toolTipAnchor"></div>
	<div class="slideFrameButtons" style="top: <%=imageFrameHeight-23%>px">
 
		<!-- Add a download link to the original image if appropriate -->
		<ja:if exists="originalPath">
			<a href="$originalPath"><img src="<%=resPath%>/download.gif" style="float: right" alt="$text.downloadOriginalImage (<%=formatNumber(((float)fileSize)/1024/1024)%> $text.MB)" title="$text.downloadOriginalImage (<%=formatNumber(((float)fileSize)/1024/1024)%> $text.MB)" /></a>
		</ja:if>
 
		<ja:if test="<%=shutterfly%>">
			<!-- Add a link to order prints online -->
			<a onclick="stopSlideShow();" href="javascript:submitOrderForm()"><img src="<%=resPath%>/orderprints.gif" style="float: right" alt="$text.orderPrint" title="$text.orderPrint" /></a>
		</ja:if>

		<ja:if exists="flash"><ja:if test="<%= displayEXIF.equalsIgnoreCase("userselect") %>">
			<!-- EXIF Button -->
			<a href="javascript:toggleEXIFInfo()"><img src="<%=resPath%>/info.gif" style="float: right" alt="$text.showEXIF" title="$text.showEXIF" /></a>
		</ja:if></ja:if>

		<ja:if test="<%=keyboardShortcuts%>">
			<!-- Add a help button to explain keyboard shortcuts -->
			<a href="javascript:toggleKeyboardInfo()"><img src="<%=resPath%>/help.gif" style="float: right" alt="$text.showKeyboard" title="$text.showKeyboard" /></a>
			<div id="keyboardDataPopup" class="keyboardDataPopup">
				$text.keyboard1<ja:if exists="flash"><ja:if test="<%= displayEXIF.equalsIgnoreCase("userselect") %>">$text.keyboard2</ja:if></ja:if><ja:if exists="originalPath">$text.keyboard3</ja:if>
			</div>
		</ja:if>
	</div>
	<a id="theSlide"></a>
	<ja:if test="<%=portraitMode%>"><span class="photoName" style="position: absolute; top: 3px; width: <%=imageFrameWidth%>px; z-index:3; text-align: center">$label &nbsp;<span class="photoPosition">[$imageNum $text.of $totalImages]</span></span></ja:if>

	<img src="$imagePath" width="<%= imageWidth %>" height="<%= imageHeight %>" alt="" style="margin-left: <%=imagePadding%>px; margin-right: <%=imagePadding%>px; margin-top: <%=imagePadding%>px; margin-bottom: <%=imagePaddingBottom-2%>px" usemap="#ee_multiarea" />
</div>
 
<ja:if test="<%=displayW3CLogosOnSlide%>"><ja:if test="<%=portraitMode%>">
	<div style="position: absolute; top: <%=imageFrameHeight-8%>px;"> 
		<a href="http://validator.w3.org/check/referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a>		
		<a href="http://jigsaw.w3.org/css-validator/check/referer"><img style="position: relative; bottom: 67px; display: block" src="http://jigsaw.w3.org/css-validator/images/vcss.gif" alt="valid CSS!" /></a>
	</div>
</ja:if></ja:if>

<ja:if test="<%=!commentAboveSlide%>"><div class="photoComments"><ja:if test="<%=(comment != void)%>"><%=comment%></ja:if></div></ja:if>
<br />
<ja:if exists="flash"><ja:if test="<%= !displayEXIF.equalsIgnoreCase("never") %>">

<% String sep = "<i>&nbsp\u003b|&nbsp\u003b</i>"; %>

<ja:if test="<%= displayEXIF.equalsIgnoreCase("always") %>">
	<div class="photoData">
</ja:if>
<ja:else>
	<div id="photoDataPopupBase" class="photoDataPopupBase">
	<div id="photoDataPopup" class="photoDataPopup">
</ja:else>
	<b>$text.date:</b> $originalDate
	<ja:if exists="cameraMake"><%=sep%> <b>$text.camera:</b> $cameraMake<ja:if exists="cameraModel"> ($cameraModel)</ja:if></ja:if>
	<ja:if exists="resolution"><%=sep%> <b>$text.resolution:</b> $resolution</ja:if>
    	<ja:if exists="focalLength">
		<% 
		// If you wish to manually enter a correction factor for your camera(s) copy, paste and adjust the following line as required
		if (cameraModel.equals("Canon DIGITAL IXUS v3")) adjustedFocalLength = (int)(numericPart(focalLength) * 6.48148 + 0.5); 
		%>
 
		<ja:if test="<%=meta.get("Focal Plane X Resolution") != null && meta.get("Exif Image Width") != null && meta.get("Focal Plane Y Resolution") != null && meta.get("Exif Image Height") != null%>">
		<%=sep%> <b>$text.35mmFocalLength:</b> <%= focus35mm() %>mm

		</ja:if>
		<ja:else>
			<ja:if test="<%= adjustedFocalLength != void %>"> 
				<%=sep%> <b>$text.35mmFocalLength:</b> <%= adjustedFocalLength %>mm
			</ja:if>
			<ja:else>
				<%=sep%> <b>$text.nativeFocalLength:</b> $focalLength
			</ja:else>
		</ja:else>
	</ja:if>

	<%
		// The array called metaArray (below) is loaded with pairs of values. The first entry in the pair is the name of the meta field name to query.
		// The second entry in the pair is the variable name to check in the texts.properties (or local language version) in order to display the field
		// name to the user.
		String[] metaArray = {"Artist", "artist", "Flash", "flash", "Exposure Time", "exposureTime", "Metering Mode", "meteringMode", "Exposure Mode", "exposureMode", "White Balance Mode", "whiteBalanceMode", "Aperture Value", "aperture", "Canon Makernote.Iso", "ISOSetting", "Iptc.Headline", "iptc.headline", "Iptc.Keywords", "iptc.keywords", "Iptc.By-line", "iptc.authorName", "Iptc.By-line Title", "iptc.authorTitle", "Iptc.Object Name", "iptc.objectName", "Iptc.Special Instructions", "iptc.specialInstructions", "Iptc.Category", "iptc.category", "Iptc.Urgency", "iptc.urgency", "Iptc.Supplemental Category(s)", "iptc.subCategories", "Iptc.City", "iptc.city", "Iptc.Province/State", "iptc.province", "Iptc.Country/Primary Location", "iptc.country", "Iptc.Original Transmission Reference", "iptc.reference", "Iptc.Credit", "iptc.credit", "Iptc.Source", "iptc.source", "Iptc.Copyright Notice", "iptc.copyright", "Iptc.Writer", "iptc.writer"};
		for (int i=0;i<metaArray.length;i=i+2) {
			if ( meta.get(metaArray[i]) != null ) {
     				out.println(sep + " <b>" + texts.getString(metaArray[i+1]) + ":</b> " + meta.get(metaArray[i]) + " ");
			}
		}
	%>

	</div> 
<ja:if test="<%= displayEXIF.equalsIgnoreCase("userselect") %>"></div></ja:if>
<ja:else><br /></ja:else>
</ja:if></ja:if>
 
<ja:if test="<%=navigationBottom%>"><ja:if test="<%=landscapeMode%>">
<!-- Cut here for nav stuff (begin) -->
 
<div class="minithumbBox"><% makeThumbLinks(); %></div>

<div>
<ja:if test="<%=navigationTop%>"></ja:if><ja:else><div class="photoName">$label &nbsp;</div><div class="photoPosition">[$imageNum of $totalImages]</div><div style="clear: left"></div></ja:else>

<!-- First button -->
<ja:if exists="previousPage">
        <a href="$firstPage"><img src="<%=resPath%>/<%=buttonSet%>/first.gif" alt="$text.firstPage" title="$text.firstPage" /></a>
</ja:if>
<ja:else>
	<img src="<%=resPath%>/<%=buttonSet%>/first_disabled.gif" alt="$text.atFirstPage" title="$text.atFirstPage" />
</ja:else>
 
<!-- Previous button -->
<ja:if exists="previousPage">
	<a href="$previousPage"><img src="<%=resPath%>/<%=buttonSet%>/previous.gif" alt="$text.previousPage" title="$text.previousPage" /></a>
</ja:if>
<ja:else>
	<img src="<%=resPath%>/<%=buttonSet%>/previous_disabled.gif" alt="$text.atFirstPage" title="$text.atFirstPage" />
</ja:else>
 
<!-- Index button -->
<a href="../$indexPage"><img src="<%=resPath%>/<%=buttonSet%>/index.gif" alt="$text.indexPage" title="$text.indexPage" /></a>
 
<!-- Next button -->
<ja:if exists="nextPage">
	<a href="$nextPage"><img src="<%=resPath%>/<%=buttonSet%>/next.gif" alt="$text.nextPage" title="$text.nextPage" /></a>
</ja:if>
<ja:else>
	<img src="<%=resPath%>/<%=buttonSet%>/next_disabled.gif" alt="$text.atLastPage" title="$text.atLastPage" />
</ja:else>
 
<!-- Last button -->
<ja:if exists="nextPage">
        <a href="$lastPage"><img src="<%=resPath%>/<%=buttonSet%>/last.gif" alt="$text.lastPage" title="$text.lastPage" /></a>
</ja:if>
<ja:else>
	<img src="<%=resPath%>/<%=buttonSet%>/last_disabled.gif" alt="$text.atLastPage" title="$text.atLastPage" />
</ja:else>
 
<!-- Slide show button -->

<ja:if test="<%=!(imageNum == totalImages) || slideShowContinuous %>">
	<script type="text/javascript">
	<!--
	if (readCookie('slideShow') == 'true') {
		document.write("	<a onclick=\"stopSlideShow(); document.location.reload(false); return false;\" href=\"#\"><img src=\"<%=resPath%>/<%=buttonSet%>/slideshowstop.gif\" alt=\"$text.stopSlideShow\" title=\"$text.stopSlideShow\" /></" + "a>");
	} else {
		document.write("	<a onclick=\"setSlideShowCookie();\" href=\"<% if (imageNum == totalImages )  out.print("$firstPage"); else  out.print("$nextPage");%>\"><img src=\"<%=resPath%>/<%=buttonSet%>/slideshowstart.gif\" alt=\"$text.startSlideShow\" title=\"$text.startSlideShow\"/></" + "a>");
	}
	-->
	</script>
</ja:if></div></ja:if>
 
<!-- Cut here for nav stuff (end) -->
<br /><br />
</ja:if>
 
<!-- Include footer.inc from image directory if present -->
<ja:include page="$rootPath/footer.inc"><br /></ja:include>
 
<ja:if test="<%=displayW3CLogosOnSlide%>"><ja:if test="<%=landscapeMode%>">
	<div id="w3clogosleft"> 
		<a href="http://validator.w3.org/check/referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a>		
		<a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="http://jigsaw.w3.org/css-validator/images/vcss.gif" alt="valid CSS!" /></a>
	</div>
</ja:if></ja:if>
</div>
</body>
</html>
