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("")}});
