{include file="header.tpl.html" extra_title="Request a Password"}

<br /><br />
{literal}
<script language="JavaScript">
<!--
function validateForm(f)
{
    if (isWhitespace(f.email.value)) {
        alert('{/literal}{t escape=js}Please enter your account email address.{/t}{literal}');
        selectField(f, 'email');
        return false;
    }
    return true;
}
//-->
</script>
{/literal}
{if not $result}
{capture assign="note_message"}
{t}Note: Please enter your email address below and a new random password will be created and assigned to your account. For security purposes a confirmation message will be sent to your email address and after confirming it the new password will be then activated and sent to you.{/t}
{/capture}
{include file="yellow_note.tpl.html" content=$note_message}
{/if}
<br />
<form name="email_form" onSubmit="javascript:return validateForm(this);" method="post" action="{$smarty.server.PHP_SELF}">
<input type="hidden" name="cat" value="reset_password">
<table align="center" width="500" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
  <tr>
    <td>
      <table bgcolor="#006486" width="100%" border="0" cellspacing="0" cellpadding="4">
        <tr>
          <td colspan="2" align="center">
            <h2 style="color: white;">{t}Request a Password{/t}</h2>
            <hr size="1" noshade color="white">
          </td>
        </tr>
        {if $result != 0}
        <tr>
          <td colspan="2" align="center" class="error">
            <b>
            {if $result == -1}
              {t}Error: An error occurred while trying to run your query.{/t}
            {elseif $result == 1}
              {t}Thank you, a confirmation message was just emailed to you. Please follow the instructions available in this message to confirm your password creation request.{/t}
            {elseif $result == 3}
              {t}Error: Your user status is currently set as inactive. Please
              contact your local system administrator for further information.{/t}
            {elseif $result == 4}
             {t} Error: Please provide your email address.{/t}
            {elseif $result == 5}
              {t}Error: No user account was found matching the entered email address.{/t}
            {/if}
            </b>
          </td>
        </tr>
        {else}
        <tr>
          <td align="right" width="40%" class="default_white"><b>{t}Email Address:{/t}</b></td>
          <td width="60%">
            <input accessKey="e" class="default" type="text" name="email" value="{$email|default:$smarty.get.email|escape:"html"}" size="30" maxlength="100">
            {include file="error_icon.tpl.html" field="email"}
          </td>
        </tr>
        <tr align="center">
          <td colspan="2">
            <input type="submit" name="Submit" value="{t}Send New Password{/t}" class="button">
          </td>
        </tr>
        {/if}
        <tr align="center">
          <td colspan="2" class="default_white">
            <a class="white_link" href="index.php">{t}Back to Login Form{/t}</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</form>
{literal}
<script language="JavaScript">
<!--
window.onload = setFocus;
function setFocus()
{
    if (document.email_form.email) {
        document.email_form.email.focus();
    }
}
//-->
</script>
{/literal}

{include file="footer.tpl.html"}