<ja:include once page="bsh/vars.bsh">Code NOT Included</ja:include>
<ja:include once page="bsh/base.bsh">Code NOT Included</ja:include>
<ja:include once page="bsh/common.bsh">Code NOT Included</ja:include>
<ja:include once page="bsh/index.bsh">Code NOT Included</ja:include>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title><%= getAlbumPageTitlePrefix() + getDirectoryTitle(imageDirectory) %></title>

	<!-- Include Header Common Parts -->
	<ja:include page="includes/header.inc" />

	<ja:if test="<%= isVariableValueEqual( USER_VAR_INCLUDE_BLENDING_EFFECT_ON_INDEXES, imageDirectory, true ) %>">
		<!-- Blending/Fading effect -->
		<meta http-equiv="page-enter" content="blendTrans(Duration=0.5)">
		<meta http-equiv="page-exit" content="blendTrans(Duration=0.5)">
	</ja:if>

	<!-- Page Setup -->
	<script language="javascript" type="text/javascript">
		<ja:include page="includes/setup-index.js">JavaScript Code NOT Included</ja:include>
	</script>

	<ja:if test="<%= isVariableValueEqual( USER_VAR_INCLUDE_KEYBOARD_SUPPORT, imageDirectory, true ) %>">
		<!-- Keyboard & Navigation Support -->
		<script language="javascript" type="text/javascript" src="$resPath/js/keyboard.js"></script>
		<script language="javascript" type="text/javascript" src="$resPath/js/nav-index.js"></script>
	</ja:if>
</head>

<body id="body">
	<%
		String folderBackgroundPath = getFolderBackgroundPath();
	%>

	<ja:include page="includes/help.inc" />

	<!-- table for entire slide page -->
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="100%" height="100%">
				<!-- table for top path bar -->
				<ja:include page="includes/index-topbar.inc" />
			</td>
		</tr>
		<tr>
			<td>
				<!-- table of navigation icons and slide image -->
				<ja:if test="<%= folderBackgroundPath!=null %>">
					<table width="100%" border="0" cellspacing="0" cellpadding="0" background="<%= folderBackgroundPath %>">
						<tr>
							<td height="10"><img src="$resPath/empty.gif" alt=""/></td>
						</tr>
				</ja:if>
				<ja:else>
					<table class="pagebody" width="100%" border="0" cellspacing="0" cellpadding="0">
				</ja:else>
					<ja:if test="<%= hasTopNavigationBar() %>">
						<tr valign="top">
							<td width="100%">
								<ja:include page="includes/index-top-navigation.inc" />
							</td>
						</tr>
					</ja:if>

					<% String header = getHeaderContent(); %>
					<ja:if test="<%= header!=null && !header.trim().equals("") %>">
						<tr>
							<td align="center" valign="top">
								<p class="bppheader"><%= header %></p>
							</td>
						</tr>
					</ja:if>

					<tr>
						<td class="topruler"/>
					</tr>

					<tr>
						<td align="center">
							<!-- Start of the thumbnail images -->
							<!-- Iterate through images and produce an index table -->
							<%
								String cellSize = ((int)100/cols) + "%";
							%>
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<ja:rowiterator>
								<% List columnProperties = new ArrayList();	%>
								<tr>
								<ja:coliterator>
									<% File currentFile = getCurrentFile(); %>
									<ja:if test="<%= currentFile.isDirectory() %>">
										<td width="<%= cellSize %>" valign="middle" align="center">
											<% columnProperties.add( writeFolderThumbnail(currentFile) ); %>
										</td>
									</ja:if>
									<ja:else>
										<td width="<%= cellSize %>" valign="bottom" align="center">
											<% columnProperties.add( writeSlideThumbnail(currentFile) ); %>
										</td>
									</ja:else>
								</ja:coliterator>
								</tr>
								<% Iterator it = columnProperties.iterator(); %>
								<tr>
								<ja:coliterator>
									<% String[] props = (String[]) it.next(); %>

									<td align="center" valign="top" width="<%= cellSize %>">
										<table width="100%" border="0">
											<tr>
												<td width="10">&nbsp;</td>
												<td align="center" valign="top">
													<a href="<%= props[0] %>" class="note">
														<ja:if test="<%= props[3].equalsIgnoreCase("TYPE_FOLDER") %>">
															<strong><%= props[1] %></strong>
														</ja:if>
														<ja:else>
															<%= props[1] %>
														</ja:else>
													</a>

													<ja:if test="<%= props[2]!=null %>">
														<!-- Voice annotation -->
														<%= getActionBlock(props[2], null, "$text.download-sound", getIconSetPath(imageDirectory) + "/sound_small.gif", "align=\"middle\""); %>
													</ja:if>
												</td>
												<td width="10">&nbsp;</td>
											</tr>
										</table>
									</td>
								</ja:coliterator>
								</tr>
								<tr>
									<td height="30"/>
								</tr>
							</ja:rowiterator>
							</table>
						</td>
					</tr>

					<tr>
						<td class="bottomruler"/>
					</tr>

					<ja:if test="<%= totalIndexes==void || indexNum==1 %>">
						<% String voicePath = getFolderVoiceAnnotationPath(); %>
						<ja:if test="<%= voicePath!=null %>">
							<!-- Add and play voice annotations (only on first index page!) -->
							<tr>
								<td width="100%" align="center">
									<ja:if test="<%= isVariableValueEqual( USER_VAR_SHOW_AUDIO_CONSOLE, imageDirectory, true ) %>">
										<embed src="<%= voicePath %>" height="20" width="150" controls="console" autostart="true"></embed>
									</ja:if>
									<ja:else>
										<embed src="<%= voicePath %>" hidden="true" height="0" width="0" autostart="true"></embed>
									</ja:else>
								</td>
							</tr>
						</ja:if>
					</ja:if>

					<ja:if test="<%= hasBottomNavigationBar() %>">
						<tr valign="top">
							<td width="100%">
								<ja:include page="includes/index-bottom-navigation.inc" />
							</td>
						</tr>
					</ja:if>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<!-- Page footer -->
				<ja:include page="includes/footer.inc" />
			</td>
		</tr>
	</table>

	<script language="javascript" type="text/javascript">pageSetup();</script>
</body>
</html>