MySpace.UI.ClientPager=function(A){MySpace.UI.ClientPager.initializeBase(this,[A]);this.currentPage=1;this.currentPageClusterPage=1;this.totalNumberOfPageClusters=1;this.highestPageInCluster=0;this.lowestPageInCluster=0};MySpace.UI.ClientPager.prototype={totalItems:0,itemsPerPage:10,pagesInCluster:5,enableBackButton:true,siblingPagerIds:null,dataPageUrl:null,dataPageParams:null,contentNode:null,ajaxLoadingGifUrl:null,ajaxLoadingText:MySpaceRes.ProfileEdit.EditorLoading,errorMessageText:MySpaceRes.AccountSettings.AnErrorOccurredPleaseTryAgain,XtoYofZText:MySpaceRes.Common.Listing,prevCluster:"&lsaquo;&lsaquo;",nextCluster:"&rsaquo;&rsaquo;",prevPage:"&lsaquo; "+MySpaceRes.Common.Prev,nextPage:MySpaceRes.Common.Next+" &rsaquo;",ofLabel:MySpaceRes.Common.OfNoSpaces,nextPageImageUrl:"",prevPageImageUrl:"",nextPageClusterImageUrl:"",prevPageClusterImageUrl:"",get_events:function(){if(!this._events){this._events=new Sys.EventHandlerList()}return this._events},add_pageChangeBegin:function(A){this.get_events().addHandler("onPageChangeBegin",A)},remove_pageChangeBegin:function(A){this.get_events().removeHandler("onPageChangeBegin",A)},add_pageChangeEnd:function(A){this.get_events().addHandler("onPageChangeEnd",A)},remove_pageChangeEnd:function(A){this.get_events().removeHandler("onPageChangeEnd",A)},_raisePagerEvent:function(B,A){var C=this.get_events().getHandler(B);if(C){if(!A){A=Sys.EventArgs.Empty}C(this,A)}},get_contentNode:function(){return this.contentNode},set_contentNode:function(A){this.contentNode=A},get_dataPageParams:function(){return this.dataPageParams},set_dataPageParams:function(A){this.dataPageParams=A},get_siblingPagerIds:function(){return this.siblingPagerIds},set_siblingPagerIds:function(A){this.siblingPagerIds=A},initialize:function(){MySpace.UI.ClientPager.callBaseMethod(this,"initialize");var D=this.get_element();Sys.UI.DomElement.addCssClass(D,"pagingContainer");D.innerHTML="";var B=Function.createDelegate(this,function(F,H){var G=document.createElement("div");G.className=F;this[H]=G;D.appendChild(G)});B("pagingLeft","XtoYofZNode");B("pagingLeft","errorNode");B("pagingLeft","loadingNode");B("pagingCenter","pageLinksNode");B("pagingRight","nextPrevNode");var C=document.createTextNode(this.errorMessageText);this.errorNode.appendChild(C);this.errorNode.style.display="none";if(this.ajaxLoadingGifUrl){var E=document.createElement("img");E.setAttribute("src",this.ajaxLoadingGifUrl);this.loadingNode.appendChild(E)}else{var A=document.createTextNode(this.ajaxLoadingText);this.loadingNode.appendChild(A)}this.loadingNode.style.display="none";this.clickDelegate=Function.createDelegate(this,this._onClick);$addHandler(D,"click",this.clickDelegate);if(this.enableBackButton&&!MySpace.UI.ClientPager.addedHistoryHandler){MySpace.Application.get_history().add_navigate(Function.createDelegate(this,function(G,F){this._goToPage(F.get_state().page||1)}));MySpace.UI.ClientPager.addedHistoryHandler=true}this.render()},dispose:function(){$removeHandler(this.get_element(),"click",this.clickDelegate);this.clickDelegate=null;this.pageLinksNode=null;this.nextPrevNode=null;this.XtoYofZNode=null;this.loadingNode=null;this.errorNode=null;MySpace.UI.ClientPager.callBaseMethod(this,"dispose")},_updateXtoYofZ:function(){var C=((this.currentPage-1)*this.itemsPerPage)+1;var B=Math.min(this.currentPage*this.itemsPerPage,this.totalItems);var A=String.format(this.XtoYofZText,C,B,this.totalItems);this.XtoYofZNode.innerHTML=A},_updateLinks:function(){this.pageLinksNode.innerHTML="";this.nextPrevNode.innerHTML="";if(this.highestPageInCluster==1){return}if(this.currentPageClusterPage!=1){this._createLink(this.pageLinksNode,1,null,1);this._createLink(this.pageLinksNode,this.prevCluster,this.prevPageClusterImageUrl,this.lowestPageInCluster-1)}for(var B=this.lowestPageInCluster;B<=this.highestPageInCluster;B++){if(B==this.currentPage){this._createLabel(this.pageLinksNode,""+B,"currentpage")}else{this._createLink(this.pageLinksNode,""+B,null,B)}}if(this.currentPageClusterPage!=this.totalNumberOfPageClusters){this._createLink(this.pageLinksNode,this.nextCluster,this.nextPageClusterImageUrl,this.highestPageInCluster+1);this._createLabel(this.pageLinksNode,this.ofLabel,"pagingOf");this._createLink(this.pageLinksNode,this.totalPages,null,this.totalPages)}var A=this.currentPage!=1;var C=this.currentPage!=this.totalPages;if(A){this._createLink(this.nextPrevNode,this.prevPage,this.prevPageImageUrl,this.currentPage-1)}if(A&&C){this._createLabel(this.nextPrevNode,"|",null)}if(C){this._createLink(this.nextPrevNode,this.nextPage,this.nextPageImageUrl,this.currentPage+1)}},_createLink:function(C,E,A,D){var B=document.createElement("a");B.href="#";B.setAttribute("pageNumber",D);B.className="pagingLink";B.innerHTML=A?'<img src="'+A+'" alt="'+E+'" />':E;C.appendChild(B)},_createLabel:function(C,D,A){var B=document.createElement("span");B.className=A;B.innerHTML=D;C.appendChild(B)},_showLoading:function(A){this.isLoading=A;this.loadingNode.style.display=A?"block":"none";this.XtoYofZNode.style.display=A?"none":"block"},_onClick:function(C){var A=new Sys.UI.DomEvent(C);A.preventDefault();A.stopPropagation();var B=this._getPageNumber(C.target);if(this.isLoading||!B){return}this._goToPage(B);if(this.enableBackButton){MySpace.Application.get_history().addHistoryPoint({page:B})}},_getPageNumber:function(B){while(B&&B.getAttribute){var A=B.getAttribute("pageNumber");if(A){return parseInt(A)}B=B.parentNode}},_goToPage:function(E){this._beginPageChange(E);if(this.siblingPagerIds){for(var D=0;D<this.siblingPagerIds.length;D++){var A=$find(this.siblingPagerIds[D]);if(A&&A!=this){$find(this.siblingPagerIds[D])._beginPageChange(E)}}}this._raisePagerEvent("onPageChangeBegin",{currentPage:E});if(this.dataPageUrl){this.dataPageParams=this.dataPageParams||{};this.dataPageParams.page=E;var F=[];for(var C in this.dataPageParams){F.push(C+"="+encodeURIComponent(this.dataPageParams[C]))}var B=this.dataPageUrl+(this.dataPageUrl.indexOf("?")>=0?"&":"?")+F.join("&");MySpace.WebRequest.invoke(B,true,null,Function.createDelegate(this,this._onDataPageLoad),Function.createDelegate(this,this._onError),null,30000)}},_beginPageChange:function(A){this.errorNode.style.display="none";this.currentPage=A;this.currentPageClusterPage=Math.ceil(A/this.pagesInCluster);this._showLoading(true)},_endPageChange:function(A){this._showLoading(false);if(A>0){this.get_element().style.visibility="";this.totalItems=A;this.totalPages=Math.ceil(A/this.itemsPerPage);this.totalNumberOfPageClusters=Math.ceil(this.totalPages/this.pagesInCluster);this.lowestPageInCluster=(this.currentPageClusterPage-1)*this.pagesInCluster+1;this.highestPageInCluster=Math.min(this.lowestPageInCluster+this.pagesInCluster-1,this.totalPages);this._updateLinks();this._updateXtoYofZ()}else{this.get_element().style.visibility="hidden"}},_onServiceLoad:function(A,C,B){this.contentNode.innerHTML=A.HTML;this.render(A.TotalItems);this._raisePagerEvent("onPageChangeEnd",{currentPage:this.currenPage})},_onDataPageLoad:function(B,A){this.contentNode.innerHTML=B;this.render();this._raisePagerEvent("onPageChangeEnd",{currentPage:this.currentPage})},_onError:function(){this._showLoading(false);this.errorNode.style.display=""},render:function(C){if(typeof C!=="number"){var D=MySpace.Utils.Selector.query(".pagingTotalItems",this.contentNode)[0];C=D?parseInt(D.innerHTML):this.totalItems}this._endPageChange(C);if(this.siblingPagerIds){for(var B=0;B<this.siblingPagerIds.length;B++){var A=$find(this.siblingPagerIds[B]);if(A&&A!=this){A._endPageChange(C)}}}},reset:function(C){this.currentPage=1;if(this.siblingPagerIds){for(var B=0;B<this.siblingPagerIds.length;B++){var A=$find(this.siblingPagerIds[B]);if(A&&A!=this){A.currentPage=1}}}this.render(C)}};MySpace.UI.ClientPager.init=function(E,C,A,D){E=E||{};E.siblingPagerIds=D;for(var B=0;B<D.length;B++){$create(MySpace.UI.ClientPager,E,C,A,$get(D[B]))}};MySpace.UI.ClientPager.registerClass("MySpace.UI.ClientPager",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);Type.registerNamespace("MySpace.PhotoAlbums.Pages");MySpace.PhotoAlbums.Pages.ViewImage=function(A){MySpace.PhotoAlbums.Pages.ViewImage.initializeBase(this,[A])};MySpace.PhotoAlbums.Pages.ViewImage.prototype={_loaded:false,_reportAbuse:null,_processPhotoUrlHandler:null,_processPhotoSetHandler:null,_processPhotoCommentsHandler:null,_toggleAllHandler:null,HistoryListenerHandler:null,PhotoBrowseByKeyHandler:null,_nextHyperlink:null,_previousHyperlink:null,_pageTitle:null,_originalURL:null,_photoCommandsBox:null,_currentImageCollection:null,_ownerLink:null,_photoLinksBox:null,_photoLinksInputs:null,_processDeleteCommentHandler:null,_nextPhotoUrl:null,_prevPhotoUrl:null,_initFinished:null,_commentsPageChangeBeginHandler:null,_commentsCache:null,_totalNumberOfComments:null,_pagerTop:null,_lastImageId:false,_viewingAlbumId:null,_currentImageLink:null,_currentImageHotLink:null,_ImageSearch:null,_imageSearchTerm:null,_authKey:null,_fetching:null,_userImage:null,_deleteMutliLink:null,_deleteMutliLink2:null,_checkAll:null,_checkAll2:null,_flashcopier:null,_imageDivStyle:null,_caption:null,_deleteMultipleBtn:null,_deleteBtn:null,_commentsTableServer:null,_commentsTableClient:null,_ajaxCommentsRegion:null,get_reportAbuse:function(){return this._reportAbuse},set_reportAbuse:function(A){this._reportAbuse=A},get_nextHyperlink:function(){return this._nextHyperlink},set_nextHyperlink:function(A){this._nextHyperlink=A},get_previousHyperlink:function(){return this._previousHyperlink},set_previousHyperlink:function(A){this._previousHyperlink=A},get_pageTitle:function(){return this._pageTitle},set_pageTitle:function(A){this._pageTitle=A},get_photoCommandsBox:function(){return this._photoCommandsBox},set_photoCommandsBox:function(A){this._photoCommandsBox=A},get_ownerLink:function(){return this._ownerLink},set_ownerLink:function(A){this._ownerLink=A},get_photoLinksBox:function(){return this._photoLinksBox},set_photoLinksBox:function(A){this._photoLinksBox=A},get_clipboardSwf:function(){return this._clipboardSwf},set_clipboardSwf:function(A){this._clipboardSwf=A},get_commentsPageChangeBeginHandler:function(){return this._commentsPageChangeBeginHandler},set_commentsPageChangeBeginHandler:function(A){this._commentsPageChangeBeginHandler=A},get_totalNumberOfComments:function(){if(this._totalNumberOfComments===null){this._totalNumberOfComments=parseInt($get("pagingTotalItems").innerHTML,10)}return this._totalNumberOfComments},set_totalNumberOfComments:function(A){this._totalNumberOfComments=A;$get("pagingTotalItems").innerHTML=A},get_pagerTop:function(){return this._pagerTop},set_pagerTop:function(A){this._pagerTop=A},get_photoCommentsTrigger:function(){if(this._photoCommentsTrigger===null){this._photoCommentsTrigger=parseInt(photoCommentsTrigger,10)}return this._photoCommentsTrigger},set_photoCommentsTrigger:function(A){this._photoCommentsTrigger=A},get_viewingAlbumId:function(){return this._viewingAlbumId},set_viewingAlbumId:function(A){this._viewingAlbumId=A},get_currentImageLink:function(){if(this._currentImageLink===null){this._currentImageLink=window.location}return this._currentImageLink},set_currentImageLink:function(A){this._currentImageLink=A},get_currentImageHotLink:function(){return this._currentImageHotLink},set_currentImageHotLink:function(A){this._currentImageHotLink=A},get_imageUserId:function(){var B;if(this.get_imageUserId.arguments.length===1){B=this.get_imageUserId.arguments[0]}else{B=window.location.href}if(B.lastIndexOf("u=")>-1){var A=B.substring(B.lastIndexOf("#")+1);var C=MySpace.Util.parseNameValuePairs(A.toLowerCase(),"&","=");return parseInt(C.u,10)}else{var A=B.substring(B.lastIndexOf("?")+1);var C=MySpace.Util.parseNameValuePairs(A.toLowerCase(),"&","=");if(C.imageuserid===undefined){return parseInt(C.friendid,10)}else{return parseInt(C.imageuserid,10)}}},get_imageId:function(){var B;if(this.get_imageId.arguments.length===1){B=this.get_imageId.arguments[0]}else{B=window.location.href}if(B.lastIndexOf("#")>-1){var A=B.substring(B.lastIndexOf("#")+1);var C=MySpace.Util.parseNameValuePairs(A.toLowerCase(),"&","=");return parseInt(C.i,10)}else{var A=B.substring(B.lastIndexOf("?")+1);var C=MySpace.Util.parseNameValuePairs(A.toLowerCase(),"&","=");return parseInt(C.imageid,10)}},get_albumId:function(){var B;if(this.get_albumId.arguments.length===1){B=this.get_albumId.arguments[0]}else{B=window.location.href}if(B.lastIndexOf("#")>-1){var A=B.substring(B.lastIndexOf("#")+1);var D=MySpace.Util.parseNameValuePairs(A.toLowerCase(),"&","=");var C=parseInt(D.a,10);if(!isNaN(C)){return C}}var A=B.substring(B.lastIndexOf("?")+1);var D=MySpace.Util.parseNameValuePairs(A.toLowerCase(),"&","=");return parseInt(D.albumid,10)},get_commentsTable:function(){var A=this._ajaxCommentsRegion;if(A.style.display==="none"){A=this._commentsTableServer}else{A=this._commentsTableClient}return A},get_ImageSearch:function(){if(this._ImageSearch!==null){return this._ImageSearch}this._ImageSearch=$get("submit_Image_Search");return this._ImageSearch},get_ImageSearchTerm:function(){if(this._imageSearchTerm!==null){return this._imageSearchTerm}this._imageSearchTerm=$get("search_image_string");return this._imageSearchTerm},get_authKey:function(){var A=window.location.href.substring(window.location.href.lastIndexOf("?")+1);var B=MySpace.Util.parseNameValuePairs(A.toLowerCase(),"&","=");return B.authkey||""},add_initFinished:function(A){this._initFinished=A},initialize:function(){this._processPhotoUrlHandler=Function.createDelegate(this,this._processPhotoUrl);this._processPhotoSetHandler=Function.createDelegate(this,this._processPhotoSet);this.PhotoBrowseByKeyHandler=Function.createDelegate(this,this._photoBrowseByKey);this.HistoryListenerHandler=Function.createDelegate(this,this.HistoryListener);this._processDeleteCommentHandler=Function.createDelegate(this,this._processDeleteComment);this._processPhotoCommentsHandler=Function.createDelegate(this,this._processPhotoComments);this.set_commentsPageChangeBeginHandler(Function.createDelegate(this,this.commentsPageChangeBegin));this._toggleAllHandler=Function.createDelegate(this,this._toggleall);this._deleteMutliLink=$get("btnDeleteSelected2");this._deleteMutliLink2=$get("deleteMultipleBtn");this._checkAll=$get("chkSelectAll");this._checkAll2=$get("chkSelectAll2");this._flashcopier=$get("flashcopier");this._imageDivStyle=$get("ImageDiv").style;this._caption=$get(captionClientID);this._deleteMultipleBtn=$get("deleteMultiple");this._deleteBtn=$get("delete");this._commentsTableServer=$get("comment_tbl");this._commentsTableClient=$get("itemContainer",$get("commentsList"));this._ajaxCommentsRegion=$get("commentsAjax");this._lastImageId=this.get_imageId();var G=$get("subfeatureHeadRight").getElementsByTagName("a");var F=G[0];var H=G[1];if(F!=undefined){this.set_previousHyperlink(F)}if(H!==undefined){this.set_nextHyperlink(H)}this._userImage=$get("userImage");var D=MySpace.Application.keyDisabled("AsyncPhotoBrowse");if(!D){if(F!=undefined){this._prevPhotoUrl=F.href;$addHandlers(F,{click:this.prev},this)}if(H!==undefined){this._nextPhotoUrl=H.href;$addHandlers(H,{click:this.next},this);$addHandlers(this._userImage,{click:this.next},this)}if(QuickBrowse){var E=MySpace.PhotosAlbums.Photos.length;var A=new Array(MySpace.PhotosAlbums.TotalCount);for(var C=0;C<E;C++){A[MySpace.PhotosAlbums.Photos[C].photoIndex]=MySpace.PhotosAlbums.Photos[C]}MySpace.PhotosAlbums.Photos=A;this._preLoadPhotos(MySpace.PhotosAlbums.CurrentPhotoIndex,0)}this._originalURL=window.location.href}$addHandler(document,"keydown",this.PhotoBrowseByKeyHandler);var B=$get("photoCommandsBox");if(B!==null){this.set_photoCommandsBox(B)}var I=$get(lblOwnerLinkClientID);if(I!==null){this.set_ownerLink(I)}this.AttachEvents();window.setTimeout(this._initFinished,100)},AttachEvents:function(){var A=$get("aReportAbuse");if(A!==null){this.set_reportAbuse(A);$addHandlers(this.get_reportAbuse(),{click:this.confirmAbuseReport},this)}$addHandlers(this.get_ImageSearch(),{click:this.DoImageSearch},this);$addHandler(this.get_ImageSearchTerm(),"keypress",Function.createDelegate(this,function(F){var E=F.charCode||F.keyCode;if(E===Sys.UI.Key.enter){this.DoImageSearch()}}));this.AddCaptionHandler();if(this.get_photoLinksBox()!==null){var C=this.get_photoLinksBox().getElementsByTagName("input");var D=C.length;this._photoLinksInputs=C;for(var B=0;B<D;B++){if(C[B].type==="text"){$addHandlers(C[B],{focus:this._selectAndCopy},this)}if(C[B].type==="button"){$addHandlers(C[B],{click:this._selectAndCopy},this)}}}this.AttachCommentsEvents()},AttachCommentsEvents:function(){if(this.get_commentsTable()===null){return}var F=this.get_commentsTable().getElementsByTagName("a");var J=F.length;var A=new Array();for(var E=0;E<J;E++){if(F[E].className==="deleteLink"){Array.add(A,F[E])}}if(!MySpace.Application.keyDisabled("PhotoQuickPostProfileComments")&&!MySpace.Application.keyDisabled("QuickProfileComments")&&!MySpace.Application.intlFeatureDisabled("QuickPostComments",MySpace.Cookies.MSCulture.get_values().PreferredCulture,MySpace.Application.Culture.PreferredCulture)){var G=MySpace.UI.getElementsByClassName("ProfileCommentBack");var M=G.length;for(var H=0;H<M;H++){$addHandler(G[H],"click",MySpace.UI.ProfileCommentQuickPostPopup.show)}}if(!MySpace.Application.keyDisabled("PhotoQuickPostMessaging")&&!MySpace.Application.keyDisabled("QuickPostMessaging")&&!MySpace.Application.intlSubFeatureDisabled("QuickPost","QuickPostMessaging",MySpace.Cookies.MSCulture.get_values().PreferredCulture,MySpace.Application.Culture.PreferredCulture)){var D=MySpace.UI.getElementsByClassName("SendMessage");var B=D.length;for(var H=0;H<B;H++){$addHandler(D[H],"click",function(Q){MySpace.UI.MessagingQuickPostPopup.show(Q,parseInt(this.getAttribute("FriendId"),10))})}}var P=new Array();var O=this.get_commentsTable().getElementsByTagName("td");var I=O.length;for(var E=0;E<I;E++){if(O[E].className==="photoCommentCell"){Array.add(P,O[E])}}if(P){var N=P.length;for(var C=0;C<N;C++){MySpace.Util.applyWBRToElement(P[C])}}this.get_commentsTable().style.width=549+"px";var L=A.length;if(L===0){return}for(var H=0;H<L;H++){var K=A[H].previousSibling.value;A[H].commentId=K;$addHandlers(A[H],{click:this._deleteComment},this)}if(this._deleteMutliLink!==null){$addHandlers(this._deleteMutliLink,{click:this._deleteCommentsMultiple},this)}if(this._deleteMutliLink2!==null){$addHandlers(this._deleteMutliLink2,{click:this._deleteCommentsMultiple},this)}if(this._checkAll!==null){$addHandlers(this._checkAll,{click:this._toggleAllHandler},this);this._checkAll.checked=false;this._toggleall()}if(this._checkAll2!==null){$addHandlers(this._checkAll2,{click:this._toggleAllHandler},this);this._checkAll2.checked=false;this._toggleall()}},AddCaptionHandler:function(){var A=$get("txtCaption");if(A!==null){$addHandlers(A,{keydown:MySpace.PhotoAlbums.Pages.EditAlbumPhoto.SaveCaptionKey,keypress:MySpace.PhotoAlbums.Pages.EditAlbumPhoto.SaveCaptionKey,keyup:MySpace.PhotoAlbums.Pages.EditAlbumPhoto.SaveCaptionKey},this)}},RemoveCommentsEvents:function(F){if(this.get_commentsTable()===null){return}var D=this.get_commentsTable().getElementsByTagName("a");if(D.length===0){return}var A=MySpace.UI.getElementsByClassName("deleteLink",this.get_commentsTable());var J=A.length;for(var G=0;G<J;G++){var H=A[G].previousSibling.value;A[G].commentId=H;$clearHandlers(A[G])}if(this._deleteMutliLink!==null){$clearHandlers(this._deleteMutliLink)}if(this._deleteMutliLink2!==null){$clearHandlers(this._deleteMutliLink2)}if(this._checkAll!==null){$clearHandlers(this._checkAll)}if(this._checkAll2!==null){$clearHandlers(this._checkAll2)}if(!MySpace.Application.keyDisabled("PhotoQuickPostProfileComments")&&!MySpace.Application.keyDisabled("QuickProfileComments")&&!MySpace.Application.intlFeatureDisabled("QuickPostComments",MySpace.Cookies.MSCulture.get_values().PreferredCulture,MySpace.Application.Culture.PreferredCulture)){var E=MySpace.UI.getElementsByClassName("ProfileCommentBack",this.get_commentsTable());var I=E.length;for(var G=0;G<I;G++){$clearHandlers(E[G])}}if(!MySpace.Application.keyDisabled("PhotoQuickPostMessaging")&&!MySpace.Application.keyDisabled("QuickPostMessaging")&&!MySpace.Application.intlSubFeatureDisabled("QuickPost","QuickPostMessaging",MySpace.Cookies.MSCulture.get_values().PreferredCulture,MySpace.Application.Culture.PreferredCulture)){var C=MySpace.UI.getElementsByClassName("SendMessage",this.get_commentsTable());var B=C.length;for(var G=0;G<B;G++){$clearHandlers(C[G])}}},_selectAndCopy:function(D){var A;if(D.target.tagName.toLowerCase()==="input"&&D.target.type==="text"){A=D.target}else{A=D.target.previousSibling}A.select();if(A.createTextRange){var B=A.createTextRange();if(B){B.execCommand("Copy")}}else{if(this._flashcopier===null){var E=document.createElement("div");E.id="flashcopier";document.body.appendChild(E);this._flashcopier=E}this._flashcopier.innerHTML="";var C='<embed src="'+this.get_clipboardSwf()+'" FlashVars="clipboard='+encodeURIComponent(A.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';this._flashcopier.innerHTML=C}},Refresh:function(A){if(typeof(RefreshAds)!=="undefined"){RefreshAds(A.toString(),this.get_photoCommentsTrigger())}},ReloadFromUrl:function(){if(window.location.href.lastIndexOf("#")>-1){this._originalURL=window.location.href.substring(0,window.location.href.lastIndexOf("#"));var A=window.location.href.substring(window.location.href.lastIndexOf("#")+1);this.HistoryListener(A,null)}else{this._originalURL=window.location.href;this._userImage.style.display="";if(typeof(RefreshAds)!=="undefined"){RefreshAds(window.location.href,photoCommentsTrigger)}}},next:function(A){A.preventDefault();if(!MySpace.Application.keyDisabled("DWBeaconPhotoPrint")){this.makeBeaconRequest(this._nextPhotoUrl,A,"next")}if(MySpace.Application.keyDisabled("AsyncPhotoBrowse")){window.location.href=this.get_nextHyperlink().href}else{this._addHistoryPointAndGetPhoto(this._nextPhotoUrl,1)}},prev:function(A){A.preventDefault();if(!MySpace.Application.keyDisabled("DWBeaconPhotoPrint")){this.makeBeaconRequest(this._prevPhotoUrl,A,"prev")}if(MySpace.Application.keyDisabled("AsyncPhotoBrowse")){window.location.href=this.get_previousHyperlink().href}else{this._addHistoryPointAndGetPhoto(this._prevPhotoUrl,-1)}},makeBeaconRequest:function(C,A,E){var G;if(A.type==="click"){G=A.target.id}else{G=A.type}var D=this.get_imageId(C);if(!isNaN(D)){if(MySpace.ClientContext.FunctionalContext==="ViewImage"){var B=this.get_albumId(C);if(!isNaN(B)){MySpace.Beacon.Request({pv:"1",imageId:D,albumId:B,src:G,type:E})}}else{if(MySpace.ClientContext.FunctionalContext==="ViewTaggedPhoto"){var F=this.get_imageUserId(C);if(!isNaN(F)){MySpace.Beacon.Request({pv:"1",imageId:D,imageUserId:F,src:G,type:E})}}}}},_photoBrowseByKey:function(A){if(A.target.tagName.toLowerCase()==="textarea"||A.target.tagName.toLowerCase()==="input"){return}switch(A.keyCode){case 39:this.next(A);return false;case 37:this.prev(A);return false}},confirmAbuseReport:function(){var A=confirm(MySpaceRes.ViewMorePicsPage.ReportConfirmation);if(A){location.href=reportAbuseUrl}},_preLoadPhotos:function(C,B){var A=new Array();switch(B){case MySpace.Web.Modules.PhotoAlbums.Services.Direction.Forward:A=MySpace.PhotoAlbums.Pages.ViewImage.RoundSequence(MySpace.PhotosAlbums.Photos.length,C,MySpace.PhotosAlbums.PhotoViewPreloadCount);break;case MySpace.Web.Modules.PhotoAlbums.Services.Direction.Backward:A=MySpace.PhotoAlbums.Pages.ViewImage.ReverseRoundSequence(MySpace.PhotosAlbums.Photos.length,C,MySpace.PhotosAlbums.PhotoViewPreloadCount);break;case MySpace.Web.Modules.PhotoAlbums.Services.Direction.Centered:A=MySpace.PhotoAlbums.Pages.ViewImage.RoundCenterSequence(MySpace.PhotosAlbums.Photos.length,C,Math.floor(MySpace.PhotosAlbums.PhotoViewPreloadCount/2));break}if(A.length>0){Array.forEach(A,function(F,E,G){if(typeof(MySpace.PhotosAlbums.Photos[F])==="undefined"){return}if(MySpace.PhotosAlbums.Photos[F].preloaded){return}var D=new Image();D.src=MySpace.PhotosAlbums.Photos[F].largeUrl;MySpace.PhotosAlbums.Photos[F].preloaded=true})}},HistoryListener:function(B,D){var A;var C;if(B.length>0){A=MySpace.Util.parseNameValuePairs(B,"&","=");if(A.u===undefined&&A.c===undefined){C=MySpace.ClientContext.DisplayFriendId}else{if(A.c!==undefined){C=MySpace.ClientContext.DisplayFriendId;A.a=-2}else{C=A.u;A.a=-1}}this._getPhotoUrl(parseInt(C,10),parseInt(A.a,10),parseInt(A.i,10),0)}else{if(D===null){A=MySpace.Util.parseNameValuePairs(window.location.href.toLowerCase(),"&","=");if(A.imageuserid===undefined){C=MySpace.ClientContext.DisplayFriendId}else{if(A.c!==undefined){C=MySpace.ClientContext.DisplayFriendId;A.albumid=-2}else{C=A.imageuserid;A.albumid=-1}}if(NotingObject.get_imageId()!==parseInt(A.imageid,10)){this._getPhotoUrl(parseInt(C,10),parseInt(A.albumid,10),parseInt(A.imageid,10),0)}else{if(typeof(RefreshAds)!=="undefined"){RefreshAds(window.location.href.toString(),photoCommentsTrigger)}}}}this._userImage.style.display=""},_resetImageDiv:function(){if(this._imageDivStyle){this._imageDivStyle.width=""}},_addHistoryPointAndGetPhoto:function(D,G){var H=MySpace.Util.parseNameValuePair(D,"#");var E=MySpace.Util.parseNameValuePairs(H.value,"&","=");var A="a={0}&i={1}";var B="u={0}&i={1}";var C="i={0}&c=true";var F;if(D.lastIndexOf("u=")===-1&&D.lastIndexOf("c=")===-1){F=String.format(A,E.a,E.i);this._getPhotoUrl(MySpace.ClientContext.DisplayFriendId,E.a,parseInt(E.i,10),G)}else{if(D.lastIndexOf("c=")>-1){F=String.format(C,E.i);E.a=-2;this._getPhotoUrl(MySpace.ClientContext.DisplayFriendId,E.a,parseInt(E.i,10))}else{F=String.format(B,E.u,parseInt(E.i,10));E.a=-1;this._getPhotoUrl(parseInt(E.u,10),E.a,parseInt(E.i,10),G)}}dhtmlHistory.add(F,E)},_getPhotoUrl:function(B,G,C,H){this._lastImageId=C;$get(loadingCirclesID).style.display="";if(typeof(NotingObject)!=="undefined"&&NotingObject.get_noteMode()){NotingObject.EndNoteMode()}if(QuickBrowse){var D=-1;var E=MySpace.PhotosAlbums.Photos.length;for(var F=0;F<E;F++){if(typeof(MySpace.PhotosAlbums.Photos[F])!=="undefined"&&MySpace.PhotosAlbums.Photos[F].imageID===C){var I=MySpace.PhotoAlbums.Pages.ViewImage.RoundCenterSequence(E,F,2);if(H===MySpace.Web.Modules.PhotoAlbums.Services.Direction.Forward&&typeof(MySpace.PhotosAlbums.Photos[I[I.length-1]])==="undefined"){this._getPhotoSet(MySpace.PhotosAlbums.Photos[F].friendID,G,MySpace.PhotosAlbums.Photos[F].imageID,1,F)}if(H===MySpace.Web.Modules.PhotoAlbums.Services.Direction.Backward&&typeof(MySpace.PhotosAlbums.Photos[I[0]])==="undefined"){this._getPhotoSet(MySpace.PhotosAlbums.Photos[F].friendID,G,MySpace.PhotosAlbums.Photos[F].imageID,-1,F)}this.set_currentImageHotLink(MySpace.PhotosAlbums.Photos[F].hotLink);this.set_currentImageLink(MySpace.PhotosAlbums.Photos[F].imageLink);addthis_content=MySpace.PhotosAlbums.Photos[F].hotLink;var A=MySpace.PhotosAlbums.Photos[F].viewCount;if(MySpace.PhotosAlbums.Photos[F].friendID!==MySpace.ClientContext.UserId){A=MySpace.PhotosAlbums.Photos[F].viewCount+1}this._renderPhoto(MySpace.PhotosAlbums.Photos[F].largeUrl,G,MySpace.PhotosAlbums.Photos[F].imageID,MySpace.PhotosAlbums.Photos[F].imageCaption,[],[],"",CurrentUserIsFriend,A,MySpace.PhotosAlbums.Photos[F].imageType,MySpace.PhotosAlbums.Photos[F].requiresViewsSinceText);this.GetPhotoCommentsPaged(MySpace.PhotosAlbums.Photos[F].imageID,1,{imageId:MySpace.PhotosAlbums.Photos[F].imageID});this.Refresh(MySpace.PhotosAlbums.Photos[F].imageLink);$get(loadingCirclesID).style.display="none";if(typeof(CommentQuickPost)!=="undefined"){CommentQuickPost.reset()}this._preLoadPhotos(F,H);return}}this._getPhotoSet(this.get_imageUserId(),G,C,0,0,true)}else{MySpace.Web.Modules.PhotoAlbums.Services.PhotoAlbums.GetNextPhoto(B,G,C,MySpace.ClientContext.DisplayFriendId,this.get_authKey(),this._processPhotoUrlHandler,this._processPhotoUrlHandler,{albumId:G,imageId:C})}},_getPhotoSet:function(E,C,D,F,B,A){if(typeof(A)==="undefined"){A=false}if(this._fetching){return true}this._fetching=true;MySpace.Web.Modules.PhotoAlbums.Services.PhotoAlbums.GetPhotosSequence(E,C,D,this.get_authKey(),F,this._processPhotoSetHandler,this._processPhotoSetHandler,{albumId:C,imageId:D,direction:F,currentIndex:B,loadFromUrl:A})},_processPhotoSet:function(D,C){var E=Sys.Serialization.JavaScriptSerializer.deserialize(D.Photos);for(var B=0;B<E.length;B++){if(typeof(MySpace.PhotosAlbums.Photos[E[B].photoIndex])==="undefined"){MySpace.PhotosAlbums.Photos[E[B].photoIndex]=E[B]}}this._fetching=false;if(C.loadFromUrl){C.currentIndex=0;var A=MySpace.PhotosAlbums.Photos.length;for(var B=0;B<A;B++){if(typeof(MySpace.PhotosAlbums.Photos[B])!=="undefined"&&MySpace.PhotosAlbums.Photos[B].imageID===C.imageId){C.currentIndex=B;break}}this.set_currentImageHotLink(MySpace.PhotosAlbums.Photos[C.currentIndex].hotLink);this.set_currentImageLink(MySpace.PhotosAlbums.Photos[C.currentIndex].imageLink);addthis_content=MySpace.PhotosAlbums.Photos[C.currentIndex].hotLink;this._renderPhoto(MySpace.PhotosAlbums.Photos[C.currentIndex].largeUrl,C.albumId,MySpace.PhotosAlbums.Photos[C.currentIndex].imageID,MySpace.PhotosAlbums.Photos[C.currentIndex].imageCaption,[],[],"",CurrentUserIsFriend,MySpace.PhotosAlbums.Photos[C.currentIndex].viewCount,MySpace.PhotosAlbums.Photos[C.currentIndex].imageType,MySpace.PhotosAlbums.Photos[C.currentIndex].requiresViewsSinceText);$get(loadingCirclesID).style.display="none";this._preLoadPhotos(C.currentIndex,1);this._preLoadPhotos(C.currentIndex,-1)}},_processPhotoUrl:function(C,B){if(this._lastImageId!=B.imageId){return}if(C.error){var D=$get("invalidImage");var A=$get("tkn_medrec");if(A!==null){D.appendChild(A);this.Refresh(window.location.href);A.setAttribute("align","center");D.style.display="";$get("content").innerHTML=D.innerHTML}return}this.set_currentImageHotLink(C.imageHotLinkUrl);this.set_currentImageLink(C.imageLink);addthis_content=C.imageHotLink;this._renderPhoto(C.imageUrl,B.albumId,C.imageId,C.caption,C.imageIds,C.userIds,C.imageOwnerText,C.currentUserIsFriend,C.viewCount,C.imageType,C.requiresViewsSinceText);this._currentImageCollection=C.imageIds;this.set_photoCommentsTrigger(C.trigger);this.Refresh(C.imageLink);$get(loadingCirclesID).style.display="none";if(typeof(CommentQuickPost)!=="undefined"){CommentQuickPost.reset()}this._processPhotoComments(C.comments,{pageNumber:1,totalCount:C.totalCount,imageId:C.imageId})},_renderPhoto:function(O,a,b,R,Y,L,S,J,M,A,P){if(typeof(NotingObject)!=="undefined"){this._resetImageDiv();NotingObject.set_photoSrc(O);NotingObject.SetImageSize();NotingObject.set_imageId(parseInt(b,10));NotingObject.set_currentUserIsFriend(J);var Q=0;var D=0;var e=0;var K=0;var G=0;var d=0;var U="";var W="";var F=0;if(QuickBrowse){if(MySpace.PhotosAlbums.Photos.length>0){F=MySpace.PhotosAlbums.Photos.length;for(var X=0;X<F;X++){if(typeof(MySpace.PhotosAlbums.Photos[X])!=="undefined"&&MySpace.PhotosAlbums.Photos[X].imageID===b){d=MySpace.PhotosAlbums.Photos[X].friendID;G=X}}var I=MySpace.PhotoAlbums.Pages.ViewImage.RoundSequence(F,G,2);var E=MySpace.PhotoAlbums.Pages.ViewImage.ReverseRoundSequence(F,G,2);Q=MySpace.PhotosAlbums.Photos[I[1]].imageID;e=MySpace.PhotosAlbums.Photos[I[1]].friendID;D=MySpace.PhotosAlbums.Photos[E[1]].imageID;K=MySpace.PhotosAlbums.Photos[E[1]].friendID}}else{if(Y.length>0){F=Y.length;for(var X=0;X<F;X++){if(Y[X]===b){d=L[X];G=X}}var I=MySpace.PhotoAlbums.Pages.ViewImage.RoundSequence(F,G,2);var E=MySpace.PhotoAlbums.Pages.ViewImage.ReverseRoundSequence(F,G,2);Q=Y[I[1]];e=L[I[1]];D=Y[E[1]];K=L[E[1]]}}NotingObject.set_imageUserId(d);NotingObject.GetPhotoNotes();var C;if(parseInt(a,10)>-1){C="{0}#a={1}&i={2}";U=String.format(C,this._originalURL,a,Q);W=String.format(C,this._originalURL,a,D)}else{if(parseInt(a,10)===-2){C="{0}#i={1}&c=true";U=String.format(C,this._originalURL,Q);W=String.format(C,this._originalURL,D)}else{C="{0}#u={1}&i={2}";U=String.format(C,this._originalURL,e,Q);W=String.format(C,this._originalURL,K,D)}}var Z;var c;if(Q<1||D<1){var N=$get("subfeatureHeadRight");N.innerHTML="";if(D>0){Z=document.createElement("a");Z.href=W;Z.innerHTML=MySpaceRes.ViewMorePicsPage.Previous}else{Z=document.createElement("b");Z.innerHTML=MySpaceRes.ViewMorePicsPage.Previous}if(Q>0){c=document.createElement("a");c.href=U;c.innerHTML=MySpaceRes.ViewMorePicsPage.Next;NotingObject.set_photoLink(U)}else{c=document.createElement("b");c.innerHTML=MySpaceRes.ViewMorePicsPage.Next;$clearHandlers(this._userImage);NotingObject.set_photoLink("javascript:void(0);")}N.appendChild(Z);N.appendChild(document.createTextNode(" | "));N.appendChild(c)}if(this._caption!==null){this._caption.innerHTML=R;MySpace.Util.applyWBRToElement(this._caption)}if(isPhotoViewCountsEnabled){$get("photoViewCounts").innerHTML=String.format(P?viewCountsViewsSincePatternText:viewCountsViewsPatternText,M);$get("photoViewCounts").style.fontWeight="bold"}if(this.get_ownerLink()){this.get_ownerLink().innerHTML=S||""}this._nextPhotoUrl=U;this._prevPhotoUrl=W;var T=this.get_photoCommandsBox().getElementsByTagName("a");var B=T.length;for(var V=0;V<B;V++){if(T[V].href){this._changePageUrl(T[V],a,b);if(T[V].href.indexOf("addthis.com")>-1){T[V].setAttribute("onmouseover","return addthis_open(this, '', ClientCodeBehind.get_currentImageLink().toString(), shareTitle)")}}}reportAbuseUrl=this._getChangedPageUrl(reportAbuseUrl,a,b,A);if($get("lnkPrintTop")){this._changePageUrl($get("lnkPrintTop"),a,b)}var H=MySpace.UI.getElementsByClassName("BreadcrumbLinkTopRight");if(H.length===3){this._changePageUrl(H[2],a,b)}if(this._photoLinksInputs!==null&&this._photoLinksInputs[0]!==undefined){this._photoLinksInputs[0].value=this.get_currentImageLink()}if(this._photoLinksInputs!==null&&this._photoLinksInputs[2]!==undefined){this._photoLinksInputs[2].value=this.get_currentImageHotLink()}if(navViewImagePageTitle.length>0){window.document.title=String.format(navViewImagePageTitle,String.format(MySpaceRes.ViewMorePicsPage.PhotoIofN,(G+1),F))}}if(!MySpace.Application.keyDisabled("PhotoQuickPostImage")&&!MySpace.Application.intlFeatureDisabled("QuickPostComments",MySpace.Cookies.MSCulture.get_values().PreferredCulture,MySpace.Application.Culture.PreferredCulture)&&typeof(CommentQuickPost)!=="undefined"){CommentQuickPost.set_webServiceParams({friendId:this.get_imageUserId(),albumId:this.get_viewingAlbumId(),imageId:b})}},GetCommentsPaged:function(A,B){MySpace.Web.Modules.PhotoAlbums.Services.PhotoAlbums.GetPhotoComments(this.get_imageUserId(),this.get_imageId(),A,this._processPhotoCommentsHandler,this._processPhotoCommentsHandler,B)},GetPhotoCommentsPaged:function(C,A,B){MySpace.Web.Modules.PhotoAlbums.Services.PhotoAlbums.GetPhotoComments(this.get_imageUserId(),C,A,this._processPhotoCommentsHandler,this._processPhotoCommentsHandler,B)},commentsPageChangeBegin:function(B,A){this.GetCommentsPaged(A.currentPage,{sender:B,pageNumber:A.currentPage,imageId:this.get_imageId()})},_processPhotoComments:function(P,G){if(this._lastImageId!=G.imageId){return}this.RemoveCommentsEvents();this._hideServerCommentsTable();var Q;switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:var Q=this._commentsTableClient.getElementsByTagName("tbody");break;default:var Q=this._commentsTableClient.getElementsByTagName("tr");break}if(Q.length>0){while(Q.length>0){this._commentsTableClient.removeChild(Q[Q.length-1])}}if(typeof(CommentQuickPost)!=="undefined"){CommentQuickPost.set_webServiceParams({friendId:this.get_imageUserId(),albumId:this.get_viewingAlbumId(),imageId:G.imageId})}if(P.totalCount===0){this.set_totalNumberOfComments(0);this._hideCommentsTables();return}var R;if(G!==null&&typeof(G.sender)!=="undefined"){G.sender.render(this.get_totalNumberOfComments());if(typeof(P.comments)==="undefined"){return}R=P.comments;if(typeof(G.Reset)!=="undefined"){if(G.Reset){PhotoCommentsPager.reset(this.get_totalNumberOfComments())}if(typeof(RefreshAds)!=="undefined"){RefreshAds(this.get_currentImageLink().toString(),parseInt(P.trigger,10))}}}else{if(typeof(P)==="undefined"){return}if(!QuickBrowse){this.set_totalNumberOfComments(G.totalCount);R=P}else{this.set_totalNumberOfComments(P.totalCount);R=P.comments;this.set_photoCommentsTrigger(P.trigger)}PhotoCommentsPager.reset(this.get_totalNumberOfComments())}var Z=new Templating.Template($get("commentTemplate"));if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&this._commentsTableClient.tagName.toLowerCase()==="tbody"){var T=this._commentsTableClient.parentNode;this._commentsTableClient.parentNode.removeChild(this._commentsTableClient);this._commentsTableClient=T;this._commentsTableClient.id="itemContainer"}for(var S=0;S<R.length;S++){var V=Z.createInstance(R[S]);switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:this._commentsTableClient.appendChild(V);break;default:for(var O=0;O<V.childNodes.length;O++){this._commentsTableClient.appendChild(V.childNodes[O])}break}var E="profileimageLink"+R[S].CommentID;var F=$get(E);if(F!==null){var J;var I=Sys.Serialization.JavaScriptSerializer.deserialize(R[S].ProfileImageLinkData);if(I){J=$create(MySpace.UI.ProfileImageLink,I,{},null,$get(E))}}if(MySpace.ClientContext.UserId===R[S].FriendId){var D="commentRowOwner"+R[S].CommentID;var X=$get(D);X.className="";X.style.display=""}var W="commentBackLink"+R[S].CommentID;var Y=$get(W);var H="sendMsgLink"+R[S].CommentID;var L=$get(H);var U="blockUserLink"+R[S].CommentID;var K=$get(U);var A;var M=MySpace.ClientContext.DisplayFriendId;if(MySpace.Application.keyDisabled("PhotoCommentLinks")){this._RemoveHyphen(Y.nextSibling);Y.style.display="none";this._RemoveHyphen(L.nextSibling);L.style.display="none";this._RemoveHyphen(K.nextSibling);K.style.display="none"}else{if(Y!==null){Y.href=String.format(commentBackLinkURL,R[S].FriendId)}L.href=String.format(SEND_MSG_LINK,R[S].FriendId);L.setAttribute("FriendId",R[S].FriendId.toString());K.href=String.format(BLOCK_USER_LINK,R[S].FriendId)}var N="deleteCommentLink"+R[S].CommentID;var B=$get(N);if(R[S].FriendId===MySpace.ClientContext.UserId){B.innerHTML=MySpaceRes.ViewMorePicsPage.DeleteMyComment;if(Y!==null&&Y!=="undefined"){Y.parentNode.className=""}if(MySpace.ClientContext.UserId!=this.get_imageUserId()){this._RemoveHyphen(Y.nextSibling);Y.style.display="none";this._RemoveHyphen(L.nextSibling);L.style.display="none";this._RemoveHyphen(K.nextSibling);K.style.display="none"}}if(R[S].FriendId!=MySpace.ClientContext.UserId&&MySpace.ClientContext.UserId!=this.get_imageUserId()&&MySpace.ClientContext.UserId>-1){if(Y!==null&&Y!=="undefined"){Y.parentNode.className=""}this._RemoveHyphen(L.nextSibling);this._RemoveHyphen(K.nextSibling);K.style.display="none";B.style.display="none"}}this._showClientComments();if(MySpace.ClientContext.UserId===this.get_imageUserId()){this._deleteMultipleBtn.style.display="block";var C=MySpace.UI.getElementsByClassName("ownercell",$get("commentsList"));for(var S=0;S<C.length;S++){C[S].className=""}}this.AttachCommentsEvents()},_showClientComments:function(){this.get_pagerTop().style.display="";if(this._deleteBtn!==null){this._deleteBtn.style.display="none"}this._deleteMultipleBtn.style.display="none";this._ajaxCommentsRegion.style.display="";this._commentsTableClient.style.display=""},_hideServerCommentsTable:function(){this.get_pagerTop().style.display="none";this._deleteMultipleBtn.style.display="none";if(this._deleteBtn){this._deleteBtn.style.display="none"}if(this._commentsTableServer){this._commentsTableServer.style.display="none"}},_hideCommentsTables:function(){this.get_pagerTop().style.display="none";if(this._deleteBtn){this._deleteBtn.style.display="none"}this._ajaxCommentsRegion.style.display="none";this._commentsTableClient.style.display="none";this._deleteMultipleBtn.style.display="none";if(this._commentsTableServer){this._commentsTableServer.style.display="none"}},_RemoveHyphen:function(A){if(A!==null&&A.nodeType===3){A.nodeValue=""}},_changePageUrl:function(B,C,A){B.href=this._getChangedPageUrl(B.href,C,A)},_getChangedPageUrl:function(J,I,F,B){var E=J;var C=E.substring(0,J.lastIndexOf("?")+1);var H=E.substring(E.lastIndexOf("?")+1);if(C.trim().length>0){var G;var A=null;if(H.indexOf("authKey")>-1){A=MySpace.Util.parseNameValuePairs(H,"&","=")}G=MySpace.Util.parseNameValuePairs(H.toLowerCase(),"&","=");if(G.albumid){G.albumid=I}if(G.imageid){G.imageid=F}if(G.imagetype){G.imagetype=B}var M=new Sys.StringBuilder(C);for(var L in G){var K=G[L],D=[L,K];if(L==="authkey"&&A!==null){M.append("&authKey="+A.authKey)}else{if(L!=="fuseaction"){M.append("&")}M.append(L+"="+K)}}return M.toString()}else{return J}},_getNextImageId:function(C){var D=0;var A=this._currentImageCollection;var E=this._currentImageCollection.length;for(var B=0;B<E;B++){if(A[B]===C){currentIndex=B+1;nextIndex=B+1;if(B<(E-1)){D=A[nextIndex]}else{if(E>0){D=A[0]}}break}}return D},_deleteComment:function(A){if(typeof(A.target.commentId)!="undefined"){if(confirm(MySpaceRes.UserPage.AreYouSureYouWantToDeleteComment)){MySpace.Web.Modules.PhotoAlbums.Services.PhotoAlbums.DeleteImageComment(this.get_imageUserId(),this.get_imageId(),parseInt(A.target.commentId,10),this._processDeleteCommentHandler,this._processDeleteCommentHandler,parseInt(A.target.commentId,10))}}},_deleteCommentsMultiple:function(){var D=this.get_commentsTable();if(D!==null){var C=D.getElementsByTagName("input");var B=false;var A=new Sys.StringBuilder();for(i=0;i<C.length;i++){if(C[i].checked&&C[i].name==="deleteList"){B=true;A.append(C[i].value+",")}}A=A.toString().substring(0,A.toString().length-1);if(!B){alert(MySpaceRes.ViewMorePicsPage.PleaseSelectAnItemToDelete);return false}else{if(confirm(MySpaceRes.Messaging.jsconfirmDeleteSelectedItems)){if(A.length>0){MySpace.Web.Modules.PhotoAlbums.Services.PhotoAlbums.DeleteImageCommentsMultiple(this.get_imageUserId(),this.get_imageId(),A,this._processDeleteCommentHandler,this._processDeleteCommentHandler,A)}}}}},_processDeleteComment:function(D,C){if(D.success==false){alert(D.message)}else{this.RemoveCommentsEvents();if(typeof(C)==="number"){this.set_totalNumberOfComments((this.get_totalNumberOfComments()-1))}else{var B=C.split(",");this.set_totalNumberOfComments((this.get_totalNumberOfComments()-B.length))}}if(this.get_totalNumberOfComments()>0){var A=$find("pagerTop");A.render(this.get_totalNumberOfComments());A._goToPage(1)}else{this._hideCommentsTables()}this.AttachCommentsEvents()},DoImageSearch:function(){var A=$get("search_image_string");if(A.value.length>0){location.href=String.format(imageSearchUrl,encodeURIComponent(A.value))}},_toggleall:function(C){var D=0;var A=this.get_commentsTable().getElementsByTagName("input");if(C!=null&&C.target.checked){if(A){D=A.length;for(var B=0;B<D;B++){if(A[B].type==="checkbox"&&A[B].id=="deleteList"){A[B].checked=true}}}}else{if(A){D=A.length;for(var B=0;B<D;B++){if(A[B].type==="checkbox"&&A[B].id=="deleteList"){A[B].checked=false}}}}},dispose:function(){this.RemoveCommentsEvents();this._loaded=false;this._reportAbuse=null;this._processPhotoUrlHandler=null;this._processPhotoSetHandler=null;this._processPhotoCommentsHandler=null;this._toggleAllHandler=null;this.HistoryListenerHandler=null;this.PhotoBrowseByKeyHandler=null;this._nextHyperlink=null;this._previousHyperlink=null;this._pageTitle=null;this._originalURL=null;this._photoCommandsBox=null;this._currentImageCollection=null;this._ownerLink=null;this._photoLinksBox=null;this._photoLinksInputs=null;this._processDeleteCommentHandler=null;this._nextPhotoUrl=null;this._prevPhotoUrl=null;this._initFinished=null;this._commentsPageChangeBeginHandler=null;this._commentsCache=null;this._totalNumberOfComments=null;this._pagerTop=null;this._lastImageId=false;this._viewingAlbumId=null;this._currentImageLink=null;this._currentImageHotLink=null;this._ImageSearch=null;this._imageSearchTerm=null;this._authKey=null;this._fetching=null;this._userImage=null;this._deleteMutliLink=null;this._deleteMutliLink2=null;this._checkAll=null;this._checkAll2=null;this._flashcopier=null;this._imageDivStyle=null;this._caption=null;this._deleteMultipleBtn=null;this._deleteBtn=null;this._commentsTableServer=null;this._commentsTableClient=null;this._ajaxCommentsRegion=null}};MySpace.PhotoAlbums.Pages.ViewImage.registerClass("MySpace.PhotoAlbums.Pages.ViewImage",Sys.UI.Behavior);MySpace.PhotoAlbums.Pages.ViewImage.RedirectToAlbums=function(){window.location.href=viewAlbumsUrl};MySpace.PhotoAlbums.Pages.ViewImage.RoundSequence=function(C,B,A){if(C<=0||A<=0){return}B=B%C;if(B<0){B+=C}var D=new Array();while(A-->0){Array.add(D,B);if(++B==C){B=0}}return D};MySpace.PhotoAlbums.Pages.ViewImage.ReverseRoundSequence=function(C,B,A){if(C<=0||A<=0){return}B=B%C;if(B<0){B+=C}var D=new Array();while(A-->0){Array.add(D,B);if(--B<0){B+=C}}return D};MySpace.PhotoAlbums.Pages.ViewImage.RoundCenterSequence=function(C,B,A){if(C<=0||A<0){return}return MySpace.PhotoAlbums.Pages.ViewImage.RoundSequence(C,(B-A)%C,A*2+1)};MySpace.PhotoAlbums.Pages.ViewImage.OnCommentPosted=function(B,A){if(!(A&&A.data&&A.data.CommentStatus==MySpace.Application.Integration.CommentStatus.Allowed)){return}var C=ClientCodeBehind.get_totalNumberOfComments();ClientCodeBehind.set_totalNumberOfComments(++C);ClientCodeBehind.GetCommentsPaged(1,{currentPage:1,sender:PhotoCommentsPager,Reset:true,imageId:B.get_webServiceParams().imageId})};window.dhtmlHistory={isIE:false,isOpera:false,isSafari:false,isKonquerer:false,isGecko:false,isSupported:false,create:function(D){var G=this;var F=navigator.userAgent.toLowerCase();var A=navigator.platform.toLowerCase();var H=navigator.vendor||"";if(H==="KDE"){this.isKonqueror=true;this.isSupported=false}else{if(typeof window.opera!=="undefined"){this.isOpera=true;this.isSupported=true}else{if(typeof document.all!=="undefined"){this.isIE=true;this.isSupported=true}else{if(Sys.Browser.agent===Sys.Browser.Firefox||Sys.Browser.agent===Sys.Browser.Safari){this.isGecko=true;this.isSupported=true}}}}window.historyStorage.setup(D);if(this.isSafari){this.createSafari()}else{if(this.isOpera){this.createOpera()}}var B=this.getCurrentLocation();this.currentLocation=B;if(this.isIE){this.createIE(B)}var E=function(){G.firstLoad=null};this.addEventListener(window,"unload",E);if(this.isIE){this.ignoreLocationChange=true}else{if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true)}else{this.ignoreLocationChange=false;this.fireOnNewListener=true}}var C=function(){G.checkLocation()};setInterval(C,100)},initialize:function(){if(this.isIE){if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true)}else{this.fireOnNewListener=true;this.firstLoad=false}}},addListener:function(A){this.listener=A;if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false}},addEventListener:function(C,B,A){if(C.addEventListener){C.addEventListener(B,A,false)}else{if(C.attachEvent){C.attachEvent("on"+B,function(){A(window.event)})}}},add:function(C,D){if(this.isSafari){C=this.removeHash(C);historyStorage.put(C,D);this.currentLocation=C;window.location.hash=C;this.putSafariState(C)}else{var B=this;var A=function(){if(B.currentWaitTime>0){B.currentWaitTime=B.currentWaitTime-B.waitTime}C=B.removeHash(C);if(document.getElementById(C)&&B.debugMode){var E="Exception: History locations can not have the same value as _any_ IDs that might be in the document, due to a bug in IE; please ask the developer to choose a history location that does not match any HTML IDs in this document. The following ID is already taken and cannot be a location: "+C;throw new Error(E)}historyStorage.put(C,D);B.ignoreLocationChange=true;B.ieAtomicLocationChange=true;B.currentLocation=C;window.location.hash=C;if(B.isIE){B.iframe.src=urlBase+"/blank.html?"+C}B.ieAtomicLocationChange=false};window.setTimeout(A,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime}},isFirstLoad:function(){return this.firstLoad},getVersion:function(){return"0.6"},getCurrentLocation:function(){var A=(this.isSafari?this.getSafariState():this.getCurrentHash());return A},getCurrentHash:function(){var B=window.location.href;var A=B.indexOf("#");return(A>=0?B.substr(A+1):"")},PAGELOADEDSTRING:"DhtmlHistory_pageLoaded",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,iframe:null,safariHistoryStartPoint:null,safariStack:null,safariLength:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,createIE:function(A){this.waitTime=400;var B=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var D="rshHistoryFrame";var C='<iframe frameborder="0" id="'+D+'" style="'+B+'" src="'+urlBase+"/blank.html?"+A+'"></iframe>';document.write(C);this.iframe=document.getElementById(D)},createOpera:function(){this.waitTime=400;var A='<img src="javascript:location.href=\'javascript:dhtmlHistory.checkLocation();\';" style="'+historyStorage.hideStyles+'" />';document.write(A)},createSafari:function(){var E="rshSafariForm";var D="rshSafariStack";var C="rshSafariLength";var B=historyStorage.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var A=(historyStorage.debugMode?"width:800px;height:20px;border:1px solid black;margin:0;padding:0;":historyStorage.hideStyles);var F='<form id="'+E+'" style="'+B+'"><input type="text" style="'+A+'" id="'+D+'" value="[]"/><input type="text" style="'+A+'" id="'+C+'" value=""/></form>';document.write(F);this.safariStack=document.getElementById(D);this.safariLength=document.getElementById(C);if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.safariHistoryStartPoint=history.length;this.safariLength.value=this.safariHistoryStartPoint}else{this.safariHistoryStartPoint=this.safariLength.value}},getSafariStack:function(){var A=this.safariStack.value;return historyStorage.fromJSON(A)},getSafariState:function(){var A=this.getSafariStack();var B=A[history.length-this.safariHistoryStartPoint-1];return B},putSafariState:function(B){var A=this.getSafariStack();A[history.length-this.safariHistoryStartPoint]=B;this.safariStack.value=historyStorage.toJSON(A)},fireHistoryEvent:function(A){var B=historyStorage.get(A);this.listener.call(null,A,B)},checkLocation:function(){if(!this.isIE&&this.ignoreLocationChange){this.ignoreLocationChange=false;return}if(!this.isIE&&this.ieAtomicLocationChange){return}var A=this.getCurrentLocation();if(A==this.currentLocation){return}this.ieAtomicLocationChange=true;if(this.isIE&&this.getIframeHash()!=A){this.iframe.src=urlBase+"/blank.html?"+A}else{if(this.isIE){return}}this.currentLocation=A;this.ieAtomicLocationChange=false;this.fireHistoryEvent(A)},getIframeHash:function(){var B=this.iframe.contentWindow.document;var A=String(B.location.search);if(A.length==1&&A.charAt(0)=="?"){A=""}else{if(A.length>=2&&A.charAt(0)=="?"){A=A.substring(1)}}return A},removeHash:function(B){var A;if(B===null||B===undefined){A=null}else{if(B===""){A=""}else{if(B.length==1&&B.charAt(0)=="#"){A=""}else{if(B.length>1&&B.charAt(0)=="#"){A=B.substring(1)}else{A=B}}}}return A},iframeLoaded:function(A){if(this.ignoreLocationChange){this.ignoreLocationChange=false;return}var B=String(A.search);if(B.length==1&&B.charAt(0)=="?"){B=""}else{if(B.length>=2&&B.charAt(0)=="?"){B=B.substring(1)}}window.location.hash=B;this.fireHistoryEvent(B)}};window.historyStorage={setup:function(B){if(typeof B!=="undefined"){if(B.debugMode){this.debugMode=B.debugMode}if(B.toJSON){this.toJSON=B.toJSON}if(B.fromJSON){this.fromJSON=B.fromJSON}}var D="rshStorageForm";var F="rshStorageField";var A=this.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var E=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var C='<form id="'+D+'" style="'+A+'"><textarea id="'+F+'" style="'+E+'"></textarea></form>';document.write(C);this.storageField=document.getElementById(F);if(typeof window.opera!=="undefined"){this.storageField.focus()}},put:function(A,B){this.assertValidKey(A);if(this.hasKey(A)){this.remove(A)}this.storageHash[A]=B;this.saveHashTable()},get:function(A){this.assertValidKey(A);this.loadHashTable();var B=this.storageHash[A];if(B===undefined){B=null}return B},remove:function(A){this.assertValidKey(A);this.loadHashTable();delete this.storageHash[A];this.saveHashTable()},reset:function(){this.storageField.value="";this.storageHash={}},hasKey:function(A){this.assertValidKey(A);this.loadHashTable();return(typeof this.storageHash[A]!=="undefined")},isValidKey:function(A){return(typeof A==="string")},showStyles:"border:0;margin:0;padding:0;",hideStyles:"left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;",debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(A){var B=this.isValidKey(A);if(!B&&this.debugMode){throw new Error("Please provide a valid key for window.historyStorage. Invalid key = "+A+".")}},loadHashTable:function(){if(!this.hashLoaded){var A=this.storageField.value;if(A!==""&&A!==null){this.storageHash=this.fromJSON(A);this.hashLoaded=true}}},saveHashTable:function(){this.loadHashTable();var A=this.toJSON(this.storageHash);this.storageField.value=A},toJSON:function(A){return A.toJSONString()},fromJSON:function(A){return A.parseJSON()}};Type.registerNamespace("MySpace.Web.Modules.PhotoAlbums.Services");MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes=function(){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.initializeBase(this);this._timeout=0;this._userContext=null;this._succeeded=null;this._failed=null};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.prototype={SaveNote:function(B,D,C,J,A,H,E,G,K,L,I,F){return this._invoke(MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_path(),"SaveNote",false,{imageOwnerId:B,imageId:D,x1:C,y1:J,x2:A,y2:H,friendId:E,note:G,showIndicator:K},L,I,F)},DeleteNote:function(F,B,C,D,A,E){return this._invoke(MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_path(),"DeleteNote",false,{noteOwnerUserId:F,imageId:B,noteId:C},D,A,E)},GetNotes:function(A,C,D,B,E){return this._invoke(MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_path(),"GetNotes",false,{friendId:A,imageId:C},D,B,E)},GetFriendsList:function(D,B,C,A,E){return this._invoke(MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_path(),"GetFriendsList",false,{canTagOwner:D,imageUserId:B},C,A,E)},EmailToAFriend:function(C,B,D,A,E){return this._invoke(MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_path(),"EmailToAFriend",false,{emailTo:C,imageId:B},D,A,E)},ApproveAutoTag:function(C,B,D,E,A,F){return this._invoke(MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_path(),"ApproveAutoTag",false,{imageOwnerId:C,imageId:B,noteId:D},E,A,F)},RejectAutoTag:function(B,C,D,A,E){return this._invoke(MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_path(),"RejectAutoTag",false,{imageId:B,noteId:C},D,A,E)}};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.registerClass("MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes",Sys.Net.WebServiceProxy);MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance=new MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes();MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.set_path=function(A){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance._path=A};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_path=function(){return MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance._path};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.set_timeout=function(A){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance._timeout=A};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_timeout=function(){return MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance._timeout};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.set_defaultUserContext=function(A){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance._userContext=A};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_defaultUserContext=function(){return MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance._userContext};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.set_defaultSucceededCallback=function(A){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance._succeeded=A};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_defaultSucceededCallback=function(){return MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance._succeeded};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.set_defaultFailedCallback=function(A){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance._failed=A};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.get_defaultFailedCallback=function(){return MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance._failed};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.set_path("/Modules/PhotoAlbums/Services/PhotoNotes.asmx");MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.SaveNote=function(B,D,C,K,A,J,E,I,L,H,F,G){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance.SaveNote(B,D,C,K,A,J,E,I,L,H,F,G)};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.DeleteNote=function(F,B,C,D,A,E){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance.DeleteNote(F,B,C,D,A,E)};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.GetNotes=function(A,C,D,B,E){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance.GetNotes(A,C,D,B,E)};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.GetFriendsList=function(C,B,D,A,E){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance.GetFriendsList(C,B,D,A,E)};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.EmailToAFriend=function(C,B,D,A,E){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance.EmailToAFriend(C,B,D,A,E)};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.ApproveAutoTag=function(C,B,D,E,A,F){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance.ApproveAutoTag(C,B,D,E,A,F)};MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.RejectAutoTag=function(B,C,D,A,E){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes._staticInstance.RejectAutoTag(B,C,D,A,E)};Type.registerNamespace("MySpace.Media.Domain");if(typeof(MySpace.Media.Domain.TaggedPhotoApprovalStatus)==="undefined"){MySpace.Media.Domain.TaggedPhotoApprovalStatus=function(){throw Error.invalidOperation()};MySpace.Media.Domain.TaggedPhotoApprovalStatus.prototype={Pending:0,Approved:1,Denied:2,ApprovedNotShown:3,Deleted:4};MySpace.Media.Domain.TaggedPhotoApprovalStatus.registerEnum("MySpace.Media.Domain.TaggedPhotoApprovalStatus",true)}Type.registerNamespace("MySpace.PhotoAlbums");var CropObject=null;var PhotoNotes=new Array();var DefaultNote=MySpaceRes.ViewMorePicsPage.NoteDefault;var DefaultNoteNameOnly=MySpaceRes.ViewMorePicsPage.NoteDefaultName;var SavingMessage=MySpaceRes.ViewMorePicsPage.Saving;var DeletingMessage=MySpaceRes.ViewMorePicsPage.Deleting;var ErrorMessage=MySpaceRes.ViewMorePicsPage.ErrorAjaxAction;var CloseMessage=MySpaceRes.ViewMorePicsPage.Close;var AcFriend=null;MySpace.PhotoAlbums.WaitingMessageType=function(){throw Error.notImplemented()};MySpace.PhotoAlbums.WaitingMessageType.prototype={Save:1,Delete:2,Approve:3,Deny:4,Error:5,EmailSent:6,EmailError:7,SingleNoteMode:8,Load:9,TooManyFriends:10};MySpace.PhotoAlbums.WaitingMessageType.registerEnum("MySpace.PhotoAlbums.WaitingMessageType");MySpace.PhotoAlbums.PhotoNoteController=function(A){MySpace.PhotoAlbums.PhotoNoteController.initializeBase(this,[A])};MySpace.PhotoAlbums.PhotoNoteController.prototype={NoteCounter:-1,ShowBoxes:true,_noteMode:false,_isEditMode:false,_captionList:null,_image:null,_imageId:null,_noteUI:null,_noteCaptionList:null,_profileURL:null,_saveNoteHandler:null,_cancelNoteHandler:null,_failedCallbackHandler:null,_coords:null,_currentUserId:0,_displayFriendId:0,_stillHideBoxes:true,_hideDelegate:null,_timeoutCookie:null,_imageLink:null,_imageAnchorHref:null,_elementLocation:null,_approveBtn:null,_denyBtn:null,_currentUserNoteId:null,_emailPhotoHandler:null,_processPhotoNoteHandler:null,_redrawImageDivHandler:null,_isAlbumPrivate:false,_privateAlbumDiv:null,_retrievedFriends:false,_scrollTop:0,_canTagOwner:true,_friendsOnlyMode:false,_imageUserId:null,_currentUserIsFriend:null,get_noteMode:function(){return this._noteMode},set_noteMode:function(A){if(this._noteMode!==A){this._noteMode=A;this.get_noteCaptionList().set_noteMode(A)}},get_isEditMode:function(){return this._isEditMode},set_isEditMode:function(A){this._isEditMode=A},get_noteUI:function(){return this._noteUI},set_noteUI:function(A){this._noteUI=A},get_captionList:function(){return $get(this._captionList)},set_captionList:function(A){this._captionList=A},get_cancelNoteHandler:function(){return this._cancelNoteHandler},add_cancelNoteHandler:function(A){this._cancelNoteHandler=A},get_changeNoteStyleHandler:function(){return this._changeNoteStyle},add_changeNoteStyleHandler:function(A){this._changeNoteStyle=A},get_profileURL:function(){return this._profileURL},set_profileURL:function(A){this._profileURL=A},get_noteCaptionList:function(){return this._noteCaptionList},set_noteCaptionList:function(A){this._noteCaptionList=A},get_coords:function(){return this._coords},set_coords:function(B,D,A,C){this._coords={x1:B,y1:D,x2:A,y2:C}},get_currentUserId:function(){return this._currentUserId},set_currentUserId:function(A){this._currentUserId=A},get_displayFriendId:function(){return this._displayFriendId},set_displayFriendId:function(A){this._displayFriendId=A},get_originalPhotoLink:function(){return this._originalPhotoLink},set_originalPhotoLink:function(A){this._originalPhotoLink=A},get_currentUserNoteId:function(){return this._currentUserNoteId},set_currentUserNoteId:function(A){this._currentUserNoteId=A},get_photoSrc:function(){return this.get_image().src},set_photoSrc:function(B){var A=new Image();A.src=B;A.id="userImage";$addHandler(A,"click",Function.createDelegate(ClientCodeBehind,ClientCodeBehind.next));var C=this.get_element().getElementsByTagName("A");if(C&&C.length>0){C[0].replaceChild(A,this.get_image())}this.set_image(A)},get_photoLink:function(){return this._imageAnchor.href},set_photoLink:function(A){this._imageAnchor.href=A;this.set_originalPhotoLink(A)},get_imageId:function(){return this._imageId},set_imageId:function(A){this._imageId=A},get_image:function(){return this._image},set_image:function(A){this._image=A},get_isAlbumPrivate:function(){return this._isAlbumPrivate},set_isAlbumPrivate:function(A){this._isAlbumPrivate=A},get_privateAlbumDiv:function(){return this._privateAlbumDiv},set_privateAlbumDiv:function(A){this._privateAlbumDiv=A},get_retrievedFriends:function(){return this._retrievedFriends},set_retrievedFriends:function(A){this._retrievedFriends=A},get_canTagOwner:function(){return this._canTagOwner},set_canTagOwner:function(A){this._canTagOwner=A},get_friendsOnlyMode:function(){return this._friendsOnlyMode},set_friendsOnlyMode:function(A){this._friendsOnlyMode=A},get_imageUserId:function(){return this._imageUserId},set_imageUserId:function(A){this._imageUserId=A},get_redrawImageDivHandler:function(){return this._redrawImageDivHandler},get_currentUserIsFriend:function(){return this._currentUserIsFriend},set_currentUserIsFriend:function(A){this._currentUserIsFriend=A},add_taggingDone:function(A){this.get_events().addHandler("taggingDone",A)},remove_taggingDone:function(A){this.get_events().removeHandler("taggingDone",A)},_raiseEvent:function(B,A){var C=this.get_events().getHandler(B);if(C){if(!A){A=Sys.EventArgs.Empty}C(this,A)}},initialize:function(){var B={deleteNoteHandler:Function.createDelegate(this,this.DeleteNote)};var A={noteMode:this.get_noteMode(),isEditMode:this.get_isEditMode()};this.set_noteCaptionList($create(MySpace.PhotoAlbums.NoteCaptionList,A,B,null,this.get_captionList()));this.set_image(this.get_element().getElementsByTagName("img")[0]);this._imageAnchor=this.get_element().getElementsByTagName("a")[0];this._elementLocation=Sys.UI.DomElement.getLocation(this.get_element());this.SetImageSize();if(this._noteUI!==null){this._noteUI.set_saveNoteHandler(Function.createDelegate(this,this.SaveStart));this._noteUI.set_resetNoterHandler(Function.createDelegate(this,this.ResetNoter));this._noteUI.add_taggingDone(Function.createDelegate(this,this.EndNoteMode));this._noteUI.add_friendsLoaded(Function.createDelegate(this,this.HideWaitingMessageAndShowFs))}this._saveNoteHandler=Function.createDelegate(this,this._saveNote);this._saveNoteCallbackHandler=Function.createDelegate(this,this._saveNoteCallback);this._failedCallbackHandler=Function.createDelegate(this,this._failedCallback);this._processPhotoNoteHandler=Function.createDelegate(this,this._processPhotoNotes);this._redrawImageDivHandler=Function.createDelegate(this,this.RedrawImageDiv);this.set_noteMode(false)},RedrawImageDiv:function(){var A=Sys.UI.DomElement.getBounds(this.get_image())},_redrawImageDivAndStart:function(){window.setTimeout(Function.createDelegate(this,this.StartNote),1000)},SetImageSize:function(){if(this.get_image().height>30){this.get_element().style.width=this.get_image().offsetWidth+"px";this.get_element().style.height=this.get_image().offsetHeight+"px"}else{$addHandlers(this.get_image(),{load:this.SetImageSize},this)}},StartNote:function(){this.set_noteMode(true);var B;if(window.innerHeight){B=window.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){B=document.documentElement.scrollTop}else{if(document.body){B=document.body.scrollTop}else{B=window.pageYOffset}}}this._scrollTop=B;var A=$get("photoLeft");if(A){Sys.UI.DomElement.addCssClass(A,"tagging")}this.SetImageSize();this.ShowWaitingMessage(MySpace.PhotoAlbums.WaitingMessageType.Load);this._noteUI.ShowFriendSuggest(this.get_canTagOwner())},ShowNoter:function(){if(!this.get_image().complete){this.get_image().src=this.get_photoSrc();window.setTimeout(Function.createDelegate(this,this.ShowNoter),0);return}this.LoadCropper();this._imageAnchor.href="javascript:void(0);";var B=PhotoNotes.length;if(B>0){this.NoteCounter=B-1}if(this.get_isAlbumPrivate()===true){if(this.get_privateAlbumDiv().style.display==="none"){this.get_privateAlbumDiv().style.display=""}}var C=PhotoNotes.length;for(var A=0;A<C;A++){PhotoNotes[A].RemoveEvents()}},EndNoteMode:function(){this.ResetNoter();this._raiseEvent("taggingDone",Sys.EventArgs.Empty);var A=$get("photoLeft");if(A){Sys.UI.DomElement.removeCssClass(A,"tagging")}},LoadCropper:function(){var A={h:50,w:50};if(this.get_image().width<100||this.get_image().height<100){if(this.get_image().width<100){A.w=this.get_image().width}if(this.get_image().height<100){A.h=this.get_image().height}}var B={x1:0,y1:50,x2:100,y2:150};B.x1=Math.round(((parseInt(this.get_image().width)/2)-100));B.x2=B.x1+100;if(CropObject!==null){CropObject.remove();CropObject=null}var C=this.get_image().parentNode;C.innerHTML="";C.appendChild(this.get_image());CropObject=new Cropper.Img(this.get_image().id,{minWidth:A.w,minHeight:A.h,onEndCrop:Function.createDelegate(this,this._positionBox),onDragMove:Function.createDelegate(this,this._positionBox),onloadCoords:B,displayOnInit:true,captureKeys:false})},ResetNoter:function(){this.set_noteMode(false);if(this._noteUI!==null){Sys.UI.DomElement.removeCssClass(this._noteUI.get_element(),"active");this._noteUI.get_element().style.left="-10000px";var A=$get("photoLeft");if(A){Sys.UI.DomElement.removeCssClass(A,"tagging")}}CropObject.remove();CropObject=null;this.set_photoLink(this.get_originalPhotoLink())},DeleteNote:function(B){this.ShowWaitingMessage(MySpace.PhotoAlbums.WaitingMessageType.Delete);var A=this.get_imageId();MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.DeleteNote(this.get_imageUserId(),A,B,Function.createDelegate(this,this._deleteCallback),this._failedCallbackHandler)},_deleteCallback:function(A){this.HideWaitingMessage();this._deleteNoteFromUI(A)},_deleteNoteFromUI:function(C){this.DeleteAllNotes();var E=PhotoNotes.length;var A=new Array();for(var B=0;B<E;B++){if(PhotoNotes[B].get_noteId()!==C){A.push(PhotoNotes[B])}PhotoNotes[B].dispose()}Array.clear(PhotoNotes);var D=A.length;for(var B=0;B<D;B++){this.AddExistingNote(A[B].get_x1(),A[B].get_y1(),A[B].get_x2(),A[B].get_y2(),A[B].get_note(),A[B].get_friendId(),A[B].get_noteId(),A[B].get_displayName(),A[B].get_approvalStatus(),A[B].get_noteUserId())}},_failedCallback:function(){this.HideWaitingMessage();this.ShowWaitingMessage(MySpace.PhotoAlbums.WaitingMessageType.Error)},DeleteAllNotes:function(){if(typeof(PhotoNotes)!=="undefined"){var F=PhotoNotes.length;for(var B=0;B<F;B++){var A=$get(B.toString());var D="inside"+B.toString();var C=$get(D);var G="highlightDiv"+B.toString();var E="highlightDiv2"+B.toString();if(A){this.get_element().removeChild(A);this.get_element().removeChild(C);this.get_element().removeChild($get(G));this.get_element().removeChild($get(E))}}this.get_noteCaptionList().get_element().innerHTML="";this.NoteCounter=-1}},_positionBox:function(G,F){var E=this.get_noteUI().get_element();var A=parseInt(E.style.width);var H=G.x1+F.width+10;var D=G.x1-A-35;var C=G.y1;Sys.UI.DomElement.addCssClass(E,"active");var B="right";if((H+A)>this.get_image().width){B="left"}switch(B){case"right":Sys.UI.DomElement.setLocation(E,H,C);break;case"left":Sys.UI.DomElement.setLocation(E,D,C);break}this.set_coords(G.x1,G.y1,G.x2,G.y2)},SaveStart:function(){var B=true;this.ShowWaitingMessage(MySpace.PhotoAlbums.WaitingMessageType.Save);var A=null;if(this.get_noteUI().get_emailInput()!==null){A=this.get_noteUI().get_emailInput().value.trim();if(A!==""&&A!==MySpaceRes.ViewMorePicsPage.EnterAnEmail){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.EmailToAFriend(this.get_noteUI().get_emailInput().value.trim(),this.get_imageId(),this._saveNoteHandler,this._failedCallbackHandler);B=false;return}}if(B){this._saveNote()}},_saveNote:function(C){var D=this.get_coords();if(D.x1<0||D.y1<0||D.x2<0||D.y2<0){this._failedCallbackHandler()}var B=MySpace.ClientContext.DisplayFriendId;if(this.get_displayFriendId()===0){B=this.get_currentUserId()}var E=true;for(var A=0;A<PhotoNotes.length;A++){if((PhotoNotes[A].get_approvalStatus()===MySpace.Media.Domain.TaggedPhotoApprovalStatus.Pending||PhotoNotes[A].get_approvalStatus()===MySpace.Media.Domain.TaggedPhotoApprovalStatus.Approved)&&PhotoNotes[A].get_friendId()===parseInt(this._noteUI.get_friendId().value)){E=false}}if(C!==null&&typeof(C)!=="undefined"){if(C!==""){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.SaveNote(B,this.get_imageId(),D.x1,D.y1,D.x2,D.y2,this._noteUI.get_friendId().value,this._noteUI.get_noteField().value,E,this._saveNoteCallbackHandler,this._failedCallbackHandler,C)}else{this.HideWaitingMessage();this.ShowWaitingMessage(MySpace.PhotoAlbums.WaitingMessageType.EmailError)}}else{if(typeof(C)==="undefined"){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.SaveNote(B,this.get_imageId(),D.x1,D.y1,D.x2,D.y2,this._noteUI.get_friendId().value,this._noteUI.get_noteField().value,E,this._saveNoteCallbackHandler,this._failedCallbackHandler)}else{this.HideWaitingMessage();this.ShowWaitingMessage(MySpace.PhotoAlbums.WaitingMessageType.EmailError)}}},_saveNoteCallback:function(I,B){if(I.error){this.HideWaitingMessage();this.ShowWaitingMessage(MySpace.PhotoAlbums.WaitingMessageType.TooManyFriends);return}if(I.note.length>0){var G=this.get_coords();this.NoteCounter++;var E=document.createElement("div");E.id=this.NoteCounter;this.get_element().appendChild(E);var D=parseInt(this._noteUI.get_friendId().value);var F;if(D===0){F={isEditMode:this.get_isEditMode(),x1:G.x1,y1:G.y1,x2:G.x2,y2:G.y2,note:I.note,friendId:D,noteId:I.noteId,noteUserId:this.get_currentUserId()}}else{F={isEditMode:this.get_isEditMode(),x1:G.x1,y1:G.y1,x2:G.x2,y2:G.y2,note:I.note,friendId:D,noteId:I.noteId,displayName:this._noteUI.get_noteField().value,approvalStatus:MySpace.Media.Domain.TaggedPhotoApprovalStatus.Pending,noteUserId:this.get_currentUserId()}}var H=$create(MySpace.PhotoAlbums.PhotoNote,F,null,null,E);PhotoNotes.push(H);var C=false;if(this.get_currentUserId()===D){C=true}var A;if(D===0){A=MySpace.PhotoAlbums.NoteCaptionList.createCaption(this.NoteCounter,H.get_noteId(),H.get_note(),D,this.get_profileURL(),this.get_imageUserId())}else{A=MySpace.PhotoAlbums.NoteCaptionList.createCaption(this.NoteCounter,H.get_noteId(),H.get_note(),D,this.get_profileURL(),this.get_imageUserId(),H.get_displayName(),C,I.noteUserId)}A.divNumber=this.NoteCounter;if(PhotoNotes.length===1){this.get_noteCaptionList().clearCaptionList()}this.get_noteCaptionList().add_note(A)}if(B===null){this.HideWaitingMessage();this.get_noteUI().CancelNoteAndReset();this.ShowWaitingMessage(MySpace.PhotoAlbums.WaitingMessageType.SingleNoteMode)}else{this.HideWaitingMessage();this.ShowWaitingMessage(MySpace.PhotoAlbums.WaitingMessageType.EmailSent,B)}if(this._scrollTop>0){window.scroll(0,this._scrollTop)}},AddExistingNote:function(D,L,C,K,J,G,B,M,F,O){this.NoteCounter++;var H=document.createElement("div");H.id=this.NoteCounter;this.get_element().appendChild(H);var I={isEditMode:this.get_isEditMode(),x1:D,y1:L,x2:C,y2:K,note:J,friendId:G,noteId:B,displayName:M,approvalStatus:F,noteUserId:O};var N=$create(MySpace.PhotoAlbums.PhotoNote,I,null,null,H);PhotoNotes.push(N);var E=false;if(this.get_currentUserId()===G){E=true}var A=MySpace.PhotoAlbums.NoteCaptionList.createCaption(this.NoteCounter,B,J,G,this.get_profileURL(),this.get_imageUserId(),M,E,O);A.divNumber=this.NoteCounter;if(PhotoNotes.length===1){this.get_noteCaptionList().clearCaptionList()}this.get_noteCaptionList().add_note(A);this.ToggleNotesIE6()},GetPhotoNotes:function(A){if(A===undefined){A=false}MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.GetNotes(this.get_imageUserId(),this.get_imageId(),this._processPhotoNoteHandler,this._processPhotoNoteHandler,{startNoting:A})},ToggleNotesIE6:function(){var B=$q("body.ie6 div.NoteListContainer");var A=(B.length===1)?($q("div.NoteListContainer span#NoteList span",B[0]).length>0):false;if(B.length===1){B[0].style.display=A?"block":"none"}},_processPhotoNotes:function(F,E){this.DeleteAllNotes();var G=PhotoNotes.length;for(var A=0;A<G;A++){PhotoNotes[A].dispose()}Array.clear(PhotoNotes);if(F.length>0){var D=Sys.Serialization.JavaScriptSerializer.deserialize(F);if(D.length>0){for(var C=0;C<D.length;C++){if(typeof(D[C].approvalStatus)!=="undefined"){this.AddExistingNote(D[C].x1,D[C].y1,D[C].x2,D[C].y2,D[C].note,D[C].notedFriendId,D[C].noteId,D[C].displayName,D[C].approvalStatus,D[C].noteUserId)}else{this.AddExistingNote(D[C].x1,D[C].y1,D[C].x2,D[C].y2,D[C].note,D[C].notedFriendId,D[C].noteId,D[C].noteUserId)}}}}else{var B=MySpace.Application.keyDisabled("PhotoABCTagging");if(this.get_currentUserId()===this.get_imageUserId()||(this.get_currentUserIsFriend()&&!B)){this.get_noteCaptionList().set_allowTagging(true)}this.get_noteCaptionList().ShowStartTagging()}this.ToggleNotesIE6();if(E.startNoting){this._redrawImageDivAndStart()}else{this.RedrawImageDiv()}},ShowWaitingMessage:function(F,J){this.HideWaitingMessage();var A=document.createElement("div");A.id="coverWrapper";coverStyle=A.style;coverStyle.width=this.get_element().style.width;coverStyle.height=this.get_element().style.height;coverStyle.top="0px";coverStyle.left="0px";coverStyle.zIndex="2005";coverStyle.position="absolute";this.get_element().appendChild(A);var H=document.createElement("div");H.id="coverUpDiv";H.className="saveBackground";var K=document.createElement("div");K.id="waitingDiv";K.style.left=((parseInt(this.get_image().width)/2)-75)+"px";var B=MySpace.StaticContentBase+"/modules/photoalbums/static/img/loadingmen.gif";switch(F){case MySpace.PhotoAlbums.WaitingMessageType.Save:K.innerHTML="<img src='"+B+"' align='middle' style='vertical-align: middle;'> <span>"+SavingMessage+"</span>";break;case MySpace.PhotoAlbums.WaitingMessageType.Delete:K.innerHTML="<img src='"+B+"' align='middle' style='vertical-align: middle;'> <span>"+DeletingMessage+"</span>";break;case MySpace.PhotoAlbums.WaitingMessageType.Approve:K.innerHTML="<img src='"+B+"' align='middle' style='vertical-align: middle;'> <span>"+SavingMessage+"</span>";break;case MySpace.PhotoAlbums.WaitingMessageType.Deny:K.innerHTML="<img src='"+B+"' align='middle' style='vertical-align: middle;'> <span>"+SavingMessage+"</span>";break;case MySpace.PhotoAlbums.WaitingMessageType.Load:K.innerHTML="<img src='"+B+"' align='middle' style='vertical-align: middle;'> <span>"+MySpaceRes.ViewMorePicsPage.Loading+"</span>";break;case MySpace.PhotoAlbums.WaitingMessageType.Error:K.innerHTML=" <span>"+ErrorMessage+"<br /><br /></span>";var G=document.createElement("input");G.type="button";G.value=CloseMessage;K.appendChild(document.createTextNode(""));K.appendChild(G);$addHandlers(G,{click:this.CloseErrorMessage},this);break;case MySpace.PhotoAlbums.WaitingMessageType.EmailSent:K.innerHTML=" <div><strong>"+MySpaceRes.ViewMorePicsPage.YourTagHasBeenAdded+"<br />"+J+"<br /><br /></div></strong>";var G=document.createElement("input");G.type="button";G.value=MySpaceRes.Common.Ok.toUpperCase();K.appendChild(document.createTextNode(""));K.appendChild(G);K.style.width=200+"px";$addHandlers(G,{click:this._closeWaitingSingleMode},this);break;case MySpace.PhotoAlbums.WaitingMessageType.EmailError:K.innerHTML=" <span>"+MySpaceRes.ViewMorePicsPage.NotValidEmails+"<br /><br /></span>";var G=document.createElement("input");G.type="button";G.value=CloseMessage;K.appendChild(document.createTextNode(""));K.appendChild(G);K.style.width=200+"px";$addHandlers(G,{click:this.CloseErrorMessage},this);break;case MySpace.PhotoAlbums.WaitingMessageType.SingleNoteMode:K.innerHTML=" <span><b>"+MySpaceRes.ViewMorePicsPage.YourTagHasBeenAddedSimple+"</b><br /><br /></span>";var I=document.createElement("input");I.type="button";I.style.width=175+"px";I.value=MySpaceRes.ViewMorePicsPage.Finished;var E=document.createElement("input");E.type="button";E.style.width=175+"px";E.value=MySpaceRes.ViewMorePicsPage.AddAnotherTag;K.appendChild(document.createTextNode(""));K.appendChild(I);K.appendChild(document.createElement("br"));K.appendChild(document.createElement("br"));K.appendChild(E);K.style.width=200+"px";$addHandlers(I,{click:this.CloseErrorMessageAndCancelNote},this);$addHandlers(E,{click:this._cancelAndTagAgain},this);break;case MySpace.PhotoAlbums.WaitingMessageType.TooManyFriends:K.innerHTML=" <span>"+MySpaceRes.ViewMorePicsPage.PopularPhoto+"<br /><br /></span>";var G=document.createElement("input");G.type="button";G.value=CloseMessage;K.appendChild(document.createTextNode(""));K.appendChild(G);$addHandlers(G,{click:this.CloseErrorMessageAndCancelNote},this);break}A.appendChild(H);A.appendChild(K);var C=PhotoNotes.length;for(var D=0;D<C;D++){PhotoNotes[D].RemoveEvents()}},HideWaitingMessage:function(){if($get("coverWrapper")){this.get_element().removeChild($get("coverWrapper"));if(this.get_noteMode()){Sys.UI.DomElement.addCssClass(this._noteUI._element,"active")}var B=PhotoNotes.length;for(var A=0;A<B;A++){PhotoNotes[A].AddEvents()}}},HideWaitingMessageAndShowFs:function(){MySpace.UI.addScript(MySpace.Photos.ScriptaculousPath,"Cropper.ready",Function.createDelegate(this,function(){this.HideWaitingMessage();this.ShowNoter()}))},CloseErrorMessage:function(){this.HideWaitingMessage();var B=PhotoNotes.length;for(var A=0;A<B;A++){PhotoNotes[A].AddEvents()}},CloseErrorMessageAndCancelNote:function(){this.CloseErrorMessage();if(Sys.UI.DomElement.containsCssClass(this.get_noteUI().get_element(),"active")){this.get_noteUI().CancelNoteAndReset();this.get_noteUI().style.left="-10000px"}var A=$get("photoLeft");if(A){Sys.UI.DomElement.removeCssClass(A,"tagging")}this._raiseEvent("taggingDone",Sys.EventArgs.Empty)},_cancelAndTagAgain:function(){this.HideWaitingMessage();if(Sys.UI.DomElement.containsCssClass(this.get_noteUI().get_element(),"active")){this.get_noteUI().CancelNoteAndReset();this.get_noteUI().style.left="-10000px"}this.StartNote()},_closeWaitingSingleMode:function(){this.HideWaitingMessage();this.ShowWaitingMessage(MySpace.PhotoAlbums.WaitingMessageType.SingleNoteMode)},getElementsByClassName:function(D,A){var C=($get(A)||document.body).getElementsByTagName("*");var F=[];var E=C.length;for(var B=0;B<E;B++){child=C[B];if(Sys.UI.DomElement.containsCssClass(child,D)){F.push(child)}}return F},dispose:function(){_captionList=null;_image=null;_noteUI=null;_noteCaptionList=null;_profileURL=null;_saveNoteHandler=null;_cancelNoteHandler=null;_coords=null;_currentUserId=0;_displayFriendId=0;_stillHideBoxes=true;_hideDelegate=null;_timeoutCookie=null;_originalPhotoLink=null;_imageAnchorHref=null;_elementLocation=null;this._emailBox=null;CropObject=null;PhotoNotes=null;MySpace.PhotoAlbums.PhotoNoteController.callBaseMethod(this,"dispose")}};MySpace.PhotoAlbums.PhotoNoteController.registerClass("MySpace.PhotoAlbums.PhotoNoteController",Sys.UI.Control);MySpace.PhotoAlbums.PhotoNote=function(A){MySpace.PhotoAlbums.PhotoNote.initializeBase(this,[A])};MySpace.PhotoAlbums.PhotoNote.prototype={_noteId:null,_x1:null,_y1:null,_x2:null,_y2:null,_note:null,_friendId:null,_noteUserId:null,_noteCounter:-1,_displayName:null,_approvalStatus:null,get_isEditMode:function(){return this._isEditMode},set_isEditMode:function(A){this._isEditMode=A},get_x1:function(){return this._x1},set_x1:function(A){this._x1=A},get_y1:function(){return this._y1},set_y1:function(A){this._y1=A},get_x2:function(){return this._x2},set_x2:function(A){this._x2=A},get_y2:function(){return this._y2},set_y2:function(A){this._y2=A},get_note:function(){return this._note},set_note:function(A){this._note=A},get_friendId:function(){return this._friendId},set_friendId:function(A){this._friendId=A},get_noteUserId:function(){return this._noteUserId},set_noteUserId:function(A){this._noteUserId=A},get_noteId:function(){return this._noteId},set_noteId:function(A){this._noteId=A},get_noteCounter:function(){return this._noteCounter},set_noteCounter:function(A){this._noteCounter=A},get_displayName:function(){return this._displayName},set_displayName:function(A){this._displayName=A},get_approvalStatus:function(){return this._approvalStatus},set_approvalStatus:function(A){this._approvalStatus=A},initialize:function(){this.get_element().innerHTML="&nbsp;";var B=this.get_x2()-this.get_x1();var H=this.get_y2()-this.get_y1();this.get_element().className="nonote";var I=this.get_element().style;I.left=parseInt(this.get_x1())+"px";I.top=parseInt(this.get_y1())+"px";I.height=H+"px";I.width=B+"px";I.position="absolute";I.zIndex=2000;var C=document.createElement("div");C.id="inside"+this.get_element().id;var E=C.style;E.left=(parseInt(this.get_x1())+1)+"px";E.top=(parseInt(this.get_y1())+1)+"px";E.height=(H-2)+"px";E.width=(B-2)+"px";E.display="none";E.zIndex=2;this.get_element().parentNode.appendChild(C);var G=this.get_element().id+"-"+this.get_element().id;this.get_element().linkId=G;var F=document.createElement("div");F.id="highlightDiv"+this.get_element().id;var J=F.style;F.className="NoteBorderHighlight";J.left=(parseInt(I.left)-1)+"px";J.top=(parseInt(I.top)-1)+"px";J.height=(parseInt(I.height)+2)+"px";J.width=(parseInt(I.width)+2)+"px";J.display="none";this.get_element().parentNode.appendChild(F);var A=document.createElement("div");A.id="highlightDiv2"+this.get_element().id;var D=A.style;A.className="NoteBorderHighlight";D.left=(parseInt(I.left)+2)+"px";D.top=(parseInt(I.top)+2)+"px";D.height=(parseInt(I.height)-4)+"px";D.width=(parseInt(I.width)-4)+"px";D.display="none";this.get_element().parentNode.appendChild(A);$addHandlers(this.get_element(),{mouseover:this.EditBoxMouseOver,mouseout:this.EditBoxMouseOut},this)},RemoveEvents:function(){$clearHandlers(this.get_element())},AddEvents:function(){$addHandlers(this.get_element(),{mouseover:this.EditBoxMouseOver,mouseout:this.EditBoxMouseOut},this)},EditBoxMouseOver:function(J){if(!J){J=window.event}var K=J.target?J.target:J.srcElement;$get(K.linkId).className="captionNoteHighlight";var C=PhotoNotes[K.id];var D=C.get_x2()-C.get_x1();var N=C.get_y2()-C.get_y1();var A=document.createElement("span");A.className="notelabel";if(C.get_friendId()===0){A.innerHTML=C.get_note()}else{var L=C.get_displayName().replace(/>/gi,"&gt;");L=L.replace(/</gi,"&lt;");L=L.replace(/'/gi,"&apos;");L=L.replace(/"/gi,"&quot;");A.innerHTML=L}var B=document.createElement("div");B.id="noteLabel"+K.id;B.style.left=C.get_x1()+"px";B.style.top=(C.get_y1()+N+3)+"px";B.className="notelabelwrapper";B.appendChild(A);K.parentNode.appendChild(B);var I="inside"+K.id;var E=$get(I);var F=$get(K.id.toString());var H="highlightDiv"+K.id;var G="highlightDiv2"+K.id;var O=$get(H);var M=$get(G);Sys.UI.DomElement.toggleCssClass(F,"nonote");Sys.UI.DomElement.toggleCssClass(F,"NoteBorder");Sys.UI.DomElement.toggleCssClass(E,"InsideNoteBorder");O.style.display="";M.style.display="";E.style.display=""},EditBoxMouseOut:function(E){if(!E){E=window.event}var D=E.target?E.target:E.srcElement;$get(D.linkId).className="";var H="noteLabel"+D.id;if($get(H)){D.parentNode.removeChild($get(H))}var B=$get(D.id.toString());var G="inside"+D.id;var A=$get(G);var F="highlightDiv"+D.id;var C="highlightDiv2"+D.id;Sys.UI.DomElement.toggleCssClass(B,"nonote");Sys.UI.DomElement.toggleCssClass(B,"NoteBorder");Sys.UI.DomElement.toggleCssClass(A,"InsideNoteBorder");$get(F).style.display="none";$get(C).style.display="none";A.style.display="none"},dispose:function(){$clearHandlers(this.get_element());MySpace.PhotoAlbums.PhotoNote.callBaseMethod(this,"dispose")}};MySpace.PhotoAlbums.PhotoNote.registerClass("MySpace.PhotoAlbums.PhotoNote",Sys.UI.Control);MySpace.PhotoAlbums.NoteUI=function(A){MySpace.PhotoAlbums.NoteUI.initializeBase(this,[A])};MySpace.PhotoAlbums.NoteUI.prototype={_MAX_NOTE_LENGTH:50,_noteField:null,_noteFieldDiv:null,_saveButton:null,_cancelButton:null,_friendId:null,_cancelNoteKeyDownHandler:null,_saveNoteHandler:null,_resetNoterHandler:null,_emailBox:null,_emailInput:null,_addFriendHandler:null,_enableTextTags:true,_canForwardToFriend:true,_myFriends:[],_imageUserId:null,_processFriendsListHandler:null,_myRecentFriends:[],get_noteFieldDiv:function(){return this._noteFieldDiv},set_noteFieldDiv:function(A){this._noteFieldDiv=A},get_noteField:function(){return this._noteField},set_noteField:function(A){this._noteField=A;this._noteField.className="notefield";this._noteField.maxlength=this._MAX_NOTE_LENGTH},get_saveButton:function(){return $get(this._saveButton)},set_saveButton:function(A){this._saveButton=A},get_cancelButton:function(){return $get(this._cancelButton)},set_cancelButton:function(A){this._cancelButton=A},get_friendId:function(){return $get(this._friendId)},set_friendId:function(A){this._friendId=A},get_saveNoteHandler:function(){return this._saveNoteHandler},set_saveNoteHandler:function(A){this._saveNoteHandler=A},get_resetNoterHandler:function(){return this._resetNoterHandler},set_resetNoterHandler:function(A){this._resetNoterHandler=A},get_emailBox:function(){return this._emailBox},set_emailBox:function(A){this._emailBox=A},get_emailInput:function(){return this._emailInput},set_emailInput:function(A){this._emailInput=A},get_addFriendHandler:function(){return this._addFriendHandler},set_addFriendHandler:function(A){this._addFriendHandler=A},get_enableTextTags:function(){return this._enableTextTags},set_enableTextTags:function(A){this._enableTextTags=A},get_canForwardToFriend:function(){return this._canForwardToFriend},set_canForwardToFriend:function(A){this._canForwardToFriend=A},get_myFriends:function(){return this._myFriends},set_myFriends:function(A){this._myFriends=A},get_myRecentFriends:function(){return this._myRecentFriends},set_myRecentFriends:function(A){this._myRecentFriends=A},get_imageUserId:function(){return this._imageUserId},set_imageUserId:function(A){this._imageUserId=A},add_taggingDone:function(A){this.get_events().addHandler("taggingDone",A)},remove_taggingDone:function(A){this.get_events().removeHandler("taggingDone",A)},add_friendsLoaded:function(A){this.get_events().addHandler("friendsLoaded",A)},remove_friendsLoaded:function(A){this.get_events().removeHandler("friendsLoaded",A)},_raiseEvent:function(B,A){var C=this.get_events().getHandler(B);if(C){if(!A){A=Sys.EventArgs.Empty}C(this,A)}},initialize:function(){if(this.get_enableTextTags()){$addHandlers(this.get_noteField(),{keydown:this.SaveNoteKeyDown},this);$addHandlers(this.get_saveButton(),{click:this.SaveNote},this)}else{this.get_saveButton().style.display="none"}$addHandlers(this.get_cancelButton(),{click:this._cancelSingleMode},this);this._cancelNoteKeyDownHandler=Function.createDelegate(this,this.CancelNoteKeyDown);$addHandler(document,"keydown",this._cancelNoteKeyDownHandler);this.set_addFriendHandler(Function.createDelegate(this,this._addAcFriend));this._processFriendsListHandler=Function.createDelegate(this,this._processFriendsList);var A=this.get_noteField();A.style.width=180+"px";A.value="";$addHandlers(A,{focus:this.ChangeNoteStyle,blur:this.ChangeNoteStyleBack},this);if(this.get_emailBox()!==null&&this.get_canForwardToFriend()){this.set_emailInput(this.get_emailBox().getElementsByTagName("input")[0]);this._emailBoxReset();$addHandlers(this.get_emailInput(),{focus:this._emailInputOnFocus,blur:this._emailInputOnBlur,keydown:this.SaveNoteKeyDown},this)}else{if(this.get_emailBox()!==null&&this.get_canForwardToFriend()===false){this.get_emailBox().parentNode.removeChild(this.get_emailBox())}}this.ChangeNoteStyleBack();Sys.UI.DomElement.removeCssClass(this.get_element(),"active");this.get_element().style.left="-10000px"},_raiseTaggingDone:function(){this._raiseEvent("taggingDone",Sys.EventArgs.Empty)},SaveNote:function(A){if(A){A.preventDefault()}var B=true;NotedFriend=this.get_friendId().value;Note=this.get_noteField();if(Note.value.length>50){Note.value=Note.value.substring(0,49)}if(Note.value===DefaultNote){B=false}if(Note.value.length===0&&NotedFriend==="0"){B=false}if(B){this.get_saveNoteHandler()()}},SaveNoteKeyDown:function(A){if(A.target.value.length>50){A.target.value=A.target.value.substring(0,49)}if(A.keyCode===Sys.UI.Key.enter){this.SaveNote()}},CancelNoteAndReset:function(){this.get_resetNoterHandler()();var B=$get("photoLeft");if(B){Sys.UI.DomElement.addCssClass(B,"tagging")}this.RemoveAcFriend();if(this.get_emailBox()!==null){this._emailBoxReset()}this.ChangeNoteStyleBack();var C=PhotoNotes.length;for(var A=0;A<C;A++){PhotoNotes[A].AddEvents()}},CancelNoteKeyDown:function(A){if(CropObject!==null){if(A.keyCode===Sys.UI.Key.esc){this.CancelNoteAndReset()}}},_cancelSingleMode:function(){Note=this.get_noteField();Note.value="";this.RemoveAcFriend();if(this.get_emailBox()!==null){this._emailBoxReset()}this.ChangeNoteStyleBack();this._raiseTaggingDone();var B=PhotoNotes.length;for(var A=0;A<B;A++){PhotoNotes[A].AddEvents()}},_addAcFriend:function(C,A){if(AcFriend===null){var B=this.get_noteField();AcFriend=A.get_value();this.get_friendId().value=AcFriend.UserId;B.value=(AcFriend.RealName.length>0?AcFriend.RealName:AcFriend.DisplayName);this.friendSelector.addRecentFriend(AcFriend);this.SaveNote()}},RemoveAcFriend:function(){var A=this.get_noteFieldDiv();AcFriend=null;this.get_noteField().value="";this.ChangeNoteStyleBack();this.get_friendId().value="0"},ChangeNoteStyle:function(){Note=this.get_noteField();if(Note.value===DefaultNote||Note.value===DefaultNoteNameOnly){Note.style.color="#000000";Note.value=""}},ChangeNoteStyleBack:function(){Note=this.get_noteField();if(Note.value.length===0){Note.style.color="#999999";if(this.get_enableTextTags()){Note.value=DefaultNote}else{Note.value=DefaultNoteNameOnly}}},_watchFriendSuggestions:function(B,A){if(this.get_enableTextTags()){if(A.completionItems.length>0){this.get_emailBox().style.display="none";B.get_completionList().style.display=""}else{this.get_emailBox().style.display="";B.get_completionList().style.display="none"}}},_emailInputOnFocus:function(){if(this.get_emailInput()!==null&&this.get_emailInput().value===MySpaceRes.ViewMorePicsPage.EnterAnEmail){this.get_emailInput().value="";this.get_emailInput().style.color="#000"}},_emailInputOnBlur:function(){if(this.get_emailInput()!==null&&this.get_emailInput().value.trim()===""){this._emailBoxReset()}},_emailBoxReset:function(){if(this.get_emailInput()!==null){this.get_emailInput().value=MySpaceRes.ViewMorePicsPage.EnterAnEmail;this.get_emailInput().style.color="#666";this.get_emailBox().style.display="none"}},_getFriendsList:function(A){MySpace.Web.Modules.PhotoAlbums.Services.PhotoNotes.GetFriendsList(A,this.get_imageUserId(),this._processFriendsListHandler,this._processFriendsListHandler,{canTagOwner:A})},_processFriendsList:function(B,A){if(B.friends.length>0){this.set_myFriends(Sys.Serialization.JavaScriptSerializer.deserialize(B.friends));if(B.recentlyTagged.length>0){this.set_myRecentFriends(Sys.Serialization.JavaScriptSerializer.deserialize(B.recentlyTagged))}this._raiseEvent("friendsLoaded");this.ShowFriendSuggest(A.canTagOwner)}},ShowFriendSuggest:function(A){MySpace.UI.addScript(MySpace.Photos.ScriptaculousPath,"MySpace.UI.FriendSelector",Function.createPartial(this,this._ShowFriendSuggest,A))},_ShowFriendSuggest:function(B){if(typeof(B)==="undefined"){B=true}if(this.get_myFriends().length===0){this._getFriendsList(B)}else{if(!this.friendSelector){var C=$get("friendSuggestInput");var A=this.get_enableTextTags()?DefaultNote:DefaultNoteNameOnly;$create(MySpace.UI.DefaultTextboxBehavior,{defaultValue:A},null,null,C);this.friendSelector=$create(MySpace.UI.FriendSelector,{completionItems:this.get_myFriends(),completionListAlwaysVisible:true,completionListFixedHeight:200,firstRowSelected:false,minimumPrefixLength:0,recentFriends:this.get_myRecentFriends(),recentFriendsLabel:MySpaceRes.ViewMorePicsPage.RecentlyTagged,allFriendsLabel:MySpaceRes.ViewMorePicsPage.AllFriends},{itemSelected:this.get_addFriendHandler(),populated:Function.createDelegate(this,this._watchFriendSuggestions)},null,C)}this._raiseEvent("friendsLoaded");this.friendSelector.set_value("")}}};MySpace.PhotoAlbums.NoteUI.registerClass("MySpace.PhotoAlbums.NoteUI",Sys.UI.Control);MySpace.PhotoAlbums.NoteCaptionList=function(A){MySpace.PhotoAlbums.NoteCaptionList.initializeBase(this,[A])};MySpace.PhotoAlbums.NoteCaptionList.prototype={_noteMode:null,_deleteNoteHandler:null,_allowTagging:null,get_noteMode:function(){return this._noteMode},set_noteMode:function(A){this._noteMode=A},get_isEditMode:function(){return this._isEditMode},set_isEditMode:function(A){this._isEditMode=A},get_deleteNoteHandler:function(){return this._deleteNoteHandler},add_deleteNoteHandler:function(A){this._deleteNoteHandler=A},get_cancelNoteHandler:function(){return this._cancelNoteHandler},add_cancelNoteHandler:function(A){this._cancelNoteHandler=A},get_allowTagging:function(){return this._allowTagging},set_allowTagging:function(A){this._allowTagging=A},initialize:function(){},clearCaptionList:function(){this.get_element().innerHTML=""},add_note:function(B){var C=this.get_element();if(C.childNodes.length>0){C.appendChild(document.createTextNode(", "))}C.appendChild(B);this.get_element().parentNode.style.display="";$addHandlers(B.childNodes[0],{mouseover:this.HighlightCaption,mouseout:this.HighlightCaption},this);var A=$q(".deleteTag",B,true);if(A){$addHandlers(A,{click:this.DeleteNote},this)}},HighlightCaption:function(G){if(!G){G=window.event}var H=G.target?G.target:G.srcElement;var I=$get(H.divNumber.toString());if(I!==null){var F="inside"+I.id;var E="highlightDiv"+I.id;var C="highlightDiv2"+I.id;var A=$get(E).style;var D=$get(C).style;var B=$get(F);if(A.display==="none"){E="highlightDiv"+I.id;C="highlightDiv2"+I.id;A.display="";D.display="";B.style.display="";Sys.UI.DomElement.toggleCssClass(I,"nonote");Sys.UI.DomElement.toggleCssClass(I,"NoteBorder");Sys.UI.DomElement.toggleCssClass(B,"InsideNoteBorder")}else{A.display="none";D.display="none";B.style.display="none";Sys.UI.DomElement.toggleCssClass(I,"nonote");Sys.UI.DomElement.toggleCssClass(I,"NoteBorder");Sys.UI.DomElement.toggleCssClass(B,"InsideNoteBorder")}}},DeleteNote:function(C){if(!C){C=window.event}var B=C.target?C.target:C.srcElement;var A=parseInt(B.noteId);this.get_deleteNoteHandler()(A)},ShowCaptions:function(){var C=this.get_element().childNodes;var A=C.length;if(A>0){for(var B=0;B<A;B++){if(C[B].style){C[B].style.display=""}}}},HideCaptions:function(){var C=this.get_element().childNodes;var A=C.length;if(A>0){for(var B=0;B<A;B++){if(C[B].style){C[B].style.display="none"}}}},ShowStartTagging:function(){if(MySpace.Application.keyDisabled("PhotoABCTagging")&&MySpace.ClientContext.DisplayFriendId!==0){this.get_element().parentNode.style.display="none"}else{if(this.get_allowTagging()){this.get_element().innerHTML="<a href='javascript:NotingObject.StartNote();'>"+MySpaceRes.ViewMorePicsPage.StartTagging+"</a>";this.get_element().parentNode.style.display=""}}},dispose:function(){var D=this.get_element();var B=D.getElementsByTagName("img");var C=B.Length;for(var A=0;A<C;A++){$clearHandlers(B[A])}MySpace.PhotoAlbums.NoteCaptionList.callBaseMethod(this,"dispose")}};MySpace.PhotoAlbums.NoteCaptionList.createCaption=function(L,A,I,F,E,G,K,C,M){var J=null;if(F===0){J=document.createElement("span");J.innerHTML=I}else{J=document.createElement("a");J.href=String.format(MySpace.Photos.Profile_Url,F);J.target="_blank";K=K.replace(/>/gi,"&gt;");K=K.replace(/</gi,"&lt;");K=K.replace(/'/gi,"&apos;");K=K.replace(/"/gi,"&quot;");J.innerHTML=K}J.id=L+"-"+L;J.divNumber=L;var D=document.createElement("span");D.id="wrapper"+L;D.className="captionWrapper";D.appendChild(J);var B=false;if(G===MySpace.ClientContext.UserId){B=true}var H=false;if(MySpace.ClientContext.UserId===M){H=true}if(H||C||B){var N=document.createElement("a");N.href="javascript:void(0);";N.className="photosSprite deleteTag";N.title=MySpaceRes.ViewMorePicsPage.Delete;N.noteId=A;N.id="deleteLink"+A;D.appendChild(document.createTextNode(" [ "));D.appendChild(N);D.appendChild(document.createTextNode(" ]"))}return D};MySpace.PhotoAlbums.NoteCaptionList.registerClass("MySpace.PhotoAlbums.NoteCaptionList",Sys.UI.Control);var NotingObject;MySpace.Application.add_DOMloaded(function(){var A=$create(MySpace.PhotoAlbums.NoteUI,{saveButton:"SaveNote",cancelButton:"CancelNote",noteField:$get("friendSuggestInput"),friendId:"friendId",emailBox:$get("EmailPhoto"),noteFieldDiv:$get("noteFieldDiv"),enableTextTags:((MySpace.ClientContext.UserId===MySpace.ClientContext.DisplayFriendId)||(MySpace.ClientContext.DisplayFriendId===0&&MySpace.ClientContext.UserId>0)),canForwardToFriend:MySpace.Photos.NoteUIProps.CanForward,imageUserId:MySpace.Photos.NoteUIProps.ImageUserId},null,null,$get("NotesBox"));NotingObject=$create(MySpace.PhotoAlbums.PhotoNoteController,{imageId:MySpace.Photos.NoteControllerProps.ImageID,isEditMode:true,noteUI:A,captionList:"NoteList",profileURL:MySpace.Photos.Profile_Url,currentUserId:MySpace.ClientContext.UserId,displayFriendId:MySpace.ClientContext.DisplayFriendId,originalPhotoLink:$get("hypImageNext").href,isAlbumPrivate:MySpace.Photos.NoteControllerProps.IsAlbumPrivate,privateAlbumDiv:$get("PrivateAlbumAlert"),canTagOwner:MySpace.Photos.NoteControllerProps.CanTagOwner,imageUserId:MySpace.Photos.NoteUIProps.ImageUserId},null,null,$get("ImageDiv"));if(typeof(AddExistingNotes)==="function"){AddExistingNotes()}});Type.registerNamespace("Templating");Templating.Template=function Templating_Template(E){this._templateContainer=E;if(!Templating.Template._regex){Templating.Template._regex=new RegExp("([^\\{]*)\\{([^\\}]+)\\}","g")}var D=[];var F=this._templateContainer.innerHTML.replace(/\n/g,"").replace(/%7B/g,"{").replace(/%7D/g,"}");this._format=F.replace(Templating.Template._regex,Function.createDelegate(this,function(H){var G=arguments[1];var J=arguments[2];if(J.substr(0,1)==="{"){return G+"{"+J+"}"}var I=J.split(":");Array.add(D,I[0]);I[0]=(D.length-1).toString();return G+"{"+I.join(":")+"}"}));var C=new Sys.StringBuilder();C.append("var container = document.createElement('div');");C.append("container.innerHTML = String.format(format");for(var B=0;B<D.length;B++){C.append(", data.");C.append(D[B])}C.appendLine(");");C.appendLine("var element = null;");C.appendLine("var itemContainer = $get('itemContainer', container);");C.appendLine("var children = itemContainer.childNodes;");C.appendLine("for (var i = 0; children.length; i++) {");C.appendLine("    if (children[i].nodeType == 1) { element = children[i]; break; }");C.appendLine("}");C.appendLine("if (element && callback) { callback(element, data, context); }");C.appendLine("return element;");var A=C.toString();this._compiledTemplate=new Function("format","data","callback","context",A)};Templating.Template.prototype={_templateContainer:null,_format:null,_compiledTemplate:null,get_templateContainer:function Templating_Template$get_templateContainer(){return this._templateContainer},createInstance:function Templating_Template$createInstance(B,C,A){return this._compiledTemplate(this._format,B,C,A)}};Templating.Repeater=function Templating_Repeater(A){Templating.Repeater.initializeBase(this,[A]);this._itemContainer$2=Sys.UI.DomElement.getElementById("itemContainer",A)};Templating.Repeater.prototype={_itemContainer$2:null,_data$2:null,_template$2:null,get_data:function Templating_Repeater$get_data(){return this._data$2},set_data:function Templating_Repeater$set_data(A){if(!this._data$2){this._data$2=A;return}this._update$2(A);return A},get_template:function Templating_Repeater$get_template(){if(this._template$2){return this._template$2.get_templateContainer()}return null},set_template:function Templating_Repeater$set_template(A){this._template$2=new Templating.Template(A);return A},addDataItem:function Templating_Repeater$addDataItem(A){if(this._template$2){var B=this._template$2.createInstance(A,null,null);if(B){Array.add(this._data$2,A);this._itemContainer$2.appendChild(B)}}},_update$2:function Templating_Repeater$_update$2(C){if((!C)||(!C.length)){this._itemContainer$2.innerHTML=""}else{if(!this._template$2){this._data$2=Array.clone(C);return}this._data$2=[];var B=this._itemContainer$2.tagName;if((window.navigator.userAgent.indexOf("MSIE")<0)||((B!=="TABLE")&&(B!=="TBODY")&&(B!=="TR"))){this._itemContainer$2.innerHTML=""}else{for(var A=this._itemContainer$2.childNodes.length-1;A>=0;A--){this._itemContainer$2.removeChild(this._itemContainer$2.childNodes[A])}}for(var A=0;A<C.length;A++){this.addDataItem(C[A])}}}};Templating.Template.registerClass("Templating.Template");Templating.Repeater.registerClass("Templating.Repeater",Sys.UI.Control);Templating.Template._regex=null;