<html>
<!--loginform-->
 <head>
  <title>ALF SSO Login</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript">

      function init() {
        document.LoginForm.authUID.focus();
        
        if(top != self) {//if the login page is in a frame, we need to reload the top
          top.location.reload();
        }
     }
    </script>
    
  <style type="text/css">
    body {
      background-color:#B4B1A0;;
      FONT-WEIGHT:normal;
      MARGIN:80px;
      color:black;
      font-family:Verdana;
      font-size:12;
    }
    .inputField
    {
      font-size:14;
      width:100%;
    }
    .inputButton
    {
      padding-top:5px;
      padding-bottom:5px;
      padding-left:10px;
      padding-right:10px;
      font-size:12;
    }
    .label
    {
      color:black;
      font-family:Verdana;
      font-size:12;
    }
    .heading
    {
      font-family:Verdana;
      font-size:16;
    }
    .wrapper
    {
      vertical-align:center;
      background-color:white;
      border: 3px groove #181818;
      text-align:middle;
      width:60%;
    }
    A 
    {
      font-size:12;
      text-decoration:none;
      color:#4D463B;
    }
    A.visited 
    {
      color:#4D463B;
    }
    A.notVisited 
    {
      color:#4D463B;
    }    
    A:hover, A.visited:hover, A.notVisited:hover 
    { 
      text-decoration:none;
      border-bottom:dashed 1px;
    }
    .err
    {
      color:Maroon;
      font-size:16;
    }
  </style>

</head>



<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="init();">      
  <center>
    <div class=wrapper>
      <center>
        <br><br>
        <img src="img/alf.gif" alt="Welcome to ALF" title="ALF Logo"><p>
        <span class="heading">Login</span><p></p>

<%
String authType = request.getAuthType();
if (authType == null) authType = new String();
if (authType.equals("NTLM") == false) {
	String errorMessage = (String) request.getAttribute("errorMessage");
	
	if (request.getAttribute("errorMessage") != null) {
		request.removeAttribute("errorMessage");
	}
%>
        <form name="LoginForm" method="POST" action="login" onsubmit="return doSubmit()">
          
          <table summary="" border="0" cellspacing="10" cellpadding="5" width="60%">
            <tr>
              <td align="left" class="label"><label for="authUID">User ID:</label></td>
              <td class="middle" width="100%"><input class="inputField" type="text" id="authUID" name="username" size="36" title="User name field">
              </td>
            </tr>
            <tr>
              <td align="left" class="label"><label for="authPWD">Password:</label></td>
              <td class="middle" width="100%"><input class="inputField" type="password" id="authPWD" name="password" size="36" title="Password field">
              </td>
            </tr>
            <tr>
              <td colspan="2" align="center" class="middle"><input class="inputButton" type="submit" name="Submit" value="login" title="Execute Login"></td>
            </tr>
            <tr>
              <td colspan="2" align="center" class="middle"><span class="err"></span></td>
            </tr>
            
<%
	if (errorMessage != null) {
%>
	<tr>
		<td colspan="2" align="center">
			<%=errorMessage%>
		</td>
	</tr>
	
<%	
	}
%>	             
          </table>
          
        </form>
        

<%} else { 
	request.getRequestDispatcher("/login").forward(request, response);
}
%>        

      </center>
    </div>
  </center>
</body>
</html>
