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))};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();(function(A){MySpace._GenericCommentsControls&&A.each(MySpace._GenericCommentsControls,function(){var L=this,H=L.maxEntries+1,C=A("#genericComments"+L.uniqueId),K=A("ul.moduleList",C),B=A("a.moreComments",C);L.pagingContext.CurrentPageNumber=1;B.click(F);C.delegate(".deleteComment","click",D);C.delegate(".markSpam","click",M);A(document).bind("quickPost.posted",E);function F(N){N.preventDefault();L.pagingContext.CurrentPageNumber++;I("RenderComments",{startIndex:H,maxEntries:L.maxEntries,pagingContext:L.pagingContext},G)}function G(N){var O=A(N.html);K.append(O);H+=L.maxEntries;L.pagingContext.ReferringPageNumber++;L.pagingContext.FirstRecordInPreviousPage=O[0].id.split("_")[5];L.pagingContext.LastRecordInPreviousPage=O[O.length-1].id.split("_")[5];L.totalComments=N.totalComments;J()}function M(N){N.preventDefault();var P=A(this).parents(".moduleList > li"),O=P.attr("id").split("_");I("FlagSpamComment",{commentId:O[5],authorId:O[6]},function(){var Q=P.html();var R=A("<div class='markspamConfirmation'></div>");R.append(L.spamCommentConfirmationText);P.empty();P.append(R);setTimeout(function(){P.empty();P.append(Q);R=null},5000)})}function D(N){N.preventDefault();if(!confirm(MySpaceRes.UserPage.AreYouSureYouWantToDeleteComment)){return}var P=A(this).parents(".moduleList > li"),O=P.attr("id").split("_");I("DeleteComment",{commentId:O[5],authorId:O[6]},function(){P.remove();L.totalComments--;J()})}function E(N,P){if(!(L.commentType==P.commentType&&L.ownerId==P.ownerId&&L.resourceId==P.resourceId&&(!L.extendedResourceId||L.extendedResourceId==P.extendedResourceId)&&(!L.videoReleaseId||L.videoReleaseId==P.videoReleaseId))){return}var O=A('<div class="userComment">').append(A("<div>",{"class":"autoResize comment",html:P.result.comment})).append(A("<p>",{"class":"datePosted",html:P.result.postedDate})).append('<div class="clear">');A('<li class="odd">').append(A("<div>",{"class":"user",html:P.result.profileImageLink})).append(O).prependTo(K);L.totalComments++;J()}function J(){A("> li:odd",K).filter(".odd").removeClass("odd").addClass("even");A("> li:even",K).filter(".even").removeClass("even").addClass("odd");A("> li.last",K).removeClass("last");A("> li:last",K).addClass("last");var N=A("> li",K).length;A("span.cnt",B).text(String.format("{0} of {1}",N,L.totalComments));B.css("display",N<L.totalComments?"":"none")}function I(N,O,Q){var P={commentType:L.commentType,ownerId:L.ownerId,resourceId:L.resourceId,extendedResourceId:L.extendedResourceId,videoReleaseId:L.videoReleaseId};A.extend(P,O);MySpace.Net.asmx({servicePath:"/Modules/Common/Services/GenericComments.asmx",methodName:N,params:P,onSuccess:Q,onFailure:function(){alert(MySpaceRes.Header.ErrorMessage.replace(/<br[^>]*>/ig,"\n"))}})}Type.registerNamespace("MySpace.UI.Comments");MySpace.UI.Comments.reload=function(O){K.empty();A.extend(L,O);H=L.maxEntries+1;I("RenderComments",{startIndex:1,maxEntries:L.maxEntries,pagingContext:L.pagingContext},G);var N=MySpace._GenericCommentsQP["qp"+L.uniqueId];N.reset();N.set_webServiceParams({commentType:O.commentType,ownerId:O.ownerId,resourceId:O.resourceId,extendedResourceId:O.extendedResourceId,videoReleaseId:O.videoReleaseId})}})})(jQuery);(function(B){B("a.addComment").click(MySpace.UI.ProfileCommentQuickPostPopup.show);var A=$q("li.suggestFriend a");if(A.length>0){A[0].style.visibility="visible";$addHandler(A[0],"click",function(C){if(!C.target.popper){var D=new MySpace.UI.Popup.IFrameContent(A[0].innerHTML,784,A[0].href,"friendSuggestionPopupContainer");window.friendSuggestionPopup=D.get_popup();C.target.popper=D;D.show()}else{C.target.popper.show()}if(C.preventDefault){C.preventDefault()}else{C.returnValue=false}})}})(jQuery);Sys.Application.add_init(function(){if(!MySpace.Application.keyDisabled("DWBeaconAppClicks")){}});Type.registerNamespace("MySpace.UI.Profiles.Stream");MySpace.UI.Profiles.Stream.SetInlineVideoDefaultWidth=function(){var A=$q(".activityStreamModule,.activityMedia",null,true);if(A){var B=MySpace.UI.getContentBox(A);if(B.w<=0&&Sys.Browser.agent==Sys.Browser.InternetExplorer){B.w=A.offsetWidth-18}MySpace.UI.InlineVideoMetadata.DefaultWidth=B.w||MySpace.UI.InlineVideoMetadata.DefaultWidth}};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.showStreamUpdates));D.showUpdateCount(D._updateCount>0)}}}catch(E){}},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"&&MySpace.UI._InlineVideo){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).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};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(14);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(A){Type.registerNamespace("MySpace.Bunchball.Nitro");MySpace.Bunchball.Nitro.MakeApiCall=function(F,D,E,C){if(!this.initialized){this.Initialize()}if(C&&!this.ConnectionInfo.SessionKey){if(this.retryTries>0){this.retryTries--;var B=this;setTimeout(function(){B.MakeApiCall(F,D,E,C)},this.retryInterval)}return}D.sessionKey=this.ConnectionInfo.SessionKey;D.method=F;A.ajax({type:"GET",url:this.ConnectionInfo.Server,data:D,dataType:"jsonp",jsonp:"jsCallback",success:function(G){if(G.Nitro.res==="ok"){E(G.Nitro)}}})};MySpace.Bunchball.Nitro.GetBadges=function(B,D){var C=this;this.MakeApiCall("user.getChallengeProgress",{userId:B},function(F){if(D){var E=C.CreateBadgeListFromNitroResponse(F);D(E)}},true)};MySpace.Bunchball.Nitro.GetRecentBadges=function(C,B,D){this.GetBadges(C,function(F){if(D){var G=new Array();A.each(F,function(I,H){if(H.IsAchieved){G.push(H)}});var E=G.sort(function(I,H){return I.CompletionTime<H.CompletionTime});E.splice(B);D(E)}})};MySpace.Bunchball.Nitro.GetNextSuggestedBadge=function(B,D){var C=this;this.MakeApiCall("user.getNextChallenge",{userId:B},function(F){if(D){var E=C.CreateBadgeListFromNitroResponse(F);D(E[0])}},true)};MySpace.Bunchball.Nitro.CreateBadgeListFromNitroResponse=function(D){var C=new Array();if(D.challenges!==true){var B=(typeof D.challenges.Challenge[0]==="undefined")?D.challenges:D.challenges.Challenge;A.each(B,function(E,F){var G=F.dateCompleted?new Date(F.dateCompleted*1000):null;C.push({Name:F.name,Description:F.description,IsAchieved:F.completionCount>0,IsLimitedEdition:F.endTime>0,ThumbUrl:F.thumbUrl,FullUrl:F.fullUrl,IconUrl:F.iconUrl,LockedUrl:F.customData,CompletionTime:G})})}return C};MySpace.Bunchball.Nitro.Initialize=function(){if(!this.initialized){this.initialized=true;this.retryInterval=100;this.retryTries=100;var B=this;this.MakeApiCall("user.login",{apiKey:this.ConnectionInfo.ApiKey,ts:this.ConnectionInfo.Timestamp,sig:this.ConnectionInfo.Signature,userId:this.ConnectionInfo.UserId},function(C){B.ConnectionInfo.SessionKey=C.Login.sessionKey})}}})(jQuery);(function(A){Type.registerNamespace("MySpace.UI.Profiles.Reputation.RecentBadges");MySpace.UI.Profiles.Reputation.RecentBadges.Initialize=function(){function B(I,H){var K=A(".latestBadge",I);A("img",K).attr("src",H.ThumbUrl).attr("alt",H.Name);var G=String.format(MySpace.UI.Profiles.Reputation.Resources.BadgeUrlFormat,encodeURIComponent(H.Name));A(".name a",K).attr("href",G).text(H.Name);A(".description",K).html(H.Description);var J=E(H);A(".completionTimestamp",K).text(J)}function D(H,G){A(".numBadgesAchieved a",H).text(G)}function F(G,O){if(O.length>0){var N=A(".reputationActivity ul",G);for(var J=0;J<O.length;++J){var M=O[J];var I=String.format(MySpace.UI.Profiles.Reputation.Resources.BadgeUrlFormat,encodeURIComponent(M.Name));var L=String.format('<a href="{0}">{1}</a>',I,M.Name);var H=String.format(MySpace.UI.Profiles.Reputation.Resources.BadgeActivity_RecievedBadge,L);var K=E(M);var P=A(String.format('<li class="activityItem clearfix"><img src="{0}" alt="{1}" /><ul class="info"><li class="headline">{2}</li><li class="completionTimestamp">{3}</li></ul></li>',M.IconUrl,M.Name,H,K));A("img",P).flyout({title:M.Name,content:M.Description,classes:"badgeTooltip",positions:"ur|ul"});N.append(P)}A(".reputationActivity",G).show()}}function C(I){var J=A(".recentBadgesModule");var H=I.length;if(H>0){D(J,H);var G=I.shift();B(J,G);F(J,I)}else{J.hide()}}function E(G){var I=new Date();var J=I-G.CompletionTime;var H=Math.floor(J/3600000);if(H>=24){return MySpace.UI.Profiles.Reputation.Resources.BadgeCompletedTimestamp_24HoursOrMore}else{if(H>1){return String.format(MySpace.UI.Profiles.Reputation.Resources.BadgeCompletedTimestamp_XHoursAgo,H)}else{if(H==1){return MySpace.UI.Profiles.Reputation.Resources.BadgeCompletedTimestamp_1HourAgo}else{return MySpace.UI.Profiles.Reputation.Resources.BadgeCompletedTimestamp_LessThan1HourAgo}}}}MySpace.Bunchball.Nitro.GetRecentBadges(MySpace.ClientContext.DisplayFriendId,100,C)}})(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})();
