	<%	
		////
		//// Setup variables for slide (casual slide ones)
		////
	%>


	<%   /*Navigation*/   %>
	<ja:if test="<%= (imageNum == totalImages) %>">
		var nextPageUrl = "$firstPage";
		var hasRealNextPage = false;
	</ja:if>
	<ja:else>
		var nextPageUrl = "$nextPage";
		var hasRealNextPage = true;
	</ja:else>

	<ja:if test="<%= (imageNum == 1) %>">
		var prevPageUrl = "$lastPage";
		var hasRealPrevPage = false;
	</ja:if>
	<ja:else>
		var prevPageUrl = "$previousPage";
		var hasRealPrevPage = true;
	</ja:else>

	var upPageUrl = "../$indexPage";
	var firstPageUrl = "$firstPage";
	var lastPageUrl = "$lastPage";

	function doSlidesPreloading()
	{
		<ja:if exists="next">
			nextimagepreload = new Image();
			nextimagepreload.src = "<%= next.get("imagePath") %>";
		</ja:if>
		<ja:if exists="previous">
			previmagepreload = new Image();
			previmagepreload.src = "<%= previous.get("imagePath") %>";
		</ja:if>
	}
