<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jspf/include/taglibs.jsp" %>



<tiles:insert definition="layout.main">
	
	
	<tiles:put name="body" type="String">
		
		<table align="center" width="100%" height="100%" border=0>
			<tr valign="middle">
				<td align="center" valign="middle"> 
					<form action="/auth.do" method="post">
					<input type="hidden" name="origQuery" value="<% if (request.getParameter("origQuery") != null) out.write( request.getParameter("origQuery") );   %>"/>
					<input type="hidden" name="submitted" value="true"/>
					
					
					<c:if test="${not empty error }">
								<div class="error">${error}</div>
					</c:if>

					<table border = 1 >
					
						<tr>
							<td>
								Логин
							</td>
							<td>
								<input type="text" name="login"  />
							</td>							
						</tr>
						
						<tr>
							<td >
								Пароль
							</td>
							<td>
								<input type="password" name="password" />
							</td>		
						</tr>

					<c:if test="${not empty realms}">
						<tr>
							<td> Скорость	</td>
							<td> 
									<select name="realm">
										<c:forEach items="${realms}" var="realm">
											<option value="${realm['realm']}">${realm['title']}</option>
										</c:forEach>
									</select>
							</td>
							
						</tr>
					</c:if>
						
						<tr>
							<td align="left" colspan="2">
								<input type="submit" value="Войти"/>
							</td>
						</tr>	

						<c:if test="${not empty securityLink}">
							<tr>
								<td colspan="2">
															
									<a href="${securityLink}">Безопасное соединение</a>
								</td>
							</tr>
						</c:if>
						
						<c:if test="${not empty cardLink}">
							<tr>
								<td colspan="2">															
									<a href="${cardLink}">Активация карты</a>
								</td>
							</tr>
						</c:if>
						
						<c:if test="${not empty remindPassword}">
							<tr>
								<td colspan="2">															
									<a href="/password.do">Забыли пароль?</a>
								</td>
							</tr>						
						</c:if>
						
						<c:if test="${not empty activateOperation}">
							<tr>
								<td colspan="2">															
									<a href="/auth/activate.do?method=${activateOperation}">Активация</a>
								</td>
							</tr>													
						</c:if>
						
						
					</table>
					</form>
				</td>
			</tr>

		</table>
	</tiles:put>
</tiles:insert>
	