  [% META title = 'User &raquo; Change password' -%]

    [% # PROCESS dumper.tt dump = form_validator %]

    [% js_change_pwd_dfv_js %]

    [% IF REMOVE_ME.form_validator.has_error %]
        [% FOREACH key IN form_validator.error %]
            [% FOREACH type IN form_validator.error(key) %]
            <p>error message:[% type %] - [% key %]</p>
            [% END %]
        [% END %]
    [% END %]

    <script language="JavaScript" type="text/JavaScript">
        function capLock(e){
            kc = e.keyCode?e.keyCode:e.which;
            sk = e.shiftKey?e.shiftKey:((kc == 16)?true:false);
            if(((kc >= 65 && kc <= 90) && !sk)||((kc >= 97 && kc <= 122) && sk))
                document.getElementById('divMayus').style.visibility = 'visible';
            else
                document.getElementById('divMayus').style.visibility = 'hidden';
        }
    </script>

	<h2 align="center">Change password</h2>

    [% PROCESS site/form_validator.tt profile = 'user' %]
    [% IF c.param('id') %]
        <p class="warning">
            If this is your 1st login, you will need to change your password.
            Minimum new password length is 5 characters. 
        </p>
    [% END %]
    
    <form method="post" action="[% app_url %]/user/do_change_password"
        [% js_change_pwd_onsubmit %] name="change_pwd" id="change_pwd">
		<div class="indent">
		<table>
			<tr>
				<td class="label">Old password:</td>
				<td class="content">
					<input type="password" size="20" name="old_password" [% site.html.onfocus %]
                        value="[% c.param('id') || c.query.param('old_password') %]"
                        onkeypress="capLock(event)" />
                    [% site.html.invalid IF form_validator.error('old_password') %]
				</td>
			</tr>
			<tr>
				<td class="label">New password:</td>
				<td class="content">
					<input type="password" size="20" name="new_password" value="[% c.query.param('new_password') %]"
                        [% site.html.onfocus %] onkeypress="capLock(event)" />
                    [% site.html.invalid IF form_validator.error('new_password') %]
				</td>
			</tr>
			<tr>
				<td class="label">Confirm new password:</td>
				<td class="content">
					<input type="password" size="20" name="new_password_confirm"
                        value="[% c.query.param('new_password_confirm') %]" [% site.html.onfocus %]
                        onkeypress="capLock(event)" />
                    [% site.html.invalid IF form_validator.error('new_password_confirm') %]
				</td>
			</tr>
            <tr>
                <td colspan="2" align="center" class="borderless">
					[% site.html.submit %]
				</td>
            </tr>
        </table>
		</div>
    </form>

    <p id="divMayus" style="visibility: hidden; color: #f00">WARNING: CAPS LOCK IS ON</p>

