<%-- 
  ExhibitPlus V1.4a 25.10.2005. Author: Mark Fyvie. Official site: http://exhibitplus.fyvie.net

  ****************************************************************************************************************
  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 (fullScreenButtons == void) fullScreenButtons = true;
	if (jumpDirectFullscreen == void) jumpDirectFullscreen = false;
	if (iconSet == void) iconSet = "default";

	import java.util.*;
  	import se.datadosen.util.*;

	// We save the label variable to fName, because we may change the label value using various config files
	fName = label;
	// Now check to see if the user wants to use a different label for their photo by checking for an entry in titles.properties, or a text file named with the same name as the filename

      // If meta.properties exists in the image directory and contains
      // a description of the folder, display it with the variable descript.
      File propsFile = new File(imageDirectory, "titles.properties");
      if (propsFile.exists()) {
        Map props = IO.readMapFile(propsFile);
        String newTitle = props.get(fileName);
        if (newTitle != null && newTitle.length() >0) label = newTitle;
	} 

	// If a text file with the same name as an image exists, use the contents of this for the image comment and/or label instead
  	File cFile = new File(imageDirectory, fName+".txt");
  	if (cFile.exists()) {
  	  Map captions = IO.readMapFile(cFile);
  	  String text = (String)captions.get("comment");
  	  if (text != null && text.length()> 0) comment = text;
  	  String text = (String)captions.get("title");
  	  if (text != null && text.length()> 0) label = text;
  	}

	if (keyboardShortcuts == void) keyboardShortcuts = true;
	if (resSubPath != void) resPath = resPath + "/" + resSubPath;
	buttonSet = (iconSet.equalsIgnoreCase("default") ? album.get("BUTTON_SET") : iconSet);
%>
<!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="$language">
<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_onepointfour" />
<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 indexPageUrl = "orig_$closeupPath";
	var firstPageUrl = "orig2_$firstPage";
	var lastPageUrl = "orig2_$lastPage";
	var zoomPageUrl = "orig_$closeupPath";
	var isSlideShow = false;
	-->
	</script>
	<script type="text/javascript" src="${resPath}/keyboard.js">
	</script>
	<script type="text/javascript" src="${resPath}/navslideorig2.js">
	</script>
<%= out.print("</" + "head>") %>
<body onload="initKeyboard();">
</ja:if>
<ja:else>
<%= out.print("</" + "head>") %>
<body>
</ja:else>

<ja:if test="${fullScreenButtons}">

<div style="position: absolute; left: 0px; bottom: 20px">
<!-- First button -->
<ja:if exists="previousPage">
        <a href="orig2_$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="orig2_$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="<ja:if test="${jumpDirectFullscreen}">../$indexPage</ja:if><ja:else>orig_$closeupPath</ja:else>"><img src="${resPath}/${buttonSet}/index.gif" alt="$text.indexPage" title="$text.indexPage" /></a>
 
<!-- Next button -->
<ja:if exists="nextPage">
	<a href="orig2_$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="orig2_$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>

</div>
</ja:if>

<div> 

<a href="orig_$closeupPath"><img src="$originalPath" width="$originalWidth" height="$originalHeight" alt="$text.backToFullScreenView" title="$text.backToFullScreenView" /></a>
</div>
</body>
</html>