	<%
		////
		//// Setup variables for index
		////
	%>


	<%   /*Navigation*/   %>
	<ja:if exists="totalIndexes">
		<ja:if exists="nextIndexPage">
			var nextIndexPageUrl = "$nextIndexPage";
			var hasRealNextPage = true;
		</ja:if>
		<ja:else>
			var nextIndexPageUrl = "$firstIndexPage";
			var hasRealNextPage = false;
		</ja:else>
	</ja:if>
	<ja:else>
		var nextIndexPageUrl = null;
		var hasRealNextPage = false;
	</ja:else>

	<ja:if exists="totalIndexes">
		<ja:if exists="previousIndexPage">
			var prevIndexPageUrl = "$previousIndexPage";
			var hasRealPrevPage = true;
		</ja:if>
		<ja:else>
			var prevIndexPageUrl = "$lastIndexPage";
			var hasRealPrevPage = false;
		</ja:else>
	</ja:if>
	<ja:else>
		var prevIndexPageUrl = null;
		var hasRealPrevPage = false;
	</ja:else>

	var parentIndexPageUrl = null;
	<ja:if exists="parentIndexPage">parentIndexPageUrl = "$parentIndexPage";</ja:if>
	
	var firstIndexPageUrl = null;
	<ja:if exists="totalIndexes">firstIndexPageUrl = "$firstIndexPage";</ja:if>
	
	var lastIndexPageUrl = null;
	<ja:if exists="totalIndexes">lastIndexPageUrl = "$lastIndexPage";</ja:if>

	var isSlideShow = false;
	var hasMetaData = false;
	var hasNavigationHelpTips = <%= indexModel.isVariableValueEqual( Constants.USER_VAR_INCLUDE_NAVIGATION_HELP_TIPS, imageDirectory, true ); %>;


	<%   /*Used for page shadow*/   %>
	var emptyIconUrl = '$resPath/empty.gif';
	
	
	<%   /*Used at save protection feature*/   %>
	var saveProtectionMessage = '$text.alert-save-protection';


	<% /*OnLoad function*/ %>
	function pageSetup()
	{
		setupActiveElementHandler();

		<ja:if test="<%= indexModel.isVariableValueEqual( Constants.USER_VAR_INCLUDE_SAVE_PROTECTION, imageDirectory, true ) %>">
			initSaveProtection();
		</ja:if>

		<ja:if test="<%= indexModel.isVariableValueEqual( Constants.USER_VAR_INCLUDE_KEYBOARD_SUPPORT, imageDirectory, true ) %>">
			initKeyboard();
		</ja:if>

		initPageShadow();
	}
