<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:if test="${article.numPages gt 1}">
	<div id="pageNav">
		<c:choose>
			<c:when test="${articlePage.pageNumber == 1}">
				&laquo; previous
			</c:when>
			<c:otherwise>
				<a href="${articlePage.pageNumber - 1}">&laquo; previous</a>
			</c:otherwise>
		</c:choose>
		<c:forEach var="i" begin="1" end="${article.numPages}">
			|
			<c:choose>
				<c:when test="${i == articlePage.pageNumber}">
					<span class="selected">&laquo; ${i} &raquo;</span>
				</c:when>
				<c:otherwise>
					<a href="${i}">&nbsp;${i}&nbsp;</a>
				</c:otherwise>
			</c:choose>
		</c:forEach>
		|
		<c:choose>
			<c:when test="${articlePage.pageNumber == article.numPages}">
				next &raquo;
			</c:when>
			<c:otherwise>
				<a href="${articlePage.pageNumber + 1}">next &raquo;</a>
			</c:otherwise>
		</c:choose>
	</div>
</c:if>
