var Member={saveFriendTag:function(B){if(!B.length){return }var A=new Prompt();var C='<table border="0"><tbody><tr><td width="80" align="right">原分组:</td><td>'+B+'</td><td/></tr><tr><td align="right">新分组:</td><td><input type="text" maxlength="7" size="20" name="txtTags" id="txtTags"/></td></tr></tbody></table>';A.confirm(["修改好友分组",C],{onReturn:function(E){if(E){var F=$("txtTags").get("value")||"";var D="do=sft&c="+B+"&b="+F;new AjaxReq({url:"/friend.v",method:"post",data:D,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(H){if(H&&H.code==100){Mbox.close();$AuthBoxShow("好友分组")}else{if(H.code==200){var G=H.msg.refresh;if(G){window.location.reload(true)}}else{Mbox.openLite('<div class="Doing">'+H.msg.html+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000)}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()}}})},editFriendInfo:function(B){if(!B){return }var A="do=efi&a="+B;new AjaxReq({url:"/friend.v",method:"post",data:A,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(H){if(H&&H.code==100){Mbox.close();$AuthBoxShow("好友状态")}else{if(H.code==200){Mbox.close();var D=new Prompt();var G=[],C=H.msg.friendTag||[];var F=H.msg.issub?"checked=checked":"";G.push("<p>修改<b>"+H.msg.username+"</b>的状态：</p><br>");G.push('<p>修改分组： <select id="ddlfriendTag" name="ddlfriendTag" onchange="Member.newTag(\'ddlfriendTag\');"><option value="">默认分组</option>');for(var E=0;E<C.length;E++){if(C[E]!=""){G.push("<option value="+C[E]+" "+(H.msg.nowtag==C[E]?" selected ":"")+"  >"+C[E]+"</option>")}}G.push("<option value=-99>新建分组...</option>");G.push("</select></p><br>");G.push("<div id=newTagDiv style=\"display:none\">新分组名：<input id='newtag' name='newtag' type=\"text\" ><br><br></div>");G.push('<p><input type="checkbox" '+F+' id="chkIsSubscription" name="chkIsSubscription"/>在情报站内订阅好友</p>');D.confirm(["修改好友状态",G.join("")],{onReturn:function(I){if(I){Member.editFriendInfoSubmit(B,$("ddlfriendTag").get("value"),$("chkIsSubscription").checked?1:0)}}})}else{Mbox.openLite('<div class="Doing">'+H.msg.html+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000)}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()},editFriendInfoSubmit:function(C,B,D){if(!C){return }var E="";if($("newtag")){E=$("newtag").get("value")}var A="do=efis&a="+C+"&b="+(B==-99?E:B)+"&c="+D;new AjaxReq({url:"/friend.v",method:"post",data:A,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(G){if(G&&G.code==100){Mbox.close();$AuthBoxShow("好友状态")}else{if(G.code==200){var F=G.msg.refresh;if(F){window.location.reload(true)}}else{Mbox.openLite('<div class="Doing">'+G.msg.html+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000)}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()},delFriend:function(B){if(!B){return }var A=new Prompt();A.confirm(["删除好友","确定要删除此好友吗？"],{onReturn:function(D){if(D){var C="do=df&a="+B;new AjaxReq({url:"/friend.v",method:"post",data:C,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(F){if(F&&F.code==100){Mbox.close();$AuthBoxShow("删除好友")}else{Mbox.openLite('<div class="Doing">'+F.msg.html+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000);var E=F.msg.refresh;if(E){window.location.reload(true)}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()}}})},imgRefresh:function(A){$(A).setProperty("src","/ValidateCode_"+$random(0,1000)+".jpg")},addFriend:function(B){if(!B){return }var A="do=af&a="+B;new AjaxReq({url:"/friend.v",method:"post",data:A,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(G){if(G&&G.code==100){Mbox.close();$AuthBoxShow("添加好友")}else{if(G.code==200){Mbox.close();var D=new Prompt();var F=[],C=G.msg.friendTag||[];var I=G.msg.iscode;var H=G.msg.username;F.push('<p>加入分组：<select id="ddlfriendGroup" name="ddlfriendGroup" onchange="Member.newTag(\'ddlfriendGroup\');"><option value="">默认分组</option>');for(var E=0;E<C.length;E++){if(C[E]!=""){F.push("<option value="+C[E]+">"+C[E]+"</option>")}}F.push("<option value=-99>新建分组...</option>");F.push("</select></p><br>");F.push("<div id=newTagDiv style=\"display:none\">新分组名：<input id='newtag' name='newtag' type=\"text\" ><br><br></div>");F.push('<p><input type="checkbox" checked="checked" name="AjaxIsSub" id="AjaxIsSub"/>在情报站内订阅好友</p><br><br>');if(I){F.push('<p>请输入验证码:<br/><input type="text" style="font-size: 20px;" id="AjaxFriendVC" maxlength="4" size="4"/><img id="ValidateCodeImg" onclick="Member.imgRefresh(this);" style="cursor: pointer;" title="看不清楚?请点击!" src="/ValidateCode18.jpg"/></p>')}D.confirm(["将"+H+"加为你的好友",F.join("")],{onReturn:function(J){if(J){Member.addFriendsubmit(B,$("ddlfriendGroup").get("value"),"",$("AjaxIsSub").checked?1:0,$("AjaxFriendVC")?$("AjaxFriendVC").get("value"):"")}}})}else{Mbox.openLite('<div class="Doing">'+G.msg+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000)}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()},newTag:function(A){if($(A).get("value")=="-99"){$("newTagDiv").setStyle("display","block")}else{$("newTagDiv").setStyle("display","none")}},addFriendsubmit:function(D,C,H,E,F){if(!D){return }var A=new Prompt();var G="";if($("newtag")){G=$("newtag").get("value")}var B="do=afs&a="+D+"&b="+(C==-99?G:C)+"&c="+H+"&d="+E+"&e="+F;new AjaxReq({url:"/friend.v",method:"post",data:B,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(J){if(J&&J.code==100){Mbox.close();$AuthBoxShow("添加好友")}else{if(J.code==200){Mbox.openLite('<div class="Doing">'+J.msg+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000)}else{if(J.code==202){Mbox.close();var I=new Prompt();I.alert(["添加失败",J.msg])}else{Mbox.openLite('<div class="Doing">'+J.msg+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000)}}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()},delFriends:function(B){var A=new Prompt();if(B==""){A.alert(["删除好友","请选择您要删除的好友！"]);return }A.confirm(["删除好友","确定要删除选中的好友吗？"],{onReturn:function(D){if(D){var C="do=dfs&a="+B;new AjaxReq({url:"/friend.v",method:"post",data:C,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(F){if(F&&F.code==100){Mbox.close();$AuthBoxShow("删除好友")}else{if(F.code==200){var E=F.msg.refresh;if(E){window.location.reload(true)}}else{Mbox.openLite('<div class="Doing">'+F.msg+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000)}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()}}})},setTag:function(E,D){var A=new Prompt();if(D==""){A.alert(["加入分组","请选择您要加入分组的好友！"]);return }var B="do=sts&a="+E+"&b="+D;if(E==-99){var C='<table border="0"><tbody><tr><td align="right">新分组:</td><td><input type="text" maxlength="7" size="20" name="txtTags" id="txtTags"/></td></tr></tbody></table>';A.confirm(["新建好友分组",C],{onReturn:function(F){if(F){var G=$("txtTags").get("value")||"";Member.updatetags(G,D)}}})}else{Member.updatetags(E,D)}},updatetags:function(D,C){var A=new Prompt();if(C==""){A.alert(["加入分组","请选择您要加入分组的好友！"]);return }var B="do=sts&a="+D+"&b="+C;new AjaxReq({url:"/friend.v",method:"post",data:B,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(E){if(E&&E.code==100){Mbox.close();Mbox.openLite('<p class="Doing">操作成功!.</p>',200,30)}else{Mbox.openLite('<div class="Doing">'+E.msg+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000);window.location.reload(true)}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()},setSub:function(B,D){var A=new Prompt();if(D==""){A.alert(["加入分组","请选择您要设置订阅的好友！"]);return }var C="do=sf&a="+B+"&b="+D;new AjaxReq({url:"/friend.v",method:"post",data:C,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(E){if(E&&E.code==100){Mbox.close();Mbox.openLite('<p class="Doing">操作成功!.</p>',200,30)}else{Mbox.openLite('<div class="Doing">'+E.msg+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000);window.location.reload(true)}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()},delReplay:function(B,D,C){var A=new Prompt();A.confirm(["屏蔽回应更新","重新参与这条回应时它会再次出现在列表里。<br><strong>确认屏蔽这条回应吗？</strong>"],{onReturn:function(F){if(F){var E="do=sdfn&a="+B+"&b="+D+"&c="+C;new AjaxReq({url:"/follownote.v",method:"post",data:E,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(G){if(G&&G.code==100){Mbox.close();$AuthBoxShow("屏蔽回应更新")}else{if(G.code==200){Mbox.openLite('<div class="Doing">'+G.msg+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000);window.location.reload(true)}else{Mbox.openLite('<div class="Doing">'+G.msg+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000)}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()}}})},addBlock:function(B){var A=new Prompt();if(!B||B==""||B=="请输入昵称"){A.alert(["加入黑名单","请输入用户昵称！"]);return }A.confirm(["加入黑名单",'<strong>真的要将"'+B+'"踢到黑名单里吗？</strong>'],{onReturn:function(D){if(D){var C="do=ab&a="+B;new AjaxReq({url:"/profile.v",method:"post",data:C,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(F){if(F&&F.code==100){Mbox.close();$AuthBoxShow("加入黑名单")}else{if(F.code==200){Mbox.openLite('<div class="Doing">'+F.msg.html+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000);var E=F.msg.refresh;if(E){window.location.reload(true)}}else{Mbox.openLite('<div class="Doing">'+F.msg+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000)}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()}}})},delBlock:function(B,C){if(!B){return }var A=new Prompt();A.confirm(["撤销黑名单","<strong>真的要将"+C+"从您的黑名单中撤销吗？</strong>"],{onReturn:function(E){if(E){var D="do=db&a="+B;new AjaxReq({url:"/profile.v",method:"post",data:D,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(G){if(G&&G.code==100){Mbox.close();$AuthBoxShow("撤销黑名单")}else{if(G.code==200){Mbox.openLite('<div class="Doing">'+G.msg.html+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000);var F=G.msg.refresh;if(F){window.location.reload(true)}}else{Mbox.openLite('<div class="Doing">'+G.msg+"</div>",280,"auto");setTimeout(function(){Mbox.close()},2000)}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close();return false" class="B">返回</a></p>',200,30)}}).send()}}})}};var Bookmark={UpdateBookmark:function(){var A=$("MyBookmark");if(A!=null){var B='<div class="UpdateBM"><div class="bmTitle"><span class="Left">添加您喜爱的网址：</span><span class="Right"><a href="#" onclick="this.blur();Bookmark.UpdateBMCancel();Bookmark.ShowDivBMList();return false;" title="关闭编辑" ><img src="http://i1.dpfile.com/Comm/Images/KillBtn.gif" border="0" /></a></span></div><div class="bmValue"><input type="text" value="http://" size="40" maxlength="50" id="url" /></div><span id="urlError"></span><div class="bmTitle">书签名：</div><div><input type="text" value="" size="40" maxlength="20" id="bm" /></div><span id="bmError"></span><div><input type="button" value="添加" onclick="this.blur();Bookmark.UpdateBMSubmit();return false;" />&nbsp;<input type="button" value="关闭" onclick="this.blur();Bookmark.UpdateBMCancel();Bookmark.ShowDivBMList();return false;" /></div><span id="bmList"></span></div>';A.set("html",B)}Bookmark.ShowBMList()},UpdateBMCancel:function(){var A=$("MyBookmark");if(A!=null){A.set("html","")}},ShowBMList:function(){var A=$("urlError");new AjaxReq({url:"/member.v",method:"post",callType:"json",data:{"do":"showuserlink"},onSuccess:function(C){if(C.code==200){var B=$("divBMList");if(B!=null){B.set("html",C.msg.html)}}else{if(A!=null){A.set("html",'<div class="Doing">获取书签列表失败！请稍后再试</div>')}}Mbox.close()}}).send()},UpdateBMSubmit:function(){var E=$("urlError");var D=$("url");D.addEvent("blur",function(){if(!$isMatch(D,$isMatch.MORE,0,true)){E.set("html",'<div class="Error">网址不能为空！</div>');D.store("valid",false)}else{if(!$isRegex(D,$isRegex.URL)){E.set("html",'<div class="Error">网址非法，请重新输入!</div>');D.store("valid",false)}else{E.set("html","");D.store("valid",true)}}});var C=$("bm");var B=$("bmError");C.addEvent("blur",function(){if(!$isMatch(C,$isMatch.MORE,0,true)){B.set("html",'<div class="Error">书签名不能为空！</div>');C.store("valid",false)}else{B.set("html","");C.store("valid",true)}});var A=function(){var F=true;[D].each(function(G){G.fireEvent("blur");if(!G.retrieve("valid")){F=false}});[C].each(function(G){G.fireEvent("blur");if(!G.retrieve("valid")){F=false}});return F};if(A()){new AjaxReq({url:"/member.v",method:"post",callType:"json",data:{"do":"addurl",url:D.get("value"),bm:C.get("value")},onSuccess:function(F){if(F.code==200){D.value="http://";C.value="";Bookmark.ShowBMList()}else{objTmp.set("html",'<div class="Doing">添加失败！请稍后再试</div>')}}}).send()}},ShowDivBMList:function(){var A=$("urlError");new AjaxReq({url:"/member.v",method:"post",callType:"json",data:{"do":"showdivuserlink"},onSuccess:function(C){if(C.code==200){var B=$("divBMList");if(B!=null){B.set("html",C.msg.html)}}else{if(A!=null){A.set("html",'<div class="Doing">获取书签列表失败！请稍后再试</div>')}}Mbox.close()}}).send()},DelBM:function(B){var A=$("urlError");new AjaxReq({url:"/member.v",method:"post",callType:"json",data:{"do":"deluserlink",id:B},onSuccess:function(C){if(C.code==200){Bookmark.ShowBMList()}else{if(A!=null){A.set("html",'<div class="Doing">删除书签失败！请稍后再试</div>')}}Mbox.close()}}).send()}};