try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.Service=new JsonFx.IO.Service("/Features/Media/MediaService.jrpc");MF.Media.Service.addToAlbum=function(albumId,mediaIdList,opt){this.invoke("addToAlbum",[albumId,mediaIdList],opt);};MF.Media.Service.addContentToAlbums=function(contentID,albumIDList,opt){this.invoke("addContentToAlbums",[contentID,albumIDList],opt);};MF.Media.Service.getAlbumList=function(start,count,opt){this.invoke("getAlbumList",[start,count],opt);};MF.Media.Service.getAlbumMedia=function(albumId,start,count,opt){this.invoke("getAlbumMedia",[albumId,start,count],opt);};MF.Media.Service.getArrangeableAlbumMedia=function(albumId,start,count,opt){this.invoke("getArrangeableAlbumMedia",[albumId,start,count],opt);};MF.Media.Service.getAlbums=function(start,count,searchQuery,sortColIdx,sortAscending,userIDs,opt){this.invoke("getAlbums",[start,count,searchQuery,sortColIdx,sortAscending,userIDs],opt);};MF.Media.Service.getRecentAlbums=function(start,count,opt){this.invoke("getRecentAlbums",[start,count],opt);};MF.Media.Service.getEditableMedia=function(start,count,strSourceID,type,opt){this.invoke("getEditableMedia",[start,count,strSourceID,type],opt);};MF.Media.Service.getMedia=function(realStartIdx,count,contentType,searchQuery,sortColIdx,sortAscending,displayedStartIdx,userIDs,opt){this.invoke("getMedia",[realStartIdx,count,contentType,searchQuery,sortColIdx,sortAscending,displayedStartIdx,userIDs],opt);};MF.Media.Service.getMediaNotInAlbum=function(albumId,start,count,contentType,opt){this.invoke("getMediaNotInAlbum",[albumId,start,count,contentType],opt);};MF.Media.Service.getPrevNextSlide=function(contentId,albumId,shareId,opt){this.invoke("getPrevNextSlide",[contentId,albumId,shareId],opt);};MF.Media.Service.getPrevNextMedia=function(contentId,albumId,shareId,opt){this.invoke("getPrevNextMedia",[contentId,albumId,shareId],opt);};MF.Media.Service.createAlbum=function(title,description,opt){this.invoke("createAlbum",[title,description],opt);};MF.Media.Service.deleteMedia=function(contentID,opt){this.invoke("deleteMedia",[contentID],opt);};MF.Media.Service.pinContent=function(contentID,pin,opt){this.invoke("pinContent",[contentID,pin],opt);};MF.Media.Service.removeFromAlbum=function(albumID,contentID,opt){this.invoke("removeFromAlbum",[albumID,contentID],opt);};MF.Media.Service.saveMedia=function(images,videos,albumIDs,albumName,opt){this.invoke("saveMedia",[images,videos,albumIDs,albumName],opt);};MF.Media.Service.saveAlbumOrder=function(albumID,pages,opt){this.invoke("saveAlbumOrder",[albumID,pages],opt);};MF.Media.Service.updateMedia=function(sourceID,sourceType,media,opt){this.invoke("updateMedia",[sourceID,sourceType,media],opt);};MF.Media.Service.saveRotate=function(contentID,orientation,displayGuid,authHash,opt){this.invoke("saveRotate",[contentID,orientation,displayGuid,authHash],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumPicker=JsonML.BST(["ul",{"class":"add-album-list js-AlbumPicker",style:function(){return(this.data.items||[]).length?null:"display:none";}}," ",function(){return JsonML.BST([""," ",["li",function(){return this.data.label;}," ",["a",{"class":"negative",href:"#remove",onclick:function(){return MF.Media.AlbumPicker.deleteClosure(this.data.id);}},["span","[x]"]]]," "]).dataBind((this.data.items||[]),this.index,this.count);}," ",["li",{"class":"choose-more"}," ",["a",{href:"#more",onclick:function(){return this.pickAlbums;}},"Choose more"]," "]," "]);(function(){var E=100,K,H,I,M,L,B,G;function J(){if(K===2&&!I.length){$("select[name=album-destination]").val(0);}var O=MF.Media.AlbumPicker.bind({items:M});$(".js-AlbumPicker").eq(0).replaceWith(O);}function C(O){I=[];M=[];while(O.length){var P=O.shift();I.push(Number(P.id));M.push({id:Number(P.id),label:String(P.label)});}setTimeout(J,0);}function A(R){var Q={};for(var P=0;P<I.length;P++){Q[String(I[P])]=true;}var O=MF.Dialogs.ListSelect.bind({callback:C,count:R.count,items:R.items,moreCallback:N,selected:Q,start:R.start,total:R.total});if(O){document.body.appendChild(O);}}function F(P){P=Number(P);for(var O=I.length-1;O>=0;O--){if(I[O]===P){I.splice(O,1);M.splice(O,1);}}J();}function D(O,P){O=O||[];P=P||[];for(var Q=O.length-1;Q>=0;Q--){for(var R=P.length-1;R>=0;R--){if(O[Q].id===P[R].id){P.splice(Q,1);}}}return O.concat(P);}function N(P,O,Q){E=O;MF.Media.Service.getAlbumList(P,E,{onSuccess:function(R){G=R.total;H=D(H,R.items);Q(R);}});}this.resetAlbums=function(){K=0;G=-1;I=[];M=[];L=null;B=null;if(MF.Media.selectedAlbums&&MF.Media.selectedAlbums.length){H=D(H,MF.Media.selectedAlbums);C(MF.Media.selectedAlbums);K=2;}};this.setupDest=function(){var O=false;var P=false;K=Number($(this).val());switch(K){case 0:break;case 1:O=true;break;case 2:P=true;MF.Media.AlbumPicker.pickAlbums();break;}if(!P){M=[];I=[];J();}$(this).parents(".js-UploadSteps").toggleClass("new-album",O);};this.setAlbumDestFld=function(){B=this;if(K){$(B).val(K);}};this.setAlbumNameFld=function(){L=this;};this.getAlbumName=function(){if(K!==1){return null;}return(L&&L.value)||new Date().toString(MF.ShortDateFormat);};this.getSelectedAlbums=function(){if(K!==2){return null;}return I;};this.pickAlbums=function(){if(G>=0&&H&&H.length){var O=Math.max(0,H.length-E);A({start:O,count:E,total:G,items:H});}else{N(0,E,function(){A({start:0,count:E,total:G,items:H});});}return false;};this.deleteClosure=function(O){if(!O){return null;}return function(){F(O);return false;};};}).call(MF.Media.AlbumPicker);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Photo){MF.Photo={};}MF.Photo.Publisher=JsonML.BST([""," ",function(){this.resetState();MF.Media.AlbumPicker.resetAlbums();}," ",["div",{"class":"add-panel add-photos add-media add-media-new js-add-panel js-PhotoPublisher"}," ",["div",{"class":"js-UploadStatus",style:"display:none"}," ",function(){MF.Publisher.UploadStatus.close=this.close;}," "]," ",["h3","Add Photos"]," ",["div",{"class":"upload-steps js-UploadSteps"}," ",["p",["strong","Step 1."]," Place photos in an album? ",["select",{name:"album-destination",onchange:function(){return MF.Media.AlbumPicker.setupDest;},"jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumDestFld;}}," ",["option",{value:"0"},"No album"]," ",["option",{value:"1"},"Create new album"]," ",["option",{value:"2"},"Add to existing album(s)"]," "]," "]," ",["p",{"class":"new-album-name"}," ",["label",{"class":"album-name"},"New album: "]," ",["input",{type:"text",name:"album-name",title:function(){return"By "+MF.user.name+" - "+new Date().toString(MF.ShortDateFormat);},"class":"text album-name js-InlineInstruction",onfocus:"this.select();","jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumNameFld;}}]," "]," ",function(){return JsonML.BST(MF.Media.AlbumPicker).dataBind({},this.index,this.count);}," ",function(){return JsonML.BST(MF.Publisher.UploadQueue).dataBind({},this.index,this.count);}," ",["p",{"class":"submit js-ChooseStep"},["strong","Step 2."]," ",function(){return JsonML.BST(MF.Publisher.Uploader).dataBind({buttonWidth:"127",formUrl:MF.Publisher.uploadUrl,fileTypes:"*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.tif",fileLabel:"Image Files",queueSize:200,queueMessage:"200 photos",fileSize:"50 MB"},this.index,this.count);}," ",["a",{href:"#choose","class":"positive choose",onclick:"return false;"},"Choose ",["span",{"class":"choose-media"},"photos"],["span",{"class":"choose-more"},"more"]]," ",["span",{"class":"choose-more"},"or"]," ",["a",{href:"#upload","class":"positive choose-more toggle-target-nohide",onclick:function(){return this.beginUpload;}},"Start upload now"]," "]," "]," ",function(){return JsonML.BST(MF.Publisher.UploadMeter).dataBind({bytesLeft:MF.Publisher.BytesLeft,bytesMax:MF.Publisher.BytesMax,upgradeUrl:MF.Publisher.UpgradeUrl},this.index,this.count);}," "]," "]);(function(){var A;function C(F,E){var D={DateTaken:E.dateTaken,DisplayAuth:E.remasteredAuth||null,DisplayGuid:E.remasteredID||null,Description:E.description,FileLength:F.size,MIMEType:E.mimeType,Orientation:E.orientation,OriginalFileName:F.name,OriginalAuth:E.originalAuth||null,OriginalGuid:E.originalID||null,Title:E.title||F.name};A.push(D);}function B(){if(!A||!A.length){MF.UnsavedData.markClean("MF.Photo.Publisher");MF.Photo.Publisher.close();return;}var D=MF.Media.AlbumPicker.getSelectedAlbums(),E=MF.Media.AlbumPicker.getAlbumName();MF.Media.Service.saveMedia(A,[],D,E,{onSuccess:function(F){MF.Publisher.BytesLeft=F.bytesLeft;MF.Publisher.BytesMax=F.bytesMax;MF.Activities.List.display(F.activity);MF.Publisher.UploadStatus.refresh(F);MF.Message.clear(null,MF.Message.Scope.Column);},onFailure:function(H,F,G){MF.Message.showError(null,"Error saving photos. Please try again.",MF.Message.Scope.Column);if(MF.isDebug){;}$(".js-PhotoPublisher").replaceWith(MF.Photo.Publisher.bind());},onComplete:function(){MF.UnsavedData.markClean("MF.Photo.Publisher");}});}this.close=function(){MF.UnsavedData.markClean("MF.Photo.Publisher");MF.Publisher.Module.reset.call(this);return false;};this.resetState=function(){A=[];};this.beginUpload=function(){MF.UnsavedData.markDirty("MF.Photo.Publisher","You are still uploading. If you leave this page your upload will be cancelled.");MF.Publisher.Uploader.beginUpload(C,B);return false;};}).call(MF.Photo.Publisher);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Video){MF.Video={};}MF.Video.Publisher=JsonML.BST([""," ",function(){this.resetState();MF.Media.AlbumPicker.resetAlbums();}," ",["div",{"class":"add-panel add-video add-media add-media-new js-add-panel js-VideoPublisher"}," ",["div",{"class":"js-UploadStatus",style:"display:none"}," ",function(){MF.Publisher.UploadStatus.close=this.close;}," "]," ",["h3","Add Videos"]," ",["div",{"class":"upload-steps js-UploadSteps"}," ",["p",["strong","Step 1."]," Place videos in an album? ",["select",{name:"album-destination",onchange:function(){return MF.Media.AlbumPicker.setupDest;},"jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumDestFld;}}," ",["option",{value:"0"},"No album"]," ",["option",{value:"1"},"Create new album"]," ",["option",{value:"2"},"Add to existing album(s)"]," "]," "]," ",["p",{"class":"new-album-name"}," ",["label",{"class":"album-name"},"New album: "]," ",["input",{type:"text",name:"album-name",title:function(){return"By "+MF.user.name+" - "+new Date().toString(MF.ShortDateFormat);},"class":"text album-name js-InlineInstruction",onfocus:"this.select();","jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumNameFld;}}]," "]," ",function(){return JsonML.BST(MF.Media.AlbumPicker).dataBind({},this.index,this.count);}," ",function(){return JsonML.BST(MF.Publisher.UploadQueue).dataBind({},this.index,this.count);}," ",["p",{"class":"submit js-ChooseStep"},["strong","Step 2."]," ",function(){return JsonML.BST(MF.Publisher.Uploader).dataBind({buttonWidth:"125",formUrl:MF.Publisher.uploadUrl,fileTypes:"*.asf;*.avi;*.flv;*.mp4;*.mpg;*.mpeg;*.mov;*.rm;*.wmv",fileLabel:"Video Files",queueSize:10,queueMessage:"10 videos",fileSize:"1 GB"},this.index,this.count);}," ",["a",{href:"#choose","class":"positive choose",onclick:"return false;"},"Choose ",["span",{"class":"choose-media"},"videos"],["span",{"class":"choose-more"},"more"]]," ",["span",{"class":"choose-more"},"or"]," ",["a",{href:"#upload","class":"positive choose-more toggle-target-nohide",onclick:function(){return this.beginUpload;}},"Start upload now"]," "]," "]," ",function(){return JsonML.BST(MF.Publisher.UploadMeter).dataBind({bytesLeft:MF.Publisher.BytesLeft,bytesMax:MF.Publisher.BytesMax,upgradeUrl:MF.Publisher.UpgradeUrl},this.index,this.count);}," "]," "]);(function(){var A;function C(F,E){var D={Description:E.description,DisplayAuth:E.previewAuth||null,DisplayGuid:E.previewID||null,Duration:E.duration,FileLength:F.size,Height:E.height,MIMEType:E.mimeType,OriginalFileName:F.name,Title:E.title||F.name,OriginalAuth:E.originalAuth||null,OriginalGuid:E.originalID||null,Width:E.width};A.push(D);}function B(){if(!A||!A.length){MF.UnsavedData.markClean("MF.Video.Publisher");MF.Video.Publisher.close();return;}var D=MF.Media.AlbumPicker.getSelectedAlbums(),E=MF.Media.AlbumPicker.getAlbumName();MF.Media.Service.saveMedia([],A,D,E,{onSuccess:function(F){MF.Publisher.BytesLeft=F.bytesLeft;MF.Publisher.BytesMax=F.bytesMax;MF.Activities.List.display(F.activity);MF.Publisher.UploadStatus.refresh(F);MF.Message.clear(null,MF.Message.Scope.Column);},onFailure:function(H,F,G){MF.Message.showError(null,"Error saving videos. Please try again.",MF.Message.Scope.Column);if(MF.isDebug){;}$(".js-VideoPublisher").replaceWith(MF.Video.Publisher.bind());},onComplete:function(){MF.UnsavedData.markClean("MF.Video.Publisher");}});}this.close=function(){MF.UnsavedData.markClean("MF.Video.Publisher");MF.Publisher.Module.reset.call(this);return false;};this.resetState=function(){A=[];};this.beginUpload=function(){MF.UnsavedData.markDirty("MF.Video.Publisher","You are still uploading. If you leave this page your upload will be cancelled.");MF.Publisher.Uploader.beginUpload(C,B);return false;};}).call(MF.Video.Publisher);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.Publisher=JsonML.BST([""," ",function(){this.resetState();MF.Media.AlbumPicker.resetAlbums();}," ",["div",{"class":"add-panel add-photos add-media add-media-new js-add-panel js-MediaPublisher"}," ",["div",{"class":"js-UploadStatus",style:"display:none"}," ",function(){MF.Publisher.UploadStatus.close=this.close;}," "]," ",["div",{"class":"upload-steps js-UploadSteps"}," ",["p",["strong","Step 1."]," Place in an album? ",["select",{name:"album-destination",onchange:function(){return MF.Media.AlbumPicker.setupDest;},"jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumDestFld;}}," ",["option",{value:"0"},"No album"]," ",["option",{value:"1"},"Create new album"]," ",["option",{value:"2"},"Add to existing album(s)"]," "]," "]," ",["p",{"class":"new-album-name"}," ",["label",{"class":"album-name"},"New album: "]," ",["input",{type:"text",name:"album-name",title:function(){return"By "+MF.user.name+" - "+new Date().toString(MF.ShortDateFormat);},"class":"text album-name js-InlineInstruction",onfocus:"this.select();","jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumNameFld;}}]," "]," ",function(){return JsonML.BST(MF.Media.AlbumPicker).dataBind({},this.index,this.count);}," ",function(){return JsonML.BST(MF.Publisher.UploadQueue).dataBind({},this.index,this.count);}," ",["p",{"class":"submit js-ChooseStep"},["strong","Step 2."]," ",function(){return JsonML.BST(MF.Publisher.Uploader).dataBind({onQueued:this.onQueued,formUrl:MF.Publisher.uploadUrl,fileTypes:"*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.tif;*.asf;*.avi;*.flv;*.mp4;*.mpg;*.mpeg;*.mov;*.rm;*.wmv",fileLabel:"Image and Video Files",queueSize:200,queueMessage:"200 photos or videos",fileSize:"1 GB"},this.index,this.count);}," ",["a",{href:"#choose","class":"positive choose",onclick:"return false;"},"Choose ",["span",{"class":"choose-media"},"files"],["span",{"class":"choose-more"},"more"]]," ",["span",{"class":"choose-more"},"or"]," ",["a",{href:"#upload","class":"positive choose-more toggle-target-nohide",onclick:function(){return this.beginUpload;}},"Start upload now"]," "]," "]," ",function(){return JsonML.BST(MF.Publisher.UploadMeter).dataBind({bytesLeft:MF.Publisher.BytesLeft,bytesMax:MF.Publisher.BytesMax,upgradeUrl:MF.Publisher.UpgradeUrl},this.index,this.count);}," "]," "]);(function(){var C,F,E,B;function A(J,I){return{DateTaken:I.dateTaken,DisplayAuth:I.remasteredAuth||null,DisplayGuid:I.remasteredID||null,Description:I.description,FileLength:J.size,MIMEType:I.mimeType,Orientation:I.orientation,OriginalFileName:J.name,OriginalAuth:I.originalAuth||null,OriginalGuid:I.originalID||null,Title:I.title||J.name};}function G(J,I){return{Description:I.description,DisplayAuth:I.previewAuth||null,DisplayGuid:I.previewID||null,Duration:I.duration,FileLength:J.size,Height:I.height,MIMEType:I.mimeType,OriginalFileName:J.name,OriginalAuth:I.originalAuth||null,OriginalGuid:I.originalID||null,Title:I.title||J.name,Width:I.width};}function D(K,J){var I=(String(J&&J.mimeCategory)||"").toLowerCase();switch(I){case"video":C.push(G(K,J));break;default:case"image":F.push(A(K,J));break;}}function H(){if(!F){F=[];}if(!C){C=[];}if(!F.length&&!C.length){MF.UnsavedData.markClean("MF.Media.Publisher");MF.Media.Publisher.close();return;}var I=MF.Media.AlbumPicker.getSelectedAlbums(),J=MF.Media.AlbumPicker.getAlbumName();MF.Media.Service.saveMedia(F,C,I,J,{onSuccess:function(K){MF.Publisher.BytesLeft=K.bytesLeft;MF.Publisher.BytesMax=K.bytesMax;MF.Publisher.UploadStatus.refresh(K);MF.Message.clear(null,MF.Message.Scope.Column);},onFailure:function(M,K,L){MF.Message.showError(null,"Error saving photos or videos. Please try again.",MF.Message.Scope.Column);if(MF.isDebug){;}$(".js-MediaPublisher").replaceWith(MF.Media.Publisher.bind());},onComplete:function(){MF.UnsavedData.markClean("MF.Media.Publisher");}});}this.close=function(){MF.UnsavedData.markClean("MF.Media.Publisher");window.location.href=MF.Media.cancelUrl;return false;};this.resetState=function(){F=[];C=[];E=0;B=0;};this.onQueued=function(L){if(MF.isDebug&&"undefined"!==typeof console&&console.log){console.log("SWF File Queued:\n"+JSON.stringify(L,null,"  "));}var I;try{I=L.name.split(".").pop().toLowerCase();}catch(K){try{I=L.type.toLowerCase();}catch(K){}}switch(I){case"jpg":case"jpeg":case"jpe":case"png":case"gif":case"tif":if(L.size>52428800){this.cancelUpload(L.id,true);var J='"'+L.name+'" is larger than the allowed size.';MF.Log.info("Upload Queue ("+J+"):\n"+JSON.stringify(L,null,"  "));MF.Message.showWarning(null,J,MF.Message.Scope.Column,10000);}else{if(E>=200){this.cancelUpload(L.id,true);var J=String.format("Only {0} may be uploaded at a time. You may need to upload in multiple batches.","200 photos");MF.Log.info("Upload Queue ("+J+"):\n"+JSON.stringify(L,null,"  "));MF.Message.showWarning(null,J,MF.Message.Scope.Column,10000);}else{E++;}}break;case"asf":case"avi":case"flv":case"mp4":case"mpg":case"mpeg":case"mov":case"rm":case"wmv":if(L.size>1073741824){this.cancelUpload(L.id,true);var J='"'+L.name+'" is larger than the allowed size.';MF.Log.info("Upload Queue ("+J+"):\n"+JSON.stringify(L,null,"  "));MF.Message.showWarning(null,J,MF.Message.Scope.Column,10000);}else{if(B>=10){this.cancelUpload(L.id,true);var J=String.format("Only {0} may be uploaded at a time. You may need to upload in multiple batches.","10 videos");MF.Log.info("Upload Queue ("+J+"):\n"+JSON.stringify(L,null,"  "));MF.Message.showWarning(null,J,MF.Message.Scope.Column,10000);}else{B++;}}break;default:this.cancelUpload(L.id,true);var J='"'+L.name+'" is an unrecognized extension.';MF.Log.info("Upload Queue ("+J+"):\n"+JSON.stringify(L,null,"  "));MF.Message.showWarning(null,J,MF.Message.Scope.Column);break;}};this.beginUpload=function(){MF.UnsavedData.markDirty("MF.Media.Publisher","You are still uploading. If you leave this page your upload will be cancelled.");MF.Publisher.Uploader.beginUpload(D,H);return false;};}).call(MF.Media.Publisher);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.PinnedContent=JsonML.BST([""," ",["a",{id:"pinned-slideshow",href:"http://www.adobe.com/go/getflashplayer","jbst:onload":function(){return this.flashClosure(this.data.slideshow);},"jbst:visible":function(){return !this.data.single;}},["img",{src:"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif",alt:"Get Adobe Flash player"}]]," ",["a",{href:function(){return this.data.singleUrl;},"jbst:visible":function(){return !!this.data.singleUrl;}}," ",["img",{"class":"pinned",src:function(){return this.data.single;}}]," "]," "]);(function(){this.flashClosure=function(A){return function(){swfobject.embedSWF("/Flash/SlideShowPro/mfSmall.swf","pinned-slideshow","300","320","9","/Flash/SWFObject/expressInstall.swf",{xmlfile:String(A),xmlfiletype:"Default"},{allowfullscreen:"true",allowscriptaccess:"always",wmode:"transparent"});};};}).call(MF.Media.PinnedContent);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}if("undefined"===typeof MF.Media.MediaDetail){MF.Media.MediaDetail={};}MF.Media.MediaDetail.Info=JsonML.BST(["div"," ",function(){this.editPage=this.data.editUrl;}," ",function(){return JsonML.BST(this.switchContentType).dataBind(this.data,this.index,this.count);}," ",["div",{"class":"page-title","jbst:visible":function(){return this.data.title.length>0;}}," ",["h2",function(){return this.data.title;}]," "]," ",["div",{"class":"discussion-content js-DiscussionContent","jbst:visible":function(){return this.data.description.length>0;}}," ",function(){return JsonML.raw(this.data.description);}," "]," "]);(function(){this.deleteMedia=function(B,A,C){MF.Media.Service.deleteMedia(B,{onSuccess:function(D){C();if("undefined"!==typeof MF.Media.nextMediaUrl){window.location=MF.Media.nextMediaUrl;}else{window.location=D.url;}}});};this.editMedia=function(B,A){window.location=MF.Media.MediaDetail.Info.editPage;};this.switchContentType=function(){switch(this.data.contentType){case"Album":return MF.Media.MediaDetail.Album;case"Slideshow":return MF.Media.MediaDetail.Slideshow;case"Video":return MF.Media.MediaDetail.Video;case"Image":return MF.Media.MediaDetail.Image;default:return null;}};}).call(MF.Media.MediaDetail.Info);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}if("undefined"===typeof MF.Media.MediaDetail){MF.Media.MediaDetail={};}MF.Media.MediaDetail.Album=JsonML.BST(["img",{"class":"item-main",src:function(){return this.data.imageUrl;}}]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}if("undefined"===typeof MF.Media.MediaDetail){MF.Media.MediaDetail={};}MF.Media.MediaDetail.Image=JsonML.BST(["img",{ondblclick:function(){return this.viewFullscreen(this.data.contentId,this.data.imageUrl);},"class":"item-main",src:function(){return this.data.imageUrl;}}]);(function(){this.viewFullscreen=function(B,A){return function(C){C=C||event;if(MF.Media.MediaNavThumbs&&MF.Media.MediaNavThumbs.viewFullscreen){MF.Media.MediaNavThumbs.viewFullscreen(B,null,false);}else{if(MF.Media.Fullscreen){MF.Media.Fullscreen.showSingle(A,"");}}};};}).call(MF.Media.MediaDetail.Image);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.Fullscreen=JsonML.BST([""," ",function(){$(document).bind("keyup",this.handleArrowNav);$(window).bind("resize",this.handleBrowserResize);}," ",["iframe",{"class":"TB_HideSelect","jbst:visible":function(){return"undefined"===typeof document.body.style.maxHeight;}}]," ",["div",{"class":"TB_overlay full-slideshow",onclick:function(){return this.closeSlideshow;},onmouseover:function(){return MF.Media.Fullscreen.showControls;},onmouseout:function(){return MF.Media.Fullscreen.hideControls;}}]," ",["div",{"class":"TB_slideshow"}," ",["div",{"class":"transport controls js-onhover",id:"ss-transport",onmouseover:function(){return MF.Media.Fullscreen.showControls;},onmouseout:function(){return MF.Media.Fullscreen.hideControls;}}," ",["a",{onclick:function(){return this.navigate(false);},id:"ss-prev",title:"Go to previous slide"},["img",{src:"/Images/fs_skipb_24.png"}]]," ",["a",{onclick:function(){return this.toggleSlideshow;},id:"ss-play",title:"Start Slideshow"},["img",{src:"/Images/fs_play_24.png"}]]," ",["a",{onclick:function(){return this.toggleSlideshow;},id:"ss-stop",title:"Stop Slideshow"},["img",{src:"/Images/fs_pause_24.png"}]]," ",["a",{onclick:function(){return this.navigate(true);},id:"ss-next",title:"Go to next slide"},["img",{src:"/Images/fs_skipf_24.png"}]]," "]," ",["div",{"class":"close js-onhover",onmouseover:function(){return MF.Media.Fullscreen.showControls;},onmouseout:function(){return MF.Media.Fullscreen.hideControls;}}," ",["p",["a",{href:"#",onclick:function(){return this.closeSlideshow;}},"Close slideshow"]]," "]," ",["div",{"class":"TB_window full-slideshow"}," ",["div",{style:"text-align:center"}," ",["a",{href:"#view",onclick:function(){return this.imageClicked;}},["img",{onmouseover:function(){return MF.Media.Fullscreen.showControls;},onmouseout:function(){return MF.Media.Fullscreen.hideControls;},id:"ss-curImg",src:"/images/loadingIndicators/small.gif"}]]," ",["div",{"class":"title",onmouseover:function(){return MF.Media.Fullscreen.showControls;},onmouseout:function(){return MF.Media.Fullscreen.hideControls;},style:"display:none"}," ",["span",{id:"ss-title"}]," "]," ",["div",{"class":"delay",style:"display:none;color:White;font-weight:bold;font-size:x-large;margin-top:-60px"}," ",["span",{id:"ss-delay"}]," "]," "]," "]," "]]);(function(){var B=3000,A=1500,N=30000,U=500;var J=null,Z=null,C=true,Q={},M=null,D=false,I=null,G=null,H=false;function X(){W(Z.image,Z.imageTitle);if(Z.hasPrev){$("#ss-prev").fadeTo("fast",0.6);}else{$("#ss-prev").fadeTo("fast",0.1);}if(Z.hasNext){$("#ss-next").fadeTo("fast",0.6);}else{$("#ss-next").fadeTo("fast",0.1);}if(C&&Z.hasNext){T(Z.nextFull);P(Z.nextId,Z.albumId,false);}else{if(!C&&Z.hasPrev){T(Z.prevFull);P(Z.prevId,Z.albumId,false);}}}function P(g,d,f){var e=g.toString()+"_"+d;if(Q.hasOwnProperty(e)){if(f){Z=Q[e];X();}}else{MF.Media.Service.getPrevNextSlide(g,d,MF.Media.ShareID,{onSuccess:function(h){Q[e]=h;if(f){Z=h;X();}}});}}function F(e){var g=1050;var d=720;var f=$(window);if(f.width()>d&&f.height()>d){return e.replace("MaxSide=640",("MaxSide="+g)).replace("Poll=True","Poll=False");}return e;}function T(d){if(d){var e=new Image();e.src=F(d);}}function W(f,e){f=F(f);var d=new Image();d.onload=function(){var i=$("#ss-curImg")[0];i.src=f;var g=R(d.height,d.width);i.height=g.height;i.width=g.width;$("#ss-title").text(e);var h=$("div.title");if(!h.is(":visible")){h.show();}};d.src=f;}function R(k,f){var p=$(window);var q=4,l=30;var j=p.height()-(q*2)-(l*2);var o=p.width()-(q*2);if(k>j||f>o){var d;if(k>j&&f>o){var h=j/k;var g=o/f;if(h<g){d=h;}else{d=g;}}else{if(k>j){d=j/k;}else{d=o/f;}}k=k*d;f=f*d;}var i=$(".TB_window");var e=k*0.1;var n=Math.floor(Math.abs(k/2-(e-q)));var m=Math.floor(f/2+q);i.height(k);i.width(f);i.css("margin-top","-"+n+"px");i.css("margin-left","-"+m+"px");return{width:f,height:k};}function V(){C=true;if(Z.hasNext){P(Z.nextId,Z.albumId,true);}else{K();}}function Y(){C=false;if(Z.hasPrev){P(Z.prevId,Z.albumId,true);}else{K();}}function S(){if(C){V();}else{Y();}M=setTimeout(S,B);}function a(){if(M){K();}else{O();}}function O(){if(M){return false;}C=true;M=setTimeout(S,B);$("#ss-play").hide();$("#ss-stop").show();}function K(){if(M){clearTimeout(M);M=null;$("#ss-stop").hide();$("#ss-play").show();}}function b(){G=null;$("div.delay").fadeOut();}function L(){if(G){clearTimeout(G);G=null;}G=setTimeout(b,2500);$("#ss-delay").html((B/1000)+"s delay");$("div.delay").show();}function c(){B-=U;if(B<A){B=A;}L();}function E(){B+=U;if(B>N){B=N;}L();}this.show=function(f,d,g){J=g;var e=MF.Media.Fullscreen.bind({});if(e){document.body.appendChild(e);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}C=true;P(f,d,true);}};this.showSingle=function(d,e){var f=MF.Media.Fullscreen.bind({});if(f){document.body.appendChild(f);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}Z={hasNext:false,hasPrev:false,image:d,imageTitle:e};H=true;$("div.js-onhover").hide();W(d,e);}};this.handleBrowserResize=function(d){W(Z.image,Z.imageTitle);};this.handleArrowNav=function(h){var d=false;var g=h||window.event;var f=g.srcElement||g.target;if(g.keyCode===27){MF.Media.Fullscreen.closeSlideshow();}if(H){return;}if(f&&f.form){return;}if(g.keyCode===39||g.keyCode===176){K();V();d=true;}else{if(g.keyCode===37||g.keyCode===177){K();Y();d=true;}else{if(g.keyCode===32||g.keyCode===19||g.keyCode===80||g.keyCode===190||g.keyCode===179){a();d=true;}else{if(g.keyCode===178){K();d=true;}else{if(g.keyCode===109){c();d=true;}else{if(g.keyCode===107){E();d=true;}else{if(g.keyCode===13){MF.Media.Fullscreen.imageClicked();d=true;}}}}}}}if(d){return MF.clearEvent(g);}};this.closeSlideshow=function(){K();C=true;$(document).unbind("keyup",this.handleArrowNav);$(window).unbind("resize",this.handleBrowserResize);MF.Dialog.remove();if(J){J();}};this.imageClicked=function(){MF.Media.Fullscreen.closeSlideshow();if(Z&&Z.imageUrl&&window.location.pathname!==Z.imageUrl){window.location.href=Z.imageUrl;}return false;};this.navigate=function(d){return function(){K();if(d){V();}else{Y();}};};this.playSlideshow=function(){O();};this.toggleSlideshow=function(){a();};this.showControls=function(){if(I){clearTimeout(I);I=null;}if(!H&&!D){D=true;$("div.js-onhover").fadeIn("fast");}};this.hideControls=function(){if(D&&I==null){I=setTimeout(function(){D=false;I=null;$("div.js-onhover").fadeOut();},500);}};}).call(MF.Media.Fullscreen);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}if("undefined"===typeof MF.Media.MediaDetail){MF.Media.MediaDetail={};}MF.Media.MediaDetail.Slideshow=JsonML.BST([""," ",["div",{"class":"item-main","jbst:onload":function(){return this.flashClosure(this.data.videoUrl,this.data.showId);}}," ",["a",{id:"slideshow-player",href:"http://www.adobe.com/go/getflashplayer"}," ",["img",{src:function(){return this.data.imageUrl;}}]," ",["img",{src:"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif",alt:"Get Adobe Flash player"}]],"\n"],"\n"]);(function(){this.flashClosure=function(A,B){return function(){var D=499;var C=550;swfobject.embedSWF("/Flash/viewer.swf","slideshow-player",D,C,"9","/Flash/SWFObject/expressInstall.swf",{showid:B,showurl:encodeURIComponent(A),loadingurl:"blank",slideDimension:480},{allowfullscreen:"true",allowscriptaccess:"always",bgcolor:"#000000",loop:"false",menu:"false",quality:"high",wmode:"transparent"});};};}).call(MF.Media.MediaDetail.Slideshow);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}if("undefined"===typeof MF.Media.MediaDetail){MF.Media.MediaDetail={};}MF.Media.MediaDetail.Video=JsonML.BST([""," ",["div",{"class":"item-main","jbst:onload":function(){return this.flashClosure(this.data.videoUrl,this.data.imageUrl,this.data.contentId);}}," ",["a",{id:function(){return"video-player-"+this.data.contentId;},href:"http://www.adobe.com/go/getflashplayer"}," ",["img",{src:function(){return this.data.imageUrl;}}]," ",["img",{src:"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif",alt:"Get Adobe Flash player"}]],"\n"],"\n"]);(function(){this.flashClosure=function(C,A,B){return function(){var E=625;if(MF.Media.MediaDetail.Video.playerWidth){E=MF.Media.MediaDetail.Video.playerWidth;}var D=480;swfobject.embedSWF("/Flash/mediaplayer.swf","video-player-"+B,E,D,"9","/Flash/SWFObject/expressInstall.swf",{file:C,image:A,width:E,height:D,bufferlength:10},{allowfullscreen:"true",allowscriptaccess:"always",wmode:"transparent"});};};}).call(MF.Media.MediaDetail.Video);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumLightbox=JsonML.BST(["div"," ",["div",{"class":"section-title"}," ",["h3","Photos & Videos in this album"]," "],""," ",["div",{"class":"thumbnails"}," ",["ul"," ",function(){return JsonML.BST(MF.Media.AlbumLightboxItem).dataBind(this.data.items,this.index,this.count);}," "]," ",["div",{"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"There are no photos or videos in this album."]," ",["br"]," "]," "],""," "]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumLightboxItem=JsonML.BST(["li",["a",{href:function(){return this.data.url;}},["img",{src:function(){return this.data.imageUrl;},width:"64",height:"64"}]]]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaModule=JsonML.BST([""," ",function(){this.contentType=this.data.contentType;}," ",["div",{"class":"js-MediaModule"}," ",function(){return JsonML.BST(MF.Toolbars.FilterBar).dataBind(this.getSortBarData(this.data),this.index,this.count);}," ",["div",{"class":function(){return"pvdisplay"+(this.data.contentType==="Video"||this.data.contentType==="Slideshow"?" videos":"");}}," ",function(){return JsonML.BST(MF.Media.MediaRow).dataBind(MF.splitArray(this.data.items,MF.Media.NumColumns),this.index,this.count);}," "]," ",""," ",["div",{"class":function(){return this.getNoResultsCss(this.data);},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"No results match that criteria."]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.getCount(),this.getTotal(),MF.Media.MediaModule.getMedia),this.index,this.count);}," "]]);(function(){this.getMedia=function(N,M){window.location.href=MF.Media.ThisUrl+H(N);};this.getCount=function(){if(this.data.start===0&&this.data.contentType==="Unknown"){return 60;}return this.data.count;};this.getTotal=function(){if(this.data.total>40&&this.data.contentType==="Unknown"){return this.data.total+20;}return this.data.total;};function H(M){var N="";if(M!==0){N="?start="+M;}var O=F.getSelectedAsString();if(O.length>0){if(N.length===0){N+="?";}else{N+="&";}N+="u="+O;}return N;}function J(M){window.location.href=M+H(0);}function E(){MF.Media.MediaModule.getMedia(0);}function K(P,M,O){if(O.selectedIdx===M){P.asc=!P.asc;}var N=MF.getQueryParam("start",true,0);MF.Media.Service.getMedia(B,L,MF.Media.MediaModule.contentType,null,M,P.asc,N,F.getSelectedUsers(),{onSuccess:function(Q){Q=MF.Media.MediaModule.bind(Q);$("div.js-MediaModule").replaceWith(Q);document.body.scrollIntoView(true);}});return true;}var L,B;var A=null;var G=null;var C;var F=new MF.Toolbars.FilterBarPeopleMenu.Menu(E);var I=new MF.Toolbars.FilterBarMenu.Menu("Sort",[{label:"Recent activity",asc:false},{label:"Date added",asc:false},{label:"Title",asc:true},{label:"Created by",asc:true},{label:"Date taken",asc:false}],K);var D=false;this.getSortBarData=function(M){if(!D){B=M.sortData.realStartIdx;L=M.count;if(M.canAdd&&M.contentType!=="Slideshow"){A=new MF.Toolbars.FilterBarButton.Button("Add more",MF.Media.UploadUrl);}C=new MF.Media.MediaToolbarMenu.Menu(M.contentType,MF.Media.MediaModule.hasSlideshows,J);I.setSelection(M.sortData.colIdx).asc=M.sortData.asc;D=true;}return{items:[A,C,F,I]};};this.getNoResultsCss=function(N){if(F.getSelectionType()>0){return"";}var M;if(this.data.contentType==="Video"){M="videos-empty";}else{if(this.data.contentType==="Image"){M="photos-empty";}else{if(this.data.contentType==="Slideshow"){M="slideshows-empty";}else{M="media-empty";}}}if(!this.data.canAdd){M+=" nopermission";}return M;};}).call(MF.Media.MediaModule);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaItem=JsonML.BST(["div",{"class":"box"}," ",["table",{cellpadding:"0",cellspacing:"0"},["tr"," ",["td",{"class":function(){return"thumbnail"+(this.data.contentType==="Video"||this.data.contentType==="Slideshow"?" videothumb":"");}}," ",["div",{"class":"vidcontain"},["a",{href:function(){return this.data.url;}},["img",{src:function(){return this.data.imageUrl;}}],["span",{"class":"overlay"},"\u00A0"]]]," "]," "],["tr"," ",["td",{"class":"info"}," ",["p",{"class":"title"},["a",{href:function(){return this.data.url;}},function(){return this.data.title;}]]," ",["p",{"class":"date"},function(){return this.data.date;}]," ",["p",{"class":"meta","jbst:visible":function(){return this.data.viewCount>=0;}},function(){return this.data.viewCount;}," Views \u2022 ",["a",{href:function(){return this.data.url+"#comments";}},function(){return this.data.commentCount;}," Comments"]]," "]," "]]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaRow=JsonML.BST(["div",{"class":"pvrow clearfix"}," ",function(){return JsonML.BST(MF.Media.MediaItem).dataBind(this.data,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaToolbarMenu=JsonML.BST([""," ",function(){this.bindTimeData=this.data;}," ",["p",{"class":"actions js-FilterMenuMedia"}," ",["a",{onclick:function(){return this.showColumnMenu;},href:"#","class":"smallbox"},"Show: ",["span",{"class":"current-filter"},function(){return this.data.items[this.data.selectedIdx].label;}]," ",["span","+"]]," ",["span",{"class":"content-filter-drop js-menumedia",style:"display:none"}," ",function(){return JsonML.BST([""," ",["a",{onclick:function(){return MF.Media.MediaToolbarMenu.itemClicked(MF.Media.MediaToolbarMenu.bindTimeData,this.index);},href:function(){return this.data.url;}},function(){return this.data.label;}]," "]).dataBind(this.data.items,this.index,this.count);}," "]," "]," "]);(function(){this.Menu=function(A,B,D){this.callback=D;this.type="mediamenu";this.jbst=MF.Media.MediaToolbarMenu;this.items=[];this.selectedIdx=0;this.items.push({label:"All media",url:MF.Media.MediaUrl,contentType:"Unknown"});this.items.push({label:"Photos",url:MF.Media.PhotosUrl,contentType:"Image"});this.items.push({label:"Videos",url:MF.Media.VideosUrl,contentType:"Video"});if(B){this.items.push({label:"Slideshows",url:MF.Media.SlideshowsUrl,contentType:"Slideshow"});}this.items.push({label:"Albums",url:MF.Media.AlbumsUrl,contentType:"Album"});for(var C=0;C<this.items.length;C++){if(this.items[C].contentType===A){this.selectedIdx=C;break;}}this.getSelection=function(){return this.items[this.selectedIdx];};this.setSelection=function(G){var E=Number(G);if(isNaN(E)){for(var F=0;F<this.items.length;F++){if(this.items[F]===G){this.selectedIdx=F;break;}}}else{this.selectedIdx=E;}return this.getSelection();};};this.showColumnMenu=function(B){B=B||window.event;var C=$(".js-menumedia");var A=!C.is(":visible");$("span.content-filter-drop").hide();if(A){C.toggle();$(document).one("click",function(){C.hide();});}MF.clearEvent(B);};this.itemClicked=function(B,A){return function(){if(B.selectedIdx!=A&&B.callback){B.callback(B.items[A].url);}return false;};};}).call(MF.Media.MediaToolbarMenu);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.EditMedia=JsonML.BST([""," ",function(){(function(){if(!MF.Media.EditMedia.unloadRegistered){MF.Media.EditMedia.unloadRegistered=true;if(window.addEventListener){window.addEventListener("beforeunload",MF.Media.EditMedia.onbeforeunload,false);}else{if(window.attachEvent){window.attachEvent("onbeforeunload",MF.Media.EditMedia.onbeforeunload);}else{var A=window.onbeforeunload;window.onbeforeunload=("function"===typeof A)?function(B){MF.Media.EditMedia.onbeforeunload(B);return A(B);}:MF.Media.EditMedia.onbeforeunload;}}}})();this.theData=this.data;}," ",["form",{"class":"js-EditMedia",id:"EditForm",onsubmit:"return false;"}," ",["div",{"class":"section-title","jbst:visible":function(){return this.isEditingAlbum();}}," ",["h3","Batch edit details"]," "]," ",["div",{"class":"twocol1wide","jbst:visible":function(){return this.isEditingAlbum();}}," ",["div",{"class":"column1"}," ",["label",{"for":""},"Album title"]," ",["input",{"class":"active",type:"text",name:"",value:function(){return this.getAlbumTitle(this.data);},onblur:function(){return this.updateAlbumTitle(this.data);}}]," ",["label",{"for":""},"Album description"]," ",["textarea",{"class":"active js-expand",onblur:function(){return this.updateAlbumDesc(this.data);}},function(){return this.getAlbumDesc(this.data);}]," ",function(){return JsonML.BST(MF.Help.FormatGuide).dataBind(this.data,this.index,this.count);}," "]," "]," ",["div",{"class":"section-title","jbst:visible":function(){return this.data.total>0;}}," ",["h3","Edit individual details"]," "],""," ",["div",{"class":"pvdisplay edit"}," ",function(){return JsonML.BST(MF.Media.EditMediaRow).dataBind(MF.splitArray(this.data.items,4),this.index,this.count);}," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,MF.Media.EditMedia.pageMedia(this.data.sourceId,this.data.sourceType)),this.index,this.count);}," ",["p",{"class":"submit"},["a",{"class":"positive",onclick:"MF.Media.EditMedia.saveChanges(this);return false;"},"Save all changes"]," or ",["a",{href:function(){return MF.Media.ReturnUrl;}},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]]," "]]);(function(){this.AlbumMediaType=0;this.ActivityMediaType=1;this.SingleMediaType=2;var C="NOTSET";var A=C;var D=C;var B={};this.setDirty=function(E){var F=E.contentId.toString();B[F]=E;};this.getDataItem=function(E){var F=E.contentId.toString();if(B.hasOwnProperty(F)){return B[F];}return E;};this.pageMedia=function(F,E){return function(H,G){MF.Media.EditMedia.getMedia(H,G,F,E);};};this.getMedia=function(G,E,F,H){MF.Media.Service.getEditableMedia(G,E,F,H,{onSuccess:function(I){I=MF.Media.EditMedia.bind(I);$("form.js-EditMedia").replaceWith(I);document.body.scrollIntoView(true);}});};this.getDirtyItems=function(){var F=new Array();if(D!=C||A!=C){F.push({contentId:Number(MF.Media.EditMedia.theData.sourceId),contentType:"Album",dateTaken:new Date(),description:MF.Media.EditMedia.getAlbumDesc(MF.Media.EditMedia.theData),tags:MF.Media.EditMedia.theData.atags,title:MF.Media.EditMedia.getAlbumTitle(MF.Media.EditMedia.theData)});}for(var E in B){if(B.hasOwnProperty(E)){F.push(B[E]);}}return F;};this.saveChanges=function(F){var G=F.form;var E=MF.Media.EditMedia.getDirtyItems();if(E.length===0){window.location.href=MF.Media.ReturnUrl;}else{MF.Forms.disableSubmit(G);MF.Media.Service.updateMedia(MF.Media.EditMedia.theData.sourceId,MF.Media.EditMedia.theData.sourceType,E,{onSuccess:function(H){B={};D=C;A=C;if(G.markClean){G.markClean();}window.location.href=MF.Media.ReturnUrl;},onFailure:function(J,H,I){MF.Message.showError(G,"Error saving changes.",MF.Message.Scope.Column);if(MF.isDebug){;}},onComplete:function(){MF.Forms.enableSubmit(G);}});}};this.updateAlbumTitle=function(E){return function(){var F=this.value;if(E.atitle===F){A=C;}else{A=F;}};};this.updateAlbumDesc=function(E){return function(){var F=this.value;if(E.adesc===F){D=C;}else{D=F;}};};this.getAlbumTitle=function(E){if(A===C){return E.atitle;}return A;};this.getAlbumDesc=function(E){if(D===C){return E.adesc;}return D;};this.isEditingAlbum=function(){return this.theData.sourceType===this.AlbumMediaType;};this.onbeforeunload=function(E){E=E||window.event;var F=MF.Media.EditMedia.getDirtyItems();if(F.length>0){var G="You have unsaved changes. Are you sure you want to leave this page without saving?";if(E){E.returnValue=G;}return G;}};}).call(MF.Media.EditMedia);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.EditMediaRow=JsonML.BST(["div",{"class":"pvrow clearfix"}," ",function(){return JsonML.BST(MF.Media.EditMediaItem).dataBind(this.data,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.EditMediaItem=JsonML.BST([""," ",function(){this.mydata=MF.Media.EditMedia.getDataItem(this.data);}," ",["div",{"class":function(){return"box"+(this.mydata.deleted?" deleted":"");},id:function(){return this.getName("box");}}," ",["p",{"class":"delete","jbst:visible":function(){return MF.Media.EditMedia.isEditingAlbum();}},["a",{onclick:function(){return this.toggleDeleted(this.mydata);},href:"#delete"},function(){return this.mydata.deleted?"Add back to":"Remove from";}," this album"]]," ",["table",{id:function(){return this.getName("table");},style:function(){return"opacity: "+(this.mydata.deleted?"0.2;":"1;");},cellpadding:"0",cellspacing:"0"},["tr",["td",{"class":function(){return"thumbnail"+(this.data.contentType==="Video"?" videothumb":"");}}," ",function(){return JsonML.BST(this.switchContentType).dataBind(this.mydata,this.index,this.count);}," "]]," ",["tr",["td",{"class":"info"}," ",["p",{"class":"title"},["input",{"class":"active",type:"text",name:function(){return this.getName("title");},value:function(){return this.mydata.title;},onblur:function(){return this.updateTitle(this.mydata);}}]]," ",["p",{"class":"desc"},["textarea",{name:function(){return this.getName("description");},"class":"js-InlineInstruction",title:"Add a description",onblur:function(){return this.updateDesc(this.mydata);}},function(){return this.mydata.description;}]]," ",["p",{"class":"date clearfix"},["label",{"for":""},"Date taken:"]," ",["input",{"class":"active",type:"text",name:function(){return this.getName("datetaken");},value:function(){return this.formatDate(this.mydata.dateTaken);},onblur:function(){return this.updateDate(this.mydata);}}]]," ",["p",{"class":"tags clearfix"},["label",{"for":""},"Tags:"]," ",["input",{"class":"active",type:"text",name:function(){return this.getName("addtag");},value:"",onkeyup:function(){return this.keyDetect(this.mydata);}}]," ",["a",{"class":"positive",onclick:function(){return this.addTag(this.mydata);}},"Add"]]," ",["p",{"class":function(){return this.getName("tags-added js-TagList");}}," ",function(){return JsonML.BST(MF.Media.EditMediaItemTag).dataBind(this.getTagData(),this.index,this.count);}," "]," "]]]," "]," "]);(function(){this.updateTitle=function(A){return function(){var B=this.value;if(A.title!=B){A.title=B;MF.Media.EditMedia.setDirty(A);}};};this.updateDesc=function(A){return function(){var B=this.value;if(A.description!=B){A.description=B;MF.Media.EditMedia.setDirty(A);}};};this.updateDate=function(A){return function(){var C=MF.Media.EditMediaItem.formatDate(Date.parse(this.value));var B=MF.Media.EditMediaItem.formatDate(A.dateTaken);if(C.length===0&&this.value.length>0){this.value=B;}else{this.value=C;if(B!=C){A.dateTaken=Date.parse(C);MF.Media.EditMedia.setDirty(A);}}};};this.addTag=function(A){return function(){var G=document.forms[0][MF.Media.EditMediaItem.createElemName("addtag",A.contentId)];var D=G.value;var I=false;if(D.length>0){var J=D.split(",");for(var B=0;B<J.length;B++){var E=J[B].trim();if(E.length>0&&!MF.Media.EditMediaItem.doesTagExist(A,E)){I=true;var F=A.tags.push(E);F--;var C=MF.Media.EditMediaItemTag.bind(MF.Media.EditMediaItem.createTagData(A,F));var H=MF.Media.EditMediaItem.createElemName("p.js-TagList",A.contentId);$(C).appendTo(H);}}if(I){MF.Media.EditMedia.setDirty(A);G.value="";}}return false;};};this.doesTagExist=function(C,A){A=A.toLowerCase();for(var B=0;B<C.tags.length;B++){if(C.tags[B].toLowerCase()==A){return true;}}return false;};this.deleteTag=function(B,A){B.tags.splice(A,1);MF.Media.EditMedia.setDirty(B);};this.createElemName=function(A,B){return A+"_"+B;};this.createTagData=function(B,A){return{item:B,tagIdx:A};};this.keyDetect=function(A){return function(C){C=C?C:window.event;var B=Number(C.keyCode||C.charCode);switch(B){case 27:this.blur();return false;case 13:MF.Media.EditMediaItem.addTag(A)();return false;default:return true;}};};this.formatDate=function(A){if(A instanceof Date&&A.getUTCFullYear()>=1753){return A.toString(MF.MediumDateFormat);}return"";};this.getName=function(A){return this.createElemName(A,this.mydata.contentId);};this.getTagData=function(){var A=[];for(var B=0;B<this.mydata.tags.length;B++){A.push(this.createTagData(this.mydata,B));}return A;};this.toggleDeleted=function(A){return function(){A.deleted=!A.deleted;MF.Media.EditMedia.setDirty(A);var C=$("#"+MF.Media.EditMediaItem.createElemName("box",A.contentId));var B=$("#"+MF.Media.EditMediaItem.createElemName("table",A.contentId));if(A.deleted){C.addClass("deleted");B.fadeTo("fast",0.2);$(this).html("Add back to this album");}else{C.removeClass("deleted");B.fadeTo("fast",1);$(this).html("Remove from this album");}return false;};};this.switchContentType=function(){switch(this.data.contentType){case"Album":return MF.Media.MediaDetail.Album;case"Video":return MF.Media.EditMediaVideoItem;case"Image":default:return MF.Media.MediaDetail.Image;}};}).call(MF.Media.EditMediaItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.EditMediaVideoItem=JsonML.BST(["div",{"class":"vidcontain"}," ",["img",{src:function(){return this.data.imageUrl;}}]," ",["span",{"class":"overlay"}," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.EditMediaItemTag=JsonML.BST([""," ",function(){this.getTag=function(){return this.data.item.tags[this.data.tagIdx];};}," ",["span",{"class":"js-TagItem"},function(){return this.getTag();}," ",["a",{"class":"delete",href:"#",onclick:function(){return this.onDeleteClick(this.data);}},"Delete Tag"]]]);(function(){this.onDeleteClick=function(A){return function(){MF.Media.EditMediaItem.deleteTag(A.item,A.tagIdx);var B=$(this).parents(".js-TagItem");B.hide("fast",function(){B.remove();});return false;};};}).call(MF.Media.EditMediaItemTag);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaNav=JsonML.BST([""," ",function(){this.lastAlbumId=this.data.albumId;}," ",["ul",{"class":"item-nav"}," ",function(){return JsonML.BST(MF.Media.MediaNavItem).dataBind(this.data.items,this.index,this.count);}," ",["li",{"class":"add-album js-addToAlbum","jbst:visible":function(){return this.data.canEdit;}},["a",{"class":"toggle-target",onclick:function(){return this.addToAlbum(this.data.id,this.data.items,this.data.type);},href:"#add"},"Add to ",function(){return this.data.total>0?"another":"";}," album"]]," "]," "]);(function(){var H=null,J=null,C,F,I,E=100;function B(N){var M={};for(var L=0;L<J.length;L++){M[String(J[L])]=true;}var K=MF.Dialogs.ListSelect.bind({callback:D,count:N.count,hideSelected:true,items:N.items,moreCallback:G,selected:M,start:N.start,total:N.total});if(K){document.body.appendChild(K);}}function D(M){if(M.length===0){return;}var K=[];var L="";while(M.length){var N=M.shift();var O=Number(N.id);L+=N.label;K.push(O);J.push(O);if(L.length>0){L+=", ";}}MF.Media.Service.addContentToAlbums(F,K,{onSuccess:function(P){P=MF.Media.MediaNavItem.bind(P.items);P=$(P);$("li.js-addToAlbum").before(P).hide().show("slow");MF.Message.showInfo(null,I+" successfully added to "+L+".",MF.Message.Scope.Page,5000);}});}function G(L,K,M){E=K;MF.Media.Service.getAlbumList(L,E,{onSuccess:function(N){C=N.total;if(H){H=H.concat(N.items);}else{H=N.items;}M(N);}});}function A(K){if(K==="Image"){I="Photo";}else{I=K;}}this.addToAlbum=function(N,K,L){F=N;J=[];A(L);for(var M=0;M<K.length;M++){J.push(K[M].albumId);}return function(){F=N;if(H){var O=Math.max(0,H.length-E);B({start:O,count:E,total:C,items:H});}else{G(0,E,B);}return false;};};}).call(MF.Media.MediaNav);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaNavItem=JsonML.BST(["li",{"class":function(){return this.getAlbumCss(this.data.albumId);}}," ",["a",{"class":"toggle-target",onclick:function(){return this.onOpenBrowse(this.data.contentId,this.data.albumId);},href:"#","jbst:onload":function(){return this.maybeOpenBrowse(this.data.contentId,this.data.albumId);}},function(){return this.data.title;}]," ",["div",{"class":"item-nav js-BrowseDiv"}," ",["p",{"class":"item-nav-heading"}," ",["a",{"class":"album-title",onclick:function(){return this.closeOpenedBrowse;},href:"#"},"Browse: ",function(){return this.data.title;}]," "]," ",["table",{"class":"newer",cellspacing:"0"},["tr",["td"," ",["span",{"class":"end"},"\u00A0"]," "]]]," ",["table",{"class":"older",cellspacing:"0"},["tr",["td"," ",["span",{"class":"end"},"\u00A0"]," "]]]," ",["p",{"class":"goto"},["a",{href:function(){return this.data.url;}},function(){return this.getGotoText(this.data.albumId,this.data.title);}]]," "]," "]);(function(){var B,A;function C(E,F,D){MF.Media.MediaNavItem.closeOpenedBrowse();E.addClass("js-OpenedNavItem");var G=E.next("div.js-BrowseDiv");E.hide();G.show();MF.Media.Service.getPrevNextMedia(F,D,MF.Media.ShareID,{onSuccess:function(H){var K,J;if(I){K=I.nextFull;J=I.prevFull;}E.addClass("js-OpenedNavItem");var L=E.next("div.js-BrowseDiv");E.hide();L.show();MF.Media.nextMediaUrl=H.nextUrl;var I=MF.Media.MediaNavThumbs.bind(H);L.html(I);if(K){A=new Image();A.src=K;}if(J){B=new Image();B.src=J;}}});}this.AllPhotostream=-1;this.UserPhotostream=0;this.onOpenBrowse=function(E,D){return function(){C(jQuery(this),E,D);return false;};};this.maybeOpenBrowse=function(E,D){return function(){if(D==MF.Media.MediaNav.lastAlbumId){C(jQuery(this),E,D);}};};this.closeOpenedBrowse=function(){$("div.js-BrowseDiv").hide();var D=$("a.js-OpenedNavItem");D.removeClass("js-OpenedNavItem");D.show();};this.getGotoText=function(D,E){if(D===MF.Media.MediaNavItem.AllPhotostream){return"Go to all photos & videos »";}else{if(D===MF.Media.MediaNavItem.UserPhotostream){return"Go to all items from member »";}else{if(E){return"Go to album »";}else{return"Go to items »";}}}};this.getAlbumCss=function(D){var E;if(D===this.AllPhotostream){E="all ";}else{if(D===this.UserPhotostream){E="all-person ";}else{E="";}}return E+"js-browse"+D;};}).call(MF.Media.MediaNavItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaNavThumbs=JsonML.BST([""," ",function(){if(!this.keypressRegistered){this.keypressRegistered=true;$(document).keyup(this.handleArrowNav);}this.prevStyle="background: url("+this.data.prev+") no-repeat 50% 50%;";this.nextStyle="background: url("+this.data.next+") no-repeat 50% 50%;";this.nextUrl=this.data.hasNext?this.data.nextUrl:null;this.prevUrl=this.data.hasPrev?this.data.prevUrl:null;this.curAlbumId=this.data.albumId;this.curContentId=this.data.contentId;}," ",["p",{"class":"item-nav-heading"}," ",["a",{onclick:function(){return this.clickSlideshow(this.data.contentId);},href:"#slideshow","class":"item-slideshow"},"Play slideshow"]," ",["a",{"class":"album-title",href:"#",onclick:function(){return this.data.title?MF.Media.MediaNavItem.closeOpenedBrowse:function(){return false;};}},"Browse: ",function(){return this.data.title;}]," ",["a",{"class":"negative",onclick:function(){return this.promptDelete(this.data.albumId,this.data.title,this.data.contentId);},"jbst:visible":function(){return this.data.canEA;},href:"#",title:"Remove from Album"},"Remove from Album"]," "]," ",["table",{"class":"newer",cellspacing:"0"},["tr"," ",["td",{"class":function(){return this.data.prevIsVideo?" videothumb":null;}}," ",["div",{"class":"vidcontain","jbst:visible":function(){return this.data.hasPrev;}}," ",["a",{"class":"overlay",href:function(){return this.data.prevUrl;},style:function(){return this.prevStyle;}}," ",["span",{"class":"overlay"},"\u00A0"]," ",["span","\u00AB ",function(){return(this.data.albumId>0)?"Previous":"Newer";}]," "]," "]," ",["span",{"class":"end","jbst:visible":function(){return !this.data.hasPrev;}},"You are at the ",function(){return(this.data.albumId>0)?"first":"newest";}," item"]," "]," "]]," ",["table",{"class":"older",cellspacing:"0"},["tr"," ",["td",{"class":function(){return this.data.nextIsVideo?" videothumb":null;}}," ",["div",{"class":"vidcontain","jbst:visible":function(){return this.data.hasNext;}}," ",["a",{"class":"overlay",href:function(){return this.data.nextUrl;},style:function(){return this.nextStyle;}}," ",["span",{"class":"overlay"},"\u00A0"]," ",["span",function(){return this.data.albumId>0?"Next":"Older";}," \u00BB"]," "]," "]," ",["span",{"jbst:visible":function(){return !this.data.hasNext;},"class":"end"},"You are at the ",function(){return this.data.albumId>0?"last":"oldest";}," item"]," "]," "]]," ",["p",{"class":"goto"},["a",{href:function(){return this.data.url;}}," ",function(){return MF.Media.MediaNavItem.getGotoText(this.data.albumId,this.data.title);}]]," "]);(function(){var A=false;this.handleArrowNav=function(D){if(A){return;}var C=D||window.event;var B=C.srcElement||C.target;if(B&&B.form){return;}if(C.keyCode==39){if(MF.Media.MediaNavThumbs.nextUrl&&MF.Media.MediaNavThumbs.nextUrl.length>0){window.location.href=MF.Media.MediaNavThumbs.nextUrl;}}else{if(C.keyCode==37){if(MF.Media.MediaNavThumbs.prevUrl&&MF.Media.MediaNavThumbs.prevUrl.length>0){window.location.href=MF.Media.MediaNavThumbs.prevUrl;}}else{if(C.keyCode===179){MF.Media.MediaNavThumbs.viewFullscreen(MF.Media.MediaNavThumbs.curContentId);return MF.clearEvent(C);}}}};this.promptDelete=function(B,D,C){return function(){MF.Dialogs.ConfirmDeleteDialog.showDlg(B,this,"Are you sure you want to remove this item from the album '"+D+"'? This item will not be deleted, it will just not appear in the album any longer.",function(F,E,G){MF.Media.Service.removeFromAlbum(B,C,{onSuccess:function(H){MF.Message.showInfo(E,"Removed from album",MF.Message.Scope.Page,5000);$("li.js-browse"+B).hide("slow");},onComplete:function(){G();}});},"Remove Item","Don't Remove");return false;};};this.viewFullscreen=function(D,B,C){A=true;if("undefined"===typeof B||B===null){if("undefined"===typeof MF.Media.MediaNavThumbs.curAlbumId){if("undefined"===typeof MF.Media.ShareID){B=-1;}else{B=-10;}}else{B=MF.Media.MediaNavThumbs.curAlbumId;}}MF.Media.Fullscreen.show(D,B,function(){A=false;});if("undefined"===typeof C||C){MF.Media.Fullscreen.playSlideshow();}};this.clickSlideshow=function(B){return function(){MF.Media.MediaNavThumbs.viewFullscreen(B);return false;};};}).call(MF.Media.MediaNavThumbs);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.SelectMedia=JsonML.BST([""," ",function(){this.albumId=this.data.albumId;this.maxCount=this.data.count;}," ",["form",{"class":"js-UnsavedData",id:"SelectForm",method:"post",title:"You have unsaved changes. Are you sure you want to leave this page?",action:function(){return this.data.returnUrl;}}," ",["div",{"class":"admin"}," ",["p",["a",{href:"#select",onclick:"MF.Media.SelectMedia.selectPage(true);return false;","class":"pv-select-all"},"Select All on Page"]]," ",["p",["a",{href:"#deselect",onclick:"MF.Media.SelectMedia.selectPage(false);return false;","class":"pv-deselect-all"},"Deselect All on Page"]]," ",["ul",{"class":"subnav","jbst:visible":function(){return this.data.albumId>0;}}," ",["li",{"class":"label"},"Show: "]," ",["li",{"class":function(){return"media"+this.getActiveCss("Unknown");}},["a",{onclick:function(){return this.setContentFilter("Unknown");},href:"#all"},"All Media"]]," ",["li",{"class":function(){return"photos"+this.getActiveCss("Image");}},["a",{onclick:function(){return this.setContentFilter("Image");},href:"#photos"},"Photos"]]," ",["li",{"class":function(){return"slideshows"+this.getActiveCss("Slideshow");},"jbst:visible":function(){return this.hasSlideshows;}},["a",{onclick:function(){return this.setContentFilter("Slideshow");},href:"#slideshows"},"Slideshows"]]," ",["li",{"class":function(){return"videos"+this.getActiveCss("Video");}},["a",{onclick:function(){return this.setContentFilter("Video");},href:"#videos"},"Videos"]]," "]," ",["span",{id:"numSelected"},"0 Selected"]," "]," ",["div",{"class":"js-SelectMediaThumbs pvdisplay select"}," ",function(){return JsonML.BST(MF.Media.SelectMediaRow).dataBind(MF.splitArray(this.data.items,7),this.index,this.count);}," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,this.pageMedia(this.data.albumId)),this.index,this.count);}," ",["p",{"class":"submit"},["a",{"class":"positive",onclick:"MF.Media.SelectMedia.addToAlbum(this);return false;"},function(){return this.getBtnText();}]," or ",["a",{href:function(){return this.data.returnUrl;}},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]]," "]]);(function(){var B="Unknown";function D(E){MF.Forms.disableSubmit(E);MF.Media.Service.addToAlbum(MF.Media.SelectMedia.albumId,MF.Media.SelectMedia.media,{onSuccess:function(F){MF.Media.SelectMedia.media=[];if(E.markClean){E.markClean();}window.location.href=F;},onComplete:function(){MF.Forms.enableSubmit(E);}});}function C(E){MF.Forms.disableSubmit(E);MF.Gifts.Service.createGift(MF.Media.SelectMedia.media,{onSuccess:function(F){MF.Media.SelectMedia.media=[];if(E.markClean){E.markClean();}MF.Gifts.Gifter.submitOrder(F.xml);},onComplete:function(){MF.Forms.enableSubmit(E);}});}function A(){$("#numSelected").html(MF.Media.SelectMedia.media.length+" Selected");}this.albumId=0;this.maxCount=0;this.media=[];this.addSelectedMedia=function(E){if(!MF.Media.SelectMedia.isSelectedMedia(E)){MF.Media.SelectMedia.media.push(E);A();}};this.addToAlbum=function(E){var F=E.form;if(MF.Media.SelectMedia.media.length===0){window.location.href=F.action;}else{if(MF.Media.SelectMedia.albumId>0){D(F);}else{C(F);}}};this.ensureSelectedMedia=function(){$(".js-SelectMediaThumbs table").each(function(){var E=$(this).find("input[type=checkbox]");if(E&&MF.Media.SelectMedia.isSelectedMedia(parseInt(E.attr("value"),10))){MF.Media.SelectMediaItem.select(this);MF.Media.SelectMediaItem.highlight(this,true);}});};this.getMedia=function(E,F,G){MF.Media.Service.getMediaNotInAlbum(E,F,G,B,{onSuccess:function(H){$("div.js-Pagination").replaceWith(MF.Paging.Pager.bind(MF.Paging.Pager.buildData(H.start,H.count,H.total,MF.Media.SelectMedia.pageMedia(H.albumId))));H=MF.Media.SelectMediaRow.bind(MF.splitArray(H.items,7));$("div.js-SelectMediaThumbs").empty().append(H);MF.Media.SelectMedia.ensureSelectedMedia();A();document.body.scrollIntoView(true);}});};this.isSelectedMedia=function(E){return jQuery.inArray(E,MF.Media.SelectMedia.media)>=0;};this.pageMedia=function(E){return function(G,F){MF.Media.SelectMedia.getMedia(E,G,F);};};this.removeSelectedMedia=function(E){var F=jQuery.inArray(E,MF.Media.SelectMedia.media);if(F>=0){MF.Media.SelectMedia.media.splice(F,1);A();}};this.selectPage=function(E){$(".js-SelectMediaThumbs table").each(function(){if(E){var F=$(this).find("input[type=checkbox]");if(F&&!F.is(":checked")){F.attr("checked","checked");MF.Media.SelectMedia.addSelectedMedia(parseInt(F.attr("value"),10));}MF.Media.SelectMediaItem.highlight(this,true);}else{var F=$(this).find("input[type=checkbox]");if(F&&F.is(":checked")){F.removeAttr("checked");MF.Media.SelectMedia.removeSelectedMedia(parseInt(F.attr("value"),10));}MF.Media.SelectMediaItem.highlight(this,false);}A();});};this.setContentFilter=function(E){return function(){if(B!==E){var F=$(this);$("li.active").removeClass("active");F.parent("li").addClass("active");B=E;MF.Media.SelectMedia.getMedia(MF.Media.SelectMedia.albumId,0,MF.Media.SelectMedia.maxCount);}return false;};};this.getActiveCss=function(E){if(E===B){return" active";}return"";};this.getBtnText=function(){if(this.data.albumId>0){return"Add to album";}else{return"Create photo gifts";}};}).call(MF.Media.SelectMedia);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.SelectMediaRow=JsonML.BST(["div",{"class":"pvrow clearfix"}," ",function(){return JsonML.BST(MF.Media.SelectMediaItem).dataBind(this.data,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.SelectMediaItem=JsonML.BST(["div",{"class":"box"}," ",["table",{cellpadding:"0",cellspacing:"0",onclick:"MF.Media.SelectMediaItem.select(this);",onmouseover:"MF.Media.SelectMediaItem.highlight(this, true);",onmouseout:"MF.Media.SelectMediaItem.highlight(this, false);"}," ",["tr",["td",{"class":function(){return"thumbnail"+(this.data.contentType==="Video"||this.data.contentType==="Slideshow"?" videothumb":"");}}," ",["div",{"class":"vidcontain"},["img",{src:function(){return this.data.imageUrl;}}],["span",{"class":"overlay"},"\u00A0"]]," "]]," ",["tr",["td",{"class":"info"}," ",["input",{type:"checkbox",value:function(){return this.data.contentId;},onmouseup:"MF.Media.SelectMediaItem.select(this);"}]," ",["p",{"class":"title"},function(){return this.data.title;}]," "]]]," "]);(function(){this.highlight=function(A,B){var C=$(A).find("td");if(C){if(B){C.addClass("active");}else{if(!$(C).find("input[type=checkbox]").is(":checked")){C.removeClass("active");}}}};this.select=function(B){A=$(B);if(B.tagName.toLowerCase()!=="input"){var A=$(B).find("input[type=checkbox]");}if(!A.is(":checked")){A.attr("checked","checked");MF.Media.SelectMedia.addSelectedMedia(parseInt(A.attr("value"),10));}else{A.removeAttr("checked");MF.Media.SelectMedia.removeSelectedMedia(parseInt(A.attr("value"),10));}};}).call(MF.Media.SelectMediaItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.RecentAlbums=JsonML.BST(["div",{"jbst:visible":function(){return this.data.total>0;}}," ",["div",{"class":"section-title"}," ",["h3","Latest albums ",["em","(",function(){return this.data.items.length;}," of ",function(){return this.data.total;}," total)"]],["a",{"class":"viewall",href:function(){return this.data.albumsUrl;}},"View all"]," "],""," ",["div",{"class":"pvdisplay albums albums-sidebar"}," ",function(){return JsonML.BST(MF.Media.AlbumItem).dataBind(this.data.items,this.index,this.count);}," "]," ",["div",{"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"There are no albums to display."]," ",["br"]," "]," ",["p",{"class":"extra","jbst:visible":function(){return this.data.total>3;}},["a",{href:function(){return this.data.albumsUrl;}},"View all albums \u00BB"]]," "]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumsModule=JsonML.BST(["div",{"class":"js-AlbumModule"}," ",function(){return JsonML.BST(MF.Toolbars.FilterBar).dataBind(this.getSortBarData(this.data),this.index,this.count);}," ",["div",{"class":"pvdisplay albums albums-full"}," ",function(){return JsonML.BST(MF.Media.AlbumRow).dataBind(MF.splitArray(this.data.items,5),this.index,this.count);}," "]," ",["div",{"class":function(){return this.getNoResultsCss(this.data);},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"No results match that criteria."]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,MF.Media.AlbumsModule.getAlbums),this.index,this.count);}," "]);(function(){function H(L){var M="";if(L!==0){M="?start="+L;}var N=F.getSelectedAsString();if(N.length>0){if(M.length===0){M+="?";}else{M+="&";}M+="u="+N;}return M;}function J(L){window.location.href=L+H(0);}function E(){MF.Media.AlbumsModule.getAlbums(0);}function B(O,L,N){if(N.selectedIdx===L){O.asc=!O.asc;}var M=MF.getQueryParam("start",true,0);MF.Media.Service.getAlbums(M,K,null,L,O.asc,F.getSelectedUsers(),{onSuccess:function(P){P=MF.Media.AlbumsModule.bind(P);$("div.js-AlbumModule").replaceWith(P);document.body.scrollIntoView(true);}});return true;}var K;var A=null;var G=null;var C;var F=new MF.Toolbars.FilterBarPeopleMenu.Menu(E);var I=new MF.Toolbars.FilterBarMenu.Menu("Sort",[{label:"Recent activity",asc:false},{label:"Date added",asc:false},{label:"Title",asc:true},{label:"Author",asc:true}],B);var D=false;this.getSortBarData=function(L){if(!D){K=L.count;if(L.canAdd){A=new MF.Toolbars.FilterBarButton.Button("Create new album",MF.Media.CreateAlbumUrl);}C=new MF.Media.MediaToolbarMenu.Menu("Album",MF.Media.AlbumsModule.hasSlideshows,J);I.setSelection(L.sortData.colIdx).asc=L.sortData.asc;D=true;}return{items:[A,C,F,I]};};this.getAlbums=function(M,L){window.location.href=MF.Media.ThisUrl+H(M);};this.getNoResultsCss=function(L){if(F.getSelectionType()>0){return"";}else{return("albums-empty"+(L.canAdd?"":" nopermission"));}};}).call(MF.Media.AlbumsModule);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumItem=JsonML.BST([""," ",["div",{"class":"box"}," ",["div",{"class":"album"}," ",["img",{src:function(){return this.data.imageUrls[0];},"jbst:visible":function(){return this.data.imageUrls.length>0;}}],["img",{src:function(){return this.data.imageUrls[1];},"jbst:visible":function(){return this.data.imageUrls.length>1;}}],["img",{src:function(){return this.data.imageUrls[2];},"jbst:visible":function(){return this.data.imageUrls.length>2;}}],["img",{src:function(){return this.data.imageUrls[3];},"jbst:visible":function(){return this.data.imageUrls.length>3;}}],["img",{src:function(){return this.data.imageUrls[4];},"jbst:visible":function(){return this.data.imageUrls.length>4;}}],["img",{src:function(){return this.data.imageUrls[5];},"jbst:visible":function(){return this.data.imageUrls.length>5;}}]," "]," ",["a",{href:function(){return this.data.url;},"class":"album-link"},"\u00A0"]," ",["div",{"class":"info"}," ",["p",{"class":"title"},["a",{href:function(){return this.data.url;}},function(){return this.data.title;}]]," ",["p",{"class":"date"},"Added ",function(){return this.data.date;}]," ",["p",{"class":"date"},"Created by ",["a",{href:function(){return this.data.authorUrl;}},function(){return this.data.authorName;}]]," ",["p",{"class":"meta"},function(){return this.data.viewCount;}," Views \u2022 ",["a",{href:function(){return this.data.url+"#comments";}},function(){return this.data.commentCount;}," Comments"]]," "]," "]," ",""," "]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumRow=JsonML.BST(["div",{"class":"pvrow clearfix"}," ",function(){return JsonML.BST(MF.Media.AlbumItem).dataBind(this.data,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumName=JsonML.BST([""," ",["div",{"class":"page-title","jbst:onload":function(){return this.autoStartSlideshow(this.data.contentId);}}," ",["h2",["a",{href:function(){return this.data.albumsUrl;}},"Albums"]," \u00BB ",["span",{ondblclick:function(){return this.viewFullscreen(this.data.contentId);}},["strong",function(){return this.data.title;}]]]," "]," ",["p",{"class":"meta album-single"},"Created ",function(){return this.data.date;}," by ",["a",{href:function(){return this.data.authorUrl;}},["strong",function(){return this.data.authorName;}]]," ",["span","\u2022"]," ",function(){return this.data.imageCount;}," Photos & ",function(){return this.data.videoCount;}," Videos ",["span","\u2022"]," ",function(){return this.data.viewCount;}," Views ",["span","\u2022"]," ",["a",{href:"#comments"},function(){return this.data.commentCount;}," Comments"]," ",["span",{"jbst:visible":function(){return this.data.canDelete;}},"\u2022"],["span",{"jbst:visible":function(){return this.data.canDelete;}},["a",{"class":"edit",href:function(){return this.data.editUrl;}},"Edit album"]," or ",["a",{"class":"delete",onclick:function(){return MF.Dialogs.ConfirmDeleteDialog.confirm(this.data.contentId,this.deleteAlbum);},href:"#"},"delete album"]]]," "]);(function(){this.deleteAlbum=function(B,A,C){MF.Media.Service.deleteMedia(B,{onSuccess:function(D){if("function"===typeof C){C();}window.location=D.url;}});};this.viewFullscreen=function(A){return function(B){if(MF.Media.AlbumMediaModule&&MF.Media.AlbumMediaModule.firstId&&MF.Media.MediaNavThumbs&&MF.Media.MediaNavThumbs.viewFullscreen){MF.Media.MediaNavThumbs.viewFullscreen(MF.Media.AlbumMediaModule.firstId,A);}};};this.autoStartSlideshow=function(A){return function(){var B=(document.location.hash||"").toLowerCase();if(B==="#slideshow"||B==="slideshow"){MF.Media.AlbumName.viewFullscreen(A)();}};};}).call(MF.Media.AlbumName);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumMediaModule=JsonML.BST([""," ",function(){this.setPinned(this.data.pinned);this.albumId=this.data.contentId;if(this.data.items&&this.data.items.length>0){this.firstId=this.data.items[0].id;}}," ",["div",{"class":"js-AlbumMediaModule"}," ",["div",{"class":"admin","jbst:visible":function(){return this.data.canAdd||this.data.canShare||this.data.canCopy;}}," ",["p",{"class":"add create-media","jbst:visible":function(){return this.data.canAdd;}},["a",{"class":"thickbox add-to-existing-album",onclick:function(){return MF.Media.AddToAlbumDialog.show(MF.Media.AddUrl,MF.Media.UploadUrl);},href:"#add"},"Add to album"]]," ",["p",{"jbst:visible":function(){return this.data.total>0;}},["a",{onclick:function(){return this.viewFullscreen(this.data.contentId);},href:"#slideshow","class":"item-slideshow"},"Play slideshow"]]," ",["p",{"jbst:visible":function(){return this.data.total>0&&this.data.arrangeUrl.length>0;}},["a",{href:function(){return this.data.arrangeUrl;}},"Arrange album"]]," ",["p",{"jbst:visible":function(){return this.data.total>0&&this.data.canAdd;}},["a",{onclick:function(){return this.pinAlbum(this.data.contentId);},href:"#pin"},function(){return this.getPinnedText(this.data.pinned);}]]," ",["p",{"jbst:visible":function(){return this.data.total>0&&this.data.canShare;}},["a",{onclick:function(){return this.showShareDialog(this.data.contentId);},href:"#share","class":"item-share"},"Share album"]]," ",["p",{"jbst:visible":function(){return this.data.total>0&&this.data.canCopy;}},["a",{onclick:function(){return this.showCopyToDialog(this.data.contentId);},href:"#copy","class":"item-copy"},"Copy album to another group"]]," ",["p",{"jbst:visible":function(){return this.data.canAdd;}},["a",{"class":function(){return this.getFavoriteCss(this.data.isFavorite);},href:"#love",onclick:function(){return this.markFavorite(this.data.contentId,this.data.isFavorite);}},function(){return this.getFavoriteText(this.data.isFavorite);}]]," "]," ",["div",{"class":"pvdisplay album","jbst:visible":function(){return this.data.total>0;}}," ",function(){return JsonML.BST(MF.Media.MediaRow).dataBind(MF.splitArray(this.data.items,5),this.index,this.count);}," "]," ",["div",{"class":function(){return this.data.canAdd?"album-empty":"no-content";},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"This album is empty"]," ",["p",{"jbst:visible":function(){return !this.data.canAdd;}},["br"]]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,this.pageMedia(this.data.contentId)),this.index,this.count);}," "]," "]);(function(){var A=false;this.pageMedia=function(B){return function(D,C){if(MF.Media.AlbumMediaModule.ajaxPaging){MF.Media.Service.getAlbumMedia(B,D,C,{onSuccess:function(F){F=MF.Media.AlbumMediaModule.bind(F);$("div.js-AlbumMediaModule").replaceWith(F);document.body.scrollIntoView(true);}});}else{if(D===0){window.location.href=MF.Media.ThisUrl;}else{var E=MF.Media.ThisUrl;if(E.indexOf("?")!=-1){E+="&";}else{E+="?";}E+="start="+D;window.location.href=E;}}};};this.setPinned=function(B){A=B;};this.arrangeAlbum=function(){alert("TODO: Implement arrange album functionality");return false;};this.getPinnedText=function(B){if(B){return"Unpin album from homepage";}else{return"Pin album to homepage";}};this.pinAlbum=function(B){return function(){var C=this;MF.Media.Service.pinContent(B,!A,{onSuccess:function(D){A=D.pinned;$(C).html(MF.Media.AlbumMediaModule.getPinnedText(A));}});return false;};};this.showShareDialog=function(B){return function(){MF.Share.ShareDialog.showDlg(B);return false;};};this.getFavoriteText=function(B){if(B){return"You love this";}else{return"Love this";}};this.getFavoriteCss=function(B){if(B){return"item-fave active";}else{return"item-fave";}};this.markFavorite=function(C,B){return function(){var D=$(this);MF.Favorite.Service.markFavorite(C,!B,"Album",{onSuccess:function(E){B=E.isFavorite;D.toggleClass("active");$(D).html(MF.ContentCopy.ActionLinks.getFavoriteText(B));$(".js-favoritesList").replaceWith(MF.Favorite.FavoriteList.bind(E.favoritesList));}});};};this.showCopyToDialog=function(B){return function(){MF.ContentCopy.SitePickerDialog.show(B);return false;};};this.viewFullscreen=function(B){return function(C){if(MF.Media.AlbumMediaModule&&MF.Media.AlbumMediaModule.firstId&&MF.Media.MediaNavThumbs&&MF.Media.MediaNavThumbs.viewFullscreen){MF.Media.MediaNavThumbs.viewFullscreen(MF.Media.AlbumMediaModule.firstId,B);}return false;};};}).call(MF.Media.AlbumMediaModule);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumEdit=JsonML.BST(["form",{"class":"js-UnsavedData",id:"AlbumEdit",method:"post",title:"You haven't saved your album yet. Are you sure you want to navigate away from this page?",onsubmit:"return false;"}," ",["div",{"class":"section-title"}," ",["h3","Album details"]," "]," ",["div",{"class":"twocol1wide"}," ",["div",{"class":"column1"}," ",["label",{"for":""},"Album title"]," ",["input",{"class":"active",type:"text",name:"atitle",value:"","jbst:onload":"this.focus()"}]," ",["label",{"for":""},"Album description"]," ",["textarea",{name:"adesc","class":"active js-expand"}]," ",function(){return JsonML.BST(MF.Help.FormatGuide).dataBind(this.data,this.index,this.count);}," "]," "]," ",["p",{"class":"submit"},["a",{"class":"positive",onclick:"MF.Media.AlbumEdit.saveChanges(this);return false;"},function(){return JsonFx.Lang.get("Global,SaveChanges");}]," or ",["a",{href:function(){return MF.Media.AlbumsUrl;}},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]]," "]);(function(){this.saveChanges=function(A){var B=A.form;MF.Message.clear(B,MF.Message.Scope.Column);var C=MF.Forms.getFormData(B);if(!C.atitle){MF.Message.showError(B,"Please enter a title.",MF.Message.Scope.Column);return false;}MF.Forms.disableSubmit(B);MF.Media.Service.createAlbum(C.atitle,C.adesc,{onSuccess:function(D){if(B.markClean){B.markClean();}window.location.pathname=D.url;},onComplete:function(){MF.Forms.enableSubmit(B);}});};}).call(MF.Media.AlbumEdit);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AddToAlbumDialog=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind({height:100,width:350,modal:false,data:this.data},this.index,this.count,{$:[""," ",["p",{"class":"submit"}," ",["a",{"class":"positive",href:function(){return this.data.uploadUrl;}},"Upload from Computer"]," or ",["a",{"class":"positive",href:function(){return this.data.addUrl;}},"Choose from this family group"]," "]," "]});});(function(){this.show=function(A,B){return function(){var C=MF.Media.AddToAlbumDialog.bind({addUrl:A,uploadUrl:B});if(C){document.body.appendChild(C);}if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}return false;};};}).call(MF.Media.AddToAlbumDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.Arrange=JsonML.BST([""," ",function(){this.updateCurrentData(this.data);}," ",["form",{"class":"js-UnsavedData js-Arrange",id:"ArrangeForm",onsubmit:"return false;",title:"You have unsaved changes. Are you sure you want to leave this page?"}," ",function(){return JsonML.BST(MF.Toolbars.SortToolbar).dataBind(this.getSortBarData(),this.index,this.count);}," ",["p",{"class":"submit first","jbst:visible":function(){return this.data.total>60;}},["a",{onclick:"MF.Media.Arrange.saveArrangement(this);return false;","class":"positive"},"Save arrangement"]," or ",["a",{href:function(){return this.cancelUrl;}},function(){return JsonFx.Lang.get("Global,Cancel");}]]," ",["div",{id:"sortable","class":"pvdisplay album","jbst:onload":function(){return this.enableSort;}}," ",function(){return JsonML.BST(MF.Media.ArrangeItem).dataBind(this.data.items,this.index,this.count);}," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,this.pageMedia(this.data.albumId)),this.index,this.count);}," ",["p",{"class":"submit"},["a",{"class":"positive",onclick:"MF.Media.Arrange.saveArrangement(this);return false;"},"Save arrangement"]," or ",["a",{href:function(){return this.cancelUrl;}},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]]," "]," "]);(function(){var G={},H=null,F=false,C=false;function B(N){var M=MF.Media.Arrange.bind(N);$("form.js-Arrange").replaceWith(M);document.body.scrollIntoView(true);}function D(N){var O=N.length;if(O==0){return false;}while(--O){var P=Math.floor(Math.random()*(O+1));var M=N[O];var Q=N[P];N[O]=Q;N[P]=M;}}function A(){if(F){var M={};for(var Q=0;Q<H.items.length;Q++){var R=H.items[Q];M[R.contentId.toString()]=R;}var P=[];var O=$("#sortable div:first");while(O.length>0){var N=O.data("contentId");var R=M[N.toString()];P.push(R);O=O.next();}H.items=P;F=false;}}function L(){C=true;H.modified=true;}function J(M,O,N){if(O===N){return 0;}else{if(O>N){return M?1:-1;}else{return M?-1:1;}}}function I(){if(H.sortColumnIdx>=0){H.sortColumnIdx=-1;MF.Toolbars.SortToolbar.rebindToolbar(MF.Media.Arrange.getSortBarData(H));}}this.pageMedia=function(M){return function(P,N){A();var O=P.toString();if(G.hasOwnProperty(O)){B(G[O]);}else{MF.Media.Service.getArrangeableAlbumMedia(M,P,N,{onSuccess:B});}};};this.saveArrangement=function(O){A();if(C){pages=[];for(var N in G){var R=G[N];if(R.modified){var M={};pages.push(M);M["start"]=R.start;var P=[];for(var Q=0;Q<R.items.length;Q++){P.push(R.items[Q].contentId);}M["items"]=P;}}MF.Media.Service.saveAlbumOrder(H.albumId,pages,{onSuccess:function(S){window.location.href=S.url;}});}else{window.location.href=MF.Media.Arrange.cancelUrl;}};this.enableSort=function(){$("#sortable").sortable({update:function(){F=true;L();I();}});};this.randomize=function(){L();H.sortColumnIdx=-1;D(H.items);B(H);return false;};this.updateCurrentData=function(N){H=N;var M=N.start.toString();if(!G.hasOwnProperty(N.start.toString())){G[M]=N;}};this.sortItems=function(O,M){H.sortColumnIdx=MF.Toolbars.SortToolbar.getSortIdx();var P=MF.Toolbars.SortToolbar.isSortAsc();var N=null;switch(H.sortColumnIdx){case 0:N=function(Q,R){return J(P,Q.title,R.title);};break;case 1:N=function(Q,R){return J(P,Q.dateCreated,R.dateCreated);};break;case 2:N=function(Q,R){return J(P,Q.dateTaken,R.dateTaken);};break;}H.items.sort(N);L();B(H);};var E=new Array("Title","Date created","Date taken");var K=new Array(true,true,true);this.getSortBarData=function(){return{columns:E,custom2:{jbst:MF.Media.ArrangeActions,data:{}},displayMode:0,initialColSortAsc:K,isListMode:false,newBtnText:"",sortCallback:MF.Media.Arrange.sortItems,sortIdx:H&&"undefined"!==typeof H.sortColumnIdx?H.sortColumnIdx:-1,showListModeBtns:false};};}).call(MF.Media.Arrange);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.ArrangeItem=JsonML.BST(["div",{"class":function(){return"ui-state-default thumbnail square"+(this.data.contentType==="Video"||this.data.contentType==="Slideshow"?" videothumb":"");},"jbst:onload":function(){return this.setData(this.data);}},["div",{"class":"vidcontain"},["img",{src:function(){return this.data.square;},width:"90",height:"90",title:function(){return this.data.title?this.data.title.replace(/\"/g,"'"):"";}}],["span",{"class":"overlay"},"\u00A0"]]," "]);(function(){this.setData=function(A){return function(){$(this).data("contentId",A.contentId);};};}).call(MF.Media.ArrangeItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.ArrangeActions=JsonML.BST(["p",{"class":"sort shuffle"},["a",{onclick:function(){return MF.Media.Arrange.randomize;},href:"#randomize","class":"last"},"Shuffle"]]);}catch(ex){}