/* author: zmm, date: Mon Oct 10 2011 23:03:05 GMT+0800 (CST) */G.def("Count",function(){var c=/([^-0-9]+)?([-0-9]+)([\w\W]+)?/;return function(f){var d=$(f);this.add=function(a){var b=c.exec(d.text());d.text(b?(b[1]||"")+(+b[2]+a)+(b[3]||""):"");return this};this.set=function(a){var b=c.exec(d.text());d.text(b?(b[1]||"")+a+(b[3]||""):"");return this}}});
$(function(){function c(a){var b={follow:'\u53d6\u6d88',unfollow:'+\u5173\u6ce8'},d={follow:1,unfollow:-1},c={navNuts:api.followUser,navDiarys:api.followUser,navGroups:api.followGroup,navMinisites:api.followSite}[g_page_name];G.req("Count",function(f){a.delegate(".followBt","click",function(){var a=
$(this),g=a.attr("data-id"),h=a.attr("data-operation");c(g,h,function(){function e(a){var b=a.parent().next().children(":eq(1)");a.replaceWith(c);(new f(b)).add(i)}var c=G.format(b[h],g),i=d[h];g_page_name==="navDiarys"?$(".followBt[data-id="+g+"]").each(function(){e($(this))}):e(a)})})})}function f(a){G.ua.isIE6&&a.delegate(".mouseHover","mouseover",function(){$(this).addClass("hover")}).delegate(".mouseHover","mouseout",function(){$(this).removeClass("hover")})}function d(){$("#followBt").doOnce(function(a){var b=
{follow:'\u5df2\u5173\u6ce8\uff5c\u53d6\u6d88',unfollow:'+\u5173\u6ce8'},c={groupIndex:api.followGroup,minisiteIndex:api.followSite},d={follow:1,unfollow:-1},f=new a("#followCounter"),j=c[g_page_name];this.live("click",function(){var a=$(this),c=a.attr("data-id"),e=a.attr("data-operation");
j(c,e,function(){e==="unfollow"?a.parent().replaceWith(G.format(b[e],c)):a.replaceWith(G.format(b[e],c));f.add(d[e])})})},"Count")}typeof g_page_name==="undefined"&&(g_page_name="");$("#followBoard").doOnce(function(){ukey&&c(this);f(this)});ukey&&d()});