$(function(){$(".fade-label input").labelFader();$("#create-user .field-error input").live("keydown",function(){$(this).parent(".field-error").removeClass("field-error")});$("#create-user").submit(function(b){var a=this;$("input[type=submit]",this).attr("disabled","disabled");$.ajax({type:"POST",url:$(this).attr("action"),data:$(this).serialize(),dataType:"json",success:function(c){document.location=c.url},error:function(d){var c=$.parseJSON(d.responseText);$("ul",$("#errors")).empty();$(".field").removeClass("field-error");var e="";$.each(c.errors,function(g,f){$("[name='user["+g+"]']").parent(".field").addClass("field-error");if(g=="password"){$("[name='user[password_confirmation]']").parent(".field").addClass("field-error")}e+=f+". "});$("#errors").text(e).show();$(".field-error:first").find("input").focus();$("body").addClass("page-error");$("input[type=submit]",a).removeAttr("disabled")}});return false})});
