(function(a){a("a[rel=follow]").live("click",function(){a.guang.dialog.isLogin()&&"false"!=a(this).data("enable")&&(a(this).data("enable","false"),$this=a(this),a.ajax({url:GUANGER.path+"/addFollow",type:"post",dataType:"json",data:{userId:a(this).data("userid")},jQueryDom:$this,success:function(c){if(c)switch(c.code){case 100:this.jQueryDom.data("enable","true");a.guang.addFollowCallback(c,this.jQueryDom);break;case 101:$this.data("enable","true");a.guang.tip.conf.tipClass="tipmodal tipmodal-error2";
a.guang.tip.show($this,"\u53c2\u6570\u9519\u8bef");break;case 103:$this.data("enable","true");a.guang.tip.conf.tipClass="tipmodal tipmodal-error2";a.guang.tip.show($this,"\u91cd\u590d\u5173\u6ce8\u4e86\u4f60\u7684\u670b\u53cb\uff01");break;case 111:$this.data("enable","true");a.guang.tip.conf.tipClass="tipmodal tipmodal-error2";a.guang.tip.show($this,"\u62b1\u6b49\uff0c\u4f60\u7684\u5173\u6ce8\u5df2\u8fbe\u4e0a\u9650\u3002");break;case 300:a.guang.dialog.login();break;case 446:a.guang.tip.conf.tipClass=
"tipmodal tipmodal-error2",a.guang.tip.show($this,"\u4f60\u5df2\u88ab\u7981\u6b62\u5173\u6ce8\u597d\u53cb\uff01")}else a.guang.tip.conf.tipClass="tipmodal tipmodal-error",a.guang.tip.show($this,"\u8bf7\u6362\u4e00\u4e2a\u975e\u5546\u5bb6\u5e10\u53f7\u5173\u6ce8~")}}))});a.guang.removeFansCallback=function(a){a.parents(".section").remove()};a("a[rel=removefans]").live("click",function(){if(a.guang.dialog.isLogin()&&"false"!=a(this).data("enable")){a(this).data("enable","false");$this=a(this);var c=
"\u786e\u5b9a\u8981\u79fb\u9664\u7c89\u4e1d\u201c"+$this.data("usernick")+"\u201d\uff1f",b=function(){a.ajax({url:GUANGER.path+"/removeFans",type:"post",dataType:"json",data:{userId:$this.data("userid")},success:function(b){switch(b.code){case 100:$this.data("enable","true");a.guang.removeFansCallback($this,b);break;case 101:$this.data("enable","true");a.guang.tip.conf.tipClass="tipmodal tipmodal-error2";a.guang.tip.show($this,b.msg);break;case 300:a.guang.dialog.login()}}})};Do("module/confirm_dialog",
function(){a.guang.confirmDialog(c,b,function(){$this.data("enable","true")})})}});a.guang.removeFollowCallback=function(){o.parents(".section").remove()};a("a[rel=removefollow]").live("click",function(){if(a.guang.dialog.isLogin()&&"false"!=a(this).data("enable")){a(this).data("enable","false");var c=a(this),b="\u786e\u5b9a\u4e0d\u518d\u5173\u6ce8\u201c"+c.data("usernick")+"\u201d\uff1f",d=function(){a.ajax({url:GUANGER.path+"/removeFollow",type:"post",dataType:"json",data:{userId:c.data("userid")},
success:function(b){switch(b.code){case 100:c.data("enable","true");a.guang.removeFollowCallback(b,c);break;case 101:c.data("enable","true");a.guang.tip.conf.tipClass="tipmodal tipmodal-error2";a.guang.tip.show(c,"\u53c2\u6570\u9519\u8bef");break;case 300:a.guang.dialog.login()}}})};Do("module/confirm_dialog",function(){a.guang.confirmDialog(b,d,function(){c.data("enable","true")})})}});a.guang.addFollowCallback=function(c,b){"0"==b.attr("data-followtype")&&(c.isYouFollowed?b.after("<div class='followed-btn-big'>\u4e92\u76f8\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='0' data-usernick="+
b.data("usernick")+" data-userid='"+b.data("userid")+"' href='javascript:;'>\u53d6\u6d88</a></div>"):b.after("<div class='followed-btn-big'>\u5df2\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='0' data-usernick="+b.data("usernick")+" data-userid='"+b.data("userid")+"' href='javascript:;'>\u53d6\u6d88</a></div>"),b.remove());"1"==b.attr("data-followtype")&&(b.after("<div class='followed-btn'>\u4e92\u76f8\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='1' data-usernick="+
b.data("usernick")+" data-userid='"+b.data("userid")+"' href='javascript:;'>\u53d6\u6d88</a></div>"),b.remove());"4"==b.attr("data-followtype")&&(c.isYouFollowed?b.after("<div class='followed-btn'>\u4e92\u76f8\u5173\u6ce8</div>"):b.after("<div class='followed-btn'>\u5df2\u5173\u6ce8</div>"),b.remove());"5"==b.attr("data-followtype")&&(c.isYouFollowed?b.after("<div class='followed-btn'>\u4e92\u76f8\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='5' data-usernick="+b.data("usernick")+
" data-userid='"+b.data("userid")+"' href='javascript:;'>\u53d6\u6d88</a></div>"):b.after("<div class='followed-btn'>\u5df2\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='5' data-usernick="+b.data("usernick")+" data-userid='"+b.data("userid")+"' href='javascript:;'>\u53d6\u6d88</a></div>"),b.remove());if("3"==b.attr("data-followtype")){for(var d=b.parents("ul").find("li"),e="",f=0;f<d.length;f++)e+=e.length?","+d.eq(f).find("a[rel=follow]").attr("data-userid"):d.eq(f).find("a[rel=follow]").attr("data-userid");
a.ajax({url:GUANGER.path+"/u/getUserInterested.html",type:"post",dataType:"json",data:{userIds:e},success:function(a){switch(a.code){case 100:if(a.snsFriend){a=a.snsFriend;if(!a.photo||0==a.photo.length)a.photo="http://static.www.letushuo.com/images/user/photo/avatar-50.png";var c="";"daren"==a.level&&(c='<strong class="i-daren inlineblock"></strong>');var d="",d=null==a.description?"\u6765\u81ea\u901b":a.description,a='<li><div class="user-pic"><a href="'+GUANGER.path+"/u/"+a.id+'" title="'+a.name+'"><img src="'+
a.photo+'" width="50" height="50" alt="'+a.name+'" title="'+a.name+'"/></a></div><div class="user-info"><p class="username"><a href="'+GUANGER.path+"/u/"+a.id+'" title="'+a.name+'">'+a.name+"</a>"+c+"</p><p>"+d+'</p><a rel="follow" href="javascript:;" class="follow-btn" data-followtype="3" data-userid="'+a.id+'">\u52a0\u5173\u6ce8</a></div></li>';b.parents("li").after(a)}b.parents("li").remove();break;case 101:b.parents("li").remove()}}})}if("6"==b.attr("data-followtype")){d=b.parents("dl").siblings("dl");
e=b.attr("data-userid");for(f=0;f<d.length;f++)e+=e.length?","+d.eq(f).find("a[rel=follow]").attr("data-userid"):d.eq(f).find("a[rel=follow]").attr("data-userid");a.ajax({url:GUANGER.path+"/u/getUserInterested.html",type:"post",dataType:"json",data:{userIds:e},success:function(a){switch(a.code){case 100:if(a.snsFriend){a=a.snsFriend;if(!a.photo||0==a.photo.length)a.photo="http://static.www.letushuo.com/images/user/photo/avatar-50.png";var c="";"daren"==a.level&&(c='<strong class="i-daren inlineblock"></strong>');
var d="",d=null==a.description?"\u6765\u81ea\u901b":a.description,a='<dl class="gper clearfix"><dt><a href="'+GUANGER.path+"/u/"+a.id+'" title="'+a.name+'" target="_blank"><img src="'+a.photo+'" width="50" height="50" alt="'+a.name+'" /></a></dt><dd><a class="name" href="'+GUANGER.path+"/u/"+a.id+'" target="_blank">'+a.name+"</a>"+c+'<p class="from">'+d+'</p><a rel="follow" href="javascript:;" class="follow-btn" data-followtype="6" data-userid="'+a.id+'">\u52a0\u5173\u6ce8</a></dd></dl>';b.parents("dl").after(a)}b.parents("dl").remove();
break;case 101:b.parents("dl").remove()}}})}"7"==b.attr("data-followtype")&&(b.after("<div class='followed-btn-big'>\u5df2\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='7' data-usernick="+b.data("usernick")+" data-userid='"+b.data("userid")+"' href='javascript:;'>\u53d6\u6d88</a></div>"),b.remove())};a.guang.removeFollowCallback=function(a,b){"0"==b.attr("data-followtype")&&(b.parent().after("<a rel='follow' href='javascript:;' class='follow-btn-big' data-followtype='0' data-usernick="+
b.data("usernick")+" data-userid="+b.data("userid")+">\u52a0\u5173\u6ce8</a>"),b.parent().remove());"1"==b.attr("data-followtype")&&(b.parent().after("<a rel='follow' href='javascript:;' class='follow-btn' data-followtype='1' data-usernick="+b.data("usernick")+" data-userid="+b.data("userid")+">\u52a0\u5173\u6ce8</a>"),b.parent().remove());"5"==b.attr("data-followtype")&&(b.parent().after("<a rel='follow' href='javascript:;' class='follow-btn' data-followtype='5' data-usernick="+b.data("usernick")+
" data-userid="+b.data("userid")+">\u52a0\u5173\u6ce8</a>"),b.parent().remove());"2"==b.attr("data-followtype")&&b.parents(".section").remove();"7"==b.attr("data-followtype")&&(b.parent().after("<a rel='follow' href='javascript:;' class='follow-btn-big' data-followtype='7' data-usernick="+b.data("usernick")+" data-userid="+b.data("userid")+">\u5173\u6ce8\u5c0f\u7ad9</a>"),b.parent().remove())}})(jQuery);
