<%@ page import="java.lang.*" %>
<%
String msg   = "";
int    errno = 0;

String baseurl = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
	

if (request.getParameter("error") != null)
{
	try {
		errno = Integer.parseInt(request.getParameter("error"));
	} catch (Exception e) {
		errno = 0x1001;
	}
}

switch (errno)
{
	// Errors - 0x1...
	case 1001: msg = "Ongeldige gebruikersnaam of wachtwoord.";
				break;
	case 1002: msg = "Vul alle parameters in a.u.b.";
				break;
	case 1003: msg = "Het nieuwe en nieuwe bevestigde wachtwoord zijn niet hetzelfde. Probeer opnieuw.";
				break;
	case 1004: msg = "Uw sessie is niet meer geldig. Log opnieuw in.";
				 session.invalidate();
				break;
}
%>
<!DOCTYPE html>
<html>
	<head>
		<title>Inloggen</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link href="<%=baseurl%>css/login.css" type="text/css" rel="stylesheet">
		<link rel="shortcut icon" href="favicon.ico" />
	</head>
	<body>
		<div id="wrapper">
			<form name="my" action="cheyenne?cddid=main&cmode=kpwindow" method="post" id="login">
	             <div class="modal-header">
	             	<h1>EASE</h1>
	             	<h2>Inloggen</h2>
	             </div>
	             <div class="modal-body">
		             <!--<a href="#" id="logo"> spacer </a>-->
		             <% if (!msg.equals("")) { %>
			         	<div class="alert alert-error"><%=msg%></div>
			         <% } %>
			         <p>
			         	<label for="username">Gebruikersnaam</label>
			            <input type="text" id="username" name="username" class="textfield"/>
			         </p>
			         <p>
			         	<label for="credentials">Wachtwoord</label>
			            <input type="password" id="credentials" name="credentials" class="textfield" size="20" />
					</p>
				    <p>
			        	<input type="submit" name="Submit" value="Inloggen" class="btn submit">
					</p>
				</div>
			    <div class="pwreset">
					<a href="jsp/pwreset.jsp">Wachtwoord vergeten?</a>
				</div>
			</form>
			<div id="footer">EASE powered by <a href="http://buildersenperformers.nl/">buildersENperformers.nl</a></div>
		</div>
	</body>
</html>
