$(function(){
$('[data-toggle="tooltip"]').tooltip({html:true});
});

$(function() {
  $("#forget_password_btn").click(function() {
	var email = $("input#email").val();
	var recaptcha_challenge_field = $("input#recaptcha_challenge_field").val();
	var recaptcha_response_field = $("input#recaptcha_response_field").val();
	
	var dataString = 'email='+ email +'&recaptcha_challenge_field='+ recaptcha_challenge_field + '&recaptcha_response_field=' + recaptcha_response_field;
	$("#forget_password_btn").append(' <span class="fa fa-spinner fa-spin"></span>');
	$.ajax({
      type: "POST",
      url: 'ajax.php?case=forget_password',
      data: dataString,
	  cache: false,
      success: function(result) {
	  if (result == 1) {
		  setTimeout(
		  function() 
		  {
	    $("#forget_password_btn span").remove();
		$("#forget-password-form").hide();
		$("div#forget-password-message").html('<div class="alert alert-success">'+success_forget_password+' <b>'+email+'</b></div>');
		}, 2000);
	  } else {
		$("#forget_password_btn span").remove();
	    $("div#forget-password-message").html(result);
	  }
      }
     });
    return false;
	});
});
