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.Area,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||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))};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))}}});MySpace.UI.Home=MySpace.UI.Home||{};MySpace.UI.Home.Alerts=function(){this.userAlerts=null;this.currentUserId=0;this.loadingImg=null;this.init()};MySpace.UI.Home.Alerts.prototype={init:function(){var A=jQuery(".userAlerts .alertsRequests");if(!A[0]){return}this.loadingImg=String.format('<img class="loadingImg" src="{0}/modules/common/static/img/loadercircles-15.gif" alt="{1}" />',MySpace.StaticContentBase,MySpaceRes.HomeDisplayV3.Loading);this.currentUserId=MySpace.ClientContext.UserId;this.requestTab(A);jQuery(this.userAlerts+" > li").hover(function(){jQuery(this).find("sup").css("display","none")})},requestTab:function(B){var C=B.find("li");if(C.length>0){for(var A=0,D=C.length;A<D;A++){this.wireRequestElement(C[A])}}else{return}},wireRequestElement:function(B){var A=this;var C={request:A._da(B,"id"),friend:A._da(B,"friend"),type:A._da(B,"type")};$element=jQuery(B);if(C.type==MySpace.UI.Home.AlertRequestType.FriendRequest){$element.find(".addRequest").click(function(){A._makeBeaconRequest("acceptFriend",C.request);A.acceptFriendRequest(A,this,C)});$element.find(".denyRequest").click(function(){A._makeBeaconRequest("denyFriend",C.request);A.denyFriendRequest(A,this,C)})}else{if(C.type==MySpace.UI.Home.AlertRequestType.AppInvite){$element.find(".addRequest").click(function(){A._makeBeaconRequest("addApp",C.request);A.addApp(A,this,C)})}}},acceptFriendRequest:function(A,C,E){var D=jQuery(C).parent();D.find("button").css("display","none");D.append(A.loadingImg);var B=String.format("AcceptFriend.ashx?request={0}&friend={1}",E.request,E.friend);MySpace.UI.Pages.Data.request(B,D,Function.createDelegate(D,A._friendRequest),null,null)},denyFriendRequest:function(A,C,E){var D=jQuery(C).parent();D.find("button").css("display","none");D.append(A.loadingImg);var B=String.format("DenyFriend.ashx?request={0}",E.request);MySpace.UI.Pages.Data.request(B,D,Function.createDelegate(D,A._denyRequest),null,null)},addFriend:function(C,D){var B={friendId:C,target:D};if(!Friends.AddToFriendsPopOver.getInstance()){$create(Friends.AddToFriendsPopOver,{iFrameSrc:MySpace.UI._addFriendPopupUrl,id:"globalAddToFriendsPopover"},null,null)}var A=Friends.AddToFriendsPopOver.getInstance();if(A){A._invokPopOver(B)}},addApp:function(A,C,D){var B=A._getAppData(D.request);window.location=B.data.appURL},_friendRequest:function(B,C){var A=jQuery(this).find(".loadingImg");try{var D=jQuery.trim(B&&B.get_responseData());if(D=="success"){jQuery(this).parent().addClass("requestSent");A.replaceWith(String.format('<p class="nowFriends">{0}</p>',MySpaceRes.HomeDisplayV3.Friends))}else{A.replaceWith(String.format('<p class="errorMsg">{0}</p>',MySpaceRes.HomeDisplayV3.RequestError));var E=this;setTimeout(function(){jQuery(E).find(".errorMsg").css("display","none").remove();jQuery(E).find("button").fadeIn()},2000)}}catch(F){}},_denyRequest:function(B,D){var F=jQuery(this);var A=F.find(".loadingImg");var G=F.parent();try{var E=jQuery.trim(B&&B.get_responseData());if(E=="success"){F.parent().animate({opacity:0}).slideToggle("fast",function(){jQuery(this).remove();C(G.parent())})}else{A.replaceWith(String.format('<p class="errorMsg">{0}</p>',MySpaceRes.HomeDisplayV3.RequestError));setTimeout(function(){F.find(".errorMsg").css("display","none").remove();F.find("button").fadeIn()},2000)}}catch(H){}function C(I){var J=jQuery("<li/>").addClass("noNewMsg").css({display:"none"}).html(String.format("<p>{0}</p>",MySpaceRes.HomeDisplayV3.NoNewRequests));if(!I.children().length>0){I.append(J);J.slideToggle()}}},_makeBeaconRequest:function(A,B){if(MySpace){MySpace.Beacon.Request({alertsTab:"Requests",alertsAction:"click",alertsRequest:A,alertsId:B})}},_da:function(B,A){return jQuery(B).attr("data-"+A)},_getAppData:function(C){var B=MySpace.UI.Home.AlertAppData;for(var A=0,D=B.length;A<D;A++){if(B[A].appId==C){return{index:A,data:B[A]}}}return null},_remove:function(D,C,B){var A=D.slice((B||C)+1||D.length);D.length=C<0?D.length+C:C;return D.push(A)}};new MySpace.UI.Home.Alerts();(function(){var D=$get("viewMyList");if(D){var A=function(I){var H;if(!I){var I=window.event}if(I.target!=null){H=I.target}else{if(I.srcElement!=null){H=I.srcElement}}while(H.id!="viewMyList"&&H.parentNode){H=H.parentNode}if(H.id!="viewMyList"){Sys.UI.DomElement.removeCssClass(D,"over");$removeHandler(document,"click",F)}};var F=Function.createDelegate(this,A);$addHandler(D,"click",Function.createDelegate(this,function(){if(Sys.UI.DomElement.containsCssClass(D,"over")){Sys.UI.DomElement.removeCssClass(D,"over");$removeHandler(document,"click",F)}else{Sys.UI.DomElement.addCssClass(D,"over");$addHandler(document,"click",F)}}))}var E=Sys.UI.DomElement;var B=null;var C=$get("pagethemes");if(!C||(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version<7)){return}var G=function(I){I.preventDefault();if(!Sys.UI.DomElement.containsCssClass(document.body,"pageEditor")){if(!B){B=document.createElement("div");document.body.appendChild(B);var H=$create(MySpace.UI.Pages.Control,{uid:0,element:B,dataSource:"ControlPanel.ashx"});H.loadContent();E.addCssClass(document.body,"pageEditor")}else{MySpace.UI.Pages.Editor.showPanel()}}else{MySpace.UI.Pages.Editor.hidePanel()}};$addHandler(C,"click",Function.createDelegate(C,G));$addHandler(C,"click",function(H){H.preventDefault();MySpace.Beacon.Request({feature:"uhp",method:"click",content:"page_themes_link",uid:userId})})})();(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){F.preventDefault();if(!(this.value==""||this.value==MySpaceRes.ViewAllFriendsPage.SearchWithin)){document.location.href=this.form.action+"&qry="+encodeURIComponent(this.value)+"#pm_cmp=Srh_UHPFriends_SearchResults"}};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 C=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 G=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 E=$get("maybeLater");var D=$get("noThanks");var A=$q("div.suggestionsModule")[0];var B=$q(".suggestionText",A,true);var F=$q(".abi div",A,true);if(B&&F){B.innerHTML=F.innerHTML}if(E!=null&&typeof(E)!="undefined"){$addHandler(E,"click",Function.createDelegate(E,C))}if(D!=null&&typeof(D)!="undefined"){$addHandler(D,"click",Function.createDelegate(D,G))}})();(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))})();(function(){var C=function(G){MySpace.UI.Pages.Data.request("AllowSharePublicContent.ashx",null,null,"atpc=true",null);MySpace.UI.Pages.Popup.Close()};var E=function(G){MySpace.UI.Pages.Data.request("AllowSharePublicContent.ashx",null,null,"atpc=false",null);MySpace.UI.Pages.Popup.Close()};var D=function(){var G=$get("atpcMoreContainer");G.className="atpcMoreShow"};var B=$get("atpcYes");var A=$get("atpcNo");var F=$get("atpcMore");if(B){$addHandler(B,"click",Function.createDelegate(B,C))}if(A){$addHandler(A,"click",Function.createDelegate(A,E))}if(F){$addHandler(F,"click",Function.createDelegate(F,D))}})();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){MySpace.Util.executeScripts(this._element)}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())}}};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,_isGrouped:false,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},get_isGrouped:function(){return this._isGrouped},set_isGrouped:function(A){this._isGrouped},initialize:function(){this._handler=this._handler||"Module.ashx";if(this._element){this._bodyElement=$q(".moduleBody",this._element,true)||this._element}},dispose:function(){MySpace.UI.Pages.Module.callBaseMethod(this,"dispose")},loadContent:function(){if(!this._dataSource){var A=String.format("?typeid={0}",this._typeid)+(this._targetId?String.format("&targetid={0}",this._targetId):"")+(this._uid?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._isGrouped?"isGrouped=true":null);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)}}else{C._element.innerHTML=A.get_responseData()}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()})();MySpace.UI.getViewportBounds=function(){return{width:self.innerWidth||(document.documentElement.clientWidth||document.body.clientWidth),height:self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight),x:window.pageXOffset||(document.documentElement.scrollLeft||document.body.scrollLeft),y:window.pageYOffset||(document.documentElement.scrollTop||document.body.scrollTop)}};MySpace.UI.getPercentVisible=function(D){var E=Sys.UI.DomElement.getBounds(D);var G=MySpace.UI.getViewportBounds();if(E.height===0||E.width===0){return 0}var B=G.y-E.y;B=(B<0)?0:(B>E.height?E.height:B);var A=G.y+G.height-E.y;A=(A>E.height)?E.height:A;var C=G.x-E.x;C=(C<0)?0:(C>E.width?E.width:C);var F=G.x+G.width-E.x;F=(F>E.width)?E.width:F;return((A-B)/E.height)*((F-C)/E.width)};MySpace.UI||(MySpace.UI={});MySpace.UI.UserActionWatcher=(function(){var A=MySpace.ClientIntMaintenanceConfigs.useractionwatcher,G=MySpace.ClientContext.FunctionalContext,D=!A||(A.enabled&&(!A[G]||A[G].enabled)),H=[],C=[],F=MySpace.UI.getPercentVisible,B=+new Date,E=function(){if(+new Date-B<2000){return}B=+new Date;Array.forEach(C,function(J){if(F($get(J[0]))>=0.5){generateAd.apply(this,J)}});if(window.google_ad_url){var I=$q(".googleafc")[0];if(!I){return}I.parentNode.removeChild(I);MySpace.UI.addScript(window.google_ad_url+"&"+(+new Date))}};if(!A||A.enabled){window.sdc_wrapper=function(){if(Array.contains(H,arguments[0])&&!Array.find(C,function(I){return I[0]===arguments[0]})){C.push(arguments)}generateAd.apply(this,arguments)}}return{discover:function(J){if(A&&!A.enabled){return}var I=$q(".action",J);Array.forEach(I,function(K){$addHandler(K,"click",E)})},setAdTypes:function(I){H=arguments},onUserAction:E}})();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 P=0;if(K.get_responseAvailable()){P=K.get_responseData();if(P>0){var L=$q(".pymkContainer .userInfo"+P);for(var O=0;O<L.length;O++){L[O].innerHTML=MySpaceRes.SiteSearch.Removed;Sys.UI.DomElement.addCssClass(L[O],"removeMessage");var M=L[O].parentNode.parentNode;var N=$q(".error",M,true);if(N!=null){N.style.display="none"}}}else{var N=$q(".pymkContainer .error");for(var O=0;O<N.length;O++){N[O].style.display="block"}}}};var A=$q(".pymkContainer .user");for(var D=0;D<A.length;D++){if(A[D].wired){continue}var F=B(A[D]);MySpace.UI.AddFriendPopup.bind(".userInfo"+F+" a.addToFriends");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}))}A[D].wired=true}};(function(A){A(".myVisitorsOverlayLater").click(function(B){B.preventDefault();MySpace.UI.Pages.Data.request("MyVisitorsOverlay.ashx?agreed=Later");MySpace.UI.Pages.Home.MyVisitors.turnOnOff(false);MySpace.UI.Pages.Popup.Close()});A(".myVisitorsOverlayYes").click(function(B){B.preventDefault();MySpace.UI.Pages.Data.request("MyVisitorsOverlay.ashx?agreed=Yes");MySpace.UI.Pages.Home.MyVisitors.turnOnOff(true);MySpace.UI.Pages.Popup.Close()});A(".myVisitorsOverlayNo").click(function(B){B.preventDefault();MySpace.UI.Pages.Data.request("MyVisitorsOverlay.ashx?agreed=No");MySpace.UI.Pages.Home.MyVisitors.turnOnOff(false);MySpace.UI.Pages.Popup.Close()})})(jQuery);(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))})();(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.Stream");MySpace.UI.Stream.Initialize=function(){if(MySpace.UI.Home.StatusMoodEditor){MySpace.UI.Home.StatusMoodEditor.Instance.add_saved(MySpace.UI.Stream.AddStatusMood)}if(MySpace.UI._ProfileImageLink){MySpace.UI._ProfileImageLink.load()}if(MySpace.UI.Stream.Pivots.Instance){if(MySpace.UI.Stream.Pivots.Instance.get_clientCache()){MySpace.UI.Stream.Pivots.Instance.sendRequest()}}};MySpace.UI.Stream.AddStatusMood=function(B,A){if(MySpace.UI.Stream.Pivots.Instance){var C=MySpace.UI.Stream.Pivots.Instance.get_filter();var D=MySpace.UI.Stream.Pivots.Instance.get_source();if((C==MySpace.UI.Stream.Pivot.All||C==MySpace.UI.Stream.Pivot.Status)&&(D==MySpace.UI.Stream.FriendCategory.All||D==MySpace.UI.Stream.FriendCategory.Me)){MySpace.UI.Stream.AddItems(A.activityHtml)}}else{MySpace.UI.Stream.AddItems(A.activityHtml)}};MySpace.UI.Stream.AddItems=function(J){var E=$q(".activityStreamModule .activitiesContainer",null,true);if(!E){var R=$q(".activityStreamModule .noActivities",null,true);if(R){E=document.createElement("ol");E.className="moduleList clearfix activitiesContainer";R.parentNode.insertBefore(E,R)}else{if(!MySpace.UI.Pages.Modules){return}for(var L=0;L<MySpace.UI.Pages.Modules.length;L++){var A=MySpace.UI.Pages.Modules[L];if(A.typeId==23){var D;Array.forEach(MySpace.UI.Pages.ModuleMetaData,function(S){if(S.typeId==A.typeId){D=S}});if(!D){return}var G=$create(MySpace.UI.Pages.Module,{uid:A.id,targetId:A.targetId,name:D.name,typeid:A.typeId,element:$get("module"+(A.id!=0?A.id:D.name)),runScripts:true});G.loadContent();return}}return}}var I=document.createElement("div");var B=document.createElement("div");var H=[];I.innerHTML=J;var Q=E.firstChild;var F;while(I.firstChild){F=I.firstChild;if(F.nodeName.toLowerCase()=="script"){B.appendChild(F)}else{E.insertBefore(F,Q);if(F.nodeType==1){H.push(F)}}}var P=$q(".activityItem",E);for(var M=0;M<P.length;M++){Sys.UI.DomElement.removeCssClass(P[M],"odd");Sys.UI.DomElement.removeCssClass(P[M],"even");if(M==0){Sys.UI.DomElement.addCssClass(P[M],"first")}else{Sys.UI.DomElement.removeCssClass(P[M],"first")}Sys.UI.DomElement.addCssClass(P[M],M%2==0?"odd":"even")}var K=$create(MySpace.UI.Pages.Control,{element:B});K._executeScripts();while(H.length>0){var C=H.pop();if(MySpace.UI.ReShare){MySpace.UI.ReShare.wire(function(){MySpace.UI.Stream.Pivots.Instance.sendRequest()},C)}if(MySpace.UI.InlineVideo){var N=$q(".activityBody .Video .thumbnailImage",C,true);if(N){var O=N.className.split(" ");if(O.length>1){MySpace.UI.InlineVideo.attach(null,O[1])}}}MySpace.UI.Stream.WireDelete(C)}};MySpace.UI.Stream.WireDelete=function(D){var F=MySpace.UI.Stream.DeleteHash;if(!F){return}var E=D||$q(".activityStreamModule .activitiesContainer",null,true);if(E){var C=$q(".delete",E,false);for(var B in C){var A=C[B];var G=A.id;A.onclick=function(){var I=this;var J=new Array();J=I.id.split("-");var M=J[0].substring(8);var K=J[1];var H=window.deleteActivityPopup;if(!H){var L=document.createElement("div");L.appendChild(document.createTextNode(MySpace.UI.Stream.Text.DeleteStatusMoodUpdate));H=window.deleteActivityPopup=MySpace.UI.Popup.create(L,MySpace.UI.Stream.Text.ConfirmDelete);H.set_top(200);H.set_width(500);H.set_parent(this)}else{H.remove_buttons()}H.add_button(MySpace.UI.Stream.Text.Yes,false,function(){Sys.Net.WebServiceProxy.invoke("/modules/friends/services/FriendsService.asmx","DeleteStatusMoodWithTicks",false,{userId:MySpace.ClientContext.UserId,timeTick:M,token:F},function(){I.parentNode.style.display="none";H._hide();Sys.UI.DomElement.removeCssClass(H._box.childNodes[2],"deleteProcessing")},function(){H._hide()});Sys.UI.DomElement.addCssClass(H._box.childNodes[2],"deleteProcessing")});H.add_button(MySpace.UI.Stream.Text.No,false,function(){H._hide()});H.show();MySpace.UI.Stream.ActivityClickTracking(K,MySpace.UI.Stream.EventIdEnum.ActivityDelete)}}}};MySpace.UI.Stream.EventIdEnum={ActivityDelete:401,CommentDelete:402,CommentAdd:403,ReShare:404,InlineVideo:405};MySpace.UI.Stream.ActivityClickTracking=function(C,B){if(MySpace.UI.ACTP&&MySpace.Beacon&&C){var A=MySpace.UI.ACTP[C];if(A){var D={eventid:B,raised_activity:A.ActivityType,oid:A.ActivityObjectID,parent_oid:A.ActivityParentID,raise_ts:A.CreationDate,init_uid:A.InitiatorUserID,display_context:A.ActivityDisplayClientID};MySpace.Beacon.Request(D)}}};MySpace.UI.Stream.wire=function(){if(MySpace.UI.InlineComment){MySpace.UI.InlineComment.wire()}if(MySpace.UI.InlineVideoMetadata&&MySpace.UI.InlineVideoMetadata.RegisteredControls&&MySpace.UI.InlineVideoMetadata.RegisteredControls.length>0){MySpace.UI.InlineVideo.wire(MySpace.UI.InlineVideoMetadata.DefaultWidth)}MySpace.UI.Stream.WireDelete();if(MySpace.UI.ReShare){var A=function(){if(MySpace.UI.Stream.Pivots&&MySpace.UI.Stream.Pivots.Instance){MySpace.UI.Stream.Pivots.Instance.sendRequest()}};if(typeof(MySpace.ClientMaintenanceConfigs)!="undefined"&&MySpace.ClientMaintenanceConfigs.reshareallactivities!=0){MySpace.UI.ReShare.wire(".reshare",A)}else{MySpace.UI.ReShare.wire(A)}}if(MySpace.UI.Pages.Activity){MySpace.UI.Pages.Activity.WireSponsored()}if(MySpace.UI.Home&&MySpace.UI.Home.Events){MySpace.UI.Home.Events.WireWalmartClickTracking()}};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.Stream");if(!MySpace.UI.Stream.TimeDiff){MySpace.UI.Stream.TimeDiff=new Date()-new Date(MySpace.UI.Stream.CurrentTime)}MySpace.UI.Stream.Pivots=function(){MySpace.UI.Stream.Pivots.initializeBase(this)};MySpace.UI.Stream.Pivots.prototype={_streamModule:null,_pivotsContainer:null,_streamContainer:null,_sourceMenu:null,_totalFeaturedItems:0,_currentSource:null,_currentFilter:null,_currentFilterType:"All",_currentFilterItem:null,_requestingData:false,_waitingImage:null,_menu:null,_viewMoreEl:null,_urlCreateFriendCategory:"",_urlStandaloneStream:"",_datahandler:"RenderUnifiedActivities.ashx",_userId:0,_clientCache:false,_checkInterval:120000,_deltaDate:null,_enableUpdates:false,_enableUpdatesViaWebIM:false,_timeoutId:0,_activitiesContainer:null,_lastRefreshDate:null,_updateContainer:null,_updateCount:0,get_requestScripts:function(){if(this._currentFilter===MySpace.UI.Stream.Pivot.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},set_filter:function(A){this._currentFilter=A},get_source:function(){return this._currentSource},set_source:function(A){this._currentSource=A},get_urlcreatefriendcategory:function(){return this._urlCreateFriendCategory},set_urlcreatefriendcategory:function(A){this._urlCreateFriendCategory=A},get_urlstandalonestream:function(){return this._urlStandaloneStream},set_urlstandalonestream:function(A){this._urlStandaloneStream=A},get_datahandler:function(){return this._datahandler},set_datahandler:function(A){this._datahandler=A||this._datahandler},get_userId:function(){return this._userId},set_userId:function(A){this._userId=A},get_clientCache:function(){return this._clientCache},set_clientCache:function(A){this._clientCache=A},get_checkInterval:function(){return this._checkInterval},set_checkInterval:function(A){this._checkInterval=A},get_enableUpdates:function(){return this._enableUpdates},set_enableUpdates:function(A){this._enableUpdates=A},get_enableUpdatesViaWebIM:function(){return this._enableUpdatesViaWebIM},set_enableUpdatesViaWebIM:function(A){this._enableUpdatesViaWebIM=A},add_render:function(B){if(B){if(typeof B==="string"){var A=this._parseHander(B);if(!A.methodName){return}B=function(D,C){A.instance[A.methodName](D,C)}}this.get_events().addHandler("render",B)}},remove_render:function(A){this.get_events().removeHandler("render",A)},add_afterPivotClicked:function(B){if(B){if(typeof B==="string"){var A=this._parseHander(B);if(!A.methodName){return}B=function(D,C){A.instance[A.methodName](D,C)}}this.get_events().addHandler("afterPivotClicked",B)}},remove_afterPivotClicked:function(A){this.get_events().removeHandler("afterPivotClicked",A)},_parseHander:function(C){var D=C.split(".");var E,A=window;for(var B=0;B<D.length;B++){if(B==D.length-1){E=D[B]}else{if(A[D[B]]){A=A[D[B]]}else{break}}}return{methodName:E,instance:A}},initialize:function(){MySpace.UI.Stream.Pivots.callBaseMethod(this,"initialize");this._streamModule=this._streamModule||$q(".activityStreamModule",null,true);this._streamContainer=$q(".streamContainer",this._streamModule,true);this._pivotsContainer=$q(".pivotsContainer",this._streamModule,true);this._toolBarEl=$q(".toolbar",this._streamModule,false);this._viewMoreEl=$q(".viewAllAnchor",this._streamModule,true);this._activitiesContainer=$q(".activitiesContainer",this._streamModule,true);this._updateContainer=$q(".updateContainer",this._streamModule,true);this._totalFeaturedItems=this.totalFeaturedItems;this._sourceMenu=$q("select",this._pivotsContainer,true);var A=$q(".horizontalMenu",this._pivotsContainer,true);this._menu=$create(MySpace.UI.HorizontalMenu,{},null,null,A);this._currentFilterItem=this._menu._selectedItem;this._currentFilterType=this.getFilterType(this._currentFilter);if(this._enableUpdatesViaWebIM){$addHandler(window,"load",this.subscribeForWebIMEvents)}this.wire();this.render()},render:function(){this.resetSourceMenu();this.wirePostBulletinLink();this.createViewMoreLink()},raiseRender:function(){var A=this.get_events().getHandler("render");if(A){A(this,Sys.EventArgs.Empty)}if(!this._clientCache){MySpace.UI.Stream.wire()}},createViewMoreLink:function(){var A=this.get_urlstandalonestream();if(this._viewMoreEl&&A){if(A.indexOf("?")==-1){this._viewMoreEl.href=String.format("{0}/{1}",A,this._currentFilterType.toLowerCase())}else{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._activitiesContainer=null;this._updateContainer=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._enableUpdates&&this._checkInterval>0){this.startUpdateTimer()}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=this.get_urlcreatefriendcategory()}else{this.wait();if(typeof B==="undefined"&&this._sourceMenu){this._currentSource=this._sourceMenu.value}else{this._currentFilter=this.getDataFilter(B);this._currentFilterType=this.getFilterType(this._currentFilter);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(){if(this._enableUpdates&&this._checkInterval>0){this.stopUpdateTimer()}if(this._clientCache===true){MySpace.UI.Pages.Data.request(String.format("GetActivityBase.ashx?uid={0}&f={1}&s={2}&sc={3}&r={4}",MySpace.ClientContext.UserId,this._currentFilter,this._currentSource,this.get_requestScripts(),this.get_requestClientResources()),null,Function.createDelegate(this,this.handleActivityBaseResponse),null,null,null,"GET")}else{MySpace.UI.Pages.Data.request(this.get_datahandler(),this,this.handleResponse,String.format("f={0}&s={1}&sc={2}&r={3}&userId={4}",this._currentFilter,this._currentSource,this.get_requestScripts(),this.get_requestClientResources(),this._userId))}},handleActivityBaseResponse:function(A){var B=Sys.Serialization.JavaScriptSerializer.deserialize(A.get_responseData());this._activityBaseData=B.activities;this._streamContainer.innerHTML=B.activities;this.executeScripts(this._streamContainer);var E=[];if(MySpace.UI.InlineCommentMetadata){for(var C=0;C<MySpace.UI.InlineCommentMetadata.RegisteredControls.length;C++){E.push(MySpace.UI.InlineCommentMetadata.RegisteredControls[C].cid+"|"+MySpace.UI.InlineCommentMetadata.RegisteredControls[C].aid+"|"+MySpace.UI.InlineCommentMetadata.RegisteredControls[C].ud)}}var D=new Date(new Date(B.cacheDate).valueOf()+MySpace.UI.Stream.TimeDiff);if(new Date()-D>15000){MySpace.UI.Pages.Data.request("GetActivityDelta.ashx",this,this.handleResponse,String.format("f={0}&s={1}&sc={2}&r={3}&cacheDate={4}&cid={5}",this._currentFilter,this._currentSource,this.get_requestScripts(),this.get_requestClientResources(),B.cacheDate,E))}else{this.unWait();this.wireActivities();MySpace.UI.Stream.wire();this._requestingData=false}},handleResponse:function(I,H){var G=I.get_webRequest().get_userContext();try{if(I.get_responseAvailable()){var J=I.get_responseData();G.unWait();if(G._clientCache===true){var A=Sys.Serialization.JavaScriptSerializer.deserialize(J);G._streamContainer.innerHTML=A.deltaActivities+G._activityBaseData;for(var C in A.deltaComments){var E=$get(C);if(E){E.innerHTML=A.deltaComments[C]}}var B=$q(".activityItem",G._streamContainer,false);for(var D=0;D<B.length;D++){Sys.UI.DomElement.removeCssClass(B[D],"first");Sys.UI.DomElement.removeCssClass(B[D],"odd");Sys.UI.DomElement.removeCssClass(B[D],"even");if(D==0&&D%2==0){Sys.UI.DomElement.addCssClass(B[D],"odd first")}else{if(D%2==0){Sys.UI.DomElement.addCssClass(B[D],"odd")}else{Sys.UI.DomElement.addCssClass(B[D],"even")}}}}else{var F=Sys.Serialization.JavaScriptSerializer.deserialize(J);G._streamContainer.innerHTML=F.activities;G._lastRefreshDate=F.lastRefreshDate;if((G._enableUpdates&&G._checkInterval>0)||G._enableUpdatesViaWebIM){G.showUpdateCount(false)}}G.clearMetaData();G.wireActivities()}}finally{MySpace.UI.Stream.wire();G._requestingData=false}},wireActivities:function(){var A=this.executeScripts(this._streamContainer);if(this._currentFilter==MySpace.UI.Stream.Pivot.Bulletins){this.wirePostBulletinLink()}this.wireBeaconTrack();this.createViewMoreLink();this.raiseAfterPivotClicked()},raiseAfterPivotClicked:function(){var A=this.get_events().getHandler("afterPivotClicked");if(A){A(this,Sys.EventArgs.Empty)}},clearMetaData:function(){if(MySpace.UI.InlineCommentMetadata){MySpace.UI.InlineCommentMetadata.RegisteredControls=[]}if(MySpace.UI.InlineVideoMetadata){MySpace.UI.InlineVideoMetadata.RegisteredControls=[]}},wireBeaconTrack:function(){if(MySpace.UI.Pages.Home.AppActivityTrack){if(this._currentFilter==MySpace.UI.Stream.Pivot.All||this._currentFilter==MySpace.UI.Stream.Pivot.Apps){MySpace.UI.Stream.MDPAppBeacon.WireBeaconTrack()}}},wirePostBulletinLink:function(){var A=$q(".bulletinsLinks a",this._streamContainer,true);if(A){A.onclick=function(B){openCommentPopup(B)}}},loadProfileImages:function(){if(MySpace.UI._ProfileImageLink){MySpace.UI._ProfileImageLink.load()}},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])}}this.loadProfileImages()}}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},getDataFilter:function(A){return A.getAttribute("data-value")},getFilterType:function(A){A=A|0;return Array.find(MySpace.UI.Stream.Filters,function(B){return B.Key===A}).Value},resetSourceMenu:function(){if(this._sourceMenu&&this._sourceMenu.value==="-1"){this._sourceMenu.value=this._currentSource}},doUpdateCheck:function(){MySpace.UI.Pages.Data.request("GetActivityDeltaWithCount.ashx",this,this.handleUpdateCheckResponse,String.format("f={0}&s={1}&sc={2}&r={3}&lastRefreshDate={4}",this._currentFilter,this._currentSource,this.get_requestScripts(),this.get_requestClientResources(),this._lastRefreshDate))},handleUpdateCheckResponse:function(B,C){var G=B.get_webRequest().get_userContext();try{if(B.get_responseAvailable()){var A=B.get_responseData();var D=Sys.Serialization.JavaScriptSerializer.deserialize(A);G._deltaDate=D.lastRefreshDate;if(!G._lastRefreshDate){G._lastRefreshDate=D.lastRefreshDate}var F=parseInt(D.updateCount);if(F>0){G._updateContainer.innerHTML=D.activityUpdateText;$clearHandlers(G._updateContainer);$addHandler(G._updateContainer,"click",Function.createDelegate(G,G.showStreamUpdates))}G.showUpdateCount(F>0)}}catch(E){}},handleStreamActivities:function(A){var D=MySpace.UI.Stream.Pivots.Instance;try{if(A!=null&&A.count!=null){var C=parseInt(A.count);if(C>0){D._updateCount+=C;var B=D._updateCount>1?MySpaceRes.ActivityTemplate.NewUpdates:MySpaceRes.ActivityTemplate.NewUpdate;D._updateContainer.innerHTML=String.format(B,D._updateCount);$clearHandlers(D._updateContainer);$addHandler(D._updateContainer,"click",Function.createDelegate(D,D.updateStatusClick));D.showUpdateCount(D._updateCount>0)}}}catch(E){}},updateStatusClick:function(){MySpace.Beacon.Request({et:"streamcount",uid:MySpace.ClientContext.UserId,timestamp:new Date().getTime(),page:location.href});MySpace.UI.Stream.Pivots.Instance.showStreamUpdates()},showStreamUpdates:function(){this._updateCount=0;this.stopUpdateTimer();this._lastRefreshDate=this._deltaDate;this.sendRequest()},showUpdateCount:function(A){if(!A){Sys.UI.DomElement.removeCssClass(this._updateContainer,"newupdates")}else{Sys.UI.DomElement.addCssClass(this._updateContainer,"newupdates")}if(this._enableUpdates&&this._checkInterval>0){this.startUpdateTimer()}},stopUpdateTimer:function(){clearTimeout(this._timeoutId);this._timeoutId=0},startUpdateTimer:function(){if(this._timeoutId>0){this.stopUpdateTimer()}this._timeoutId=setTimeout(Function.createDelegate(this,this.doUpdateCheck),this._checkInterval)},subscribeForWebIMEvents:function(){WebIM.Console.Events.subscribe("StreamActivities",MySpace.UI.Stream.Pivots.Instance.handleStreamActivities)}};MySpace.UI.Stream.Pivots.registerClass("MySpace.UI.Stream.Pivots",Sys.Component);MySpace.UI.InlineComment=function(){throw"Cannot instantiate static class."};MySpace.UI.InlineComment.show=function(A,E,D,C,B){$create(MySpace.UI._InlineComment,{ownerId:A,updateDate:E,comments:D,commentLinkId:C,elementId:B},null,null,$get(B))};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&&!D.wired){var E={inputWidth:D.iw,defComments:D.dc,commentLinkId:D.clid,ownerId:D.aid,updateDate:D.ud,commentType:D.ctype,resourceId:D.resourceId,extendedResourceId:D.extendedResourceId,showOnLoad:D.ol,preRendered:true,showInputDiv:D.sid,title:D.title,activity_ctpId:D.activity_ctpId,customObjectInfo:D.customObjectInfo};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);D.wired=true}}};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,_ownerId: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,_commentType:0,_resourceId:0,_extendedResourceId:"",_title:"",_activity_ctpId:"",_customObjectInfo:"",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_ownerId:function(){return this._ownerId},set_ownerId:function(A){this._ownerId=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},get_commentType:function(){return this._commentType},set_commentType:function(A){this._commentType=A},set_resourceId:function(A){this._resourceId=A},get_resourceId:function(){return this._resourceId},set_extendedResourceId:function(A){this._extendedResourceId=A},get_extendedResourceId:function(){return this._extendedResourceId},get_title:function(){return this._title},set_title:function(A){this._title=A},get_activity_ctpId:function(){return this._activity_ctpId},set_activity_ctpId:function(A){this._activity_ctpId=A},get_customObjectInfo:function(){return this._customObjectInfo},set_customObjectInfo:function(A){this._customObjectInfo=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="odd";for(var B=0;B<this._commentsDiv.childNodes.length;B++){A=(B%2==0)?"odd":"even";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="";if(MySpace.UI.Stream&&MySpace.UI.Stream.ActivityClickTracking){MySpace.UI.Stream.ActivityClickTracking(this.get_activity_ctpId(),MySpace.UI.Stream.EventIdEnum.CommentAdd)}},_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={commentType:this._commentType,ownerId:this._ownerId,resourceId:this._resourceId,extendedResourceId:this._extendedResourceId,startIdx:A+1,count:B,title:this._title,customObjectInfo:this._customObjectInfo};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._ownerId,updateDate:this._updateDate,type:this._commentType,resourceId:this._resourceId,extendedResourceId:this._extendedResourceId,authorId:this._commentAuthorId,title:this._title,customObjectInfo:this._customObjectInfo}},{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,resourceId:this._resourceId,extendedResourceId:this._extendedResourceId,commentType:this._commentType},{commentDeleted:this._commentDeletedHandler},null,this._commentsDiv);this._totalShown++}},_renderComment:function(C,A,B){$create(MySpace.UI.Comment,{comment:C,statusAuthorId:this._ownerId,cssClass:A,defComments:this._defComments,resourceId:this._resourceId,extendedResourceId:this._extendedResourceId,commentType:this._commentType,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();if(MySpace.UI.Stream&&MySpace.UI.Stream.ActivityClickTracking){MySpace.UI.Stream.ActivityClickTracking(this.get_activity_ctpId(),MySpace.UI.Stream.EventIdEnum.CommentDelete)}},_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,_resourceId:-1,_extendedResourceId:"",_commentId:-1,_commentType:0,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},get_resourceId:function(){return this._resourceId},set_resourceId:function(A){this._resourceId=A},get_extendedResourceId:function(){return this._extendedResourceId},set_extendedResourceId:function(A){this._extendedResourceId=A},get_commentId:function(){return this._commentId},set_commentId:function(A){this._commentId=A},get_commentType:function(){return this._commentType},set_commentType:function(A){this._commentType=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;this._commentId=this._comment.CommentId;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);A.setAttribute("cid",this._comment.CommentId);A.setAttribute("ctype",this._commentType);$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);D.setAttribute("cid",this._comment.CommentId);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");this._commentId=this._deleteBtn.getAttribute("cid");this._commentType=this._deleteBtn.getAttribute("ctype");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={ownerId: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),resourceId:this._resourceId,extendedResourceId:this._extendedResourceId,commentId:this._commentId,commentType:this._commentType};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,clickTrackingJsonKey:B.clickTrackingJsonKey};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",_chrome:40,_defWidth:null,_handlerURL:"/Modules/Common/Services/InlineVideo.ashx",_mediaType:null,_mediaUrl:null,_height:null,_width:null,_objectId:null,_showVideoHandler:null,_target:null,_videoId:null,_clickTrackingJsonKey:null,get_chrome:function(){return this._chrome},set_chrome:function(A){this._chrome=A},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},get_clickTrackingJsonKey:function(){return this._clickTrackingJsonKey},set_clickTrackingJsonKey:function(A){this._clickTrackingJsonKey=A},initialize:function(){this._embedCode=null;this._showVideoHandler=Function.createDelegate(this,this._getEmbedCode);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},_getEmbedCode:function(){var B=this._getMediaUrl();if(this._embedCode){this._showPlayer(this._embedCode)}else{if(B.length>1){if(this._height==0){this._height=parseInt(this._defWidth/1.6)}var A=parseInt(this._defWidth/(this._width/this._height))+this._chrome;MySpace.WebRequest.invoke(this._handlerURL+"?h="+A+"&w="+this._defWidth+"&src="+encodeURIComponent(B),true,"",Function.createDelegate(this,this._showPlayer),null,null,0)}}},_showPlayer:function(D){this._embedCode=D;if(this._embedCode.length>0){var A=$q(".player",this._element.parentNode,true);if(A!=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 B=document.createElement("div");B.className="player";B.innerHTML=this._embedCode;this._element.style.display="none";var C=this._element.parentNode;C.appendChild(B);if(MySpace.UI.Stream&&MySpace.UI.Stream.ActivityClickTracking){MySpace.UI.Stream.ActivityClickTracking(this.get_clickTrackingJsonKey(),MySpace.UI.Stream.EventIdEnum.InlineVideo)}}},_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);__stPublisher=MySpace.UI.Share?MySpace.UI.Share.config.publisherId:null;try{if(typeof(stLight)=="undefined"&&typeof(SHARETHIS)=="undefined"){stLight=new function(){this.publisher=null;this.sessionID_time=(new Date()).getTime().toString();this.sessionID_rand=Number(Math.random().toPrecision(5).toString().substr(2)).toString();this.sessionID=this.sessionID_time+"."+this.sessionID_rand;this.fpc=null;this.counter=0;this.meta={hostname:document.location.host,location:document.location.pathname}};stLight.onReady=function(){stLight.fpc=stLight._stFpc();stLight.log("pview",null,null)};stLight.log=function(D){if(D=="pview"){var C="http://l.sharethis.com/pview?event="}var B=stLight.dbrInfo();if(B==false){B=""}C+=D;C+="&source=lightLoader";C+="&publisher="+encodeURIComponent(stLight.publisher)+"&hostname="+encodeURIComponent(stLight.meta.hostname)+"&location="+encodeURIComponent(stLight.meta.location)+"&url="+encodeURIComponent(document.location.href)+"&sessionID="+stLight.sessionID+"&fpc="+stLight.fpc+"&ts"+(new Date()).getTime()+"."+stLight.counter+++"&r_sessionID=&hash_flag=&shr=&count="+B;var A=new Image(1,1);A.src=C;A.onload=function(){return};stLight.createSegmentFrame()};stLight._stFpc=function(){if(!document.domain||document.domain.search(/\.gov/)>0){return false}var D=stLight._stGetFpc("__unam");if(D==false){var H=Math.round(Math.random()*2147483647);H=H.toString(16);var C=(new Date()).getTime();C=C.toString(16);var F="";var B=stLight._stGetD();B=B.split(/\./)[1];if(!B){return false}F=stLight._stdHash(B)+"-"+C+"-"+H+"-1";D=F;stLight._stSetFpc(D)}else{var A=D;var E=A.split(/\-/);if(E.length==4){var G=Number(E[3]);G++;A=E[0]+"-"+E[1]+"-"+E[2]+"-"+G;D=A;stLight._stSetFpc(D)}}return D};stLight._stSetFpc=function(C){var I="__unam";var G=new Date;var A=G.getFullYear();var D=G.getMonth()+9;var B=G.getDate();var F=I+"="+escape(C);if(A){var H=new Date(A,D,B);F+="; expires="+H.toGMTString()}var E=stLight._stGetD();F+="; domain="+escape(E)+";path=/";document.cookie=F};stLight._stGetD=function(){var A=document.domain.split(/\./);var B="";if(A.length>1){B="."+A[A.length-2]+"."+A[A.length-1]}return B};stLight._stGetFpc=function(A){var B=document.cookie.match("(^|;) ?"+A+"=([^;]*)(;|$)");if(B){return(unescape(B[2]))}else{return false}};stLight._stdHash=function(B){var C=0,D=0;for(var E=B.length-1;E>=0;E--){var A=parseInt(B.charCodeAt(E));C=((C<<8)&268435455)+A+(A<<12);if((D=C&161119850)!=0){C=(C^(D>>20))}}return C.toString(16)};stLight._thisScript=null;stLight.getShareThisLightScript=function(){var C=document.getElementsByTagName("script");var D=null;for(var A=0;A<C.length;A++){var B=C[A].src;if(B.search(/.*sharethis.*\/button\/light.*/)>=0){D=C[A]}}return D};stLight.dbrInfo=function(){var B=document.referrer;var F=new RegExp(document.domain,"gi");if(F.test(B)==true){return false}if(B&&B.length>0){var G=/(http:\/\/)(.*?)\/.*/i;var A=/(^.*\?)(.*)/ig;var C="";var D=B.replace(G,"$2");if(D.length>0){C+="&refDomain="+D}else{return false}var E=B.replace(A,"$2");if(E.length>0){C+="&refQuery="+encodeURIComponent(E)}return C}else{return false}};stLight.parseScript=function(D){var C=D.src;var A=new RegExp(/.*?(publisher)=(.*?)(&|$)/);var B=C.match(A);if(typeof(stLight[B[1]])!="undefined"){stLight[B[1]]=B[2]}};stLight.odjs=function(B,A){this.head=document.getElementsByTagName("head")[0];this.scriptSrc=B;this.script=document.createElement("script");this.script.setAttribute("type","text/javascript");this.script.setAttribute("src",this.scriptSrc);this.script.onload=A;this.script.onreadystatechange=function(){if(this.readyState=="loaded"||this.readyState=="complete"){A()}};this.head.appendChild(this.script)};if(window.document.readyState=="completed"){stLight.onReady()}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("load",stLight.onReady,false)}else{if(typeof(document.addEventListener)!="undefined"){document.addEventListener("load",stLight.onReady,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",stLight.onReady)}}}}if(typeof(__stPublisher)=="undefined"){_thisScript=stLight.getShareThisLightScript();stLight.parseScript(_thisScript)}else{stLight.publisher=__stPublisher}}stLight.getCount=function(A,B){if(!B){B=document.location.href}stLight.odjs("http://wd.sharethis.com/api/getCount.php?url="+encodeURIComponent(B),function(){if(typeof(__stCount)!="undefined"){A(__stCount)}else{A({total:0})}})};stLight.loadFeature=function(A,B){if(A=="buttons"){if(typeof(B)=="undefined"){B=document.location.href}stLight.getCount(function(){stLight.odjs("http://wd.sharethis.com/button/buttons.js",function(){})},B)}};stLight.createSegmentFrame=function(){try{stLight.segmentframe=document.createElement('<iframe name="stframe" allowTransparency="true" style="body{background:transparent;}" ></iframe>')}catch(A){stLight.segmentframe=document.createElement("iframe")}stLight.segmentframe.id="stSegmentFrame";stLight.segmentframe.name="stSegmentFrame";var C=document.body;var B=(("https:"==document.location.protocol)?"http://wd.":"http://wd.")+"sharethis.com/api/getSegment.php?rnd="+(new Date()).getTime();stLight.segmentframe.src=B;C.appendChild(stLight.segmentframe);stLight.segmentframe.frameBorder="0";stLight.segmentframe.scrolling="no";stLight.segmentframe.width="0px";stLight.segmentframe.height="0px"}}catch(err){}MySpace.UI=MySpace.UI||{};MySpace.UI.LinkPreviewer=function(V){var Ae=this,S,v,o,j,l,E,U,Ac,X,z,Ai,c,p,d,m,Am,q,O,D,I,N=[],C,x,w,r,G,y,Aj,g,l,s,Ah,Y,Ag=[["&","&amp;"],["<","&lt;"],[">","&gt;"]],Ab=/^\s+/g,Af=/^https?:\/\//gi,J=/<\/?[^<>]*\/?>/g;this.get_videoAutoplay=function(){return s};this.get_readOnlyTitle=function(){return Ah};this.get_readOnlyDescription=function(){return Y};this.set_videoAutoplay=function(t){s=t};this.set_readOnlyTitle=function(t){Ah=t};this.set_readOnlyDescription=function(t){Y=t};MySpace.UI.LinkPreviewer.initializeBase(this,[V]);this.initialize=function(){MySpace.UI.LinkPreviewer.callBaseMethod(this,"initialize");V.className="msLinkPreviewer";n();b()};this.previewUrl=function(t,As,Ar,Aq,An,At,Ap){t=t.replace(Ab,"");if(!t.match(Af)){t="http://"+t}R();S=t;w=As;r=Ar;y=Aq;Aj=An;g=At;var Ao=Ap?MySpace.SuperShareScraperURL+"?type="+Ap:MySpace.SuperShareScraperURL;MySpace.Net.JsonpWebServiceProxy.invoke(Ao,{url:t},k,M,null,null,30000)};this.previewUrlWithData=function(t,An){R();S=t;k(An)};this.getLinkData=function(){if(C==null){return null}return{url:S,title:W(j||o.innerHTML),domain:C.domain,description:W(E||l.innerHTML),image:(I==null||p.checked)?null:I.src,favicon:x,mediaType:C.mediaType,mediaUrl:C.mediaUrl,mediaHeight:C.mediaHeight,mediaWidth:C.mediaWidth,contentType:C.contentType,actionText:C.attribution?C.attribution:"",token:C.token}};this.reset=function(){C=null;x=null;Sys.UI.DomElement.removeCssClass(V,"moviePreviewer");Sys.UI.DomElement.removeCssClass(Ac,"clickable");var t=$q(".player",V,true);if(t){t.parentNode.removeChild(t)}o=$q(".title",V,true);l=$q(".description",V,true);o.innerHTML=j=l.innerHTML=E="";o.style.height="auto";l.onmouseover=function(){};l.onmouseout=function(){}};this.enableEdit=function(t){if(t){$addHandler(o,"click",Ad);$addHandler(o,"keyup",B);$addHandler(o,"paste",B);$addHandler(l,"click",Ad);$addHandler(l,"keyup",B);$addHandler(l,"paste",B);$addHandler(Ac,"click",Ae.playVideo)}else{$removeHandler(o,"click",Ad);$removeHandler(o,"keyup",B);$removeHandler(o,"paste",B);$removeHandler(l,"click",Ad);$removeHandler(l,"keyup",B);$removeHandler(l,"paste",B);$removeHandler(Ac,"click",Ae.playVideo);l.onmouseover=function(){};l.onmouseout=function(){}}};function R(){Ac.style.display="none";o.style.display="none";d.style.display="none";l.style.display="none";X.style.display="none";Am.style.display="none";v.style.display="";if(I){I.parentNode.removeChild(I);I=null}U=(MySpace.PostToData&&MySpace.PostToData.Thumb)?[MySpace.PostToData.Thumb]:null;C=null;x=null}function b(){V.innerHTML="<div class='loading'>"+MySpaceRes.PostTo.LoadingPreview+"</div><div class='extra_wrapper'><div class='thumbnail'>	<div class='loadingImages' style='display:none;'>		<img src='"+MySpace.StaticContentBase+"/modules/common/static/img/loadercircles.gif'>		<br />"+MySpaceRes.PostTo.LoadingImages+"	</div>	<span class='wrapper'>		<span class='video' style='display:none;'></span>	</span>	<div class='noImage' style='display:none;'>"+MySpaceRes.PostTo.NoImage+"	</div></div>   <div class='picker' style='display:none;'>       <span class='arrows'>		    <span class='prev'></span>		    <span class='next'></span>		    <span class='imgCount'></span>	    </span>	    <input type='checkbox' />"+MySpaceRes.PostTo.NoImage+"   </div></div><div class='title fieldText'></div><div class='description fieldArea'></div>";v=$q(".loading",V,true);Ac=$q(".thumbnail",V,true);X=$q(".wrapper",V,true);extraWrapper=$q(".extra_wrapper",V,true);z=$q(".video",V,true);m=$q(".loadingImages",V,true);Am=$q(".noImage",V,true);o=$q(".title",V,true);d=$q(".picker",V,true);Ai=$q(".prev",V,true);c=$q(".next",V,true);p=$q(".picker input",V,true);q=$q(".imgCount",V,true);l=$q(".description",V,true);$addHandler(Ai,"click",Function.createPartial(this,F,-1));$addHandler(c,"click",Function.createPartial(this,F,1));$addHandler(p,"click",e);Ae.enableEdit(true)}function k(Ap){var An=Sys.UI.DomElement.getBounds(V).width;if(An){l.style.width=o.style.width=(An-130)+"px"}Ac.style.display="";if(!Ah){o.style.display=""}if(!Y){l.style.display=""}v.style.display="none";C=Ap;o.innerHTML=H(L(w||Ap.title),80);if(r||Ap.description){l.innerHTML=H(L(r||Ap.description),170)}else{Q(l)}K(U||Ap.images);z.style.display=(Ap.mediaType=="Video")?"":"none";if(Ap.favicon){var t=document.createElement("img");t.onload=function(){x=Ap.favicon};t.src=Ap.favicon}if(Ap.loadFailed&&y){y()}if(Ap.mediaType=="Video"){var Ao=$q(".movie",V,true);if(!Ao){Ao=document.createElement("div");Ao.className="movie";V.insertBefore(Ao,extraWrapper);Ao.appendChild(extraWrapper)}Sys.UI.DomElement.addCssClass(extraWrapper,"clickable");if(s){Ae.playVideo()}}}this.playVideo=function(){if(C.mediaType=="Video"&&MySpace.UI._InlineVideo){Sys.UI.DomElement.addCssClass(V,"moviePreviewer");var An=Sys.UI.DomElement.getBounds(V);var Ao={defWidth:An.width,mediaUrl:C.mediaUrl,mediaType:"other",height:250,width:An.width,videoId:C.mediaUrl,target:document.createElement("span")};var t=$create(MySpace.UI._InlineVideo,Ao,null,null,extraWrapper);extraWrapper.style.display="none";t._showVideoHandler();l.style.width=o.style.width="98%"}};function M(){var Ao=S.split("/"),An=Ao.length,As=Ao[Ao[An-1]]==""?Ao[An-2]:Ao[An-1];var t=S.indexOf("://"),Ar=(t>=0)?S.substring(t+3):S,Aq=Ar.indexOf("/"),Ap=(Aq>=0)?Ar.substring(0,Aq):Ar;k({title:As,domain:Ap,images:[],favicon:"http://"+Ap+"/favicon.ico",description:null,mediaType:"BookMark",mediaHeight:0,mediaWidth:0,mediaUrl:null,contentType:null,loadFailed:true,token:""})}function K(An){m.style.display="";var t=document.createElement("div");t.className="msLinkPreviewerLoader";document.body.appendChild(t);O=An.length;N=[];G=false;for(var Ap=0;Ap<An.length;Ap++){var Ao=document.createElement("img");Ao.src=An[Ap];t.appendChild(Ao);if(Ao.complete){Aa(Ao)}else{Ao.onload=Z;Ao.onerror=Z}}if(O){setTimeout(u,5000)}else{u()}}function Z(t){t=t||window.event;var An=t.target||t.srcElement;Aa(An)}function Aa(t){if(G){return}if(a(t)){t.origHeight=t.offsetHeight;t.origWidth=t.offsetWidth;if(t.offsetHeight<t.offsetWidth){var An=t.offsetHeight/t.offsetWidth;t.style.width="100px";t.style.height=Math.round(An*100)+"px"}else{var An=t.offsetWidth/t.offsetHeight;t.style.height="100px";t.style.width=Math.round(An*100)+"px"}t.parentNode.removeChild(t);N.push(t)}O--;if(O==0){u()}}function u(){if(G){return}G=true;N.sort(function(At,As){var Ar=At.origHeight,Ao=At.origWidth,Aq=As.origHeight,t=As.origWidth;var Ap=Ar*Ao,An=Aq*t;if(Ap<An){return 1}if(Ap>An){return -1}return 0});m.style.display="none";D=0;A();if(g){g()}}function e(){B();A()}function B(){if(Aj){Aj();Aj=null}}function Ad(){var t;if(Sys.UI.DomElement.containsCssClass(this,"fieldText")){t=Al(this)}else{if(Sys.UI.DomElement.containsCssClass(this,"fieldArea")){t=h(this)}}this.parentNode.replaceChild(t,this);t.style.width=this.style.width;t.focus();t.select();$addHandler(t,"blur",f)}function Al(t){var An=T("input",t);An.maxLength="160";return An}function h(Ap){if(Ap.innerHTML==MySpaceRes.PostTo.DescriptionHint){Ap.innerHTML=""}var As=T("textarea",Ap);var Aq=As.value;var Ao=5;var t=15;var At=30;var An=Aq.length;var Ar=Math.ceil(An/At);As.style.overflow="auto";As.spellcheck="false";return As}function H(An,t){for(var Ao=0;Ao<Ag.length;Ao++){An=An.replace(new RegExp(Ag[Ao][0],"g"),Ag[Ao][1])}if(An.length>t){An=An.substring(0,t)+"...<span>"+An.substring(t,An.length)+"</span>"}return An}function W(t){var Ao=new RegExp("...<span[^>]*>(.*?)</span>","i");t=t.replace(Ao,"$1");for(var An=0;An<Ag.length;An++){t=t.replace(new RegExp(Ag[An][1],"g"),Ag[An][0])}return t}function T(An,t){var Ao=document.createElement(An);if(t.id){Ao.id=t.id}if(t.className){Ao.className=t.className}Ao.value=W(t.innerHTML);return Ao}function f(){var t=null;var An=document.createElement("div");if(this.id){An.id=this.id}if(this.className){An.className=this.className}this.value=L(this.value);if(Sys.UI.DomElement.containsCssClass(this,"title")){j=this.value;t=80;if(this.value.length==0){An.style.height="16px"}else{An.innerHTML=H(this.value,t)}}else{if(Sys.UI.DomElement.containsCssClass(this,"description")){E=this.value;t=170;if(this.value.length==0){Q(An)}else{An.innerHTML=H(this.value,t)}}}An.style.width=this.style.width;this.parentNode.replaceChild(An,this);$addHandler(An,"click",Ad)}function Q(t){t.onmouseover=function(){Ak.apply(t)};t.onmouseout=function(){P.apply(t)}}function Ak(){this.innerHTML=MySpaceRes.PostTo.DescriptionHint}function P(){this.innerHTML=""}function L(t){return t.replace(J,"")}function a(t){if(t.offsetWidth<50){return false}if(t.offsetHeight<50){return false}if(t.offsetWidth/t.offsetHeight>3){return false}if(t.offsetHeight/t.offsetWidth>3){return false}return true}function F(An){var t=D+An;if(t<0||t>=N.length){return}D=t;B();A()}function A(){if(N.length==0){Am.style.display="";return}d.style.display=(C.mediaType!="Video")?"":"none";q.innerHTML=String.format(MySpaceRes.PostTo.ImageCount,D+1,N.length);var An=D!=0,t=D!=N.length-1;if(p.checked){X.style.display="none";Am.style.display="";An=t=false}else{X.style.display="";Am.style.display="none"}if(I){I.parentNode.removeChild(I)}X.appendChild(N[D]);I=N[D];if(An){Sys.UI.DomElement.removeCssClass(Ai,"prevDisabled")}else{Sys.UI.DomElement.addCssClass(Ai,"prevDisabled")}if(t){Sys.UI.DomElement.removeCssClass(c,"nextDisabled")}else{Sys.UI.DomElement.addCssClass(c,"nextDisabled")}}function n(){MySpace.UI.addStyles(".msLinkPreviewerLoader { position:absolute; top:-100px; left:-100px; width:10px; height:10px; overflow:hidden; }.msLinkPreviewer {font-family:Arial;}.msLinkPreviewer .extra_wrapper{margin: 15px 10px 0 0;width:110px;float:left}.msLinkPreviewer .loading { text-align:center; padding-top:28px; margin:0 auto; background:url('"+MySpace.StaticContentBase+"/modules/common/static/img/loadercircles.gif') no-repeat center top; }.msLinkPreviewer .thumbnail { position: relative;display: block; vertical-align: middle;text-align:center;height:110px; width:110px;}.msLinkPreviewer .loading,.msLinkPreviewer .loadingImages { color:#9c9c9c; font-weight:bold; }.msLinkPreviewer .thumbnail .wrapper { display:table-cell;text-align:left;vertical-align:middle; height: 110px; width: 110px;margin-bottom:5px;border: 1px solid #dedede;padding:0;}.msLinkPreviewer .thumbnail img { -ms-interpolation-mode:bicubic; display:block; margin:0 auto; }.msLinkPreviewer .thumbnail .video { position:absolute; top:45px; left:38px; background:url('"+MySpace.StaticContentBase+"/modules/postto/static/img/v3/video.png') no-repeat; height:34px; width:34px; }.msLinkPreviewer .noImage { position: relative;font-weight:bold; color:#9c9c9c;display:table-cell;text-align:center;vertical-align:middle;height: 110px; width: 110px;border: 1px solid #dedede;padding:1px;}.msLinkPreviewer .title,.msLinkPreviewer .description { color:#444; float:right;  overflow:visible; font-size:12px; line-height:17px; resize:none; text-align:left;width:245px;}.msLinkPreviewer .description { padding:5px 0 5px 5px;margin:0 0 10px 0;height:85px;color:#000000;}.msLinkPreviewer .description:hover { background-color:#fffff5;padding:5px 0 5px 5px;color:#000000;}.msLinkPreviewer .title{ margin: 15px 0 5px 0;padding:5px 0 5px 5px;}.msLinkPreviewer .title:hover {background-color:#fffff5; margin: 15px 0 5px 0;padding:5px 0 5px 5px;}.msLinkPreviewer input.title,.msLinkPreviewer input.title:hover,.msLinkPreviewer textarea.description,.msLinkPreviewer textarea.description:hover {font-family:Arial;border:1px solid #000000; background:#fff url('"+MySpace.StaticContentBase+"/modules/postto/static/img/V3/bg.png') 0 -67px repeat-x;}.msLinkPreviewer textarea.description,.msLinkPreviewer textarea.description:hover {height:83px;}.msLinkPreviewer .title { font-weight:bold; }.msLinkPreviewer .title span,.msLinkPreviewer .description span{ display:none; }.msLinkPreviewer .msDefaultTextbox { opacity:0; filter:alpha(opacity=0); color:#898989 }.msLinkPreviewer .msDefaultTextbox:hover { opacity:100; filter:none; }.msLinkPreviewer .picker { color:#bdbdbd; font-size:11px; padding-top:5px; float:left; width:100%;}.msLinkPreviewer .arrows { width:100px;display:block; vertical-align:top; float:left;}.msLinkPreviewer .prev,.msLinkPreviewer .next { float:left; height:19px; width:21px; cursor:pointer; background:url('"+MySpace.StaticContentBase+"/modules/postto/static/img/v3/icons.png') }.msLinkPreviewer .prev { float:left;background-position:-259px -46px; margin-right:2px; }.msLinkPreviewer .next { float:left;background-position:-282px -46px; }.msLinkPreviewer .prev:hover { float:left;background-position:-259px -86px; }.msLinkPreviewer .next:hover { float:left;background-position:-282px -86px; }.msLinkPreviewer .prevDisabled,.msLinkPreviewer .prevDisabled:hover { float:left;background-position:-259px -6px; cursor:default; }.msLinkPreviewer .nextDisabled,.msLinkPreviewer .nextDisabled:hover { float:left;background-position:-282px -6px; cursor:default; }.msLinkPreviewer .imgCount { width:100%;float:left;display:block; color:#9c9c9c; font-size:9px; text-align:left; padding-left:6px;}.msLinkPreviewer .picker input { clear:both; vertical-align:-2px; margin-right:8px; }.msLinkPreviewer .clickable { cursor:pointer }.moviePreviewer .title, .moviePreviewer .description { float:none; }.ie .msLinkPreviewer .picker input { margin-right:4px; }","MySpace.UI.LinkPreviewer")}};if(MySpace.UI.LinkPreviewer.registerClass){MySpace.UI.LinkPreviewer.registerClass("MySpace.UI.LinkPreviewer",Sys.UI.Control)}(function(A){A.widget("ms.captcha",{_create:function(){var L=this,F=0,H,I,K,D,M=this.element,B,C;L.show=function(R){H=R.useRecaptcha;L.hide();if(!!R.explanation){A("<div>").html(R.explanation).appendTo(M)}var Q=A('<div class="container clearfix">').appendTo(M);if(H){Q.html('<div class="recaptcha" id="recaptcha_widget"><div id="recaptcha_image"></div><input id="recaptcha_response_field" type="hidden" /></div>');MySpace.UI.addScript("http://api.recaptcha.net/js/recaptcha_ajax.js","window.Recaptcha",function(){Recaptcha.should_focus=false;Recaptcha.create(R.reCaptchaPublicKey,"recaptcha_widget",{theme:"custom",lang:"en",custom_theme_widget:"recaptcha_widget"});Recaptcha.should_focus=false})}else{var O=A("<div>").css("float","left").appendTo(Q);I=R.imageUrl;B=A("<img>").appendTo(O).attr("src",I)}var N=((document.location.protocol=="https:")?"https://secure.":"http://");var S=(R.customRefreshButton!=undefined&&(R.customRefreshButton=="true"||R.customRefreshButton==true));if(!S){A('<a href="#"><img src="'+N+'x.myspacecdn.com/images/icons/refreshicon2.jpg" /></a>').appendTo(Q).click(G)}else{A('<a href="#" class="captchaRefresh"></a>').appendTo(Q).click(G)}A('<div class="copyright">').html(R.copyright||"").appendTo(M);if(R.showSickOfCaptchas){M.append("<div><br/><br/><span class='sickOfCaptchas'>"+R.sickOfCaptchaText+"&nbsp;<a href='javascript:var temp=window.open(\""+R.sickOfCaptchaLink+'","smsVerificationPopupWindow", "width=700, height=400, resizeable=no, menubar=0,toolbar=0, titlebar=no, status=no, scroll bars=no, location=no");\'>'+R.sickOfCaptchaClickText+"</a></span><br/></div>")}if(R.showEmailVerifyCaptchas){A('<div class="emailVerify">').html(R.emailVerifyLinkText).appendTo(M)}if(!!R.directions){A("<div>").addClass("captchaDirections "+(H?"recaptchaDirections":"")).html(R.directions).appendTo(M)}C=A('<input id="captcha_text">').keypress(J).appendTo(M);var P=A('<button class="glue primary medium">').css("display",R.submitLabel?"":"none").html(R.submitLabel||"").appendTo(M).click(E);K=R.timeout*1000;D=window.setTimeout(G,K)};L.hide=function(){window.clearTimeout(D);if(H&&window.Recaptcha){Recaptcha.destroy()}M.html("")};L.focus=function(){try{C.focus()}catch(N){}};L.val=function(){var N=A("#recaptcha_challenge_field").val()||"";return N+(N?"|":"")+C.val()};function G(N){window.clearTimeout(D);if(N&&N.preventDefault){N.preventDefault()}C.val("");if(H){Recaptcha.reload("t")}else{B.attr("src",I+"&r="+ ++F)}D=window.setTimeout(G,K)}function J(N){if(N.keyCode==A.ui.keyCode.ENTER){E(N)}}function E(N){L._trigger("submit");N.preventDefault()}}})})(jQuery);MySpace.UI.ShareAccordion=function(){this.base=arguments[0];var A=arguments[1];this.shown=0;this.nodes=this.base.getElementsByTagName("li");this.expandingNode=null;this.expandedNode=null;this.collapsingNode=null;this.interval=null;this.rate=12;this.delta=30;this.activeCss="active";this._headerHeight=0;this._nodeHeight=0;this.init(A)};MySpace.UI.ShareAccordion.prototype={init:function(D){var C=this;this._headerHeight=D.headerHeight;this._nodeHeight=D.nodeHeight;for(var A=0;A<this.nodes.length;A++){var B=this.nodes[A];var E=this._getHeader(B);E.onclick=C.onClickBind(B)}},getBase:function(){return this.base},open:function(D){var C=this;this.shown=D;for(var A=0;A<this.nodes.length;A++){var B=this.nodes[A];var E=this._getHeader(B);if(D==A){this._open(B);jQuery(E).addClass(this.activeCss)}else{this._close(B);jQuery(E).removeClass(this.activeCss)}}},onClickBind:function(B){var A=this;return function(C){if(!A._isOpen(B)){jQuery(A._getHeader(B)).addClass(A.activeCss);A.actWithSlide(B)}}},setHeaderHeight:function(A){this._headerHeight=A},setNodeHeight:function(A){this._nodeHeight=A},_animate:function(){var A=this;this.interval=setInterval(function(){A._slide()},A.rate)},_slide:function(){if(this._isInProcess()){var A=this._expand();this._collapse(A)}else{clearInterval(this.interval)}},_expand:function(){var D=this.delta;var C=this.expandingNode;if(!C){return 0}var B=parseInt(C.style.height);var A=B+D;if(A>=this._nodeHeight){D=this._nodeHeight-B;A=this._nodeHeight;C.style.height=A+"px";this._setExpanding(null);this.expandedNode=C}else{C.style.height=A+"px"}return D},_collapse:function(E){var C=this.collapsingNode;var B=parseInt(C.style.height);if(B==this._nodeHeight){C.style.overflow="hidden";C.style.position="relative";var D=this._getHeader(C);jQuery(D).removeClass(this.activeCss)}var A=0;if(E!=0){A=B-E;if(A<=this._headerHeight){A=this._headerHeight;this.collapsingNode=null}C.style.height=A+"px"}},actWithSlide:function(B){if(!!this.interval){clearInterval(this.interval)}var A=this.expandedNode;this._setExpanding(B);this.collapsingNode=A;this._animate()},_isInProcess:function(){return this.collapsingNode!=null||this.expandingNode!=null},_setExpanding:function(A){this.expandingNode=A},_open:function(A){A.style.height=this._nodeHeight+"px";A.style.overflow="visible";A.style.position="relative";this.expandedNode=A},_close:function(A){A.style.height=this._headerHeight+"px";A.style.overflow="hidden";A.style.position="relative"},_isClosed:function(A){return parseInt(A.style.height)==this._headerHeight},_isOpen:function(A){return A.offsetHeight==this._nodeHeight},_getHeader:function(A){return A.getElementsByTagName("h3")[0]},_getContent:function(A){return A.getElementsByTagName("div")[0]},getActiveNode:function(){return this._getContent(this.expandedNode)},getAllPanes:function(){var B=[];for(var A=0;A<this.nodes.length;A++){B.push(this._getContent(this.nodes[A]))}return B},hide:function(){this.base.style.display="none";this.base.style.visibility="hidden"},show:function(){this.base.style.display="block";this.base.style.visibility="visible"}};(function(C){var D,B="/Modules/common/services/SharePost.ashx";function A(){var E;if(!D&&(MySpace.UI.Share.config==undefined||MySpace.UI.Share.config.enableEmail)){C.ajax({url:B,async:false,data:{captchaconfig:true},success:function(F){E=JSON.parse(F)}})}return E}MySpace.UI.ShareButton=function(P){var H=(P&&P.length)?P.find(".linkCssClass:first").val():"";var O=P,F;var G=".shareButtons",N=false,I=MySpace.UI.Share.config;function R(){if(O.attr("data-type")=="activity"){return}var T,V,W,S;var U=O.find(".sharedURL:first");T=U.val()==""?document.location.href:U.val();V=U.val()==""?document.title:O.find(".sharedTitle:first").val();W={url:T,title:V};if(H){H=M(H);S=O.find(H+":first");if(!S.length){S=C(H+":first")}}if(S&&S.length){S.click(function(X){J(W);X.preventDefault()});F=new MySpace.UI.SharePopup(O,N,I);E(W,F.getPopupBase())}else{N=true;E(W);F=new MySpace.UI.SharePopup(O,N,I)}}function M(S){return S.indexOf(".")>=0?S:"."+S}this.openActivityPopup=function(T,S){N=true;if(!F){F=new MySpace.UI.SharePopup(O,N,I)}F.setCallback(S);J(T)};function E(V){var S=arguments[1]||O;S.find(G+" a").click(function(X){var W=this.href.slice(this.href.lastIndexOf("#")+1);if(W=="Email"||W=="MySpace"){J(V,W)}else{if(!N){L(W)}Q(W,V)}X.preventDefault()});var T=S.find(G+":first");try{stLight.getCount(function(W){K(W,T)},V.url)}catch(U){K(null,T)}}function K(T,S){S.find("a").each(function(){var U=this.href.slice(this.href.lastIndexOf("#")+1);C(this).find("em").html(T!=null?T[U.toLowerCase()]||"--":"--")})}function J(U,S){var T=(!!S&&S=="Email")?1:0;F.show(T,U)}function L(S){if(F.hasNetworksDiv()){F.showNote(S)}}function Q(S,T){window.open(MySpace.UI.ShareButton.getUrl(S,T,I))}R()};MySpace.UI.ShareButton.getUrl=function(E,H,G){var F=G.url.replace("{0}",E.toLowerCase());F=F.replace("{1}",encodeURIComponent(H.url));F=F.replace("{2}",encodeURIComponent(H.title));F=F.replace("{3}",G.publisherId);return F};MySpace.UI.SharePopup=function(d,T,z){var Ao=d;var W=T;var p=z;var q=MySpaceRes.PostTo;var Ak=440;var h=true;var a=false;var g=false;var R=!p.enableEmail?380:(W?421:522);var N=B;var l,Ax,r,y,J,F,E,Au,As,O,Ae,Ah,b,G,Av,Ac,Am,Aw,Aj,Ad,S,Ab,n,v,I,Ag={},t,At,Z,k;function s(){Ax=C(H()).appendTo(document.body);r=Ax.find(".loading:first");y=Ax.find(".postToForm:first");J=Ax.find(".shareForm:first");F=Ax.find(".smallLoader:first");E=J.find(".smallLoader:first");Au=Ax.find(".hiddenNode:first");As=Au.find(".successNode:first");O=Au.find(".emailSuccessNode:first");Ae=Au.find(".errorNode:first");Ah=Au.find(".emailErrorNode:first");b=Ax.find(".networks:first");G=Ax.find(".note:first");Av=J.find(".warning:first");Ac=y.find(".warning:first");Am=Ax.find(".shareCaptcha:first");Aw=Ax.find(".shareEmailMessage:first");Aj=Ax.find(".shareToEmailAddress:first");Ad=Ax.find(".shareEmailName:first");l=new MySpace.UI.ShareAccordion(Ax.find(".accordion:first")[0],{headerHeight:34,nodeHeight:380});S=$create(MySpace.UI.LinkPreviewer,null,null,null,Ax.find(".preview:first")[0]);t=y.find(".blob:first");At=y.find(".previewWrapper:first");var Az=Ax.find(".comment:first").bind("keyup focus blur paste",function(){if(this.value.length>=140){this.value=this.value.substr(0,140);Ac.show()}else{Ac.hide()}});Ab=$create(MySpace.UI.DefaultTextboxBehavior,{defaultValue:q.EnterMessage},null,null,Az[0]);Ax.bind("dialogclose",function(AA,AB){j()});y.find("button.postToBtn:first").bind({click:function(){F.show();G.hide();An()},keydown:function(AA){if(AA.keyCode==9){AA.preventDefault()}}});if(p.enableEmail){v=$create(MySpace.UI.DefaultTextboxBehavior,{defaultValue:q.EnterMultipleEmailAddresses},null,null,Aj[0]);n=$create(MySpace.UI.DefaultTextboxBehavior,{defaultValue:q.EnterName},null,null,Ad[0]);I=$create(MySpace.UI.DefaultTextboxBehavior,{defaultValue:q.EnterMessage},null,null,Aw[0]);J.find("button.shareEmailBtn:first").click(function(AA){if(V.isValidEmailList(v.get_value())){E.show();G.hide();L();Av.html("").removeClass("errorFont");Aj.removeClass("errorFont errorBorder")}else{Av.html(q.InvalidEmail).addClass("errorFont");Aj.addClass("errorBorder")}})}Ae.find("a").add(Ah.find("a")).click(function(AA){Ay();AA.preventDefault()});As.find("a").click(function(AA){window.open(p.homePage);AA.preventDefault()})}function H(){var Az='<div class="sharePopup"><img class="loading" src="'+p.largeLoader+'" />  <p class="note">     <span class="warning"></span>     <span class="message">'+q.ShareOtherNetworksDescription+'     </span> </p> <ul class="accordion">     <li>         <h3>'+q.PageHeading+'         </h3>         <div class="content">             <div class="postToForm">                  <textarea class="comment" name="comment"></textarea>                 <h5 class="warning">'+q.ContentExceedsLimit+'                 </h5>                 <div class="previewWrapper">                     <div class="preview"></div>                 </div>                 <div class="blob"></div>                 <button class="postToBtn">'+q.PostButton+'                 </button>                 <img class="smallLoader" src="'+p.smallLoader+'"/>            </div>         </div>     </li>';if(p.enableEmail){Az+="         <li>            <h3>"+q.ShareViaEmail+'             </h3>            <div class="content">                <div class="shareForm">	                <h5 class="warning"></h5>	                <input class="shareEmailName" maxlength="100" />	                <input class="shareToEmailAddress" maxlength="1000" />	                <textarea class="shareEmailMessage"></textarea>	                <div class="shareCaptcha"></div>	                <button class="shareEmailBtn">'+q.PostButton+'                 </button>	                <img class="smallLoader" src="'+p.smallLoader+'"/>	            </div>            </div>        </li>'}Az+=' </ul><div class="networks">    <p>'+q.ShareOtherNetworks+'    </p>   <ul class="shareButtons">'+Y("Facebook",q.ShareToFacebook)+Y("Twitter",q.ShareToTwitter)+Y("Digg",q.ShareToDigg)+'     </ul> </div>  <div class="hiddenNode">     <div class="successNode">         <span class="successImg"></span>         <p>'+q.AllDone+'          <br /><a href="#">'+q.GoCheckOut+'          </a></p>      </div>      <div class="errorNode">          <span class="errorImg"></span>          <p>'+q.TryAgainMessage+"          </p>      </div>";if(p.enableEmail){Az+='       <div class="emailSuccessNode">           <span class="successImg"></span>           <p>'+q.AllDone+'           </p>       </div>       <div class="emailErrorNode">           <span class="errorImg"></span>           <p>'+q.TryAgainMessage+"           </p>       </div>"}Az+="</div></div>";return Az}function Y(Az,AA){return'<li><span class="gapShareTip">'+AA+'<span class="shareTipHoverControl"><small></small></span></span><a href="#'+Az+'" class="'+Az.toLowerCase()+' gapShareContent"><em></em></a></li>'}function An(){if(!Al()){MySpace.UI.LoginOverlayClient.show({loggedInCallback:M,alreadyLoggedInCallback:M,titleClass1:"PostTo",titleKey1:"LoginFirst"});u()}else{M()}}function j(){if(g){window.location.href=window.location.href}if(!h){Ay();G.hide();if(!W){b.hide()}Am.captcha("hide")}h=true}function Ay(){if(y.is(":hidden")){Ap(y);y.show()}if(J.is(":hidden")){Ap(J);J.show()}Ac.hide();F.hide();E.hide();Av.html("")}function Al(){return MySpace.ClientContext.IsLoggedIn}function M(){if(h){g=true;c();e();P()}else{Aa(Ao.find(".sharehash:first").val())}}function P(){C.ajax({url:N,type:"post",data:{userhash:true},success:function(Az){Aa(Az)},error:Af})}function Aa(AA){if(!Ag.isInternalLink){var Az=S.getLinkData();Az.comment=Ab.get_value();Az.sharepost="true";Az.hash=AA;C.ajax({url:N,type:"post",data:x(Az),success:function(AB){f(AB,Az.url,Az.title)},error:Af})}else{var Az={};Az.comment=Ab.get_value();Az.activitypost=JSON.stringify(Ag);Az.hash=AA;C.ajax({url:N,type:"post",data:x(Az),success:f,error:Af})}}function u(){h=true;Ax.dialog("close");b.hide()}function e(){h=false;Ax.dialog("open").dialog({dialogClass:"nopadding",width:Ak,height:R/2})}function Q(Az,AB){var AA=MySpace.UI.ShareButton.getUrl(Az,AB,p);AA=AA+"&pixel=true";return AA}function c(){a=true;r.show();Ax.css({paddingTop:R/2+"px",height:R/2+"px",width:Ak+"px",backgroundColor:"#ffffff",display:"block"});l.hide()}function Ai(){a=false;Ax.css({paddingTop:"0px",height:"auto"});r.hide();F.hide();E.hide();if(!W){b.show()}l.show()}function f(Az,AA,AB){F.hide();if(a){Ai()}if(Az=="true"){if(!Ag.isInternalLink){var AC={url:AA,title:AB};var AA=Q("2myspace",AC);X(AA)}o(y,As);if(typeof Z==="function"){Z()}return}o(y,Ae)}function Af(){F.hide();o(y,Ae);if(a){Ai()}}function x(AA){var AB=[];for(var Az in AA){AB.push(Az+"="+encodeURIComponent(AA[Az]))}return AB.join("&")}function o(Az,AA){Az.parent().append(AA);Az.hide()}function K(){setTimeout(Ai,250)}function Ar(){setTimeout(Ai,250)}function L(){var Az=S.getLinkData();Az.emailpost="true";Az.sendername=n.get_value();Az.emails=v.get_value();Az.message=I.get_value();Az.hash=Ao.find(".sharehash:first").val();if(!Al()||k){Az.captcha=Am.captcha("val")}C.ajax({url:N,type:"post",data:x(Az),success:function(AA){Aq(AA,Az.url,Az.title)},error:Af})}function Aq(AC,Az,AG){E.hide();if(a){Ai()}try{var AB=JSON.parse(AC);if(AB==true){o(J,O);var AH=v.get_value().split(",").length;var AA=[];for(var AD=0;AD<AH;AD++){AA.push("email")}var AF=Q(AA.join(","),encodeURIComponent(Az),encodeURIComponent(AG));X(AF);return}else{if(AB.error=="captcha"){Av.html(q.InvalidSecurityCode).addClass("errorFont");Ax.find("#captcha_text").addClass("errorBorder");return}}}catch(AE){}o(J,Ah)}function w(AA,Az){E.hide();o(J,Ah);if(a){Ai()}}function X(Az){document.createElement("img").src=Az}function Ap(AA){var Az=AA.next();if(Az.length){Au.append(Az)}}function U(AA,Az){t.html(AA);t.find("a").attr("href","javascript:;");t.show();At.hide();setTimeout(Ai,250)}function m(){if(!Al()){return true}if(!p.enableEmail){return false}return false}this.show=function(Az,AB){l.open(Az);c();e();k=m();if(k){D=D?D:A()}if(AB.isInternalLink!=undefined||!Al()){S.enableEdit(false)}if(!AB.isInternalLink){Ag={isInternalLink:AB.isInternalLink,url:AB.url,title:AB.title,description:AB.description};t.hide();At.show();S.previewUrl(Ag.url,Ag.title,Ag.description,K,null,Ar,"share")}else{var AA={};Ag={};Ag=AB;AA.activityid=JSON.stringify(AB);AA.hash=Ao.find(".sharehash:first").val();C.ajax({url:N,type:"post",data:x(AA),success:U,error:K})}Ab.set_value("");if(p.enableEmail){n.set_value("");v.set_value("");if(!Al()){Ad.show();Aw.hide();Am.captcha();Am.captcha("show",D)}else{Ad.hide();Aw.show();I.set_value("");if(k){Aw.height(45);Am.captcha();Am.captcha("show",D)}else{Aw.height(120);Am.captcha("hide")}}}};this.hasNetworksDiv=function(){return b.is(":visible")};this.showNote=function(Az){G.find(".message:first").html(q.ShareOtherNetworksDescription.replace("{0}",Az));G.show()};this.getPopupBase=function(){return Ax};this.setCallback=function(Az){Z=Az};var V={isValidEmailList:function(AA){AA=AA.replace(";",",");var AB=AA.split(",");for(var Az=0;Az<AB.length;Az++){if(!this.validEmail(C.trim(AB[Az]))){return false}}return true},validEmail:function(Az){try{var AA=/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})$/;if(!AA.test(Az)){return false}}catch(AB){return false}return true}};s()};C(".shareButtonControl").each(function(){new MySpace.UI.ShareButton(C(this))})})(jQuery);MySpace.UI.PopupV2=function(J){var M=this,A,L,I,D,E,K,C;function H(){L=B("msPopupV2Overlay",document.body);I=B("msPopupV2Wrapper",document.body);D=B("msPopupV2Box",I);E=B("msPopupV2Content",D);K=B("msPopupV2Border",D);C=B("msPopupV2Close",D);$addHandler(C,"click",M.hide);$addHandler(window,"resize",G);M.set(J||{});MySpace.UI.addStyles(".msPopupV2Overlay { position:absolute;top:0;left:0;display:none;z-index:1000200;width:100%;opacity:0.6;filter:alpha(opacity=60);background:#000; }.msPopupV2Wrapper { position:absolute;left:0;display:none;width:100%;z-index:1000201 }.msPopupV2Box { margin:0 auto;padding:10px;position:relative; }.msPopupV2Border { position:absolute;top:0;left:0;background:#000;height:100%;width:100%;opacity:0.33;filter:alpha(opacity=33);-moz-border-radius:10px;-webkit-border-radius:10px;z-index:-1; }.msPopupV2Close { position:absolute;top:-5px;right:-7px;height:15px;width:15px;background:url("+MySpace.StaticContentBase+"/modules/common/static/img/closepopup.png);cursor:pointer; }.msPopupV2Content { height:100%;width:100%;overflow:auto;background:#444; }",false,"MySpace.UI.PopupV2")}function G(){L.style.height=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)+"px"}function B(O,N){var P=document.createElement("div");P.className=O;N.appendChild(P);return P}function F(Q){if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<=6){var P="iframe,select,embed,object",O=$q(P),N=$q(P,I);Array.forEach(O,function(R){if(Array.indexOf(N,R)==-1){if(Q){R.setAttribute("origvis",R.style.visibility)}R.style.visibility=Q?"hidden":(R.getAttribute("origvis")||"")}})}}M.show=function(){G();L.style.display="block";I.style.display="block";D.style.height=J.height+"px";D.style.width=J.width+"px";var N=window.innerHeight||document.documentElement.clientHeight,O=document.documentElement.scrollTop||document.body.scrollTop;I.style.top=(O+Math.max(Math.round((N-J.height)/2),50))+"px";K.style.zoom="1";K.style.zoom="";F(true);A=true};M.hide=function(N){L.style.display="";I.style.display="";F(false);A=false};M.set=function(N){for(var O in N){J[O]=N[O]}if(N.content){if(typeof N.content=="string"){E.innerHTML=N.content}else{E.innerHTML="";E.appendChild(N.content)}}if(A){M.show()}};M.getCloseButton=function(){return C};H()};if(!MySpace){MySpace={}}if(!MySpace.UI){MySpace.UI={}}MySpace.UI.LoginOverlayClient=(function(){var B=this,H,I=350,D=550,C=450,F;function A(){return !(MySpace.ClientContext&&MySpace.ClientContext.UserId>0)}function E(){var J;if(document.domain.indexOf("myspace.dev")>=0){document.domain="myspace.dev";J="http://secure.myspace.dev"}else{if(document.domain.indexOf("myspace.com")>=0){document.domain="myspace.com";J="https://secure.myspace.com"}}J+="/index.cfm?fuseaction=login.simpleform&featureName=loginOverlay";if(H.titleClass1&&H.titleKey1){J+="&tc1="+H.titleClass1+"&tk1="+H.titleKey1}if(H.titleClass2&&H.titleKey2){J+="&tc2="+H.titleClass2+"&tk2="+H.titleKey2}return J}function G(){var J=document.createElement("iframe");J.style.height="99.3%";J.style.width="100%";J.style.border="none";J.scrolling="no";J.frameBorder="0";J.src=E();return J}B.show=function(J){H={};if(J){for(var K in J){H[K]=J[K]}}if(A()){var L={height:I,width:C,content:G()};if(!F){F=new MySpace.UI.PopupV2(L)}else{F.set(L)}F.show();return true}else{if(H.alreadyLoggedInCallback&&typeof(H.alreadyLoggedInCallback)=="function"){H.alreadyLoggedInCallback()}else{B._loggedIn()}}return false},B.hide=function(){if(F){F.hide()}};B._resizeForCaptcha=function(J){if(F){if(J){F.set({height:D})}else{F.set({height:I})}}};B._loggedIn=function(J){B.hide();if(H.loggedInCallback&&typeof H.loggedInCallback=="function"){H.loggedInCallback(J)}else{if(H.redirectUrl&&typeof H.redirectUrl=="string"){window.top.location=H.redirectUrl}else{window.location.reload(true)}}};return B})();if(typeof(MySpace.ClientMaintenanceConfigs)!="undefined"&&MySpace.ClientMaintenanceConfigs.reshareallactivities!=0){(function(A){MySpace.UI.ReShare=function(){throw"Cannot instantiate static class."};MySpace.UI.ReShare.wire=function(C,D){if(typeof this.shareButtonControl!="object"){this.shareButtonControl=new MySpace.UI.ShareButton(A(".shareButtonControl:first"))}var B=this;A(C).each(function(){var H=A(this);var J=H.attr("rel").split("-");var K=J[1];var E="#activityItem"+J[0];var G=MySpace.UI.ACTP?MySpace.UI.ACTP[K]:null;if(G){var I=MySpace.ClientContext?MySpace.ClientContext.UserId:null;var F=H.attr("href",F);var L=H.hasClass("internal");H.click(function(O){if(L){G.isInternalLink=L;B.shareButtonControl.openActivityPopup(G)}else{var M=A(E).find(".portraitDetailItem");var P="";var N="";M.each(function(){var R=A(this);if(R.find("a").length){P=R.find("a:first").html()}else{N=R.html()}});var Q={isInternalLink:L,url:F,title:P,description:N};B.shareButtonControl.openActivityPopup(Q,D)}MySpace.UI.Stream.ActivityClickTracking(K,MySpace.UI.Stream.EventIdEnum.ReShare);O.preventDefault()});H.addClass("shareable");H.attr("href","#")}})}})(jQuery)}else{MySpace.UI._ReShare=function(){MySpace.UI._ReShare.initializeBase(this)};MySpace.UI._ReShare.prototype={_contentUrl:null,_contentTitle:null,_contentDesc:null,_contentThumb:null,_height:440,_width:440,_usePopup:false,_callBack:null,_activity_ctpId:null,_url:"/Modules/PostTo/Pages/?u={0}&t={1}&c={2}&i={3}&opid={4}",get_contentUrl:function(){return this._contentUrl},set_contentUrl:function(A){this._contentUrl=A},get_contentTitle:function(){return this._contentTitle},set_contentTitle:function(A){this._contentTitle=A},get_contentDesc:function(){return this._contentDesc},set_contentDesc:function(A){this._contentDesc=A},get_contentThumb:function(){return this._contentThumb},set_contentThumb:function(A){this._contentThumb=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},get_activity_ctpId:function(){return this._activity_ctpId},set_activity_ctpId:function(A){this._activity_ctpId=A},initialize:function(){if(this._contentUrl.length>0){var B=-1;if(MySpace.UI.ACTP){var A=MySpace.UI.ACTP[this.get_activity_ctpId()];B=A?A.InitiatorUserID:-1}this._url=String.format(this._url,encodeURIComponent(this._contentUrl),this._contentTitle?encodeURI(this._contentTitle):"",this._contentDesc?encodeURI(this._contentDesc):"",this._contentThumb?encodeURIComponent(this._contentThumb):"",B);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 L=$q(".confirmation",J,true);if(L){F.successReShare=true;var H=$q(".homeLink",L,true);if(H){H.style.display="none"}setTimeout(function(){F._hide()},2000)}}};$addHandler(A,"load",E)}F.show();MySpace.UI.Stream.ActivityClickTracking(B.get_activity_ctpId(),MySpace.UI.Stream.EventIdEnum.ReShare)}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(C,H){var H=H||null;var I=$q(".reshare",H);var B=null;for(var G=0,D=I.length;G<D;G++){B=I[G];if(B&&B.href){Sys.UI.DomElement.addCssClass(B,"shareable");var N=new Array();N=B.rel.split("-");var K=N[1];var P="activityItem"+N[0];var A=$q(".portraitDetailItem",P);var J=null;var L=null;if(A){for(var F=0;F<A.length;F++){var Q=A[F];if(Q.firstChild.nodeName=="A"){J=Q.firstChild.innerHTML}else{L=Q.innerHTML}}}var M=$q(".thumbnailImage",P);var O=(M&&M.length>0)?M[0].src:null;var E={contentUrl:B.href,contentTitle:J,contentDesc:L,contentThumb:O,element:B,usePopup:false,callBack:C,activity_ctpId:K};$create(MySpace.UI._ReShare,E,null,null,null);B.href="#"}}}}Type.registerNamespace("MySpace.UI.Stream.MDPAppBeacon");MySpace.UI.Stream.MDPAppBeacon.trackAppLinkClick=function(C){var E="0";var A=this.href;var F=A.indexOf("appId=")+6;var D=A.indexOf("&",F);if(D<0){D=A.length}currentAppId=A.substring(F,D);var B=AppBeaconEnum.em_canvas;if(A.indexOf("appinstall_source")>0){B=AppBeaconEnum.em_addapp}MySpace.Apps.trackClick(null,AppBeaconEnum.ec_userhome,B,MySpace.ClientContext.FunctionalContext,currentAppId)};MySpace.UI.Stream.MDPAppBeacon.WireBeaconTrack=function(){if(MySpace.Application.keyDisabled("DWBeaconStreamAppClicks")){return}var B=$q(".streamContainer .application a",null);for(var A=0;A<B.length;A++){if(B[A].href.toLowerCase().indexOf("canvas.aspx")>0){$addHandler(B[A],"click",Function.createDelegate(B[A],MySpace.UI.Stream.MDPAppBeacon.trackAppLinkClick))}}};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"}}this.wireBeaconTrack()},sendRequest:function(){var A;if(this._isFilterByFriend){A=String.format("f={0}&s={1}&sc={2}&r={3}&uid={4}",this.get_filter(),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.get_filter(),this.get_source(),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=""}},wireBeaconTrack:function(){if(MySpace.UI.Stream.MDPAppBeacon){if(this._currentFilter==MySpace.UI.Stream.Pivot.All||this._currentFilter==MySpace.UI.Stream.Pivot.Apps){MySpace.UI.Stream.MDPAppBeacon.WireBeaconTrack()}}},handleResponse:function(B,A){MySpace.UI.Pages.Home.StandaloneStream.Filters.callBaseMethod(this,"handleResponse",[B,A]);document.title=MySpace.UI.Pages.Home.ActivityStream.PageTitle}};MySpace.UI.Pages.Home.StandaloneStream.Filters.registerClass("MySpace.UI.Pages.Home.StandaloneStream.Filters",MySpace.UI.Stream.Pivots);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.OverlayMetadata){return}var A=$create(MySpace.UI.Pages.Activity.OverlayedActivity,null,null,null,null)};MySpace.UI.Pages.Activity.OverlayedActivity=function(){MySpace.UI.Pages.Activity.OverlayedActivity.initializeBase(this)};MySpace.UI.Pages.Activity.OverlayedActivity.prototype={_modal:null,_title:null,_invisibleDiv:null,_inlineVideoCtrl:null,initialize:function(){MySpace.UI.Pages.Activity.OverlayedActivity.callBaseMethod(this,"initialize");this.processOverlayActivities()},processOverlayActivities:function(){var C=$q(".streamContainer .activitiesContainer",null,true);if(C){var A=$q(".overlayActivity",C,false);for(var B=0;B<A.length;B++){this.processOverlayActivity(A[B],MySpace.UI.Pages.Activity.OverlayMetadata.ClickThruUrls[B],MySpace.UI.Pages.Activity.OverlayMetadata.ClickThruBeaconUrls[B])}}},processOverlayActivity:function(C,A,D){var B=this;if(this.IsSponsored(C)){this._title=MySpace.UI.Pages.Activity.OverlayMetadata.Title;C.onclick=function(){B.handleSponsoredClicks(A,D);return false}}else{C.onclick=function(){B.handleOverlayDivClicks(A,D);return false}}C.style.cursor="pointer"},IsSponsored:function(A){return new RegExp("\\bsponsoredActivity\\b").test(A.className)},handleOverlayDivClicks:function(A,B){this.BeaconCall(B);window.open(A)},handleSponsoredClicks:function(A,B){if(MySpace.UI.Pages.Activity.OverlayMetadata.InlineVideoObject){if(!this._inlineVideoCtrl){this.BeaconCall();this._content=MySpace.UI.Pages.Activity.OverlayMetadata.InlineVideoObject;if(MySpace.UI.InlineVideo){this._inlineVideoCtrl=MySpace.UI.InlineVideo.attach(this._invisibleDiv,this._content);this._inlineVideoCtrl._showVideoHandler();this._invisibleDiv.parentNode.style.height="auto";this._invisibleDiv.parentNode.removeChild(this._invisibleDiv)}}}else{this.BeaconCall(B);this._content=A;this._modal=this.createModal();this._modal.show(Function.createDelegate(this,this.clearModal))}},clearModal:function(){this._modal.set_content("")},BeaconCall:function(B){var A=document.createElement("img");A.src=B;A.className="trackingpixel"},createModal:function(){var D=document.createElement("iframe");D.src=this._content;D.frameBorder=0;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";B._box.childNodes[2].style.padding="0px";return B}};MySpace.UI.Pages.Activity.OverlayedActivity.registerClass("MySpace.UI.Pages.Activity.OverlayedActivity",Sys.Component);Type.registerNamespace("MySpace.UI.Home.Events");MySpace.UI.Home.Events.WireWalmartClickTracking=function(){var M=$q(".activityStreamModule .event");var F=MySpace.ClientContext.UserId;var E=new Object();for(var D=0;D<M.length;D++){var B=M[D];var A;var H=$q("a.view-details",B,true);if(H){A=H.href.split("/")[4];$addHandler(H,"click",Function.createDelegate(A,function(N){MySpace.Beacon.Request({et:"events",em:"click",ec:"stream_view_details",eid:this,uid:F,ip:""})}))}var K=$q(".description a",B,true);if(K){$addHandler(K,"click",Function.createDelegate(A,function(N){MySpace.Beacon.Request({et:"events",em:"click",ec:"stream_event_title",eid:this,uid:F,ip:""})}))}var I=$q(".event-img a",B,true);if(I){$addHandler(I,"click",Function.createDelegate(A,function(N){MySpace.Beacon.Request({et:"events",em:"click",ec:"stream_event_image",eid:this,uid:F,ip:""})}))}var G=$q(".rsvp a.yes",B,true);if(G){$addHandler(G,"click",Function.createDelegate(A,function(N){MySpace.Beacon.Request({et:"events",em:"click",ec:"stream_rsvp_yes",eid:this,uid:F,ip:""})}))}var C=$q(".rsvp a.maybe",B,true);if(C){$addHandler(C,"click",Function.createDelegate(A,function(N){MySpace.Beacon.Request({et:"events",em:"click",ec:"stream_rsvp_maybe",eid:this,uid:F,ip:""})}))}var J=$q(".sponsor a",B,true);if(J){$addHandler(J,"click",Function.createDelegate(A,function(N){MySpace.Beacon.Request({et:"events",em:"click",ec:"stream_sponsor_logo",eid:this,uid:F,ip:""})}));if(!E[A]){E[A]=1}else{E[A]++}}}for(var A in E){var L=E[A];MySpace.Beacon.Request({et:"events",em:"impressions",ec:"stream",eid:A,uid:F,ip:"",ic:L})}};(function(){var A=$q(".applicationsModule iframe");for(var B=0;B<A.length;B++){if(A[B].className!=""){A[B].src=A[B].className}}})();Type.registerNamespace("MySpace.SyncSettings");MySpace.SyncSettings.SyncItem=function(A){this.Id=A.Id;this.Name=A.Name;this.Title=A.Title;this.ConnectStatus=A.ConnectStatus;this.ConnectUrl=A.ConnectUrl;this.PushEnabled=A.PushEnabled;this.PopEnabled=A.PopEnabled;this.PushStatus=A.PushStatus;this.PopStatus=A.PopStatus;this.RemoteName=A.RemoteName;this.RemoteUrl=A.RemoteUrl;this.IsPrivate=A.IsPrivate;this.InstallationStatus=A.InstallStatus;this.Icon=A.Icon;this.LinkUrl=A.LinkUrl;this.UnLinkUrl=A.UnLinkUrl;this.StatusMessage="";this.OnChangeStatus=null};MySpace.SyncSettings.SyncItem.prototype={_htmlEl:null,_linkEl:null,_unlinkEl:null,_statusEl:null,_textEl:null,_remoteLinkEl:null,_syncImg:null,_permissionEl:null,_confirmationEl:null,_privateAccEl:null,_pushCheckEl:null,_popCheckEl:null,_disconnectCheckEl:null,_disclaimerEl:null,_popup:null,_errorPopup:null,_syncOverlayImg:null,_isProtected:null,_createpPopup:function(){if(!this._popup){var A=MySpace.SyncSettings.SyncService.Instance.Resources.PermissionsTitle;this._popup=MySpace.UI.Popup.create("",A);this._popup.set_width(500);this._popup._box.firstChild.style.display="none";this._popup.set_autoSize(false);this._popup.set_top(200)}},_createErrorPopup:function(){if(!this._errorPopup){}},_showBusyLayer:function(){this._busylayer=document.createElement("div");this._busylayer.className="autopostloading";this._popup._box.appendChild(this._busylayer);this._busylayer.style.position="absolute";this._busylayer.style.width="100%";this._busylayer.style.height="100%";this._busylayer.style.opacity=0.5;this._busylayer.style.filter="alpha(opacity=50)";this._busylayer.style.left="0px";this._busylayer.style.top="0px"},_removeBusyLayer:function(){if(this._busylayer){this._busylayer.parentNode.removeChild(this._busylayer)}},Setup:function(){if(this.ConnectUrl&&this.ConnectUrl!=""){window.open(this.ConnectUrl)}},OnSetupSuccess:function(C,A,B){this.ConnectStatus=true;if(C!=undefined&&C!=""){this.RemoteName=C}if(B!=undefined&&B!=""){this.RemoteUrl+=B}else{this.RemoteUrl+=C}this.IsPrivate=A.toLowerCase();this.ShowPermissions(true)},ShowPermissions:function(T){if(!this._popup){this._createpPopup();var A=document.createElement("div");A.className="servicePermissionOverlay";var B=document.createElement("h5");var J=this.Title;B.appendChild(document.createTextNode(J));A.appendChild(B);var L=document.createElement("span");L.className=this.Name+"LargeIcon";A.appendChild(L);var E=document.createElement("div");this._permissionEl=E;E.className="permissionContent";A.appendChild(E);var C=document.createElement("div");C.className="permissionContentTitle";C.appendChild(document.createTextNode(MySpace.SyncSettings.SyncService.Instance.Resources.PermissionsDesc));E.appendChild(C);var I=document.createElement("ul");E.appendChild(I);var R=MySpace.SyncSettings.SyncService.Instance.Resources.StatusUpdatePush;if(this.Name.toLowerCase()=="facebook"){R=MySpace.SyncSettings.SyncService.Instance.Resources.StatusUpdatePushFB}this._pushCheckEl=this._createSettingRow(I,R,J,this.PushEnabled);this._pushCheckEl.syncType="push";this._popCheckEl=this._createSettingRow(I,MySpace.SyncSettings.SyncService.Instance.Resources.StatusUpdatePop,J,this.PopEnabled,this.IsPrivate);this._popCheckEl.syncType="pop";var G=document.createElement("div");G.className="privateTwitterAccount";G.innerHTML=String.format(MySpace.SyncSettings.SyncService.Instance.Resources.TwitterPrivateAccount,J);this._privateAccEl=G;E.appendChild(G);var D=document.createElement("div");D.className="connectionDiagram clearfix";var P=document.createElement("div");P.className=this.Name+"MediumIcon";var Q=document.createElement("div");this._syncOverlayImg=Q;var H=document.createElement("div");H.className="mySpaceMediumIcon";D.appendChild(P);D.appendChild(Q);D.appendChild(H);E.appendChild(D);var F=document.createElement("div");F.className="permissionContentFooter";checkBox=document.createElement("input");checkBox.type="checkbox";this._disconnectCheckEl=checkBox;F.appendChild(checkBox);checkBoxTextEl=document.createElement("div");checkBoxTextEl.appendChild(document.createTextNode(String.format(MySpace.SyncSettings.SyncService.Instance.Resources.Disconnect,J)));F.appendChild(checkBoxTextEl);E.appendChild(F);var K=document.createElement("div");K.className="permissionDisclaimer";K.appendChild(document.createTextNode(String.format(MySpace.SyncSettings.SyncService.Instance.Resources.LegalDisclaimer,J)));this._disclaimerEl=K;E.appendChild(K);var N=this._pushCheckEl;var M=this._popCheckEl;var O=function(){Q.className=N.checked&&M.checked?"syncTwowayOverlay":N.checked?"syncPostOverlay":M.checked?"syncIngestOverlay":"";if(Q.className==""){Q.parentNode.style.display="none"}else{Q.parentNode.style.display=""}};N.onclick=O;M.onclick=O;this._createRemoveConfirmation(A);this._popup.set_content(A)}if(T){this.PushStatus=this.PushEnabled;this.PopStatus=this.PopEnabled}this._pushCheckEl.checked=this.PushStatus;this._popCheckEl.checked=this.PopStatus;this._syncOverlayImg.className=this._pushCheckEl.checked&&this._popCheckEl.checked?"syncTwowayOverlay":this._pushCheckEl.checked?"syncPostOverlay":this._popCheckEl.checked?"syncIngestOverlay":"";if(this._syncOverlayImg.className==""){this._syncOverlayImg.parentNode.style.display="none"}else{this._syncOverlayImg.parentNode.style.display=""}this._privateAccEl.style.display=(this.IsPrivate==="true"?"":"none");this._disconnectCheckEl.checked=false;this._disconnectCheckEl.parentNode.style.display=T?"none":"";this._disclaimerEl.style.display=T?"":"none";if(this._confirmationEl){this._confirmationEl.style.display="none"}this._permissionEl.style.display="block";this._popup.remove_buttons();var S=this;this._popup.add_button(MySpace.SyncSettings.SyncService.Instance.Resources.Update,false,function(){S._updatePermissions()});this._popup.add_button(MySpace.SyncSettings.SyncService.Instance.Resources.Cancel,false,function(){if(T){S.PushStatus=false;S.PopStatus=false}S.set_status();S._popup._hide()},"cancelOverlay");this._popup.show()},_updatePermissions:function(){var A=this._pushCheckEl?this._pushCheckEl.checked:false;var C=this._popCheckEl?this._popCheckEl.checked:false;var B=this._disconnectCheckEl.checked;var D=MySpace.SyncSettings.SyncService.Instance.HashValue;if(B){this._confirmRemoval()}else{var E={hash:D,serviceName:this.Name,isOutgoing:A,isIncoming:C,isDisconnect:false};this._sendRequestForUpdate(E)}},_sendRequestForUpdate:function(B){var A=this;Sys.Net.WebServiceProxy.invoke("/modules/AccountSettings/services/ExternalService.asmx","UpdateExternalService",false,B,function(C){A._onUpdateSuccess(C)},function(C){A._onUpdateFailure(C)});this._showBusyLayer()},_onUpdateSuccess:function(A){this._removeBusyLayer();this.IsPrivate=false;if(this._disconnectCheckEl.checked){this.PushStatus=false;this.PopStatus=false;this.ConnectStatus=false;this.RemoteName="";this.StatusMessage=String.format(MySpace.SyncSettings.SyncService.Instance.Resources.RemoveSuccessMessage,this.Title);this.set_status()}else{this.PushStatus=this._pushCheckEl.checked;this.PopStatus=this._popCheckEl.checked;this.ConnectStatus=true;var B=String.format(MySpace.SyncSettings.SyncService.Instance.Resources.UpdateSuccessMessage,this.Title);if(this.PushStatus){B+=" "+MySpace.SyncSettings.SyncService.Instance.Resources.UpdateYourStatusNow}this.StatusMessage=B;this.set_status()}this._popup._hide()},_onUpdateFailure:function(A){this._removeBusyLayer()},_confirmRemoval:function(){this._confirmationEl.style.display="block";this._permissionEl.style.display="none";this._popup.remove_buttons();var A=this;this._popup.add_button(MySpace.SyncSettings.SyncService.Instance.Resources.YesRemoveService,false,function(){A._removeService()});this._popup.add_button(MySpace.SyncSettings.SyncService.Instance.Resources.NoKeepService,false)},_removeService:function(){var A=this._pushCheckEl?this._pushCheckEl.checked:false;var B=this._popCheckEl?this._popCheckEl.checked:false;var C=MySpace.SyncSettings.SyncService.Instance.HashValue;var D={hash:C,serviceName:this.Name,isOutgoing:A,isIncoming:B,isDisconnect:true};this._sendRequestForUpdate(D)},set_status:function(){if(this.OnChangeStatus!=null){this.OnChangeStatus(this,this.StatusMessage)}},_createSettingRow:function(F,H,B,D,G){var A=document.createElement("li");var C=document.createElement("input");C.type="checkbox";A.appendChild(C);var E=document.createElement("div");E.innerHTML=String.format(H,B);if(!D){C.disabled=true;E.className="disabled";E.innerHTML+=" "+MySpace.SyncSettings.SyncService.Instance.Resources.SettingNotSupported}if(G==="true"){E.innerHTML+="*"}A.appendChild(E);F.appendChild(A);return C},_createRemoveConfirmation:function(C){var B=document.createElement("div");B.className="permissionContent";C.appendChild(B);var A=document.createElement("div");A.className="permissionContentTitle";A.appendChild(document.createTextNode(String.format(MySpace.SyncSettings.SyncService.Instance.Resources.RemoveConfirmationTitle,this.Title)));B.appendChild(A);var D=document.createElement("div");D.className="removalConfirmation";D.appendChild(document.createTextNode(String.format(MySpace.SyncSettings.SyncService.Instance.Resources.RemoveConfirmation,this.Title)));B.appendChild(D);this._confirmationEl=B}};MySpace.SyncSettings.SyncItem.registerClass("MySpace.SyncSettings.SyncItem",Sys.Component);MySpace.SyncSettings.SyncService=function(){var D="/Modules/PageEditor/Handlers/Common/{0}.ashx";this.extServices=null;this.msidServices=null;this.allSyncServices=null;this.Resources=null;this.HashValue="";var B=jQuery;this.getExternalServices=function(E){if(this.extServices==null){this.extServices=new Array();this.doAjax("GetExternalServicesSyncData",this.extServices,E)}return this.extServices};this.getMySpaceIDServices=function(E){if(this.msidServices==null){this.msidServices=new Array();this.doAjax("GetMySpaceIdServicesSyncData",this.msidServices,E)}return this.msidServices};this.getSyncServices=function(E){if(this.allSyncServices==null){this.allSyncServices=new Array();this.doAjax("GetAllSyncServicesData",this.allSyncServices,E)}return this.allSyncServices};function A(G,F){for(var E in F){G[F[E].Name]=new MySpace.SyncSettings.SyncItem(F[E])}}function C(G,F){F=F.toLowerCase();for(var E in G){if(G[E]["Name"].toLowerCase()==F){return G[E]}}return null}this.getSyncItem=function(F){if(this.allSyncServices!=null){return C(this.allSyncServices,F)}var E=null;if(this.extServices!=null){E=C(this.extServices,F)}if(E==null&&this.msidServices!=null){E=C(this.msidServices,F)}return E};this.doAjax=function(G,I,F){var H=String.format(D,G);var E=this;B.ajax({type:"POST",url:H,success:function(J){try{var L=JSON.parse(J);A(I,L.services);if(E.Resources==null){E.HashValue=L.hash;E.Resources=new Array();var M=JSON.parse(L.resources);for(var K in M){E.Resources[K]=M[K]}}if(F){F(I)}}catch(N){}},data:{hash:MySpace.UI.Pages.HashMashter}})}};MySpace.SyncSettings.SyncService.registerClass("MySpace.SyncSettings.SyncService",Sys.Component);MySpace.SyncSettings.SyncService.Instance=new MySpace.SyncSettings.SyncService();MySpace.SyncSettings.SyncService.OnSetupSuccess=function(E,C,D,B){if(MySpace.SyncSettings.SyncService.Instance!=null){var A=MySpace.SyncSettings.SyncService.Instance.getSyncItem(B);if(A!=null){A.ConnectStatus=true;if(E!=undefined&&E!=""){A.RemoteName=E}if(D!=undefined&&D!=""){A.RemoteUrl+=D}else{A.RemoteUrl+=E}A.IsPrivate=C.toLowerCase();A.ShowPermissions(true)}}};(function(A){A(".superShareContainer").each(function(){new (function(A7){var Bg=A7.find("form:first");if(!Bg.length){return}var v="Attach_Type_Status",Be="Attach_Type_Mood",AP="Attach_Type_Photo",BD="Attach_Type_Video",A0="Attach_Type_Link",x="Attach_Type_Movie",U="Attach_Type_Music",Ah="Attach_Type_Videosearch",a=MySpace.UI.SuperPost.config,AE=v,BB=MySpace.StaticContentBase+"/modules/common/static/img/spacer.gif",u=/\b((https?:\/\/)|(www\.)|(\S+\.com\/))\S+/gi,o={},F=[],Aw,A2,Y,R,A8,J,B,Ae,C,AN,z,E,Bw,Bs,Bi,AA,Ad,y,Am,AT,Bp,AJ,AG,AX,e,D,n,BG,p,AK,AD,s,AZ,AY,A9,w,Ba,M,r,AU,Bb=MySpace.Beacon&&!MySpace.Application.keyDisabled("DWBeaconSuperPost"),BF=a.movieMetaData,AM,Ab,Bc,P,An,Bk,Ak,Ai,Az,Br,X,AO,h=false,V=this,Al,Aa="/Modules/PageEditor/Handlers/Common/{0}.ashx";function Ay(){Aw=Bg.find("textarea:first");A2=$create(MySpace.UI.DefaultTextboxBehavior,{defaultValue:a.defaultStatus},null,null,Aw[0]);AD=Bg.find("maxChars:first");Aw.keypress(Ao).focus(Q).bind("paste",L);Y=Bg.find(".attachTypes:first");R=Bg.find(".submitBtn:first");F=Bg.find(".error");Y.click(t);R.click(function(BJ){V.shareClick(BJ)});Bk=Bg.find(".chooseBtn:first");Bk.click(T);Al=Bg.find("input[name=hash]:first").val();var BH=Bg.find(".externalServices:first");if(BH[0]){if(MySpace.SyncSettings.SyncService&&MySpace.SyncSettings.SyncService.Instance!=null){var BI=MySpace.SyncSettings.SyncService.Instance;BI.getExternalServices(function(BN){if(BN!=null){BH.before('<button class="syncSelection glue utility" type="button"><span class="gear"></span><small>▼</small></button>')}for(var BL in BN){var BM=BN[BL];var BJ=3;if(BM.ConnectStatus&&BM.PushStatus){BJ=1}else{if(BM.ConnectStatus){BJ=2}}strCheckbox="<input type='checkbox' value='"+BM.Name+"' "+(BJ==1?" checked='checked' ":"")+" data-flag='"+BJ+"'/>";BH.append("<li>"+strCheckbox+"<span class='logo "+BM.Name+"'></span>"+BM.Title+"</li>")}BH.find("input").each(function(){A(this).data("orgStatus",this.checked);var BO=A(this);A(this).change(function(){if(A(this).is(":checked")){var BP=A(this).attr("data-flag");switch(BP){case"1":case"2":break;case"3":var BQ=BI.getSyncItem(BO.val());BQ.OnChangeStatus=function(BR){if(!BR.PushStatus){BO[0].checked=false;if(BR.ConnectStatus){BO.attr("data-flag","2")}}else{BO.attr("data-flag","1");A(this).data("orgStatus",true)}};BQ.Setup();break}}})});var BK=Bg.find(".syncSelection:first").show();BK.click(function(BO){BH.show()})})}A(document).mousedown(function(BJ){if(BH.css("display")=="none"||A.contains(BH[0],BJ.target)||BH[0]==BJ.target){return}BH.hide()})}A7.data("superShare",V)}function t(BJ){BJ.preventDefault();var BK=BJ.target;var BI=Y.get()[0];while(BK.tagName!="LI"){if(BK==BI){return}BK=BK.parentNode}AH(BK.className);var BH=BF&&BK.className=="movie"?{mturl:BF.linkUrl}:null;AB({mood:"ma",photo:"pa",video:"va",link:"sl",movie:"mtv"}[BK.className],BH)}function AH(BH,BI){MySpace.UI.addDeferredScript("SuperPostBundle.js",function(){Av(BH);if(BI){BI()}if(Bc&&!Ai){Ax()}})}function Av(BJ){if(!A8){M=Bg.find(".addMood:first");var BI=Bg.find(".addPhoto:first");r=Bg.find(".addVideo:first");AU=Bg.find(".addLink:first");AM=Bg.find(".addMovie:first");Bc=Bg.find(".addSong:first");Br=Bg.find(".addVideoSearch:first");if(M[0]){A8=M.find("input:first");M.find(".cancel:first").click(Aj)}if(BI[0]){Ae=BI.find(".upload:first").click(function(){AB("spu")});C=BI.find(".preview img");C.data("_orgSrc",C.attr("src"));AN=BI.find(".error:first");BI.find(".webcam:first").click(H);BI.find(".cancel:first").click(Aj)}if(r[0]){E=r.find(".upload:first").click(function(){AB("svu")});Bw=r.find(".error:first");r.find(".webcam:first").click(Ap);r.find(".cancel:first").click(Aj)}if(AU[0]){Bs=AU.find(".url:first").val("").bind("keypress",Ag);Bi=$create(MySpace.UI.DefaultTextboxBehavior,{defaultValue:"http://"},null,null,Bs[0]);AA=AU.find(".attachLink:first").click(As);Ad=AU.find(".error:first").click(W);AU.find(".cancel:first").click(Aj)}if(AM[0]){AM.find(".cancel:first").click(Z)}if(Bc[0]){var BH=Bc.find(".song:first");P=$create(MySpace.UI.DefaultTextboxBehavior,null,null,null,BH[0]);$create(MySpace.UI.AutoCompleteBehavior,{minimumPrefixLength:2,servicePath:"modules/sitesearchv2/services/autocompletesearch.asmx",serviceMethod:"GetMusicSearchResults",postParameterName:"searchText",completionListCssClass:"completionList",groupHeaderCssClass:"groupHeader",completionInterval:300},{itemSelected:function(BL,BK){var BM=BK.get_item();if(BM&&BM.childNodes.length>1){BL.set_value(BM.childNodes[1].innerHTML,true)}AC()},itemOver:function(BL,BK){var BM=BK.get_item();if(BM&&BM.childNodes.length>1){BL.set_value(BM.childNodes[1].innerHTML,true)}}},null,BH[0]);Bc.find(".attachSong:first").click(AC);Bc.find(".cancel:first").click(Aj);Bc.find(".musicMenu:first").find(".songs,.videos,.albums").click(AV);Bc.find(".nav .next").click(Ar);Bc.find(".nav .prev").click(Bh);Bc.find(".videoPlayer .close").click(Bu);Bc.find(".details .close").click(A4)}if(Br[0]){X=Br.find(".video:first");Br.find(".attachVideo:first").click(AR).end().find(".cancel:first").click(Aj).end().find(".nav .next").click(A6).end().find(".nav .prev").click(N).end().find(".videoPlayer .close").click(Bo).end().find(".details .close").click(By)}A1()}AE="Attach_Type_"+BJ.charAt(0).toUpperCase()+BJ.substring(1);Bg.removeClass("showAttachTypes").addClass("attaching attach"+BJ);if(BJ=="mood"){if(Am){setTimeout(function(){A8.focus()},0)}else{A.ajax({url:String.format(Aa,"GetMoodData"),success:k,data:{hash:Al,moodHash:a.hash}})}}else{if(BJ=="link"){Bs.width(AU.outerWidth()-AA.outerWidth()-11)}else{if(BJ=="movie"){m()}else{if(BJ=="music"||BJ=="videosearch"){g()}}}}Q()}function A1(){function BH(BI,BK,BJ,BM){if(BM){BM.parentNode.removeChild(BM)}var BL=document.createElement("input");BL.setAttribute("type","file");BL.setAttribute("name",BI);BK.append(BL);A(BL).bind("change",BJ);return BL}if(Ae){B=BH("photo",Ae,Bq,B)}if(E){z=BH("video",E,c,z)}}function k(BI){try{Am=JSON.parse(BI)}catch(BH){Am={error:"error"}}AT=$create(MySpace.UI.ComboBoxBehavior,{minimumPrefixLength:1,completionItems:Am.moods,completionInterval:500},{itemSelected:function(BK,BJ){b(BJ.get_value());Bt()}},null,A8[0]);if(AT._completionListElement){A(AT._completionListElement).addClass("moodList")}A8.change(Bt);J=Bg.find(".smileySelector:first").click(AI);Bp=J.find("div:first");b(Am.defaultMood.value);A8.val(Am.defaultMood.text).select()}function Aj(BH){if(BH){BH.preventDefault()}AE=v;h=false;Bg.addClass("showAttachTypes");A.each(["attaching","attachmood","attachphoto","attachvideo","attachlink","attachingLink","uploadedPhoto","uploadingVideo","attachmovie","attachmusic","attachvideosearch"],function(BI,BJ){Bg.removeClass(BJ)});F.html("");A1();BG=-1;if(C){C.attr("src",C.data("_orgSrc"))}AZ=false;if(Bi){Bi.set_value("")}if(y){y.reset()}if(AM){AM.detach(".player")}if(Bc&&Bc[0]){BA()}if(Br&&Br[0]){K()}Aw.attr("readonly",false);Q();g(false)}function A5(){var BI=A2.get_value(),BK={};if(AE==AP&&BG>-1){BK={caption:BI,id:BG}}else{if(AE==Be&&(A8.val()||AX)){BK={status:BI,mood:A8.val(),smiley:AX}}else{if(AE==A0&&y.getLinkData()){BK=y.getLinkData();BK.status=BI}else{if(AE==x&&Ab){BK=Ab.getLinkData();BK.status=BI;if(BF.linkUrl){BK.url=BF.linkUrl}}else{if(AE==U&&Ak){var BH=Ak.getLinkData();if(BH){BK=BH}BK.status=BI}else{if(AE==Ah&&AO){var BH=AO.getLinkData();if(BH){BK=BH}BK.status=BI}else{BK={status:BI}}}}}}}BK.isLinkedStatus=h;var BJ=Bj();if(BJ){BK.syncSettings=BJ}BK.attachType=AE;return BK}function At(BL){BL.preventDefault();if(AY||!BC()){return}var BH=A2.get_value(),BK={},BJ="SaveStatus";if(AE==AP&&BG>-1){BK={caption:BH,id:BG};BJ="SharePhoto";AB(Ba?"pwp":"pup")}else{if(AE==Be&&(A8.val()||AX)){BK={status:BH,mood:A8.val(),smiley:AX};if(AX&&Am.smileys&&Am.smileys.sponsoredSmileys&&A.inArray(AX,Am.smileys.sponsoredSmileys)>-1){AB("mp",{setype:q(AX)})}else{AB("mp")}}else{if(AE==BD&&z.value){Aq();AB("vup");return}else{if(AE==BD&&AK){AF(AK,A2.get_value(),false,A3);AB("vwp");return}else{if(AE==A0&&y.getLinkData()){BK=y.getLinkData();BK.status=BH;AB("lp")}else{if(AE==x){if(Ab){BK=Ab.getLinkData();BK.status=BH;if(BF.linkUrl){BK.url=BF.linkUrl}AB("mtp",{mturl:BF.linkUrl})}else{return}}else{if(AE==U){if(Ak){BK=Ak.getLinkData();if(!BK){return}BK.status=BH}else{return}}else{if(AE==Ah){if(AO){BK=AO.getLinkData();if(!BK){return}BK.status=BH}else{return}}else{BK={status:BH};AB("sp")}}}}}}}}BK.isLinkedStatus=h;var BI=Bj();if(BI){BK.syncSettings=BI}BK.hash=Al;A.ajax({url:String.format(Aa,BJ),success:AW,data:BK,type:"POST"});Bg.addClass("posting");AY=true}function BC(){return !Bg.hasClass("uploadingPhoto")&&((AE==AP&&BG>-1)||(AE==Be&&(A8.val()||AX))||(AE==BD&&(z.value||AK))||(AE==A0&&y&&y.getLinkData())||(AE==x&&Ab)||(AE==U&&Ak)||(AE==Ah&&AO)||(A2.get_value()))}function Aq(){window.onSuperPostVideoUploadPopupLoad=function(BK,BI){var BJ=z.form;BJ.setAttribute("action",a.uploadUrl+"&media_type=Video&redirect="+encodeURIComponent("http://"+document.location.hostname+"/modules/common/pages/superpost/uploadresponse.aspx?type=video")+"&vuid="+BI);BJ.setAttribute("target",BK);BJ.submit();AF(BI,p,false);A3()};p=A2.get_value();var BH=window.open("/modules/common/pages/superpost/videouploadpopup.aspx","msSuperPostVideoUpload","height=275,width=560,resizable=yes,scrollbars=yes");setTimeout(function(){if(!BH){alert(MySpaceRes.HomeDisplayV3.SuperPost_PopupBlocked);return}},0)}function AF(BI,BL,BJ,BM){var BK="desc="+encodeURIComponent(BL)+"&isPrivate="+BJ+"&guid="+encodeURIComponent(BI)+"&hash="+Al;var BH=Bj();if(BH){BK+="&syncSettings="+encodeURIComponent(BH)}A.ajax({url:String.format(Aa,"SaveVideoMetadata"),success:BM,data:BK,type:"POST"})}function Bj(){var BJ=Bg.find(".externalServices:first");if(BJ[0]){var BI={},BH=false;BJ.find("input").each(function(){if(A(this).data("orgStatus")!=this.checked){BI[this.value]=this.checked;BH=true}});if(BH){return JSON.stringify(BI)}}return null}function AW(BH){AY=false;Bg.removeClass("posting");try{val=JSON.parse(BH)}catch(BI){}if(val&&"html" in val){A3()}else{alert(MySpaceRes.Header.ErrorMessage.replace(/<br.*>/gi,"\n"))}if(typeof(V.shareCallback)==="function"){V.shareCallback(val)}}function A3(){A2.set_value("");w=false;Aj()}function H(BI){BI.preventDefault();AB("spw");Bg.addClass("takingPhoto");if(!AJ){AJ=A("<div><div id='msSuperPostPhotoUploader'></div></div>").dialog({width:400,height:404,autoOpen:false});var BH=MySpaceRes.UploadResource;swfobject.embedSWF(a.photoUploaderUrl,"msSuperPostPhotoUploader",400,400,"9.0.28",null,{h:a.photoUploadHash,f:MySpace.ClientContext.UserId,ae:1,culture:a.culture,t:a.unixTime,utoken:a.uploadToken,pmode:2,CameraActivity:BH.CameraActivity,Cancel:BH.Cancel,Capture:BH.Capture,Error:BH.Error,OK:BH.OK,MsgCamActivity:BH.MsgCamActivity,MsgNoCamFound:BH.MsgNoCamFound,Msg_NoCam:BH.Msg_NoCam,Photo:BH.Photo,Retake:BH.Retake,RetakePic:BH.RetakePic,Step1:BH.ChooseDevice,Step2:BH.SaveFlashSettings,TakePicture:BH.TakePicture,Upload:BH.Keep,UploadError2:BH.UploadError2,UploadError1:BH.UploadError1,Uploading:BH.Uploading,UploadPic:BH.UploadPic,UploadToMySpace:BH.UploadToMySpace},{allowscriptaccess:"always",wmode:"transparent"},null,function(){AJ.dialog("open")})}AJ.dialog("open");window.onSuperPostWebcamPhoto=function(BJ){A.ajax({url:String.format(Aa,"GetWebcamPhotoURL"),success:function(BK){C.attr("src",BK);BG=BJ;Ba=true;Bg.addClass("uploadedPhoto").removeClass("uploadingPhoto");AJ.dialog("close")},data:{id:BJ,hash:Al},type:"POST"});AB("pwc")}}function Ap(BH){BH.preventDefault();AB("swv");Bg.addClass("takingVideo");if(!AG){AG=A("<div>").dialog({height:404,width:400})}AG.html("<div id='msSuperPostVideoUploader'></div>");A.ajax({url:String.format(Aa,"GetWebcamVUID"),success:function(BI){AK=BI;swfobject.embedSWF("http://lads.myspace.com/superpost/VideoRecorder_sp.swf","msSuperPostVideoUploader",400,400,"9.0.0",null,{utoken:a.uploadToken,vuid:AK},{allowscriptaccess:"always",allowfullscreen:"true",quality:"high",wmode:"transparent"});AG.dialog("open")},data:{hash:Al}});window.VideoRecordComplete=function(BI){Bw.html("");Bg.addClass("uploadingVideo");setTimeout(function(){AG.dialog("close")},0);AF(AK,A2.get_value(),true);AB("vwc")}}function As(BH){BH.preventDefault();AB("la");if(Bi.get_value()){O(Bi.get_value())}}function Ag(BH){if(BH.which==A.ui.keyCode.ENTER){As(BH)}}function O(BH){AH("link",function(){if(!y){y=$create(MySpace.UI.LinkPreviewer,null,null,null,Bg.find(".linkPreviewer:first")[0])}Bg.addClass("attachingLink");y.previewUrl(BH,null,null,AS,function(){AB("le")},function(){AB("lpc")})})}function AS(){var BH=MySpaceRes.HomeDisplayV3.SuperPost_LinkError;if(!AZ){BH+=" <a href='#'>"+MySpaceRes.HomeDisplayV3.SuperPost_TryAgain+"</a>"}Ad.html(BH)}function W(BH){BH.preventDefault();if(BH.target.tagName=="A"){Aj(BH);AH("link")}}function Bq(){AB("spf");var BI=B.value.search(/\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.tif|\.tiff/i)!==-1,BH=(B.files&&B.files[0].fileSize)?(B.files[0].fileSize<(1024*1000*5)):true;if(!BI){AN.html(MySpaceRes.HomeDisplayV3.SuperPost_PhotoFileType);return}else{if(!BH){AN.html(MySpaceRes.HomeDisplayV3.SuperPost_PhotoFileSize);return}}AN.html("");window.onSuperPostUploadComplete=function(BL){if(BL.error){AN.html(BL.error)}else{C.attr("src",BL.url);BG=BL.id;Ba=false;Bg.addClass("uploadedPhoto");AB("puc")}Bg.removeClass("uploadingPhoto");window.onSuperPostUploadComplete=null};var BK=B.form,BJ=function(){if(window.onSuperPostUploadComplete){onSuperPostUploadComplete({error:MySpaceRes.HomeDisplayV3.SuperPost_UploadPhotoError})}};A7.find("#superpostUpload").bind("load error",BJ);BK.setAttribute("action",a.uploadUrl+"&media_type=StreamPhoto&redirect="+encodeURIComponent("http://"+document.location.hostname+"/modules/common/pages/superpost/uploadresponse.aspx?type=photo"));BK.setAttribute("target","superpostUpload");BK.submit();Bg.addClass("uploadingPhoto")}function c(){AB("svf");var BJ=new RegExp(a.videoExtensions.replace(/\./g,"\\.").replace(/,/g,"|"),"i"),BI=z.value.search(BJ)!==-1,BH=(z.files&&z.files[0].fileSize)?(z.files[0].fileSize<(1024*1000*500)):true;if(!BI){Bw.html(String.format(MySpaceRes.HomeDisplayV3.SuperPost_VideoFileType,a.videoExtensions.replace(/,/g,", ")));return}else{if(!BH){Bw.html(MySpaceRes.HomeDisplayV3.SuperPost_VideoFileSize);return}}Bw.html("");Bg.addClass("uploadingVideo")}function b(BH){AX=BH||BB;Bp.css("background-image",String.format("url('{0}')",BH))}function AI(BJ){if(e){D.hide()}else{if(!D){if(document.body.className.indexOf("ie7")>=0){var BI=M.find(".spMood:first").outerWidth(true)+M.find(".moodCombo:first").outerWidth(true)+24;var BH=M.find(".smileySelector:first").outerHeight();D=Bg.find(".smileyPalette:first").show().css({left:BI,top:BH,"z-index":1000}).smileySelector({smileyData:Am.smileys}).bind("smileyselectorpick",f)}else{D=Bg.find(".smileyPalette:first").show().position({my:"left top",at:"left bottom",of:J[0]}).css("z-index",1000).smileySelector({smileyData:Am.smileys}).bind("smileyselectorpick",f)}A(document).mousedown(function(BK){if(!e||A.contains(D[0],BK.target)||D[0]==BK.target){return}D.hide();e=false})}D.show().focus()}e=!e}function f(BH,BJ){var BI=BJ.url;D.hide();e=false;b(BI);if(BI!=BB){AB("se",BJ.isSponsored?{setype:q(BI)}:null)}}function q(BH){return BH.substring(BH.lastIndexOf("/")+1,BH.lastIndexOf("."))}function Bt(){if(A8.val()){AB("sm")}}function AL(){var BH={videoAutoplay:true,readOnlyTitle:BF.titleDisabled=="True",readOnlyDescription:BF.descriptionDisabled=="True"};Ab=$create(MySpace.UI.LinkPreviewer,BH,null,null,AM.find(".moviePreviewer:first")[0]);Ab.previewUrl(BF.videoPage,BF.title,BF.description,function(){Ab=null})}function m(){if(!BF){return}if(!Ab){AL()}else{Ab.playVideo()}if(BF.statusText){A2.set_value(BF.statusText)}if(BF.statusDisabled=="True"){Aw.attr("readonly",true)}}function Z(BH){BH.preventDefault();A2.set_value("");Aj()}function AC(BI){if(BI){BI.preventDefault()}var BH=P.get_value();if(BH){A.ajax({url:String.format(Aa,"GetMusicContent"),success:Bm,data:{hash:Al,query:BH},context:{query:BH,mode:0}});Bc.find(".songPreviewer:first").addClass("searching");Bn()}}function Ar(BK){BK.preventDefault();var BI=Bc.find(".musicMenu:first").data("selectedTab");var BH=G(BI);var BJ=BH.data("query");if(!Bf(BH)){A.ajax({url:String.format(Aa,"GetMusicContent"),success:Bm,data:{hash:Al,query:BJ,pageNumber:BH.data("pageNumber")+1,type:BI},context:{query:BJ,mode:1}});Bc.find(".songPreviewer:first").addClass("searching")}}function Bh(BJ){BJ.preventDefault();var BI=Bc.find(".musicMenu:first").data("selectedTab");var BH=G(BI);Bv(BH)}function AV(BM){BM.preventDefault();BA();var BK=BM.target;BK=BK.tagName!="A"?BK.parentNode:BK;var BJ=BK.className.split(" ")[0];var BH=A(BK.parentNode);var BN=BH.data("selectedTab");if(BJ!=BN){var BL=G(BJ);Bc.find(".songPreviewer:first").removeClass(BN).addClass(BJ);A(BK).addClass("selected");BH.find("."+BN).removeClass("selected");BH.data("selectedTab",BJ);var BI=BL.data("pageNumber");Bc.find(".nav .prev").css("display",BI==1?"none":"inline");Bc.find(".nav .next").css("display",BI==Math.ceil(BL.count/BL.pageSize)?"none":"inline")}}function G(BI){var BH=BI=="videos"?".videoList":BI=="albums"?".albumList":".songList";return Bc.find(BH)}function Bm(Ca){var BN;try{BN=JSON.parse(Ca)}catch(B4){}var BJ=this;var BM=BJ.query;var BT=BJ.mode;var B0=Bc.find(".songPreviewer:first");B0.removeClass("searching");var BH=Bc.find(".musicMenu:first");var BI=Bc.find(".songs:first");var Cb=Bc.find(".videos:first");var BR=Bc.find(".albums:first");var BQ=Bc.find(".nav .next");var B7=Bc.find(".nav .prev");var BU=totalPageNumber=0;if(BN){if(BN.songs&&BN.songs.results&&BN.songs.results.length>0){var B6=BN.songs;var BY=B0.find(".songList:first");var BO=Bd(BY,BM,B6);for(var B2=0;B2<B6.results.length;B2++){var BX=B6.results[B2];var B1=BX.songId;var B5=BX.albumId;var BP=l("spMusicItem");A("<a/>",{className:"samplePlay",title:MySpaceRes.MyPlaylistsControl.PlaySample}).click(Au).appendTo(BP).data("_orgTitle",MySpaceRes.MyPlaylistsControl.PlaySample);A("<span/>").text(BX.name+" "+BX.duration).bind("mouseover",BE).bind("mouseout",j).appendTo(BP);BP.data("dataObject",BX);BO.append(BP)}BY.append(BO);BI.show();BI.find("span:first").html("("+BN.songs.count+")");BU=BN.songs.pageNumber;totalPageNumber=BN.songs.count/BN.songs.pageSize;if(BT==0){B0.addClass("songs");BI.addClass("selected");BH.data("selectedTab","songs")}}if(BN.videos&&BN.videos.results&&BN.videos.results.length>0){var B3=BN.videos;var BK=B0.find(".videoList:first");var BW=Bd(BK,BM,B3);for(var B2=0;B2<BN.videos.results.length;B2++){var BS=BN.videos.results[B2];var BP=l("spMusicVideoItem");if(B2%2==0){BP.addClass("odd")}A("<img/>",{id:BS.videoId,src:BS.thumbnail}).click(AQ).appendTo(BP);BP.append("<br/>");A("<span/>").text(BS.name||"").appendTo(BP);BP.append("<br/>").append(MySpaceRes.SiteSearch.By+": "+BS.artistName).append("<br/>").append(BS.matchesOn).data("dataObject","videoObj");BW.append(BP)}BK.append(BW);Cb.show();Cb.find("span:first").html("("+BN.videos.count+")");if(BU==0){BU=BN.videos.pageNumber;totalPageNumber=BN.videos.count/BN.videos.pageSize;if(BT==0){BH.data("selectedTab","videos");B0.addClass("videos");Cb.addClass("selected")}}}if(BN.albums&&BN.albums.results&&BN.albums.results.length>0){var BV=BN.albums;var BL=B0.find(".albumList:first");var B8=Bd(BL,BM,BV);for(var B2=0;B2<BV.results.length;B2++){var BZ=BV.results[B2];var B9=l("spMusicAlbumItem");A("<img/>",{src:BZ.smallThumbNail}).appendTo(B9);A("<div/>").text(BZ.name||"").append("<br/>").append(MySpaceRes.SiteSearch.By+": "+BZ.artistName).append("<br/>").append(BZ.matchesOn).appendTo(B9);B9.data("dataObject",BZ);B8.append(B9)}BL.append(B8);BR.show();BR.find("span:first").html("("+BV.count+")");if(BU==0){BU=BV.pageNumber;totalPageNumber=BV.count/BV.pageSize;if(BT==0){BH.data("selectedTab","albums");B0.addClass("albums");BR.addClass("selected")}}}if(BU>0){BH.show();if(BU<totalPageNumber){BQ.show()}else{BQ.hide()}if(BU>1){B7.show()}}g(true)}}function Bd(BH,BI,BJ){BH.data({query:BI,count:BJ.count,pageSize:BJ.pageSize,pageNumber:BJ.pageNumber});return A("<ul/>").addClass("page"+BJ.pageNumber)}function l(BH){return A("<li/>").append(A("<input/>",{type:"radio",name:BH}))}function Bn(){var BH=Bc.find(".musicMenu:first");BH.hide();BH.data("selectedTab",null);BH.find("a").removeClass("selected").hide();var BI=Bc.find(".songPreviewer:first").removeClass("songs videos albums");BI.find(".songList:first").add(".videoList:first").add(".albumList:first").html("");Bc.find(".nav .next").add(".nav .prev").hide();BA()}function BE(BL){var BI=BL.target;var BK=BI.tooltipContent;if(!BK){var BH=A(BI.parentNode).data("dataObject");var BM=A("<div/>",{"class":"musicTooltip"}).append(A("<img/>",{src:BH.thumbnail}));A("<p/>").text(BH.name||"").append("<br/>").append(MySpaceRes.SiteSearch.By+": "+BH.artistName).append("<br/>").append(MySpaceRes.SiteSearch.AlbumLower+": "+BH.albumName).append("<br/>").append("<br/>").append(BH.matchesOn).appendTo(BM);BK=BI.tooltipContent=BM[0]}var BJ=Bc.data("tooltipObj");if(!BJ){BJ=$create(MySpace.UI.Tooltip,{container:Bc[0],cssClass:"sptooltipdiv"},null,null,document.createElement("span"));Bc.data("tooltipObj",BJ)}BJ._element=BI;BJ.set_content(BK);BJ._delayedShow()}function j(BI){var BH=BI.target;if(Bc.data("tooltipObj")){Bc.data("tooltipObj")._delayedHide()}}function AQ(BH){I(BH.target.id,Bc.find(".songPreviewer:first"))}function Bu(BH){if(BH){BH.preventDefault()}Bz(Bc.find(".songPreviewer:first"))}function A4(BH){if(BH){BH.preventDefault()}Bc.find(".songPreviewer").removeClass("searchLinkPreviewer");g(true);if(Ak){Ak.reset()}}function BA(BH){Bu(BH);A4(BH);Af()}function Ax(){swfobject.embedSWF(a.musicPlayerUrl,"spMusicPlayerObj",1,1,a.musicPlayerVersion,null,null,{allowscriptaccess:"always",wmode:"transparent"},null);window.MySpaceMusic=window.MySpaceMusic||{};window.MySpaceMusic.onStop=function(){Az.removeClass("pauseButton").data("isPlaying",false).attr("title",Az.data("_orgTitle"))};Ai=document.getElementById("spMusicPlayerObj")}function Au(BJ){var BI=BJ.target;var BH=A(BI.parentNode).data("dataObject");if(!Ai||!Ai.playSong){return}if(Az&&BI==Az[0]&&(Az.data("isPlaying")||Az.data("isPaused"))){if(Az.data("isPlaying")){Ai.pauseCurrentTrack();Az.data("isPaused",true).removeClass("pauseButton").attr("title",Az.data("_orgTitle"))}else{Ai.playCurrentTrack();Az.data("isPlaying",true).data("isPaused",false).addClass("pauseButton").attr("title",MySpaceRes.MyPlaylistsControl.PauseSong)}}else{Af();Ai.playSong(BH.songId,null,BH.albumId,null,true,true);Az=A(BI).data("isPlaying",true).addClass("pauseButton").attr("title",MySpaceRes.MyPlaylistsControl.PauseSong)}}function Af(){if(Az){if(Az.data("isPlaying")){Ai.pauseCurrentTrack()}Az.removeClass("pauseButton").attr("title",Az.data("_orgTitle")).data("isPlaying",null).data("isPaused",null)}}function AR(BI){BI.preventDefault();var BH=X.val();if(BH){A.ajax({url:String.format(Aa,"GetVideoContent"),success:d,data:{hash:Al,query:BH},context:{query:BH}});S();Br.find(".videoPreviewer:first").addClass("searching")}}function d(BP){var BJ;try{BJ=JSON.parse(BP)}catch(BQ){}var BK=Br.find(".videoPreviewer:first").removeClass("searching");if(!BJ){return}var BR=this;var BS=BR.query;if(BJ.results&&BJ.results.length>0){var BM=BK.find(".videoList:first");var BT=Bd(BM,BS,BJ);for(var BO=0;BO<BJ.results.length;BO++){var BL=BJ.results[BO];var BH=l("spVideoItem");if(BO%2==0){BH.addClass("odd")}A("<img/>",{id:BL.videoId,src:BL.thumbnail}).click(Bl).appendTo(BH);BH.append("<br/>").append(A("<span/>",{text:BL.name||""})).append("<br/>").append(MySpaceRes.SiteSearch.By+": "+BL.artistName).append("<br/>").append(BL.matchesOn);BH.data("dataObject",BL);BT.append(BH)}BM.append(BT);BK.find(".videoMenu:first").html("( "+BJ.count+" )");var BI=BJ.count/BJ.pageSize;if(BJ.pageNumber>0){var BN=BK.find(".nav .next");var BU=BK.find(".nav .prev");if(BJ.pageNumber<BI){BN.show()}else{BN.hide()}if(BJ.pageNumber>1){BN.show()}}g(true)}}function A6(BJ){BJ.preventDefault();var BH=Br.find(".videoList:first");var BI=BH.data("query");if(!Bf(BH)){A.ajax({url:String.format(Aa,"GetVideoContent"),success:d,data:{hash:Al,query:BI,pageNumber:BH.data("pageNumber")+1},context:{query:BI}});Br.find(".videoPreviewer:first").addClass("searching")}}function N(BH){BH.preventDefault();Bv(Br.find(".videoList:first"))}function Bl(BH){I(BH.target.id,Br.find(".videoPreviewer:first"))}function Bo(BH){if(BH){BH.preventDefault()}Bz(Br.find(".videoPreviewer:first"))}function By(BH){if(BH){BH.preventDefault()}Br.find(".videoPreviewer:first").removeClass("searchLinkPreviewer");g(true);if(AO){AO.reset()}}function K(BH){Bo(BH);By(BH)}function S(){var BH=Br.find(".videoPreviewer:first");BH.find(".videoList").add(".videoMenu").html("");BH.find(".nav .next").add(".nav .prev").hide();K()}function Bf(BJ){var BK=BJ.data("pageNumber");BJ.find(".page"+BK).hide();++BK;var BI=BJ.find(".page"+BK);if(BI[0]){BI.show();BJ.data("pageNumber")=BK;var BH=BJ.parent();BH.find(".nav .prev").show();if(BK==Math.ceil(BJ.data("count")/BJ.data("pageSize"))){BH.find(".nav .next").hide()}return true}return false}function Bv(BI){var BJ=BI.data("pageNumber");BI.find(".page"+BJ).hide();--BJ;BI.find(".page"+BJ).show();BI.data("pageNumber",BJ);var BH=BI.parent();BH.find(".nav .next").show();if(BJ==1){BH.find(".nav .prev").hide()}}function T(BN){BN.preventDefault();if(AE==U){var BI=Bc.find(".musicMenu:first").data("selectedTab");var BM=G(BI);var BL=BM.find("input:checked");if(BL.length<=0){return}if(!Ak){Ak=$create(MySpace.UI.LinkPreviewer,null,null,null,Bc.find(".details:first").children()[1])}var BO=BL.parent().data("dataObject");if(!BO){return}var BK={};BK.title=BO.name?BO.name:"";BK.attribution=BO.artistName?BO.artistName:"";if(BI=="videos"){BK.description=BO.description}else{if(BI=="albums"){BK.title+=" "+MySpaceRes.SiteSearch.By+" "+BO.artistName;BK.description=String.format(MySpaceRes.ArtistAlbums.AddThisMetaTagDesc2,BO.name,BO.artistName);BK.attribution=""}else{BK.description=BO.albumName}}BK.domain="myspace.com";BK.contentType=BO.contentType;BK.images=[BO.thumbnail];BK.url=BO.url;BK.favicon="http://www.myspace.com/favicon.ico";BK.mediaType=BO.mediaType;BK.mediaUrl=BO.mediaUrl?BO.mediaUrl:"";BK.mediaHeight=BO.mediaHeight?BO.mediaHeight:0;BK.mediaWidth=BO.mediaWidth?BO.mediaWidth:0;Bc.find(".songPreviewer:first").addClass("searchLinkPreviewer");g(false);Af();Ak.previewUrlWithData(BO.url,BK)}else{if(AE==Ah){var BH=Br.find(".videoPreviewer:first");var BL=BH.find("input:checked");if(BL.length<=0){return}var BJ=BL.parent().data("dataObject");if(!BJ){return}if(!AO){AO=$create(MySpace.UI.LinkPreviewer,null,null,null,Br.find(".details:first").children()[1])}var BK={title:BJ.name?BJ.name:"",attribution:BJ.artistName?BJ.artistName:"",description:BJ.description,domain:"myspace.com",contentType:BJ.contentType,images:[BJ.thumbnail],url:BJ.url,favicon:"http://www.myspace.com/favicon.ico",mediaType:BJ.mediaType,mediaUrl:BJ.mediaUrl?BJ.mediaUrl:"",mediaHeight:BJ.mediaHeight?BJ.mediaHeight:0,mediaWidth:BJ.mediaWidth?BJ.mediaWidth:0};BH.addClass("searchLinkPreviewer");g(false);AO.previewUrlWithData(BJ.url,BK)}}}function g(BI){if(typeof(BI)==="undefined"){if(AE==U){var BH=Bc.find(".musicMenu:first")[0];BI=BH&&(BH.style.display!="none")}else{if(AE==Ah){BI=Br.find(".videoList:first input:first")[0]?true:false}}}R.css("display",BI?"none":"");Bk.css("display",BI?"block":"none")}function I(BL,BH){BH.addClass("playingVideo");var BK=BH.find(".videoPlayer:first");var BI=BK.outerWidth();var BM={defWidth:BI,mediaType:"video",height:250,width:BI,videoId:BL,target:document.createElement("span")};var BJ=$create(MySpace.UI._InlineVideo,BM,null,null,BK.children(":first")[0]);BJ._showVideoHandler()}function Bz(BH){var BI=BH.find(".videoPlayer:first");BI.find(".player:first").remove();BH.removeClass("playingVideo")}function Ao(BI){if(Bx()>=140){var BH=BI.which;if(!BI.altKey&&!BI.ctrlKey&&BH>=32&&BH<=126){BI.preventDefault()}}}function L(BH){window.setTimeout(function(){if(Bx()>140){var BI=140;while(Bx(Aw.val().substring(0,BI))<140){BI++}Aw.val(Aw.val().substring(0,BI))}s=true},0)}function Bx(BH){return(BH||Aw.val()).replace(u,"http://lnk.ms/123456").length}function Q(){clearTimeout(A9);AD.innerHTML=(Bx()>=140)?MySpaceRes.HomeDisplayV3.SuperPost_MaxChars:"";if(!w&&A2.get_value()){w=true;AB("st")}if(AE==v){u.lastIndex=0;var BH=u.exec(Aw.val());if(BH&&!o[BH[0]]){var BI=Ac();if(s||BI<BH.index||BI>BH.index+BH[0].length){o[BH[0]]=true;AZ=true;O(BH[0]);AB("ald");h=true}}}s=false;R.toggleClass("disable",!BC());A9=setTimeout(Q,500)}function Ac(){var BJ=Aw[0];if("selectionStart" in BJ){return BJ.selectionStart}var BI=document.selection.createRange();if(!(BI&&BI.parentElement()==BJ)){return -1}var BH=BJ.createTextRange(),BK=BH.duplicate();BH.moveToBookmark(BI.getBookmark());BK.setEndPoint("EndToStart",BH);return BK.text.length}function AB(BJ,BK){if(Bb){var BI={type:"sp",action:BJ,v:"1"};if(BK){for(var BH in BK){BI[BH]=BK[BH]}}MySpace.Beacon.Request(BI)}}this.getData=A5;this.shareClick=At;this.shareCallback=null;this.reset=A3;Ay()})(A(this))})})(jQuery);(function(A){var B=A(".superPostModule .superShareContainer").data("superShare");if(B){B.shareCallback=function(C){if(C&&"html" in C){if(C.html){MySpace.UI.Stream.AddItems(C.html)}}}}})(jQuery);(function(){var C="",B=(MySpace.UI.BucketTesting)?MySpace.UI.BucketTesting.Tests:[];if(!B||B.length==0){return}for(var A=0;A<B.length;A++){C+=((C.length===0)?"":",")+B[A].testid+"_"+B[A].bucketid}if(!MySpace.AdditionalPageBeaconKVPs){MySpace.AdditionalPageBeaconKVPs={}}MySpace.AdditionalPageBeaconKVPs.abtest=C})();Type.registerNamespace("MySpace.UI.Home.Events");MySpace.UI.Home.Events.Initialize=function(){var B=$q(".recommendedEventsModule .event");for(var A=0;A<B.length;++A){MySpace.UI.Home.Events.WireEventNode(B[A])}};MySpace.UI.Home.Events.ViewedEvents=new Array();MySpace.UI.Home.Events.WireEventNode=function(B){var C=$q("input[name=eventId]",B,true);var A=C?C.value:-1;MySpace.UI.Home.Events.ViewedEvents.push(A);MySpace.UI.Home.Events.WireRsvpControls(B,A);MySpace.UI.Home.Events.WireIgnoreEvent(B,A);MySpace.UI.Home.Events.WireClickTracking(B,A)};MySpace.UI.Home.Events.RsvpToEvent=function(A,E){var B=MySpace.UI.Home.Events.RsvpUrl;var C=MySpace.UI.Home.Events.RsvpHash;var D={event_id:A,rsvp_status:E,hash:C,method:"post"};MySpace.Net.JsonpWebServiceProxy.invoke(B,D)};MySpace.UI.Home.Events.SetRsvpCss=function(A,B){Sys.UI.DomElement.removeCssClass(A,"yes");Sys.UI.DomElement.removeCssClass(A,"maybe");Sys.UI.DomElement.removeCssClass(A,"no");Sys.UI.DomElement.removeCssClass(A,"noresponse");Sys.UI.DomElement.addCssClass(A,B)};MySpace.UI.Home.Events.OnRsvpClick=function(B,A,D,C){MySpace.UI.Home.Events.RsvpToEvent(A,D);MySpace.UI.Home.Events.SetRsvpCss(B,C)};MySpace.UI.Home.Events.WireRsvpControls=function(D,C){var B=$q(".rsvp",D,true);if(B){var A;A=$q(".yes",B,true);if(A){$addHandler(A,"click",function(G){MySpace.UI.Home.Events.OnRsvpClick(G.target.parentNode,C,MySpace.UI.Home.Events.RsvpStatus.Yes,"yes");var E=$q(".rsvp-going",D,true);var F=$q("span",E,true);if(F){F.innerHTML=parseInt(F.innerHTML)+1}G.preventDefault()})}A=$q(".maybe",B,true);if(A){$addHandler(A,"click",function(E){MySpace.UI.Home.Events.OnRsvpClick(E.target.parentNode,C,MySpace.UI.Home.Events.RsvpStatus.Maybe,"maybe");E.preventDefault()})}A=$q(".yes-change",B,true);if(A){$addHandler(A,"click",function(G){MySpace.UI.Home.Events.OnRsvpClick(G.target.parentNode,C,MySpace.UI.Home.Events.RsvpStatus.NoResponse,"noresponse");var E=$q(".rsvp-going",D,true);var F=$q("span",E,true);if(F){F.innerHTML=parseInt(F.innerHTML)-1}G.preventDefault()})}A=$q(".maybe-change",B,true);if(A){$addHandler(A,"click",function(E){MySpace.UI.Home.Events.OnRsvpClick(E.target.parentNode,C,MySpace.UI.Home.Events.RsvpStatus.NoResponse,"noresponse");E.preventDefault()})}}};MySpace.UI.Home.Events.OnGetNextEventSuccess=function(A,B){var D=A.get_webRequest().get_userContext();var C=A.get_responseData();if(C!==" "){D.innerHTML=C;MySpace.UI.Home.Events.WireEventNode(D)}else{D.style.display="none"}};MySpace.UI.Home.Events.GetNextEvent=function(A){MySpace.UI.Pages.Data.request(String.format("GetNextRecommendedEvent.ashx?eventsToExclude={0}",MySpace.UI.Home.Events.ViewedEvents.join(",")),A,MySpace.UI.Home.Events.OnGetNextEventSuccess)};MySpace.UI.Home.Events.IgnoreEvent=function(C){var A=MySpace.UI.Home.Events.IgnoreUrl;var D=MySpace.UI.Home.Events.IgnoreHash;var B=$q("input[name=eventId]",C,true).value;var E={event_id:B,hash:D,method:"post"};MySpace.Net.JsonpWebServiceProxy.invoke(A,E)};MySpace.UI.Home.Events.WireIgnoreEvent=function(B,A){var C=$q(".event-options .ignore",B,true);if(C){$addHandler(C,"click",function(D){MySpace.UI.Home.Events.IgnoreEvent(B,A);MySpace.UI.Home.Events.GetNextEvent(B)})}};MySpace.UI.Home.Events.WireClickTracking=function(G,A){var E=MySpace.ClientContext.UserId;var C=$q(".details a.summary",G,true);if(C){$addHandler(C,"click",function(J){MySpace.Beacon.Request({et:"events",em:"click",ec:"uhp_event_title",eid:A,uid:E,ip:""})})}var I=$q("aside a",G,true);if(I){$addHandler(I,"click",function(J){MySpace.Beacon.Request({et:"events",em:"click",ec:"uhp_event_image",eid:A,uid:E,ip:""})})}var B=$q(".goingCount",G,true);if(B){$addHandler(B,"click",function(J){MySpace.Beacon.Request({et:"events",em:"click",ec:"uhp_event_going_count",eid:A,uid:E,ip:""})})}var F=$q(".rsvp .yes",G,true);if(F){$addHandler(F,"click",function(J){MySpace.Beacon.Request({et:"events",em:"click",ec:"uhp_rsvp_yes",eid:A,uid:E,ip:""})})}var D=$q(".rsvp .maybe",G,true);if(D){$addHandler(D,"click",function(J){MySpace.Beacon.Request({et:"events",em:"click",ec:"uhp_maybe_link",eid:A,uid:E,ip:""})})}var H=$q(".details .sponsor a",G,true);if(H){$addHandler(H,"click",function(J){MySpace.Beacon.Request({et:"events",em:"click",ec:"uhp_sponsor_logo",eid:A,uid:E,ip:""})})}};MySpace.UI.Home.Events.Initialize();(function(F){if(!MySpace.UI.Home.InviteFriends){return}var K,G,H,B,N,J;var M,I=false;var A=MySpace.UI.Home.InviteFriends.config;var D=/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})$/;var C=null;var L={yahoo:1,windowslivehotmail:2,windowslivemessenger:3};if(!A){return}function O(){var P=F(".inviteFriendsModule:first");K=P.find("input[name='login']").blur(E);G=P.find("input[name='$login']");B=P.find("input[name='$ddlCarrier']");H=P.find(".password");N=P.find(".providerLogo");J=P.find(".info");if(K.val()){E()}P.find("button:first").click(function(T){var R=F.trim(K.val());if(R){G.val(D.test(R)?R.substring(0,R.indexOf("@")):R);var Q=P.find("form:first");var S=B.val();S=S.substring(0,S.indexOf("#"));if(S){if(L[S]){Q.attr("action",Q.attr("action").replace("invite.login","invite.abinvite"))}Q.attr("action",Q.attr("action")+"&carrier="+S)}P.find("form:first").submit()}})}function E(W){if(M){clearTimeout(M)}var X=F.trim(K.val());if(!X){return}var Y="",a="";if(D.test(X)){var S=X.substring(X.indexOf("@")+1).toLowerCase();if(S){if(C){var P=C[S];if(P){Y=P.provider+"#"+S;a=P.imgSrc}}else{var Q=false;C={};for(var T=0;T<A.length;T++){var U=A[T];if(U.name=="AIM"){I=true}for(var R=0;R<U.extensions.length;R++){var Z=U.extensions[R];C[Z]={provider:U.name,imgSrc:U.imgSrc};if(!Q&&Z.indexOf(S)>=0){Q=true;Y=U.name+"#"+S;a=U.imgSrc}}}}}}else{if(I){Y="AIM"}else{Y=""}}B.val(Y);N.html(a?"<img src='"+a+"'></img>":"");var V=Y.substring(0,Y.indexOf("#"));if(Y=="AIM"||(V&&!L[V])){H.show();J.show();if(W){W.preventDefault();H.find("input").focus()}}else{H.hide().val("");J.hide()}}O()})(jQuery);(function(C){var A=C(".optInUHP");var D=C(".downgradeUHP");var H=C(".dismissMessage");A.bind("click",G);D.bind("click",I);H.bind("click",F);function G(K){var J=C(this).parent();J.find("a:first").before(E("s"));J.find("a").fadeOut("fast");MySpace.UI.Pages.Data.request("UpgradeTwoColumn.ashx",null,B,null,null);K.preventDefault()}function I(J){C(this).unbind("click").replaceWith(E("s"));MySpace.UI.Pages.Data.request("DowngradeHome.ashx",null,B,null,null);J.preventDefault()}function F(){if(MySpace.Cookies){var J=new Date();MySpace.Cookies.save(new MySpace.Cookie("MSUHPOptIn","d="+J.toUTCString()),".myspace.com",J.addDays(7))}C(".optInMessagingModule").animate({opacity:0},function(){C(this).slideToggle("fast",function(){C(this).remove()})})}function E(J){return String.format('<img class="loadingImg" src="{0}/modules/common/static/img/loadercircles{1}.gif" alt="{2}" />',MySpace.StaticContentBase,(J=="s"?"-15":""),MySpaceRes.HomeDisplayV3.Loading)}function B(){setTimeout(function(){window.location=window.location},2000)}})(jQuery);(function(A){MySpace.UI.Pages=MySpace.UI.Pages||{};MySpace.UI.Pages.Home=MySpace.UI.Pages.Home||{};MySpace.UI.Pages.Home.wireRedux=function(){A(".activityStreamModule .reduxPlay").click(function(){var F=A(this);var E=F.data("loaded");var C=A(".activityStreamModule .reduxPlayerContainer");if(!E){var B,D;C.addClass("invoking").slideDown("slow",function(){D=true;if(B){A(this).removeClass("invoking").html(C.data("flash"))}});F.toggleClass("playing");A.ajax({url:"/Modules/PageEditor/Handlers/Home/GetReduxObjectHtml.ashx",success:function(G){if(G){F.data("loaded","true");B=true;C.data("flash",G);if(D){C.html(G).removeClass("invoking")}}},data:{height:710,width:C.parent().width(),hash:MySpace.UI.Pages.HashMashter},type:"POST"})}else{if(E=="true"){C.empty().slideUp("slow",function(){F.toggleClass("playing")});F.data("loaded","false")}else{C.slideDown("slow",function(){A(this).html(C.data("flash"))});F.data("loaded","true").toggleClass("playing")}}})}})(jQuery);
