
function LostPasswordSubmit()
  {
    var userbox = docElem('LostPasswordUsername');
    var val = trim(userbox.value);

    if (!val.length)
      {
        alert('Please enter your login name, postcode or email address');
        userbox.focus();
        return false;
      }

    var args = new Array();
    args['Userstring'] = val;

    kjax('ResetPassword', args, 'LostPasswordSubmitOK', 'LostPasswordSubmitFAIL');
  }


function LostPasswordSubmitOK(result)
  {
    var userbox = docElem('LostPasswordUsername');
    if (result['Success'] < 1)
      {
        alert(result['Reason']);
        userbox.focus();
        return false;
      }

    //alert('Your new password has been emailed to your main account address');
    docElem('PasswordForm').style.display = 'none';
    docElem('Thankyoubox').style.display = 'inline';
  }


function LostPasswordSubmitFAIL(result)
  { alert('Sorry, there was a problem: '+result['error']); }