	<%	
		////
		//// 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">
			var nextimagepreload = new Image();
			nextimagepreload.src = "<%= next.get("imagePath") %>";
		</ja:if>
		<ja:if exists="previous">
			var previmagepreload = new Image();
			previmagepreload.src = "<%= previous.get("imagePath") %>";
		</ja:if>
	}
