var addfriend=Class.create();addfriend.prototype={initialize:function(){},addfriend:function(wndtype,friendid,friendname){var param={"id":friendid,"name":friendname,"wndtype":wndtype};gdApi.callMethod("gd.space.addfriend",param,this);},gd_space_addfriend_call:function(success,responseXML,html,param){var wndtype=param.wndtype;thisClass=this;if(success){switch(html){case 'unlogin':if(wndtype==0)
reg.showLogin();else if(wndtype==1)
parent.reg.showLogin();break;case 'self':alert("这是您自己！");break;case 'myFriend':alert(param.name+"已经是您的好友了！");break;case 'myBacklist':alert(param.name+"被您加入了黑名单哦，先恢复关系吧！");break;case 'otherFriend':alert("添加好友成功！请查看全部好友！");break;case 'otherBacklist':alert("您在"+param.name+"的黑名单之中！");break;case 'repeatmsg':alert("您已经发送过请求，等待对方验证！");break;case 'send':if(wndtype==0){Dialog.confirm($("addfrddiv").innerHTML,{windowParameters:{className:"register",width:514,closable:true,title:"<span class='addfrd_titletext'>添加好友</span>"},okLabel:" ",cancelLabel:" ",buttonClass:"register",ok:function(win){var p={"friendid":param.id,"content":$("addfrd_contentname").value,"wndtype":wndtype};gdApi.callMethod("gd.space.sendmsg",p,thisClass);},cancel:function(win){Windows.closeAll();}});$("addfrd_contentname").focus();}else if(wndtype==1){parent.Dialog.confirm(parent.$("addfrddiv").innerHTML,{windowParameters:{className:"register",width:514,closable:true,title:"<span class='addfrd_titletext'>添加好友</span>"},okLabel:" ",cancelLabel:" ",buttonClass:"register",ok:function(win){var p={"friendid":param.id,"content":parent.$("addfrd_contentname").value,"wndtype":wndtype};parent.gdApi.callRouter("gd.space.sendmsg",p,thisClass);},cancel:function(win){parent.Windows.closeAll();}});parent.$("addfrd_contentname").focus();}
break;default:break;}}else{pubFunc.errorReport(responseXML);}},gd_space_sendmsg_call:function(success,responseXML,html,param){var wndtype=param.wndtype;if(success){if(wndtype==0)
Windows.closeAll();else if(wndtype==1)
parent.Windows.closeAll();alert("已经发送请求，等待对方验证！");}else{pubFunc.errorReport(responseXML);}},wndclose:function(){document.getElementById("addfrddiv").style.display="none";$("addfrd_contentname").value="";}}
var addfrd=new addfriend();