Type.registerNamespace("FriendsCategories");var limitBy12RegEx=new RegExp(/[^\s]{12}/mg);function getElementsByClassName(E,C,D){var A=new Array();if(E){var F=E.getElementsByTagName(C);for(var B=0;B<F.length;B++){if(F[B].className.indexOf(D)!=-1){Array.add(A,F[B])}}}return A}FriendsCategories.AjaxToolTip=function(){this.targetElCss;this.targetElTag;this.tTipContent;this.tTipCss;this.tTipPtrCss;this.tTipTextCss;this.tTipShowOnFocus;this.targets=[];this._element=null;this.fixLocation;FriendsCategories.AjaxToolTip.initializeBase(this)};FriendsCategories.AjaxToolTip.prototype={_tTipUpHtml:"<div id='divPopup' class='{0}'><div id='{1}' class='{2}'>{3}</div><div id='{4}' class='{5}'>{6}</div></div>",_isSetUp:false,get_targets:function(){return this.targets},initialize:function(){if(!this.tTipCss){this.tTipCss="PopupDiv"}if(!this.tTipPtrCss){this.tTipPtrCss="PopupPointer"}if(!this.tTipTextCss){this.tTipTextCss="PopupText"}if(this.targetElCss){this.targets=getElementsByClassName(document.body,this.targetElTag,this.targetElCss)}if(this.targets){for(var A=0;A<this.targets.length;A++){$addHandlers(this.targets[A],{mouseover:this.show,mouseout:this.hide},this);if(this.tTipShowOnFocus){$addHandlers(this.targets[A],{focus:this.show,blur:this.hide},this)}}}if(!this.fixLocation){this.fixLocation=0}if(this.tTipContent){this.tTipContent=this._decodedHtml(this.tTipContent)}FriendsCategories.AjaxToolTip.callBaseMethod(this,"initialize")},dispose:function(){if(this.targets){for(var A=0;A<this.targets.length;A++){$clearHandlers(this.targets[A])}}this._element=null;FriendsCategories.AjaxToolTip.callBaseMethod(this,"dispose")},setContent:function(A){this.tTipContent=A;if(this._element){this._element.firstChild.childNodes[(this._element.location==3?1:0)].innerHTML=this.tTipContent}},_setUp:function(){this._element=document.createElement("div");this._element.innerHTML=this._buildTTip("up");var A=this._element.style;A.position="absolute";A.height="auto";A.left="0px";A.top="0px";A.zIndex=50;document.body.appendChild(this._element);this._isSetUp=true},_buildTTip:function(A){if(A=="up"){return String.format(this._tTipUpHtml,this.tTipCss,"divPtr",this.tTipPtrCss,"","divPopupText",this.tTipTextCss,this.tTipContent)}else{return String.format(this._tTipUpHtml,this.tTipCss,"divPopupText",this.tTipTextCss+"Above",this.tTipContent,"divPtr",this.tTipPtrCss+"down","")}},_positionToolTip:function(E){var A=Sys.UI.DomElement.getBounds(E);var C=this._getWindowSize();var B=MySpace.UI.getElementsByClassName("addToFriendsContentOL",document)[0];if(B){var F=Sys.UI.DomElement.getBounds(B)}var D=MySpace.UI.getElementsByClassName("addToFriendsContent",document)[0];if(this.fixLocation!=3&&(this.fixLocation==1||(A.y-this._getScrollPos())+A.height+this._element.firstChild.clientHeight>C.height)){if(this._element.location!=1){this._element.innerHTML=this._buildTTip("down")}if(B&&F){this._element.style.top=(A.y-F.y)-(this._element.firstChild.clientHeight+2)+"px"}else{this._element.style.top=A.y-this._element.firstChild.clientHeight+"px"}this._element.location=1}else{if(this._element.location!=3){this._element.innerHTML=this._buildTTip("up")}if(B&&F){this._element.style.top=(A.y-F.y)+(A.height+2)+"px"}else{this._element.style.top=A.y+A.height+"px"}this._element.location=3}if(B&&F||D){this._element.style.left=(A.x-167)+"px"}else{this._element.style.left=A.x+"px"}},_getWindowSize:function(){var B=0,A=0;if(typeof(window.innerWidth)=="number"){B=window.innerWidth;A=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){B=document.documentElement.clientWidth;A=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){B=document.body.clientWidth;A=document.body.clientHeight}}}return{width:B,height:A}},_getScrollPos:function(){var A=document.body.scrollTop;if(A==0){if(window.pageYOffset){A=window.pageYOffset}else{A=(document.body.parentElement)?document.body.parentElement.scrollTop:0}}return A},show:function(A){var B=A.target;if(!this._isSetUp){this.setContent(this.tTipContent);this._setUp()}if(!this._element||B.dispalyed){return false}B.dispalyed=true;this._positionToolTip(B);this._element.style.visibility="visible";return false},hide:function(A){var B=A.target;if(this._element){this._element.style.visibility="hidden";this._element.style.left="0px";this._element.style.top="0px";B.dispalyed=false}},_decodedHtml:function(B){var A=document.createElement("div");if(B!=null&&B.length>0){B=this._encodeAmpersands(B);A.innerHTML=B}else{return""}return A.innerText||A.textContent||B},_encodeAmpersands:function(A){A=A.replace(/&$/g,"&amp;");A=A.replace(/\s&$/g," &amp;");A=A.replace(/\s&\s/g," &amp; ");return A}};FriendsCategories.AjaxToolTip.registerClass("FriendsCategories.AjaxToolTip",Sys.Component);FriendsCategories.TimeOutAjaxToolTip=function(){FriendsCategories.TimeOutAjaxToolTip.initializeBase(this)};FriendsCategories.TimeOutAjaxToolTip.prototype={_hideDelay:500,_timerID:0,_timeOEvt:null,get_hideDelay:function(){return this._hideDelay},set_hideDelay:function(A){this._hideDelay=A},initialize:function(){FriendsCategories.TimeOutAjaxToolTip.callBaseMethod(this,"initialize");if(this.targets){for(var A=0;A<this.targets.length;A++){$clearHandlers(this.targets[A]);$addHandler(this.targets[A],"mouseover",Function.createDelegate(this,this._toShow));$addHandler(this.targets[A],"mouseout",Function.createDelegate(this,this._checkToHide))}}},dispose:function(){FriendsCategories.TimeOutAjaxToolTip.callBaseMethod(this,"dispose")},_clearTimerID:function(){if(this._timerID){clearTimeout(this._timerID);this._timerID=0}},_toShow:function(A){if(!A.target.dispalyed){FriendsCategories.TimeOutAjaxToolTip.callBaseMethod(this,"show",[A]);$addHandler(this._element,"mouseover",Function.createDelegate(this,this._cancelHide));$addHandler(this._element,"mouseout",Function.createDelegate(this,this._enableHide))}},_cancelHide:function(A){this._mOverTT=true},_enableHide:function(A){this._mOverTT=false},_checkToHide:function(A){this._clearTimerID();this._timeOEvt=A;this._timerID=window.setTimeout(Function.createDelegate(this,this._dHide),this._hideDelay)},_dHide:function(){this._clearTimerID();if(this._mOverTT){this._timerID=window.setTimeout(Function.createDelegate(this,this._dHide),this._hideDelay)}else{$clearHandlers(this._element);this.hide(this._timeOEvt)}}};FriendsCategories.TimeOutAjaxToolTip.registerClass("FriendsCategories.TimeOutAjaxToolTip",FriendsCategories.AjaxToolTip);FriendsCategories.ViewFriends=function(){this._catDD;this._cId;this._cName;this._cPriv;this._cDesc;this._isReqOwner;this._rndFrndHref;this._ownViewo;this._exViewTTo;this.MAX_DD_NAME_LEN=30;this.MAX_AB_NAME_LEN=17};FriendsCategories.ViewFriends.registerClass("FriendsCategories.ViewFriends");var _viewFriendso;FriendsCategories.ViewFriends.getObj=function(C,B,F,A,E,G,D){if(!_viewFriendso){_viewFriendso=new FriendsCategories.ViewFriends();_viewFriendso._rndFrndHref=G;_viewFriendso.initialize(C,B,F,A,E,D)}return _viewFriendso};FriendsCategories.ViewFriends.prototype={initialize:function(C,B,F,A,E,D){FriendsCategories.ViewFriends.initializeBase(this);this._cId=C;this._cName=B;this._cDesc=F;this._cPriv=A;this._cType=D;this._isReqOwner=E;var G=$get("myfriends_display");if(G){this._catDD=G.getElementsByTagName("select")[0]}this.setEditCat();this.setViewHideTips();this.setExViewTips();this.setRndHlpTip();if(this._isReqOwner){this.setOwnerViewTips()}else{this.setVisitorViewTips()}},setEditCat:function(){this._ownViewo=getElementsByClassName($get("myfriends"),"div","categoryListView")[0];if(this._ownViewo){var D=getElementsByClassName(this._ownViewo,"a","_editCatLink");if(D.length>0){var B=new FriendsCategories.EditCat();B.init(D[0],this._cId,this._cName,this._cDesc,this._cPriv,this._cType);B.addEditCatClicked(Function.createDelegate(this,this.editCatCB))}var A=getElementsByClassName(this._ownViewo,"a","categoryNameLabel")[0];A.innerHTML=this._encodeAmpersands(this._cName.call(TextFilterWBR));var C=getElementsByClassName(this._ownViewo,"p","categoryDescLabel")[0];if(C){C.innerHTML=this._encodeAmpersands(this._cDesc)}MySpace.Util.applyWBRToElement(C,{frequency:12})}},setViewHideTips:function(){var A=$create(FriendsCategories.AjaxToolTip,{targetElCss:"hiddenTTip",targetElTag:"img",tTipContent:MySpaceRes.FriendCategories.HiddenFriendTooltip,tTipShowOnFocus:0})},setOwnerViewTips:function(){var B=new Sys.StringBuilder("");B.append("<div id='' class='toolTipDefText'>");B.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipHelpText);B.append("</div>");B.append("<br />");B.append("<span id='' class='toolTipDefLabel'>");B.append(MySpaceRes.ViewAllFriendsPage.JustMeCategorySecurityLabel);B.append(":&nbsp;</span>");B.append("<span id='' class='toolTipDefText'>");B.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipJustMe);B.append("</span>");B.append("<br />");B.append("<br />");B.append("<span id='' class='toolTipDefLabel'>");B.append(MySpaceRes.ViewAllFriendsPage.MembersOnlyCategorySecurityLabel);B.append(":&nbsp;</span>");B.append("<span id='' class='toolTipDefText'>");B.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipMembersOnly);B.append("</span>");B.append("<br />");B.append("<br />");B.append("<span id='' class='toolTipDefLabel'>");B.append(MySpaceRes.ViewAllFriendsPage.EveryoneCategorySecurityLabel);B.append(":&nbsp;</span>");B.append("<span id='' class='toolTipDefText'>");B.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipEveryone);B.append("</span>");B.append("<br />");var A=$create(FriendsCategories.AjaxToolTip,{targetElCss:"categoryHelpImg",targetElTag:"img",tTipCss:"BluePopupDiv",tTipPtrCss:"BluePopupPointer",tTipTextCss:"BluePopupText",tTipShowOnFocus:0});A.tTipContent=B},setVisitorViewTips:function(){var B=new Sys.StringBuilder("");B.append("<span id='' class='toolTipDefLabel'>");B.append(MySpaceRes.ViewAllFriendsPage.MembersOnlyCategorySecurityLabel);B.append(":&nbsp;</span>");B.append("<span id='' class='toolTipDefText'>");B.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipMembersOnly);B.append("</span>");B.append("<br />");B.append("<br />");B.append("<span id='' class='toolTipDefLabel'>");B.append(MySpaceRes.ViewAllFriendsPage.EveryoneCategorySecurityLabel);B.append(":&nbsp;</span>");B.append("<span id='' class='toolTipDefText'>");B.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipEveryone);B.append("</span>");B.append("<br />");var A=$create(FriendsCategories.AjaxToolTip,{targetElCss:"categoryHelpImg",targetElTag:"img",tTipCss:"BluePopupDiv",tTipPtrCss:"BluePopupPointer",tTipTextCss:"BluePopupText",tTipShowOnFocus:0});A.tTipContent=B},setRndHlpTip:function(){var C=$get("_rndHlpTipImg");if(C){var B=new Sys.StringBuilder(MySpaceRes.ViewAllFriendsPage.FriendsRandomziedTooltip1);B.append("<br /><br />");B.append(String.format(MySpaceRes.ViewAllFriendsPage.FriendsRandomziedTooltip2,"<a href="+this._rndFrndHref+">","</a>"));var A=$create(FriendsCategories.TimeOutAjaxToolTip,{targets:[C],tTipShowOnFocus:0});A.tTipContent=B}},setExViewTips:function(){var A=$get("_exViewHideTip");if(A){this._exViewTTo=$create(FriendsCategories.AjaxToolTip,{targets:[A],targetElTag:"img",tTipShowOnFocus:0});if($get("hideMeButton").firstChild.getAttribute("IsPublic")=="false"){this._exViewTTo.setContent(MySpaceRes.ViewAllFriendsPage.UnHideToolTip)}else{this._exViewTTo.setContent(MySpaceRes.ViewAllFriendsPage.HideToolTip)}}},editCatCB:function(D,G){if(G.cName){this._catDD.options[this._catDD.selectedIndex].innerHTML=G.cName;var B=this._catDD.options[this._catDD.selectedIndex].text;if(B.length>this.MAX_DD_NAME_LEN){B=B.substring(0,this.MAX_DD_NAME_LEN)+"..."}this._catDD.options[this._catDD.selectedIndex].innerHTML=B;B=G.cName;var A=getElementsByClassName(this._ownViewo,"a","categoryNameLabel")[0];A.innerHTML=this._encodeAmpersands(B.call(TextFilterWBR));B=G.cName;if(G.cName.length>this.MAX_AB_NAME_LEN){B=G.cName.substring(0,this.MAX_AB_NAME_LEN)+"..."}var F=getElementsByClassName(document.body,"a","catName");for(var C=0;C<F.length;C++){F[C].innerHTML=B}}if(G.cDesc!="undefined"&&G.cDesc!=null){var E=getElementsByClassName(this._ownViewo,"p","categoryDescLabel")[0];E.innerHTML=this._encodeAmpersands(G.cDesc);MySpace.Util.applyWBRToElement(E,{frequency:12});if(G.isTopFriend&&G.el){G.el.innerHTML=G.cDesc.length?MySpaceRes.ViewAllFriendsPage.TopFriendsEditDescription:MySpaceRes.ViewAllFriendsPage.TopFriendsAddDescription}}if(G.cPriv){getElementsByClassName(this._ownViewo,"span","categoryDefBold")[0].innerHTML=G.cPriv}},setCategoryPrivacyStatus:function(D,B,E,A,G){var C=E.getAttribute("IsPublic")=="false";var F=getElementsByClassName($get("myfriends"),"img","hiddenCatImage")[0];MySpace.Web.Modules.Friends.Services.FriendsService.UpdateMembershipStatus(D,C);if(C){E.innerHTML=A;E.setAttribute("IsPublic","true");_viewFriendso._exViewTTo.setContent(MySpaceRes.ViewAllFriendsPage.HideToolTip);F.style.visibility="hidden"}else{E.innerHTML=G;E.setAttribute("IsPublic","false");_viewFriendso._exViewTTo.setContent(MySpaceRes.ViewAllFriendsPage.UnHideToolTip);F.style.visibility="visible"}},_encodeAmpersands:function(A){A=A.replace(/&$/g,"&amp;");A=A.replace(/\s&$/g," &amp;");A=A.replace(/\s&\s/g," &amp; ");return A}};FriendsCategories.ViewCats=function(){this._isReqOwner;this._catIds;this._catNames;this._catDescs;this._catPrivs};FriendsCategories.ViewCats.registerClass("FriendsCategories.ViewCats");FriendsCategories.ViewCats.prototype={initialize:function(D,B,K,H,C,F,I){FriendsCategories.ViewCats.initializeBase(this);this._isReqOwner=D;this._catIds=B;this._catNames=H;this._catPrivs=F;this._catDescs=C;var J=getElementsByClassName($get("myfriends"),"div","categoryListView");for(var A=0;A<J.length;A++){var G=getElementsByClassName(J[A],"a","_editCatLink");if(G.length>0){var E=new FriendsCategories.EditCat();E.init(G[0],this._catIds[A],this._catNames[A],this._catDescs[A],this._catPrivs[A],K[A]);E.addEditCatClicked(Function.createDelegate(J[A],this.editCatCB))}}if(this._isReqOwner&&(!I)){this.setOwnerViewTips()}else{this.setVisitorViewTips()}this.setHiddenViewTips();this.setCatWBR();this.setHideLinksTips()},setCatWBR:function(){var C=getElementsByClassName($get("myfriends"),"a","categoryNameLabel");for(var A=0;A<C.length;A++){MySpace.Util.applyWBRToElement(C[A],{frequency:12})}var B=getElementsByClassName($get("myfriends"),"p","categoryDescLabel");for(var A=0;A<B.length;A++){MySpace.Util.applyWBRToElement(B[A],{frequency:12})}},editCatCB:function(C,D){if(D.cName){var A=getElementsByClassName(this,"a","categoryNameLabel")[0];A.innerHTML=viewCatso._encodeAmpersands(D.cName.call(TextFilterWBR))}if(D.cPriv){var E=getElementsByClassName(this,"span","categoryDefBold")[0];E.innerHTML=D.cPriv}if(D.cDesc!="undefined"&&D.cDesc!=null){var B=getElementsByClassName(this,"p","categoryDescLabel")[0];B.innerHTML=viewCatso._encodeAmpersands(D.cDesc);MySpace.Util.applyWBRToElement(B,{frequency:12});if(D.isTopFriend&&D.el){D.el.innerHTML=D.cDesc.length?MySpaceRes.ViewAllFriendsPage.TopFriendsEditDescription:MySpaceRes.ViewAllFriendsPage.TopFriendsAddDescription}}},setOwnerViewTips:function(){var A=new Sys.StringBuilder("");A.append("<div id='' class='toolTipDefText'>");A.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipHelpText);A.append("</div>");A.append("<br />");A.append("<span id='' class='toolTipDefLabel'>");A.append(MySpaceRes.ViewAllFriendsPage.JustMeCategorySecurityLabel);A.append(":&nbsp;</span>");A.append("<span id='' class='toolTipDefText'>");A.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipJustMe);A.append("</span>");A.append("<br />");A.append("<br />");A.append("<span id='' class='toolTipDefLabel'>");A.append(MySpaceRes.ViewAllFriendsPage.MembersOnlyCategorySecurityLabel);A.append(":&nbsp;</span>");A.append("<span id='' class='toolTipDefText'>");A.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipMembersOnly);A.append("</span>");A.append("<br />");A.append("<br />");A.append("<span id='' class='toolTipDefLabel'>");A.append(MySpaceRes.ViewAllFriendsPage.EveryoneCategorySecurityLabel);A.append(":&nbsp;</span>");A.append("<span id='' class='toolTipDefText'>");A.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipEveryone);A.append("</span>");A.append("<br />");var B=$create(FriendsCategories.AjaxToolTip,{targetElCss:"categoryHelpImg",targetElTag:"img",tTipCss:"BluePopupDiv",tTipPtrCss:"BluePopupPointer",tTipTextCss:"BluePopupText",tTipShowOnFocus:0});B.tTipContent=A},setVisitorViewTips:function(){var B=new Sys.StringBuilder("");B.append("<span id='' class='toolTipDefLabel'>");B.append(MySpaceRes.ViewAllFriendsPage.MembersOnlyCategorySecurityLabel);B.append(":&nbsp;</span>");B.append("<span id='' class='toolTipDefText'>");B.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipMembersOnly);B.append("</span>");B.append("<br />");B.append("<br />");B.append("<span id='' class='toolTipDefLabel'>");B.append(MySpaceRes.ViewAllFriendsPage.EveryoneCategorySecurityLabel);B.append(":&nbsp;</span>");B.append("<span id='' class='toolTipDefText'>");B.append(MySpaceRes.ViewAllFriendsPage.PrivacyTooltipEveryone);B.append("</span>");B.append("<br />");var A=$create(FriendsCategories.AjaxToolTip,{targetElCss:"categoryHelpImg",targetElTag:"img",tTipCss:"BluePopupDiv",tTipPtrCss:"BluePopupPointer",tTipTextCss:"BluePopupText",tTipShowOnFocus:0});A.tTipContent=B},setHiddenViewTips:function(){var B=new Sys.StringBuilder("");B.append("<div id='' class=''>");B.append(MySpaceRes.ViewAllFriendsPage.ToolTipHiddenFriends);B.append("</div>");var A=$create(FriendsCategories.AjaxToolTip,{targetElCss:"hiddenFriendsImg",targetElTag:"img",tTipCss:"BluePopupDiv2",tTipPtrCss:"BluePopupPointer2",tTipTextCss:"BluePopupText2",tTipShowOnFocus:0});A.tTipContent=B},setHideLinksTips:function(){var A=getElementsByClassName($get("myfriends"),"img","hidelinktooltip");if(A!=null&&A.length>0){this._hideLinkCatTip=$create(FriendsCategories.AjaxToolTip,{tTipCss:"BluePopupDiv2",tTipPtrCss:"BluePopupPointer2",tTipTextCss:"BluePopupText2",tTipShowOnFocus:0});for(var B=0;B<A.length;B++){$addHandlers(A[B],{mouseover:this.ShowHideLinkTip,mouseout:this.HideHideLinkTip},this)}}},ShowHideLinkTip:function(A){if(this._hideLinkCatTip){var B=(A.target.getAttribute("IsPublic")=="true");if(B){this._hideLinkCatTip.setContent(MySpaceRes.ViewAllFriendsPage.HideToolTip)}else{this._hideLinkCatTip.setContent(MySpaceRes.ViewAllFriendsPage.UnHideToolTip)}this._hideLinkCatTip.show(A)}},HideHideLinkTip:function(A){this._hideLinkCatTip.hide(A)},_encodeAmpersands:function(A){A=A.replace(/&$/g,"&amp;");A=A.replace(/\s&$/g," &amp;");A=A.replace(/\s&\s/g," &amp; ");return A}};var viewCatso=new FriendsCategories.ViewCats();FriendsCategories.UrlHelper=function(){};FriendsCategories.UrlHelper.registerClass("FriendsCategories.UrlHelper");FriendsCategories.UrlHelper=function(A){this.fullUrl=A;this.basePath=this.fullUrl;this.query="";if(this.fullUrl.indexOf("?")>-1){qSplit=this.fullUrl.split("?");for(var B=1;B<qSplit.length;B++){this.query+=qSplit[B]}if(this.query.indexOf("#")>-1){this.query=this.query.substring(0,this.query.indexOf("#"))}this.basePath=qSplit[0]}};FriendsCategories.UrlHelper.prototype={GetQueryPair:function(B){var A=this.query.indexOf(B+"=")-1;if(A>-1){var C=this.query.indexOf("&",A+1);if(C==-1){C=this.query.length}return this.query.substring(A,C)}return null},GetQueryValue:function(A){var B=this.GetQueryPair(A);if(B!=null&&B.indexOf("=")>-1){return B.split("=")[1]}else{return null}},SetQueryValue:function(A,C,B){if(B){C=escape(C)}if(this.query.length>0){var D=this.GetQueryPair(A);if(D!=null){this.query=this.query.replace(D,"&"+A+"="+C)}else{this.query+="&"+A+"="+C}}else{this.query=A+"="+C}},RemoveQueryPair:function(A){var B=this.GetQueryPair(A);if(B!=null){this.query=this.query.replace(B,"")}},ToUrl:function(){return this.basePath+"?"+this.query}};Type.registerNamespace("MySpace.FriendsCategories.SearchText");MySpace.FriendsCategories.SearchText=function(){this._searchInputId=null;this._searchUrl=null;this._attachFriendSelector=false;this._displayUserId=null;MySpace.FriendsCategories.SearchText.initializeBase(this)};MySpace.FriendsCategories.SearchText.prototype={_quickFindBtn:null,_searchInput:null,_urlHelper:null,initialize:function(){MySpace.FriendsCategories.SearchText.callBaseMethod(this,"initialize");this._searchInput=$get(this._searchInputId);if(this._searchInput){$addHandler(this._searchInput,"blur",Function.createDelegate(this,this.onBlurSearchText));$addHandler(this._searchInput,"focus",Function.createDelegate(this,this.onFocusSearchText));$addHandler(this._searchInput,"keypress",Function.createDelegate(this,this.submitFormOnEnter));if(this._attachFriendSelector){this.attachFriendSelector()}}this._quickFindBtn=$get("quickfindbutton");if(this._quickFindBtn){$addHandler(this._quickFindBtn,"click",Function.createDelegate(this,this.onClickQuickFind))}this._urlHelper=new FriendsCategories.UrlHelper(this._searchUrl);this._CheckSearchTextBox()},dispose:function(){this._searchInput=null;this._quickFindBtn=null;MySpace.FriendsCategories.SearchText.callBaseMethod(this,"dispose")},onBlurSearchText:function(){if(this._searchInput.value==""){this._searchInput.value=MySpaceRes.ViewAllFriendsPage.SearchWithin;this._searchInput.className="inp grey"}},onFocusSearchText:function(){if(this._searchInput.className=="inp grey"){this._searchInput.value="";this._searchInput.className="inp"}},submitFormOnEnter:function(A){A=A||window.event;if(!A){return}if((A.which==13)||(A.keyCode==13)||(A.charCode==13)){this._quickFindBtn.click();A.preventDefault()}},onClickQuickFind:function(A){A=A||window.event;if(!A){return}if(this._searchInput.className=="inp grey"||this._searchInput.value.trim().length==0){return}this._urlHelper.SetQueryValue("qFriends",encodeURIComponent(this._searchInput.value.trim()),false);if(this._urlHelper.ToUrl().toLowerCase().indexOf("user.edittopfriends")!=-1){return}location.href=this._urlHelper.ToUrl();A.preventDefault()},_CheckSearchTextBox:function(){if(!this._searchInput){return}if(this._searchInput.value==MySpaceRes.ViewAllFriendsPage.SearchWithin){this._searchInput.className="inp grey"}else{this._searchInput.className="inp"}},attachFriendSelector:function(){if(!this._searchInput){return}var A=this._searchInput;var B=this;$create(MySpace.UI.FriendSelector,{minimumPrefixLength:1,firstRowSelected:false,showSelectedUserImg:true,userId:this._displayUserId,useWebService:true},{itemSelected:function(E,D){A.value=D.get_value()?D.get_value().DisplayName:"";B._quickFindBtn.click();var C=getElementsByClassName($get("friends_search"),"div","friendSelect")[0];if(C){if(D.get_value()){B._quickFindBtn.style.marginTop=(C.offsetHeight-B._quickFindBtn.offsetHeight)/2+"px";C.style.padding="1px"}else{C.style.padding="4px";B._quickFindBtn.style.marginTop="-3px"}}}},null,this._searchInput);MySpace.UI.addStyles(".searchcaption{clear:both;} .friendSelect{float:left;padding:4px;} input.inp {border:0 none; padding:0px;} .friendSelect .selected{width:100%;} button#quickfindbutton{margin-top:-3px;margin-left:5px;}",false,"FriendQuickSearchFriendSelector")}};MySpace.FriendsCategories.SearchText.registerClass("MySpace.FriendsCategories.SearchText",Sys.Component);function submitFormOnEnter(C,B){var D=B?B:window.event;if(!D){return true}if((D.which==13)||(D.keyCode==13)){var A=$get(C);A.click();return false}return true}function resetBox(A){if(A.defaultValue==A.value){A.value="";A.className="inp"}}function blurBox(A){if(A.value==""){A.value=A.defaultValue;A.className="inp grey"}}function ResetSearchText(A){if(A.className=="inp grey"){A.value="";A.className="inp"}}function BlurSearchText(A){if(A.value==""){A.value=MySpaceRes.ViewAllFriendsPage.SearchWithin;A.className="inp grey"}}function ValidateSearchText(A){if(searchTextBox.className=="inp grey"||searchTextBox.value.length==0){return false}self.location.href=A;return false}function CheckSearchTextBox(){if(searchTextBox==null){return}if(searchTextBox.value==MySpaceRes.ViewAllFriendsPage.SearchWithin){searchTextBox.className="inp grey"}else{searchTextBox.className="inp"}}function setServicePath(A){MySpace.Web.Modules.Friends.Services.FriendsService.set_path(A);Sys.Net.WebRequestManager.add_invokingRequest(onReqInvoke);Sys.Application.add_unload(onCatPgUnload)}function onReqInvoke(B,A){A.get_webRequest().get_headers()["hashChecker"]=$get("hashChecker").value}function onCatPgUnload(B,A){Sys.Net.WebRequestManager.remove_invokingRequest(onReqInvoke)}function ExitSuggestionPopup(){var A=parent.window.get_iframepopup();if(null!==A&&"undefined"!==typeof(A)){A.hide()}}FriendsCategories.AlphaBar=function(){var A=this;this.alphaLinks=new Array();this.pagerLinks=new Array();this._container=null;this._events=null;this.AlphabarUnload=function(){A.ClearAlpha();A.ClearPager();A=null};this.ClearAlpha=function(){for(var B=0;B<A.alphaLinks.length;B++){$removeHandler(A.alphaLinks[B],"click",A.AlphaLinkClicked)}A.alphaLinks=null};this.ClearPager=function(){if(A.pagerLinks){for(var B=0;B<A.pagerLinks.length;B++){$removeHandler(A.pagerLinks[B],"click",A.PagerLinkClicked)}}A.pagerLinks=null};this.AlphaLinkClicked=function(B){A._RaiseEvent("alphaLinkClicked",B.target);B.preventDefault()};this.PagerLinkClicked=function(B){var C=B.target.className.toLowerCase();if(!(C.indexOf("highlight")>-1||C.indexOf("disabled")>-1)){A._RaiseEvent("pagerLinkClicked",B.target)}B.preventDefault()}};FriendsCategories.AlphaBar.prototype={Initialize:function(A){this._container=A;this.SetUpAlphaLinks(A);Sys.Application.add_unload(this.AlphabarUnload)},SetUpAlphaLinks:function(A){var C=A.getElementsByTagName("A");for(var B=0;B<C.length;B++){if(C[B].className.toLowerCase().indexOf("alphabarlink")>-1){$addHandler(C[B],"click",this.AlphaLinkClicked);Array.add(this.alphaLinks,C[B])}else{if(C[B].className.toLowerCase().indexOf("paginglink")>-1||(C[B].className=="highlight"&&C[B].parentNode.className=="nav_left")){$addHandler(C[B],"click",this.PagerLinkClicked);Array.add(this.pagerLinks,C[B])}}}},AdjustAlphaTitle:function(B){var A=17;if(B&&B.length>A){B=B.substring(0,A)+"..."}return B},UpdateAlpha:function(C){C=this.AdjustAlphaTitle(C);for(var B=0;B<this.alphaLinks.length;B++){var A=this.alphaLinks[B];if(A.innerHTML==C){Sys.UI.DomElement.addCssClass(A,"highlight")}else{Sys.UI.DomElement.removeCssClass(A,"highlight")}}},UpdateAlphaTitle:function(A){A=this.AdjustAlphaTitle(A);for(var B=0;B<this.alphaLinks.length;B++){if(this.alphaLinks[B].className.indexOf("catName")>-1){this.alphaLinks[B].innerHTML=A}}},UpdatePager:function(B,C,E,F){for(var D=0;D<this.pagerLinks.length;D++){var A=this.pagerLinks[D];if(A.innerHTML==B){A.className="pagingLink";A.href="GotoPage("+B+")"}else{if(A.innerHTML==C){A.className="highlight";A.removeAttribute("href")}else{if(Sys.UI.DomElement.containsCssClass(A,"prevPagingLink")){if(E>0){A.href="GotoPage("+E+")";Sys.UI.DomElement.removeCssClass(A,"disabledPaging")}else{A.removeAttribute("href");Sys.UI.DomElement.addCssClass(A,"disabledPaging")}}else{if(Sys.UI.DomElement.containsCssClass(A,"nextPagingLink")){if(F>0){A.href="GotoPage("+F+")";Sys.UI.DomElement.removeCssClass(A,"disabledPaging")}else{A.removeAttribute("href");Sys.UI.DomElement.addCssClass(A,"disabledPaging")}}}}}}},HidePager:function(A){for(var B=0;B<A.length;B++){A[B].style.visibility="hidden"}},ShowPager:function(A){for(var B=0;B<A.length;B++){A[B].style.visibility="visible"}},ResetPager:function(A){A.style.visibility="visible";if(this.alphaLinks&&this.alphaLinks.length>0){Sys.UI.DomElement.addCssClass(A.childNodes[0],"alphaLine")}var C=A.getElementsByTagName("A");if(this.pagerLinks==null){this.pagerLinks=new Array()}for(var B=0;B<C.length;B++){$addHandler(C[B],"click",this.PagerLinkClicked);Array.add(this.pagerLinks,C[B])}},AddAlphaLinkClicked:function(A){this.GetEvents().addHandler("alphaLinkClicked",A)},AddPagerLinkClicked:function(A){this.GetEvents().addHandler("pagerLinkClicked",A)},DisableHandlers:function(B){for(var A=0;A<this.alphaLinks.length;A++){$removeHandler(this.alphaLinks[A],"click",this.AlphaLinkClicked);$addHandler(this.alphaLinks[A],"click",this.DisabledLinkClick);if(B){this.alphaLinks[A].style.color="gray"}if(this.alphaLinks[A].href){this.alphaLinks[A].setAttribute("hrefback",this.alphaLinks[A].href);this.alphaLinks[A].removeAttribute("href")}}if(this.pagerLinks){for(var A=0;A<this.pagerLinks.length;A++){$removeHandler(this.pagerLinks[A],"click",this.PagerLinkClicked);$addHandler(this.pagerLinks[A],"click",this.DisabledLinkClick);if(B){this.pagerLinks[A].style.color="gray"}if(this.pagerLinks[A].href){this.pagerLinks[A].setAttribute("hrefback",this.pagerLinks[A].href);this.pagerLinks[A].removeAttribute("href")}}}},EnableHandlers:function(){for(var A=0;A<this.alphaLinks.length;A++){$removeHandler(this.alphaLinks[A],"click",this.DisabledLinkClick);$addHandler(this.alphaLinks[A],"click",this.AlphaLinkClicked);this.alphaLinks[A].style.color="";if(this.alphaLinks[A].getAttribute("hrefback")){this.alphaLinks[A].setAttribute("href",this.alphaLinks[A].getAttribute("hrefback"));this.alphaLinks[A].removeAttribute("hrefback")}}if(this.pagerLinks){for(var A=0;A<this.pagerLinks.length;A++){$removeHandler(this.pagerLinks[A],"click",this.DisabledLinkClick);$addHandler(this.pagerLinks[A],"click",this.PagerLinkClicked);this.pagerLinks[A].style.color="";if(this.pagerLinks[A].getAttribute("hrefback")){this.pagerLinks[A].setAttribute("href",this.pagerLinks[A].getAttribute("hrefback"));this.pagerLinks[A].removeAttribute("hrefback")}}}},DisabledLinkClick:function(){return false},GetEvents:function(){if(!this._events){this._events=new Sys.EventHandlerList()}return this._events},_RaiseEvent:function(B,A){var C=this.GetEvents().getHandler(B);if(C){if(!A){A=Sys.EventArgs.Empty}C(this,A)}}};Type.registerNamespace("MySpace.Friends");MySpace.Friends.ResultsContainer=function(A){MySpace.Friends.ResultsContainer.initializeBase(this,[A]);this._clickDelegate=null;this._page=1;this._bottomLinksContainer=null;this._ajaxLoader=null;this._results=[];this._lastResultTimeStamp=null;this._personalFeed=false;this._activityType=null;this._userId=0;this._includeHistory=true;this._itemsPerPage=20;this._totalCount=0;this._showMoreLink=null;this._categoryId=0;this._clearResult=true;this._resultCount=0};MySpace.Friends.ResultsContainer.prototype={get_resultCount:function(){return this._resultCount},set_resultCount:function(A){this._resultCount=A},get_clearResult:function(){return this._clearResult},set_clearResult:function(A){this._clearResult=A},get_categoryId:function(){return this._categoryId},set_categoryId:function(A){this._categoryId=A},get_showMoreLink:function(){return this._showMoreLink},set_showMoreLink:function(A){this._showMoreLink=A},get_totalCount:function(){return this._totalCount},set_totalCount:function(A){this._totalCount=A},get_includeHistory:function(){return this._includeHistory},set_includeHistory:function(A){this._includeHistory=A},get_itemsPerPage:function(){return this._itemsPerPage},set_itemsPerPage:function(A){this._itemsPerPage=A},get_lastResultTimeStamp:function(){return this._lastResultTimeStamp},set_lastResultTimeStamp:function(A){this._lastResultTimeStamp=A},get_personalFeed:function(){return this._personalFeed},set_personalFeed:function(A){this._personalFeed=A},get_activityType:function(){return this._activityType},set_activityType:function(A){this._activityType=A},get_userId:function(){return this._userId},set_userId:function(A){this._userId=A},add_click:function(A){this.get_events().addHandler("click",A)},remove_click:function(A){this.get_events().removeHandler("click",A)},set_page:function(A){this._page=A},get_page:function(){return this._page},_clearResults:function(){var A=this.get_element();A.innerHTML=""},_processResult:function(D){var B=this.get_element();var C=document.createElement("div");this._totalCount=D.TotalCount;var A=$create(MySpace.Friends.Result,{comments:D.Comments,totalCount:D.TotalCount,displayName:D.DisplayName,mood:D.Mood,title:D.Title,source:D.Source,activityType:D.ActivityType,profileImageLink:D.ProfileImageUrl,userId:D.UserId,profileUrl:D.ProfileUrl,personalFeed:this._personalFeed,timeStamp:D.TimeStamp,dateTime:D.DateTime},null,null,C);A.set_parent(this);Array.add(this._results,A)},_renderHtml:function(){var C=this.get_element();var B=document.createElement("div");var F=document.createElement("a");var D=window.pageNum||this._page;var G=false;if(this._resultCount===50){if(this._totalCount<=(D*50)){G=true}}else{G=true}if(D>1){var A=document.createElement("div");Sys.UI.DomElement.addCssClass(A,"feed");this._bottomLinksContainer=$get("bottomLinks");C.insertBefore(A,this._bottomLinksContainer);Array.forEach(this._results,function(J,H,L){var I=J.get_element();A.appendChild(I);var K=document.createElement("div");Sys.UI.DomElement.addCssClass(K,"comments");I.childNodes[0].appendChild(K);if(inlineCommentsEnabled){K.id="comments_"+J._userId+"_"+J._timeStamp.TicksInt32;MySpace.UI.InlineComment.show(J._userId,J._timeStamp.TicksInt32,J._comments,J._comment.id,K.id)}},this)}else{var E=document.createElement("div");Sys.UI.DomElement.addCssClass(E,"feed");C.appendChild(E);F.setAttribute("id","showmore");F.setAttribute("href","javascript:void(0)");F.innerHTML=MySpaceRes.Status.ShowMore;this._showMoreLink=F;B.setAttribute("id","bottomLinks");B.appendChild(F);C.appendChild(B);Array.forEach(this._results,function(J,H,L){var I=J.get_element();E.appendChild(I);var K=document.createElement("div");Sys.UI.DomElement.addCssClass(K,"comments");I.childNodes[0].appendChild(K);if(inlineCommentsEnabled){K.id="comments_"+J._userId+"_"+J._timeStamp.TicksInt32;MySpace.UI.InlineComment.show(J._userId,J._timeStamp.TicksInt32,J._comments,J._comment.id,K.id)}},this);this._bottomLinksContainer=B;Sys.UI.DomElement.addCssClass(B,"bottomLinks");Sys.UI.DomElement.addCssClass(B,"clearfix");Sys.UI.DomElement.addCssClass(F,"showmore");Sys.UI.DomEvent.addHandler(F,"click",this._clickDelegate)}if(this._ajaxLoader!=null){this._ajaxLoader.style.display="none"}if(G){this._bottomLinksContainer.style.display="none";window.pageNum=null;this._page=null}else{this._bottomLinksContainer.style.display="block"}},_showEmptyResult:function(){var A=document.createElement("div");Sys.UI.DomElement.addCssClass(A,"emptyDiv");this.get_element().appendChild(A);A.innerHTML=MySpaceRes.Status.NoResults;if(this._ajaxLoader!=null){this._ajaxLoader.style.display="none"}},_getResults:function(){var A=this.get_element();if(this._ajaxLoader!=null){this._ajaxLoader.style.display="block"}MySpace.Web.Modules.Friends.Services.FriendsService.set_path(friendsServicePath);MySpace.Web.Modules.Friends.Services.FriendsService.GetStatusMoods(this._userId,this._personalFeed,this._includeHistory,this._categoryId,this._page,this._onSuccess,this._onFailure,this)},_onSuccess:function(A,C,B){if(A!=null){if(A==""){C._showEmptyResult()}try{Array.clear(C._results);C._resultCount=A.length;for(x=0;x<A.length;x++){C._processResult(A[x])}C._renderHtml()}catch(D){C._processException(D)}}else{C._showEmptyResult()}},_onFailure:function(A,C,B){C._processException(B)},_processException:function(B){var A=this.get_element();if(this._testMode===true){alert(B)}else{A.innerHTML=MySpaceRes.Status.StatusMoodUnavailable}},initialize:function(){if(this._clearResult){this._clearResults()}if(this._clickDelegate===null){this._clickDelegate=Function.createDelegate(this,this._clickHandler)}this._ajaxLoader=$get("ajaxLoader");this._getResults();MySpace.Friends.ResultsContainer.callBaseMethod(this,"initialize")},dispose:function(){var A=this.get_element();if(this._clickDelegate){Sys.UI.DomEvent.removeHandler($get("stream"),"click",this._clickDelegate);delete this._clickDelegate}MySpace.Friends.ResultsContainer.callBaseMethod(this,"dispose")},_clickHandler:function(B){var A=this.get_events().getHandler("click");if(A){A(this,Sys.EventArgs.Empty)}this._page+=1;this._getResults()}};MySpace.Friends.ResultsContainer.registerClass("MySpace.Friends.ResultsContainer",Sys.UI.Control);MySpace.Friends.Result=function(A){MySpace.Friends.Result.initializeBase(this,[A]);this._userId=null;this._displayName=null;this._isMDPActivity=false;this._activityType=null;this._timeStamp=null;this._personalFeed=false;this._profileUrl=null;this._profileImageLink=null;this._dateTime=null;this._source=null;this._title=null;this._viewAllClickDelegate=null;this._deleteClickDelegate=null;this._postCommentClickDelegate=null;this._postMessageClickDelegate=null;this._clickDelegate=null;this._hoverDelegate=null;this._unhoverDelegate=null;this._totalCount=0;this._mood=null;this._comments=null};MySpace.Friends.Result.prototype={get_comments:function(){return this._comments},set_comments:function(A){this._comments=A},get_mood:function(){return this._mood},set_mood:function(A){this._mood=A},get_totalCount:function(){return this._totalCount},set_totalCount:function(A){this._totalCount=A},get_personalFeed:function(){return this._personalFeed},set_personalFeed:function(A){this._personalFeed=A},get_profileUrl:function(){return this._profileUrl},set_profileUrl:function(A){this._profileUrl=A},get_dateTime:function(){return this._dateTime},set_dateTime:function(A){this._dateTime=A},get_source:function(){return this._source},set_source:function(A){this._source=A},get_profileImageLink:function(){return this._profileImageLink},set_profileImageLink:function(A){this._profileImageLink=A},get_displayName:function(){return this._displayName},set_displayName:function(A){this._displayName=A},get_activityType:function(){return this._activityType},set_activityType:function(A){this._activityType=A},get_title:function(){return this._title},set_title:function(A){this._title=A},get_timeStamp:function(){return this._timeStamp},set_timeStamp:function(A){this._timeStamp=A},get_userId:function(){return this._userId},set_userId:function(A){this._userId=A},add_viewAllClick:function(A){this.get_events().addHandler("viewAllClick",A)},remove_viewAllClick:function(A){this.get_events().removeHandler("viewAllClick",A)},add_deleteClick:function(A){this.get_events().addHandler("deleteClick",A)},remove_deleteClick:function(A){this.get_events().removeHandler("deleteClick",A)},add_postCommentClick:function(A){this.get_events().addHandler("postCommentClick",A)},remove_postCommentClick:function(A){this.get_events().removeHandler("postCommentClick",A)},add_postMessageClick:function(A){this.get_events().addHandler("postMessageClick",A)},remove_postMessageClick:function(A){this.get_events().removeHandler("postMessageClick",A)},add_click:function(A){this.get_events().addHandler("click",A)},remove_click:function(A){this.get_events().removeHandler("click",A)},add_hover:function(A){this.get_events().addHandler("mouseover",A)},remove_hover:function(A){this.get_events().removeHandler("mouseover",A)},add_unhover:function(A){this.get_events().addHandler("mouseout",A)},remove_unhover:function(A){this.get_events().removeHandler("mouseout",A)},render:function(){var A=this.get_element();A.innerHTML=this.get_profileUrl()},initialize:function(){var C=this.get_element();var H=document.createElement("div");Sys.UI.DomElement.addCssClass(H,"content");var L=document.createElement("div");Sys.UI.DomElement.addCssClass(L,"profileImage");if(standAloneView){L.style.display="none"}var J=document.createElement("a");J.setAttribute("href",this._profileUrl);L.innerHTML=this._profileImageLink;H.appendChild(L);MySpace.UI._ProfileImageLink.init(L.firstChild);var G=document.createElement("div");Sys.UI.DomElement.addCssClass(G,"titleBody");var E=document.createElement("div");Sys.UI.DomElement.addCssClass(E,"title");var K=document.createElement("span");K.innerHTML=this._title;E.appendChild(K);G.appendChild(E);var F=document.createElement("div");Sys.UI.DomElement.addCssClass(F,"body");var M=document.createElement("div");Sys.UI.DomElement.addCssClass(M,"mood");M.innerHTML=this._mood;G.appendChild(M);var A=this._viewmore=document.createElement("a");A.setAttribute("href",statusMoodURL+"&friendId="+this._userId);Sys.UI.DomElement.addCssClass(A,"pipeItem");var D=this._comment=document.createElement("a");D.id="comment_"+this._createCommentId();Sys.UI.DomElement.addCssClass(D,"pipeItem");if(quickPostCommentEnabled&&!inlineCommentsEnabled){D.setAttribute("href","javascript:void(0)");if(this._postCommentClickDelegate===null){this._postCommentClickDelegate=Function.createDelegate(this,this._postCommentHandler)}Sys.UI.DomEvent.addHandler(D,"click",this._postCommentClickDelegate)}else{if(!quickPostCommentEnabled&&!inlineCommentsEnabled){D.setAttribute("href",commentURL.replace("{0}",this._userId))}else{D.setAttribute("href","javascript:void(0)")}}var O=this._message=document.createElement("a");if(quickPostMessagingEnabled){O.setAttribute("href","javascript:void(0);");if(this._postMessageClickDelegate===null){this._postMessageClickDelegate=Function.createDelegate(this,this._postMessageHandler)}Sys.UI.DomEvent.addHandler(O,"click",this._postMessageClickDelegate)}else{O.setAttribute("href","/Modules/Messaging/Pages/SendMessage.aspx?fuseaction=mail.message&friendID="+this._userId)}D.innerHTML=MySpaceRes.HomeDisplay.Comment;O.innerHTML=MySpaceRes.HomeDisplay.Message;A.innerHTML=MySpaceRes.HomeDisplay.ViewMore;if(this._personalFeed===false&&this._userId!=MySpace.ClientContext.UserId){if(this._viewAllClickDelegate===null){this._viewAllClickDelegate=Function.createDelegate(this,this._viewAllClickHandler)}Sys.UI.DomEvent.addHandler(A,"click",this._viewAllClickDelegate);F.appendChild(A);F.appendChild(D);F.appendChild(O)}else{if(this._personalFeed===false&&this._userId===MySpace.ClientContext.UserId){if(this._viewAllClickDelegate===null){this._viewAllClickDelegate=Function.createDelegate(this,this._viewAllClickHandler)}Sys.UI.DomEvent.addHandler(A,"click",this._viewAllClickDelegate);F.appendChild(A);if(inlineCommentsEnabled){F.appendChild(D);D.style.border="none"}else{Sys.UI.DomElement.addCssClass(A,"lastItem")}}else{if(this._personalFeed===true&&this._userId!==MySpace.ClientContext.UserId){F.appendChild(D);F.appendChild(O)}else{if(this._personalFeed===true&&this._userId==MySpace.ClientContext.UserId){if(inlineCommentsEnabled){F.appendChild(D);D.style.border="none"}}}}}G.appendChild(F);if(this._userId===MySpace.ClientContext.UserId){var B=document.createElement("div");Sys.UI.DomElement.addCssClass(B,"delete");var I=document.createElement("a");I.setAttribute("href","javascript:void(0)");var N=document.createElement("img");N.setAttribute("src","http://x.myspacecdn.com/modules/friends/static/img/delete_icon_gray.gif");N.title=MySpaceRes.Status.DeleteThisUpdate;I.appendChild(N);B.appendChild(I);if(this._deleteClickDelegate===null){this._deleteClickDelegate=Function.createDelegate(this,this._deleteClickHandler)}Sys.UI.DomEvent.addHandler(I,"click",this._deleteClickDelegate)}H.appendChild(G);C.appendChild(H);if(B){C.appendChild(B)}if(this._clickDelegate===null){this._clickDelegate=Function.createDelegate(this,this._clickHandler)}Sys.UI.DomEvent.addHandler(C,"click",this._clickDelegate);if(this._hoverDelegate===null){this._hoverDelegate=Function.createDelegate(this,this._hoverHandler)}Sys.UI.DomEvent.addHandler(C,"mouseover",this._hoverDelegate);if(this._unhoverDelegate===null){this._unhoverDelegate=Function.createDelegate(this,this._unhoverHandler)}Sys.UI.DomEvent.addHandler(C,"mouseout",this._unhoverDelegate);this.addCssClass("StatusMoodUpdate");this.addCssClass("result");this.addCssClass("clearfix");MySpace.Friends.Result.callBaseMethod(this,"initialize")},_createCommentId:function(){return this._userId+"_"+this._timeStamp.TicksInt32},_viewAllClickHandler:function(B){if(B.button==0){B.target.setAttribute("href","javascript:void(0);")}var A=this.get_events().getHandler("viewAllClick");if(A){A(this,Sys.EventArgs.Empty)}if($get("chkOneUpdate")){$get("chkOneUpdate").checked=false}window.scrollTo(0,0);if(this._userId!==MySpace.ClientContext.UserId){window.fs.selectFriendById(this._userId)}else{$get("selectedCategoryId").value=1;if(window.categoryComboBox._completionItems){window.categoryComboBox.set_value(window.categoryComboBox._completionItems[$get("selectedCategoryId").value].text,true);$create(MySpace.Friends.ResultsContainer,{personalFeed:true,userId:this._userId,activityType:"StatusMoodUpdate",includeHistory:true,categoryId:$get("selectedCategoryId").value},null,null,$get("stream"))}}return false},_postCommentHandler:function(B){var A=this.get_events().getHandler("postCommentClick");if(A){A(this,Sys.EventArgs.Empty)}MySpace.UI.ProfileCommentQuickPostPopup.show(B,this._userId)},_postMessageHandler:function(B){var A=this.get_events().getHandler("postMessageClick");if(A){A(this,Sys.EventArgs.Empty)}MySpace.UI.MessagingQuickPostPopup.show(new Sys.UI.DomEvent(B),this._userId)},_deleteClickHandler:function(E){var D=this.get_events().getHandler("deleteClick");if(D){D(this,Sys.EventArgs.Empty)}var C=document.createElement("div");var B=MySpace.UI.Popup.create(C,MySpaceRes.Status.ConfirmDelete);B.set_content(MySpaceRes.Status.DeleteStatusMoodUpdate);B.set_top(200);B.set_width(500);B.set_parent(this);var F=B.add_button(MySpaceRes.Comment.Yes,false,this._deleteResult);var A=B.add_button(MySpaceRes.Comment.No,false,function(){this._hide()});B.show()},_deleteResult:function(){var B=this._parent.get_element();var A=B.parentNode;A.removeChild(B);if(!A.firstChild){$get("showmore").style.display="none"}MySpace.Web.Modules.Friends.Services.FriendsService.set_path(friendsServicePath);if(typeof(this._parent._timeStamp.TicksInt32)==="number"){MySpace.Web.Modules.Friends.Services.FriendsService.DeleteStatusMoodWithTicks(MySpace.ClientContext.UserId,this._parent._timeStamp.TicksInt32,hashToken,this._onSuccess,this._onFailure,this)}this._hide()},_clickHandler:function(B){var A=this.get_events().getHandler("click");if(A){A(this,Sys.EventArgs.Empty)}},_hoverHandler:function(C){var B=this.get_events().getHandler("mouseover");if(B){B(this,Sys.EventArgs.Empty)}var A=this.get_element()},_unhoverHandler:function(C){var B=this.get_events().getHandler("mouseout");if(B){B(this,Sys.EventArgs.Empty)}var A=this.get_element()},dispose:function(){var A=this.get_element();if(this._viewAllClickDelegate){Sys.UI.DomEvent.removeHandler(this,"click",this._viewAllClickDelegate);delete this._viewAllClickDelegate}if(this._deleteClickDelegate){Sys.UI.DomEvent.removeHandler(this,"delete",this._deleteClickDelegate);delete this._deleteClickDelegate}if(this._clickDelegate){Sys.UI.DomEvent.removeHandler(this,"click",this._clickDelegate);delete this._clickDelegate}if(this._hoverDelegate){Sys.UI.DomEvent.removeHandler(this,"mouseover",this._hoverDelegate);delete this._hoverDelegate}if(this._unhoverDelegate){Sys.UI.DomEvent.removeHandler(this,"mouseout",this._unhoverDelegate);delete this._unhoverDelegate}MySpace.Friends.ResultsContainer.callBaseMethod(this,"dispose")}};MySpace.Friends.Result.registerClass("MySpace.Friends.Result",Sys.UI.Control);MySpace.Friends.Category=function(A){MySpace.Friends.Category.initializeBase(this,[A]);this._setDefault=false;this._clickDelegate=null};MySpace.Friends.Category.prototype={get_setDefault:function(){return this._setDefault},set_setDefault:function(A){this._setDefault=A},add_click:function(A){this.get_events().addHandler("click",A)},remove_click:function(A){this.get_events().removeHandler("click",A)},initialize:function(){this._getResults();var A=this.get_element();if(this._clickDelegate===null){this._clickDelegate=Function.createDelegate(this,this._clickHandler)}Sys.UI.DomEvent.addHandler(A,"click",this._clickDelegate);MySpace.Friends.Category.callBaseMethod(this,"initialize")},_getResults:function(){var A=this.get_element();MySpace.Web.Modules.Friends.Services.FriendsService.set_path(friendsServicePath);MySpace.Web.Modules.Friends.Services.FriendsService.GetCategoryList(this._onSuccess,this._onFailure,this)},_onSuccess:function(A,C,B){C._populateCategory(A)},_onFailure:function(A,C,B){C._processException(B)},_processException:function(A){},_populateCategory:function(B){var D=[];var F=$get("friendCat");var A=document.createElement("div");A.id="listWrapper";A.style.visibility="hidden";A.style.position="absolute";A.style.border="1px solid #666";A.style.marginRight=3+"px";A.style.paddingBottom=3+"px";A.style.backgroundColor="#fff";var G=document.createElement("div");G.id="list";A.appendChild(G);var C=document.createElement("div");C.style.margin=3+"px";C.style.paddingTop=3+"px";C.style.borderTop="1px solid #CCCCCC";var H=document.createElement("a");H.href=createCategoryUrl;H.innerHTML=MySpaceRes.Status.CreateAFriendCategory;C.appendChild(H);A.appendChild(C);F.appendChild(A);for(var E=0;E<B.length;E++){D.push({text:B[E].CategoryName,value:B[E].CategoryId})}window.categoryComboBox=$create(MySpace.UI.ComboBoxBehavior,{minimumPrefixLength:1,completionItems:["0"],completionInterval:500,completionListWrapperID:"listWrapper",completionListElementID:"list",completionListCssClass:"categoryList"},{itemSelected:Function.createDelegate(this,this._onCategoryChange)},null,MySpace.Utils.Selector.query(".CategoryComboBox",null,true));window.categoryComboBox.set_completionItems(D);if(window.userId===MySpace.ClientContext.UserId&&window.categoryFilter=="1"){$get("selectedCategoryId").value=1;window.categoryComboBox.set_value(D[1].text,true)}else{$get("selectedCategoryId").value=0;window.categoryComboBox.set_value(D[0].text,true)}},_onCategoryChange:function(B,A){showHideViewLink(true);if($get("selectedCategoryId").value===A.get_value()){return}$get("selectedCategoryId").value=A.get_value();window.fs.selectFriendById(null);if($get("selectedCategoryId").value!=="0"){if($get("chkOneUpdate").checked){$create(MySpace.Friends.ResultsContainer,{includeHistory:false,categoryId:A.get_value(),personalFeed:false,userId:MySpace.ClientContext.UserId,activityType:"StatusMoodUpdate"},null,null,$get("stream"))}else{if($get("selectedCategoryId").value==="1"){$create(MySpace.Friends.ResultsContainer,{includeHistory:true,categoryId:A.get_value(),personalFeed:true,userId:MySpace.ClientContext.UserId,activityType:"StatusMoodUpdate"},null,null,$get("stream"))}else{$create(MySpace.Friends.ResultsContainer,{includeHistory:true,categoryId:A.get_value(),personalFeed:false,userId:MySpace.ClientContext.UserId,activityType:"StatusMoodUpdate"},null,null,$get("stream"))}}}},_clickHandler:function(B){var A=this.get_events().getHandler("click");if(A){A(this,Sys.EventArgs.Empty)}window.categoryComboBox._toggleComboBoxList(B)},dispose:function(){if(this._clickDelegate){Sys.UI.DomEvent.removeHandler(this,"click",this._clickDelegate);delete this._clickDelegate}MySpace.Friends.Category.callBaseMethod(this,"dispose")}};MySpace.Friends.Category.registerClass("MySpace.Friends.Category",Sys.UI.Control);MySpace.Friends.Filter=function(){MySpace.Friends.Filter.initializeBase(this)};MySpace.Friends.Filter.prototype={ResetSearchText:function(A){if(A.id==="friendInput"){if(A.className=="inp grey"){A.value="";A.className="inp"}}},BlurSearchText:function(A){if(A.id==="friendInput"){if(A.value==""){A.value=MySpaceRes.Status.FilterByFriend;A.className="inp grey"}}},CheckSearchTextBox:function(B){var A=B;if(A===null){return}if(A.id==="friendInput"){if(A.value==MySpaceRes.Status.FilterByFriend){A.className="inp grey"}else{if(A.value===""){A.value=MySpaceRes.Status.FilterByFriend;A.className="inp grey"}else{A.className="inp"}}}},initialize:function(){MySpace.Friends.Filter.callBaseMethod(this,"initialize")},dispose:function(){MySpace.Friends.Filter.callBaseMethod(this,"dispose")}};MySpace.Friends.Filter.registerClass("MySpace.Friends.Filter",Sys.Component);if(typeof(Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()}function wireUpQuickPost(){if(MySpace&&MySpace.UI&&MySpace.UI.ProfileCommentQuickPostPopup){var B=MySpace.Utils.Selector.query("a.bdayAddComment");for(var A=0;A<B.length;A++){$addHandler(B[A],"click",MySpace.UI.ProfileCommentQuickPostPopup.show)}}};