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)}}};Type.registerNamespace("MySpace.UI.Pages");MySpace.UI.Pages._Data=function(){MySpace.UI.Pages._Data.initializeBase(this)};MySpace.UI.Pages._Data.prototype={_maxRetries:5,_retryDelay:100,request:function(B,C,H,A,F,E,G){var D=new Sys.Net.WebRequest();if(A){D.set_body(A)}if(F){for(i=0;i<F.length;i++){D.get_headers()[F[i].key]=F[i].value}}if(MySpace.UI.Pages.HashMashter){D.get_headers()["Hash"]=MySpace.UI.Pages.HashMashter}if(MySpace.UI.Pages.CurrentPageId){D.get_headers()["PageId"]=MySpace.UI.Pages.CurrentPageId}D.set_url(String.format("/Modules/PageEditor/Handlers/{0}/{1}",MySpace.UI.Pages.WebModule,B));D.set_httpVerb(G||"POST");D.set_userContext(C);E=E||{retryCount:0,url:B};D.add_completed(Function.createDelegate(this,function(J,K){if(J.getResponseHeader("Retry")&&E.retryCount<this._maxRetries){E.retryCount++;var I=this;setTimeout(function(){I.request(E.url+(E.url.indexOf("?")>0?"&":"?")+"retry="+E.retryCount,C,H,A,F,E)},I._retryDelay);return}if(H){H.apply(this,arguments)}}));D.invoke()}};MySpace.UI.Pages.Data=new MySpace.UI.Pages._Data();Type.registerNamespace("MySpace.UI.Pages");MySpace.UI.Pages.resizeObjects=function(C){if(C.nodeType!==1){return}var G=C.getElementsByTagName("OBJECT");if(G.length>0){for(var D=0;D<G.length;D++){var F=G[D].parentNode;if(F.clientWidth<1){continue}var E=F.clientWidth;var B=1;while((F&&F.className&&F.className.indexOf("autoResize")===-1)&&(B<10)){F=F.parentNode;E=F.clientWidth;B++}if(H===0){continue}var H=G[D].height;var A=G[D].width;if((!G[D]._ratio)&&(!G[D]._origWidth)){if((H!==0)&&(A!==0)){G[D]._ratio=(MySpace.UI.Pages.isValidPercent(A))?((E*(parseInt(A)/100))/H):(A/H);G[D]._origWidth=A}}if(G[D]._ratio===0){continue}if(MySpace.UI.Pages.isValidPercent(G[D]._origWidth)){G[D].height=(E*(parseInt(A)/100))/G[D]._ratio}else{if(!isNaN(G[D]._origWidth)){if(G[D]._origWidth>=E){G[D].height=E/G[D]._ratio;G[D].width=E}else{if(G[D]._origWidth!==G[D].width){G[D].height=G[D]._origWidth/G[D]._ratio;G[D].width=G[D]._origWidth}}}}}}};MySpace.UI.Pages.isValidPercent=function(B){var A=parseInt(B);return((B.lastIndexOf("%")===(B.length-1))&&(!isNaN(A))&&(A>0&&A<=100))};(function(){var C=Sys.UI.DomElement;var A=null;var D=function(F){F.preventDefault();if(!Sys.UI.DomElement.containsCssClass(document.body,"pageEditor")){if(!A){A=document.createElement("div");document.body.appendChild(A);var E=$create(MySpace.UI.Pages.Control,{uid:0,element:A,dataSource:"ControlPanel.ashx"});E.loadContent();C.addCssClass(document.body,"pageEditor")}else{MySpace.UI.Pages.Editor.showPanel()}}else{MySpace.UI.Pages.Editor.hidePanel()}};var B=$q("div.greetingModule .pagethemes a",null,true);if(!B||(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version<7)){return}$addHandler(B,"click",Function.createDelegate(B,D))})();MySpace.Application.add_DOMloaded(function(){var F=function(H,L,I){var J=MySpace.Utils.Selector.query(H);for(var K=0;K<J.length;K++){$addHandler(J[K],"click",Function.createDelegate(this,function(){MySpace.UI.Pages.Data.request(L,null,null,null,null);window.location.href=I}))}};F("a.indicatorRecordings","ClearKSoloIndicator.ashx",MySpace.UI.Pages.Home.KSoloIndicatorUrl);F("a.indicatorkSoloFavNewSongFan","ClearKSoloFanIndicator.ashx",MySpace.UI.Pages.Home.KsoloFanUrl);F("a.indicatorkSoloFavNewSongFeedBack","ClearKSoloFeedBackIndicator.ashx",MySpace.UI.Pages.Home.KsoloFeedBackUrl);F("a.indicatorNewVirtualGift","ClearVirtualGiftIndicator.ashx",MySpace.UI.Pages.Home.VirtualGiftUrl);if(!MySpace.Application.keyDisabled("DWBeaconAppClicks")){var C={et_mopClickTrack:"mop_clicktrack",ec_homepage:5,em_alertnotification:225,em_alertinvite:226};var B=$q(".alertsModule",null,true);var A=function(H){MySpace.Apps.trackClick(null,C.ec_homepage,C.em_alertnotification,MySpace.ClientContext.FunctionalContext,0)};var E=$q("a.indicatorNewAppNotifications",B,true);if(E){$addHandler(E,"click",Function.createDelegate(E,A))}var D=function(H){MySpace.Apps.trackClick(null,C.ec_homepage,C.em_alertinvite,MySpace.ClientContext.FunctionalContext,0)};var G=$q("a.indicatorNewAppInvites",B,true);if(G){$addHandler(G,"click",Function.createDelegate(G,D))}}});(function(){var B=$get("viewMyList");if(!B){return}var A=function(E){var D;if(!E){var E=window.event}if(E.target!=null){D=E.target}else{if(E.srcElement!=null){D=E.srcElement}}while(D.id!="viewMyList"&&D.parentNode){D=D.parentNode}if(D.id!="viewMyList"){Sys.UI.DomElement.removeCssClass(B,"over");$removeHandler(document,"click",C)}};var C=Function.createDelegate(this,A);$addHandler(B,"click",Function.createDelegate(this,function(){if(Sys.UI.DomElement.containsCssClass(B,"over")){Sys.UI.DomElement.removeCssClass(B,"over");$removeHandler(document,"click",C)}else{Sys.UI.DomElement.addCssClass(B,"over");$addHandler(document,"click",C)}}))})();(function(){var D=function(){if(this.value==""){this.value=MySpaceRes.ViewAllFriendsPage.SearchWithin;Sys.UI.DomElement.addCssClass(this,"blur")}};var C=function(){if(Sys.UI.DomElement.containsCssClass(this,"blur")){this.value="";Sys.UI.DomElement.removeCssClass(this,"blur")}};var E=function(F){if(this.value==""||this.value==MySpaceRes.ViewAllFriendsPage.SearchWithin){F.preventDefault()}};var B=MySpace.Utils.Selector.query("input.friendSpaceSearchBox");for(var A=0;A<B.length;A++){$addHandler(B[A],"blur",Function.createDelegate(B[A],D));$addHandler(B[A],"focus",Function.createDelegate(B[A],C));$addHandler(B[A].form,"submit",Function.createDelegate(B[A],E))}})();Type.registerNamespace("MySpace.UI.Pages.Home.StatusMood");MySpace.UI.Pages.Home.StatusMood.WireMessaging=function(){if(!MySpace.UI.Pages.Home.StatusMood.QuickPostMessaging){return}var B=$q("a.popupMessage");for(var A=0;A<B.length;A++){$addHandler(B[A],"click",Function.createDelegate(B[A],MySpace.UI.Pages.Home.StatusMood.MessageOnClick))}};MySpace.UI.Pages.Home.StatusMood.MessageOnClick=function(B){var A=MySpace.UI.Pages.Home.StatusMood.GetUserId(this);MySpace.UI.MessagingQuickPostPopup.show(new Sys.UI.DomEvent(B),A);return false};MySpace.UI.Pages.Home.StatusMood.GetUserId=function(B){var A=B.getAttribute("class")||B.getAttribute("className");if(!A){return}A=A.toString();var D=A.indexOf("userId")+6;var C=A.indexOf(" ",D);if(C<0){C=A.length}return A.substring(D,C)};MySpace.Application.add_DOMloaded(MySpace.UI.Pages.Home.StatusMood.WireMessaging);Type.registerNamespace("MySpace.UI.Pages.Home.MyVisitors");MySpace.UI.Pages.Home.MyVisitors.Initialize=function(){var C=$get("myVisitorsHelpBtn");if(!C){return}$addHandler(C,"click",Function.createDelegate(C,MySpace.UI.Pages.Home.MyVisitors.helpClick));var A=$get("myVisitorsTurnOff");if(A){$addHandler(A,"click",Function.createDelegate(A,MySpace.UI.Pages.Home.MyVisitors.turnOffClick))}var E=$get("myVisitorsTurnOn");if(E){$addHandler(E,"click",Function.createDelegate(E,MySpace.UI.Pages.Home.MyVisitors.turnOnClick))}if(MySpace.UI.Pages.Home.MyVisitors.UseFriendToolTips){var B=MySpace.Utils.Selector.query("li.visitor");if(B.length>0){for(var D=0;D<B.length;D++){B[D].friendid=MySpace.UI.Pages.Home.MyVisitors.GetUserId(B[D])}MySpace.UI.FriendToolTip.attachHandlers(B)}}};MySpace.UI.Pages.Home.MyVisitors.turnOffClick=function(A){A.preventDefault();MySpace.UI.Pages.Home.MyVisitors.turnOnOff(false)};MySpace.UI.Pages.Home.MyVisitors.turnOnClick=function(A){A.preventDefault();MySpace.UI.Pages.Home.MyVisitors.turnOnOff(true)};MySpace.UI.Pages.Home.MyVisitors.turnOnOff=function(A){$get("myVisitorLoading").style.display="block";MySpace.UI.Pages.Data.request(String.format("MyVisitorsTurnOnOff.ashx?status={0}",A),null,MySpace.UI.Pages.Home.MyVisitors.onSuccess,null,null)};MySpace.UI.Pages.Home.MyVisitors.onSuccess=function(A,C){$get("myVisitorLoading").style.display="";var D=false;if(A.get_responseAvailable()){var B=A.get_responseData();if(B!=null){D=true;$q(".myVisitorsModule .moduleBody",null,true).innerHTML=B+'<div class="moduleBodyEnd"></div>';MySpace.UI.Pages.Home.MyVisitors.Initialize()}}if(!D){$get("myVisitorsContent").style.display="none";$get("myVisitorsErrorMessage").style.display="block"}};MySpace.UI.Pages.Home.MyVisitors.helpClick=function(A){A.preventDefault();if(Sys.UI.DomElement.containsCssClass(this,"selected")){Sys.UI.DomElement.removeCssClass(this,"selected");$get("myVisitorsContent").style.display="";$get("myVisitorsHelp").style.display=""}else{Sys.UI.DomElement.addCssClass(this,"selected");$get("myVisitorsContent").style.display="none";$get("myVisitorsHelp").style.display="block"}};MySpace.UI.Pages.Home.MyVisitors.GetUserId=function(B){var A=B.getAttribute("class")||B.getAttribute("className");if(!A){return}A=A.toString();var D=A.indexOf("userId")+6;var C=A.indexOf(" ",D);if(C<0){C=A.length}return A.substring(D,C)};(function(){var B=function(){MySpace.UI.Pages.Data.request(String.format("SuggestionsDismiss.ashx?later=true&suggestionType={0}",MySpace.UI.suggestionType),null,null,null,null);A.style.display="none"};var E=function(){MySpace.UI.Pages.Data.request(String.format("SuggestionsDismiss.ashx?later=false&suggestionType={0}",MySpace.UI.suggestionType),null,null,null,null);A.style.display="none"};var D=$get("maybeLater");var C=$get("noThanks");var A=$q("div.suggestionsModule")[0];if(D!=null&&typeof(D)!="undefined"){$addHandler(D,"click",Function.createDelegate(D,B))}if(C!=null&&typeof(C)!="undefined"){$addHandler(C,"click",Function.createDelegate(C,E))}})();(function(){var A=function(L){L.preventDefault();var K=$q("ul.moduleListMore",null,true);if(D.innerHTML===MySpaceRes.HomeDisplay.AppNavViewAll){D.innerHTML=MySpaceRes.HomeDisplay.AppNavViewLess;Sys.UI.DomElement.removeCssClass(K,"moduleListMoreHide")}else{D.innerHTML=MySpaceRes.HomeDisplay.AppNavViewAll;Sys.UI.DomElement.addCssClass(K,"moduleListMoreHide")}};var D=$q("a.myapps_viewall",null,true);if(D){$addHandler(D,"click",Function.createDelegate(D,A))}if(!MySpace.Application.keyDisabled("DWBeaconAppClicks")){var B={et_mopClickTrack:"mop_clicktrack",ec_homepage:5,em_canvas:203,em_settings:205,em_togglelist:218};var C=$q(".myappsModule",null,true);var J=function(L){var N="0";var K=this.href;var O=K.indexOf("appId=")+6;var M=K.indexOf("&",O);if(M<0){M=K.length}currentAppId=K.substring(O,M);MySpace.Apps.trackClick(null,B.ec_homepage,B.em_canvas,MySpace.ClientContext.FunctionalContext,currentAppId)};var G=$q("a.myapps_title",C);if(G){for(var E=0;E<G.length;E++){$addHandler(G[E],"click",Function.createDelegate(G[E],J))}}var F=function(K){MySpace.Apps.trackClick(null,B.ec_homepage,B.em_togglelist,MySpace.ClientContext.FunctionalContext,0)};if(D){$addHandler(D,"click",Function.createDelegate(D,F))}var I=function(K){MySpace.Apps.trackClick(null,B.ec_homepage,B.em_settings,MySpace.ClientContext.FunctionalContext,0)};var H=$q("a.manage_apps",C,true);if(H){$addHandler(H,"click",Function.createDelegate(H,I))}}})();(function(){var D=function(G){G.preventDefault();var H;var E=$q(".privacySettingModule input",A);for(var F=0;F<E.length;F++){if(E[F].checked){H=E[F].value;break}}MySpace.UI.Pages.Data.request(String.format("SavePrivacyLevel.ashx?level={0}",H),null,null,null,null);MySpace.UI.Pages.Popup.Close()};var B=$get("savePrivacy");if(B){var A=$get("popup");$addHandler(B,"click",Function.createDelegate(B,D));var C=$q("form",A,true);$addHandler(C,"submit",Function.createDelegate(C,D))}})();(function(){var B=function(J){J.preventDefault();var K=H(G);K=H(I)&&K;if(!K){return}var L=($get("showFullName")).checked;MySpace.UI.Pages.Data.request("SaveRealName.ashx",null,Function.createDelegate(this,D),String.format("firstName={0}&lastName={1}&showRealName={2}",G.value,I.value,L),null)};var C=function(J){J.preventDefault();MySpace.UI.Pages.Data.request("DismissRealName.ashx",null,null,null,null);MySpace.UI.Pages.Popup.Close()};var D=function(J,K){var M=false;if(J.get_responseAvailable()){var L=J.get_responseData();if(L!=null&&L.trim()!=""){($q(".realNameModule p.errorMsg","popup",true)).innerHTML=L;return}}MySpace.UI.Pages.Popup.Close()};var H=function(J){var K=($q(".errorMsg",J.parentNode,true));if(J.value.trim()==""){K.innerHTML="*";return false}K.innerHTML="";return true};var E=$get("saveRealName");if(!E){return}var G=$get("firstName");var I=$get("lastName");var F=($q(".realNameModule .popup_x"))[0];var A=$q(".realNameModule form",null,true);$addHandler(E,"click",Function.createDelegate(E,B));$addHandler(A,"submit",Function.createDelegate(A,B));$addHandler(F,"click",Function.createDelegate(F,C))})();(function(){var A=function(D){D.preventDefault();MySpace.UI.Pages.Data.request("DismissABI.ashx",null,null,null,null);MySpace.UI.Pages.Popup.Close()};var C=$q(".abiModule",null,true);if(!C){return}var B=$q(".noThanks",C,true);$addHandler(B,"click",Function.createDelegate(B,A))})();Type.registerNamespace("MySpace.UI.Pages");MySpace.UI.Pages.UIElement=function(){MySpace.UI.Pages.UIElement.initializeBase(this)};MySpace.UI.Pages.UIElement.prototype={_uid:null,_name:null,_parent:null,_owner:null,_isSelected:false,_title:null,_visible:false,_body:null,_element:null,get_body:function(){return this._body||document.getElementsByTagName("body")[0]},get_element:function(){return this._element},set_element:function(A){this._element=A},get_uid:function(){return this._uid},set_uid:function(A){this._uid=A},get_name:function(){return this._name},set_name:function(A){this._name=A},get_parent:function(){return this._parent},set_parent:function(A){this._parent=A},get_owner:function(){return this._owner},set_owner:function(A){this._owner=A},get_isSelected:function(){return this._isSelected},set_isSelected:function(A){this._isSelected=A;if(this._isSelected){Sys.UI.DomElement.addCssClass(this._element,"selected")}else{Sys.UI.DomElement.removeCssClass(this._element,"selected")}},get_title:function(){return this._title||this._name},set_title:function(A){this._title=A},get_visible:function(){return this._visible},set_visible:function(A){this._visible=A;if(this._element){this._element.style.display=A?"block":"none"}},getText:function(A){if(typeof(MySpaceRes.PageEditor[A])==="undefined"){if(typeof(MySpace.UI.Pages.ResourceName)!="undefined"&&typeof(MySpaceRes[MySpace.UI.Pages.ResourceName][A])!="undefined"){return MySpaceRes[MySpace.UI.Pages.ResourceName][A]}else{return""}}else{return MySpaceRes.PageEditor[A]}},replaceElement:function(B,A){B.parentNode.replaceChild(A,B);return A},removeElement:function(B){var A=B.parentNode;if(A){A.removeChild(B)}},removeChildren:function(A){if(A.hasChildNodes()){while(A.childNodes.length>=1){A.removeChild(A.firstChild)}}},raiseEvent:function(B,A){var C=this.get_events().getHandler(B);if(C){if(!A){A=Sys.EventArgs.Empty}C(this,A)}},createElement:function(A,D,C){var B=document.createElement(A);if(D){B.className=D}if(C){C.appendChild(B)}return B},insertAfter:function(D,B){var C=B.parentNode;var A=B.nextSibling;if(A){C.insertBefore(D,A)}else{C.appendChild(D)}},createElement:function(A,D,C){var B=document.createElement(A);if(D){B.className=D}if(C){C.appendChild(B)}return B},addCssClass:function(A,B){if(!A){return}Sys.UI.DomElement.addCssClass(A,B)},removeCssClass:function(A,B){if(!A){return}Sys.UI.DomElement.removeCssClass(A,B)},dispose:function(){this._uid=null;this._name=null;this._parent=null;this._owner=null;this._isSelected=false;this._title=null;this._visible=false;this._body=null;MySpace.UI.Pages.UIElement.callBaseMethod(this,"dispose")}};MySpace.UI.Pages.UIElement.registerClass("MySpace.UI.Pages.UIElement",Sys.Component);Type.registerNamespace("MySpace.UI.Pages");MySpace.UI.Pages.Control=function(){MySpace.UI.Pages.Control.initializeBase(this)};MySpace.UI.Pages.Control.prototype={_dataSource:null,_runScripts:true,get_dataSource:function(){return this._dataSource},set_dataSource:function(A){this._dataSource=A},get_runScripts:function(){return this._runScripts},set_runScripts:function(A){this._runScripts=A},add_loaded:function(A){this.get_events().addHandler("loaded",A)},remove_loaded:function(A){this.get_events().removeHandler("loaded",A)},initialize:function(){},dispose:function(){this._element=null;MySpace.UI.Pages.Control.callBaseMethod(this,"dispose")},loadContent:function(){MySpace.UI.Pages.Data.request(this._dataSource,this,Function.createDelegate(this,this._onContentLoad),null,null)},setContent:function(A){if(this._element){this._element.innerHTML=A}this._contentLoaded()},_contentLoaded:function(){if(this._runScripts){this._executeScripts()}if(this._element){MySpace.UI.Pages.resizeObjects(this._element)}this.raiseEvent("loaded")},_onContentLoad:function(A,B){if(A.get_responseAvailable()){this.setContent(A.get_responseData())}},_executeScripts:function(){var B=[];if(!this._element){return}var A=this._element.getElementsByTagName("script");if(A.length<=0){return}for(var D=A.length-1;D>-1;D--){var E=document.createElement("script");E.type="text/javascript";if(A[D].text!==""){E.text=A[D].text}else{E.src=A[D].src}A[D].parentNode.removeChild(A[D]);Array.add(B,E)}if(B.length<=0){return}var C=document.getElementsByTagName("head")[0];for(var D=B.length-1;D>-1;D--){C.appendChild(B[D])}}};MySpace.UI.Pages.Control.registerClass("MySpace.UI.Pages.Control",MySpace.UI.Pages.UIElement);Type.registerNamespace("MySpace.UI.Pages");MySpace.UI.Pages.Module=function(){MySpace.UI.Pages.Module.initializeBase(this)};MySpace.UI.Pages.Module.prototype={_typeid:-1,_targetId:null,_handler:null,_parameters:null,_showContainer:null,get_typeid:function(){return this._typeid},set_typeid:function(A){this._typeid=A},get_targetId:function(){return this._targetId},set_targetId:function(A){this._targetId=A},get_handler:function(){return this._handler},set_handler:function(A){this._handler=A},get_parameters:function(){return this._parameters},set_parameters:function(A){this._parameters=A},get_showContainer:function(){return this._showContainer},set_showContainer:function(A){this._showContainer},initialize:function(){this._handler=this._handler||"Module.ashx";if(this._element){this._bodyElement=$q(".moduleBody",this._element,true)}},dispose:function(){MySpace.UI.Pages.Module.callBaseMethod(this,"dispose")},loadContent:function(){if(!this._dataSource){var A=String.format("?typeid={0}",this._typeid)+((this._targetId!=0)?String.format("&targetid={0}",this._targetId):"")+((this._uid!=0)?String.format("&moduleid={0}",this._uid):"");A+=this._addParameters(this._showContainer!==null?"container="+this._showContainer:null);A+=this._addParameters(window.location.search.substring(1));A+=this._addParameters(this._parameters);this._dataSource=String.format(this._handler+A)}MySpace.UI.Pages.Module.callBaseMethod(this,"loadContent")},_addParameters:function(A){return A!==null&&A.length>0?"&"+A:""},_onContentLoad:function(A,B){var C=A.get_webRequest().get_userContext();if(A.get_responseAvailable()){if(C._bodyElement){var D=$q(".moduleBodyEnd",C._bodyElement,true);if(D){D.parentNode.removeChild(D)}C._bodyElement.innerHTML=A.get_responseData();if(D){C._bodyElement.appendChild(D)}}C._contentLoaded();if(C._element){Sys.UI.DomElement.removeCssClass(C._element,"noContent")}}}};MySpace.UI.Pages.Module.registerClass("MySpace.UI.Pages.Module",MySpace.UI.Pages.Control);(function(){if(!MySpace.UI.Pages.Modules){return}for(var A=0;A<MySpace.UI.Pages.Modules.length;A++){var B=MySpace.UI.Pages.Modules[A];var E;Array.forEach(MySpace.UI.Pages.ModuleMetaData,function(F){if(F.typeId==B.typeId){E=F}});if(!E){continue}if(E.async){var D=$get("module"+(B.id!=0?B.id:E.name));if(D){var C=$create(MySpace.UI.Pages.Module,{element:D,uid:B.id,targetId:B.targetId,name:E.name,typeid:B.typeId,runScripts:true});C.loadContent()}}}})();Type.registerNamespace("MySpace.UI.Pages.Popup");MySpace.UI.Pages.Popup.SetOverlayHeight=function(){var C=$get("popup_overlay");var B=document.body.scrollHeight;var A=document.documentElement.clientHeight;var D=document.documentElement.scrollHeight;B=((B>D)?B:D);B=((B>A)?B:A)+300;C.style.height=B+"px"};MySpace.UI.Pages.Popup.Close=function(C){var A=$get("popup");var B=$get("popup_overlay");if(A){A.parentNode.removeChild(A)}if(B){B.parentNode.removeChild(B)}$removeHandler(window,"resize",MySpace.UI.Pages.Popup.SetOverlayHeight)};(function(){var A=$get("popup_overlay");if(!A){return}$addHandler(window,"resize",MySpace.UI.Pages.Popup.SetOverlayHeight);MySpace.UI.Pages.Popup.SetOverlayHeight()})();Type.registerNamespace("MySpace.UI");MySpace.UI._UserActionWatcher=function(){this.initialize()};MySpace.UI._UserActionWatcher.prototype={_adTypes:[],initialize:function(){this.configureAdWrapper()},configureAdWrapper:function(){var A=this;var B=sdc_wrapper;sdc_wrapper=function(){sdc_wrapper.cache=sdc_wrapper.cache||[];if(Array.contains(A._adTypes,arguments[0])&&!Array.find(sdc_wrapper.cache,function(C){return C[0]===arguments[0]})){sdc_wrapper.cache.push(arguments)}generateAd.apply(this,arguments)};sdc_wrapper.original=B},onUserAction:function(){var A=this;Array.forEach(sdc_wrapper.cache,function(B){if(Sys.UI.DomElement.getPercentVisible($get(B[0]))>=0.5){generateAd.apply(A,B)}})},discover:function(C){var B=$q(".action",C);var A=this;Array.forEach(B,function(D){$addHandler(D,"click",Function.createDelegate(A,A.onUserAction))})},setAdTypes:function(A){this._adTypes=arguments}};MySpace.UI.UserActionWatcher=new MySpace.UI._UserActionWatcher();Type.registerNamespace("MySpace.UI.Pages.Home.PYMK");MySpace.UI.Pages.Home.PYMK.Initialize=function(){var B=function(L){var K=L.getAttribute("class")||L.getAttribute("className");if(!K){return"0"}var N=0;N=K.indexOf("userInfo")+8;var M=K.indexOf(" ",N);if(M<0){M=K.length}return K.substring(N,M)};var H=function(L,K,M){if(!MySpace.Application.keyDisabled("DWBeaconPYMK")){MySpace.Beacon.Request({friendid:MySpace.ClientContext.UserId,reqfriendid:L,index:K,type:M})}if(M=="add"){if(window.pageTracker){pageTracker._trackPageview("/outgoing/friendadd")}if(window.pymkTracker){pymkTracker._trackPageview("/outgoing/friendadd")}}};var E=function(L,K){H(L,K,"remove");MySpace.UI.Pages.Data.request(String.format("RemovePYMK.ashx?userId={0}",L),null,C,null,null)};var C=function(K){var N=0;if(K.get_responseAvailable()){N=K.get_responseData();var M=$q(".pymkModule .error");if(N>0){var L=$q(".pymkModule .userInfo"+N);if(L[0]!=null){L[0].innerHTML=MySpaceRes.SiteSearch.Removed;Sys.UI.DomElement.addCssClass(L[0],"removeMessage")}if(M[0]!=null){M[0].style.display="none"}}else{if(M[0]!=null){M[0].style.display="block"}}}};MySpace.UI.AddFriendPopup.bind(".userInfo a.addToFriends");var A=$q(".pymkModule .user");for(var D=0;D<A.length;D++){var F=B(A[D]);var I=$q(".close",A[D],true);if(I!=null){$addHandler(I,"click",Function.createCallback(function(L,K){E(K.userId,K.index)},{userId:F,index:D}))}var J=$q(".tooltip",A[D],true);if(J!=null){$create(MySpace.UI.Tooltip,{content:J.innerHTML,cssClass:"pymkTooltip",tipPos:"bottomleft",autoPos:false,hideDelay:0,width:180},null,null,J.parentNode);J.parentNode.removeChild(J)}var G=$q(".addToFriends",A[D],true);if(G!=null){$addHandler(G,"click",Function.createDelegate(function(L,K){H(K.userId,K.index,"add")},{userId:F,index:D}))}}};(function(){var A=function(E){E.preventDefault();MySpace.UI.Pages.Data.request("DismissMyVisitorsOverlay.ashx?agreed=true",null,null,null,null);MySpace.UI.Pages.Popup.Close()};var C=$get("closeMyVisitorOverLay");if(!C){return}var D=$get("accepted");var B=$q(".MyVisitorsOverlayModule form",null,true);C.disabled=D.checked?"":"disabled";$addHandler(D,"click",function(E){C.disabled=D.checked?"":"disabled"});$addHandler(B,"submit",Function.createDelegate(B,A));$addHandler(C,"click",Function.createDelegate(C,A))})();(function(){var C=function(D){MySpace.UI.Pages.Data.request("DismissUHPUpgradeOverlay.ashx",null,null,null,null);D.preventDefault();MySpace.UI.Pages.Popup.Close()};var B=$get("closeUhpUpgrade");if(!B){return}var A=$q(".UHPUpgradeModule form",null,true);$addHandler(A,"submit",Function.createDelegate(A,C));$addHandler(B,"click",Function.createDelegate(B,C))})();Type.registerNamespace("MySpace.UI.Home");MySpace.UI.Home.StatusMoodEditor=function(){MySpace.UI.Home.StatusMoodEditor.initializeBase(this)};MySpace.UI.Home.StatusMoodEditor.prototype={_urlRegex:/\b((https?:\/\/)|(www\.)|(\S+\.com\/))\S+/gi,_spacerUrl:"http://x.myspacecdn.com/modules/common/static/img/spacer.gif",initialize:function(){this._form=$get("statusMoodEditor");if(!this._form){return}this._config=MySpace.UI.Home.smConfig;this._charCnt=$q(".charCount",this._form,true);this._statusInput=$q("textarea",this._form,true);this._moodInput=$q(".mood input",this._form,true);this._smiley=$q(".smiley",this._form,true);this._smileyImg=$q(".smiley div",this._form,true);this._smileyPalette=$q(".smileyPalette",this._form,true);this._updateBtn=$q(".updateBtn button",this._form,true);this._shortenUrlNotice=$q(".urlShortened",this._form,true);this._updating=$q(".updating",this._form,true);this._currentStatus=$q(".currentStatus",null,true);this._currentMood=$q(".currentMood",null,true);this._currentSmiley=$q(".currentSmiley",null,true);this._currentMoodSmiley=$q(".currentMoodSmiley",null,true);this._currentStatusDateTime=$q(".currentStatusDateTime",null,true);this._shortenUrls=!MySpace.Application.keyDisabled("ShortenUrlsInStatusMood");this._notFocusedYet=true;this._smileyList=null;this._moodList=null;this._previousStatus=this._status=this._config.status||"";this._previousMood=this._mood=this._config.mood||"";this._previousSmileyUrl=this._smileyUrl=this._config.smileyUrl||this._spacerUrl;this._reset();$addHandler(this._statusInput,"change",Function.createDelegate(this,this._onStatusChange));$addHandler(this._statusInput,"keyup",Function.createDelegate(this,this._onStatusChange));$addHandler(this._statusInput,"focus",Function.createDelegate(this,this._onFocusInput));$addHandler(this._moodInput,"change",Function.createDelegate(this,this._setBtnStatus));$addHandler(this._moodInput,"keyup",Function.createDelegate(this,this._setBtnStatus));$addHandler(this._moodInput,"focus",Function.createDelegate(this,this._onFocusInput));$addHandler(this._smiley,"click",Function.createDelegate(this,this._showSmileyPalette));$addHandler(this._smileyPalette,"blur",Function.createDelegate(this,this._hideSmileyPalette));$addHandler(this._form,"keydown",Function.createDelegate(this,this._onKeyDown));$addHandler(this._updateBtn,"click",Function.createDelegate(this,this._saveStatus));MySpace.UI.Pages.Data.request(String.format("GetStatusMoodData.ashx?culture={0}",this._config.culture),null,Function.createDelegate(this,this._onGetStatusMoodDataSuccess),null,null,null,"GET")},_onGetStatusMoodDataSuccess:function(A){var B=Sys.Serialization.JavaScriptSerializer.deserialize(A.get_responseData());this._moodList=B.moodList;this._smileyList=B.smileyList;this._moodComboBox=$create(MySpace.UI.ComboBoxBehavior,{minimumPrefixLength:1,completionItems:this._moodList,completionInterval:500},{itemSelected:Function.createDelegate(this,this._onMoodSelected)},null,this._moodInput)},_saveStatus:function(A){A.preventDefault();if(Sys.UI.DomElement.containsCssClass(this._updateBtn.parentNode,"msDefBtnDisabled")||this._isDuplicate()||this._saveInProgress){return}this._saveInProgress=true;this._updateBtn.focus();Sys.UI.DomElement.addCssClass(this._form,"showUpdating");MySpace.UI.Pages.Data.request("SaveStatusMood.ashx",null,Function.createDelegate(this,this._onSaved),String.format("status={0}&mood={1}&smiley={2}",encodeURIComponent(this._statusInput.value),encodeURIComponent(this._moodInput.value),this._smileyUrl),null)},_onSaved:function(A,C){this._saveInProgress=false;Sys.UI.DomElement.removeCssClass(this._form,"showUpdating");var D=A.get_webRequest().get_userContext();if(A.get_responseAvailable()){var E=A.get_responseData();if(E!=" "){var B=Sys.Serialization.JavaScriptSerializer.deserialize(E);this._previousStatus=this._status=this._statusInput.value=B.status;this._previousMood=this._mood=this._moodInput.value=B.moodName;this._previousSmileyUrl=this._smileyUrl=B.smiley;this._reset();this._currentStatus.innerHTML=B.statusHtml;this._currentMood.innerHTML=(B.mood>-1)?B.moodName:"";this._currentSmiley.src=B.smiley;this._currentStatusDateTime.innerHTML=B.updateTime;if(B.mood>-1||(B.smiley.toLowerCase().indexOf("spacer.gif")==-1&&B.smiley!=null&&B.smiley!="")){Sys.UI.DomElement.removeCssClass(this._currentMoodSmiley,"noMood")}else{Sys.UI.DomElement.addCssClass(this._currentMoodSmiley,"noMood")}this.raiseSaved(B)}}else{var F=MySpaceRes.Header.ErrorMessage.replace(/<br.*>/gi,"\n");alert(F)}this._onStatusChange();this._notFocusedYet=true;this._setBtnStatus()},_reset:function(){this._statusInput.value="";this._moodInput.value=this._config.defaultMood;this._setSmileyUrl(this._spacerUrl)},_onStatusChange:function(){var A=this._statusInput.value;if(this._shortenUrls){var C=A.length;A=A.replace(this._urlRegex,this._shortenedURLBase+"123456");if(A.length!=C){if(!Sys.UI.DomElement.containsCssClass(this._form,"showUrlShortened")){Sys.UI.DomElement.addCssClass(this._form,"showUrlShortened")}}else{if(Sys.UI.DomElement.containsCssClass(this._form,"showUrlShortened")){Sys.UI.DomElement.removeCssClass(this._form,"showUrlShortened")}}}var B=160-A.length;this._charCnt.innerHTML=B;if(B<0){Sys.UI.DomElement.addCssClass(this._charCnt,"negative")}else{Sys.UI.DomElement.removeCssClass(this._charCnt,"negative")}this._notFocusedYet=false;this._setBtnStatus()},_setBtnStatus:function(){if(this._isDuplicate()||this._isEmpty()){Sys.UI.DomElement.addCssClass(this._updateBtn.parentNode,"msDefBtnDisabled");Sys.UI.DomElement.removeCssClass(this._updateBtn.parentNode,"msDefBtn")}else{Sys.UI.DomElement.addCssClass(this._updateBtn.parentNode,"msDefBtn");Sys.UI.DomElement.removeCssClass(this._updateBtn.parentNode,"msDefBtnDisabled")}},_isDuplicate:function(){return this._statusInput.value==this._previousStatus&&this._moodInput.value==this._previousMood&&this._smileyUrl.substring(this._smileyUrl.lastIndexOf("/"),this._smileyUrl.length).toLowerCase()==this._previousSmileyUrl.substring(this._previousSmileyUrl.lastIndexOf("/"),this._previousSmileyUrl.length).toLowerCase()},_onMoodSelected:function(B,A){this._setSmileyUrl(A.get_value());this._notFocusedYet=false},_showSmileyPalette:function(A){if(!this._smileyPopupBehavior){this._smileyPopupBehavior=$create(MySpace.UI.PopupBehavior,{parentElement:this._smiley,positioningMode:MySpace.UI.PositioningMode.BottomLeft,hideOnDocumentClick:true,x:-1,y:-2},null,null,this._smileyPalette);this._smileySelector=$create(MySpace.UI.SmileySelector,{smileyData:this._smileyList},{selected:Function.createDelegate(this,this._onSmileySelect)},null,this._smileyPalette)}this._smileyPopupBehavior.show();this._smileyPalette.focus()},_hideSmileyPalette:function(A){this._smileyPopupBehavior.hide()},_onSmileySelect:function(B,A){this._hideSmileyPalette();this._notFocusedYet=false;this._setSmileyUrl(A)},_setSmileyUrl:function(A){this._smileyUrl=A||this._spacerUrl;this._smileyImg.style.backgroundImage=String.format("url('{0}')",A);this._setBtnStatus()},_onFocusInput:function(B){var A=B.target;A.select();this._notFocusedYet=false;this._setBtnStatus()},_onKeyDown:function(A){if(this._moodComboBox.get_visible()){return}if(A.keyCode==13){this._saveStatus(A);MySpace.UI.UserActionWatcher.onUserAction()}},_isEmpty:function(){return(this._statusInput.value.trim()==""&&(this._moodInput.value==this._config.defaultMood||this._moodInput.value=="")&&this._smileyUrl==this._spacerUrl)},add_saved:function(A){this.get_events().removeHandler("saved",A);this.get_events().addHandler("saved",A)},remove_saved:function(A){this.get_events().removeHandler("saved",A)},raiseSaved:function(A){var B=this.get_events().getHandler("saved");if(B){B(this,A)}},dispose:function(){$clearHandlers(this._statusInput);$clearHandlers(this._moodInput);$clearHandlers(this._smiley);$clearHandlers(this._smileyPalette);$clearHandlers(this._form);$clearHandlers(this._updateBtn)}};MySpace.UI.Home.StatusMoodEditor.registerClass("MySpace.UI.Home.StatusMoodEditor",Sys.Component);MySpace.UI.Home.StatusMoodEditor.Instance=$create(MySpace.UI.Home.StatusMoodEditor,{},null,null,null);(function(){var B=function(N){var M=$q("input.app_Token",N,true);return M.value};var A={et_mopClickTrack:"mop_clicktrack",ec_homepage:5,ec_hide_app_popup:5,em_modulereorder:219,em_moduleremove:220,em_hidemodule:223,em_hidemodule_cancel:224};var G=function(P){var O=P._module;var M=$q("a.appTitle",O,true);var R="0";if(M){var N=M.href;var S=N.indexOf("appId=")+6;var Q=N.indexOf("&",S);if(Q<0){Q=N.length}R=N.substring(S,Q)}return R};var K=function(M){MySpace.Apps.trackClick(null,A.ec_homepage,A.em_modulereorder,MySpace.ClientContext.FunctionalContext,G(this))};var I=function(M){MySpace.Apps.trackClick(null,A.ec_hide_app_popup,A.em_moduleremove,MySpace.ClientContext.FunctionalContext,G(this))};var H=function(M){MySpace.Apps.trackClick(null,A.ec_homepage,A.em_hidemodule,MySpace.ClientContext.FunctionalContext,G(M))};var D=function(M){MySpace.Apps.trackClick(null,A.ec_homepage,A.em_hidemodule_cancel,MySpace.ClientContext.FunctionalContext,G(M))};var C=function(S,O){if(O.target.value===MySpaceRes.AppManagement.AppChromeHideButton){var R=this._module;var N=$q(this._selector);var M=-1;for(var Q=0;Q<N.length;Q++){if(N[Q].className===R.className){M=Q;break}}if(!MySpace.Application.keyDisabled("DWBeaconAppClicks")){H(this)}R.parentNode.removeChild(R);var P=B(R);MySpace.UI.Pages.Data.request(String.format("UpdateAppSetting.ashx?appToken={0}",P))}else{if(!MySpace.Application.keyDisabled("DWBeaconAppClicks")){D(this)}}};var F=function(){var R=this._module;var O=$q(this._selector);var M=-1;for(var Q=0;Q<O.length;Q++){if(O[Q].className===R.className){M=Q;break}}if(M>0){var S=O[M-1];var N=this._module.parentNode;N.removeChild(this._module);N.insertBefore(this._module,S);var P=B(R);MySpace.UI.Pages.Data.request(String.format("MoveAppUp.ashx?appToken={0}",P))}};var J=function(){var R=this._module;var O=$q(this._selector);var M=-1;for(var Q=0;Q<O.length;Q++){if(O[Q].className===R.className){M=Q;break}}if(M<O.length-1){var S=O[M+1];var N=this._module.parentNode;N.removeChild(S);N.insertBefore(S,this._module);var P=B(R);MySpace.UI.Pages.Data.request(String.format("MoveAppDown.ashx?appToken={0}",P))}};var L=function(){var O=this._module;var M=$q(this._selector);for(var N=0;N<M.length;N++){if(M[N].className===O.className){var P=MySpaceRes.AppManagement.AppChromeHideContent;var Q=MySpace.UI.Popup.create(P,MySpaceRes.AppManagement.AppChromeHideHeader,Function.createDelegate(this,C));Q.add_button(MySpaceRes.AppManagement.Cancel,true);Q.add_button(MySpaceRes.AppManagement.AppChromeHideButton,false);Q.show();break}}};var E=function(M){var N=$q(M);for(var O=0;O<N.length;O++){var R=$q("div.toolbar a.cbUp",N[O],true);var Q=$q("div.toolbar a.cbDown",N[O],true);var P=$q("div.toolbar a.cbClose",N[O],true);if(R){R._module=N[O];R._selector=M;$addHandler(R,"click",Function.createDelegate(R,F));if(!MySpace.Application.keyDisabled("DWBeaconAppClicks")){$addHandler(R,"click",Function.createDelegate(R,K))}}if(Q){Q._module=N[O];Q._selector=M;$addHandler(Q,"click",Function.createDelegate(Q,J));if(!MySpace.Application.keyDisabled("DWBeaconAppClicks")){$addHandler(Q,"click",Function.createDelegate(Q,K))}}if(P){P._module=N[O];P._selector=M;$addHandler(P,"click",Function.createDelegate(P,L));if(!MySpace.Application.keyDisabled("DWBeaconAppClicks")){$addHandler(P,"click",Function.createDelegate(P,I))}}}};E("div.applicationsModule")})();(function(){var B=function(F){F.preventDefault();if(A){return}A=true;MySpace.UI.Pages.Data.request("../Profiles/UpgradeProfile.ashx",null,function(){window.setTimeout(function(){window.location.href=MySpace.UI.Pages.PageEditorUrl},4000)},null,null);Sys.UI.DomElement.addCssClass(E,"inProgress")};var C=function(F){F.preventDefault();MySpace.UI.Pages.Data.request("DismissUpgradeProfile.ashx",null,null,null,null);MySpace.UI.Pages.Popup.Close()};var E=$get("upgradeProfile");if(!E){return}var A=false;var D=$q(".upgradeProfileModule .popup_x",null,true);$addHandler(E,"click",Function.createDelegate(E,B));$addHandler(D,"click",Function.createDelegate(D,C))})();Type.registerNamespace("MySpace.UI.Pages.Home.ActivityStream");MySpace.UI.Pages.Home.ActivityStream.Initialize=function(){MySpace.UI.Home.StatusMoodEditor.Instance.add_saved(MySpace.UI.Pages.Home.ActivityStream.AddStatusMood)};MySpace.UI.Pages.Home.ActivityStream.AddStatusMood=function(B,A){if(MySpace.UI.Pages.Home.ActivityStream.Filters.Instance){var C=MySpace.UI.Pages.Home.ActivityStream.Filters.Instance.get_filter();var D=MySpace.UI.Pages.Home.ActivityStream.Filters.Instance.get_source();if((C==MySpace.UI.Pages.Home.ActivityStream.Filter.All||C==MySpace.UI.Pages.Home.ActivityStream.Filter.Status)&&(D==MySpace.UI.Pages.Home.ActivityStream.Source.All||D==MySpace.UI.Pages.Home.ActivityStream.Source.Me)){MySpace.UI.Pages.Home.ActivityStream.AddItems(A.activityHtml)}}else{MySpace.UI.Pages.Home.ActivityStream.AddItems(A.activityHtml)}};MySpace.UI.Pages.Home.ActivityStream.AddItems=function(J){var G=$q(".activityStreamModule .activitiesContainer",null,true);if(G==null||typeof(G)=="undefined"){if(!MySpace.UI.Pages.Modules){return}for(var C=0;C<MySpace.UI.Pages.Modules.length;C++){var B=MySpace.UI.Pages.Modules[C];if(B.typeId==23){var K;Array.forEach(MySpace.UI.Pages.ModuleMetaData,function(M){if(M.typeId==B.typeId){K=M}});if(!K){return}var A=$create(MySpace.UI.Pages.Module,{uid:B.id,targetId:B.targetId,name:K.name,typeid:B.typeId,element:$get("module"+(B.id!=0?B.id:K.name)),runScripts:true});A.loadContent();return}}return}var L=document.createElement("div");var D=document.createElement("div");L.innerHTML=J;var H=G.firstChild;while(L.firstChild){if(L.firstChild.nodeName.toLowerCase()=="script"){D.appendChild(L.firstChild)}else{G.insertBefore(L.firstChild,H)}}var I=$q(".activityItem",G);for(var F=0;F<I.length;F++){Sys.UI.DomElement.removeCssClass(I[F],"odd");Sys.UI.DomElement.removeCssClass(I[F],"even");if(F==0){Sys.UI.DomElement.addCssClass(I[F],"first")}else{Sys.UI.DomElement.removeCssClass(I[F],"first")}Sys.UI.DomElement.addCssClass(I[F],F%2==0?"odd":"even")}var E=$create(MySpace.UI.Pages.Control,{element:D});E._executeScripts()};Type.registerNamespace("MySpace.UI.ActivityStream");MySpace.UI.ActivityStream.WireDelete=function(){var E=MySpace.UI.ActivityStream.DeleteHash;if(!E){return}var D=$q(".activityStreamModule .activitiesContainer",null,true);if(D){var C=$q(".delete",D,false);for(var B in C){var A=C[B];var F=A.id;A.onclick=function(){var H=this;var J=H.id.substring(8);var G=window.deleteActivityPopup;if(!G){var I=document.createElement("div");I.appendChild(document.createTextNode(MySpace.UI.ActivityStream.Text.DeleteStatusMoodUpdate));G=window.deleteActivityPopup=MySpace.UI.Popup.create(I,MySpace.UI.ActivityStream.Text.ConfirmDelete);G.set_top(200);G.set_width(500);G.set_parent(this)}else{G.remove_buttons()}G.add_button(MySpace.UI.ActivityStream.Text.Yes,false,function(){Sys.Net.WebServiceProxy.invoke("/modules/friends/services/FriendsService.asmx","DeleteStatusMoodWithTicks",false,{userId:MySpace.ClientContext.UserId,timeTick:J,token:E},function(){H.parentNode.style.display="none";G._hide();Sys.UI.DomElement.removeCssClass(G._box.childNodes[2],"deleteProcessing")},function(){G._hide()});Sys.UI.DomElement.addCssClass(G._box.childNodes[2],"deleteProcessing")});G.add_button(MySpace.UI.ActivityStream.Text.No,false,function(){G._hide()});G.show()}}}};Type.registerNamespace("MySpace.UI");MySpace.UI.HorizontalMenu=function(A){MySpace.UI.HorizontalMenu.initializeBase(this,[A])};MySpace.UI.HorizontalMenu.prototype={_items:null,_selectedItem:null,_selectedIndex:null,_hasDropdown:null,_dropdown:null,_dropdownItems:null,_dropdownTitle:null,_dropdownList:null,_links:null,initialize:function(){this._items=$q("li",this._element);this._links=$q("li>a",this._element);this._selectedItem=$q("li.selected",this._element,true);this._hasDropdown=false;this._dropdownItems=0;this.resize();this.wire();this._element.style.overflow="visible";MySpace.UI.HorizontalMenu.callBaseMethod(this,"initialize")},wire:function(){for(var A=0;A<this._links.length;A++){$addHandler(this._links[A],"click",Function.createDelegate(this,this.itemClick))}},itemClick:function(A){A.preventDefault();this.selectItem(A.target.parentNode)},selectItem:function(A){if(this._selectedItem!=null){Sys.UI.DomElement.removeCssClass(this._selectedItem,"selected")}this._selectedItem=A;Sys.UI.DomElement.addCssClass(this._selectedItem,"selected");this._selectedIndex=this.itemIndex(this._selectedItem);if(this._selectedIndex>=this._items.length-this._dropdownItems){Sys.UI.DomElement.addCssClass(this._dropdown,"selectedDropdown");this._dropdownTitle.innerHTML=$q("a",this._selectedItem,true).innerHTML}else{if(this._dropdown!=null){Sys.UI.DomElement.removeCssClass(this._dropdown,"selectedDropdown");this._dropdownTitle.innerHTML=MySpaceRes.ProfileDisplayV3.More}}},itemIndex:function(B){for(var A=0;A<this._items.length;A++){if(this._items[A]==B){return A}}return -1},resize:function(){var C=Sys.UI.DomElement.getBounds(this._items[0]);var B=this._dropdownItems==0?this._items[this._items.length-1]:this._dropdown;var A=Sys.UI.DomElement.getBounds(B);if(A.y==C.y){while(A.y==C.y&&this._dropdownItems>0){this.removeFromDropdown(this._items[this._items.length-this._dropdownItems]);A=Sys.UI.DomElement.getBounds(B)}A=Sys.UI.DomElement.getBounds(B);if(this._dropdownItems==0){this.removeDropdown()}else{if(A.y!=C.y){this.addToDropdown(this._items[this._items.length-1-this._dropdownItems])}}}else{this.showDropdown();while(this._dropdownItems<this._items.length-1){A=Sys.UI.DomElement.getBounds(this._dropdown);if(A.y==C.y){break}this.addToDropdown(this._items[this._items.length-1-this._dropdownItems])}this._dropdownTitle.style.width=""}this.selectItem(this._selectedItem)},createDropdown:function(){if(this._dropdown!=null){return}this._dropdown=document.createElement("li");this._dropdownTitle=document.createElement("span");this._dropdownTitle.innerHTML=MySpaceRes.ProfileDisplayV3.More;this._dropdown.appendChild(this._dropdownTitle);var C=document.createElement("small");C.innerHTML="▼";this._dropdown.appendChild(C);this._dropdownList=document.createElement("ol");this._dropdown.appendChild(this._dropdownList);this._element.appendChild(this._dropdown);Sys.UI.DomElement.addCssClass(this._dropdown,"dropdown");var B=Sys.UI.DomElement.getBounds(this._dropdownTitle).width;for(var A=0;A<this._items.length;A++){var D=Sys.UI.DomElement.getBounds(this._items[A]);if(D.width>B){B=D.width}}this._dropdownTitle.style.width=B+"px"},removeDropdown:function(){if(this._dropdownItems>0||this._dropdown==null){return}this._element.removeChild(this._dropdown);this._dropdown=null},showDropdown:function(){if(this._dropdown==null){this.createDropdown()}this._dropdown.style.display="block"},addToDropdown:function(A){this._element.removeChild(A);if(this._dropdownitems==0){this._dropdownList.appendChild(A)}else{this._dropdownList.insertBefore(A,this._dropdownList.firstChild)}this._dropdownItems++},removeFromDropdown:function(A){this._dropdownList.removeChild(A);this._element.insertBefore(A,this._dropdown);this._dropdownItems--}};MySpace.UI.HorizontalMenu.registerClass("MySpace.UI.HorizontalMenu",Sys.UI.Control);Type.registerNamespace("MySpace.UI.Pages.Home.ActivityStream");MySpace.UI.Pages.Home.ActivityStream.Filters=function(){MySpace.UI.Pages.Home.ActivityStream.Filters.initializeBase(this)};MySpace.UI.Pages.Home.ActivityStream.Filters.prototype={_streamModule:null,_pivotsContainer:null,_streamContainer:null,_sourceMenu:null,_totalFeaturedItems:0,_currentSource:null,_currentFilter:null,_currentFilterItem:null,_requestingData:false,_waitingImage:null,_menu:null,_viewMoreEl:null,get_requestScripts:function(){if(this._currentFilter===MySpace.UI.Pages.Home.ActivityStream.Filter.Bulletins){return true}return false},get_requestClientResources:function(){return typeof(MySpaceRes.Comment)==="undefined"},get_streamModule:function(){return this._streamModule},set_streamModule:function(A){this._streamModule=A},get_filter:function(){return this._currentFilter},get_source:function(){return this._currentSource},initialize:function(){MySpace.UI.Pages.Home.ActivityStream.Filters.callBaseMethod(this,"initialize");this._streamModule=this._streamModule||$q(".activityStreamModule",null,true);this._pivotsContainer=$q(".pivotsContainer",this._streamModule,true);this._streamContainer=$q(".streamContainer",this._streamModule,true);this._sourceMenu=$q("select",this._pivotsContainer,true);this._toolBarEl=$q(".toolbar",this._streamModule,false);this._viewMoreEl=$q(".viewAllAnchor",this._streamModule,true);this._totalFeaturedItems=this.totalFeaturedItems;this._currentFilter=MySpace.UI.Pages.Home.ActivityStream.Selections.filter;this._currentSource=MySpace.UI.Pages.Home.ActivityStream.Selections.source;var A=$q(".horizontalMenu",this._pivotsContainer,true);this._menu=$create(MySpace.UI.HorizontalMenu,{},null,null,A);this._currentFilterItem=this._menu._selectedItem;this.wire();this.render()},render:function(){this.resetSourceMenu();this.wirePostBulletinLink();this.wireVideos();this.wireDelete();this.wireReShare();this.wireSponsoredActivity();this.createViewMoreLink()},createViewMoreLink:function(){var A=MySpace.UI.Pages.Home.ActivityStream.NavigationUrls.StandaloneStream;if(this._viewMoreEl&&A){A+=A.indexOf("?")==-1?"?":"&";this._viewMoreEl.href=String.format("{0}f={1}&s={2}",A,this._currentFilter,this._currentSource)}},dispose:function(){this._streamModule=null;this._pivotsContainer=null;this._streamContainer=null;this._sourceMenu=null;this._filterList=null;this._filterListItems=null;this._waitingImage=null;this._menu=null;this._viewMoreEl=null},wire:function(){var B=this;var A=$q("li a",this._pivotsContainer,false);Array.forEach(A,function(C){C.onclick=function(){B.executeFilter(this);return false}});if(this._sourceMenu){this._sourceMenu.onchange=function(){B.executeFilter()}}},executeFilter:function(B){if(this._requestingData===true){if(typeof(B)!="undefined"){this._menu.selectItem(this._currentFilterItem)}return}this._requestingData=true;if(this._sourceMenu&&this._sourceMenu.value==="-1"){document.location.href=MySpace.UI.Pages.Home.ActivityStream.NavigationUrls.CreateFriendCategory}else{this.wait();if(typeof B==="undefined"&&this._sourceMenu){this._currentSource=this._sourceMenu.value}else{this._currentFilter=this.parseUrlForFilter(B.href);this._currentFilterItem=B.parentNode}if(!MySpace.Application.keyDisabled("DWBeaconStreamFilters")&&MySpace.Beacon){var A=this._currentSource<0?-1:this._currentSource;MySpace.Beacon.Request({ustype:this._currentFilter,ussource:A})}this.sendRequest()}},wait:function(){this._streamContainer.innerHTML="";Sys.UI.DomElement.addCssClass(this._streamContainer,"loading");if(this._toolBarEl){Array.forEach(this._toolBarEl,function(A){A.style.display="none"})}},unWait:function(){if(this._toolBarEl){Array.forEach(this._toolBarEl,function(A){A.style.display=""})}Sys.UI.DomElement.removeCssClass(this._streamContainer,"loading")},sendRequest:function(){MySpace.UI.Pages.Data.request("RenderUnifiedActivities.ashx",this,this.handleResponse,String.format("f={0}&s={1}&sc={2}&r={3}",this._currentFilter,this._currentSource,this.get_requestScripts(),this.get_requestClientResources()))},handleResponse:function(B,C){var E=B.get_webRequest().get_userContext();try{if(B.get_responseAvailable()){var A=B.get_responseData();E.unWait();E._streamContainer.innerHTML=A;E.clearMetaData();var D=E.executeScripts(E._streamContainer);if(D.wireComments){E.wireComments()}if(D.wireVideos){E.wireVideos()}if(E._currentFilter==MySpace.UI.Pages.Home.ActivityStream.Filter.Bulletins){E.wirePostBulletinLink()}E.wireDelete();E.wireReShare();E.wireSponsoredActivity();E.createViewMoreLink()}}finally{E._requestingData=false}},clearMetaData:function(){if(MySpace.UI.InlineCommentMetadata){MySpace.UI.InlineCommentMetadata.RegisteredControls=[]}if(MySpace.UI.InlineVideoMetadata){MySpace.UI.InlineVideoMetadata.RegisteredControls=[]}},wireVideos:function(){if(!MySpace.UI.InlineVideoMetadata||!MySpace.UI.InlineVideoMetadata.RegisteredControls||MySpace.UI.InlineVideoMetadata.RegisteredControls.length===0){return}MySpace.UI.InlineVideo.wire(MySpace.UI.InlineVideoMetadata.DefaultWidth)},wireComments:function(){MySpace.UI.InlineComment.wire()},wirePostBulletinLink:function(){var A=$q(".bulletinsLinks a",this._streamContainer,true);if(A){A.onclick=function(B){openCommentPopup(B)}}},wireDelete:function(){if(MySpace.UI.ActivityStream){MySpace.UI.ActivityStream.WireDelete()}},wireSponsoredActivity:function(){if(MySpace.UI.Pages.Activity){MySpace.UI.Pages.Activity.WireSponsored()}},wireReShare:function(){if(MySpace.UI.ReShare){var A=this;MySpace.UI.ReShare.wire(function(){A.sendRequest()})}},executeScripts:function(F){var H=false;var C=false;if(F){var A=F.getElementsByTagName("script");if(A.length>0){var B=[];for(var E=A.length-1;E>-1;E--){var G=document.createElement("script");G.type="text/javascript";if(A[E].text!==""){G.text=A[E].text;if(G.text.indexOf("InlineCommentMetadata")>-1){H=true}if(G.text.indexOf("InlineVideoMetadata")>-1){C=true}}else{G.src=A[E].src}A[E].parentNode.removeChild(A[E]);Array.add(B,G)}if(B.length>0){var D=document.getElementsByTagName("head")[0];for(var E=B.length-1;E>-1;E--){D.appendChild(B[E])}}}}return{wireComments:H,wireVideos:C}},parseUrlForFilter:function(B){var E=B.substring(B.indexOf("?")+1).split("&");for(var C=0;C<E.length;C++){var F=E[C].indexOf("=");if(F>=0){var A=E[C].substring(0,F);var D=E[C].substring(F+1);if(A==="f"){return D}}}return this._currentFilter},resetSourceMenu:function(){if(this._sourceMenu&&this._sourceMenu.value==="-1"){this._sourceMenu.value=this._currentSource}}};MySpace.UI.Pages.Home.ActivityStream.Filters.registerClass("MySpace.UI.Pages.Home.ActivityStream.Filters",Sys.Component);MySpace.UI.InlineComment=function(){throw"Cannot instantiate static class."};MySpace.UI.InlineComment.show=function(B,E,D,C,A){$create(MySpace.UI._InlineComment,{statusMoodAuthorId:B,updateDate:E,comments:D,commentLinkId:C,elementId:A},null,null,$get(A))};MySpace.UI.InlineComment.wire=function(){if(!MySpace.UI.InlineCommentMetadata||!MySpace.UI.InlineCommentMetadata.RegisteredControls){return}var D=null,B=null;for(var A=0;A<MySpace.UI.InlineCommentMetadata.RegisteredControls.length;A++){D=MySpace.UI.InlineCommentMetadata.RegisteredControls[A];B=$get(D.cid);if(B){var E={inputWidth:D.iw,defComments:D.dc,commentLinkId:D.clid,statusMoodAuthorId:D.aid,updateDate:D.ud,showOnLoad:D.ol,preRendered:true,showInputDiv:D.sid};if(D.tt.length>0){E.textboxTip=D.tt}var C=!MySpace.UI.InlineCommentMetadata.OnQuickPostCreated?null:{quickPostCreated:MySpace.UI.InlineCommentMetadata.OnQuickPostCreated};D.control=$create(MySpace.UI._InlineComment,E,C,null,B)}}};MySpace.UI._InlineComment=function(A){MySpace.UI._InlineComment.initializeBase(this,[A])};MySpace.UI._InlineComment.prototype={webServiceParams:null,webServiceUrl:"/Modules/Common/Services/InlineComment.asmx",_commentLinkId:null,_comments:null,_inputWidth:492,_defComments:2,_preRendered:false,_statusMoodAuthorId:null,_textboxTip:"",_totalCount:0,_updateDate:null,_showOnLoad:true,_showInputDiv:true,_commentsDiv:null,_container:null,_cssclass:"",_enableLinkCount:false,_inputDiv:null,_firstShow:true,_isVisible:true,_linksDiv:null,_loadingDiv:null,_quickPostInlineControl:null,_hideAllLink:null,_rendered:false,_showAllLink:null,_showMoreLink:null,_textArea:null,_totalLabel:null,_totalShown:0,get_commentLinkId:function(){return this._commentLinkId},set_commentLinkId:function(A){this._commentLinkId=A},get_comments:function(){return this._comments},set_comments:function(A){this._comments=A},get_inputWidth:function(){return this._inputWidth},set_inputWidth:function(A){this._inputWidth=A},get_defComments:function(){return this._defComments},set_defComments:function(A){this._defComments=A},get_preRendered:function(){return this._preRendered},set_preRendered:function(A){this._preRendered=A},get_showOnLoad:function(){return this._showOnLoad},set_showOnLoad:function(A){this._showOnLoad=A},get_statusMoodAuthorId:function(){return this._statusMoodAuthorId},set_statusMoodAuthorId:function(A){this._statusMoodAuthorId=A},get_textboxTip:function(){return this._textboxTip},set_textboxTip:function(A){this._textboxTip=A},get_totalCount:function(){return this._totalCount},set_totalCount:function(A){this._totalCount=A},get_updateDate:function(){return this._updateDate},set_updateDate:function(A){this._updateDate=A},get_showInputDiv:function(){return this._showInputDiv},set_showInputDiv:function(A){this._showInputDiv=A},add_quickPostCreated:function(A){this.get_events().addHandler("quickPostCreated",A)},remove_quickPostCreated:function(A){this.get_events().removeHandler("quickPostCreated",A)},initialize:function(){this._commentDeletedHandler=Function.createDelegate(this,this._commentDeleted);this._postSuccessHandler=Function.createDelegate(this,this._postSuccess);this._hideAllHandler=Function.createDelegate(this,this._showLess);this._showAllHandler=Function.createDelegate(this,this._showAll);this._showMoreHandler=Function.createDelegate(this,this._showMore);this._toggleHandler=Function.createDelegate(this,this.toggle);if(MySpaceRes.Comment&&MySpaceRes.Comment.ShowMore){this._wireCommentLink();if((this._comments&&this._comments.TotalComments>0)||this._preRendered){this.show(true)}else{this._isVisible=false}}else{this._loadResourceStrings()}},toggle:function(A){this._showInputDiv=true;this.show()},cancelEvent:function(A){A.preventDefault()},show:function(A){if(this._firstShow){this._textboxTip=MySpaceRes.Comment.AddInlineComment+"...";if(!this._rendered){this._renderInput();if(this._preRendered){this._wireComments();if(this._totalCount<1){return}}else{if(this._comments){this._loadComments()}}}if(!this._showOnLoad&&!this._ready){this._isVisible=false;this._inputDiv.style.display="none";this._commentsDiv.style.display="none";this._firstShow=true;this._ready=true;this._toggleShowMoreLink();return}this._firstShow=false}if(!A){window.setTimeout(Function.createDelegate(this,this._openQuickPost),0)}this._isVisible=true;if(typeof(this._showInputDiv)=="boolean"){this._inputDiv.style.display=this._showInputDiv?"block":"none"}else{this._inputDiv.style.display=Boolean.parse(this._showInputDiv)?"block":"none"}this._showInputDiv=true;this._commentsDiv.style.display=(this._totalShown>0?"block":"none");this._toggleShowMoreLink()},hide:function(){this._isVisible=false;this._inputDiv.style.display="none";this._commentsDiv.style.display="none";this._toggleShowMoreLink()},_call:function(A,C,D){C=C||{};C.args=this.webServiceParams;var B=this.webServiceUrl.replace(/https?:\/\/[^\/]*\//,"/");Sys.Net.WebServiceProxy.invoke(B,A,false,C,Function.createPartial(this,D,C.args),Function.createDelegate(this,this._onError))},_onError:function(A){alert(MySpaceRes.Header.ErrorMessage.replace(/<br.*>/gi,"\n"))},_wireCommentLink:function(){if(this._commentLinkId||this._commentLink){var A=$get(this._commentLinkId);A.innerHTML=MySpaceRes.HomeDisplay.Comment;if(this._enableLinkCount){if(this._totalCount==1){A.innerHTML=String.format("{0} {1}",1,MySpaceRes.HomeDisplay.Comment)}else{if(this._totalCount>1){A.innerHTML=String.format("{0} {1}",this._totalCount,MySpaceRes.HomeDisplay.Comments)}}}$addHandler(A,"mousedown",this._toggleHandler);$addHandler(A,"click",Function.createDelegate(this,this.cancelEvent))}},_wireShowMoreLinks:function(){var A=MySpace.Utils.Selector.query("a",this._linksDiv);if(A.length>1){this._showMoreLink=A[0];this._hideAllLink=A[1];this._showAllLink=A[2];$addHandler(this._showMoreLink,"mousedown",this._showMoreHandler);$addHandler(this._hideAllLink,"mousedown",this._hideAllHandler);$addHandler(this._showAllLink,"click",this._showAllHandler)}this._totalLabel=MySpace.Utils.Selector.query(".icTotal",this._linksDiv)[0]},_showMore:function(){this._inputDiv.style.display="block";if(this._firstShow){this.show(true)}else{this._getRecentComments(this._totalShown,10);this._updateCssClasses()}},_updateCssClasses:function(){var A="even";for(var B=0;B<this._commentsDiv.childNodes.length;B++){A=A=="odd"?"even":"odd";this._commentsDiv.childNodes[B].className=A+(B==this._commentsDiv.childNodes.length-1?" last":"")}},_showAll:function(){this.show(true)},_showLess:function(){this.hide()},_postSuccess:function(A,B){this._renderComment(B.data.comment,"",true);this._totalCount++;this._updateCssClasses();this._toggleShowMoreLink();this._commentsDiv.style.display=""},_clearComments:function(){this._removeChildrenFromNode(this._commentsDiv)},_getRecentComments:function(A,B,C){this._loadingDiv.style.display="block";if(A<1&&!C){this._clearComments();this._totalShown=0}this.webServiceParams={doInsert:C||false};var E={authorId:this._statusMoodAuthorId,updateDate:this._updateDate,startIdx:A,count:B};var D=Function.createDelegate(this,this._loadComments);this._call("GetComments",E,D)},_removeChildrenFromNode:function(B){if(!this._isValidObj(B)){return}var A=B.childNodes.length;while(B.hasChildNodes()){B.removeChild(B.firstChild)}},_isValidObj:function(A){if(null==A){return false}if("undefined"==typeof(A)){return false}return true},_renderInput:function(){if(!this._preRendered){var B='<div class="inlineCommentCtl"><div class="icWrap"><div class="icInputRow">           <div class="icInput">             <div class="icTxtArea"><textarea>'+this._textboxTip+'</textarea></div>               <button class="fakeButton" onClick="return false;"></button>           </div>           <div class="icButtons">               <div class="hsmButton" tabindex="503" style="display:none;">                   Submit                   <div class="hsmButtonRight"></div>               </div>           </div></div><ul class="icComments"></ul><div class="icLinks">   <span class="icTotal"></span>   <a class="showMore">'+MySpaceRes.Comment.ShowMore+'</a>   <a class="showLess">'+MySpaceRes.Comment.HideAll+'</a>   <a class="showAll">'+MySpaceRes.ProfileEdit.Show.toLowerCase()+'</a>   <div class="icAjaxLoader"></div>   <div class="clear"></div></div></div></div>';this._element.innerHTML=B}var C=this.get_element();this._container=MySpace.Utils.Selector.query("div.inlineCommentCtl",C,true);this._inputDiv=MySpace.Utils.Selector.query("div.icInputRow",C,true);this._commentsDiv=MySpace.Utils.Selector.query("ul.icComments",C,true);this._linksDiv=MySpace.Utils.Selector.query("div.icLinks",C,true);this._textArea=MySpace.Utils.Selector.query(".icTxtArea textarea",C,true);this._loadingDiv=MySpace.Utils.Selector.query("div.icAjaxLoader",C,true);this._wireShowMoreLinks();var A=MySpace.Utils.Selector.query(".icInput",this._inputDiv)[0];$addHandler(A.getElementsByTagName("textarea")[0],"focus",Function.createDelegate(this,this._openQuickPost));this._textArea.removeAttribute("disabled");this._rendered=true},reset:function(){this._linksDiv.style.display="none";this._container.style.display="none";this._commentsDiv.innerHTML="";this.set_totalCount(0)},_openQuickPost:function(A){if(A&&A.preventDefault){A.preventDefault()}MySpace.UI.addQuickPostScript(Function.createDelegate(this,function(){if(!this._quickPostInlineControl){var C=MySpace.Utils.Selector.query(".icInput",this._inputDiv)[0];this._quickPostInlineControl=$create(MySpace.UI.QuickPostInline,{enableCancel:true,enableBlurBehavior:true,textboxWrapClass:"icTxtArea",textboxTip:this._textboxTip,webServiceUrl:this.webServiceUrl,webServiceParams:{friendId:this._statusMoodAuthorId,updateDate:this._updateDate}},{success:this._postSuccessHandler},null,C);this._quickPostInlineControl.show();var B=this.get_events().getHandler("quickPostCreated");if(B){B(this,C)}return}this._quickPostInlineControl.show()}))},_loadComments:function(B,A){if(A){this._comments=A}if(this._comments&&this._comments.TotalComments){this._totalCount=this._comments.TotalComments;for(var C=0;C<this._comments.CommentsList.length;C++){this._cssclass=this._cssclass=="odd"?"even":"odd";var D=C==this._comments.CommentsList.length-1?" last":"";var E=(B&&B.doInsert?B.doInsert:false);this._renderComment(this._comments.CommentsList[C],this._cssclass+D,E)}this._commentsDiv.style.display="block";this._toggleShowMoreLink()}this._loadingDiv.style.display="none"},_wireComments:function(){this._totalCount=this._commentsDiv.getAttribute("ttl");for(var B=0;B<this._commentsDiv.childNodes.length;B++){var A=MySpace.Utils.Selector.query(".icDeleteBtn",this._commentsDiv.childNodes[B])[0];$create(MySpace.UI.Comment,{deleteBtn:A,defComments:this._defComments},{commentDeleted:this._commentDeletedHandler},null,this._commentsDiv);this._totalShown++}},_renderComment:function(C,A,B){$create(MySpace.UI.Comment,{comment:C,statusAuthorId:this._statusMoodAuthorId,cssClass:A,defComments:this._defComments,webServiceUrl:this.webServiceUrl,updateDate:this._updateDate,doInsert:B},{commentDeleted:this._commentDeletedHandler},null,this._commentsDiv);this._totalShown++},_commentDeleted:function(B,A){this._commentsDiv.removeChild(this._commentsDiv.childNodes[A.currIdx]);if(A.CommentsList&&A.CommentsList.length>0&&parseInt(A.currIdx)<=1&&this._totalShown==this._defComments){this._renderComment(A.CommentsList[0],"",false)}this._totalCount--;this._totalShown--;if(this._totalCount==0){this._inputDiv.style.display="block"}this._updateCssClasses();this._toggleShowMoreLink()},_toggleShowMoreLink:function(){this._totalLabel.innerHTML=this._totalCount>1?String.format(MySpaceRes.Comment.CommentsTotal,this._totalCount):MySpaceRes.Comment.CommentTotal;this._totalLabel.style.display=this._totalCount>0?"":"none";if(this._isVisible){this._showMoreLink.style.display=parseInt(this._totalShown)<parseInt(this._totalCount)&&parseInt(this._totalCount)>parseInt(this._defComments)?"block":"none";this._hideAllLink.style.display=parseInt(this._totalShown)>parseInt(this._defComments)&&parseInt(this._totalShown)==parseInt(this._totalCount)?"block":"none";this._showAllLink.style.display="none";this._container.style.display="block"}else{this._showMoreLink.style.display=(this._firstShow&&!this._showOnLoad&&this._totalCount>0?"block":"none");this._hideAllLink.style.display="none";this._showAllLink.style.display=(this._firstShow&&!this._showOnLoad?"none":"block");this._container.style.display=this._totalCount>0?"block":"none"}this._linksDiv.style.display=this._totalCount>0?"block":"none"},dispose:function(){},_loadResourceStrings:function(){this._call("GetResources",{},Function.createDelegate(this,this._addResourceStrings))},_addResourceStrings:function(B,A){this._addStrings(A.strings);if(this._comments&&this._comments.TotalComments>0){this.show(true)}else{this._isVisible=false}this._wireCommentLink()},_addStrings:function(A){for(var B in A){if(!MySpaceRes[B]){MySpaceRes[B]={}}for(var C in A[B]){MySpaceRes[B][C]=A[B][C]}}}};MySpace.UI._InlineComment.registerClass("MySpace.UI._InlineComment",Sys.UI.Control);MySpace.UI.Comment=function(A){MySpace.UI.Comment.initializeBase(this,[A])};MySpace.UI.Comment.prototype={webServiceParams:{},_statusAuthorId:0,_comment:null,_cssClass:"",_doInsert:false,_updateDate:null,_webServiceUrl:"/Modules/Common/Services/InlineComment.asmx",_commentDate:null,_commentAuthorId:null,_currIdx:0,_userId:-1,get_defComments:function(){return this._defComments},set_defComments:function(A){this._defComments=A},get_statusAuthorId:function(){return this._statusAuthorId},set_statusAuthorId:function(A){this._statusAuthorId=A},get_cssClass:function(){return this._cssClass},set_cssClass:function(A){this._cssClass=A},get_comment:function(){return this._comment},set_comment:function(A){this._comment=A},get_deleteBtn:function(){return this._deleteBtn},set_deleteBtn:function(A){this._deleteBtn=A},get_doInsert:function(){return this._doInsert},set_doInsert:function(A){this._doInsert=A},get_updateDate:function(){return this._updateDate},set_updateDate:function(A){this._updateDate=A},get_webServiceUrl:function(){return this._webServiceUrl},set_webServiceUrl:function(A){this._webServiceUrl=A},initialize:function(){this._deleteCommentHandler=Function.createDelegate(this,this._deleteComment);this._successHandler=Function.createDelegate(this,this._success);this._userId=MySpace.ClientContext.UserId;if(!this._deleteBtn){var B='<div class="icContent"><div class="icProfileImage"></div>   <div class="icCommentBody">       <div class="icUpdateInfo">           <span class="icLink"><a href="'+this._comment.ProfileUrl+'">'+this._comment.UserName+'</a></span>           <span class="icLastUpdate">'+this._comment.LastUpdateText+'</span>       </div>       <div class="icComment">'+this._comment.Body+'</div>   </div>   <div class="icDelete"></div></div><div class="clear"></div>';this._commentDate=this._comment.PostedDateText;this._commentAuthorId=this._comment.AuthorId;var D=this._createItem(B);if(this._cssClass.length>0){D.className=this._cssClass}if(this._statusAuthorId==this._userId||this._comment.AuthorId==this._userId){var C=MySpace.Utils.Selector.query(".icDelete",D)[0];var A=document.createElement("div");A.className="icDeleteBtn";A.setAttribute("cd",this._commentDate);A.setAttribute("aid",this._commentAuthorId);$addHandler(A,"click",Function.createDelegate(this,this._confirmDelete));C.appendChild(A)}$create(MySpace.UI.ProfileImageLink,this._comment.ProfileImageUrl,{},{},D.firstChild.firstChild);D.setAttribute("cd",this._commentDate);D.setAttribute("aid",this._commentAuthorId);if(this._doInsert&&this._element.childNodes.length>0){this._element.insertBefore(D,this._element.childNodes[0])}else{this._element.appendChild(D)}}else{this._commentDate=this._deleteBtn.getAttribute("cd");this._commentAuthorId=this._deleteBtn.getAttribute("aid");this._statusAuthorId=this._deleteBtn.getAttribute("said");this._updateDate=this._deleteBtn.getAttribute("ud");this._currIdx=this._deleteBtn.getAttribute("idx");if(this._statusAuthorId==this._userId||this._commentAuthorId==this._userId){$addHandler(this._deleteBtn,"click",Function.createDelegate(this,this._confirmDelete))}else{this._deleteBtn.style.display="none"}}},_confirmDelete:function(D){for(var B=0;B<this._element.childNodes.length;B++){if(D.target.getAttribute("cd")==this._element.childNodes[B].getAttribute("cd")&&D.target.getAttribute("aid")==this._element.childNodes[B].getAttribute("aid")){this._currIdx=B}}if(this._commentAuthorId==this._userId){MySpace.UI.Popup.confirm(MySpaceRes.Comment.AreYouSureDelete,this._deleteCommentHandler)}else{var C=MySpaceRes.Comment.DeleteCommentConfirmationText;C=C.replace(new RegExp("\n","g"),"<br>");C=String.format(C,'<a href="http://profileedit.myspace.com/index.cfm?fuseaction=accountSettings.blockedUsers">',"</a>");var A=MySpace.UI.Popup.create(C,MySpaceRes.Common.Attention,this._deleteCommentHandler);A.add_button(MySpaceRes.Comment.DeleteComment,true);A.add_button(MySpaceRes.Comment.DeleteCommentAndBlockUser,false);A.set_width(400);A.show()}},_createItem:function(A){var B=document.createElement("li");if(typeof(A)==="string"){B.innerHTML=A}else{B.appendChild(A)}return B},_deleteComment:function(A,B){var D=B.target.value;if(B.target&&(D===MySpaceRes.Common.Yes||D===MySpaceRes.Comment.DeleteComment||D===MySpaceRes.Comment.DeleteCommentAndBlockUser)){var C={statusMoodAuthorId:this._statusAuthorId,updateDate:this._updateDate,commentAuthorId:this._commentAuthorId,userId:this._userId,commentPostDate:this._commentDate,currIdx:this._currIdx,defCmts:this._defComments,hash:MySpace.UI._QuickPost.hashToken,blockUser:(D===MySpaceRes.Comment.DeleteCommentAndBlockUser)};this._call("DeleteComment",C,this._successHandler)}},dispose:function(){},_raiseEvent:function(A,B){var C=this.get_events().getHandler(A);if(C){if(!B){B=new Sys.EventArgs()}C(this,B)}},add_commentDeleted:function(A){this.get_events().addHandler("commentDeleted",A)},remove_commentDeleted:function(A){this.get_events().removeHandler("commentDeleted",A)},_call:function(A,C,D){C=C||{};C.args=this.webServiceParams;var B=this._webServiceUrl.replace(/https?:\/\/[^\/]*\//,"/");Sys.Net.WebServiceProxy.invoke(B,A,false,C,Function.createPartial(this,D,C.args),Function.createDelegate(this,this._onError))},_success:function(B,A){for(var C=0;C<this._element.childNodes.length;C++){if(this._commentDate==this._element.childNodes[C].getAttribute("cd")&&this._commentAuthorId==this._element.childNodes[C].getAttribute("aid")){A.currIdx=C}}this._raiseEvent("commentDeleted",A)},_onError:function(A){alert(MySpaceRes.Header.ErrorMessage.replace(/<br.*>/gi,"\n"))}};MySpace.UI.Comment.registerClass("MySpace.UI.Comment",Sys.UI.Control);MySpace.UI.ProfileImageLink=function(A){MySpace.UI.ProfileImageLink.initializeBase(this,[A])};MySpace.UI.ProfileImageLink.prototype={html:"",initialize:function(){MySpace.UI.ProfileImageLink.callBaseMethod(this,"initialize");var A=this.get_element();A.innerHTML=this.html;MySpace.UI._ProfileImageLink.init(A.firstChild);if(MySpace.UI.FriendToolTip){MySpace.UI.FriendToolTip.attachHandlers(MySpace.Utils.Selector.query(".friendToolTipBox",A))}}};MySpace.UI.ProfileImageLink.registerClass("MySpace.UI.ProfileImageLink",Sys.UI.Behavior);MySpace.UI.InlineVideo=function(){throw"Cannot instantiate static class."};MySpace.UI.InlineVideo.wire=function(E){if(!MySpace.UI.InlineVideoMetadata||!MySpace.UI.InlineVideoMetadata.RegisteredControls){return}var B=null,D=null;for(var C=0,A=MySpace.UI.InlineVideoMetadata.RegisteredControls.length;C<A;C++){B=MySpace.UI.InlineVideoMetadata.RegisteredControls[C];D=$q("."+B.objectId,null,true);if(D){var F={defWidth:E,mediaUrl:B.mediaUrl,mediaType:B.mediaType,height:B.height,width:B.width,videoId:B.videoId,objectId:B.objectId};B.control=$create(MySpace.UI._InlineVideo,F,null,null,D)}}};MySpace.UI.InlineVideo.attach=function(F,A){if(!MySpace.UI.InlineVideoMetadata||!MySpace.UI.InlineVideoMetadata.RegisteredControls){return}var C=null,E=null;var H=MySpace.UI.InlineVideoMetadata.DefaultWidth||350;E=$q("."+A,null,true);if(E){for(var D=0,B=MySpace.UI.InlineVideoMetadata.RegisteredControls.length;D<B;D++){C=MySpace.UI.InlineVideoMetadata.RegisteredControls[D];if(C.objectId==A){var G={defWidth:H,mediaUrl:C.mediaUrl,mediaType:C.mediaType,height:C.height,width:C.width,videoId:C.videoId,objectId:C.objectId,target:F};C.control=$create(MySpace.UI._InlineVideo,G,null,null,E);return C.control}}}};MySpace.UI._InlineVideo=function(A){MySpace.UI._InlineVideo.initializeBase(this,[A])};MySpace.UI._InlineVideo.prototype={HuluMediaUrl:"http://player.hulu.com/embed/myspace_viral_player.swf?embed=true&videoID={0},ap=1",MySpaceMediaUrl:"http://mediaservices.myspace.com/services/media/embed.aspx/m={0},t=1,mt=video,ap=1",_defWidth:null,_mediaType:null,_mediaUrl:null,_height:null,_width:null,_objectId:null,_showVideoHandler:null,_target:null,_videoId:null,_embedCode:'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="{1}px" height="{2}px"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="movie" value="{0}" /><param name="wmode" value="opaque" /><embed src="{0}" wmode="opaque" width="{1}px" height="{2}px" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" /></object>',get_defWidth:function(){return this._defWidth},set_defWidth:function(A){this._defWidth=A},get_mediaType:function(){return this._mediaType},set_mediaType:function(A){this._mediaType=A},get_mediaUrl:function(){return this._mediaUrl},set_mediaUrl:function(A){this._mediaUrl=A},get_height:function(){return this._height},set_height:function(A){this._height=A},get_width:function(){return this._width},set_width:function(A){this._width=A},get_objectId:function(){return this._objectId},set_objectId:function(A){this._objectId=A},get_target:function(){return this._target},set_target:function(A){this._target=A},get_videoId:function(){return this._videoId},set_videoId:function(A){this._videoId=A},initialize:function(){this._showVideoHandler=Function.createDelegate(this,this._showPlayer);this._element.onclick=null;if(this._element.parentNode.nodeName.toLowerCase()=="a"){$addHandler(this._element.parentNode,"click",function(B){B.preventDefault()})}var A=$q(".videoIcon",this._element.parentNode,true);if(A!=null){$addHandler(A,"click",this._showVideoHandler)}if(this._target){$addHandler(this._target,"click",this._showVideoHandler)}else{$addHandler(this._element,"click",this._showVideoHandler)}},dispose:function(){this._showVideoHandler=null},_showPlayer:function(E){var B=$q(".player",this._element.parentNode,true);if(B!=null){return}if(this._element.parentNode.nodeName.toLowerCase()=="a"){Sys.UI.DomElement.addCssClass(this._element.parentNode,"playing")}if(this._element.parentNode.parentNode.nodeName.toLowerCase()=="li"){Sys.UI.DomElement.addCssClass(this._element.parentNode.parentNode,"playing")}var F=this._getMediaUrl();if(F.length>1){if(this._height==0){this._height=parseInt(this._defWidth/1.6)}var A=parseInt(this._defWidth/(this._width/this._height));var C=document.createElement("div");C.className="player";C.innerHTML=String.format(this._embedCode,F,this._defWidth,A);this._element.style.display="none";var D=this._element.parentNode;D.appendChild(C)}},_getMediaUrl:function(){switch(this._mediaType.toLowerCase()){case"other":return this._mediaUrl;break;default:return String.format(this._mediaType.toLowerCase()=="hulu"?this.HuluMediaUrl:this.MySpaceMediaUrl,this._videoId)}}};MySpace.UI._InlineVideo.registerClass("MySpace.UI._InlineVideo",Sys.UI.Control);MySpace.UI._ReShare=function(){MySpace.UI._ReShare.initializeBase(this)};MySpace.UI._ReShare.prototype={_contentUrl:null,_height:440,_width:440,_usePopup:false,_callBack:null,_url:"/Modules/PostTo/Pages/?u={0}",get_contentUrl:function(){return this._contentUrl},set_contentUrl:function(A){this._contentUrl=A},get_element:function(){return this._element},set_element:function(A){this._element=A},get_height:function(){return this._height},set_height:function(A){this._height=A},get_width:function(){return this._width},set_width:function(A){this._width=A},get_usePopup:function(){return this._usePopup},set_usePopup:function(A){this._usePopup=A},get_callBack:function(){return this._callBack},set_callBack:function(A){this._callBack=A},initialize:function(){if(this._contentUrl.length>0){this._url=String.format(this._url,encodeURIComponent(this._contentUrl));if(this._element){$addHandler(this._element,"click",Function.createDelegate(this,this.show))}}},show:function(G){if(this._usePopup){window.open(this._url,"ptm","height="+this._height+",width="+this._width)}else{var D='<iframe width="'+this._width+'" height="'+this._height+'" MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no allowTransparency=true src="'+this._url+'"></iframe>';var F=MySpace.UI.Popup.create(D,"");F.set_width(this._width+20);var C=F._hide;var B=this;F._hide=function(){C.apply(F);if(F.successReShare&&typeof(B._callBack)==="function"){B._callBack()}};var A=F._box.childNodes[2].firstChild;if(A){var E=function(M){var K=M.target;var J=K.contentWindow.document.getElementById("module-1");if(J){var I=$q(".mainWidth .closeWindow",J,true);if(I){I.style.display="block";I.onclick=function(){F._hide();return false}}var H=$q(".confirmation .homeLink",J,true);if(H){H.style.display="none"}var L=$q(".confirmation .closeWindow",J,true);if(L){F.successReShare=true;L.onclick=function(){F._hide();return false}}}};$addHandler(A,"load",E)}F.show()}if(G){G.preventDefault()}}};MySpace.UI._ReShare.registerClass("MySpace.UI._ReShare",Sys.Component);MySpace.UI.ReShare=function(){throw"Cannot instantiate static class."};MySpace.UI.ReShare.create=function(A){var B=$create(MySpace.UI._ReShare,{contentUrl:A},null,null,null);B.show()};MySpace.UI.ReShare.generic=function(D,A,C,B){var E=$create(MySpace.UI._ReShare,{contentUrl:D,height:A,width:C,usePopup:B},null,null,null);E.show()};MySpace.UI.ReShare.wire=function(E){var C=$q(".reshare",null);var D=null;for(var B=0,A=C.length;B<A;B++){D=C[B];if(D&&D.href){Sys.UI.DomElement.addCssClass(D,"shareable");var F={contentUrl:D.href,element:D,usePopup:false,callBack:E};$create(MySpace.UI._ReShare,F,null,null,null);D.href="#"}}};Type.registerNamespace("MySpace.UI.Pages.Home.StandaloneStream");MySpace.UI.Pages.Home.StandaloneStream.Filters=function(){MySpace.UI.Pages.Home.StandaloneStream.Filters.initializeBase(this)};MySpace.UI.Pages.Home.StandaloneStream.Filters.prototype={_isFilterByFriend:false,_selectedFriend:-1,initialize:function(){MySpace.UI.Pages.Home.StandaloneStream.Filters.callBaseMethod(this,"initialize");this._isFilterByFriend=MySpace.UI.Pages.Home.ActivityStream.Selections.isFilterByFriend;this._selectedFriend=MySpace.UI.Pages.Home.ActivityStream.Selections.selectedFriend;var C=$q(".filterstreambyfriend",this._pivotsContainer,true);var A=$get("friendInput");if(A){var B=$q(".filters",this._pivotsContainer,"true");A.orgValue=A.value;A.onblur=this.setFriendSelectText;A.onfocus=this.clearFriendSelectText}else{if(C){C.style.display="none"}}},sendRequest:function(){var A;if(this._isFilterByFriend){A=String.format("f={0}&s={1}&sc={2}&r={3}&uid={4}",this._currentFilter,MySpace.UI.Pages.Home.ActivityStream.Selections.personalFeed,this.get_requestScripts(),this.get_requestClientResources(),this._selectedFriend)}else{A=String.format("f={0}&s={1}&sc={2}&r={3}",this._currentFilter,this._currentSource,this.get_requestScripts(),this.get_requestClientResources())}MySpace.UI.Pages.Data.request("RenderStandaloneStream.ashx",this,this.handleResponse,A)},filterByFriend:function(A){if(MySpace.UI.Pages.Home.StandaloneStream.FriendSelector.isProcessed){MySpace.UI.Pages.Home.StandaloneStream.FriendSelector.isProcessed=false;return}if(A._selectedFriend){this._isFilterByFriend=true;this._selectedFriend=A._selectedFriend.UserId;this.sendRequest();this.wait()}else{if(this._isFilterByFriend){this._isFilterByFriend=false;this._selectedFriend=-1;this.sendRequest();this.wait()}}},wire:function(){MySpace.UI.Pages.Home.StandaloneStream.Filters.callBaseMethod(this,"wire");if(this._sourceMenu){var A=this;this._sourceMenu.onchange=function(){A.onSourceMenuChange()}}},onSourceMenuChange:function(){this._isFilterByFriend=false;this._selectedFriend=-1;if(MySpace.UI.Pages.Home.StandaloneStream.FriendSelector){MySpace.UI.Pages.Home.StandaloneStream.FriendSelector.selectFriendById(null)}this.setFriendSelectText();this.executeFilter()},setFriendSelectText:function(){var A=$get("friendInput");if(A){A.value=A.orgValue}},clearFriendSelectText:function(){var A=$get("friendInput");if(A){A.value=""}}};MySpace.UI.Pages.Home.StandaloneStream.Filters.registerClass("MySpace.UI.Pages.Home.StandaloneStream.Filters",MySpace.UI.Pages.Home.ActivityStream.Filters);MySpace.UI.Pages.Home.StandaloneStream.wireSyncPromo=function(){var B=$get("syncTwitterIcon");if(B){B.onlick=function(){MySpace.CMS.track("8ba515d7-611e-46e4-826b-6e9ca40defca","34098")}}var A=$get("syncSettings");if(A){A.onclick=function(){MySpace.CMS.track("8ba515d7-611e-46e4-826b-6e9ca40defca","34099")}}};Type.registerNamespace("MySpace.UI.Pages.Activity");MySpace.UI.Pages.Activity.WireSponsored=function(){if(!MySpace.UI.Pages.Activity.SponsoredMetadata){return}var A=$create(MySpace.UI.Pages.Activity.SponsoredActivity,null,null,null,null)};MySpace.UI.Pages.Activity.SponsoredActivity=function(){MySpace.UI.Pages.Activity.SponsoredActivity.initializeBase(this)};MySpace.UI.Pages.Activity.SponsoredActivity.prototype={_modal:null,_title:null,_invisibleDiv:null,_inlineVideoCtrl:null,initialize:function(){MySpace.UI.Pages.Activity.SponsoredActivity.callBaseMethod(this,"initialize");var D=$get("sponsoredFieldSet");if(!D){return}this._title=MySpace.UI.Pages.Activity.SponsoredMetadata.Title;var A=$q(".activityBody",D,true);var B=Sys.UI.DomElement.getBounds(A);this._invisibleDiv=document.createElement("div");D.appendChild(this._invisibleDiv);this._invisibleDiv.style.width=B.width+"px";this._invisibleDiv.style.height=B.height-8+"px";this._invisibleDiv.style.cursor="pointer";this._invisibleDiv.style.background="url(/modules/common/static/img/1by1.gif) repeat transparent";Sys.UI.DomElement.setLocation(this._invisibleDiv,B.x,B.y);var C=this;this._invisibleDiv.onclick=function(){C.onClickHandler()}},onClickHandler:function(){if(MySpace.UI.Pages.Activity.SponsoredMetadata.InlineVideoObject){if(!this._inlineVideoCtrl){var A=document.createElement("img");A.src=MySpace.UI.Pages.Activity.SponsoredMetadata.ClickThruUrl;A.className="trackingpixel";this._content=MySpace.UI.Pages.Activity.SponsoredMetadata.InlineVideoObject;if(MySpace.UI.InlineVideo){this._inlineVideoCtrl=MySpace.UI.InlineVideo.attach(this._invisibleDiv,this._content);this._inlineVideoCtrl._showPlayer()}}}else{this._content=MySpace.UI.Pages.Activity.SponsoredMetadata.ClickThruUrl;if(!this._modal){this._modal=this.createModal()}this._modal.show()}},createModal:function(){var D=document.createElement("iframe");D.src=this._content;D.setAttribute("width","100%");D.setAttribute("height","100%");var B=MySpace.UI.Popup.create(D,this._title);var C=610;var A=360;B.set_width(C);B._box.childNodes[2].style.height=A+"px";return B}};MySpace.UI.Pages.Activity.SponsoredActivity.registerClass("MySpace.UI.Pages.Activity.SponsoredActivity",Sys.Component);(function(){var A=$q(".applicationsModule iframe");for(var B=0;B<A.length;B++){if(A[B].className!=""){A[B].src=A[B].className}}})();