ComCore.PhotoScroller={};ComCore.PhotoScroller.AD_RELOAD_TIME=60000;ComCore.PhotoScroller.AD_RELOAD_ENABLED=true;ComCore.PhotoScroller.PRELOAD_THUMBS_OUTSIDE_OF_VIEWPORT=3;ComCore.PhotoScroller.SCROLL_DELAY=0.1;ComCore.PhotoScroller.PhotoNode=Class.create();ComCore.PhotoScroller.Controller=Class.create();ComCore.PhotoScroller.MetaController=Class.create();ComCore.PhotoScroller.AdController=Class.create();ComCore.PhotoScroller.Helper={buildImagePath:function(B){var A=ComCore.Page.str_pad(B,9,0,"STR_PAD_LEFT");return(ComCore.Configuration.get("photoURL")||ComCore.Configuration.get("photoStaticURL"))+"/p/tt/"+A.substr(0,3)+"/"+A.substr(3,3)+"/"+B+".jpg"},array_merge:function(B,A){return B.concat(A)}};ComCore.PhotoScroller.Photo=Class.create({initialize:function(A,B){this.photoId=A;this.thumbnailUrl=B;this.fullUrl=B.replace(/p\/tt/,"p/oo")},_eoo:true});ComCore.PhotoScroller.IframeWrapper=Class.create({initialize:function(){this.element=$("preloadSkyscraperIframeWrapper");this._visible=false},hide:function(){this.element.setStyle({visibility:"hidden",position:"absolute"});this._visible=false},show:function(){this.element.setStyle({visibility:"visible",position:""});this._visible=true},visible:function(){return this._visible},_eoo:true});ComCore.PhotoScroller.AdController.prototype={initialize:function(A){this.interval=ComCore.PhotoScroller.AD_RELOAD_TIME||20000;window.setInterval(function(){ComCore.Ads.getAd("SKYSCRAPER",160,600,"adSkyscraperWrapper")},this.interval)},_eoo:true};ComCore.PhotoScroller.MetaController.prototype={initialize:function(A){this.controller=A;this.controller.observe("onNewPicture",this.onNewPicture.bind(this));this.controller.observe("onCommentFormSubmitCallBack",this.onCommentSubmit.bind(this));this.controller.observe("onInitPhotoList",this.onInitPhotoList.bind(this));this.metaStore=$H();this.requesting=[];this.globalCallbacks=$H();ComCore.Ratings.observe("onRatingLinkClicked",this.onResetMetaCache.bind(this));PhotoNoteManager.observe("onResetCache",this.resetCache.bind(this));this.photoDescriptionDetails=$("photoDescriptionDetails");this.photoEditLinks=$("photoEditLinks");this.photoSetsContainer=$("photoSetsContainer");this.photoTagsContainer=$("photoTagsContainer");this.commentItemId=$("commentItemID");this.ratingLinks=$$("#ratings ul li a");this.premiumStatistics=$$("#content a.buttonStatistics").first();this.manage=$("curPhotoEditLink1")},onResetMetaCache:function(){var B=this.controller.currentPhotoId;var A=this.metaStore.get(B);A.editLinks=this.photoEditLinks.innerHTML},resetCache:function(C,B,D){var A=this.metaStore.get(B);if(A){D.each(function(E){A[E.key]=E.value})}},onCommentSubmit:function(A){var C=this.controller.currentPhotoId;var B=this.metaStore.get(C);if(B){B.comments=$("commentList").innerHTML}},onInitPhotoList:function(D){var A={};var E,C,L,J,F,H="";var G=$("commentList");if(G){C="<div id='commentList'>"+G.innerHTML+"</div>"}var K=$("photoDescriptionDetails");if(K){L=K.innerHTML}if(this.photoEditLinks){J=this.photoEditLinks.innerHTML}if(this.photoSetsContainer){F=this.photoSetsContainer.innerHTML}if(this.photoTagsContainer){H=this.photoTagsContainer.innerHTML}var B=$("notesJSON");if(B){try{E=$("notesJSON").innerHTML.trim().evalJSON()}catch(I){}if(E){E.each(function(M){if(M.userHTML){M.userHTML=M.userHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}}A[D.photo.photoId]={photoDescriptionHtml:L,editLinks:J,setsHtml:F,tagsHtml:H,photoCommentsHtml:C,notes:E};this.setDetails(A);this.changePhotoNotes(D.photo.photoId,A[D.photo.photoId]);this.fetchMetaData()},onNewPicture:function(A){if(this.premiumStatistics){this.premiumStatistics.setAttribute("href",this.premiumStatistics.href.replace(/photoid=(\d+)/,"photoid="+A.photo.photoId))}if(this.manage){this.manage.setAttribute("href",this.manage.href.replace(/photoid=(\d+)/,"photoid="+A.photo.photoId))}if(this.ratingLinks){this.ratingLinks.each(function(B){B.setAttribute("href",B.href.replace(/photoid=(\d+)/,"photoid="+A.photo.photoId))})}this.requestMetaData()},requestMetaData:function(B){var D=B||this.controller.currentPhotoId;var C=this.metaStore.get(D);var E=(function(F){this.setCurrentPhotoListDetails()}).bind(this);if(!C){this.controller.disableControls=true;var A=new Effect.Opacity($$("div.right180").first(),{from:1,to:0.5,duration:0.1});this.fetchMetaData([E])}else{E(C)}},setData:function(C,A,D){var B=this.metaStore.get(C);if(B){B[A]=D}},setCurrentPhotoListDetails:function(){var D=this.controller.currentPhotoId;var C=this.metaStore.get(D);this.controller.commentsControl.setItemID(D);var B=$("reportAbuseButton");if(B){B.stopObserving();B.observe("click",function(J){J.stop();B.toggle()})}if(C){this.controller.disableControls=false;var E=new Effect.Opacity($$("div.right180").first(),{from:0.5,to:1,duration:0.1});if(ComCore.LoadingIndicator._isShown===true){ComCore.LoadingIndicator.hide()}var F=$("addNoteButton");if(F){F.remove()}this.photoDescriptionDetails.update(C.description);this.photoEditLinks.update(C.editLinks);this.photoSetsContainer.update(C.setContainer);this.photoTagsContainer.update(C.tagContainer);var G=this.photoDescriptionDetails.down("p.body");if(G){document.title=G.innerHTML.replace(/(<([^>]+)>)/ig,"")}else{document.title=this.controller.originalTitle}var I=$$("form.commentform textarea");if(I&&(I.length>0)){var H=I.first();H.value=(C.commentForm!==undefined)?C.commentForm:""}$("commentsWrapper").childElements().each(function(J){if(J.hasClassName("commentFormWrapper")===false){J.remove()}});$$("#commentsWrapper div.statusMessage").invoke("remove");var A=$$("#commentsWrapper div.commentFormWrapper").first();if(A){A.insert({before:C.comments})}this.commentItemId=$("commentItemID");if(this.commentItemId){this.commentItemId.value=D}this.changePhotoNotes(D,C)}else{ComCore.LoadingIndicator.show()}},changePhotoNotes:function(C,B){if(this.controller.photoNoteManager){this.controller.photoNoteManager.photoID=C;$("noteText").hide();this.controller.photoNoteManager.resetNotes();this.controller.photoNoteManager.img=$("photoNote");this.controller.photoNoteManager.loadNotes(B.notes||0);this.controller.photoNoteManager.editNoteID=0;var A=$("addNoteButton");if(A){A.stopObserving();A.observe("click",this.controller.photoNoteManager.onAddNote.bindAsEventListener(this.controller.photoNoteManager))}}},fetchMetaData:function(A){var E=this.controller.currentPhotoId;var F=this.controller.getSurroundingPhotoNodes(E,5);var C;F=F.reject(function(G){return(this.metaStore.get(G.photo.photoId)!==undefined)},this);var B=F.collect(function(G){return G.photo.photoId});if(this.controller.startPhotoId!==E){B.push(E)}if(this.requesting.indexOf(E)>-1){ComCore.LoadingIndicator.show();this.globalCallbacks.set(E,(function(){this.requestMetaData(E)}).bind(this))}B=B.findAll(function(G){return(this.requesting.indexOf(G)===-1)},this);this.requesting=ComCore.PhotoScroller.Helper.array_merge(this.requesting,B);if(B.length>0){C=ComCore.Page.buildAjaxURL("photos","getPhotoDetails")+"&ownerid="+ComCore.Profile.getUserID()+"&photoids="+B}var D=new Ajax.Request(C,{method:"get",onComplete:this.onPhotoDetailsLoaded.bindAsEventListener(this,E,A,B)})},onPhotoDetailsLoaded:function(D,C,A,B){var F;try{F=D.responseText.evalJSON()}catch(E){return }this.requesting=this.requesting.reject(function(G){return(B.indexOf(G)>-1)});this.setDetails(F);if(A){A.each(function(G){G(this.metaStore.get(C))},this)}this.globalCallbacks.each(function(G){if(B.indexOf(parseInt(G.key,10))>-1){if(Object.isFunction(G.value)){G.value()}this.globalCallbacks.unset(G.key)}})},setDetails:function(A){if(A){$H(A).each(function(C){var B={description:C.value.photoDescriptionHtml,editLinks:C.value.editLinks,setContainer:C.value.setsHtml,tagContainer:C.value.tagsHtml,comments:C.value.photoCommentsHtml,notes:C.value.notes};this.metaStore.set(C.key,B)},this)}},_eoo:true};ComCore.PhotoScroller.PhotoNode.prototype={initialize:function(B,D,A,E,C){this.controller=A;this.hasPreloaded=false;this.insertPosition=C;if(this.insertPosition===undefined){this.insertPosition="AFTER"}this.photo=new ComCore.PhotoScroller.Photo(B,D);this.createThumbnailPlaceholder();if(E!==false){this.preload()}},createThumbnailPlaceholder:function(){var E;var G=$("photoCarouselList");var F=G.down("li.carousel_"+this.photo.photoId);if(!F){F=new Element("li",{id:"carousel_"+this.photo.photoId}).addClassName("carousel_"+this.photo.photoId);E=new Element("a",{href:ComCore.Profile.getUrl()+"/photos/photoid="+this.photo.photoId+"&surr=0#photos",id:"photoCarousel"+this.photo.photoId+"_link"}).addClassName("photoid_"+this.photo.photoId);if(this.photo.photoId>0){F.insert(E)}else{F.insert(new Element("a"));F.setStyle({visibility:"hidden"})}}else{E=F.down("a")}var B=this.controller.photoBlock.indexOf(this.photo.photoId);var D=this.controller.photoBlock.indexOf(this.controller.currentPhotoId);if(((D-B)>2)&&(this.insertPosition==="AFTER")){if(this.photo.photoId){G.setStyle({right:(((D-B)-2)*this.controller.getPictureWidth())+"px"})}}var H=$("photoCarouselList").childElements().length+5;var C=(H*this.controller.getPictureWidth());G.setStyle({width:C+"px"});if(this.insertPosition==="AFTER"){G.insert(F)}else{if(this.insertPosition==="NONE"){}else{var I=parseInt(G.getStyle("right").replace("px",""),10)||0;G.insert({top:F});var A=I+this.controller.getPictureWidth();G.setStyle({right:A+"px"})}}this.thumbnail=F;this.link=E},preload:function(){if((this.hasPreloaded===false)&&(this.photo.photoId>0)){this.hasPreloaded=true;this.img=new Element("img",{src:this.photo.fullUrl});$("preloadedImagesStash").insert(this.img);var A=this.link.down("img");if(!A){var B=new Element("img",{src:this.photo.thumbnailUrl});this.link.insert(B)}}},_eoo:true};ComCore.PhotoScroller.ScrollController=Class.create({initialize:function(A){this.controller=A;this.currentPosition=this.controller.beginPosition;this.isBusyScrolling=false;this.queue=[];this.pollInterval=0;this.isPressingKey=0;this.keyPressStart=0;this.timerInterval=200;this.previousLink=$("photoCarouselPrev");this.nextLink=$("photoCarouselNext");this.list=$("photoCarouselList");this.navigationHash=this.getNavigationHash();this.currentPhotoId=this.controller.currentPhotoId;if(this.previousLink){this.previousLink.observe("click",this.onPreviousClick.bind(this))}if(this.nextLink){this.nextLink.observe("click",this.onNextClick.bind(this))}this.observeNavigation();this.controller.observe("onNewPicture",this.onNewPicture.bind(this));this.controller.observe("onNewBlock",this.updatePosition.bind(this));document.observe("keyup",this.onKeyUp.bind(this));document.observe("keydown",this.onKeyDown.bind(this))},onNewPicture:function(A){var B=parseInt(this.controller.currentPhotoId,10);var C=parseInt(this.fetchOriginalPhotoIdFromURL(),10);if(B!==C){this.navigationHash=B;ComCore.History.set("/"+ComCore.Profile.getNickname()+"/photos/photoid="+B)}},getNavigationHash:function(){var A=window.location.hash.match(/\/photos\/photoid=(\d+)(?:&)?/i);if(A&&A[1]){return parseInt(A[1],10)}else{var B=this.fetchOriginalPhotoIdFromURL();if(B&&(B>0)){return parseInt(B,10)}}return 0},fetchOriginalPhotoIdFromURL:function(){var A=window.location.href.match(/photoid=(\d+)#?/i);if(A&&A[1]){return parseInt(A[1],10)}return false},observeNavigation:function(){ComCore.History.observe("onChange",this.onNavigationChange.bind(this))},onNavigationChange:function(){var A=this.getNavigationHash();if(this.navigationHash!==A){this.notify("onNavigationChange",A);this.navigationHash=A}},onKeyDown:function(A){if((this.isPressingKey===false)&&((A.keyCode===Event.KEY_RIGHT)||(A.keyCode===Event.KEY_LEFT))){this.isPressingKey=true;this.keyPressStart=new Date().getTime();this.pollInterval=window.setTimeout(this.pollKey.bind(this,A),this.timerInterval)}},pollKey:function(A){if(this.isPressingKey===true){this.handleKey(A)}else{if(this.pollInterval){return }}this.timerInterval=Math.abs(140-(Math.round((new Date().getTime()-this.keyPressStart)/1000))*7);this.timerInterval=(this.timerInterval<=50)?50:this.timerInterval;this.pollInterval=window.setTimeout(this.pollKey.bind(this,A),this.timerInterval)},onKeyUp:function(A){if((A.keyCode===Event.KEY_RIGHT)||(A.keyCode===Event.KEY_LEFT)){this.handleKey(A);this.queue=[]}this.isPressingKey=false},handleKey:function(A){A=A||window.event;if(!A){return }if(A.findElement("form")){return false}switch(A.keyCode){case Event.KEY_RIGHT:this.onNavigationClick("GO_RIGHT");A.stop();break;case Event.KEY_LEFT:this.onNavigationClick("GO_LEFT");A.stop();break}},onPreviousClick:function(A){A.stop();this.onNavigationClick("GO_LEFT")},onNextClick:function(A){A.stop();this.onNavigationClick("GO_RIGHT")},highlightPreviousNextLinks:function(B){var A=B?this.previousLink:this.nextLink;A.addClassName("busyScrolling")},doScroll:function(F){this.highlightPreviousNextLinks(F<0);if(this.isBusyScrolling){this.queue.push(F);return }this.isBusyScrolling=true;var C=this.list.getStyle("right");if(C===null){C="0px"}var G=parseInt(C.replace("px",""),10);var B=(F*this.controller.getPictureWidth());var A=this.controller.photos[this.currentPosition].thumbnail;if((this.currentPosition+F)>=this.controller.photos.length){this.isBusyScrolling=false;this.removeHighlights();return false}if((this.currentPosition+F)<0){this.isBusyScrolling=false;this.removeHighlights();return false}if(this.controller.photos[this.currentPosition+F].photo.photoId<=0){this.isBusyScrolling=false;this.removeHighlights();return }var E=$$("form.commentform textarea");if(E&&(E.length>0)){this.controller.metaController.setData(this.controller.photos[this.currentPosition].photo.photoId,"commentForm",E.first().value)}this.currentPosition+=F;var D=this.controller.photos[this.currentPosition].thumbnail;this.controller.currentPhotoId=this.controller.photos[this.currentPosition].photo.photoId;this.currentPhotoNode=this.controller.photos[this.currentPosition];ComCore.PhotoScroller.ScrollEffect.create(this.list,G,G+B,this.onScrollEffectDone.bindAsEventListener({previous:A,next:D,that:this}))},updatePosition:function(){this.currentPosition=this.controller.photoBlock.indexOf(this.controller.currentPhotoId)},onNavigationClick:function(A){ComCore.trackPageview(window.location);var B=(A==="GO_RIGHT")?1:-1;this.doScroll(B)},onScrollEffectDone:function(A){var E=this.that;E.isBusyScrolling=false;if(E.queue.length>0){E.doScroll(E.queue.shift())}this.previous.removeClassName("active");this.next.addClassName("active");E.notify("onScrollEffectDone",this.next);var D=E.controller.getPreloadIds();var B=(function(G){return E.controller.photosCollection.get(parseInt(G,10))}).bind(E);for(var C=0;C<D.length;C++){var F=B(D[C]);if(F){F.preload()}}E.removeHighlights()},removeHighlights:function(){[this.previousLink,this.nextLink].invoke("removeClassName","busyScrolling")},_eoo:true});ComCore.Events.extend(ComCore.PhotoScroller.ScrollController);ComCore.PhotoScroller.ScrollEffect={create:function(B,E,C,D){if(Prototype.Browser.IE===true){B.setStyle({right:C+"px"});D();return }var A=new Effect.Tween(B,E,C,{afterFinish:function(){D()},duration:ComCore.PhotoScroller.SCROLL_DELAY},function(F){B.setStyle({right:F+"px"})})}};ComCore.PhotoScroller.Controller.prototype={initialize:function(B){this.photos=$A();this.photosCollection=$H();PhotoNoteManager.observe("onNotesReady",this.registerPhotoNoteManager.bind(this));this.photoNoteManager=new PhotoNoteManager("photoNote",false);this.commentsControl=B;this.photoBaseUrl=$("photoBaseUrl").value;this.photoBlockPage=parseInt($("photoBlockPage").value,10);this.fetchNewBatches=($("fetchNewBatches")!==null);this.selectedPicture=$$("#photoCarouselList li.active").first();this.currentPhotoId=this.getCurrentPhotoId();this.startPhotoId=this.currentPhotoId;this.photoBlock=$("photoBlock").value.split(",").collect(function(E){return parseInt(E,10)||0});this.beginPosition=this.photoBlock.indexOf(this.currentPhotoId);this.disableControls=false;this.padding=this.addPadding=0;this.requestedBlocks={};this.originalTitle=$("photoNote").getAttribute("alt")||"";if((this.photoBlock.length-this.beginPosition)<3){this.padding=(2-((this.photoBlock.length-1)-this.beginPosition));for(var D=0;D<this.padding;D++){this.photoBlock.push(-D)}}if(this.beginPosition<3){this.addPadding=2-this.beginPosition;for(var C=0;C<this.addPadding;C++){this.photoBlock.unshift(-C-5)}}debug("padding "+this.padding+" : "+this.addPadding);$$("#photoCarouselList li.carousel_").invoke("remove");var A=$("photoDragAreaDiv");if(A){A.observe("click",this.onNextPhoto.bind(this))}$$("div.right180").first().observe("click",this.onControlClick.bind(this));this.scrollController=new ComCore.PhotoScroller.ScrollController(this);this.scrollController.observe("onNavigationChange",this.onNavigationChange.bind(this));ComCore.PhotoScroller.ScrollController.observe("onScrollEffectDone",this.onScrollEffectDone.bind(this));this.metaController=new ComCore.PhotoScroller.MetaController(this);this.initPhotoList();debug("photoScroller is ready")},onControlClick:function(A){if(this.disableControls===true){A.stop()}},registerPhotoNoteManager:function(){this.photoOverlay=$("photoOverlayDiv");this.photoNoteDragArea=$("photoDragAreaDiv");this.photoNoteWrapper=$("photoWrapperDiv");this.photoNoteManagerElement=$("noteManager")},onNextPhoto:function(A){if(!A.findElement("div.note")){A.stop();this.scrollController.onNavigationClick("GO_RIGHT")}},getPictureWidth:function(){return 92},onNavigationChange:function(A){if(this.photoBlock.indexOf(A)===-1){return false}this.showPicture(A)},getCurrentPhotoId:function(){return parseInt(this.selectedPicture.getClassData("carousel"),10)},onScrollEffectDone:function(C,A){var B=parseInt(A.getClassData("carousel"),10);this.displayFullPicture(B)},initPhotoList:function(){var G=this.photoBlock.indexOf(this.currentPhotoId);var E=this.photoBlock.reject(function(H){return(parseInt(H,10)<=0)});for(var A=0;A<this.photoBlock.length;A++){var C=parseInt(this.photoBlock[A],10);var D=E.indexOf(C);var F=(Math.abs(D-this.beginPosition)<5);this.preparePicture(C,F,"AFTER")}this.photoBlock=E;if((G-2)>1){$("photoCarouselList").setStyle({right:((G-2)*this.getPictureWidth())+"px"})}var B=this.photosCollection.get(parseInt(this.currentPhotoId,10));this.notify("onInitPhotoList",B)},getSurroundingPhotoNodes:function(E,B){var D=$A();var A=this.photoBlock.indexOf(E);for(var C=1;C<=B;C++){D.push(this.photoBlock[A-C]||this.photoBlock[this.photoBlock.length-C]);D.push(this.photoBlock[A+C]||this.photoBlock[C])}D=D.uniq();return D.compact().collect(function(F){return this.photosCollection.get(parseInt(F,10))},this)},preparePicture:function(B,E,C){var D=ComCore.PhotoScroller.Helper.buildImagePath(B);var A=new ComCore.PhotoScroller.PhotoNode(B,D,this,E,C);if(B>0){this.photos.push(A);this.photosCollection.set(B,A)}if(A.link){A.link.observe("click",this.onPhotoClick.bind(this))}},onPhotoClick:function(B){B.stop();var A=B.findElement("a");var C=parseInt(A.getClassData("photoid"),10);this.showPicture(C)},showPicture:function(C){var B;for(var A=0;A<this.photos.length;A++){if(this.photos[A].photo.photoId===C){B=A;break}}var D=(B-this.scrollController.currentPosition);if(D!==0){this.scrollController.doScroll(D)}},displayFullPicture:function(E){var D=this.photosCollection.get(parseInt(E,10));if(D){if(D.img===undefined){debug("Error! empty img for photonode "+E);return }var B=D.img;$$("#photoPlaceHolder img").invoke("remove");var C=$("photoNote");if(C){C.remove()}B.setAttribute("id","photoNote");$("photoWrapperDiv").insert({top:B});var F=B.width+"px";var A=B.height+"px";this.photoNoteDragArea.style.width=this.photoNoteWrapper.style.width=this.photoNoteManagerElement.style.width=F;this.photoNoteDragArea.style.height=this.photoNoteWrapper.style.height=this.photoNoteManagerElement.style.height=A;this.notify("onNewPicture",D)}},getPreloadIds:function(){var F=[];var A=this.photoBlock.indexOf(this.currentPhotoId);if(A<0){debug("Error: could not find current photoId ("+this.currentPhotoId+") in photoBlock ");debug(this.photoBlock)}for(var D=A-3;D>(A-3-ComCore.PhotoScroller.PRELOAD_THUMBS_OUTSIDE_OF_VIEWPORT);D--){if(this.photoBlock[D]){F.push(this.photoBlock[D])}}for(var C=A+3;C<(A+ComCore.PhotoScroller.PRELOAD_THUMBS_OUTSIDE_OF_VIEWPORT+3);C++){if(this.photoBlock[C]){F.push(this.photoBlock[C])}}var B=(A<(3+ComCore.PhotoScroller.PRELOAD_THUMBS_OUTSIDE_OF_VIEWPORT));var E=(A>(this.photoBlock.length-3-ComCore.PhotoScroller.PRELOAD_THUMBS_OUTSIDE_OF_VIEWPORT));if(B||E){if(this.fetchNewBatches===true){this.goFetchNewPictures(B===true)}}return F},goFetchNewPictures:function(D){var E=D?"LEFT":"RIGHT";var C=D?this.photoBlock[0]:this.photoBlock[this.photoBlock.length-1];if(this.requestedBlocks[C]===undefined){this.requestedBlocks[C]=true;var A=ComCore.Page.buildAjaxURL("photos","getNewBlock")+"&photoId="+C+"&direction="+E;var B=new Ajax.Request(A,{method:"get",onComplete:this.onGetNewBlock.bind(this)})}},onGetNewBlock:function(D){var H;try{H=D.responseText.evalJSON()}catch(F){debug(F)}var A=H.photoIDs;var I=H.direction;var B=H.photoID;var G;if(I==="LEFT"){for(var E=1;E>=0;E--){G=parseInt(A[E],10);this.photoBlock.unshift(G);this.preparePicture(G,true,"BEFORE")}}else{for(var C=0;C<A.length;C++){G=parseInt(A[C],10);this.photoBlock.push(G);this.preparePicture(G,true,"AFTER")}}this.notify("onNewBlock")},_eoo:true};ComCore.Events.extend(ComCore.PhotoScroller.Controller);