{include file="header.tpl"}

{literal}
<script type="text/javascript">
function checkform() {
  if (document.mainform.username.value=='') {
    alert("Please type your username!");
    document.mainform.username.focus();
    return false;
  }
  if (document.mainform.password.value=='') {
    alert("Please type your password!");
    document.mainform.password.focus();
    return false;
  }
  return true;
}
</script>
{/literal}

<h3>Login</h3>

{if $frm.display eq 'invalid_login'}
<div class="error">Your login or password{if $settings.use_turing} or turing image code{/if} is wrong. Please check this information.</div>
{/if}

<form method="post" name="mainform" onsubmit="return checkform()" action="">
<input type=hidden name="a" value="do_login">
<input type=hidden name="referrer" value="{$frm.referrer|escape:url}">
<table class="form">
<tr>
 <th>Username:</th>
 <td><input type="text" name="username" value="{$frm.username|escape:html}"></td>
</tr>
<tr>
 <th>Password:</th>
 <td><input type="password" name="password" value=""></td>
</tr>
{if $settings.use_turing}
<tr>
 <th><img src="{"?a=turing&`$sesname`=`$sesid`&r=`$rand`"|encurl}" alt="turing code"></th>
 <td><input type="text" name="turing"></td>
</tr>
{/if}
<tr>
 <th></th>
 <td><input type="submit" value="Login"></td>
</tr></table>
</form>
<a href="{"?a=forgot_password"|encurl}">Remind your login information</a>

{include file="footer.tpl"}
