try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Message){MF.Message={};}MF.Message.Service=new JsonFx.IO.Service("/Features/MessageCenter/MessageService.jrpc");MF.Message.Service.deleteMessages=function(msgIDs,opt){this.invoke("deleteMessages",[msgIDs],opt);};MF.Message.Service.getMessage=function(messageID,start,count,opt){this.invoke("getMessage",[messageID,start,count],opt);};MF.Message.Service.getMessages=function(start,count,opt){this.invoke("getMessages",[start,count],opt);};MF.Message.Service.addReply=function(messageID,subject,message,opt){this.invoke("addReply",[messageID,subject,message],opt);};MF.Message.Service.sendMessage=function(recipientIDs,subject,message,opt){this.invoke("sendMessage",[recipientIDs,subject,message],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.PeopleService=new JsonFx.IO.Service("/Features/People/Services/PeopleService.jrpc");MF.People.PeopleService.getSites=function(start,count,opt){this.invoke("getSites",[start,count],opt);};MF.People.PeopleService.getUsers=function(userIDs,siteID,opt){this.invoke("getUsers",[userIDs,siteID],opt);};MF.People.PeopleService.findUsers=function(name,startIdx,siteID,opt){this.invoke("findUsers",[name,startIdx,siteID],opt);};MF.People.PeopleService.getMemberList=function(start,count,opt){this.invoke("getMemberList",[start,count],opt);};MF.People.PeopleService.inviteMember=function(firstName,lastName,emailAddress,opt){this.invoke("inviteMember",[firstName,lastName,emailAddress],opt);};MF.People.PeopleService.inviteMembers=function(invites,message,membershipLevel,isUniversal,opt){this.invoke("inviteMembers",[invites,message,membershipLevel,isUniversal],opt);};MF.People.PeopleService.getSiteMemberList=function(start,count,searchString,sortColIdx,sortAsc,opt){this.invoke("getSiteMemberList",[start,count,searchString,sortColIdx,sortAsc],opt);};MF.People.PeopleService.requestToJoin=function(opt){this.invoke("requestToJoin",null,opt);};MF.People.PeopleService.cancelRequest=function(requestID,opt){this.invoke("cancelRequest",[requestID],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.memberList=JsonML.BST([""," ",["div",{"class":"section-title"}," ",["h3",function(){return JsonFx.Lang.get("Global,MemberListTitle");}]," ",["p",{"class":"section-title-extra","jbst:visible":function(){return MF.People.Permissions.CanInvite;}}," ",["a",{"class":"add active",href:function(){return MF.People.InviteUrl;}},"Invite someone"]," "]," "]," ",["div",{"class":function(){return"contacts small js-MemberList"+(this.data.firstRun?" onemember":"");}}," ",function(){return JsonML.BST(MF.People.memberItem).dataBind(this.data.members,this.index,this.count);}," ",["p",{"class":"extra","jbst:visible":function(){return !this.data.firstRun&&(this.data.count<this.data.total);}}," ",["a",{href:function(){return MF.People.PeopleUrl;}},function(){return JsonFx.Lang.get("Global,MemberListMore");}]," "]," "]," "]);(function(){MF.People.memberList.init=function(C){var A=jQuery(".js-MemberList")[0];if(!A||!C){return;}var B=MF.People.memberItem.bind(C.members);if(B){JsonFx.UI.clear(A);A.appendChild(B);}};MF.People.memberList.reload=function(B,A){MF.People.PeopleService.getMemberList(B,A,{onSuccess:function(C){MF.People.memberList.init(C);}});};MF.People.memberList.loadInviteForm=function(){$(".js-MemberList").prepend(MF.People.MemberInviteForm.bind());};MF.People.memberList.removeInviteForm=function(){$(".js-InviteMembers").remove();};MF.People.memberList.toggleInviteForm=function(){if(jQuery(".js-InviteMembers").length>0){MF.People.memberList.removeInviteForm();}else{MF.People.memberList.loadInviteForm();}};}).call(MF.People.memberList);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.memberItem=JsonML.BST(["p"," ",["a",{href:function(){return this.data.url;}},["img",{src:function(){return this.data.avatar;},width:"32",height:"32"}]]," ",["span",{"class":"contain"}," ",["span",{"class":"meta"},["a",{href:function(){return this.data.url;}},function(){return this.data.name;}]," ",function(){return this.data.status;}]," ",["span",{"class":"extra"},function(){return this.data.visited.getFullYear()<1997?"Not yet visited":"Visited "+this.data.visited.toRelative(MF.ShortDateFormat);}]," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.MemberInviteForm=JsonML.BST([""," ",["div",{"class":"invite-members js-InviteMembers"}," ",["a",{href:"#","class":"negative",onclick:"MF.People.memberList.removeInviteForm();return false;"},"X"]," ",["p",{"class":"intro"},"To invite someone new, enter their email address below and hit send."]," ",["form",{id:"InviteForm",action:"#","class":"js-EnableKeys",onsubmit:"return false;"}," ",["fieldset"," ",["input",{type:"text","class":"text switch-value js-InlineInstruction",title:function(){return JsonFx.Lang.get("Global,Email");},name:"inviteEmail",validate:function(){return MF.Validation.create(MF.RegExp.Email,"Email doesn't look quite right.");},onchange:"this.validate();"}]," ",["p",{"class":"submit"}," ",["a",{"class":"positive js-EnterKeyTarget",href:"#",onclick:"MF.People.MemberInviteForm.inviteMember();return false;"},"Send invite"]," or ",["a",{href:function(){return MF.People.InviteUrl;},onclick:function(){return MF.People.MemberInviteForm.addMore();}},["strong","invite more people"]]," "]," "]," "]," "],""]);(function(){this.inviteMember=function(A){var B=$("#InviteForm")[0];if(!MF.Validation.validateForm(B)){return false;}var C=MF.Forms.getFormData(B);if(C.inviteEmail&&C.inviteEmail.length>0){MF.Forms.disableSubmit(B);MF.People.PeopleService.inviteMember("","",C.inviteEmail,{onSuccess:function(D){if(D){MF.Message.showInfo(B,"Invite sent!",MF.Message.Scope.Inline,3000);MF.Forms.reset(B);}else{MF.Message.showError(B,"Failure",MF.Message.Scope.Inline,3000);}},onComplete:function(){MF.Forms.enableSubmit(B);}});}};this.addMore=function(){return function(){var A=$(this);var B=A.parents("fieldset").children("input");if(B.is(".active")){window.location.href=A.attr("href")+"?email="+encodeURIComponent(B.val());return false;}else{return true;}};};}).call(MF.People.MemberInviteForm);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.MemberRow=JsonML.BST([""," ",function(){MF.People.MemberTable.counter++;}," ",["fieldset",{"class":"email js-email"}," ",["p"," ",["input",{"class":function(){return(MF.People.MemberTable.counter===1)?"text js-InlineInstruction js-FirstName":"text js-InlineInstruction";},type:"text",title:"First name",name:function(){return"Invite$"+(MF.People.MemberTable.counter-1)+"$FirstName";},value:function(){return this.data.FirstName;},onchange:"MF.People.MemberTable.markDirty(this)","jbst:onload":function(){return MF.People.MemberTable.focusFirstField;}}]," ",["input",{"class":"text js-InlineInstruction",type:"text",title:"Last name",name:function(){return"Invite$"+(MF.People.MemberTable.counter-1)+"$LastName";},value:function(){return this.data.LastName;},onchange:"MF.People.MemberTable.markDirty(this)"}]," ",["input",{"class":"text last js-InlineInstruction",type:"text",title:"Email address",name:function(){return"Invite$"+(MF.People.MemberTable.counter-1)+"$Email";},value:function(){return this.data.Email;},onchange:"MF.People.MemberTable.markDirty(this);this.validate();",validate:function(){return MF.Validation.create(MF.RegExp.Email,"Email doesn't look quite right.");}}]," ",["a",{"class":"del clone-remove js-remove",href:"#",onclick:"MF.People.MemberTable.removeEmail(this);return false;","jbst:visible":function(){return MF.People.MemberTable.counter!==1;},tabindex:"-1"},"Delete this email"]," "]," ",["input",{type:"hidden","class":"js-dirtyIndicator",value:function(){return(this.data.Email!=="").toString();}}]," "]]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.MemberTable=JsonML.BST([""," ",["div",{"class":"page-title"}," ",["h2","Invite people to this group"]," "]," ",["p","Use the form below to invite more people to your family site."]," ",["form",{action:"",method:"","class":"js-inviteForm"}," ",["div",{"class":"js-holder"}," ",function(){return JsonML.BST(MF.People.MemberRow).dataBind(this.data.inviteData,this.index,this.count);}," "]," ",["p",{"class":"actions js-actions"}," ",["a",{"class":"add cloner",href:"#",onclick:"MF.People.MemberTable.addEmail(this);return false;"},"Add More People"]," "]," ",["textarea",{id:"emailHolder",style:"display:none"}]," ",["fieldset"," ",["p"," ",["label","Message:"],["textarea",{"class":"message js-InlineInstruction js-counter",title:"Optional: your message",name:"Message",onkeyup:"MF.People.MemberTable.enforceMaxLength($(this));return false;"},function(){return this.data.messageDefault;}]," "]," "]," ",["div",{"class":"advanced js-advanced","jbst:visible":function(){return this.data.canCreateUniversalInvite;}}," ",["p"," ",["a",{href:"#",onclick:"MF.People.MemberTable.showAdvance(this);return false;"},"Advanced options"]," "]," "]," ",["div",{"class":"advancedOptions box js-advancedOptions","jbst:visible":function(){return this.data.canCreateUniversalInvite;},style:"display:none"}," ",["p",{"class":"inviteAs"}," Invite these people as ",["select",{name:"MembershipLevel"}," ",["option",{value:"Member"},"Members"]," ",["option",{value:"Admin"},"Administrators"]," ",["option",{value:"Guest"},"Limited Members"]," "]," ",function(){return JsonML.BST(MF.Messaging.WhatsThis).dataBind({message:MF.People.MemberTable.roleExplaination},this.index,this.count);}," "]," ",["p",{"jbst:visible":function(){return false;}}," ",["input",{type:"checkbox",name:"Universal"}]," Make these invites universal? ",function(){return JsonML.BST(MF.Messaging.WhatsThis).dataBind({message:MF.People.MemberTable.universalExplaination},this.index,this.count);}," "]," "]," ",["p",{"class":"submit"}," ",["a",{"class":"positive",href:"#",onclick:"MF.People.MemberTable.post(jQuery(this).parents('form'));return false;"},"Send invites"]," or ",["a",{href:function(){return this.data.cancelUrl;}}," ",["strong","cancel"]," "]," "]," "]]);(function(){this.maxLength=250;this.showAdvance=function(A){A=jQuery(A);if(A.toggleClass("active").is(".active")){$(".js-advancedOptions").show();}else{$(".js-advancedOptions").hide();}};this.removeEmail=function(A){jQuery(A).parents(".js-email").remove();};this.addEmail=function(C){var B=$(".js-email").length;if(B<MF.People.inviteLimit){var A=[{Email:""},{Email:""},{Email:""}];if(A.length>MF.People.inviteLimit-B){A=A.slice(0,MF.People.inviteLimit-B);}$(".js-holder").append(MF.People.MemberRow.bind(A));}};this.post=function(C){data=MF.Forms.getFormData(C);data.Universal=(data.Universal==="on");if(!data.MembershipLevel){data.MembershipLevel="Member";}var B="";for(var D=0;D<data.Invite.length;D++){if((data.Invite[D].FirstName||data.Invite[D].LastName)&&!data.Invite[D].Email){B=B+(data.Invite[D].FirstName||"");if(data.Invite[D].FirstName&&data.Invite[D].LastName){B+=" "+data.Invite[D].LastName;}else{if(data.Invite[D].LastName){B+=data.Invite[D].LastName;}}if(D<data.Invite.length-1){B=B+", ";}}}if(B.length>0){MF.Message.showError(C,"You must enter an email address for the following people: "+B,MF.Message.Scope.Column);return false;}var A=data.Invite.length-MF.People.inviteLimit;if(A>0){MF.Message.showError(C,"You have exceeded the maximum number of invites. Please remove "+A+" emails.",MF.Message.Scope.Column,3000);return;}MF.People.PeopleService.inviteMembers(data.Invite,data.Message,data.MembershipLevel,data.Universal,{onSuccess:function(F){MF.People.MemberTable.counter=0;var E=[{Email:""},{Email:""},{Email:""}];$(".js-holder").empty().append(MF.People.MemberRow.bind(E));MF.Message.showInfo(C,"Invite(s) sent",MF.Message.Scope.Page,3000);},onFailure:function(G,E,F){MF.Message.showError(C,"Unsucessful",MF.Message.Scope.Page,3000);}});};this.counter=0;this.showPlaxo=function(){showPlaxoABChooser("emailHolder",MF.People.chooserUrl);};this.formatEmailsFromPlaxo=function(F){var B=[];var A=[];var C=$(".js-email").length;for(var D=0;D<F.length;D++){A=F[D][0].split(" ");B[D]={FirstName:A[0],LastName:A[1],Email:F[D][1],isDirty:true};A=[];}$("fieldset.js-email").each(function(){if($(this).children("input.js-dirtyIndicator").val()==="false"){if($(this).children("p").children(".js-remove").length===0){B[0].showDelete=false;}$(this).remove();}});$(".js-holder").append(MF.People.MemberRow.bind(B.slice(0,MF.People.inviteLimit-C),C));if(MF.People.inviteLimit<(B.length+C)){var E=MF.Dialogs.AlertDialog.bind({message:"Limit reached."});if(E){document.body.appendChild(E);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}}};this.markDirty=function(A){$(A).parents("fieldset.js-email").children(".js-dirtyIndicator").val("true");};this.focusFirstField=function(){var A=$(this);if(A.is(".js-FirstName")){A.focus();}};this.roleExplaination=[{explaination:"This drop-down menu lets you select the 'Membership Type' of the people you are inviting. Here are the differences between the three types:"},{title:"Administrators:",explaination:"Have permission to add/delete anything on the group, invite or remove members, and change group settings."},{title:"Members:",explaination:"Have permission to add content to the group, comment on anything and invite other members (by default)."},{title:"Limited Members:",explaination:"Have permission to comment on anything (by default), but cannot add content or invite anyone."},{explaination:"You can edit membership settings and change the membership types of existing users by clicking on the Memberships tab under Group Settings."}];this.universalExplaination=[{explaination:"Universal invitations can be accepted an unlimited number of times (normal invitations can be accepted only once)."},{explaination:"Check this box if you want to allow recipients of your invitations to forward those invitations on to others, so that they can also join this group."}];this.enforceMaxLength=function(A){if(A.val().length>=this.maxLength){A.val(A.val().substr(0,this.maxLength));}};}).call(MF.People.MemberTable);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Toolbars){MF.Toolbars={};}MF.Toolbars.FilterMember=JsonML.BST(["form",{onsubmit:function(){return this.data.filterClicked(this.data);}}," ",["p",{"class":"filter"}," ",["input",{id:"filterText",name:"filter",type:"text","class":"text switch-value js-InlineInstruction js-EnableKeys",title:function(){return this.data.helpText;},value:function(){return this.data.currentFilter;}}]," "]," ",["p",{"class":"add"}," ",["a",{onclick:function(){return this.data.filterClicked(this.data);}},function(){return this.data.name;}]," "]," "]);(function(){this.Filter=function(A,B,C){this.name=B;this.helpText=A;this.type="input";this.jbst=MF.Toolbars.FilterMember;this.callback=C;this.currentFilter=MF.getQueryParam("t",true,"");this.filterClicked=function(D){return function(){var E=$("#filterText").val();if(E!==D.helpText&&E!==D.currentFilter){D.callback(E);}return false;};};};}).call(MF.Toolbars.FilterMember);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.List=JsonML.BST([""," ",function(){this.searchString=this.data.searchString;}," ",["div",{"class":"js-memberlist"}," ",function(){return JsonML.BST(MF.Toolbars.FilterBar).dataBind(MF.People.List.getSortBarData(this.data),this.index,this.count);}," ",["ul",{"class":"alpha"}," ",["li",["a",{"class":function(){return(this.data.searchString==="")?"first active":"first";},href:"#all",onclick:function(){return MF.People.List.filterBy("");}},"All"]]," ",["li",["a",{href:"#a",onclick:function(){return MF.People.List.filterBy("a");},"class":function(){return(this.data.searchString==="a")?"active":"";}},"A"]]," ",["li",["a",{href:"#b",onclick:function(){return MF.People.List.filterBy("b");},"class":function(){return(this.data.searchString==="b")?"active":"";}},"B"]]," ",["li",["a",{href:"#c",onclick:function(){return MF.People.List.filterBy("c");},"class":function(){return(this.data.searchString==="c")?"active":"";}},"C"]]," ",["li",["a",{href:"#d",onclick:function(){return MF.People.List.filterBy("d");},"class":function(){return(this.data.searchString==="d")?"active":"";}},"D"]]," ",["li",["a",{href:"#e",onclick:function(){return MF.People.List.filterBy("e");},"class":function(){return(this.data.searchString==="e")?"active":"";}},"E"]]," ",["li",["a",{href:"#f",onclick:function(){return MF.People.List.filterBy("f");},"class":function(){return(this.data.searchString==="f")?"active":"";}},"F"]]," ",["li",["a",{href:"#g",onclick:function(){return MF.People.List.filterBy("g");},"class":function(){return(this.data.searchString==="g")?"active":"";}},"G"]]," ",["li",["a",{href:"#h",onclick:function(){return MF.People.List.filterBy("h");},"class":function(){return(this.data.searchString==="h")?"active":"";}},"H"]]," ",["li",["a",{href:"#i",onclick:function(){return MF.People.List.filterBy("i");},"class":function(){return(this.data.searchString==="i")?"active":"";}},"I"]]," ",["li",["a",{href:"#j",onclick:function(){return MF.People.List.filterBy("j");},"class":function(){return(this.data.searchString==="j")?"active":"";}},"J"]]," ",["li",["a",{href:"#k",onclick:function(){return MF.People.List.filterBy("k");},"class":function(){return(this.data.searchString==="k")?"active":"";}},"K"]]," ",["li",["a",{href:"#l",onclick:function(){return MF.People.List.filterBy("l");},"class":function(){return(this.data.searchString==="l")?"active":"";}},"L"]]," ",["li",["a",{href:"#m",onclick:function(){return MF.People.List.filterBy("m");},"class":function(){return(this.data.searchString==="m")?"active":"";}},"M"]]," ",["li",["a",{href:"#n",onclick:function(){return MF.People.List.filterBy("n");},"class":function(){return(this.data.searchString==="n")?"active":"";}},"N"]]," ",["li",["a",{href:"#o",onclick:function(){return MF.People.List.filterBy("o");},"class":function(){return(this.data.searchString==="o")?"active":"";}},"O"]]," ",["li",["a",{href:"#p",onclick:function(){return MF.People.List.filterBy("p");},"class":function(){return(this.data.searchString==="p")?"active":"";}},"P"]]," ",["li",["a",{href:"#q",onclick:function(){return MF.People.List.filterBy("q");},"class":function(){return(this.data.searchString==="q")?"active":"";}},"Q"]]," ",["li",["a",{href:"#r",onclick:function(){return MF.People.List.filterBy("r");},"class":function(){return(this.data.searchString==="r")?"active":"";}},"R"]]," ",["li",["a",{href:"#s",onclick:function(){return MF.People.List.filterBy("s");},"class":function(){return(this.data.searchString==="s")?"active":"";}},"S"]]," ",["li",["a",{href:"#t",onclick:function(){return MF.People.List.filterBy("t");},"class":function(){return(this.data.searchString==="t")?"active":"";}},"T"]]," ",["li",["a",{href:"#u",onclick:function(){return MF.People.List.filterBy("u");},"class":function(){return(this.data.searchString==="u")?"active":"";}},"U"]]," ",["li",["a",{href:"#v",onclick:function(){return MF.People.List.filterBy("v");},"class":function(){return(this.data.searchString==="v")?"active":"";}},"V"]]," ",["li",["a",{href:"#w",onclick:function(){return MF.People.List.filterBy("w");},"class":function(){return(this.data.searchString==="w")?"active":"";}},"W"]]," ",["li",["a",{href:"#x",onclick:function(){return MF.People.List.filterBy("x");},"class":function(){return(this.data.searchString==="x")?"active":"";}},"X"]]," ",["li",["a",{href:"#y",onclick:function(){return MF.People.List.filterBy("y");},"class":function(){return(this.data.searchString==="y")?"active":"";}},"Y"]]," ",["li",["a",{href:"#z",onclick:function(){return MF.People.List.filterBy("z");},"class":function(){return(this.data.searchString==="z")?"active":"";}},"Z"]]," "]," ",["table",{cellpadding:"0",cellspacing:"0","class":"memberslist"}," ",function(){return JsonML.BST(this.data.isAnonymous?MF.People.ListBasicItem:MF.People.ListItem).dataBind(this.data.memberData,this.index,this.count);}," "]," ",["div",{"class":function(){return"members-empty"+(this.data.canInvite?"":" nopermission");},"jbst:visible":function(){return this.data.total===0;}}," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,MF.People.List.getMembers),this.index,this.count);}," "]]);(function(){this.searchString="";function D(H){MF.People.List.searchString=H;MF.People.List.getMembers(0,false);}this.filterBy=function(H){return function(){MF.People.List.searchString=H;MF.People.List.getMembers(0);return false;};};this.getMembers=function(J,H){var K="";if(J!==0){K+="?start="+J;}var I=MF.People.List.searchString;if(I.length>0){if(K.length===0){K="?";}else{K+="&";}K+="t="+I;}window.location.href=window.location.pathname+K;};this.memberExplainations=[{title:"Members:",explaination:"This list shows everyone who is a member of the group. The information displayed here depends on the information members have entered into their profile details and their selected profile privacy settings for this group."}];this.whatsThisData={message:MF.People.List.memberExplainations};function E(K,H,J){if(J.selectedIdx===H){K.asc=!K.asc;}var I=MF.getQueryParam("start",true,0);MF.People.PeopleService.getSiteMemberList(I,A,MF.People.List.searchString,H,K.asc,{onSuccess:function(L){$(".js-memberlist").replaceWith(MF.People.List.bind(L));}});return true;}var C=null;var B=new MF.Toolbars.FilterBarMenu.Menu("Sort",[{label:"Alphabetically",asc:true},{label:"Visited",asc:false},{label:"Date joined",asc:false}],E);var G=new MF.Toolbars.FilterMember.Filter("Enter Name...","Filter",D);var F=false;var A;this.getSortBarData=function(H){if(!F){if(H.canInvite){C=new MF.Toolbars.FilterBarButton.Button("Invite more people",H.inviteUrl);}B.setSelection(H.sortData.colIdx).asc=H.sortData.asc;A=H.count;F=true;}return{items:[C,B,G]};};}).call(MF.People.List);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.ListItem=JsonML.BST(["tr"," ",["td",{"class":"mlperson"}," ",["div",{"class":"contacts large item-meta"}," ",["p",["a",{href:function(){return this.data.url;},title:""},["img",{src:function(){return this.data.avatar;},alt:""}]]," ",["span",{"class":"contain"}," ",["span",{"class":"name"},["a",{href:function(){return this.data.url;},title:""},function(){return this.data.name;}]," ",["img",{src:"/Images/admin.gif","jbst:visible":function(){return this.data.isAdmin;}}]]," ",["span",{"class":"dates"},["em","Visited:"]," ",function(){return this.data.visited.getFullYear()<1997?"Not yet visited":this.data.visited.toRelative(MF.ShortDateFormat);}]," ",["span",{"class":"dates"},["em","Joined:"]," ",function(){return this.data.joined.toRelative(MF.ShortDateFormat);}]," ",["span",{"class":"meta","jbst:visible":function(){return(this.data.birthday.length>0);}},["em","Birthday:"]," ",function(){return this.data.birthday;}]," "]," "]," "]," ",""," "]," ",["td",{"class":"mladdress"}," ",["div",{"class":"module meta"}," ",["dl"," ",function(){return JsonML.BST(MF.People.ListDataItem).dataBind(this.data.addresses,this.index,this.count);}," "]," "]," "]," ",["td",{"class":"mlcontact"}," ",["div",{"class":"module meta"}," ",["dl"," ",function(){return JsonML.BST(MF.People.ListDataItem).dataBind(this.data.email,this.index,this.count);}," ",function(){return JsonML.BST(MF.People.ListDataItem).dataBind(this.data.phone,this.index,this.count);}," "]," "]," "],"\n"]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.ListDataItem=JsonML.BST([""," ",["dt",function(){return this.data.label;},":"]," ",["dd",{"jbst:visible":function(){return(this.data.url.length<=0);}}," ",function(){return JsonML.raw(this.data.item);}," "]," ",["dd",{"jbst:visible":function(){return(this.data.url.length>0);}}," ",["a",{href:function(){return this.data.url;}}," ",function(){return this.data.item;}," "]," "]]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.ListBasicItem=JsonML.BST(["tr"," ",["td",{"class":"mlperson"}," ",["div",{"class":"contacts large item-meta"}," ",["p",["a",{href:function(){return this.data.url;},title:""},["img",{src:function(){return this.data.avatar;},alt:""}]]," ",["span",{"class":"contain"}," ",["span",{"class":"name"},["a",{href:function(){return this.data.url;},title:""},function(){return this.data.name;}]," ",["img",{src:"/Images/admin.gif","jbst:visible":function(){return this.data.isAdmin;}}]]," ",["span",{"class":"dates"},["em","Visited:"]," ",function(){return this.data.visited.toRelative(MF.ShortDateFormat);}]," ",["span",{"class":"dates"},["em","Joined:"]," ",function(){return this.data.joined.toRelative(MF.ShortDateFormat);}]," "]," "]," "]," ",""," "],"\n"]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.UserBadge=JsonML.BST(["div",{"class":"contacts large item-meta"}," ",["p",["a",{href:function(){return this.data.url;},title:""},["img",{src:function(){return this.data.avatar;},alt:"Author's Picture"}]]," ",["span",{"class":"name"},["a",{href:function(){return this.data.url;}},function(){return this.data.authorName;}]]," ",["span",{"class":"detail"}," ",function(){return this.data.publishText;}," ",["em",{"jbst:visible":function(){return this.data.publishText2.length>0;}}," \u2022 "]," ",["a",{href:function(){return this.data.origDateSearchUrl;},"jbst:visible":function(){return this.data.publishText2.length>0;}},function(){return this.data.publishText2;}]," "]," ",["span",{"class":"meta","jbst:visible":function(){return this.data.viewCount>=0;}},function(){return this.data.viewCount;}," views \u2022 ",["a",{href:"#comments"},function(){return this.data.commentCount;}," comments"]]," ",["span",{"jbst:visible":function(){return this.data.contentId>0;},"class":"single-edit"},["a",{onclick:function(){return this.onClickEdit(this.data.contentId,this.data.editCallback);},href:"#"},"Edit"]," or ",["a",{href:"#",onclick:function(){return this.onClickDelete(this.data.overrideDelete,this.data.contentId,this.data.deleteCallback,this.data.ok,this.data.cancel,this.data.title);}},"delete"]]]," "]);(function(){this.onClickEdit=function(B,A){return function(){if("function"===typeof A){A(B,this);}return false;};};this.onClickDelete=function(F,E,A,B,D,C){if(F){if("function"===typeof A){return A(E);}}else{return MF.Dialogs.ConfirmDeleteDialog.confirm(E,A,B,D,C);}};}).call(MF.People.UserBadge);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.CreateRequest=JsonML.BST(["div",{"class":"container js-rtjcontainer"}," ",["div",{"class":"box shared public"}," ",["p"," ",["strong",function(){return this.data.siteName;}]," is a ",function(){return this.data.privacyText;}," family group on ",["a",{href:function(){return this.data.mfUrl;}},"myfamily.com"],". To add content or comment you must be a member. "]," ",["p",{"class":"sign-connect"},["a",{"class":"positive",href:"#request",onclick:function(){return this.request();}},"Request to join this group"]]," "]," "]);(function(){this.request=function(){return function(){MF.People.PeopleService.requestToJoin({onSuccess:function(A){if(A.signedOut||(A.request&&A.request.isMember)){window.location.href=A.url;}else{$(".js-rtjcontainer").replaceWith(MF.People.CancelRequest.bind(A.request));}}});};return false;};}).call(MF.People.CreateRequest);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.CancelRequest=JsonML.BST(["div",{"class":"container js-rtjcontainer"}," ",["div",{"class":"box shared public requested"}," ",["p"," ",["strong",function(){return this.data.siteName;}]," is a ",function(){return this.data.privacyText;}," family group on ",["a",{href:function(){return this.data.mfUrl;}},"myfamily.com"]," . You have requested to join this group. "]," ",["a",{"class":"positive",href:"#cancel",onclick:function(){return this.cancel(this.data);}},"Cancel request to join"]," "]," "]);(function(){this.cancel=function(A){return function(){MF.People.PeopleService.cancelRequest(A.requestID,{onSuccess:function(B){$(".js-rtjcontainer").replaceWith(MF.People.CreateRequest.bind(A));}});};return false;};}).call(MF.People.CancelRequest);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.SelectMembersDialog=JsonML.BST([""," ",function(){this.resetState();}," ",function(){return JsonML.BST(MF.Dialog).dataBind({maxHeight:485,width:920,modal:false,data:this.data},this.index,this.count,{$:[""," ",["div",{"class":"members choose"}," ",["h2",function(){return this.data.title||"Add recipients";}]," ",["p",{"class":"filter"}," ",["input",{id:"filterText",name:"filter",type:"text","class":"text switch-value js-InlineInstruction",onkeyup:"MF.People.SelectMembersDialog.filterTextChanged(this.value);return false;",title:"Filter...",value:""}]]," ",["p",{"class":"choose-group"}," ",["label","Show:"]," ",["select",{id:"siteSelect",onchange:function(){return MF.People.SelectMembersDialog.siteChanged;},name:"siteSelect","jbst:visible":function(){return MF.People.SelectMembersDialog.sites.length>0;}}," ",["option",{value:"0",selected:"selected"},"All Family Groups"]," ",function(){return JsonML.BST([""," ",["option",{on:"",value:function(){return this.data.id;}},function(){return this.data.name;}]," "]).dataBind(MF.People.SelectMembersDialog.sites,this.index,this.count);}," "]," "]," ",["ul",{"class":"alpha"}," ",["li",["a",{"jbst:onload":function(){return MF.People.SelectMembersDialog.filterBy("");},onclick:function(){return MF.People.SelectMembersDialog.filterBy("");},"class":"first active js-filter",href:"#filter"},"All"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("a");},"class":"js-filter",href:"#filter"},"A"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("b");},"class":"js-filter",href:"#filter"},"B"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("c");},"class":"js-filter",href:"#filter"},"C"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("d");},"class":"js-filter",href:"#filter"},"D"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("e");},"class":"js-filter",href:"#filter"},"E"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("f");},"class":"js-filter",href:"#filter"},"F"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("g");},"class":"js-filter",href:"#filter"},"G"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("h");},"class":"js-filter",href:"#filter"},"H"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("i");},"class":"js-filter",href:"#filter"},"I"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("j");},"class":"js-filter",href:"#filter"},"J"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("k");},"class":"js-filter",href:"#filter"},"K"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("l");},"class":"js-filter",href:"#filter"},"L"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("m");},"class":"js-filter",href:"#filter"},"M"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("n");},"class":"js-filter",href:"#filter"},"N"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("o");},"class":"js-filter",href:"#filter"},"O"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("p");},"class":"js-filter",href:"#filter"},"P"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("q");},"class":"js-filter",href:"#filter"},"Q"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("r");},"class":"js-filter",href:"#filter"},"R"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("s");},"class":"js-filter",href:"#filter"},"S"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("t");},"class":"js-filter",href:"#filter"},"T"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("u");},"class":"js-filter",href:"#filter"},"U"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("v");},"class":"js-filter",href:"#filter"},"V"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("w");},"class":"js-filter",href:"#filter"},"W"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("x");},"class":"js-filter",href:"#filter"},"X"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("y");},"class":"js-filter",href:"#filter"},"Y"]]," ",["li",["a",{onclick:function(){return MF.People.SelectMembersDialog.filterBy("z");},"class":"js-filter",href:"#filter"},"Z"]]," ",["li",["a",{id:"selectedCount",onclick:function(){return MF.People.SelectMembersDialog.filterBySelected;},"class":"last js-filter",href:"#filter"},"Selected(",function(){return MF.People.SelectMembersDialog.getSelectedCount();},")"]]," "]," ",["div",{"class":"box js-results"}," ",["p",{"class":"no-content"},"Loading..."]," "]," ",["p",{"class":"submit"},["a",{onclick:"MF.People.SelectMembersDialog.done();return false;","class":"positive"},"Done"]," or ",["a",{onclick:"MF.Dialog.remove();return false;",href:"#cancel"},"cancel"]]," "],""," "]});}," "]);(function(){var D=-10;var H="";var A={};var I=F;var B=-1;var C=0;var E=0;function G(J){var K=MF.People.SelectMembersDialog.bind({items:[],selected:A,title:J});if(K){document.body.appendChild(K);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}}this.sites=[];this.showForSite=function(K,L){E=MF.mfsid;I=L;var J="Select members";if(K&&K.length>0){MF.People.PeopleService.getUsers(K,E,{onSuccess:function(M){A=M.items;G(J);}});}else{G(J);}};this.showForBlog=function(K,L){E=D;I=L;var J="Select members";if(K&&K.length>0){MF.People.PeopleService.getUsers(K,E,{onSuccess:function(M){A=M.items;G(J);}});}else{G(J);}};this.show=function(J,K){if("undefined"===typeof J){A={};}else{A=J;}if("undefined"!==typeof K){I=K;}E=0;MF.People.PeopleService.getSites(0,100,{onSuccess:function(L){MF.People.SelectMembersDialog.sites=L.items;G();}});return false;};this.filterUsers=function(J,L,K){if(J===H&&B===L){return;}H=J;B=L;var M=document.getElementById("filterText");M.value=J;if(J.length===0&&K){M.focus();M.blur();}MF.People.PeopleService.findUsers(J,L,E,{onSuccess:function(N){if(H===J){N=MF.People.SelectMembersResults.bind(N);$("div.js-results").replaceWith(N);}}});};this.filterBy=function(J){return function(){$("a.js-filter").removeClass("active");$(this).addClass("active");MF.People.SelectMembersDialog.filterUsers(J,0,true);return false;};};this.filterBySelected=function(){H="-1";B=0;$("a.js-filter").removeClass("active");$(this).addClass("active");var J=MF.People.SelectMembersDialog.getSelectedUsers();var K=MF.People.SelectMembersResults.bind({start:0,items:J,total:1});$("div.js-results").replaceWith(K);};this.filterTextChanged=function(J){MF.People.SelectMembersDialog.filterUsers(J,0,false);};this.done=function(){B=-1;MF.Dialog.remove();I(MF.People.SelectMembersDialog.getSelectedUsers());};this.pageUsers=function(K,J){MF.People.SelectMembersDialog.filterUsers(H,K,true);};this.setSelected=function(J){A={};C=0;for(var K=0;K<J.length;K++){MF.People.SelectMembersDialog.addSelected(J[K]);}};this.toggleSelected=function(J){if(MF.People.SelectMembersDialog.isSelected(J)){MF.People.SelectMembersDialog.removeSelected(J);return false;}else{MF.People.SelectMembersDialog.addSelected(J);return true;}};this.addSelected=function(J){A[""+J.id]=J;C++;MF.People.SelectMembersDialog.updateSelectedCount();};this.removeSelected=function(J){A[""+J.id]=null;C--;MF.People.SelectMembersDialog.updateSelectedCount();};this.isSelected=function(J){return A[""+J.id]!=null&&A[""+J.id].id===J.id;};this.getSelectedUsers=function(){var K=new Array();for(var J in A){if(A[J]!=null){K.push(A[J]);}}return K;};this.getSelectedCount=function(){return C;};this.updateSelectedCount=function(){var J=document.getElementById("selectedCount");if(J){J.innerHTML="Selected("+C+")";}};this.resetState=function(){if("undefined"!==typeof this.data.selected){this.setSelected(this.data.selected);}H="";B=-1;};this.siteChanged=function(){E=Number(this.options[this.selectedIndex].value);B=-1;$("a.js-filter").removeClass("active");$("a.first").addClass("active");MF.People.SelectMembersDialog.filterUsers("",0,true);};function F(){alert("TODO: Specify a callback function when user clicks done");}}).call(MF.People.SelectMembersDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.SelectMembersResults=JsonML.BST([""," ",["div",{"class":"box js-results"}," ",["div",{"class":"contacts large js-moreresults",style:function(){return this.data.items.length>16?"height:280px;overflow:auto;":"";}}," ",function(){return JsonML.BST(MF.People.SelectMembersUser).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.People.SelectMembersDialog.pageUsers),this.index,this.count);}," "],""," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.People){MF.People={};}MF.People.SelectMembersUser=JsonML.BST(["div",{onclick:function(){return this.toggleSelected(this.data);},"class":function(){return"contact clearfix"+(MF.People.SelectMembersDialog.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.People.SelectMembersDialog.toggleSelected(A);$(this).toggleClass("selected");return false;};};}).call(MF.People.SelectMembersUser);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Message){MF.Message={};}MF.Message.MessageModule=JsonML.BST([""," ",function(){this.numMessages=this.data.items.length;this.initMessages(this.data.start,this.data.count);}," ",["div",{"class":"js-message"}," ",["div",{"class":"rightinfo","jbst:visible":function(){return this.numMessages>0;}},function(){return this.data.total;}," messages total, ",["strong",function(){return this.data.unread;}," new"]]," ",["div",{"class":"admin"}," ",["p",{"class":"add"},["a",{href:function(){return MF.Message.NewUrl;}},"Compose message"]]," ",["p",{"jbst:visible":function(){return this.numMessages>0;}},["a",{onclick:function(){return this.promptDelete;},href:"#delete"},"Delete selected"]]," "]," ",""," ",["table",{"class":"messages",cellpadding:"0",cellspacing:"0","jbst:visible":function(){return this.numMessages>0;}}," ",["thead"," ",["tr"," ",["th",{"class":"check"},["a",{onclick:function(){return this.toggleChecks;},href:"#toggle","class":"select-all-toggle"},"\u2714"]]," ",["th",{"class":"author"},"From"]," ",["th",{"class":"title"},"Message"]," ",["th",{"class":"date"},"Date"]," "]," "]," ",["tbody"," ",function(){return JsonML.BST(MF.Message.MessageItem).dataBind(this.data.items,this.index,this.count);}," "]," "],""," ",["div",{"class":"inbox-empty","jbst:visible":function(){return this.numMessages===0;}}," Your inbox is empty "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,MF.Message.MessageModule.getMessages),this.index,this.count);}," "]]);(function(){var D=0;var F=25;var C=[];function B(G){C.push(G);}function E(H){for(var G=0;G<C.length;G++){if(C[G]===H){C.splice(G,1);return;}}}function A(H){for(var G=0;G<C.length;G++){if(C[G]===H){return true;}}return false;}this.getMessages=function(H,G){if(H===0){window.location.href=MF.Message.ThisUrl;}else{window.location.href=MF.Message.ThisUrl+"?start="+H;}};this.toggleSelected=function(G){if(A(G)){E(G);}else{B(G);}};this.toggleChecks=function(){var G=$("#msg0");if(G){var H=!G.is(":checked");$("input[type=checkbox]").each(function(){var I=$(this);if(H){if(!I.is(":checked")){I.attr("checked","checked");var J=parseInt(I.attr("value"),10);B(J);}}else{if(I.is(":checked")){I.removeAttr("checked");var J=parseInt(I.attr("value"),10);E(J);}}});}return false;};this.doDelete=function(H,G,I){MF.Message.Service.deleteMessages(C,{onSuccess:function(J){I();var K=D;if(D>0&&(MF.Message.MessageModule.numMessages-C.length)<=0){K=Math.max(D-F,0);}MF.Message.MessageModule.getMessages(K,F);}});};this.promptDelete=function(){if(C.length===0){alert("Please select the message(s) you would like to delete.");}else{MF.Dialogs.ConfirmDeleteDialog.showDlg(0,this,"Are you sure you want to delete the "+C.length+" selected mail message(s) from your inbox? This cannot be undone.",MF.Message.MessageModule.doDelete,"Delete","don't delete","Delete message");}return false;};this.initMessages=function(H,G){F=G;D=H;};}).call(MF.Message.MessageModule);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Message){MF.Message={};}MF.Message.MessageItem=JsonML.BST(["tr",{"class":function(){return this.data.isNew?"new":"";}}," ",["td",{"class":"check"},["input",{id:function(){return"msg"+this.index;},onclick:function(){return MF.Message.MessageItem.toggleCheck(this.data.rootId);},type:"checkbox",name:function(){return"msg"+this.index;},value:function(){return this.data.rootId;}}]]," ",["td",{"class":"author"},["span",function(){return this.data.from;}]]," ",["td",{"class":"title"},["a",{href:function(){return this.data.url;}},function(){return this.data.subject;}]," ",function(){return this.data.message;}]," ",["td",{"class":"date"},function(){return this.data.date.toRelative(MF.ShortDateFormat);}]," "]);(function(){this.toggleCheck=function(A){return function(){MF.Message.MessageModule.toggleSelected(A);return true;};};}).call(MF.Message.MessageItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Message){MF.Message={};}MF.Message.CreateMessage=JsonML.BST([""," ",function(){this.setRecipients(this.data.selected);}," ",["form",{method:"post",id:"composeForm","class":"js-UnsavedData",title:"You haven't sent your message. Are you sure you want to leave this page?"}," ",["div",{"class":"members compose"}," ",["label",{"for":""},"To:"]," ",["div",{"class":"box"}," ",function(){return JsonML.BST(MF.Message.RecipientList).dataBind(this.data,this.index,this.count);}," ",["a",{id:"addRecipients",onclick:function(){return this.showAddMoreDlg;},href:"#addrecipients","class":"thickbox"},function(){return this.getRecipients().length>0?"Add more recipients":"Add recipients";}]," "]," ",["label",{"for":""},"Subject:"]," ",["input",{"class":"text active",type:"text",name:"subject",value:""}]," ",["label",{"for":""},"Message:"]," ",["textarea",{"class":"active js-expand",name:"message"}]," ",function(){return JsonML.BST(MF.Help.FormatGuide).dataBind(this.data,this.index,this.count);}," ",["p",{"class":"submit"}," ",["a",{"class":"positive",onclick:function(){return this.sendMessage;},href:""},function(){return JsonFx.Lang.get("Global,SendMessage");}]," or ",["a",{href:function(){return MF.Message.ReturnUrl;}},function(){return JsonFx.Lang.get("Global,Cancel");}]]," "]," "]]);(function(){var B=[];function A(){var C=[];for(var D=0;D<B.length;D++){C.push(B[D].id);}return C;}this.sendMessage=function(){var C=$("#composeForm")[0];MF.Message.clear(C,MF.Message.Scope.Column);var D=MF.Forms.getFormData(C);if(B.length===0){MF.Message.showError(C,"Please add recipients.",MF.Message.Scope.Column,30000);return false;}if(!D.subject){MF.Message.showError(C,"Please enter a subject.",MF.Message.Scope.Column,10000);return false;}if(!D.message){MF.Message.showError(C,"Please enter a message.",MF.Message.Scope.Column,10000);return false;}MF.Forms.disableSubmit(C);MF.Message.Service.sendMessage(A(),D.subject,D.message,{onSuccess:function(E){if(C.markClean){C.markClean();}window.location.pathname=E.url;},onComplete:function(){MF.Forms.enableSubmit(C);}});return false;};this.getRecipients=function(){return B;};this.setRecipients=function(D){B=D;var C=document.getElementById("addRecipients");if(C!=null){document.getElementById("addRecipients").innerHTML=B.length===0?"Add recipients":"Add more recipients";}};this.removeRecipient=function(D){for(var C=0;C<B.length;C++){if(B[C].id===D.id){B.splice(C,1);}}};this.setRecipientsCallback=function(C){MF.Message.CreateMessage.setRecipients(C);var D=MF.Message.RecipientList.bind({start:0,selected:B,total:B.length});$("div.js-recipients").replaceWith(D);};this.showAddMoreDlg=function(){MF.Message.clear(document.forms[0],MF.Message.Scope.Column);MF.People.SelectMembersDialog.show(B,MF.Message.CreateMessage.setRecipientsCallback);return false;};}).call(MF.Message.CreateMessage);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Message){MF.Message={};}MF.Message.RecipientList=JsonML.BST(["div",{"class":"contacts large js-recipients"}," ",function(){return JsonML.BST(MF.Message.Recipient).dataBind(this.data.selected,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Message){MF.Message={};}MF.Message.Recipient=JsonML.BST(["div",{"class":"contact clearfix js-arecipient"}," ",["img",{src:function(){return this.data.avatar;}}]," ",["p",["span",{"class":"name"},function(){return this.data.name;}]," ",["a",{onclick:function(){return this.deleteRecipient(this.data);},"class":"negative",href:"#delete"},"Delete Recipient"]]," "]);(function(){this.deleteRecipient=function(A){return function(){MF.Message.CreateMessage.removeRecipient(A);$(this).parents(".js-arecipient").hide("fast",function(){$(this).remove();});return false;};};}).call(MF.Message.Recipient);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Message){MF.Message={};}MF.Message.MessageDetailItem=JsonML.BST(["div",{"class":"comment-group"}," ",["a",{href:function(){return this.data.authorUrl;}},["img",{src:function(){return this.data.avatar;},width:"64",height:"64"}]]," ",["p",{"class":"comment-author"},["a",{href:function(){return this.data.authorUrl;}},function(){return this.data.isSelf?"You":this.data.author;}]," ",["span",{"class":"comment-meta"},"replied ",function(){return this.data.date.toRelative(MF.ShortDateFormat);}]]," ",["div",{"class":"comment-content"},function(){return JsonML.raw(this.data.message);}]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Message){MF.Message={};}MF.Message.MessageDetail=JsonML.BST([""," ",["p",{"class":"message error","jbst:visible":function(){return this.data.id===0;}},"This message is no longer available"]," ",["form",{id:"reply","class":"js-MessageDetail","jbst:visible":function(){return this.data.id!==0;}}," ",["div",{"class":"admin"}," ",["p",["a",{onclick:function(){return this.promptDelete(this.data.id);},href:"#delete"},"Delete this message"]]," "]," ",["div",{"class":"page-title"}," ",["h2",function(){return this.data.subject;}]," "]," ",["div",{"class":"notes js-ReplyList"}," ",["div",{"class":"comment-group"}," ",["a",{href:function(){return this.data.root.authorUrl;}},["img",{src:function(){return this.data.root.avatar;},width:"64",height:"64"}]]," ",["p",{"class":"comment-author"}," ",["span",{"jbst:visible":function(){return this.data.root.authorUrl.length===0;}},function(){return this.data.root.author;}]," ",["a",{"jbst:visible":function(){return this.data.root.authorUrl.length>0;},href:function(){return this.data.root.authorUrl;}},function(){return this.data.root.isSelf?"You":this.data.root.author;}]," ",["span",{"class":"comment-meta"},"messaged ",function(){return this.data.root.isSelf?"":this.data.to.length>0?"you and":"you";}," ",function(){return JsonML.BST(MF.Message.RecipientLink).dataBind(this.data.to,this.index,this.count);}," on ",function(){return this.data.root.date.toString(MF.LongDateFormat);}]]," ",["div",{"class":"comment-content"},function(){return JsonML.raw(this.data.root.message);}]," "]," ",function(){return JsonML.BST(MF.Message.MessageDetailItem).dataBind(this.data.replies,this.index,this.count);}," "]," ",["div",{"class":"notes"}," ",["div",{"class":"comment-group"}," ",["a",{href:function(){return MF.user.url;}},["img",{src:function(){return this.data.avatar;},width:"64",height:"64"}]]," ",["p",{"class":"comment-author"},["span",{"class":"comment-meta"},"Your reply:"]]," ",["div",{"class":"comment-content"}," ",["textarea",{"class":"js-expand js-ReplyMessage active",name:"message"}]," ",["p",{"class":"submit"},["a",{onclick:function(){return MF.Message.MessageDetail.postReply(this.data.root.id,this.data.subject);},"class":"positive"},function(){return JsonFx.Lang.get("Global,AddReply");}]]," "]," "]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,MF.Message.MessageDetail.getReplies(this.data.id)),this.index,this.count);}," "]," "]);(function(){this.getReplies=function(A){return function(C,B){MF.Message.Service.getMessage(A,C,B,{onSuccess:function(D){D=MF.Message.MessageModule.bind(D);$("form.js-MessageDetail").replaceWith(D);document.body.scrollIntoView(true);}});};};this.postReply=function(A,B){return function(){var C=$("#reply")[0];var D=MF.Forms.getFormData(C);if(D.message){MF.Forms.disableSubmit(C);MF.Message.Service.addReply(A,B,D.message,{onSuccess:function(E){E=MF.Message.MessageDetailItem.bind(E);$(E).hide().appendTo("div.js-ReplyList").show("slow");MF.Forms.reset(C);$(".js-ReplyMessage").height("auto");if(C.markClean){C.markClean();}},onComplete:function(){MF.Forms.enableSubmit(C);}});}};};this.doDelete=function(B,A,D){var C=[];C.push(B);MF.Message.Service.deleteMessages(C,{onSuccess:function(E){D();window.location.href=E.url;}});};this.promptDelete=function(A){return function(){MF.Dialogs.ConfirmDeleteDialog.showDlg(A,this,"Are you sure you want to delete this message from your inbox? This cannot be undone.",MF.Message.MessageDetail.doDelete,"Delete","don't delete","Delete message");return false;};};}).call(MF.Message.MessageDetail);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Message){MF.Message={};}MF.Message.RecipientLink=JsonML.BST([""," ",function(){return this.index>0?", ":"";},["a",{"class":"recip",href:function(){return this.data.url;}},function(){return this.data.name;}]]);}catch(ex){}