try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Publisher){MF.Publisher={};}MF.Publisher.SingleFileUploader=JsonML.BST([""," ",function(){this.setUploaderData(this.data);if(this.data.documentDomain){document.domain=this.data.documentDomain;}}," ",["iframe",{id:"AsyncUploadFrame",name:"AsyncUploadFrame",style:"display:none"}]," ",["form",{method:"post",enctype:"multipart/form-data",encoding:"multipart/form-data",target:"AsyncUploadFrame",action:function(){return this.data.postUrl;},"class":"js-AsyncUploadForm"}," ",["fieldset",{"class":"upload"}," ",["p",["label","Choose"]," ",["input",{type:"file",name:"FileUpload",value:function(){return JsonFx.Lang.get("Global,ChooseFile");},onchange:function(){return this.fileChanged;}}]]," "]," ",["input",{type:"hidden",name:"Transforms",value:function(){return this.data.transforms;},defaultValue:function(){return this.data.transforms;}}]," ",["input",{type:"hidden",name:"AuthID",value:function(){return this.data.authID;},defaultValue:function(){return this.data.authID;}}]," "]," "]);(function(){var E=new MF.PollQueue(C,null),A=null;function D(H){var K;try{K=H.split(".").pop().toLowerCase();}catch(J){try{K=H.toLowerCase();}catch(J){}}for(var I=0;I<A.fileTypes.length;I++){if(A.fileTypes[I]===K){return true;}}return false;}function G(){MF.Message.clear($(A.errorElem),MF.Message.Scope.Column);}function B(H){if(A.onError){A.onError(H);}else{MF.Message.showError($(A.errorElem),H,MF.Message.Scope.Column);}}function C(I,H){if(MF.isDebug&&"undefined"!==typeof console&&console.log){console.log("Polling complete:\n"+JSON.stringify(H,null,"  "));}if(H.fileLength<=0){B("That video appears to be empty.");return;}if(A.onTransformFinished){A.onTransformFinished(H);}}function F(H){if(MF.isDebug&&"undefined"!==typeof console&&console.log){console.log("Upload result:\n"+JSON.stringify(H,null,"  "));}var I=H&&H.result;if(!I||(!I.originalID&&(!I.remasteredID||!I.previewID))){MF.Log.error("Upload error:\n"+JSON.stringify(H,null,"  ")+I.originalID+"; "+I.remasteredID+"; "+I.previewID);B("An error occurred while uploading (err#pq1).");return;}if(!E){MF.Log.error("pollQueue was not initialized in beginPolling():\n"+JSON.stringify(H,null,"  "));B("An error occurred while uploading (err#pq2).");return;}if(A.onTransformBegin){A.onTransformBegin(I);}E.enqueue({},I);}this.jsonp=function(H){F(H);if(A&&A.clearInput){var I=$("form.js-AsyncUploadForm");if(I.length){I[0].reset();I.find("input[type=hidden]").each(function(){if(!this.value){this.value=this.getAttribute("defaultValue");}});}}};this.fileChanged=function(){G();if(!this.value){return;}if(D(this.value)){var I=$("iframe#AsyncUploadFrame")[0];if(I&&I.contentWindow){I.contentWindow.name=I.name;}this.form.submit();if(A.onUploadBegin){A.onUploadBegin(this.value);}}else{var H="";for(var J=0;J<A.fileTypes.length;J++){if(H.length>0){H+=", ";}if(J===(A.fileTypes.length-1)){H+="and ";}H+=("."+A.fileTypes[J]);}B("Invalid file type. Supported file types are "+H);}};this.setUploaderData=function(H){A=H;};this.buildData=function(K,H,O,Q,P,J,L,N,M){var I=null;if("string"===typeof M){I=M;M=null;}return{authID:H,clearInput:true,documentDomain:P,errorElem:I,fileTypes:K,onUploadBegin:J,onTransformBegin:L,onTransformFinished:N,onError:M,postUrl:O.replace(/{jbst}/,"MF.Publisher.SingleFileUploader"),transforms:Q};};}).call(MF.Publisher.SingleFileUploader);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.StatusService=new JsonFx.IO.Service("/Features/ProfileSites/Profile/StatusService.jrpc");MF.Profile.StatusService.getStatus=function(opt){this.invoke("getStatus",null,opt);};MF.Profile.StatusService.saveStatus=function(Status,opt){this.invoke("saveStatus",[Status],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfileStatusEdit=JsonML.BST(["p",{"class":"status-edit js-status-edit"}," ",["input",{type:"text","jbst:onload":"this.focus();","class":"text js-status js-InlineInstruction",title:"What are you doing right now?",name:"status",maxlength:"140",onkeyup:"return MF.Profile.ProfileStatusEdit.keyDetect(this, event);",onclick:"return MF.clearEvent(event);",onfocus:"this.select()",value:function(){return this.data.status;}}]," ",["a",{"class":"positive js-updateStatus",onclick:"MF.Profile.ProfileStatusEdit.post(this);return MF.clearEvent(event);"},"Update status"]," "]);(function(){this.post=function(B){var D=jQuery(B).parents(".js-status-edit");$(document).unbind("click",MF.Profile.ProfileStatusEdit.setBlurCancel);MF.Forms.disableSubmit(D);var C=D.children(".js-status");var A=(C.is(".active"))?C.attr("value"):"";MF.Profile.StatusService.saveStatus(A,{onSuccess:function(E){if(E){var F=MF.Profile.ProfileTitle.switchStatus(E);jQuery(B).parents(".js-status-edit").replaceWith(F.bind(E));}},onFailure:function(E){$(document).bind("click",MF.Profile.ProfileStatusEdit.setBlurCancel);MF.Forms.enableSubmit(D);}});};this.keyDetect=function(C,A){A=A?A:window.event;var B=Number(A.keyCode||A.charCode);switch(B){case 27:MF.Profile.ProfileStatusEdit.cancel(C);return false;case 13:MF.Profile.ProfileStatusEdit.post(C);return false;default:return true;}};this.cancel=function(A){MF.Profile.StatusService.getStatus({onSuccess:function(B){var C=MF.Profile.ProfileTitle.switchStatus(B);jQuery(A).parents(".js-status-edit").replaceWith(C.bind(B));}});$(document).unbind("click",MF.Profile.ProfileStatusEdit.setBlurCancel);};this.setBlurCancel=function(A){if(A.which!==3){MF.Profile.ProfileStatusEdit.cancel($(".js-updateStatus"));}};}).call(MF.Profile.ProfileStatusEdit);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfileStatusView=JsonML.BST(["p",{"class":"status"}," ",["span",function(){return this.data.status;}]," ",["a",{"class":"edit toggle-target",href:"#","jbst:visible":function(){return !!this.data.currentUser;},onclick:"MF.Profile.ProfileTitle.editStatus(this);return false;"},function(){return JsonFx.Lang.get("Global,UpdateYourStatus");}]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.SitesService=new JsonFx.IO.Service("/Features/ProfileSites/Profile/SitesService.jrpc");MF.Profile.SitesService.acceptInvite=function(accept,opt){this.invoke("acceptInvite",[accept],opt);};MF.Profile.SitesService.switchInviteUser=function(opt){this.invoke("switchInviteUser",null,opt);};MF.Profile.SitesService.getInvitableSites=function(startIdx,count,opt){this.invoke("getInvitableSites",[startIdx,count],opt);};MF.Profile.SitesService.getSitesList=function(start,count,opt){this.invoke("getSitesList",[start,count],opt);};MF.Profile.SitesService.inviteToSites=function(siteIDs,opt){this.invoke("inviteToSites",[siteIDs],opt);};MF.Profile.SitesService.createSite=function(name,privacy,opt){this.invoke("createSite",[name,privacy],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.SitesList=JsonML.BST([""," ",function(){this.updatePaging(this.data);}," ",["div",{"class":"section-title notes","jbst:visible":function(){return this.data.sites.length>0||!!this.data.isOwner;}}," ",["h3",function(){return JsonFx.Lang.get("Global,Sites");}]," ",["p",{"class":"section-title-extra","jbst:visible":function(){return !!this.data.isOwner;}}," ",["a",{"class":"add",href:"#create-site",onclick:function(){return this.createSite;}},function(){return JsonFx.Lang.get("Global,CreateNewSite");}]," "]," "]," ",["div",{"class":"contacts large siteslist"}," ",function(){return JsonML.BST(MF.Profile.SitesItem).dataBind(this.data.sites,this.index,this.count);}," ",["div",{"jbst:visible":function(){return this.data.suggestSite;},"class":function(){return"js-AddGroups sitegroup addgroups"+(this.data.total===0?" nogroups":"");}}," ",["a",{onclick:function(){return this.hideSuggest;},href:"#close",title:"Close this","class":"negative"},"Close this"]," "]," ",["div",{"class":"js-MoreSitesLink pagination","jbst:visible":function(){return this.data.total>this.data.count;}}," ",["p",{"class":"lazy"}," ",["a",{onclick:"MF.Profile.SitesList.more(this);return false;",href:"#more"},function(){return JsonFx.Lang.get("Global,ShowMoreSites");}]," "]," "]," "]," "]);(function(){this.updatePaging=function(A){MF.Profile.SitesList.paging={start:A.start,count:A.count,total:A.total};return MF.Profile.SitesList.paging;};this.more=function(B){var C=MF.Profile.SitesList.paging;if(!C||C.count>=C.total||C.start+C.count>C.total){return;}var A=B.onclick;B.onclick=function(){return false;};MF.Profile.SitesService.getSitesList(C.start+C.count,C.count,{onSuccess:function(D){C=MF.Profile.SitesList.updatePaging(D);var E=$(MF.Profile.SitesItem.bind(D.sites)).unwrapFragment();if(E){$(B).firstParent(".js-MoreSitesLink").before(E.hide().fadeIn("fast"));}if(C.start+C.count>C.total){B.parentNode.style.display="none";}else{B.onclick=A;}}});};this.createSite=function(){var A=MF.Profile.CreateSiteDialog.bind();if(A){document.body.appendChild(A);}return false;};this.hideSuggest=function(){MF.Messaging.Service.dismissMessage(4,{onComplete:function(){$("div.js-AddGroups").hide("fast");}});return false;};}).call(MF.Profile.SitesList);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.SitesItem=JsonML.BST(["div",{"class":function(){return this.ContainerClass();}}," ",["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;}},["strong",function(){return this.data.name;}]]," ",["img",{src:"/Images/publicsite.gif","jbst:visible":function(){return this.data.isPublic&&!this.data.isExpired;}}]," ",["img",{src:"/Images/expiredsite.gif","jbst:visible":function(){return this.data.isExpired;}}]," "]," ",["span",{"class":"extra"},function(){return this.data.members;}," members"]," ",["span",{"class":"extra"},function(){return this.data.visited.getFullYear()<1997?"Not yet visited":"Last visited "+this.data.visited.toRelative(MF.ShortDateFormat);}]," "]," "]);(function(){this.ContainerClass=function(){if(this.index%2){return"sitegroup";}else{return"sitegroup first";}};}).call(MF.Profile.SitesItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.CreateSiteDialog=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind({height:230,width:500,modal:false,data:this.data},this.index,this.count,{$:[""," ",["fieldset",{"class":"settings creategroup"}," ",["label","Group name:"]," ",["span",{"class":"instruct"},"(This can be changed at anytime)"]," ",["form",{method:"post",id:"CreateSiteForm","class":"privacy js-EnableKeys"}," ",["input",{"class":"text name active",type:"text",name:"SiteName","jbst:onload":"this.focus();"}]," ",["p",{"class":"submit"}," ",["input",{type:"submit","class":"positive js-EnterKeyTarget",onclick:function(){return MF.Profile.CreateSiteDialog.submit;},value:"Create group"}]," or ",["a",{href:"#",onclick:function(){return MF.Dialog.remove;}},["strong","don't create"]]]," "]," "]," "]});});(function(){this.submit=function(){var A=this.form||this;var B=MF.Forms.getFormData(A);if(!B||!B.SiteName){MF.Message.showError(A,"Please fill in a group name.",MF.Message.Scope.Column);return false;}MF.Forms.disableSubmit(A);MF.Profile.SitesService.createSite(B.SiteName,"Protected",{onSuccess:function(C){MF.Tracking.createSite("Dialog");if(C){window.location.href=C;}},onComplete:function(){MF.Dialog.remove();MF.Forms.enableSubmit(A);}});return false;};}).call(MF.Profile.CreateSiteDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Notes){MF.Notes={};}MF.Notes.Service=new JsonFx.IO.Service("/Features/ProfileSites/Profile/NotesService.jrpc");MF.Notes.Service.postNote=function(message,opt){this.invoke("postNote",[message],opt);};MF.Notes.Service.deleteNote=function(noteID,opt){this.invoke("deleteNote",[noteID],opt);};MF.Notes.Service.getNotes=function(start,count,opt){this.invoke("getNotes",[start,count],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Notes){MF.Notes={};}MF.Notes.NotesList=JsonML.BST(["form",{method:"post",id:"ProfileNotesForm","class":"js-ProfileNotes js-UnsavedData",title:"You haven't posted your note. Are you sure you want to leave this page?"}," ",["div",{"class":"section-title notes"}," ",["h3",function(){return JsonFx.Lang.get("Global,Notes");}]," "]," ",["div",{"class":"notes"}," ",["textarea",{"class":"js-InlineInstruction js-expand",name:"message",title:function(){return JsonFx.Lang.get("Global,WriteNote");}}]," ",["p",{"class":"submit"}," ",["a",{"class":"positive",onclick:"MF.Notes.NotesList.post(this);return false;"},function(){return JsonFx.Lang.get("Global,PostNote");}]," "]," "]," ",["div",{"class":"notes js-NotesList"}," ",function(){return JsonML.BST(MF.Notes.NotesItem).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.Notes.NotesList.go),this.index,this.count);}," "]);(function(){this.go=function(B,A){MF.Notes.Service.getNotes(B,A,{onSuccess:function(C){C=MF.Notes.NotesList.bind(C);$("form.js-ProfileNotes").replaceWith(C);document.body.scrollIntoView(true);}});};this.post=function(A){var B=A.form;var C=MF.Forms.getFormData(B);if(C.message){MF.Forms.disableSubmit(B);MF.Notes.Service.postNote(C.message,{onSuccess:function(D){D=MF.Notes.NotesItem.bind(D);$(D).hide().prependTo("div.js-NotesList").show("slow");MF.Forms.reset(B);if(B.markClean){B.markClean();}},onComplete:function(){MF.Forms.enableSubmit(B);}});}};}).call(MF.Notes.NotesList);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Notes){MF.Notes={};}MF.Notes.NotesItem=JsonML.BST(["div",{"class":"comment-group"}," ",["a",{href:function(){return this.data.Url;}},["img",{src:function(){return this.data.Avatar;},alt:function(){return this.data.AuthorName;},height:"64",width:"64"}]]," ",["p",{"class":"comment-author"}," ",["a",{href:function(){return this.data.Url;}},function(){return this.data.AuthorName;}]," ",["span",{"class":"comment-meta"},function(){return this.data.Date.toRelative(MF.ShortDateFormat);}," ",["a",{href:function(){return"#"+this.data.NoteID;},onclick:function(){return MF.Notes.NotesItem.deleteClosure(this.data.NoteID);},"jbst:visible":function(){return this.data.NoteID>0;}},"Delete"]]," "]," ",["div",{"class":"comment-content"},function(){return JsonML.raw(this.data.CommentText);}]," "]);(function(){this.deleteNote=function(B,A,C){MF.Notes.Service.deleteNote(B,{onSuccess:function(D){$(A).parents(".comment-group").hide("slow",function(){$(this).remove();});C();}});};this.deleteClosure=function(A){return function(){var B=MF.Dialogs.ConfirmDeleteDialog.bind({id:A,elem:this,callback:MF.Notes.NotesItem.deleteNote});if(B){document.body.appendChild(B);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}return false;};};}).call(MF.Notes.NotesItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfileInfo=JsonML.BST([""," ",["div",{"class":"section-title information"}," ",["h3",function(){return JsonFx.Lang.get("Global,Information");}]," ",["p",{"class":"section-title-extra","jbst:visible":function(){return !!this.data.editUrl;}}," ",["a",{"class":"edit",href:function(){return this.data.editUrl;}},function(){return JsonFx.Lang.get("Global,EditThis");}]," "]," "]," ",function(){return JsonML.BST(MF.Profile.AboutMe).dataBind(this.data,this.index,this.count);}," ",["div",{"class":"module meta"}," ",["dl"," ",function(){return JsonML.BST(MF.Profile.ProfileInfoItem).dataBind(this.data.items,this.index,this.count);}," "]," "]]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfileInfoItem=JsonML.BST([""," ",["dt",{"jbst:visible":function(){return(this.data.ItemValue.length>0);}},function(){return this.data.ItemLabel;}," "]," ",["dd",{"jbst:visible":function(){return(this.data.ItemValue.length>0);}}," ",function(){return JsonML.BST(this.switchTemplates).dataBind(this.data.ItemValue,this.index,this.count);}," "]]);(function(){this.switchTemplates=function(){if(this.data.URL){return MF.Profile.ProfileInfoLink;}return MF.Profile.ProfileInfoValue;};}).call(MF.Profile.ProfileInfoItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfileInfoValue=JsonML.BST(["p",function(){return JsonML.raw(this.data.Value);}]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfileInfoLink=JsonML.BST(["a",{href:function(){return this.data.URL;}},function(){return this.data.Value;}]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ConnectionsService=new JsonFx.IO.Service("/Features/ProfileSites/Profile/ConnectionsService.jrpc");MF.Profile.ConnectionsService.getConnections=function(start,count,opt){this.invoke("getConnections",[start,count],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ConnectionsList=JsonML.BST([""," ",["div",{"class":"section-title"}," ",["h3",function(){return JsonFx.Lang.get("Global,FamilyConnectons");}]," ",["p",{"class":"section-title-extra","jbst:visible":function(){return !!this.data.addUrl;}}," ",["a",{"class":"add",href:function(){return this.data.addUrl;}},function(){return JsonFx.Lang.get("Global,Add");}]," "]," "]," ",["div",{"class":"contacts large"}," ",function(){return JsonML.BST(MF.Profile.ConnectionsItem).dataBind(this.data.items,this.index,this.count);}," "]]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ConnectionsItem=JsonML.BST(["p"," ",["a",{href:function(){return this.data.ProfileUrl;}}," ",["img",{src:function(){return this.data.AvatarUrl;},alt:function(){return this.data.UserName;}}]," "]," ",["span",{"class":"name"}," ",["a",{href:function(){return this.data.ProfileUrl;}},function(){return this.data.UserName;}]," "]," ",["span",{"class":"details"},function(){return this.data.ConnectionType;}]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfileAvatar=JsonML.BST([""," ",["p",{"class":"profile-picture-edit"}," ",["a",{href:function(){return this.data.editUrl;},"jbst:visible":function(){return !!this.data.editUrl;}}," ",["img",{src:function(){return this.data.avatar;},width:"300"}]," ",["span",["strong","Change this picture"]]," "]," ",["img",{src:function(){return this.data.avatar;},width:"300","jbst:visible":function(){return !this.data.editUrl;}}]," "]," ",["ul",{"class":"actions","jbst:visible":function(){return !!this.data.MessageProfileUser||(!!this.data.InviteProfileUser)||(false&&!!this.data.AddProfileUser);}}," ",["li",{"jbst:visible":function(){return !!this.data.MessageProfileUser;}}," ",["a",{href:function(){return this.data.MessageUserUrl;}},function(){return this.data.MessageProfileUser;}]," "]," ",["li",{"jbst:visible":function(){return !!this.data.InviteProfileUser;}}," ",["a",{href:"#",onclick:function(){return MF.Profile.SelectSitesDialog.show({},this.doInvite);}},function(){return this.data.InviteProfileUser;}]," "]," ",["li",{"jbst:visible":function(){return false&&!!this.data.AddProfileUser;}}," ",["a",{href:"#",onclick:"alert('TODO: AddProfileUser');return false;"},function(){return this.data.AddProfileUser;}]," "]," "]," "]);(function(){this.doInvite=function(B){var A=[];for(var C=0;C<B.length;C++){A.push(B[C].id);}MF.Profile.SitesService.inviteToSites(A,{onSuccess:function(D){MF.Message.showInfo($("div.column2"),"Invite(s) Sent!",MF.Message.Scope.Column,7000);}});};}).call(MF.Profile.ProfileAvatar);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.AboutMe=JsonML.BST(["div",{"class":"aboutme","jbst:visible":function(){return this.data.aboutMe.length>0;}}," ",function(){return JsonML.raw(this.data.aboutMe);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.AcceptInviteDialog=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind({height:200,width:400,modal:true,data:this.data},this.index,this.count,{$:[""," ",["h3",function(){return this.data.user;}," has invited you to connect on ",function(){return this.data.site;}]," ",["p","You're signed in as ",function(){return MF.user.username;},'. To accept this invite click "accept" below. ',["a",{onclick:function(){return MF.Profile.AcceptInviteDialog.switchUser(this.data.signInUrl);},href:function(){return this.data.signInUrl;}},"Click here"]," to accept this invite with a different account."]," ",["p",{"class":"submit"},["a",{"class":"positive",onclick:"MF.Profile.AcceptInviteDialog.acceptInvite(true);return false;",href:""},"Accept invite"]," or ",["a",{onclick:"MF.Profile.AcceptInviteDialog.acceptInvite(false);return false;",href:"#no"},"don't accept"]]," "]});});(function(){this.acceptInvite=function(A){MF.Profile.SitesService.acceptInvite(A,{onSuccess:function(B){if(B.url){window.location.href=B.url;}},onComplete:function(){MF.Dialog.remove();}});};this.switchUser=function(A){return function(){MF.Profile.SitesService.switchInviteUser({onComplete:function(){window.location.href=A;}});return false;};};}).call(MF.Profile.AcceptInviteDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfileTitle=JsonML.BST(["div",{"class":"js-Title"}," ",["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(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(A){A=A||this.data;if(A.status||!A.currentUser){return MF.Profile.ProfileStatusView;}return MF.Profile.ProfileStatusEdit;};}).call(MF.Profile.ProfileTitle);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.InfoService=new JsonFx.IO.Service("/Features/ProfileSites/EditInfo/EditInfoService.jrpc");MF.Profile.InfoService.getInfo=function(opt){this.invoke("getInfo",null,opt);};MF.Profile.InfoService.saveInfo=function(firstName,middleName,maidenName,lastName,aboutMe,gender,birthdate,addresses,emails,phones,websites,opt){this.invoke("saveInfo",[firstName,middleName,maidenName,lastName,aboutMe,gender,birthdate,addresses,emails,phones,websites],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoForm=JsonML.BST(["form",{method:"post",id:"EditInfoForm","class":"js-UnsavedData",title:"You have unsaved changes. Are you sure you want to leave this page?",action:function(){return this.data.ReturnUrl;}}," ",["div",{"class":"section-title"}," ",["h3",function(){return JsonFx.Lang.get("Global,EditYourProfile");}]," "]," ",function(){return JsonML.BST(MF.Profile.EditInfoName).dataBind(this.data.Name,this.index,this.count);}," ",function(){return JsonML.BST(MF.Profile.EditInfoMe).dataBind(this.data.AboutMe,this.index,this.count);}," ",function(){return JsonML.BST(MF.Profile.EditInfoEmail).dataBind(this.data.Emails.length?this.data.Emails:[{}],this.index,this.count);}," ",function(){return JsonML.BST(MF.Profile.EditInfoBirthday).dataBind(this.data.Birthdate,this.index,this.count);}," ",function(){return JsonML.BST(MF.Profile.EditInfoGender).dataBind(this.data.Gender,this.index,this.count);}," ",function(){return JsonML.BST(MF.Profile.EditInfoAddress).dataBind(this.data.Addresses.length?this.data.Addresses:[{}],this.index,this.count);}," ",function(){return JsonML.BST(MF.Profile.EditInfoPhone).dataBind(this.data.Phones.length?this.data.Phones:[{}],this.index,this.count);}," ",function(){return JsonML.BST(MF.Profile.EditInfoWebsite).dataBind(this.data.Websites.length?this.data.Websites:[{}],this.index,this.count);}," ",["p",{"class":"submit"}," ",["a",{"class":"positive",onclick:"MF.Profile.EditInfoForm.saveInfo(this);return false;"},function(){return JsonFx.Lang.get("Global,SaveChanges");}]," or ",["a",{href:function(){return this.data.ReturnUrl;},onclick:"MF.Forms.reset($(this).parents('form')[0]);"},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]," "]," "]);(function(){this.saveInfo=function(A){var C=A.form;if(!MF.Validation.validateForm(C)){MF.Message.showError(C,"Please fix the errors below.",MF.Message.Scope.Column);return;}MF.Message.clear(C,MF.Message.Scope.Column);MF.Forms.disableSubmit(C);var D,B=MF.Forms.getFormData(C);if(!B){return;}if(!B.FirstName){MF.Message.showError(C,"First name is required.",MF.Message.Scope.Column);return;}if(!B.LastName){MF.Message.showError(C,"Last name is required.",MF.Message.Scope.Column);return;}if(B.Addresses){for(D=0;D<B.Addresses.length;D++){B.Addresses[D].ID=Number(B.Addresses[D].ID);if(MF.Profile.EditInfoAddress.isEmpty(B.Addresses[D])){B.Addresses.splice(D,1);D--;}else{if(!B.Addresses[D].CountryCode){MF.Message.showError(C,"Country is required.",MF.Message.Scope.Column);return;}}}}if(B.Emails){for(D=0;D<B.Emails.length;D++){B.Emails[D].ID=Number(B.Emails[D].ID);if(MF.Profile.EditInfoEmail.isEmpty(B.Emails[D])){B.Emails.splice(D,1);D--;}}}if(B.Phones){for(D=0;D<B.Phones.length;D++){B.Phones[D].ID=Number(B.Phones[D].ID);if(MF.Profile.EditInfoPhone.isEmpty(B.Phones[D])){B.Phones.splice(D,1);D--;}}}if(B.Websites){for(D=0;D<B.Websites.length;D++){B.Websites[D].ID=Number(B.Websites[D].ID);if(!MF.Profile.EditInfoWebsite.isEmpty(B.Websites[D])&&B.Websites[D].Label&&!(B.Websites[D].Url)){MF.Message.showError(C,"You cannot have a website name without associating it with a URL.",MF.Message.Scope.Column);return;}if(MF.Profile.EditInfoWebsite.isEmpty(B.Websites[D])){B.Websites.splice(D,1);D--;}}}B.Birthdate=Date.parse(B.Birthdate);if(B.Birthdate instanceof Date){B.Birthdate=B.Birthdate.set({hour:12,minute:0,second:0}).setTimezone("GMT");}else{delete B.Birthdate;}MF.Profile.InfoService.saveInfo(B.FirstName||null,B.MiddleName||null,B.MaidenName||null,B.LastName||null,B.AboutMe||null,B.Gender||null,B.Birthdate||null,B.Addresses||null,B.Emails||null,B.Phones||null,B.Websites||null,{onSuccess:function(E){if(E){E=MF.Profile.EditInfoForm.bind(E);$(C).replaceWith(E);if(C.markClean){C.markClean();}}MF.Message.showInfo(E,"Profile info successfully saved.",MF.Message.Scope.Column);},onComplete:function(){MF.Forms.enableSubmit(C);}});};this.fixAddLinks=function(A){if(A){var B=$("."+A.split(" ").join(".")+" a.add");B.each(function(C){$(this).toggle(B.length<5&&C===(B.length-1));});}};this.appendField=function(C,B){var D=B.href;if(D){D=D.substr(D.indexOf("#")+1);}D=Number(D);var A=C.bind({},D+1,C.totalCount+1);$(B).parents("fieldset.js-DynamicFieldSet").after(A).each(function(){MF.Profile.EditInfoForm.fixAddLinks(this.className);});};this.removeField=function(B,A){$(A).parents("fieldset.js-DynamicFieldSet").remove().each(function(){MF.Profile.EditInfoForm.fixAddLinks(this.className);B.totalCount--;});};}).call(MF.Profile.EditInfoForm);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoName=JsonML.BST(["fieldset"," ",["p",{"class":"profile-label"}," ",["label",{"for":"profile-name"},function(){return JsonFx.Lang.get("Global,Name");},":"]," "]," ",["p",{"class":"profile-detail"}," ",["span",{"class":"required-pair"}," ",["input",{type:"text",name:"FirstName","class":"text js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,FirstName");},value:function(){return this.data.FirstName;},maxlength:"200",validate:function(){return MF.Validation.create(MF.RegExp.Name,"First name doesn't look quite right.");},onchange:"this.validate();"}]," ",["span","(required)"]," "]," ",["input",{type:"text",name:"MiddleName","class":"text js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,MiddleName");},value:function(){return this.data.MiddleName;},maxlength:"200",validate:function(){return MF.Validation.create(MF.RegExp.Name,"Middle name doesn't look quite right.");},onchange:"this.validate();"}]," ",["input",{type:"text",name:"MaidenName","class":"text js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,MaidenName");},value:function(){return this.data.MaidenName;},maxlength:"200",validate:function(){return MF.Validation.create(MF.RegExp.Name,"Maiden name doesn't look quite right.");},onchange:"this.validate();"}]," ",["span",{"class":"required-pair"}," ",["input",{type:"text",name:"LastName","class":"text js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,LastName");},value:function(){return this.data.LastName;},maxlength:"200",validate:function(){return MF.Validation.create(MF.RegExp.Name,"Last name doesn't look quite right.");},onchange:"this.validate();"}]," ",["span","(required)"]," "]," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoEmail=JsonML.BST([""," ",function(){this.totalCount++;}," ",["fieldset",{"class":"email js-DynamicFieldSet"}," ",["p",{"class":"profile-label"},["label",{"for":"profile-email"},function(){return JsonFx.Lang.get("Global,EmailAddress");},":"]]," ",["p",{"class":"profile-detail"}," ",["input",{type:"hidden",name:function(){return"Emails$"+this.index+"$ID";},value:function(){return this.data.ID;}}]," ",["select",{name:function(){return"Emails$"+this.index+"$Type";},size:"1"}," ",["option",{selected:function(){return(this.data.Type==="Home")?"selected":null;},value:"Home"},function(){return JsonFx.Lang.get("Global,Home");}]," ",["option",{selected:function(){return(this.data.Type==="Work")?"selected":null;},value:"Work"},function(){return JsonFx.Lang.get("Global,Work");}]," ",["option",{selected:function(){return(this.data.Type==="Secondary")?"selected":null;},value:"Secondary"},function(){return JsonFx.Lang.get("Global,Secondary");}]," ",["option",{selected:function(){return(this.data.Type==="Mobile")?"selected":null;},value:"Mobile"},function(){return JsonFx.Lang.get("Global,Mobile");}]," ",["option",{selected:function(){return(this.data.Type==="Web")?"selected":null;},value:"Web"},function(){return JsonFx.Lang.get("Global,Web");}]," ",["option",{selected:function(){return(this.data.Type==="Other")?"selected":null;},value:""},function(){return JsonFx.Lang.get("Global,Other");}]," "]," ",["input",{type:"text",name:function(){return"Emails$"+this.index+"$Email";},"class":"text profile-email js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,EmailExample");},value:function(){return this.data.Email;},maxlength:"100",validate:function(){return MF.Validation.create(MF.RegExp.Email,"Email doesn't look quite right.");},onchange:"this.validate();"}]," "]," ",["p",{"class":"actions"}," ",["a",{"class":"add",href:function(){return"#"+this.index;},style:function(){return(this.count<5&&this.index===(this.count-1))?null:"display:none";},onclick:"MF.Profile.EditInfoForm.appendField(MF.Profile.EditInfoEmail,this);return false;"},"Add another email"]," ",["a",{"class":"del",href:"#del",onclick:"MF.Profile.EditInfoForm.removeField(MF.Profile.EditInfoEmail,this);return false;","jbst:visible":function(){return !!this.index;}},"Delete this email"]," "]," "]]);(function(){this.totalCount=0;this.isEmpty=function(A){return !A||!A.Email;};}).call(MF.Profile.EditInfoEmail);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoAddress=JsonML.BST([""," ",function(){this.totalCount++;}," ",["fieldset",{"class":"address js-DynamicFieldSet"}," ",["p",{"class":"profile-label"},["label",{"for":"profile-address"},function(){return JsonFx.Lang.get("Global,Address");},":"]]," ",["p",{"class":"profile-detail"}," ",["input",{type:"hidden",name:function(){return"Addresses$"+this.index+"$ID";},value:function(){return this.data.ID;}}]," ",["select",{name:function(){return"Addresses$"+this.index+"$Type";},size:"1"}," ",["option",{selected:function(){return(this.data.Type==="Home")?"selected":null;}},function(){return JsonFx.Lang.get("Global,Home");}]," ",["option",{selected:function(){return(this.data.Type==="Work")?"selected":null;}},function(){return JsonFx.Lang.get("Global,Work");}]," ",["option",{selected:function(){return(this.data.Type==="Mailing")?"selected":null;}},function(){return JsonFx.Lang.get("Global,Mailing");}]," ",["option",{selected:function(){return(this.data.Type==="Other")?"selected":null;}},function(){return JsonFx.Lang.get("Global,Other");}]," "]," ",["input",{type:"text",name:function(){return"Addresses$"+this.index+"$Line1";},"class":"text js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,Street");},value:function(){return this.data.Line1;},maxlength:"400",validate:function(){return MF.Validation.create(MF.RegExp.Label400,"Street 1 doesn't look quite right.");},onchange:"this.validate();"}]," ",["input",{type:"text",name:function(){return"Addresses$"+this.index+"$Line2";},"class":"text js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,Street");},value:function(){return this.data.Line2;},maxlength:"400",validate:function(){return MF.Validation.create(MF.RegExp.Label400,"Street 2 doesn't look quite right.");},onchange:"this.validate();"}]," ",["input",{type:"text",name:function(){return"Addresses$"+this.index+"$City";},"class":"text address-city js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,City");},maxlength:"100",value:function(){return this.data.City;},validate:function(){return MF.Validation.create(MF.RegExp.City,"City doesn't look quite right.");},onchange:"this.validate();"}]," ",["input",{type:"text",name:function(){return"Addresses$"+this.index+"$State";},"class":"text address-state js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,StateProvince");},value:function(){return this.data.State;},maxlength:"200",validate:function(){return MF.Validation.create(MF.RegExp.Label200,"State doesn't look quite right.");},onchange:"this.validate();"}]," ",["input",{type:"text",name:function(){return"Addresses$"+this.index+"$PostalCode";},"class":"text js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,PostalCode");},value:function(){return this.data.PostalCode;},maxlength:"15",validate:function(){return MF.Validation.create(MF.RegExp.PostalCode,"Postal Code doesn't look quite right.");},onchange:"this.validate();"}]," ",["select",{"class":"profile-country",size:"1",name:function(){return"Addresses$"+this.index+"$CountryCode";}}," ",function(){this.countryCode=this.data.CountryCode;}," ",function(){return JsonML.BST([""," ",["option",{value:function(){return this.data.code;},selected:function(){return(this.data.code===MF.Profile.EditInfoAddress.countryCode)?"selected":null;}},function(){return this.data.name;}]," "]).dataBind(MF.Profile.EditInfoAddress.Countries,this.index,this.count);}," "]," "]," ",["p",{"class":"actions"}," ",["a",{"class":"add",href:function(){return"#"+this.index;},style:function(){return(this.count<5&&this.index===(this.count-1))?null:"display:none";},onclick:"MF.Profile.EditInfoForm.appendField(MF.Profile.EditInfoAddress,this);return false;"},"Add another address"]," ",["a",{"class":"del",href:"#del",onclick:"MF.Profile.EditInfoForm.removeField(MF.Profile.EditInfoAddress,this);return false;","jbst:visible":function(){return !!this.index;}},"Delete this address"]," "]," "]]);(function(){this.totalCount=0;this.isEmpty=function(A){return !A||!A.Line1&&!A.Line2&&!A.City&&!A.State&&!A.PostalCode;};}).call(MF.Profile.EditInfoAddress);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoPhone=JsonML.BST([""," ",function(){this.totalCount++;}," ",["fieldset",{"class":"phone-number js-DynamicFieldSet"}," ",["p",{"class":"profile-label"},["label",{"for":"profile-phone"},"Phone:"]]," ",["p",{"class":"profile-detail"}," ",["input",{type:"hidden",name:function(){return"Phones$"+this.index+"$ID";},value:function(){return this.data.ID;}}]," ",["select",{name:function(){return"Phones$"+this.index+"$Type";},size:"1"}," ",["option",{selected:function(){return(this.data.Type==="Home")?"selected":null;},value:"Home"},function(){return JsonFx.Lang.get("Global,Home");}]," ",["option",{selected:function(){return(this.data.Type==="WorkPhone")?"selected":null;},value:"WorkPhone"},function(){return JsonFx.Lang.get("Global,Work");}]," ",["option",{selected:function(){return(this.data.Type==="Cell")?"selected":null;},value:"Cell"},function(){return JsonFx.Lang.get("Global,Mobile");}]," ",["option",{selected:function(){return(this.data.Type==="Pager")?"selected":null;},value:"Pager"},function(){return JsonFx.Lang.get("Global,Pager");}]," ",["option",{selected:function(){return(this.data.Type==="Fax")?"selected":null;},value:"Fax"},function(){return JsonFx.Lang.get("Global,Fax");}]," ",["option",{selected:function(){return(this.data.Type==="Other")?"selected":null;},value:"Other"},function(){return JsonFx.Lang.get("Global,Other");}]," "]," ",["input",{type:"text",name:function(){return"Phones$"+this.index+"$PhoneNumber";},"class":"text js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,PhoneExample");},value:function(){return this.data.PhoneNumber;},maxlength:"20",validate:function(){return MF.Validation.create(MF.RegExp.Phone,"Phone number doesn't look quite right.");},onchange:"this.validate();"}]," ",["input",{type:"hidden",name:function(){return"Phones$"+this.index+"$Extension";},value:function(){return this.data.Extension;}}]," "]," ",["p",{"class":"actions"}," ",["a",{"class":"add",href:function(){return"#"+this.index;},style:function(){return(this.count<5&&this.index===(this.count-1))?null:"display:none";},onclick:"MF.Profile.EditInfoForm.appendField(MF.Profile.EditInfoPhone,this);return false;"},"Add another number"]," ",["a",{"class":"del",href:"#del",onclick:"MF.Profile.EditInfoForm.removeField(MF.Profile.EditInfoPhone,this);return false;","jbst:visible":function(){return !!this.index;}},"Delete this number"]," "]," "]]);(function(){this.totalCount=0;this.isEmpty=function(A){return !A||!A.PhoneNumber;};}).call(MF.Profile.EditInfoPhone);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoWebsite=JsonML.BST([""," ",function(){this.totalCount++;}," ",["fieldset",{"class":"website js-DynamicFieldSet"}," ",["p",{"class":"profile-label"}," ",["label",{"for":"profile-website"},function(){return JsonFx.Lang.get("Global,Website");},":"]," "]," ",["p",{"class":"profile-detail"}," ",["input",{type:"hidden",name:function(){return"Websites$"+this.index+"$ID";},value:function(){return this.data.ID;}}]," ",["input",{type:"text",name:function(){return"Websites$"+this.index+"$Label";},"class":"text js-InlineInstruction",value:function(){return this.data.Label;},title:function(){return JsonFx.Lang.get("Global,Name");},maxlength:"50",validate:function(){return MF.Validation.create(MF.RegExp.Label050,"The website label doesn't look quite right.");},onchange:"this.validate();"}]," ",["input",{type:"text",name:function(){return"Websites$"+this.index+"$Url";},"class":"text js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,WebsiteExample");},value:function(){return this.data.Url;},maxlength:"200",validate:function(){return MF.Validation.create(MF.RegExp.Url,"The website address doesn't look quite right.");},onchange:"this.validate();"}]," "]," ",["p",{"class":"actions"}," ",["a",{"class":"add",href:function(){return"#"+this.index;},style:function(){return(this.count<5&&this.index===(this.count-1))?null:"display:none";},onclick:"MF.Profile.EditInfoForm.appendField(MF.Profile.EditInfoWebsite,this);return false;"},"Add another website"]," ",["a",{"class":"del",href:"#del",onclick:"MF.Profile.EditInfoForm.removeField(MF.Profile.EditInfoWebsite,this);return false;","jbst:visible":function(){return !!this.index;}},"Delete this site"]," "]," "]]);(function(){this.totalCount=0;this.isEmpty=function(A){return !A||!A.Label&&!A.Url;};}).call(MF.Profile.EditInfoWebsite);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoGender=JsonML.BST(["fieldset"," ",["p",{"class":"profile-label"},["label",{"for":"profile-gender"},function(){return JsonFx.Lang.get("Global,Gender");},":"]]," ",["p",{"class":"profile-detail gender"}," ",["input",{id:"gender-female",type:"radio",name:"Gender",checked:function(){return(this.data==="Female")?"checked":null;},value:"Female"}],["label",{"for":"gender-female"},function(){return JsonFx.Lang.get("Global,Female");}]," ",["input",{id:"gender-male",type:"radio",name:"Gender",checked:function(){return(this.data==="Male")?"checked":null;},value:"Male"}],["label",{"for":"gender-male"},function(){return JsonFx.Lang.get("Global,Male");}]," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoBirthday=JsonML.BST(["fieldset"," ",["p",{"class":"profile-label"}," ",["label",{"for":"profile-birthday"},function(){return JsonFx.Lang.get("Global,Birthday");},":"]," "]," ",["p",{"class":"profile-detail birthday"}," ",["input",{name:"Birthdate",type:"text","class":"text js-InlineInstruction",title:function(){return MF.MediumDateFormat.toLowerCase();},value:function(){return this.formatDate(this.data);},onfocus:"this.select()",onchange:"this.value=MF.Profile.EditInfoBirthday.formatDate(Date.parse(this.value));"}]," "]," "]);(function(){this.formatDate=function(A){if(A instanceof Date&&A.getUTCFullYear()>=1753){return A.toString(MF.MediumDateFormat);}return"";};}).call(MF.Profile.EditInfoBirthday);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoMe=JsonML.BST(["fieldset"," ",["p",{"class":"profile-label"}," ",["label",{"for":"profile-name"},"Bio:"]," "]," ",["p",{"class":"profile-detail"}," ",["textarea",{"class":"active aboutme js-expand",name:"AboutMe",onkeyup:"MF.Profile.EditInfoMe.enforceMaxLength($(this));return false;"},function(){return this.data;}]," ",["span",{"class":"countdown"}," ",["strong",{"class":"js-counter"},function(){return this.maxLength-this.data.length;}]," Characters Left "]," "]," "]);(function(){this.maxLength=300;this.updateMessageLength=function(A){$(".js-counter").text(this.maxLength-A.length);};this.enforceMaxLength=function(A){if(A.val().length>=this.maxLength){A.val(A.val().substr(0,this.maxLength));}MF.Profile.EditInfoMe.updateMessageLength(A.val());};}).call(MF.Profile.EditInfoMe);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfilePermissions=JsonML.BST([""," ",["div",{"class":"box"}," ",["p"," ",["strong",function(){return JsonFx.Lang.get("Global,PrivacySeriously");}]," ",function(){return JsonFx.Lang.get("Global,PrivacyExplaination");}," ",["strong",function(){return JsonML.BST(MF.Messaging.WhatsThis).dataBind({message:this.data.explanations},this.index,this.count);}]," "]," "]," ",["div",{"jbst:visible":function(){return this.data.hasBlog;}}," ",["div",{"class":"section-title"}," ",["h3","Edit blog privacy"]," "]," ",["fieldset",{"class":"privacy privacy-blog"}," ",["p"," ",["label"," ",["input",{type:"checkbox",checked:function(){return this.data.blogFullProfile;},defaultChecked:function(){return this.data.blogFullProfile;},name:"BlogFullProfile"}]," ",["strong","Allow followers to view my full profile"]," "]," "],["br"],["br"]," ",["p"," ",["label"," ",["input",{type:"checkbox",checked:function(){return !this.data.autoApprove;},defaultChecked:function(){return !this.data.autoApprove;},name:"AutoApprove"}]," ",["strong","Ask me to approve followers"]," "]," "],["br"],["br"]," ",["p",["label",["strong","Default post privacy:"]]," ",["select",{name:"blogPrivacy",size:"1"}," ",["option",{selected:function(){return this.data.blogPrivacy==="Public"?"selected":"";}},"Public"]," ",["option",{selected:function(){return this.data.blogPrivacy==="Private"?"selected":"";}},"Private"]," ",["option",{selected:function(){return this.data.blogPrivacy==="Secret"?"selected":"";}},"Secret"]," "]," "]," ",["p","When you make a blog post, you have 3 options for who can view it:"]," ",["ul"," ",["li",["strong","Public:"]," anyone can see the post."]," ",["li",["strong","Private:"]," only your followers can see the post. See the option above to approve who follows your blog."]," ",["li",["strong","Secret:"]," only you can see the post. This is a good option if you'd like to use the blog as a personal family journal."]," "]," "]," "]," ",["div",{"class":"section-title"}," ",["h3",function(){return JsonFx.Lang.get("Global,EditProfilePermissions");}]," "]," ",["p",["strong",function(){return JsonFx.Lang.get("Global,PrivacySettingsLabel");},":"]]," ",["fieldset",{"class":"privacy privacy-group"}," ",function(){return JsonML.BST(MF.Profile.PermissionSiteList).dataBind(this.data.items,this.index,this.count);}," "]]);(function(){this.post=function(A){var C=jQuery(A.form);var B=MF.Forms.getFormData(C);if(B.Permissions){for(var D=0;D<B.Permissions.length;D++){B.Permissions[D].AllowFullProfileAccess=!!B.Permissions[D].AllowFullProfileAccess;}}B.AutoApprove=!(B.AutoApprove==="on");var E=B.BlogFullProfile==="on";MF.Forms.disableSubmit(C);MF.Profile.ProfilePermissionsService.updatePermissions(B.Permissions,"Private",B.AutoApprove,E,B.blogPrivacy,{onSuccess:function(F){MF.Message.showInfo(C,"Profile info successfully saved.",MF.Message.Scope.Column);if(C[0].markClean){C[0].markClean();}},onComplete:function(){MF.Forms.enableSubmit(C);}});};}).call(MF.Profile.ProfilePermissions);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.PermissionSiteList=JsonML.BST(["p"," ",["label"," ",["input",{type:"checkbox",checked:function(){return(this.data.profile)?"checked":null;},defaultChecked:function(){return(this.data.profile)?"defaultChecked":null;},name:function(){return"Permissions$"+this.index+"$AllowFullProfileAccess";}}]," ",function(){return this.data.name;}," "]," ",["input",{type:"hidden",name:function(){return"Permissions$"+this.index+"$SiteID";},value:function(){return this.data.siteID;}}]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfileAdminList=JsonML.BST([""," ",["div",{"class":"section-title"}," ",["h3",function(){return JsonFx.Lang.get("Global,ProfileAdministrators");}]," "]," ",["p"," ",function(){return JsonFx.Lang.get("Global,ProfileAdministratorsInstruction");}," ",["a",{href:function(){return this.data.addUrl;}},function(){return JsonFx.Lang.get("Global,ProfileAdministratorsLink");}]," "]," ",["br"]," ",["div",{"class":"contacts large"}," ",function(){return JsonML.BST(MF.Profile.ProfileAdminItem).dataBind(this.data.items,this.index,this.count);}," "]]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfileAdminItem=JsonML.BST(["p"," ",["img",{src:function(){return this.data.AvatarUrl;}}]," ",["span",{"class":"name"},function(){return this.data.UserName;}]," ",["span",{"class":"detail"}," ",["a",{href:function(){return this.data.RemoveUrl;}},function(){return JsonFx.Lang.get("Global,Remove");}]," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.ProfilePermissionsService=new JsonFx.IO.Service("/Features/ProfileSites/EditPermissions/ProfilePermissionsService.jrpc");MF.Profile.ProfilePermissionsService.siteProfilePermissions=function(opt){this.invoke("siteProfilePermissions",null,opt);};MF.Profile.ProfilePermissionsService.updatePermissions=function(Sites,PrivacyLevel,AutoApprove,BlogFullProfile,blogPrivacy,opt){this.invoke("updatePermissions",[Sites,PrivacyLevel,AutoApprove,BlogFullProfile,blogPrivacy],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditAvatar=JsonML.BST([""," ",["div",{"class":"section-title"}," ",["h3",function(){return JsonFx.Lang.get("Global,ChangeProfilePicture");}]," ",function(){return JsonML.BST(MF.Messaging.WhatsThis).dataBind({message:MF.Profile.EditAvatar.avatarExplainations},this.index,this.count);}," "]," ",["form",{method:"post","class":"js-avatar"}," ",["p",{"class":"profile-picture"}," ",["img",{src:function(){return this.data.avatar;},"class":"js-AvatarPreview",width:"300",height:"300",onload:function(){return MF.Loading.hide;}}]," ",["span","This is your current profile picture."]," ",["a",{"class":"profile-picture-del js-delete",href:"#",onclick:"MF.Profile.EditAvatar.reset($('form.js-avatar')[0]);$(this).hide();return false;",style:function(){return this.data.showDelete?null:"display:none;";}},"Delete Current Picture?"]," "]," ",["input",{type:"hidden",name:"guid"}]," ",["input",{type:"hidden",name:"title"}]," ",["input",{type:"hidden",name:"description"}]," ",["input",{type:"hidden",name:"height",value:"300"}]," ",["input",{type:"hidden",name:"width",value:"300"}]," ",["input",{type:"hidden",name:"dateTaken"}]," ",["input",{type:"hidden",name:"mimeType"}]," ",["input",{type:"hidden",name:"fileName"}]," ",["input",{type:"hidden",name:"orientation",value:"0"}]," "]," ",function(){return JsonML.BST(MF.Publisher.SingleFileUploader).dataBind(this.getUploaderData(),this.index,this.count);}," ",["p",{"class":"submit"},["a",{"class":"positive",onclick:"MF.Profile.EditAvatar.save($('form.js-avatar')[0]);return false;"},function(){return JsonFx.Lang.get("Global,SaveChanges");}]," or ",["a",{href:function(){return this.data.cancelUrl;},onclick:"MF.UnsavedData.markClean('EditAvatar.Upload');"},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]," "]]);(function(){var A=".js-avatar";function B(D){MF.Loading.show();$(".js-delete").show();}function C(E){var D=E.remasteredID||E.originalID;$("input[name=guid]").val(D);$("input[name=title]").val(E.title);$("input[name=description]").val(E.description);$("input[name=height]").val(E.height);$("input[name=width]").val(E.width);$("input[name=dateTaken]").val(E.dateTaken);$("input[name=mimeType]").val(E.mimeType);$("input[name=fileName]").val(E.originalFileName);$("input[name=orientation]").val(E.orientation);MF.Profile.EditAvatarService.getUrl(D,{onSuccess:function(F){$("img.js-AvatarPreview").attr("src",F);}});}this.save=function(D){var E=MF.Forms.getFormData(D);MF.Message.clear(D,MF.Message.Scope.Column);if(!E.guid){return;}if(E.guid==="00000000-0000-0000-0000-000000000000"){MF.Profile.EditAvatarService.resetAvatar({onSuccess:function(F){MF.UnsavedData.markClean("EditAvatar.Upload");MF.Message.showInfo(D,"Save successful",MF.Message.Scope.Column,5000);$(".js-SiteTitle .js-Title").replaceWith(MF.Profile.ProfileTitle.bind({title:F.title,avatarUrl:F.avatarUrl,status:F.status,edit:F.edit}));},onFailure:function(H,F,G){MF.Message.showError(D,"Error saving changes",MF.Message.Scope.Column);if(MF.isDebug){;}}});return;}MF.Profile.EditAvatarService.saveAvatar(E.guid,E.title,E.description,E.height||-1,E.width||-1,E.dateTaken,E.mimeType,E.fileName,E.orientation||0,{onSuccess:function(F){MF.UnsavedData.markClean("EditAvatar.Upload");MF.Message.showInfo(D,"Save successful",MF.Message.Scope.Column,5000);$(".js-SiteTitle .js-Title").replaceWith(MF.Profile.ProfileTitle.bind({title:F.title,avatarUrl:F.avatarUrl,status:F.status,edit:F.edit}));D.reset();},onFailure:function(H,F,G){MF.Message.showError(D,"Error saving avatar",MF.Message.Scope.Column);if(MF.isDebug){;}}});};this.reset=function(D){MF.UnsavedData.markDirty("EditAvatar.Upload","You didn't save your profile picture changes.");D.reset();$("input[name=guid]").val("00000000-0000-0000-0000-000000000000");MF.Profile.EditAvatarService.getUrl(null,{onSuccess:function(E){if(E){$("img.js-AvatarPreview").attr("src",E);}}});};this.getUploaderData=function(){return MF.Publisher.SingleFileUploader.buildData(["jpg","jpeg","jpe","png","gif","tif"],this.data.authID,this.data.formUrl,this.data.transforms,this.data.domain,B,null,C,A);};this.avatarExplainations=[{title:"Profile picture:",explaination:"Your profile picture appears on your profile page and on every group you belong to. It will be shown next to your name on the member list and recently online module, as well as all of your contributed activities within the group."},{explaination:"To upload your profile picture, click the browse button and select a photo that is a .jpg, .gif or .png file type.  A loading indicator will appear at the top of the page. Once the loading indicator disappears, you can click the save button."}];}).call(MF.Profile.EditAvatar);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditAvatarService=new JsonFx.IO.Service("/Features/ProfileSites/EditAvatar/EditAvatarService.jrpc");MF.Profile.EditAvatarService.getUrl=function(contentGuid,opt){this.invoke("getUrl",[contentGuid],opt);};MF.Profile.EditAvatarService.resetAvatar=function(opt){this.invoke("resetAvatar",null,opt);};MF.Profile.EditAvatarService.saveAvatar=function(contentGuid,title,description,height,width,dateTaken,mimeType,originalFileName,orientation,opt){this.invoke("saveAvatar",[contentGuid,title,description,height,width,dateTaken,mimeType,originalFileName,orientation],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.NicknamesService=new JsonFx.IO.Service("/Features/ProfileSites/EditNicknames/NicknamesService.jrpc");MF.Profile.NicknamesService.getNicknames=function(opt){this.invoke("getNicknames",null,opt);};MF.Profile.NicknamesService.saveNicknames=function(NicknameList,opt){this.invoke("saveNicknames",[NicknameList],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.Nicknames=JsonML.BST(["form",{method:"post",id:"NicknamesForm","class":"js-UnsavedData",title:"You have unsaved changes. Are you sure you want to leave this page?","jbst:visible":function(){return this.data.items.length>0;}}," ",["div",{"class":"section-title"}," ",["h3",function(){return JsonFx.Lang.get("Global,EditSiteNicknames");}]," ",function(){return JsonML.BST(MF.Messaging.WhatsThis).dataBind({message:MF.Profile.Nicknames.nicknamesExplaination},this.index,this.count);}," "]," ",function(){return JsonML.BST(MF.Profile.NicknameItem).dataBind(this.data.items,this.index,this.count);}," ",["p",{"class":"submit"}," ",["a",{"class":"positive",onclick:"MF.Profile.Nicknames.post(this);return false;"},function(){return JsonFx.Lang.get("Global,SaveChanges");}]," or ",["a",{href:function(){return this.data.ReturnUrl;},onclick:"MF.Forms.reset($(this).parents('form')[0]);"},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]," "]," "]);(function(){this.post=function(A){var C=A.form;if(!MF.Validation.validateForm(C)){MF.Message.showError(C,"Please fix the errors below.",MF.Message.Scope.Column);return;}else{MF.Message.clear(C,MF.Message.Scope.Column);}var B=MF.Forms.getFormData(C);MF.Forms.disableSubmit(C);MF.Profile.NicknamesService.saveNicknames(B.Nickname,{onSuccess:function(D){if(D){D=MF.Profile.Nicknames.bind(D);var E=D.firstChild;$(C).replaceWith(D);}MF.Message.showInfo(E,"Profile info successfully saved.",MF.Message.Scope.Column);if(C.markClean){C.markClean();}},onComplete:function(){MF.Forms.enableSubmit(C);}});};this.nicknamesExplaination=[{title:"Group nicknames:",explaination:'By default, your first and last name will be used to identify you within a group. If you would like to be known by a different name, like "Aunt Wendy," you can use the Nickname feature to give yourself a nickname for that group. You can set a different nickname for each group you belong to.'}];}).call(MF.Profile.Nicknames);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.NicknameItem=JsonML.BST(["fieldset"," ",["input",{type:"hidden",name:function(){return"Nickname$"+this.index+"$SiteID";},value:function(){return this.data.SiteID;}}]," ",["p",{"class":"profile-label"}," ",["label",function(){return JsonFx.Lang.get("Global,Site");},":"]," "]," ",["p",{"class":"profile-detail"}," ",["strong",function(){return this.data.SiteName;}]," ",["input",{type:"text","class":"text js-InlineInstruction",name:function(){return"Nickname$"+this.index+"$Nickname";},title:function(){return MF.Profile.Fullname;},value:function(){return this.data.Nickname;},maxlength:"200",validate:function(){return MF.Validation.create(MF.RegExp.Label200,"Nickname doesn't look quite right.");},onchange:"this.validate();"}]," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditAccount=JsonML.BST(["form",{method:"post",id:"EditAccountForm","class":"js-UnsavedData js-EnableKeys",onsubmit:"return false;",title:"You have unsaved changes. Are you sure you want to leave this page?"}," ",["div",{"class":"section-title"}," ",["h3"," ",function(){return JsonFx.Lang.get("Global,EditAccountInformation");}," "]," "]," ",function(){return JsonML.BST(MF.Profile.EditInfoUsername).dataBind(this.data.Username,this.index,this.count);}," ",function(){return JsonML.BST(MF.Profile.EditAccountEmail).dataBind(this.data.Email,this.index,this.count);}," ",function(){return JsonML.BST(MF.Profile.EditInfoPassword).dataBind(this.data,this.index,this.count);}," ",function(){return JsonML.BST(MF.Profile.UnlinkFBAccount).dataBind(this.data,this.index,this.count);}," ",["p",{"class":"submit"}," ",["a",{"class":"positive js-EnterKeyTarget",onclick:function(){return this.post;}},function(){return JsonFx.Lang.get("Global,SaveChanges");}]," or ",["a",{"class":"js-EscKeyTarget",href:function(){return this.data.ReturnUrl;},onclick:"MF.Forms.reset($(this).parents('form')[0]);"},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]," "]," "]);(function(){this.post=function(){var B=$(this).parents("form").andSelf().eq(0);if(!MF.Validation.validateForm(B)){MF.Message.showError(this,"Please fix the errors below.",MF.Message.Scope.Column);return false;}var A=MF.Forms.getFormData(B);if(!A.OldPassword){MF.Message.showError(B,"Old password is required.",MF.Message.Scope.Column);return false;}if(A.NewPassword!=A.ConfirmPassword){MF.Message.showError(B,"Passwords do not match",MF.Message.Scope.Column);return false;}MF.Forms.disableSubmit(B);MF.Profile.EditAccountService.saveAccountInfo(A.Username,A.OldPassword,A.NewPassword,A.PreferredEmail,{onSuccess:function(C){if(!C){MF.Message.showInfo(B,"Update successful",MF.Message.Scope.Column);if(B[0].markClean){B[0].markClean();}$(".js-OldPassword").val("");return;}MF.Message.showError(B,C,MF.Message.Scope.Column);},onFailure:function(E,C,D){switch(D&&D.data&&D.data.Type){case"UsernameChangeException":MF.Message.showError(B,"Error changing username.",MF.Message.Scope.Column);break;case"PasswordChangeException":MF.Message.showError(B,"Error changing password.",MF.Message.Scope.Column);break;case"AccountEmailChangeException":MF.Message.showError(B,"Error changing email address.",MF.Message.Scope.Column);break;default:MF.Message.showError(B,"An error occurred while saving.",MF.Message.Scope.Column);break;}},onComplete:function(){MF.Forms.enableSubmit(B);}});return false;};}).call(MF.Profile.EditAccount);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditAccountService=new JsonFx.IO.Service("/Features/ProfileSites/EditAccount/EditAccountService.jrpc");MF.Profile.EditAccountService.saveAccountInfo=function(newUsername,oldPassword,newPassword,newEmail,opt){this.invoke("saveAccountInfo",[newUsername,oldPassword,newPassword,newEmail],opt);};MF.Profile.EditAccountService.disassociateFBId=function(opt){this.invoke("disassociateFBId",null,opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoUsername=JsonML.BST(["fieldset"," ",["p",{"class":"profile-label"}," ",["label",{"for":"profile-name"},function(){return JsonFx.Lang.get("Global,Username");},":"]," "]," ",["p",{"class":"profile-detail"}," ",["span",function(){return JsonFx.Lang.get("Global,AcceptedUsernameCharacters");}]," ",["input",{type:"text",name:"Username","class":"text js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,Username");},value:function(){return this.data.username;},maxlength:"25",validate:function(){return MF.Validation.create(MF.RegExp.Username,"Username doesn't look quite right.");},onchange:"this.validate();"}]," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditInfoPassword=JsonML.BST(["fieldset"," ",["p",{"class":"profile-label"},["label",{"for":"profile-email"},"Change password:"]]," ",["p",{"class":"profile-detail"}," ",["input",{name:"OldPassword",type:"password","class":"text js-PasswordInstruction js-OldPassword",title:function(){return JsonFx.Lang.get("Global,EnterOldPassword");}}]," ",["span",function(){return JsonFx.Lang.get("Global,AcceptedPasswordCharacters");}]," ",["input",{name:"NewPassword",type:"password","class":"text js-PasswordInstruction",title:function(){return JsonFx.Lang.get("Global,EnterNewPassword");},maxlength:"25",validate:function(){return MF.Validation.create(MF.RegExp.Password,"Password doesn't look quite right.");},onchange:"this.validate();"}]," ",["input",{name:"ConfirmPassword",type:"password","class":"text js-PasswordInstruction",title:function(){return JsonFx.Lang.get("Global,ConfirmNewPassword");},maxlength:"25",validate:function(){return MF.Validation.create(MF.RegExp.Password,"Password doesn't look quite right.");},onchange:"this.validate();"}]," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.EditAccountEmail=JsonML.BST(["fieldset"," ",["p",{"class":"profile-label"}," ",["label",{"for":"profile-username"},"Account email:"]," "]," ",["p",{"class":"profile-detail"}," ",["span","This email is only used for account purposes, e.g. notifications. It is not shown on your profile."]," ",["input",{"class":"text switch-value js-InlineInstruction",type:"text",title:function(){return JsonFx.Lang.get("Global,PreferredEmailAddress");},name:"PreferredEmail",value:function(){return this.data;},validate:function(){return MF.Validation.create(MF.RegExp.Email,"Email doesn't look quite right.");}}]," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.UnlinkFBAccount=JsonML.BST(["fieldset",{"jbst:visible":function(){return this.data.hasFBId;},"class":"js-fbDisassociate"}," ",["p",{"class":"profile-label"}," ",["label",{"for":"profile-name"},"Facebook Connect:"]," "]," ",["p",{"class":"profile-detail fb-link"}," Your Facebook account is currently linked to this myfamily.com account. If you need to link your Facebook account with a different myfamily.com account or prefer not to have your accounts linked, ",["a",{onclick:function(){return this.unlinkFBId();}},"please click here to unlink your Facebook account from this myfamily.com account"],". "]," "]);(function(){this.unlinkFBId=function(){return function(){var A=this;MF.Profile.EditAccountService.disassociateFBId({onSuccess:function(B){$(".js-fbDisassociate").hide("slow",function(){$(this).remove();});MF.Message.showInfo(A,"Unlinked!",MF.Message.Scope.Column);},onFailure:function(){MF.Message.showInfo(A,"Are you sure you're signed in with the right account?",MF.Message.Scope.Column);}});};};}).call(MF.Profile.UnlinkFBAccount);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.Notifications=JsonML.BST([""," ",["div",{"class":"section-title"}," ",["h3",function(){return JsonFx.Lang.get("Global,EmailNotificationLabel");}]," ",function(){return JsonML.BST(MF.Messaging.WhatsThis).dataBind({message:this.profileExplainations},this.index,this.count);}," "]," ",["form"," ",["div",{"class":"box"}," ",["p"," ",["input",{type:"checkbox",value:"",name:"ProfileSettings$NotifyForNewProfileNotes",checked:function(){return this.data.ProfileNotes?"checked":null;},defaultChecked:function(){return this.data.ProfileNotes?"defaultChecked":null;}}]," ",function(){return JsonFx.Lang.get("Global,NotesNotificationLabel");}," "]," ",["p"," ",["input",{type:"checkbox",value:"",name:"ProfileSettings$NotifyForNewPrivateMessages",checked:function(){return this.data.PrivateMessages?"checked":null;},defaultChecked:function(){return this.data.PrivateMessages?"checked":null;}}]," ",function(){return JsonFx.Lang.get("Global,PMNotificationLabel");}," "]," "]," ",["div"," ",["div",{"class":"section-title"}," ",["h3","Edit blog activity notifications"]," ",function(){return JsonML.BST(MF.Messaging.WhatsThis).dataBind({message:this.blogExplainations},this.index,this.count);}," "]," ",["fieldset",{"class":"privacy"}," ",["input",{type:"hidden",value:function(){return this.data.blogSiteId;},name:"BlogSettings$SiteID"}]," ",["p",["strong","Comments & Loves:"]]," ",["ul"," ",["li",{"jbst:visible":function(){return this.data.blogSiteId>1;}}," ",["input",{type:"checkbox",value:"",name:"BlogSettings$IsCommentOnMemberContentNotificationEnabled",checked:function(){return this.data.blogNotifyCommentOnPost?"checked":null;},defaultChecked:function(){return this.data.blogNotifyCommentOnPost?"defaultChecked":null;}}]," When someone comments on or loves my posts "]," ",["li"," ",["input",{type:"checkbox",value:"",name:"blogCommentOnComment",checked:function(){return this.data.blogNotifyCommentOnComment?"checked":null;},defaultChecked:function(){return this.data.blogNotifyCommentOnComment?"defaultChecked":null;}}]," When someone comments on posts I've commented on or loved "]," "]," "]," "]," ",["div",{"jbst:visible":function(){return this.data.siteNames.length>0;},"class":"notifications"}," ",["div",{"class":"section-title"}," ",["h3","Edit group activity notifications"]," ",function(){return JsonML.BST(MF.Messaging.WhatsThis).dataBind({message:this.groupExplainations},this.index,this.count);}," "]," ",["p"," ",["strong",function(){return JsonFx.Lang.get("Global,FamilyGroup");},":"]," ",["select",{onchange:function(){return this.changeSite();}}," ",function(){return JsonML.BST([""," ",["option",{value:function(){return this.data.siteId;}},function(){return this.data.siteName;}]," "]).dataBind(this.data.siteNames,this.index,this.count);}," "]," "]," ",function(){return JsonML.BST(MF.Profile.SiteItem).dataBind(this.data.siteData,this.index,this.count);}," "]," ",["p",{"class":"note notifications"},function(){return JsonFx.Lang.get("Global,NotificationEmailExplain");},["strong",function(){return JsonFx.Lang.get("Global,AccountEmailAddress");}],". ",function(){return JsonFx.Lang.get("Global,NotificationEmailExplain2");},["a",{href:function(){return this.data.accountUrl;}},function(){return JsonFx.Lang.get("Global,here");}],"."]," ",["p",{"class":"submit"}," ",["a",{"class":"positive",onclick:"MF.Profile.Notifications.post(this);return false;"},function(){return JsonFx.Lang.get("Global,SaveChanges");}]," ",function(){return JsonFx.Lang.get("Global,Or");}," ",["a",{href:function(){return MF.user.url;}}," ",["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]," "]," "]," "]]);(function(){var A={};this.setDirty=function(C){var B=C.siteId;A[B]=C;};this.post=function(D){D=$(D);var E=D.parents("form");var F=MF.Forms.getFormData(E);var C=new Array();for(var B in A){if(A.hasOwnProperty(B)){C.push(A[B]);}}F.SiteSettings=C;if(!F.ProfileSettings){F.ProfileSettings={};}F.blogCommentOnComment=(F.blogCommentOnComment==="on");if(F.BlogSettings&&F.BlogSettings.SiteID>1){F.BlogSettings.IsCommentOnMemberContentNotificationEnabled=(F.BlogSettings.IsCommentOnMemberContentNotificationEnabled==="on");F.BlogSettings.IsCommentOnMemberCommentNotificationEnabled=false;F.BlogSettings.ContentNotificationIntervalType="None";F.BlogSettings.IsEventNotificationEnabled=false;C.push(F.BlogSettings);}F.ProfileSettings.NotifyForNewPrivateMessages=(F.ProfileSettings.NotifyForNewPrivateMessages==="on");F.ProfileSettings.NotifyForNewProfileNotes=(F.ProfileSettings.NotifyForNewProfileNotes==="on");MF.Profile.NotificationsService.saveSiteDetails(F.ProfileSettings,F.SiteSettings,F.blogCommentOnComment,{onSuccess:function(G){MF.Message.showInfo(E.parent(),"Success",MF.Message.Scope.Column,5000);}});};this.changeSite=function(){return function(){MF.Profile.NotificationsService.getSiteData(this.value,{onSuccess:function(B){$(".js-privacy").replaceWith(MF.Profile.SiteItem.bind(B));}});};};this.profileExplainations=[{title:"Profile activity notifications:",explaination:"All profile notifications are sent to your Account email address. Click the Account menu on the right to edit your Account email address."},{title:"Profile note notifications:",explaination:"Check this box to receive a notification email as soon as someone posts a new note to your profile page."},{title:"Private message notifications:",explaination:"Check this box to receive a notification email as soon as someone sends a new private message to your Inbox."}];this.blogExplainations=[{title:"Blog activity notifications:",explaination:"All blog notifications are sent to your Account email address. Click the Account menu on the right to edit your Account email address."},{title:"Blog activity notification preferences"},{title:"Comments and loves notifications:",explaination:"When someone comments on or loves your posts, know about it with an instant email notification."},{explaination:"You can also select to receive an immediate email notification when someone comments on posts you commented on or loved."}];this.groupExplainations=[{title:"Group activity notifications:",explaination:"All group notifications are sent to your Account email address. Click the Account menu on the right to edit your Account email address."},{explaination:"To select your preferences, choose the group in the dropdown menu and then select your notification preferences for that specific group.  Remember to click the 'Save' button when you are done."},{title:"Group activity notification preferences"},{title:"New content notifications:",explaination:"Always know about new group content by receiving a daily digest email of yesterday's activity."},{title:"Comments and loves notifications:",explaination:"When someone comments on or loves content you add to a group, know about it with an instant email notification. "},{explaination:"You can also select to receive an immediate email notification when someone comments on something you commented on or 'loved'."},{title:"Event reminders:",explaination:" For each group you belong to, receive a reminder email for all events. The reminder email will be sent to you one week before the event occurs."}];}).call(MF.Profile.Notifications);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.SiteItem=JsonML.BST(["fieldset",{"class":"privacy js-privacy"}," ",["p",{"class":"label"}," ",["strong",function(){return JsonFx.Lang.get("Global,NewContent");}]," "]," ",["p"," ",["label"," ",["input",{type:"checkbox",checked:function(){return this.data.ContentNotificationIntervalType==="Daily"?"checked":null;},defaultChecked:function(){return this.data.ContentNotificationIntervalType==="Daily"?"checked":null;},name:"ContentNotificationIntervalType",onclick:function(){return this.updateReceiveDigest(this.data);}}]," ",function(){return JsonFx.Lang.get("Global,DigestNotification");}," "]," "]," ",["br"]," ",["p",{"class":"label"}," ",["strong",function(){return JsonFx.Lang.get("Global,Comments");}," & ",function(){return JsonFx.Lang.get("Global,Favorites");}]," "]," ",["p"," ",["label"," ",["input",{type:"checkbox",checked:function(){return this.data.IsCommentOnMemberContentNotificationEnabled?"checked":null;},defaultChecked:function(){return this.data.IsCommentOnMemberContentNotificationEnabled?"checked":null;},name:"IsCommentOnMemberContentNotificationEnabled",onclick:function(){return this.updateMyContent(this.data);}}]," ",function(){return JsonFx.Lang.get("Global,MyContentNotification");}," "]," "]," ",["p"," ",["label"," ",["input",{type:"checkbox",checked:function(){return this.data.IsCommentOnMemberCommentNotificationEnabled?"checked":null;},defaultChecked:function(){return this.data.IsCommentOnMemberCommentNotificationEnabled?"checked":null;},name:"IsCommentOnMemberCommentNotificationEnabled",onclick:function(){return this.updateCommentedContent(this.data);}}]," ",function(){return JsonFx.Lang.get("Global,MyCommentsNotification");}," "]," "]," ",["br"]," ",["p",{"class":"label"}," ",["strong",function(){return JsonFx.Lang.get("Global,Events");}]," "]," ",["p"," ",["label"," ",["input",{type:"checkbox",checked:function(){return this.data.IsEventNotificationEnabled?"checked":null;},defaultChecked:function(){return this.data.IsEventNotificationEnabled?"checked":null;},name:"IsEventNotificationEnabled",onclick:function(){return this.updateEventSetting(this.data);}}]," ",function(){return JsonFx.Lang.get("Global,EventsNotification");}," "]," "]," ",["br"]," ",["input",{type:"hidden",name:"SiteID",value:function(){return this.data.siteId;}}]," "]);(function(){this.updateReceiveDigest=function(A){return function(){var B=this.checked?"Daily":"None";if(A.ContentNotificationIntervalType!=B){A.ContentNotificationIntervalType=B;MF.Profile.Notifications.setDirty(A);}};};this.updateMyContent=function(A){return function(){var B=this.checked;if(A.IsCommentOnMemberContentNotificationEnabled!=B){A.IsCommentOnMemberContentNotificationEnabled=B;MF.Profile.Notifications.setDirty(A);}};};this.updateCommentedContent=function(A){return function(){var B=this.checked;if(A.IsCommentOnMemberCommentNotificationEnabled!=B){A.IsCommentOnMemberCommentNotificationEnabled=B;MF.Profile.Notifications.setDirty(A);}};};this.updateEventSetting=function(A){return function(){var B=this.checked;if(A.IsEventNotificationEnabled!=B){A.IsEventNotificationEnabled=B;MF.Profile.Notifications.setDirty(A);}};};}).call(MF.Profile.SiteItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.NotificationsService=new JsonFx.IO.Service("/Features/ProfileSites/Notifications/NotificationsService.jrpc");MF.Profile.NotificationsService.getNotificationSettings=function(start,count,opt){this.invoke("getNotificationSettings",[start,count],opt);};MF.Profile.NotificationsService.saveSiteDetails=function(profileSettings,siteSettings,notifyBlogCommentOnComment,opt){this.invoke("saveSiteDetails",[profileSettings,siteSettings,notifyBlogCommentOnComment],opt);};MF.Profile.NotificationsService.getSiteData=function(siteId,opt){this.invoke("getSiteData",[siteId],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Subscriptions){MF.Subscriptions={};}MF.Subscriptions.List=JsonML.BST([""," ",function(){this.updatePaging(this.data);}," ",["div",{"class":"js-data"}," ",["div",{"class":"section-title"}," ",["h3",function(){return JsonFx.Lang.get("Global,SubscriptionTitle");}]," ",["p",{"class":"section-title-extra"}," ",function(){return this.data.total;}," group(s) total "]," "]," ",["table",{"class":"data subscriptions",cellpadding:"0",cellspacing:"0"}," ",["thead"," ",["tr"," ",["th",{"class":"name"},function(){return JsonFx.Lang.get("Global,SiteName");}]," ",["th",{"class":"dates",width:"25%"},function(){return JsonFx.Lang.get("Global,SubscriptionDetails");}]," ",["th",{"class":"dates",width:"25%"},function(){return JsonFx.Lang.get("Global,SubscriptionDates");}]," ",["th",{"class":"actions",width:"28%"},function(){return JsonFx.Lang.get("Global,Actions");}]," "]," "]," ",["tbody"," ",function(){return JsonML.BST(MF.Subscriptions.Item).dataBind(this.data.items,this.index,this.count);}," "]," "]," ",["p",{"class":"note"}," ",function(){return JsonFx.Lang.get("Global,SiteAdminExplaination");}," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,MF.Subscriptions.List.getSites),this.index,this.count);}," "]]);(function(){this.updatePaging=function(A){MF.Subscriptions.List.paging={start:A.start,count:A.count,total:A.total};return MF.Subscriptions.List.paging;};this.getSites=function(B,A){MF.Subscriptions.Service.getSites(B,A,{onSuccess:function(C){$(".js-data").replaceWith(MF.Subscriptions.List.bind(C));}});};this.removeMe=function(B,A,C){MF.Subscriptions.Service.removeMember(B,{onSuccess:function(D){if(D){$(A).parents("tr").hide("slow",function(){$(this).remove();});MF.Message.showInfo($(".js-data"),"Success. You have been removed from the group.",MF.Message.Scope.Column,3000);C();}}});};this.deleteSite=function(B,A,C){MF.Subscriptions.Service.deleteSite(B,{onSuccess:function(D){$(A).parents("tr").hide("slow",function(){$(this).remove();});C();}});};}).call(MF.Subscriptions.List);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Subscriptions){MF.Subscriptions={};}MF.Subscriptions.Item=JsonML.BST(["tr",{"class":function(){return(this.index%2>0)?"":"odd";}}," ",["td"," ",["strong"," ",["a",{href:function(){return this.data.siteUrl;}}," ",function(){return this.data.siteName;}," "]," "]," ",["img",{src:"/Images/publicsite.gif","jbst:visible":function(){return this.data.isPublic&&!this.data.isExpired;}}]," ",["img",{src:"/Images/expiredsite.gif","jbst:visible":function(){return this.data.isExpired;}}]," "]," ",["td"," ",["p"," ",["strong",function(){return JsonFx.Lang.get("Global,Subscription");},":"]," ",function(){return this.data.subscription;}," "]," ",["p",{"jbst:visible":function(){return this.data.groupSponsor!=="";}}," ",["strong",function(){return JsonFx.Lang.get("Global,Sponsor");},": ",["a",{href:function(){return this.data.groupSponsorUrl;}},function(){return this.data.groupSponsor;}]]," "]," "]," ",["td"," ",["p",{"jbst:visible":function(){return this.data.paidDate!=="";}}," ",["strong",function(){return JsonFx.Lang.get("Global,LastPayment");},":"]," ",function(){return this.data.paidDate;}," "]," ",["p",{"jbst:visible":function(){return this.data.renewalDate!=="";}}," ",["strong",function(){return JsonFx.Lang.get("Global,RenewsOn");},":"]," ",function(){return this.data.renewalDate;}," "]," ",["p",{"jbst:visible":function(){return this.data.status==="Cancelled";}},"(",function(){return JsonFx.Lang.get("Global,EndDate");},")"]," "]," ",["td"," ",["p",{"jbst:visible":function(){return false&&(MF.user.id===this.data.sponsorId)&&(this.data.status==="Active"||this.data.status==="Upgraded"||this.data.status==="Pending");}}," ",["a",{href:"#",onclick:function(){return MF.Subscriptions.Item.signInClosure(this.data.orderNumber,this.data.siteName);}}," ",function(){return JsonFx.Lang.get("Global,EditBillingInfo");}," "]," "]," ",["p",{"jbst:visible":function(){return(MF.user.id===this.data.sponsorId)&&(this.data.status==="Graced");}}," ",["a",{href:"#","class":"deny",onclick:function(){return MF.Subscriptions.Item.signInClosure(this.data.orderNumber,this.data.siteName);}}," ",function(){return JsonFx.Lang.get("Global,UpdateBillingInfo");}," "]," "]," ",["p",{"jbst:visible":function(){return this.showUpgradeLink(this.data);}}," ",["a",{href:function(){return this.data.upgradeUrl;},onclick:"MF.Tracking.upgradeBtn();"}," ",function(){return JsonFx.Lang.get("Global,UpgradeSite");}," "]," "]," ",["a",{href:"#remove",onclick:function(){return MF.Subscriptions.Item.removeMeClosure(this.data);}}," ",function(){return JsonFx.Lang.get("Global,RemoveMe");}," "]," "]," "]);(function(){this.signInClosure=function(A,B){return function(){var C=MF.Subscriptions.VerifyUserDialog.bind({orderNumber:A,siteName:B});if(C){document.body.appendChild(C);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}return false;};};this.removeMeClosure=function(A){return function(){var B;if(A.isAdmin&&A.isExpired){B=MF.Subscriptions.ExpiredSiteDialog.bind({id:A.siteId,elem:this,message:"You can remove yourself from the group or you can remove yourself from the group and delete the group as well.",removeMeCallback:MF.Subscriptions.List.removeMe,deleteCallback:MF.Subscriptions.List.deleteSite,ok:"Leave group",cancel:"don't leave",title:"Leave group"});}else{if(!A.isLastAdmin){B=MF.Dialogs.ConfirmDeleteDialog.bind({id:A.siteId,elem:this,message:"If you remove yourself from this group, you will no longer have access to it. Are you sure you want to remove yourself from this group?",callback:MF.Subscriptions.List.removeMe,ok:"Leave group",cancel:"don't leave",title:"Leave group"});}else{if(A.subscription==="Basic"||A.isDNA){B=MF.Dialogs.ConfirmDeleteDialog.bind({id:A.siteId,elem:this,message:"Because you are the only administrator of this group, removing yourself will delete the group entirely. Are you sure you want to delete this group?",callback:MF.Subscriptions.List.deleteSite,ok:"Delete group",cancel:"don't delete",title:"Delete group"});}else{B=MF.Dialogs.AlertDialog.bind({message:"Because you are the only administrator of this group, removing yourself will delete the group entirely. Please call our Customer Service team at 1-888-265-7491 if you would like to delete this group."});}}}if(B){document.body.appendChild(B);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}return false;};};this.showUpgradeLink=function(A){if(A.subscription==="Basic"){return true;}else{if(A.isExpired){return true;}else{if(A.status==="Cancelled"||A.status==="Expired"||A.status==="Hybernated"){return true;}else{return false;}}}};}).call(MF.Subscriptions.Item);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Subscriptions){MF.Subscriptions={};}MF.Subscriptions.Service=new JsonFx.IO.Service("/Features/ProfileSites/Subscriptions/SubscriptionsService.jrpc");MF.Subscriptions.Service.removeMember=function(siteId,opt){this.invoke("removeMember",[siteId],opt);};MF.Subscriptions.Service.getSites=function(start,count,opt){this.invoke("getSites",[start,count],opt);};MF.Subscriptions.Service.deleteSite=function(siteId,opt){this.invoke("deleteSite",[siteId],opt);};MF.Subscriptions.Service.authenticate=function(username,password,orderNumber,siteName,opt){this.invoke("authenticate",[username,password,orderNumber,siteName],opt);};MF.Subscriptions.Service.forgotPassword=function(opt){this.invoke("forgotPassword",null,opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Subscriptions){MF.Subscriptions={};}MF.Subscriptions.VerifyUserDialog=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind({height:275,width:350,modal:true,data:this.data},this.index,this.count,{$:[""," ",["form",{id:"SignIn","class":"js-EnableKeys",onsubmit:"return false"}," ",["div",{"class":"box signin js-container"}," ",["h3","Verify your account information"]," ",["p","Please confirm your password to view/edit your billing information"]," ",["label",{"class":"js-error","for":"user"},function(){return JsonFx.Lang.get("Global,Username");},":"]," ",function(){return MF.user.username;}," ",["label",{"for":"pass","class":"password"},function(){return JsonFx.Lang.get("Global,Password");},":"]," ",["input",{name:"pass",id:"password",tabindex:"2",type:"password",value:"","jbst:onload":"this.focus();"}]," ",["p",{"class":"submit"}," ",["input",{type:"submit","class":"js-EnterKeyTarget",tabindex:"4",onclick:function(){return MF.Subscriptions.VerifyUserDialog.authenticateClosure(this.data.orderNumber,this.data.siteName);},value:"Sign in"}]," or ",["a",{href:"#cancel",onclick:function(){return MF.Dialog.remove;}},["strong","cancel"]]," "]," ",["p",{"class":"instruct"}," Forgot your password? ",["a",{href:"#",onclick:"MF.Subscriptions.VerifyUserDialog.forgotPassword();return false;"},"Click here"]," and we'll send you an email containing instructions on how to reset it. "]," "]," "]," "]});});(function(){function A(){return $("#SignIn")[0];}this.getFormData=function(){var B=MF.Forms.getFormData(A());return B;};this.authenticateClosure=function(B,C){return function(){var D=A();if(!D){throw new Error("Cannot find SignIn form");}var E=$(".js-error");var F=MF.Subscriptions.VerifyUserDialog.getFormData();MF.Message.clear(E,MF.Message.Scope.Inline);if(!F.pass){MF.Message.showError(E,"Please enter your Password.",MF.Message.Scope.Inline);return false;}MF.Forms.disableSubmit(D);MF.Subscriptions.Service.authenticate(MF.user.username,F.pass,B,C,{onSuccess:function(G){if(G.ok){var H=MF.Subscriptions.BillingInfo.bind({info:G.info,posUrl:G.posUrl});$(document.body).append(H);MF.Subscriptions.BillingInfo.submitForm();}else{MF.Message.showError(E,"We couldn't find this username and password combination. Are you sure it was typed correctly?",MF.Message.Scope.Inline);MF.Forms.reset(D);$("#password").focus();}},onFailure:function(G){MF.Message.showError(E,"We couldn't find this username and password combination. Are you sure it was typed correctly?",MF.Message.Scope.Inline);MF.Forms.reset(D);$("#password").focus();},onComplete:function(){MF.Forms.enableSubmit(D);}});return false;};};this.reset=function(){MF.Forms.reset(A());};this.forgotPassword=function(){MF.Subscriptions.Service.forgotPassword({onSuccess:function(B){MF.Dialog.remove();MF.Message.showInfo($(".js-data"),"We just sent a message to "+B+" with your username and a link to a page where you can reset your password. For security reasons, the link will expire in 12 hours, so please check your email now.",MF.Message.Scope.Column);}});};}).call(MF.Subscriptions.VerifyUserDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Subscriptions){MF.Subscriptions={};}MF.Subscriptions.BillingInfo=JsonML.BST(["form",{"class":"js-BillingInfoForm",action:function(){return this.data.posUrl;},method:"post"}," ",["input",{type:"hidden",value:function(){return this.data.info;},name:"POSData"}]," "]);(function(){this.submitForm=function(){$(".js-BillingInfoForm").submit();};}).call(MF.Subscriptions.BillingInfo);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Subscriptions){MF.Subscriptions={};}MF.Subscriptions.ExpiredSiteDialog=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind({height:125,width:460,modal:false,data:this.data},this.index,this.count,{$:[""," ",["h2"," Leave group "]," ",["p"," You can remove yourself from the group or you can remove yourself from the group and delete the group as well. "]," ",["p",{"class":"submit removegroup"}," ",["a",{"class":"positive",onclick:function(){return MF.Subscriptions.ExpiredSiteDialog.leave(this.data.id,this.data.elem,this.data.removeMeCallback);}}," Remove me only "]," ",["a",{"class":"positive",onclick:function(){return MF.Subscriptions.ExpiredSiteDialog.leave(this.data.id,this.data.elem,this.data.deleteCallback);}}," Remove me and delete the group "]," or ",["a",{href:"#cancel",onclick:function(){return MF.Dialog.remove;}},["strong","cancel"]]," "]," "]});});(function(){this.leave=function(B,A,C){return function(){if(this.disabled){return false;}this.disabled=true;C(B,A,MF.Dialog.remove);return false;};};}).call(MF.Subscriptions.ExpiredSiteDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.SelectSitesDialog=JsonML.BST([""," ",function(){this.resetState();}," ",function(){return JsonML.BST(MF.Dialog).dataBind({maxHeight:555,width:920,modal:false,data:this.data},this.index,this.count,{$:[""," ",["div",{"class":"members choose"}," ",["h2","Choose group"]," ",["ul",{"class":"alpha"}," ",["li",["a",{"jbst:onload":function(){return MF.Profile.SelectSitesDialog.filterByAll(this.data.count);},onclick:function(){return MF.Profile.SelectSitesDialog.filterByAll(this.data.count);},"class":"first active js-filter",href:"#filter"},"All"]]," ",["li",["a",{id:"selectedCount",onclick:function(){return MF.Profile.SelectSitesDialog.filterBySelected;},"class":"last js-filter",href:"#filter"},"Selected(",function(){return MF.Profile.SelectSitesDialog.getSelectedCount();},")"]]," "]," ",["div",{"class":"box js-results"}," ",["p",{"class":"no-content"},"Loading..."]," "]," ",["p",{"class":"submit"},["a",{onclick:"MF.Profile.SelectSitesDialog.done();return false;","class":"positive"},"Send invitation"]," or ",["a",{onclick:"MF.Dialog.remove();return false;",href:"#cancel"},"cancel"]]," "]," "]});}," "]);(function(){var B=null;var C=D;var A=0;this.show=function(E,F){return function(){if("undefined"===typeof E){B={};}else{B=E;}if("undefined"!==typeof F){C=F;}var G=MF.Profile.SelectSitesDialog.bind({items:[],selected:B});if(G){document.body.appendChild(G);}if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}return false;};};this.done=function(){MF.Dialog.remove();C(MF.Profile.SelectSitesDialog.getSelectedSites());};this.filterSites=function(F,E){MF.Profile.SitesService.getInvitableSites(F,E,{onSuccess:function(G){G=MF.Profile.SelectSitesResults.bind(G);$("div.js-results").replaceWith(G);}});};this.filterByAll=function(E){return function(){$("a.js-filter").removeClass("active");$(this).addClass("active");MF.Profile.SelectSitesDialog.filterSites(0,E);return false;};};this.filterBySelected=function(){$("a.js-filter").removeClass("active");$(this).addClass("active");var F=MF.Profile.SelectSitesDialog.getSelectedSites();var E=MF.Profile.SelectSitesResults.bind({start:0,items:F,total:1});$("div.js-results").replaceWith(E);};this.pageSites=function(F,E){MF.Profile.SelectSitesDialog.filterSites(F,E);};this.setSelected=function(E){B=[];A=0;for(var F=0;F<E.length;F++){MF.Profile.SelectSitesDialog.addSelected(E[F]);}};this.toggleSelected=function(E){if(MF.Profile.SelectSitesDialog.isSelected(E)){MF.Profile.SelectSitesDialog.removeSelected(E);return false;}else{MF.Profile.SelectSitesDialog.addSelected(E);return true;}};this.addSelected=function(E){B[""+E.id]=E;A++;MF.Profile.SelectSitesDialog.updateSelectedCount();};this.removeSelected=function(E){B[""+E.id]=null;A--;MF.Profile.SelectSitesDialog.updateSelectedCount();};this.isSelected=function(E){return B[""+E.id]!=null&&B[""+E.id].id===E.id;};this.getSelectedSites=function(){var F=new Array();for(var E in B){if(B[E]!=null){F.push(B[E]);}}return F;};this.getSelectedCount=function(){return A;};this.updateSelectedCount=function(){var E=document.getElementById("selectedCount");if(E){E.innerHTML="Selected("+A+")";}};this.resetState=function(){if("undefined"!==typeof this.data.selected){this.setSelected(this.data.selected);}};function D(){alert("TODO: Specify a callback function when user clicks done");}}).call(MF.Profile.SelectSitesDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.SelectSitesResults=JsonML.BST([""," ",["div",{"class":"box js-results"}," ",["div",{"class":"contacts large js-moreresults",style:function(){return this.data.items.length>20?"height:350px;overflow:auto;":"";}}," ",function(){return JsonML.BST(MF.Profile.SelectSitesItem).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.Profile.SelectSitesDialog.pageSites),this.index,this.count);}," "],""," "]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Profile){MF.Profile={};}MF.Profile.SelectSitesItem=JsonML.BST(["div",{onclick:function(){return this.toggleSelected(this.data);},"class":function(){return"contact clearfix"+(MF.Profile.SelectSitesDialog.isSelected(this.data)?" selected":"");}},["img",{src:function(){return this.data.avatar;}}]," ",["p",["span",{"class":"name"},function(){return this.data.name;}]]]);(function(){this.toggleSelected=function(A){return function(){var B=MF.Profile.SelectSitesDialog.toggleSelected(A);$(this).toggleClass("selected");return false;};};}).call(MF.Profile.SelectSitesItem);}catch(ex){}