
$(function() {
    //Recuperar password
    $("#btnrecuperar").click(function(e){        
        if($("#email").val()!=""){
            $.ajax({
        		type:"POST",
        		dataType:"html",
        		url:"modulos/registrarse/action.php",
        		data:"email="+$("#email").val()+"&tarea=recuperarpassword",
        		success:function(msg){
  		            if(msg=="OK")
                        $("#mensaje").addClass("exito").text("Su nuevo contraseņa fue enviado a su correo.").show();
                    else
                        $("#mensaje").addClass("error").html(msg).show();
        		}                                
        	});
       }else{
            $.achtung({message: 'Debe introducir su email!', timeout:5});
            $("#mensaje").addClass("error").text("Debe Introducir su email.").show();
       }
    });
    
    $("#email").keypress(function(e){
       if(e.which==13)
          $("#btnrecuperar").click();
    });
});
