MySpace.UI._FriendToolTip=function(){this.sendMsgUrl=null;this.addFriendUrl=null;this.addCommentUrl=null;this.addFriendQuickPostEnabled=false;this._localCache={};this._friendBoxes=[];MySpace.UI._FriendToolTip.initializeBase(this)};MySpace.UI._FriendToolTip.prototype={_localCache:null,_hideTimeoutID:null,_hideTimeoutInterval:250,_currentFriendId:0,_callStatus:{InProgress:1,Completed:2,Error:-1},_delayTimerId:null,_friendBoxes:null,_hMouseOver:false,_cHelperTimeoutId:null,_tooltip:null,_tooltipdiv:null,_showFriendToolTipWithImage:0,initialize:function(){MySpace.UI._FriendToolTip.callBaseMethod(this,"initialize");this.sendMsgUrl=this.sendMsgUrl.replace("%7b","{").replace("%7d","}");this.addFriendUrl=this.addFriendUrl.replace("%7b","{").replace("%7d","}");this.addCommentUrl=this.addCommentUrl.replace("%7b","{").replace("%7d","}");var A=this;this.mouseOutHandler=function(B){A._hMouseOver=false;A._setHideTimeout()};this.mouseOverHandler=function(B){A._hMouseOver=true;A._clearHideTimeout()};this._friendBoxes=MySpace.Utils.Selector.query(".friendToolTipBox, .friendToolTipBoxWithImage");this.attachHandlers(this._friendBoxes)},attachHandlers:function(A){for(var B=0;B<A.length;B++){A[B].fHelpero=this;$addHandler(A[B],"mouseover",Function.createDelegate(A[B],this._renderHelper));$addHandlers(A[B],{mouseout:this._cancelHelper},this)}},dispose:function(){if(this._cHelperTimeoutId){window.clearTimeout(this._cHelperTimeoutId);this._cHelperTimeoutId=null}for(var A=0;A<this._friendBoxes.length;A++){$clearHandlers(this._friendBoxes[A])}this._friendBoxes=null;MySpace.UI._FriendToolTip.callBaseMethod(this,"dispose")},_createFriendToolTip:function(){if(this._tooltip){return}this._tooltipdiv=document.createElement("div");var B=new Sys.StringBuilder("");B.append("<div id='tooltip' class='friendtooltip'>");B.append("<div class='bubble'>");B.append("<div id='fttprofileImage'><img id='fttProfileImageUrl' width='70' border='0' /></div>");B.append("<div id='fttContent'>");B.append("</div>");B.append("<ul>");B.append("<li class='msg'><a href='#' id='fttSendMsgLink'>"+MySpaceRes.FriendTooltip.SendMessage+"</a></li>");B.append("<li class='cmt'><a href='#' id='fttCommentLink'>"+MySpaceRes.FriendTooltip.AddComments+"</a></li>");B.append("<li class='add'><a href='#' id='fttAddLink'>"+MySpaceRes.FriendTooltip.AddToFriends+"</a></li>");B.append("</ul>");B.append("<div class='clear'></div>");B.append("</div>");B.append("</div>");this._tooltipdiv.innerHTML=B.toString();this.addStyles();var A=document.createElement("div");document.body.appendChild(A);this._tooltip=$create(MySpace.UI.Tooltip,{hover:false},null,null,A);$addHandlers(this._tooltip.get_element(),{mouseover:this.mouseOverHandler,mouseout:this.mouseOutHandler},this);$addHandlers(this._tooltip._tipDiv,{mouseover:this._clearHelperTimeoutID,mouseout:this._cancelHelper},this);this._tooltip.set_content(this._tooltipdiv);this.Ctnt=$get("fttContent");this.msgLink=$get("fttSendMsgLink");this.commentLink=$get("fttCommentLink");this.addLink=$get("fttAddLink");this._profileImage=$get("fttProfileImageUrl");if(this.sendMsgUrl=="qp"){$addHandler(this.msgLink,"click",Function.createDelegate(this,this.messagingQuickPost))}if(this.addCommentUrl=="qp"){$addHandler(this.commentLink,"click",Function.createDelegate(this,this.commentQuickPost))}if(this.addFriendQuickPostEnabled){MySpace.UI.AddFriendPopup.bind("#fttAddLink")}},_renderHelperWithDelay:function(B,A){this._createFriendToolTip();this._showFriendToolTipWithImage=Sys.UI.DomElement.containsCssClass(B,"friendToolTipBoxWithImage");if(this._showFriendToolTipWithImage){Sys.UI.DomElement.addCssClass(this._tooltipdiv,"friendtooltipwithimage");this._tooltip.set_arrowOffsetY(0);this._tooltip.set_tipOffsetX(0);this._tooltip.set_tipOffsetY(0);this._tooltip.set_width(260);this._tooltip.set_tipPos("right")}else{Sys.UI.DomElement.removeCssClass(this._tooltipdiv,"friendtooltipwithimage");this._tooltip.set_reflect(true);this._tooltip.set_tipOffsetY(-15);this._tooltip.set_arrowOffsetY(20);this._tooltip.set_width(160);this._tooltip.set_tipPos("bottomright")}this._hideTimeoutID=null;this._currentFriendId=A;this.msgLink.href=(this.sendMsgUrl=="qp")?"#":String.format(this.sendMsgUrl,A);this.commentLink.href=(this.addCommentUrl=="qp")?"#":String.format(this.addCommentUrl,A);this.addLink.href=String.format(this.addFriendUrl,A);this.addLink.friendId=A;this._imageposition=Sys.UI.DomElement.getLocation(B);this._imageposition.element=B;if(!this._localCache[A]){this._localCache[A]={}}if(this._localCache[A].state===this._callStatus.Completed){this._writeContent(this._localCache[A].result);return}else{if(this._localCache[A].state===this._callStatus.Error){this._renderFailure(null,this,null);return}}this._referrer=B.getAttribute("referrer")||null;this._getUserInfo(A)},_renderHelper:function(A){var C=this;var B=parseInt(this.friendid||this.getAttribute("friendid")||"0",10);if(B){if(this._cHelperTimeoutId){window.clearTimeout(this._cHelperTimeoutId);this._cHelperTimeoutId=null}C.fHelpero._delayTimerId=window.setTimeout(function(){C.fHelpero._renderHelperWithDelay(C,B)},250)}},_cancelHelper:function(C,A){window.clearTimeout(this._delayTimerId);this._delayTimerId=null;var B=this;this._cHelperTimeoutId=window.setTimeout(function(){if(!B._hMouseOver){B._hideFriendHelper()}},this._hideTimeoutInterval)},_getUserInfo:function(A){if(this._localCache[A].state!==this._callStatus.InProgress){this._localCache[A]={state:this._callStatus.InProgress};Sys.Net.WebServiceProxy.invoke(document.location.protocol+"//"+document.location.hostname+"/Modules/Common/Services/FriendToolTipService.asmx","GetFriendHelperData",false,{userId:A},this._renderCallback,this._renderFailure,this)}},_renderCallback:function(A,C,B){C._localCache[A.FriendId].state=C._callStatus.Completed;C._localCache[A.FriendId].result=A;if(C._currentFriendId!==A.FriendId){return}C._writeContent(A)},_renderFailure:function(B,C,A){C._localCache[C._currentFriendId].state=C._callStatus.Error;C._writeContent(null)},_hideFriendHelper:function(){if(this._cHelperTimeoutId){this._clearHideTimeout();if(this._tooltip!=null){this._tooltip.hide()}}},_setHideTimeout:function(){if(this._hideTimeoutID==null){var A=this;this._hideTimeoutID=window.setTimeout(function(){if(A._hideTimeoutID!=null){A._hideFriendHelper()}},this._hideTimeoutInterval)}},_clearHideTimeout:function(){if(this._hideTimeoutID!=null){window.clearTimeout(this.hideTimoutID);this._hideTimeoutID=null}},_writeContent:function(A){A=A||{};this.addLink.parentNode.style.display=A.IsFriend?"none":"";this.addLink.acctType=A.AccountType||"";this.commentLink.parentNode.style.display=A.IsFriend?"":"none";this.Ctnt.innerHTML=A.DisplayText||"";if(this._showFriendToolTipWithImage&&A.ImageUrl){this._profileImage.src=A.ImageUrl;this._profileImage.style.display=""}else{this._profileImage.style.display="none"}this._tooltip._element=this._imageposition.element;MySpace.Util.applyWBRToElements(MySpace.Utils.Selector.query(".name, .realName",this._tooltip._tipDiv),{frequency:11});this._tooltip.show()},_clearHelperTimeoutID:function(){window.clearTimeout(this._cHelperTimeoutId);this._cHelperTimeoutId=null},_delayedHide:function(A){this._clearTimerID();this._timerID=window.setTimeout(Function.createDelegate(this,this._hide),this._hideDelay)},_clearTimerID:function(){if(this._timerID){window.clearTimeout(this._timerID);this._timerID=0}},messagingQuickPost:function(A){MySpace.UI.MessagingQuickPostPopup.show(A,this._currentFriendId,false,this._referrer)},commentQuickPost:function(A){MySpace.UI.ProfileCommentQuickPostPopup.show(A,this._currentFriendId,this._referrer)},addStyles:function(){MySpace.UI.addStyles(".friendtooltip {width:150px;text-align:left;}.friendtooltipwithimage .friendtooltip {width:250px;}.friendtooltip #fttprofileImage { display:none; float:left; margin-right:10px}.friendtooltipwithimage #fttprofileImage { display:inline; }.friendtooltip .bubble {font-size:10px;}.friendtooltip .bubble p{ font-size:11px;font-weight:bold; text-decoration:none; color:#039; padding:0 0 4px 0;margin:0;}.friendtooltip .bubble p a { text-decoration:none; color:#039; }.friendtooltip .bubble p.realName { font-weight: normal; color:#666 }.friendtooltip ul { margin:10px 0 0 0; padding:5px 0 0 0; border-top:1px dotted #999; list-style:none; float:left; }.friendtooltip .bubble li { padding:0; }.friendtooltip .bubble li a { background:url('"+MySpace.StaticContentBase+"/modules/common/static/img/friendtooltip_icons.gif') transparent no-repeat; font-size:11px;font-weight:normal;text-decoration:none; color:#039; padding:5px 0 5px 25px; display:block; width:110px; _display:inline-block; height:15px;}.friendtooltip .bubble li a:hover { background-color:#e8e8af;color:#c00}.friendtooltip .bubble .msg a {background-position:4px 5px; }.friendtooltip .bubble .cmt a { background-position:4px -17px;}.friendtooltip .bubble .add a { background-position:4px -38px; }",true,"FriendTooltip")},get_tooltip:function(){return this._tooltip},set_tooltip:function(A){this._tooltip=A},get_tooltipdiv:function(){return _tooltipdiv},set_tooltipdiv:function(A){this._tooltipdiv=A}};MySpace.UI._FriendToolTip.registerClass("MySpace.UI._FriendToolTip",Sys.Component);MySpace.UI.FriendToolTip={initialize:function(A){if(!MySpace.UI.FriendToolTip._instance){MySpace.UI.FriendToolTip._instance=$create(MySpace.UI._FriendToolTip,A,null,null)}},attachHandlers:function(A){if(MySpace.UI.FriendToolTip._instance){MySpace.UI.FriendToolTip._instance.attachHandlers(A)}}};