if(typeof AJS.followCallbacks=="undefined"){AJS.followCallbacks=[]}AJS.toInit(function(d){var c=d(".follow-user-box");c.length&&c.autocomplete(contextPath+"/json/usersearch.action?filterDisabledUsers=true&query=",2,function(f){d("input[name=username]",d(f.input).parent()).val(f.username)});d(".follow-user").submit(function(h){var g=d("input[name=username]",d(this).parent());var f=g.val();if(!f){f=d(".follow-user-box").val()}AJS.safe.post(contextPath+"/ajax/followuser.action",{username:f},function(j){var i=d(".follow-user-result");i.html(j);i.show();var k=d(".follow-user-box");k.val("");k.focus();g.val("")});return AJS.stopEvent(h)});var e=d(".follow-user-box");if(!e.length){return}var a="followUserDataKey";var b=AJS.params.followUserBoxPlaceholder;e.each(function(){$followUserBox=d(this);$followUserBox.data(a,{placeholder:b,placeholded:true})});if(!d.browser.safari){e.val(e.data(a).placeholder);e.addClass("placeholded");e.focus(function(){var f=d(this);if(f.data(a).placeholded){f.data(a).placeholded=false;f.val("");f.removeClass("placeholded")}});e.blur(function(){var f=d(this);if(f.data(a).placeholder&&(/^\s*$/).test(f.val())){f.val(f.data(a).placeholder);f.data(a).placeholded=true;f.addClass("placeholded")}})}else{e.each(function(){$followUserBox=d(this);$followUserBox.attr("placeholder",b)});e.val("")}});

