try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.Service=new JsonFx.IO.Service("/Features/BlogSites/BlogSiteService.jrpc");MF.Blog.Service.createBlog=function(opt){this.invoke("createBlog",null,opt);};MF.Blog.Service.createEntry=function(title,description,privacyLevel,image,video,orientation,opt){this.invoke("createEntry",[title,description,privacyLevel,image,video,orientation],opt);};MF.Blog.Service.deleteEntry=function(contentID,opt){this.invoke("deleteEntry",[contentID],opt);};MF.Blog.Service.followBlog=function(bloggerID,requestId,opt){this.invoke("followBlog",[bloggerID,requestId],opt);};MF.Blog.Service.unfollowBlog=function(bloggerID,requestId,opt){this.invoke("unfollowBlog",[bloggerID,requestId],opt);};MF.Blog.Service.getBlogStream=function(start,count,onlyShowFavs,sortColIdx,sortAsc,userIDs,opt){this.invoke("getBlogStream",[start,count,onlyShowFavs,sortColIdx,sortAsc,userIDs],opt);};MF.Blog.Service.getFollowingList=function(start,count,sortColIdx,sortAsc,opt){this.invoke("getFollowingList",[start,count,sortColIdx,sortAsc],opt);};MF.Blog.Service.getImageUrl=function(contentGuid,opt){this.invoke("getImageUrl",[contentGuid],opt);};MF.Blog.Service.removeFollower=function(userId,opt){this.invoke("removeFollower",[userId],opt);};MF.Blog.Service.updateEntry=function(entryID,title,description,privacyLevel,image,video,opt){this.invoke("updateEntry",[entryID,title,description,privacyLevel,image,video],opt);};MF.Blog.Service.getPendingList=function(start,count,opt){this.invoke("getPendingList",[start,count],opt);};MF.Blog.Service.approve=function(requestIds,opt){this.invoke("approve",[requestIds],opt);};MF.Blog.Service.deny=function(requestIds,opt){this.invoke("deny",[requestIds],opt);};MF.Blog.Service.getFollowersList=function(start,count,sortColIdx,sortAsc,opt){this.invoke("getFollowersList",[start,count,sortColIdx,sortAsc],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.PrivacySelect=JsonML.BST(["p",{"class":"privacy"},["label","Privacy"]," ",["select",{name:"privacy"}," ",["option",{selected:function(){return this.getSelectedPrivacy(this.data,"Public");},value:"Public"},"Public"]," ",["option",{selected:function(){return this.getSelectedPrivacy(this.data,"Private");},value:"Private"},"Private"]," ",["option",{selected:function(){return this.getSelectedPrivacy(this.data,"Secret");},value:"Secret"},"Secret"]," "]," "]);(function(){this.getSelectedPrivacy=function(C,B){var A=MF.Blog.PrivacyLevel;if(C&&C.privacy){A=C.privacy;}return A===B?"selected":"";};}).call(MF.Blog.PrivacySelect);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.PhotoPublisher=JsonML.BST(["div",{"class":"add-panel add-photos add-media js-add-panel js-PhotoPublisher"}," ",["div",{"class":"js-PostSuccess",style:"display:none"}," ",function(){MF.Blog.PostSuccess.close=this.close;}," "]," ",["div",{"class":"js-ErrorLocation"}]," ",["p",{"class":"blog-picture",style:function(){return this.data&&this.data.imageUrl?"":"display:none";}}," ",["label","\u00A0"]," ",["img",{src:function(){return this.data&&this.data.imageUrl?String.format(this.data.imageUrl,this.data.orientation||0):"";},"class":"js-ImagePreview item-main"}]," ",["span",{"class":"js-statusmsg"}],["br"]," "]," ",["div",{id:"js-rotatePhoto"}," ",function(){return this.rotateControl(this.data);}," "]," ",function(){return JsonML.BST(MF.Publisher.SingleFileUploader).dataBind(this.getUploaderData(),this.index,this.count);}," ",["form",{id:"photo-publisher","class":"js-photoform"}," ",["p",["label","Title"]," ",["input",{"class":"text js-InlineInstruction",type:"text",name:"title",title:"Optional",onblur:"MF.Message.clear($('div.js-ErrorLocation'), MF.Message.Scope.Column);",value:function(){return this.data&&this.data.title?this.data.title:"";}}]]," ",["p",["label","Message"]," ",["textarea",{"class":"discussion js-expand js-InlineInstruction",title:"Optional",name:"message"},function(){return this.data&&this.data.message?this.data.message:"";}]]," ",function(){return JsonML.BST(MF.Help.FormatGuide).dataBind(this.data,this.index,this.count);}," ",function(){return JsonML.BST(MF.Blog.PrivacySelect).dataBind(this.data,this.index,this.count);}," ",["p",{"class":"submit"}," ",["a",{"class":"positive",onclick:function(){return this.save((this.data&&this.data.id)?this.data.id:0);}},function(){return this.getSubmitText();}]," or ",["a",{href:function(){return this.data?this.data.cancelUrl:"#cancel";},onclick:function(){return this.data&&this.data.cancelUrl?null:this.close;}},["strong","cancel"]]," "]," "]," "]);(function(){var A="/Images/loadingIndicators/small-brown.gif";var H="div.js-ErrorLocation";var F=null;function C(J){var I=new Image();I.onload=function(){var K=$("img.js-ImagePreview")[0];K.src=J;K.width=I.width;K.height=I.height;I.onload=null;I=null;};I.src=J;}function E(I){$("span.js-statusmsg").text(I);}function G(I){MF.Message.clear($(H),MF.Message.Scope.Column);F=null;$("p.blog-picture").show();E("Uploading "+I+". Please wait.");C(A);}function D(K){F={DateTaken:K.dateTaken,DisplayAuth:K.remasteredAuth||null,DisplayGuid:K.remasteredID||null,Description:K.description,FileLength:K.fileLength,MIMEType:K.mimeType,Orientation:K.orientation,OriginalFileName:K.originalFileName,OriginalAuth:K.originalAuth||null,OriginalGuid:K.originalID||null,Title:K.title||K.originalFileName};E("");var I=$("input[name=title]");if(I.val()===""){I.val(F.Title);}var J=K.originalID;MF.Blog.Service.getImageUrl(J,{onSuccess:function(L){C(String.format(L.imageUrl,K.orientation||0));$("#js-rotatePhoto").empty().append(MF.Blog.RotatePhoto.bind({transforms:"",saveUrl:L.saveUrl,id:0,orient:F.Orientation,rotateUrl:L.imageUrl,type:"Image"}));}});}function B(I){if(I){MF.Message.showError($(H),I,MF.Message.Scope.Column);}else{MF.Message.clear($(H),MF.Message.Scope.Column);}}this.save=function(I){return function(){var J=$("form.js-photoform")[0];MF.Message.clear($(H),MF.Message.Scope.Column);var L=MF.Forms.getFormData(J);if(I===0){if(F===null){MF.Message.showError($(H),"No photo uploaded yet.",MF.Message.Scope.Column);return false;}var K=F.DisplayGuid||F.OriginalGuid;if(!K||K==="00000000-0000-0000-0000-000000000000"){MF.Message.showError($(H),"Please choose a photo.",MF.Message.Scope.Column);return false;}MF.Forms.disableSubmit(J);MF.Blog.Service.createEntry(L.title,L.message,L.privacy,F,null,F.Orientation,{onSuccess:function(M){if(J.markClean){J.markClean();}F=null;if(L.privacy==="Public"){MF.Blog.PostSuccess.refresh(M.entry);}else{MF.Blog.PhotoPublisher.close();}MF.Publisher.BytesLeft=M.bytesLeft;MF.Publisher.BytesMax=M.bytesMax;MF.Blog.BlogsModule.display(M.entry);},onComplete:function(){MF.Forms.enableSubmit(J);}});}else{MF.Forms.disableSubmit(J);MF.Blog.Service.updateEntry(I,L.title,L.message,L.privacy,F,null,{onSuccess:function(M){if(J.markClean){J.markClean();}window.location.href=M.url;},onComplete:function(){MF.Forms.enableSubmit(J);}});}};};this.close=function(){MF.UnsavedData.markClean("Blog.Upload");MF.Publisher.Module.reset.call(this);return false;};this.getUploaderData=function(){var I=MF.Publisher.SingleFileUploader.buildData(["jpg","jpeg","jpe","png","gif","tif"],MF.user.authID,(this.data&&this.data.formUrl)?this.data.formUrl:MF.Publisher.iframeUploadUrlFmt,(this.data&&this.data.transforms)?this.data.transforms:MF.Publisher.thumbTransforms,(this.data&&this.data.domain)?this.data.domain:MF.Publisher.uploadDomain,G,null,D,B);I.clearInput=true;return I;};this.getSharedData=function(){var I=$("#photo-publisher")[0];return MF.Forms.getFormData(I);};this.getSubmitText=function(){if(this.data&&this.data.id){return"Save";}else{return"Post photo";}};this.rotateControl=function(I){if(I&&I.mediaId>0){return MF.Blog.RotatePhoto.dataBind({transforms:"",saveUrl:I.saveUrl,id:I.mediaId||"",orient:I.orientation,rotateUrl:I.imageUrl,type:"Image"});}};this.setAuthGuid=function(I){if(F){F.DisplayAuth=I;}};this.setDisplayGuid=function(I){if(F){F.DisplayGuid=I;}};this.setOrientation=function(I){if(F){F.Orientation=I;}};}).call(MF.Blog.PhotoPublisher);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.TextPublisher=JsonML.BST(["div",{"class":"add-panel add-discussion add-media js-add-panel"}," ",["div",{"class":"js-PostSuccess",style:"display:none"}," ",function(){MF.Blog.PostSuccess.close=this.close;}," "]," ",["form",{id:"discussion-publisher"}," ",["p",["label","Title"]," ",["input",{"class":"text js-InlineInstruction",type:"text",name:"title",title:"Optional",value:function(){return this.data&&this.data.title?this.data.title:"";}}]]," ",["p",["label","Message"]," ",["textarea",{"class":"discussion active js-expand",name:"message"},function(){return this.data&&this.data.message?this.data.message:"";}]]," ",function(){return JsonML.BST(MF.Help.FormatGuide).dataBind(this.data,this.index,this.count);}," ",function(){return JsonML.BST(MF.Blog.PrivacySelect).dataBind(this.data,this.index,this.count);}," ",["p",{"class":"submit"}," ",["a",{"class":"positive",onclick:function(){return MF.Blog.TextPublisher.save((this.data&&this.data.id)?this.data.id:0);}},function(){return this.getSubmitText();}]," or ",["a",{href:function(){return this.data?this.data.cancelUrl:"#cancel";},onclick:function(){return this.data&&this.data.cancelUrl?null:MF.Publisher.Module.reset;}},["strong","cancel"]]," "]," "]," "]);(function(){this.save=function(A){return function(){var B=this.form;MF.Message.clear(B,MF.Message.Scope.Column);var C=MF.Forms.getFormData(B);if(!C.message){MF.Message.showError(B,"Please enter a message.",MF.Message.Scope.Column);return false;}MF.Forms.disableSubmit(B);if(A===0){MF.Blog.Service.createEntry(C.title,C.message,C.privacy,null,null,0,{onSuccess:function(D){if(B.markClean){B.markClean();}if(C.privacy==="Public"){MF.Blog.PostSuccess.refresh(D.entry);}else{MF.Blog.TextPublisher.close();}MF.Blog.BlogsModule.display(D.entry);},onComplete:function(){MF.Forms.enableSubmit(B);}});}else{MF.Blog.Service.updateEntry(A,C.title,C.message,C.privacy,null,null,{onSuccess:function(D){if(B.markClean){B.markClean();}window.location.href=D.url;},onComplete:function(){MF.Forms.enableSubmit(B);}});}return false;};};this.close=function(){MF.Publisher.Module.reset.call(this);return false;};this.getSharedData=function(){var A=$("#discussion-publisher")[0];return MF.Forms.getFormData(A);};this.getSubmitText=function(){if(this.data&&this.data.id){return"Save";}else{return"Post new entry";}};}).call(MF.Blog.TextPublisher);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.VideoPublisher=JsonML.BST(["div",{"class":"add-panel add-video add-media js-add-panel js-VideoPublisher"}," ",["div",{"class":"js-PostSuccess",style:"display:none"}," ",function(){MF.Blog.PostSuccess.close=this.close;}," "]," ",["div",{"class":"js-ErrorLocation"}]," ",["p",{"class":"blog-video",style:function(){return this.data&&this.data.imageUrl?"":"display:none";}}," ",["label","\u00A0"]," ",["img",{src:function(){return this.data&&this.data.imageUrl?this.data.imageUrl:"";},"class":"js-ImagePreview"}]," ",["span",{"class":"js-statusmsg"}],["br"]," "]," ",function(){return JsonML.BST(MF.Publisher.SingleFileUploader).dataBind(this.getUploaderData(),this.index,this.count);}," ",["form",{id:"video-publisher","class":"js-videoform"}," ",["p",["label","Title"]," ",["input",{"class":"text js-InlineInstruction",type:"text",name:"title",title:"Optional",onblur:"MF.Message.clear($('div.js-ErrorLocation'), MF.Message.Scope.Column);",value:function(){return this.data&&this.data.title?this.data.title:"";}}]]," ",["p",["label","Message"]," ",["textarea",{"class":"discussion js-expand js-InlineInstruction",title:"Optional",name:"message"},function(){return this.data&&this.data.message?this.data.message:"";}]]," ",function(){return JsonML.BST(MF.Help.FormatGuide).dataBind(this.data,this.index,this.count);}," ",function(){return JsonML.BST(MF.Blog.PrivacySelect).dataBind(this.data,this.index,this.count);}," ",["p",{"class":"submit"}," ",["a",{"class":"positive",onclick:function(){return this.save((this.data&&this.data.id)?this.data.id:0);}},function(){return this.getSubmitText();}]," or ",["a",{href:function(){return this.data?this.data.cancelUrl:"#cancel";},onclick:function(){return this.data&&this.data.cancelUrl?null:MF.Publisher.Module.reset;}},["strong","cancel"]]," "]," "]," "]);(function(){var A="/Images/loadingIndicators/small-brown.gif";this.loadingImgUrl=A;var H="div.js-ErrorLocation";var F=null;function C(K){var J=new Image();J.onload=function(){var L=$("img.js-ImagePreview")[0];L.src=K;L.width=J.width;L.height=J.height;J.onload=null;J=null;};J.src=K;}function E(J){$("span.js-statusmsg").text(J);}function G(J){MF.Message.clear($(H),MF.Message.Scope.Column);F=null;$("p.blog-video").show();E("Uploading "+J+". Please wait.");C(A);}function I(J){}function D(L){var K=L.previewID||L.originalID;F={Description:L.description,DisplayAuth:L.previewAuth||null,DisplayGuid:L.previewID||null,Duration:L.duration,FileLength:L.fileLength,Height:L.height,MIMEType:L.mimeType,OriginalFileName:L.originalFileName,Title:L.title||L.originalFileName,OriginalAuth:L.originalAuth||null,OriginalGuid:L.originalID||null,Width:L.width};E("");var J=$("input[name=title]");if(J.val()===""){J.val(F.Title);}var K=L.previewID||L.originalID;MF.Blog.Service.getImageUrl(K,{onSuccess:function(M){C(String.format(M.imageUrl,L.orientation||0));}});}function B(J){if(J){MF.Message.showError($(H),J,MF.Message.Scope.Column);}else{MF.Message.clear($(H),MF.Message.Scope.Column);}}this.save=function(J){return function(){var K=$("form.js-videoform")[0];MF.Message.clear($(H),MF.Message.Scope.Column);var M=MF.Forms.getFormData(K);if(J===0){if(F===null){MF.Message.showError($(H),"No video uploaded yet.",MF.Message.Scope.Column);return false;}var L=F.DisplayGuid||F.OriginalGuid;if(!L||L==="00000000-0000-0000-0000-000000000000"){MF.Message.showError($(H),"Please choose a video.",MF.Message.Scope.Column);return false;}MF.Forms.disableSubmit(K);MF.Blog.Service.createEntry(M.title,M.message,M.privacy,null,F,0,{onSuccess:function(N){if(K.markClean){K.markClean();}F=null;if(M.privacy==="Public"){MF.Blog.PostSuccess.refresh(N.entry);}else{MF.Blog.VideoPublisher.close();}MF.Publisher.BytesLeft=N.bytesLeft;MF.Publisher.BytesMax=N.bytesMax;MF.Blog.BlogsModule.display(N.entry);},onComplete:function(){MF.Forms.enableSubmit(K);}});}else{MF.Forms.disableSubmit(K);MF.Blog.Service.updateEntry(J,M.title,M.message,M.privacy,null,F,{onSuccess:function(N){if(K.markClean){K.markClean();}window.location.href=N.url;},onComplete:function(){MF.Forms.enableSubmit(K);}});}};};this.close=function(){MF.Publisher.Module.reset.call(this);return false;};this.getUploaderData=function(){var J=MF.Publisher.SingleFileUploader.buildData(["asf","avi","flv","mp4","mpg","mpeg","mov","rm","wmv"],MF.user.authID,(this.data&&this.data.formUrl)?this.data.formUrl:MF.Publisher.iframeUploadUrlFmt,(this.data&&this.data.transforms)?this.data.transforms:MF.Publisher.thumbTransforms,(this.data&&this.data.domain)?this.data.domain:MF.Publisher.uploadDomain,G,I,D,B);J.clearInput=true;return J;};this.getSharedData=function(){var J=$("#video-publisher")[0];return MF.Forms.getFormData(J);};this.getSubmitText=function(){if(this.data&&this.data.id){return"Save";}else{return"Post video";}};}).call(MF.Blog.VideoPublisher);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.PostSuccess=JsonML.BST(["div",{"class":"uploader js-PostSuccess"}," ",["div",{"class":"uploading-progress-bg"}," ",["iframe",{"class":"ie-layer-shield","jbst:visible":function(){return JsonFx.userAgent.ie<7;}}]," "]," ",["div",{"class":"uploading-progress"}," ",["div",{"class":"uploading-success"}," ",["h4","Upload Success!"]," ",["p","What next?"]," ",["div",{"class":"upload-options options-share options-copy"}," ",["p",{"class":"upload-share"}," ",["a",{href:"#share",onclick:function(){return this.showShareDialog(this.data.id);}},"Share with people",["br"],"not on myfamily.com"]," "]," ",["p",{"class":"upload-copy"}," ",["a",{href:"#copy",onclick:function(){return this.showCopyToDialog(this.data.id);}},"Copy to another",["br"],"family group"]," "]," "]," ",["a",{href:"#close","class":"negative",onclick:function(){return MF.Blog.PostSuccess.close;}},"Close"]," "]," "]," "]);(function(){this.refresh=function(A){$(".js-PostSuccess").replaceWith(MF.Blog.PostSuccess.bind(A||{}));};this.close=function(){return false;};this.showShareDialog=function(A){return function(){MF.Share.ShareDialog.showDlg(A);return false;};};this.showCopyToDialog=function(A){return function(){MF.ContentCopy.SitePickerDialog.show(A,MF.ContentCopy.SitePickerDialog.CopyTypes.blog);return false;};};}).call(MF.Blog.PostSuccess);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.RotatePhoto=JsonML.BST([""," ",["ul",{"class":"item-actions"}," ",["li",{"class":"action-rotate","jbst:visible":function(){return MF.ContentCopy.Rotate.canRotate(this.data);}}," ",["a",{href:"#rotate-left","class":"action-link item-rotate-left",onclick:function(){return MF.ContentCopy.Rotate.rotate(this.data.rotateUrl,-1);}},"Rotate left"]," ",["a",{href:"#rotate-right","class":"action-link item-rotate-right",onclick:function(){return MF.ContentCopy.Rotate.rotate(this.data.rotateUrl,+1);}},"Rotate right"]," ",["a",{href:"#save-rotate","class":"positive item-rotate-save js-SaveRotate",onclick:function(){return MF.ContentCopy.Rotate.saveRotate(this.data.saveUrl,this.data.id,this.data.orient);},style:"display:none"},["span","Save rotate"]]," "]," "]," ",function(){return JsonML.BST(MF.ContentCopy.Rotate).dataBind(this.data,this.index,this.count);}]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.ContentCopy){MF.ContentCopy={};}MF.ContentCopy.Rotate=JsonML.BST(["div",{"jbst:visible":function(){return this.canRotate(this.data);},style:"display:none"}," ",["iframe",{id:"CreateImageFrame",name:"CreateImageFrame"}]," ",["form",{method:"post",action:function(){return this.data.saveUrl;},target:"CreateImageFrame","class":"js-CreateImageForm"}," ",["input",{type:"hidden",name:"Transforms",value:function(){return this.data.transforms;},defaultValue:function(){return this.data.transforms;}}]," "]," "]);(function(){var I,B,D,H,J=false;var E=[0,0,0,2,2,1,1,3,3];var C=[1,6,3,8];function G(K,L){H=D=null;MF.Message.showInfo(null,"Rotation successfully saved.",MF.Message.Scope.Column,10000);$(".js-SaveRotate").hide();}function F(K,L,M){MF.Message.showError(null,"Rotation failed. Please try again.",MF.Message.Scope.Column);}function A(){J=false;MF.Loading.hide();}this.canRotate=function(K){if(!K.rotateUrl){return false;}switch(K.type){case"Image":return true;default:return false;}};this.rotate=function(L,K){return function(){if(J){return false;}var M=($("img.js-ImagePreview").length>0)?$("img.js-ImagePreview"):$("img.item-main");if(!M.length){return false;}MF.Message.clear(null,MF.Message.Scope.Column);if(!H){H=M.attr("src");D=B;}B=(C.length+B+K)%C.length;if(B!==D){MF.Loading.show(50);M[0].onload=function(){MF.Loading.hide();this.onload=null;};M.attr("src",String.format(L,C[B]||0)).removeAttr("height").removeAttr("width");}else{M.attr("src",H).removeAttr("height").removeAttr("width");}$(".js-SaveRotate").toggle(B!==D);return false;};};this.jsonp=function(K){var N=K&&K.result;if(!N||(!N.remasteredID&&!N.originalID)){F(K,null,K&&K.error);return;}var L=N.remasteredAuth||N.originalAuth||null;var M=N.remasteredID||N.originalID||null;if(I&&I>0){MF.Media.Service.saveRotate(I,C[B]||0,M,L,{onSuccess:G,onFailure:F,onComplete:A});}else{if(MF.Blog&&MF.Blog.PhotoPublisher){MF.Blog.PhotoPublisher.setAuthGuid(L);MF.Blog.PhotoPublisher.setDisplayGuid(M);MF.Blog.PhotoPublisher.setOrientation(C[B]||0);G({},{});A();}}};this.saveRotate=function(K,N,L){B=E[L]||0;I=N;var M=K;return function(){if(J){return false;}J=true;MF.Message.clear(null,MF.Message.Scope.Column);MF.Loading.show(100);var O=$("iframe#CreateImageFrame")[0];if(O&&O.contentWindow){O.contentWindow.name=O.name;}var P=$("form.js-CreateImageForm");P.attr("action",String.format(M,C[B]||0));P[0].submit();return false;};};}).call(MF.ContentCopy.Rotate);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.Service=new JsonFx.IO.Service("/Features/BlogSites/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.Blog){MF.Blog={};}MF.Blog.ActiveFollowingList=JsonML.BST([""," ",["div",{"class":"section-title","jbst:visible":function(){return this.data.total>0;}}," ",["h3","Blogs ",function(){return this.data.firstName;}," follows (",function(){return this.data.total;},")"]," "]," ",["div",{"class":"contacts small suggest"}," ",function(){return JsonML.BST([""," ",["p"," ",["a",{href:function(){return this.data.url;}},["img",{src:function(){return this.data.avatar;},width:"48",height:"48"}]]," ",["span",{"class":"contain"}," ",["span",{"class":"meta"},["a",{href:function(){return this.data.url;}},function(){return this.data.name;}]]," ",["span",{"class":"extra"},function(){return this.data.followers;}," Followers \u2022 ",function(){return this.data.lastPost.getFullYear()<1997?"Not yet posted":"Last active "+this.data.lastPost.toRelative(MF.ShortDateFormat);}]," "]," "]," "]).dataBind(this.data.items,this.index,this.count);}," ",["p",{"class":"extra","jbst:visible":function(){return this.data.count<this.data.total;}}," ",["a",{href:function(){return this.data.followsUrl;}},"View all \u00BB"]," "]," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.BloggerBadge=JsonML.BST(["div",{"jbst:visible":function(){return this.showBadge();}}," ",["div",{"class":"section-title first"}," ",["h3","Blog details"]," "]," ",["div",{"class":"blog-info"}," ",["p",{"class":"feed"},["a",{href:function(){return this.data.feedUrl;}},["img",{src:"../Images/feed.png"}]]]," ",["p",["strong",function(){return this.data.following;}]," Following"]," ",["p",["strong",function(){return this.data.followers;}]," Followers"]," ",["p",["strong",function(){return this.data.posts;}]," Posts"]," ",["p",{"jbst:visible":function(){return this.data.about.length>0;}},["strong","Bio"]," ",function(){return JsonML.raw(this.data.about);}]," "],""," "]);(function(){this.showBadge=function(){return this.data.followers>0||this.data.following>0||this.data.posts>0||this.data.about.length>0;};}).call(MF.Blog.BloggerBadge);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.BlogItem=JsonML.BST(["div",{"class":function(){return"discussion js-entry"+this.data.id;}}," ",["h3",function(){return this.data.title;}]," ",function(){return JsonML.BST(this.switchType).dataBind(this.data.content,this.index,this.count);}," ",["div",{"class":"discussion-content"}," ",function(){return JsonML.raw(this.data.body);}," "]," ",["p",{"class":"meta"},"Created ",function(){return this.data.date.toRelative(MF.ShortDateFormat);}," by ",["a",{href:function(){return this.data.authorUrl;}},["strong",function(){return this.data.authorName;}]]," ",["span",{"jbst:visible":function(){return !this.isSingle;}},"\u2022 ",["a",{href:function(){return this.data.url+"#comments";}},function(){return this.data.comments;}," Comment",function(){return this.data.comments===1?"":"s";}]]," ",["span","\u2022 ",["strong",{id:function(){return("js-favecnt-"+this.data.id);},style:"font-weight:normal"},function(){return this.data.loves;}]," Loves"]," ",["a",{"jbst:visible":function(){return MF.user.id>1;},href:"#love",onclick:function(){return this.markFavorite(this.data.id,this.data.authorId,this.data.isFave);},"class":function(){return"fave"+(this.data.isFave?" faved":"");}},["span",{"class":"js-fav"},function(){return this.getFavoriteText(this.data.isFave);}]]," ",["span",{"jbst:visible":function(){return this.data.canEdit;}},"\u2022 ",["a",{href:function(){return this.data.editUrl;}},"Edit"]," or ",["a",{onclick:function(){return this.confirmDeleteEntry(this.data.id);},href:"#delete"},"delete"]]," ",["span",{"jbst:visible":function(){return this.data.privacy!=="Public";}},"\u2022 ",function(){return this.data.privacy;}]]," ",["p",{"class":"tags","jbst:visible":function(){return this.data.tags&&this.data.tags.length>0;}}," ",function(){return JsonML.BST([""," ",["span",["a",{href:function(){return MF.Tags.TagCloudItem.getSearchUrl(this.data);}},function(){return this.data;}]]," "]).dataBind(this.data.tags,this.index,this.count);}," "]," "]);(function(){function A(C,B,D){MF.Blog.Service.deleteEntry(C,{onSuccess:function(){$("div.js-entry"+C).hide("fast",function(){$(this).remove();});if(D){D();}}});}this.updateFaveCount=function(D,C){var F="#js-favecnt-"+D;var B=$(F);var E=Number(B.text());if(!isNaN(E)){if(C){E+=1;}else{E-=1;}B.text(E);}B=$("#js-totalfaves");if(B.length>0){var E=Number(B.text());if(!isNaN(E)){if(C){E+=1;}else{E-=1;}B.text(E);}}};this.switchType=function(){if(!this.data){return null;}switch(this.data.type){case"Video":return MF.Media.MediaDetail.Video;case"Image":return MF.Media.MediaDetail.Image;default:return null;}};this.confirmDeleteEntry=function(B){return function(){MF.Dialogs.ConfirmDeleteDialog.showDlg(B,this,"Are you sure you want to delete this post? This cannot be undone!",A,"Ok","cancel","Delete blog post");return false;};};this.markFavorite=function(C,D,B){return function(){var E=$(this);MF.Favorite.Service.markBlogFavorite(C,D,!B,{onSuccess:function(F){B=F.isFavorite;E.toggleClass("faved");$(E).children("span.js-fav").html(MF.Blog.StreamItem.getFavoriteText(B));$(".js-favoritesList").replaceWith(MF.Favorite.FavoriteList.bind(F.favoritesList));MF.Blog.BlogItem.updateFaveCount(C,B);}});return false;};};this.getFavoriteText=function(B){if(B){return"You love this";}else{return"Love this";}};}).call(MF.Blog.BlogItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.BlogsModule=JsonML.BST(["div",{"class":"js-BlogsModule"}," ",["div",{"class":"js-discussionList"}," ",function(){return JsonML.BST(MF.Blog.BlogItem).dataBind(this.data.items,this.index,this.count);}," "]," ",["div",{"class":function(){return"blog-empty"+(this.data.canAdd?"":" nopermission");},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"There are no entries to display"]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,this.getEntries),this.index,this.count);}," "]);(function(){this.getEntries=function(B,A){var C="";if(B>0){C="?start="+B;}window.location.href=window.location.pathname+C;};this.display=function(A){$("div.blog-empty").hide();A=$(MF.Blog.BlogItem.bind(A)).unwrapFragment();A.hide().prependTo("div.js-discussionList").show("slow");};}).call(MF.Blog.BlogsModule);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.BlogTitle=JsonML.BST([""," ",["a",{href:function(){return this.data.edit;},"jbst:visible":function(){return this.data.edit.length>0;}},["img",{src:function(){return this.data.avatarUrl;},"class":"pic"}]]," ",["img",{src:function(){return this.data.avatarUrl;},"class":"pic","jbst:visible":function(){return this.data.edit.length===0;}}]," ",["div",{"class":"blog-title-follow"}," ",["h1",{"class":"title"},function(){return this.data.title;}]," ",function(){return JsonML.BST(MF.Blog.FollowButton).dataBind(MF.Blog.FollowButton.buildData(this.data.userId,this.data.follows,this.data.signUpUrl,this.data.requestId,this.data.autoApprove),this.index,this.count);}," "]," ",function(){return JsonML.BST(this.switchStatus).dataBind(this.data.status,this.index,this.count);}]);(function(){this.editStatus=function(A,B){MF.Profile.StatusService.getStatus({onSuccess:function(C){jQuery(A).parents("p.status").replaceWith(MF.Profile.ProfileStatusEdit.bind(C));$(document).bind("click",MF.Profile.ProfileStatusEdit.setBlurCancel);}});};this.switchStatus=function(){if(this.data.status||!this.data.currentUser){return MF.Profile.ProfileStatusView;}return MF.Profile.ProfileStatusEdit;};}).call(MF.Blog.BlogTitle);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.CreateBlog=JsonML.BST(["p",{"class":"submit"},["a",{"class":"positive",onclick:function(){return this.createBlog;},href:"#"},"Start your blog now"]]);(function(){this.createBlog=function(){MF.Blog.Service.createBlog({onSuccess:function(A){window.location.reload();}});return false;};}).call(MF.Blog.CreateBlog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.EditEntry=JsonML.BST(["div",{"class":"addnew editentry"}," ",function(){return JsonML.BST(this.getPublisher()).dataBind(this.data,this.index,this.count);}," "]);(function(){this.getPublisher=function(){switch(this.data.type){case"Image":return MF.Blog.PhotoPublisher;case"Video":return MF.Blog.VideoPublisher;default:return MF.Blog.TextPublisher;}};}).call(MF.Blog.EditEntry);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.FollowersList=JsonML.BST(["div",{"class":"members js-followerslist"}," ",function(){return JsonML.BST(MF.Toolbars.FilterBar).dataBind(this.getSortBarData(this.data),this.index,this.count);}," ",["table",{cellpadding:"0",cellspacing:"0","class":"memberslist"}," ",function(){return JsonML.BST([""," ",["tr",{"class":function(){return("js-follower"+this.data.id);}}," ",["td",{"class":"mlperson"}," ",["div",{"class":"contacts large item-meta"}," ",["p",["a",{href:function(){return this.data.url;},title:""},["img",{src:function(){return this.data.avatar;},alt:""}]]," ",["span",{"class":"contain"}," ",["span",{"class":"name"},["a",{href:function(){return this.data.url;},title:""},function(){return this.data.name;}]," ",["a",{onclick:function(){return MF.Blog.FollowersList.promptRemove(this.data.id);},"class":"negative",title:"Remove follower",href:"#remove","jbst:visible":function(){return this.data.canDelete;}},"Remove follower"]]," ",["div",{"jbst:visible":function(){return this.data.hasBlog;}}," ",["span",{"class":"meta","jbst:visible":function(){return this.data.lastPost.getFullYear()>1997;}},["em","Last active ",function(){return this.data.lastPost.toRelative(MF.ShortDateFormat);}]]," ",["span",{"class":"meta"},function(){return this.data.following;}," ",["em","Following"]," \u2022 ",function(){return this.data.followers;}," ",["em","Follower",function(){return this.data.followers===1?"":"s";}]," "]," ",function(){return JsonML.BST(MF.Blog.FollowButton).dataBind(MF.Blog.FollowersList.followBtnData(this.data),this.index,this.count);}," "]," "]," "]," "]," ",""," "]," ",["td",{"class":"mladdress"}," ",["p",{"jbst:visible":function(){return this.data.about.length>0;}},"Bio:"],["div",{"class":"aboutme"}," ",function(){return this.data.about;}," "]," "]," "]," "]).dataBind(this.data.items,this.index,this.count);}," "]," ",["div",{"class":function(){return"blog-empty blog-followers"+(this.data.canAdd?"":" nopermission");},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"There's no one following your blog yet!"]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,this.getPage),this.index,this.count);}," "]);(function(){function C(F,G,H){MF.Blog.Service.removeFollower(F,{onSuccess:function(){$("tr.js-follower"+F).hide("fast",function(){$(this).remove();});if(H){H();}}});}this.getPage=function(G,F){var H="";if(G!==0){H+="?start="+G;}window.location.href=window.location.pathname+H;};this.followBtnData=function(F){return MF.Blog.FollowButton.buildData(F.id,F.isFollowing,MF.Blog.FollowersList.data.signUpUrl,F.requestId,F.autoApprove);};this.promptRemove=function(F){return function(){MF.Dialogs.ConfirmDeleteDialog.showDlg(F,this,"Are you sure you want to remove this person from your followers?",C,"Ok","cancel","Remove follower");return false;};};function E(I,F,H){if(H.selectedIdx===F){I.asc=!I.asc;}var G=MF.getQueryParam("start",true,0);MF.Blog.Service.getFollowersList(G,A,F,I.asc,{onSuccess:function(J){$("div.js-followerslist").replaceWith(MF.Blog.FollowersList.bind(J));}});return true;}var B=new MF.Toolbars.FilterBarMenu.Menu("Sort",[{label:"Alphabetically",asc:true},{label:"Last active",asc:false},{label:"# Following",asc:false},{label:"# Followers",asc:false}],E);var D=false;var A;this.getSortBarData=function(F){if(!D){B.setSelection(F.sortData.colIdx).asc=F.sortData.asc;A=F.count;D=true;}return{items:[B]};};}).call(MF.Blog.FollowersList);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.PendingList=JsonML.BST(["div",{"class":"members js-pendinglist","jbst:visible":function(){return this.data.items.length>0;}}," ",["div",{"class":"section-title"}," ",["h3","Pending requests to follow your blog"]," ",["p",{"class":"section-title-extra pending"}," ",["a",{"class":"approve",href:"#approveAll",onclick:function(){return this.approve();}},"Approve all"]," or ",["a",{"class":"deny",href:"#denyAll",onclick:function(){return this.deny();}},"Deny all"]," "]," "]," ",["div",{"class":"contacts large siteslist"}," ",function(){return JsonML.BST([""," ",["div",{"class":function(){return MF.Blog.PendingList.containerClass(this.index);}}," ",["input",{type:"hidden",value:function(){return this.data.requestId;},name:function(){return"Requests$"+this.index;}}]," ",["a",{href:function(){return this.data.url;}}," ",["img",{src:function(){return this.data.avatar;}}]," "]," ",["p"," ",["span",{"class":"name"}," ",["a",{href:function(){return this.data.url;}},function(){return this.data.name;}]," "]," ",["span",{"class":"extra"}," ",["a",{"class":"approve",href:"#approve",onclick:function(){return MF.Blog.PendingList.approve(this.data.requestId);}},"Approve"]," or ",["a",{"class":"deny",href:"#deny",onclick:function(){return MF.Blog.PendingList.deny(this.data.requestId);}},"Deny"]," "]," "]," "]," "]).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.getMore),this.index,this.count);}," ",["div",{"class":"section-title"}," ",["h3","People following your blog"]," "]," "]);(function(){this.containerClass=function(A){if(A%2){return"js-Item sitegroup";}else{return"js-Item sitegroup first";}};this.approve=function(A){return function(){var B=$(this).parents(".js-pendinglist");var C=[];if(A){C[0]=A;}else{var D=MF.Forms.getFormData(B);C=D.Requests;}MF.Blog.Service.approve(C,{onSuccess:function(E){MF.Message.showInfo($("div.column1"),"Members successfully updated!",MF.Message.Scope.Column,5000);B.replaceWith(MF.Blog.PendingList.bind(E.pending));$(".js-followerslist").replaceWith(MF.Blog.FollowersList.bind(E.following));}});return false;};};this.deny=function(A){return function(){var B=$(".js-pendinglist");var C=[];if(A){C[0]=A;}else{var D=MF.Forms.getFormData(B);C=D.Requests;}MF.Blog.Service.deny(C,{onSuccess:function(E){MF.Message.showInfo($("div.column1"),"Members successfully updated!",MF.Message.Scope.Column,5000);B.replaceWith(MF.Blog.PendingList.bind(E.pending));}});return false;};};this.getMore=function(B,A){MF.Blog.Service.getPendingList(B,A,{onSuccess:function(C){$(".js-pendinglist").replaceWith(MF.Blog.PendingList.bind(C));}});};}).call(MF.Blog.PendingList);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.FollowsList=JsonML.BST(["div",{"class":"members js-followslist"}," ",function(){return JsonML.BST(MF.Toolbars.FilterBar).dataBind(this.getSortBarData(this.data),this.index,this.count);}," ",["table",{cellpadding:"0",cellspacing:"0","class":"memberslist"}," ",function(){return JsonML.BST([""," ",["tr",{"class":function(){return("js-follower"+this.data.id);}}," ",["td",{"class":"mlperson"}," ",["div",{"class":"contacts large item-meta"}," ",["p",["a",{href:function(){return this.data.url;},title:""},["img",{src:function(){return this.data.avatar;},alt:""}]]," ",["span",{"class":"contain"}," ",["span",{"class":"name"},["a",{href:function(){return this.data.url;},title:""},function(){return this.data.name;}]]," ",["span",{"class":"meta","jbst:visible":function(){return this.data.lastPost.getFullYear()>1997;}},["em","Last active ",function(){return this.data.lastPost.toRelative(MF.ShortDateFormat);}]]," ",["span",{"class":"meta"},function(){return this.data.following;}," ",["em","Following"]," \u2022 ",function(){return this.data.followers;}," ",["em","Follower",function(){return this.data.followers===1?"":"s";}]," "]," ",function(){return JsonML.BST(MF.Blog.FollowButton).dataBind(MF.Blog.FollowsList.followBtnData(this.data),this.index,this.count);}," "]," "]," "]," ",""," "]," ",["td",{"class":"mladdress"}," ",["p",{"jbst:visible":function(){return this.data.about.length>0;}},"Bio:"],["div",{"class":"aboutme"}," ",function(){return this.data.about;}," "]," "]," "]," "]).dataBind(this.data.items,this.index,this.count);}," "]," ",["div",{"class":function(){return"blog-empty blog-following"+(this.data.canAdd?"":" nopermission");},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"You're not following any blogs yet!"]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,this.getPage),this.index,this.count);}," "]);(function(){this.getPage=function(G,F){var H="";if(G!==0){H+="?start="+G;}window.location.href=window.location.pathname+H;};function D(I,F,H){if(H.selectedIdx===F){I.asc=!I.asc;}var G=MF.getQueryParam("start",true,0);MF.Blog.Service.getFollowingList(G,A,F,I.asc,{onSuccess:function(J){$("div.js-followslist").replaceWith(MF.Blog.FollowsList.bind(J));}});return true;}var B=new MF.Toolbars.FilterBarMenu.Menu("Sort",[{label:"Alphabetically",asc:true},{label:"Date followed",asc:false},{label:"Last active",asc:false},{label:"# Followers",asc:false}],D);var C=false;var A;this.getSortBarData=function(F){if(F.total<=1){return{};}if(!C){B.setSelection(F.sortData.colIdx).asc=F.sortData.asc;A=F.count;C=true;}return{items:[B]};};function E(F){return function G(H,I){if(MF.user.id===F&&!I){$("tr.js-follower"+H).hide("slow",function(){$(this).remove();});return true;}return false;};}this.followBtnData=function(F){return MF.Blog.FollowButton.buildData(F.id,F.isFollowing,MF.Blog.FollowsList.data.signUpUrl,F.requestId,F.autoApprove,E(MF.Blog.FollowsList.data.bloggerId));};}).call(MF.Blog.FollowsList);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.FollowButton=JsonML.BST(["div",{"class":"js-FollowButton","jbst:visible":function(){return this.data.userId!==MF.user.id;}}," ",["p",{"class":function(){return"blog-follow "+this.followCss(this.data.userId);},"jbst:visible":function(){return !(this.data.follows||this.data.requestId>0);}},["a",{onclick:function(){return this.follow(this.data);},href:function(){return this.data.signUpUrl+"?url="+encodeURIComponent(window.location.pathname);},"class":"positive"},function(){return this.data.autoApprove?"Follow this blog":"Request to follow this blog";}]," "]," ",["p",{"class":function(){return"blog-unfollow "+this.unfollowCss(this.data.userId);},"jbst:visible":function(){return(this.data.follows||this.data.requestId>0);}},["a",{onclick:function(){return this.unfollow(this.data);},href:"#stop","jbst:visible":"false","class":"positive unfollow"}," ",["span",{"class":"follow-stop"},function(){return this.data.follows?"Stop following":"Cancel request to follow";}]," ",["span",{"class":"follow-current"},function(){return this.data.follows?"You follow":"You've requested to follow";}]," ",["span","this blog"]," "]," "]," "]);(function(){this.buildData=function(C,B,A,E,D,F){return{autoApprove:D,callback:F,follows:B,requestId:E,signUpUrl:A,userId:C};};this.follow=function(A){return function(){if(MF.user.id>1){var B=$(this).parents(".js-FollowButton");MF.Forms.disableSubmit(B);MF.Blog.Service.followBlog(A.userId,A.requestId,{onSuccess:function(C){if(!A.callback||!A.callback(A.userId,true)){MF.Blog.FollowButton.updateButton(A,C,B);}},onComplete:function(){MF.Forms.enableSubmit(B);}});return false;}};};this.unfollow=function(A){return function(){if(MF.user.id>1){var B=$(this).parents(".js-FollowButton");MF.Forms.disableSubmit(B);MF.Blog.Service.unfollowBlog(A.userId,A.requestId,{onSuccess:function(C){if(!A.callback||!A.callback(A.userId,false)){MF.Blog.FollowButton.updateButton(A,C,B);}},onComplete:function(){MF.Forms.enableSubmit(B);}});return false;}};};this.updateButton=function(C,A,B){C.requestId=(C.requestId!==A.requestId)?A.requestId:C.requestId;C.follows=(C.follows!==A.follows)?A.follows:C.follows;B.replaceWith(MF.Blog.FollowButton.bind(MF.Blog.FollowButton.buildData(C.userId,C.follows,C.signUpUrl,C.requestId,C.autoApprove,C.callback)));};this.followCss=function(A){return"js-follow"+A;};this.unfollowCss=function(A){return"js-unfollow"+A;};}).call(MF.Blog.FollowButton);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.Stream=JsonML.BST([""," ",function(){MF.Media.MediaDetail.Video.playerWidth=550;}," ",["div",{"class":"js-BlogsModule"}," ",function(){return JsonML.BST(MF.Toolbars.FilterBar).dataBind(this.getSortBarData(this.data),this.index,this.count);}," ",["div",{"class":"js-blogStream"}," ",function(){return JsonML.BST(MF.Blog.StreamItem).dataBind(this.data.items,this.index,this.count);}," "]," ",["div",{"class":function(){return"blog-empty "+(this.data.favsOnly?"blog-loves":"blog-activity")+(this.data.canAdd?"":" nopermission");},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"There is no recent activity to display"]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,this.getEntries),this.index,this.count);}," "]," "]);(function(){function D(H){var I="";if(H!==0){I="?start="+H;}var J=E.getSelectedAsString();if(J.length>0){if(I.length===0){I+="?";}else{I+="&";}I+="u="+J;}return I;}function G(){MF.Blog.Stream.getEntries(0);}function F(K,H,J){if(J.selectedIdx===H){K.asc=!K.asc;}var I=MF.getQueryParam("start",true,0);MF.Blog.Service.getBlogStream(I,A,true,H,K.asc,E.getSelectedUsers(),{onSuccess:function(L){L=MF.Blog.Stream.bind(L);$("div.js-BlogsModule").replaceWith(L);document.body.scrollIntoView(true);}});return true;}var A;var E=new MF.Toolbars.FilterBarPeopleMenu.Menu(G);var B=new MF.Toolbars.FilterBarMenu.Menu("Sort",[{label:"Recent activity",asc:false},{label:"# of comments",asc:false},{label:"# of loves",asc:false}],F);this.getEntries=function(H){window.location.href=window.location.pathname+D(H);};var C=false;this.getSortBarData=function(H){if(!C){A=H.count;E.label.all="All following";E.label.selected="Selected blogs";E.label.youVisible=false;E.showPickerFunction=MF.People.SelectMembersDialog.showForBlog;C=true;}if(H.favsOnly){return{items:[E,B]};}else{return{items:[E]};}};}).call(MF.Blog.Stream);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.StreamItem=JsonML.BST([""," ",["div",{"class":function(){return"post "+this.getPostTypeCss();}}," ",["div",{"class":"type"}]," ",["div",{"class":"meta"}," ",["a",{title:function(){return this.data.authorName;},href:function(){return this.data.blogUrl;}},["img",{src:function(){return this.data.avatar;}}]]," ",["p",function(){return this.data.date.toRelative(MF.ShortDateFormat);}]," ",["p",["a",{href:function(){return this.data.url+"#comments";}},["strong",function(){return this.data.comments;}]," Comments"]]," ",["p",["a",{href:function(){return this.data.url;}},["strong",{id:function(){return("js-favecnt-"+this.data.id);}},function(){return this.data.loves;}]," Loves"]]," ",["p",{"class":"private","jbst:visible":function(){return this.data.privacy==="Private";}},"Private"]," "]," ",["div",{"class":"discussion"}," ",["h3",{"jbst:visible":function(){return this.data.title;}},function(){return this.data.title;}]," ",["div",{"class":"post-content"}," ",function(){return JsonML.BST(this.switchType).dataBind(this.data.content,this.index,this.count);}," ",["div",{"class":"discussion-content"},function(){return JsonML.raw(this.data.body);}]," ",["div",{"class":"post-actions"},["a",{href:"#love",onclick:function(){return this.markFavorite(this.data.id,this.data.authorId,this.data.isFave);},"class":function(){return"fave"+(this.data.isFave?" faved":"");}},["span",{"class":"js-fav"},function(){return this.getFavoriteText(this.data.isFave);}]],["a",{href:function(){return this.data.url+"#comments";},"class":"comment"},["span","Leave a comment"]]]," "],""," "],""," "],""," "]);(function(){this.markFavorite=function(B,C,A){return function(){var D=$(this);MF.Favorite.Service.markBlogFavorite(B,C,!A,{onSuccess:function(E){A=E.isFavorite;D.toggleClass("faved");$(D).children("span.js-fav").html(MF.Blog.StreamItem.getFavoriteText(A));MF.Blog.BlogItem.updateFaveCount(B,A);}});return false;};};this.switchType=function(){if(!this.data){return null;}switch(this.data.type){case"Video":return MF.Media.MediaDetail.Video;case"Image":return MF.Media.MediaDetail.Image;default:return null;}};this.getFavoriteText=function(A){if(A){return"You love this";}else{return"Love this";}};this.getPostTypeCss=function(){if(this.data.content){if(this.data.content.type==="Image"){return"photo";}else{return"video";}}else{return"text";}};}).call(MF.Blog.StreamItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.SuggestBlogs=JsonML.BST([""," ",["div",{"class":"section-title","jbst:visible":function(){return this.data.total>0;}}," ",["h3","Other blogs you should follow"]," "]," ",["div",{"class":"contacts small suggest"}," ",function(){return JsonML.BST([""," ",["p"," ",["a",{href:function(){return this.data.url;}},["img",{src:function(){return this.data.avatar;},width:"48",height:"48"}]]," ",["span",{"class":"contain"}," ",["span",{"class":"meta"},["a",{href:function(){return this.data.url;}},function(){return this.data.name;}]]," ",["span",{"class":"extra"},function(){return this.data.followers;}," Followers \u2022 ",function(){return this.data.lastPost.getFullYear()<1997?"Not yet posted":"Last active "+this.data.lastPost.toRelative(MF.ShortDateFormat);}]," ",function(){return JsonML.BST(MF.Blog.FollowButton).dataBind(MF.Blog.SuggestBlogs.followBtnData(this.data),this.index,this.count);}," "]," "]," "]).dataBind(this.data.items,this.index,this.count);}," "]," "]);(function(){this.followBtnData=function(A){return MF.Blog.FollowButton.buildData(A.id,A.isFollowing,MF.Blog.SuggestBlogs.data.signUpUrl,A.requestId,A.autoApprove);};}).call(MF.Blog.SuggestBlogs);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Blog){MF.Blog={};}MF.Blog.BlogEntryResults=JsonML.BST([""," ",function(){MF.Search.SearchPanel.addResults(this.data.total);}," ",["div",{"class":"js-BlogsModule","jbst:visible":function(){return this.data.total>0;}}," ",["div",{"class":"js-discussionList"}," ",function(){return JsonML.BST(MF.Blog.BlogItem).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,MF.Search.SearchPanel.pageResults(this.moreUrl)),this.index,this.count);}," "]," "]);}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={};}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.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){}