<% 
  // 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!
  // ****************************************************************************************************************

	if (slideShowDelay == void) slideShowDelay = 4;
	if (slideShowContinuous == void) slideShowContinuous = false;
  	if (iconSet == void) iconSet = "default";
	if (keyboardShortcuts == void) keyboardShortcuts = true;

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

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

// 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;
%>
<!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("orig_$firstPage") : out.print("#") ); else  out.print("orig_$nextPage");%>";
	var prevPageUrl = "<% if (imageNum == 1 ) ( (slideShowContinuous) ? out.print("orig_$lastPage") : out.print("#") ); else out.print("orig_$previousPage");%>";
	var indexPageUrl = "$closeupPath";
	var firstPageUrl = "orig_$firstPage";
	var lastPageUrl = "orig_$lastPage";
 	var zoomPageUrl = "<%="orig2_"+label+engine.getPageExtension()%>";
	var isSlideShow = true;
	-->
	</script>
	<script type="text/javascript" src="<%=resPath%>/keyboard.js">
	</script>
	<script type="text/javascript" src="<%=resPath%>/navslideorig.js">
	</script>
<%= out.print("</" + "head>") %>
<body onload="initPage();initKeyboard();">
</ja:if>
<ja:else>
<%= out.print("</" + "head>") %>
<body onload="initPage();">
</ja:else>

<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('orig_slideShow', 'true');
}
 
function moveOn() {
<%
if (nextPage != void || slideShowContinuous) {
	out.print("	document.location.href = \"");
	if (imageNum == totalImages )  out.print("orig_$firstPage"); else  out.print("orig_$nextPage");	
	out.print("#theSlide" + "\";");
}
%>
}
function stopSlideShow() {
	try {
		clearTimeout(timeout);
	} catch(e) {
	}
	saveCookie('orig_slideShow', '', -1);
}
 
var timeout = null;
function initPage() {
	if (readCookie('orig_slideShow') == 'true') {
	<ja:if test="<%=!(imageNum == totalImages) || slideShowContinuous %>">
		document.getElementById('navButtons').style.visibility="hidden";
		timeout = setTimeout('moveOn()', <%=slideShowDelay * 1000%>);
	</ja:if>
	<ja:else>
		saveCookie('orig_slideShow', '', -1);
		document.getElementById('navButtons').style.visibility="visible";
	</ja:else>
	}
}
-->
</script>

<div id="navButtons" style="position: absolute; left: 0; bottom: 0; visibility: hidden">
<ja:if test="<%=fullScreenButtons%>">
<script type="text/javascript">
	<!--
	if (readCookie('orig_slideShow') != 'true') {
		document.getElementById('navButtons').style.visibility="visible";
	}
	-->
</script>
<!-- First button -->
<ja:if exists="previousPage">
        <a href="orig_$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="orig_$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>$closeupPath</ja:else>"><img src="<%=resPath%>/<%=buttonSet%>/index.gif" alt="$text.goBack" title="$text.goBack" /></a>
 
<!-- Next button -->
<ja:if exists="nextPage">
	<a href="orig_$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="orig_$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>

<!-- Zoom button -->
<a href="<%="orig2_"+label+engine.getPageExtension()%>"><img src="<%=resPath%>/<%=buttonSet%>/zoom.gif" alt="$text.zoom" title="$text.zoom" /></a>
 
<!-- Slide show button -->
<ja:if test="<%=!(imageNum == totalImages) || slideShowContinuous %>">
	<script type="text/javascript">
	<!--
	if (readCookie('orig_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("orig_$firstPage"); else  out.print("orig_$nextPage");%>\"><img src=\"<%=resPath%>/<%=buttonSet%>/slideshowstart.gif\" alt=\"$text.startSlideShow\" title=\"$text.startSlideShow\" /></" + "a>");
	}
	-->
	</script>
</ja:if>
</ja:if>
</div>

<div> 
<a href="<ja:if test="<%=jumpDirectFullscreen%>">../$indexPage</ja:if><ja:else>$closeupPath</ja:else>"><img src="$originalPath" width="100%" alt="" /></a>
</div>
</body>
</html>

<%
	String originalPage2 = originalPath;	// Default if no extra template page
	File template = new File(skinDirectory, "originalslide2.htt");
	if (template.exists()) {
		originalPage2 = "orig2_"+label+engine.getPageExtension();
		engine.processTemplateFile(template, new File(outputDirectory,"slides/"+originalPage2), current);
	}
%>
