var usernameValidator;UsernameValidator=Class.create({initialize:function(a){this.lookupUrl=a.lookupUrl},getLookupUrl:function(){return this.lookupUrl},setMessage:function(a){this.message=a},getMessage:function(){return this.message}});Tapestry.Validator.username=function(b,a){b.addValidator(function(e){var c=pqCoreUtil.makeUrlRelative(usernameValidator.getLookupUrl());var d;new Ajax.Request(c,{method:"post",parameters:{username:e},onFailure:function(f){alert("Error communicating with the server")},onException:function(g,f){alert("Exception: Error communicating with the server: "+f);throw f},onSuccess:function(f){d=f.responseText;if(f.responseText=="true"){b.showValidationMessage(a)}}})})};Tapestry.Initializer.usernameValidator=function(a){usernameValidator=new UsernameValidator(a)};