$(document).ready(function(){$("#forgot_email").validate({rules:{'data[User][username]':{required:true}},messages:js_vars.errorMessages.User,errorLabelContainer:$('div#forgot_email_error')});$("#forgot_password").validate({rules:{'data[User][email]':{required:true,email:true}},messages:js_vars.errorMessages.User,errorLabelContainer:$('div#forgot_password_error')});$('#forgot_email button.submit').click(function(){$(this).parents('form').submit();return false;});$('#forgot_password button.submit').click(function(){$(this).parents('form').submit();return false;});$('#forgot_email').submit(function(){if(!$('#forgot_email').valid()){return false;}
var handle_response_forgot_email=function(response){if(!response.success){$('#forgot_email_error').html(response.error_html).show();}else{document.getElementById("forgotPassword").className="widget box container";$('#box-header').replaceWith('<h2>'+"Your Email Address"+'</h2><br />');$('#box-body').replaceWith('<br />'+response.message+'<br /><br />');}}
$.post($('#forgot_email').attr('action'),$('#forgot_email').serialize(),handle_response_forgot_email,'json');return false;});$('#forgot_password').submit(function(){if(!$('#forgot_password').valid()){return false;}
var handle_response_forgot_password=function(response){if(!response.success){$('#forgot_password_error').html(response.error_html).show();}else{document.getElementById("forgotPassword").className="widget box container";$('#box-header').replaceWith('<h2>'+"Complete Password Reset"+'</h2><br />');$('#box-body').replaceWith('<br />'+response.message+'<br /><br />');}}
$.post($('#forgot_password').attr('action'),$('#forgot_password').serialize(),handle_response_forgot_password,'json');return false;});});