﻿function sendForgottenPassword(email) {
    Ext.Msg.buttonText.ok = 'OK';
    Ext.Msg.wait('Sending...', 'Please wait...');
    Ext.Ajax.request({
        url: 'forgot.ashx',
        params: { type: 'sendEmail', 'email': email },
        success: function(result) {
            if (Ext.decode(result.responseText).success)
                Ext.Msg.alert('Information', 'Your login information was successfully sent on ' + email + '.');
            else {
                Ext.Msg.alert('Error', 'Cannot send the email.');
            }
        },
        failure: function() { Ext.Msg.alert('Error', 'Cannot send the email.'); }
    });
}
