try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.AuthService=new JsonFx.IO.Service("/Features/Security/Services/SecurityService.jrpc");MF.Security.AuthService.checkEmail=function(email,opt){this.invoke("checkEmail",[email],opt);};MF.Security.AuthService.checkUsername=function(username,first,last,opt){this.invoke("checkUsername",[username,first,last],opt);};MF.Security.AuthService.createUser=function(firstName,lastName,email,username,password,facebookId,joinSiteID,opt){this.invoke("createUser",[firstName,lastName,email,username,password,facebookId,joinSiteID],opt);};MF.Security.AuthService.sendForgotEmail=function(email,opt){this.invoke("sendForgotEmail",[email],opt);};MF.Security.AuthService.signOut=function(opt){this.invoke("signOut",null,opt);};MF.Security.AuthService.signIn=function(username,password,isPersistent,joinSiteID,facebookId,opt){this.invoke("signIn",[username,password,isPersistent,joinSiteID,facebookId],opt);};MF.Security.AuthService.signInViaExternalId=function(externalId,joinSiteID,opt){this.invoke("signInViaExternalId",[externalId,joinSiteID],opt);};MF.Security.AuthService.resetPassword=function(password,opt){this.invoke("resetPassword",[password],opt);};MF.Security.AuthService.updateUser=function(username,password,isPersistent,firstName,lastName,email,joinSiteID,opt){this.invoke("updateUser",[username,password,isPersistent,firstName,lastName,email,joinSiteID],opt);};MF.Security.AuthService.generateAccount=function(firstName,lastName,email,facebookId,joinId,opt){this.invoke("generateAccount",[firstName,lastName,email,facebookId,joinId],opt);};MF.Security.AuthService.findUsernamesFromEmail=function(email,opt){this.invoke("findUsernamesFromEmail",[email],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.SignInForm=JsonML.BST(["form",{id:"SignIn","class":"SignInForm js-EnableKeys",onsubmit:"return false"}," ",["div",{"class":"box signin"}," ",["h3",{"jbst:visible":function(){return this.isNormalFlow();}},"Sign in"]," ",["p",{"jbst:visible":function(){return this.isInvite();},"class":"intro"},"Sign in below to accept the invite. If you don't already have an username and password, ",["a",{href:function(){return MF.Security.SignUpUrl;}},"Click here to register"],"."]," ",["p",{"jbst:visible":function(){return this.isJoin();},"class":"intro"},"Sign in below to request membership to this group. If you don't already have an username and password, ",["a",{href:function(){return MF.Security.SignUpUrl;}},"Click here to register"],"."]," ",["label",{"class":"js-error","for":"user"}," ",["div",{"class":"js-UsernameErr message error inline",style:"display:none"}," We couldn't find this username and password combination. Are you sure it was typed correctly? Or did you ",["a",{href:function(){return MF.Security.SignInHelpUrl;}},"forget your password?"]]," ",function(){return JsonFx.Lang.get("Global,Username");},": "]," ",["input",{id:"username",name:"user",onblur:"MF.Security.SignInForm.maybeShowTC(this);",tabindex:"1",type:"text",value:function(){return this.data.uname;},"jbst:onload":"this.focus();"}]," ",["label",{"for":"pass"},function(){return JsonFx.Lang.get("Global,Password");},":"]," ",["input",{name:"pass",onblur:"MF.Security.SignInForm.maybeShowTC(this);",tabindex:"2",type:"password",value:""}]," ",["p",{"jbst:visible":function(){return this.isNormalFlow();}},["input",{type:"checkbox",checked:"checked",name:"rme",tabindex:"3",value:""}]," ",function(){return JsonFx.Lang.get("Global,RememberMe");}]," ",["p",{"class":"submit"},["input",{type:"submit","class":"js-EnterKeyTarget",tabindex:"4",onclick:function(){return this.signIn;},value:function(){return this.getSubmitText();}}]," ",["span",{"jbst:visible":function(){return MF.FBConnect.FBSignIn.allowFBConnect();}},"or"]," ",function(){return JsonML.BST(MF.FBConnect.FBSignIn).dataBind(this.data,this.index,this.count);}]," ",["p",{"class":"confirm js-confirm","jbst:visible":function(){return this.isInvite();},style:"display:none"},"By clicking '",function(){return this.getSubmitText();},"' you confirm you are over 13 years of age and accept the ",["a",{target:"_blank",href:function(){return MF.TermsUrl;}},"Terms & Conditions"],"."]," ",["a",{href:function(){return MF.Security.SignInHelpUrl;},"class":function(){return this.isNormalFlow()?"forgot":"forgot inline";}},"Forgot username/password?"]," "]," "]);(function(){function A(){return $("#SignIn")[0];}this.getFormData=function(){var B=MF.Forms.getFormData(A());B.rme=!!B.rme;return B;};this.signIn=function(){var B=A();if(!B){throw new Error("Cannot find SignIn form");}var C=$(".js-error");var D=MF.Security.SignInForm.getFormData();MF.Message.clear(C,MF.Message.Scope.Inline);$("div.js-UsernameErr").hide();if(!D.user){MF.Message.showError(C,"Please enter your Username.",MF.Message.Scope.Inline);return false;}if(!D.pass){MF.Message.showError(C,"Please enter your Password.",MF.Message.Scope.Inline);return false;}MF.Forms.disableSubmit(B);MF.Security.AuthService.signIn(D.user,D.pass,D.rme,MF.Security.Flow==="Join"?MF.mfsid:0,"",{onSuccess:function(E){if(E.ok){window.location.replace(MF.getQueryParam("url",true)||E.url||"/");}else{if(E.update){MF.Security.UpdateInfoDialog.show(E.fname,E.lname,E.email);}}},onFailure:function(E){$("div.js-UsernameErr").show();MF.Forms.reset(B);$("#username").focus();},onComplete:function(){MF.Forms.enableSubmit(B);}});return false;};this.maybeShowTC=function(B){if(this.isInvite()){var C=this.getFormData();this.showTC(C.user||C.pass);}};this.showTC=function(B){if(B){$("p.js-confirm").show("slow");}else{$("p.js-confirm").hide("slow");}};this.reset=function(){MF.Forms.reset(A());};this.getSubmitText=function(){if(this.isInvite()){return"Accept invite";}else{if(this.isJoin()){return"Send request";}else{return"Sign in";}}};this.isInvite=function(){return MF.Security.Flow==="Invite";};this.isJoin=function(){return MF.Security.Flow==="Join";};this.isNormalFlow=function(){return MF.Security.Flow==="Normal";};}).call(MF.Security.SignInForm);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.SignInHelpForm=JsonML.BST(["form",{id:"SignInHelp","class":"SignInHelp js-EnableKeys",onsubmit:"return false"}," ",["div",{"class":"box signin"}," ",["h3",{"jbst:visible":function(){return this.isNormalFlow();}},"Sign In Help"]," ",["p",{"class":"intro",id:"jserror"},"If you can't remember your username or password, please enter your email below and we'll send you your login details."]," ",["label",{"for":""},"Email address:"]," ",["input",{type:"text",name:"email",tabindex:"1",value:function(){return MF.getQueryParam("email",false);},"jbst:onload":"this.focus();"}]," ",["p",{"class":"submit"},["input",{type:"submit","class":"js-EnterKeyTarget",tabindex:"2",onclick:function(){return this.send;},value:"Send details"}]," or ",["a",{"class":"js-EscKeyTarget",href:function(){return MF.Security.SignInUrl;}},"cancel"]]," "]," "]);(function(){this.send=function(){var A=$("#SignInHelp")[0];if(!A){throw new Error("Cannot find SignInHelp form");}var B=$("#jserror");MF.Message.clear(B,MF.Message.Scope.Inline);var C=MF.Forms.getFormData(A);if(!C.email||!MF.RegExp.Email.exec(C.email)){MF.Message.showError(B,"Please enter a valid email address",MF.Message.Scope.Inline);return false;}MF.Forms.disableSubmit(A);MF.Security.AuthService.sendForgotEmail(C.email,{onSuccess:function(D){if(D){MF.Message.showInfo(B,"We just sent a message to "+C.email+" 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.Inline);MF.Forms.reset(A);}else{MF.Message.showError(B,"Sorry, we couldn't find a record of the email address: "+C.email+". Want to try again?",MF.Message.Scope.Inline);}},onComplete:function(){MF.Forms.enableSubmit(A);}});return false;};this.isInvite=function(){return MF.Security.Flow==="Invite";};this.isJoin=function(){return MF.Security.Flow==="Join";};this.isNormalFlow=function(){return MF.Security.Flow==="Normal";};}).call(MF.Security.SignInHelpForm);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.SignUpForm=JsonML.BST(["form",{id:"SignUp","class":"SignUpForm js-EnableKeys",onsubmit:"return false","js-EnterKeyTarget":""}," ",["div",{"class":"box signin"}," ",["h3",{"jbst:visible":function(){return this.isNormalFlow();},"class":"reg-title"},"Create your group in 30 seconds"]," ",["p",{"jbst:visible":function(){return this.isInvite();},"class":"intro"},"Sign in below to accept the invite. If you don't already have an username and password, ",["a",{href:function(){return MF.Security.SignUpUrl;}},"Click here to register"],"."]," ",["p",{"jbst:visible":function(){return this.isJoin();},"class":"intro"},"Sign in below to request membership to this group. If you don't already have an username and password, ",["a",{href:function(){return MF.Security.SignUpUrl;}},"Click here to register"],"."]," ",["fieldset"," ",["div",{"class":"half"}," ",["label",{"for":""},"First name:"]," ",["input",{type:"text",name:"fname",maxlength:"200",onblur:"MF.Security.SignUpForm.maybeShowTC(this);",validate:function(){return MF.Validation.create(MF.RegExp.Name,this.ErrorMessage(this.ErrorCode.FirstName));},onchange:"this.validate();",value:"",tabindex:"1","jbst:onload":"this.focus();"}]," "]," ",["div",{"class":"half"}," ",["label",{"for":""},"Last name:"]," ",["input",{type:"text",name:"lname",maxlength:"200",onblur:"MF.Security.SignUpForm.maybeShowTC(this);",validate:function(){return MF.Validation.create(MF.RegExp.Name,this.ErrorMessage(this.ErrorCode.LastName));},onchange:"this.validate();",value:"",tabindex:"2"}]," "]," "]," ",["fieldset"," ",["div",{"class":"js-EmailExists message error inline",style:"display:none"}," This email address already has an username associated with it. Did you ",["a",{onclick:function(){return this.gotoForgotPwd;},href:function(){return MF.Security.SignInHelpUrl;}},"forget your password?"]," If not, please ",["a",{href:function(){return MF.Security.SignInUrl;}},"sign in"]," or try another email address. "]," ",["p",{"class":"email-check"}," ",["label",{"for":""},"Email address:"]," ",["input",{type:"text",onblur:function(){return this.checkEmail;},"class":"username-check",name:"email",validate:function(){return MF.Validation.create(MF.RegExp.Email,this.ErrorMessage(this.ErrorCode.Email));},value:"",tabindex:"3"}]," "]," ",["span",{"class":"username-ok js-EmailOk",style:"display:none"},"\u00A0"]," "]," ",["fieldset"," ",["div",{"class":"js-Usernames"}]," ",["label",{"for":""},"Create username:"]," ",["input",{type:"text","class":"username-check",name:"uname",maxlength:"25",onblur:function(){return this.checkUsername;},validate:function(){return this.validateUsername;},value:"",tabindex:"4"}]," ",["span",{"class":"username-ok js-UsernameOk",style:"display:none"},"\u00A0"]," "]," ",["fieldset"," ",["label",{"for":""},"Create password:"]," ",["input",{type:"password",name:"pwd",maxlength:"25",onblur:"MF.Security.SignUpForm.maybeShowTC(this);",validate:function(){return MF.Validation.create(MF.RegExp.Password,this.ErrorMessage(this.ErrorCode.Password));},onchange:"this.validate();",value:"",tabindex:"5"}]," "]," ",["p",{"class":"submit"},["input",{"class":"sign-up js-EnterKeyTarget",type:"submit",tabindex:"6",onclick:function(){return this.signUp;},value:function(){return this.getSubmitText();}}]," ",["span",{"jbst:visible":function(){return MF.FBConnect.FBSignIn.allowFBConnect();}},"or"]," ",function(){return JsonML.BST(MF.FBConnect.FBSignIn).dataBind(this.data,this.index,this.count);}]," ",["p",{"class":"confirm js-confirm",style:"display:none"},"By clicking '",function(){return this.getSubmitText();},"' you confirm you are over 13 years of age and accept the ",["a",{target:"_blank",href:function(){return MF.TermsUrl;}},"Terms & Conditions"],"."]," "]," "]);(function(){var C="";var E="";var A="";var B={Success:0,FirstName:1,LastName:2,Email:3,EmailExists:4,Username:5,UsernameExists:6,Password:7};function D(F){switch(F){case B.Success:return"Success.";case B.FirstName:return"First name doesn't look quite right.";case B.LastName:return"Last name doesn't look quite right.";case B.Email:return"Email address doesn't look quite right.";case B.EmailExists:return"This email address already has an username associated with it. Did you forget your password? If not, please sign in or try another email address";case B.Username:return"Please try another Username. Usernames must have between 5 and 25 characters. No spaces or special characters.";case B.UsernameExists:return"This username is already taken. Please choose one of the following usernames or try again.";case B.Password:return"Please try another password. Passwords must have between 5 and 25 characters. No spaces or special characters.";}return"Unknown Error ("+idx+")";}this.ErrorCode=B;this.ErrorMessage=D;this.signUp=function(){var F=$("#SignUp")[0];if(!MF.Validation.validateForm(F)){MF.Message.showError(F,"Please fix the errors below.",MF.Message.Scope.Column);return false;}var G=MF.Forms.getFormData(F);MF.Message.clear(F,MF.Message.Scope.Column);if(!G.fname){MF.Message.showError(F,D(B.FirstName),MF.Message.Scope.Column);return false;}if(!G.lname){MF.Message.showError(F,D(B.LastName),MF.Message.Scope.Column);return false;}if(!G.email){MF.Message.showError(F,D(B.Email),MF.Message.Scope.Column);return false;}if(!G.uname){MF.Message.showError(F,D(B.Username),MF.Message.Scope.Column);return false;}if(!G.pwd){MF.Message.showError(F,D(B.Password),MF.Message.Scope.Column);return false;}MF.Forms.disableSubmit(F);MF.Security.AuthService.createUser(G.fname,G.lname,G.email,G.uname,G.pwd,"",MF.Security.Flow==="Join"?MF.mfsid:0,{onSuccess:function(H){if(H.errcode===B.Success){window.location.replace(H.url||"/");}else{if(H.errcode===B.EmailExists){E="";A=G.email;MF.Security.SignUpForm.checkEmail.call($("input[name='email']")[0]);}else{if(H.errcode===B.UsernameExists){C="";MF.Security.SignUpForm.checkUsername.call($("input[name='uname']")[0]);}else{MF.Message.showError(F,D(H.errcode),MF.Message.Scope.Column);}}}},onComplete:function(){MF.Forms.enableSubmit(F);}});return false;};this.checkEmail=function(){MF.Security.SignUpForm.maybeShowTC(this);$("div.js-EmailExists").hide();if(this.validate()){var F=$("#SignUp")[0];MF.Message.clear(F,MF.Message.Scope.Column);var H=$(this);var G=H.val();if(G&&G!=E){MF.Security.AuthService.checkEmail(G,{onSuccess:function(I){if(I){E=G;$("span.js-EmailOk").show();}else{$("span.js-EmailOk").hide();$("div.js-EmailExists").show();A=G;}}});}}else{$("span.js-EmailOk").hide();}};this.validateUsername=function(){if("string"===typeof this.value){this.value=this.value.trim();if(this.value.length===0){return false;}}return MF.Validation.validate(this,MF.RegExp.Username,D(B.Username));};this.checkUsername=function(){MF.Security.SignUpForm.maybeShowTC(this);if(this.validate()){var F=$("#SignUp")[0];var G=MF.Forms.getFormData(F);MF.Message.clear(F,MF.Message.Scope.Column);if(G.uname&&G.uname!=C){MF.Security.AuthService.checkUsername(G.uname,G.fname.length>0?G.fname:G.uname,G.lname.length>0?G.lname:G.uname,{onSuccess:function(H){if(H.ok){C=G.uname;$("span.js-UsernameOk").show();$("div.js-Usernames").hide();}else{$("span.js-UsernameOk").hide();$("div.js-Usernames").replaceWith(MF.Security.Usernames.bind(H)).show();}}});}}else{$("span.js-UsernameOk").hide();$("div.js-Usernames").hide();}};this.maybeShowTC=function(F){var G=MF.Forms.getFormData($("#SignUp")[0]);this.showTC(G.fname||G.lname||G.email||G.uname||G.pwd);};this.showTC=function(F){if(F){$("p.js-confirm").show("slow");}else{$("p.js-confirm").hide("slow");}};this.setUsername=function(F){var G=$("input[name='uname']");G.val(F);G.focus();};this.getSubmitText=function(){if(this.isInvite()){return"Accept invite";}else{if(this.isJoin()){return"Send request";}else{return"Get started";}}};this.isInvite=function(){return MF.Security.Flow==="Invite";};this.isJoin=function(){return MF.Security.Flow==="Join";};this.isNormalFlow=function(){return MF.Security.Flow==="Normal";};this.gotoForgotPwd=function(){var F=MF.Security.SignInHelpUrl;if(A&&A.length>0){F+="?email="+A;}window.location.href=F;return false;};}).call(MF.Security.SignUpForm);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.MyFamilySplash=JsonML.BST(["div",{"class":"account"}," ",["h2",{"class":"homemain"},"myfamily.com helps keep your family connected."]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.SiteAvatar=JsonML.BST(["img",{"class":"site-picture",src:function(){return this.data.avatar;},width:"300"}]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.ResetPwdForm=JsonML.BST(["form",{id:"ResetPwd","class":"js-ResetPwdForm js-UnsavedData js-EnableKeys",title:"You haven't reset your password yet. Are you sure you want to leave this page?",onsubmit:"return false"}," ",["div",{"class":"box signin"}," ",["h3","Reset Password"]," ",["fieldset"," ",["label",{"for":"user"},function(){return JsonFx.Lang.get("Global,Username");},":"]," ",["input",{name:"user",type:"text",readonly:"readonly",tabindex:"1",value:function(){return this.data.username;}}]," ",["input",{type:"hidden",name:"uid",value:function(){return this.data.id;}}]," ",["label",{"for":"pass1"},function(){return JsonFx.Lang.get("Global,EnterNewPassword");},":"]," ",["input",{name:"pass1",type:"password",validate:function(){return MF.Validation.create(MF.RegExp.Password,"Password doesn't look quite right.");},onchange:"this.validate();",value:"",tabindex:"2"}]," ",["br"]," ",["label",{"for":"pass2"},function(){return JsonFx.Lang.get("Global,ConfirmNewPassword");},":"]," ",["input",{name:"pass2",type:"password",validate:function(){return MF.Validation.create(MF.RegExp.Password,"Password doesn't look quite right.");},onchange:"this.validate();",value:"",tabindex:"3"}]," ",["p",{"class":"instruct"},function(){return JsonFx.Lang.get("Global,AcceptedPasswordCharacters");}]," "]," ",["p",{"class":"submit"},["a",{onclick:function(){return this.resetPwd;},"class":"positive js-EnterKeyTarget"},"Reset"]," or ",["a",{"class":"js-EscKeyTarget",href:function(){return MF.Security.SignInUrl;}},"Cancel"]]," "]," "]);(function(){this.resetPwd=function(){var A=$("#ResetPwd")[0];if(!MF.Validation.validateForm(A)){MF.Message.showError(this,"Please fix the errors below.",MF.Message.Scope.Column);return false;}var B=MF.Forms.getFormData(A);MF.Message.clear(A,MF.Message.Scope.Column);if(B.pass1.length===0){MF.Message.showError(A,"Please enter a new password",MF.Message.Scope.Column);return false;}else{if(B.pass1!=B.pass2){MF.Message.showError(A,"Passwords do not match",MF.Message.Scope.Column);return false;}}MF.Forms.disableSubmit(A);MF.Security.AuthService.resetPassword(B.pass1,{onSuccess:function(C){if(C){MF.Message.clear(A,MF.Message.Scope.Column);MF.Message.showInfo(A,"Your password has been changed and you are now logged in. Please wait while we redirect you to your profile.",MF.Message.Scope.Column);if(A.markClean){A.markClean();}setTimeout(function(){window.location.replace(MF.getQueryParam("url",true)||"/");},4000);}else{MF.Message.showError(A,"An error occurred while trying to change your password. Please try again.",MF.Message.Scope.Column);}},onComplete:function(){MF.Forms.enableSubmit(A);}});return false;};}).call(MF.Security.ResetPwdForm);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.Usernames=JsonML.BST(["div",{"class":"usernames js-Usernames"}," ",["p",{"class":"message error inline"},function(){return MF.Security.SignUpForm.ErrorMessage(MF.Security.SignUpForm.ErrorCode.UsernameExists);}," ",function(){return JsonML.BST(MF.Security.Username).dataBind(this.data.unames,this.index,this.count);}," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.Username=JsonML.BST([""," ",["br"],["a",{href:"#",onclick:function(){return this.setUsername(this.data);}},function(){return this.data;}]]);(function(){this.setUsername=function(A){return function(){MF.Security.SignUpForm.setUsername(A);return false;};};}).call(MF.Security.Username);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.UpdateInfoDialog=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind({height:275,width:430,modal:true,data:this.data},this.index,this.count,{$:[""," ",["form",{id:"UpdateUcdm","class":"js-EnableKeys",onsubmit:"return false;"}," ",["div",{"class":"account ucdm"}," ",["p","To finish creating your myfamily.com account, please fill out any empty fields below and confirm the Terms and Conditions:"]," ",["div",{"class":"box"}," ",["fieldset"," ",["div",{"class":"half"}," ",["label",{"for":""},"First Name:"]," ",["input",{type:"text",name:"fname",maxlength:"200",validate:function(){return MF.Validation.create(MF.RegExp.Name,MF.Security.SignUpForm.ErrorMessage(MF.Security.SignUpForm.ErrorCode.FirstName));},onblur:"this.validate();",value:function(){return this.data.fname;},tabindex:"11","jbst:onload":"this.focus();"}]," "]," ",["div",{"class":"half"}," ",["label",{"for":""},"Last Name:"]," ",["input",{type:"text",name:"lname",maxlength:"200",validate:function(){return MF.Validation.create(MF.RegExp.Name,MF.Security.SignUpForm.ErrorMessage(MF.Security.SignUpForm.ErrorCode.LastName));},onblur:"this.validate();",value:function(){return this.data.lname;},tabindex:"12"}]," "]," ",["label",{"for":""},"Email Address:"]," ",["input",{type:"text",name:"email",validate:function(){return MF.Validation.create(MF.RegExp.Email,MF.Security.SignUpForm.ErrorMessage(MF.Security.SignUpForm.ErrorCode.Email));},onblur:"this.validate();",value:function(){return this.data.email;},tabindex:"13"}]," ",["p",{"class":"confirm"},"By clicking 'Submit' below, you confirm you are over 13 years of age and accept the ",["a",{target:"_blank",href:function(){return MF.TermsUrl;}},"Terms & Conditions"],"."]," ",["p",{"class":"submit"},["input",{onclick:function(){return MF.Security.UpdateInfoDialog.update;},"class":"js-EnterKeyTarget",tabindex:"14",type:"submit",name:"",value:"Submit"}]," or ",["a",{onclick:function(){return MF.Security.UpdateInfoDialog.cancelUpdate;},href:"#cancel"},"cancel"]]," "]," "]," "]," "]," "]});});(function(){this.show=function(B,D,C){var A=MF.Security.UpdateInfoDialog.bind({fname:B,lname:D,email:C});if(A){document.body.appendChild(A);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}};this.update=function(){var C=$("#UpdateUcdm")[0];if(!MF.Validation.validateForm(C)){return false;}var D=MF.Forms.getFormData(C);var A=true;if(!D.email||D.email.length===0){MF.Message.showError($(C.email),MF.Security.SignUpForm.ErrorMessage(MF.Security.SignUpForm.ErrorCode.Email),MF.Message.Scope.Inline);A=false;}if(!D.lname||D.lname.length===0){MF.Message.showError($(C.lname).context,MF.Security.SignUpForm.ErrorMessage(MF.Security.SignUpForm.ErrorCode.LastName),MF.Message.Scope.Inline);A=false;}if(!D.fname||D.fname.length===0){MF.Message.showError($(C.fname).context,MF.Security.SignUpForm.ErrorMessage(MF.Security.SignUpForm.ErrorCode.FirstName),MF.Message.Scope.Inline);A=false;}if(!A){return false;}var B=MF.Security.SignInForm.getFormData();MF.Forms.disableSubmit(C);MF.Security.AuthService.updateUser(B.user,B.pass,B.rme,D.fname,D.lname,D.email,MF.Security.Flow==="Join"?MF.mfsid:0,{onSuccess:function(E){window.location.href=MF.getQueryParam("url",true)||E.url;},onComplete:function(){MF.Dialog.remove();MF.Forms.enableSubmit(C);}});return false;};this.cancelUpdate=function(){MF.Security.SignInForm.reset();MF.Dialog.remove();return false;};}).call(MF.Security.UpdateInfoDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Security){MF.Security={};}MF.Security.Title=JsonML.BST(["h1",{"class":"title"},function(){return this.data.title;}]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.FBConnect){MF.FBConnect={};}MF.FBConnect.Identify=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind({height:75,width:430,modal:false,data:this.data},this.index,this.count,{$:[""," ",["div",{"class":"modal newsignin"}," ",["div",{"class":"box signin js-identify"}," ",["form",{"class":"js-EnableKeys",onsubmit:"return false;"}," ",["h3","Already have a myfamily.com account?"]," ",["div",{"class":"contacts large"}," ",["p"," ",["img",{alt:"",src:function(){return(this.data.pic_big)?this.data.pic_big:"/images/DummyFBAvatar.gif";}}]," ",["span",{"class":"name"},"Hi there ",function(){return this.data.first_name;},"!"]," ",["span",{"class":"meta"},"Do you already have an account on myfamily.com?"]," "]," "]," ",["fieldset",{"class":"fb-user-check"}," ",["p",{"class":"acct"}," ",["input",{type:"radio",name:"nextStep",checked:"checked",defaultChecked:"defaultChecked",value:"create"}]," ",["label","No, I am new to myfamily.com"]," "]," ",["p",{"class":"acct"}," ",["input",{type:"radio",name:"nextStep",value:"associate"}]," ",["label","Yes, I already have a myfamily.com account"]," "]," ",["br"]," ",["p"," ",["label","Email address:"]," ",["input",{"class":"text",type:"text",name:"email",onkeypress:function(){return MF.FBConnect.Identify.showTC();},validate:function(){return MF.Validation.create(MF.RegExp.Email,"Email address doesn't look quite right.");}}]," "]," ",["p",{"class":"submit"}," ",["a",{"class":"positive js-EnterKeyTarget",href:"#signin",onclick:function(){return MF.FBConnect.Identify.createOrAssociate(this.data);}},"Submit"]," "]," "]," ",["p",{"class":"instruct js-tc",style:"display:none"},"By clicking 'Submit' you confirm you are over 13 years of age and accept the ",["a",{target:"_blank",href:function(){return MF.TermsUrl;}},"Terms & Conditions"],"."]," "]," "]," "]," "]});});(function(){this.show=function(B){var A=MF.FBConnect.Identify.bind(B);if(A){document.body.appendChild(A);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}};this.createOrAssociate=function(A){return function(){var B=$(".js-identify");if(!MF.Validation.validateForm(B)){MF.Message.showError(B,"Please fix the errors below.",MF.Message.Scope.Inline);return false;}var C=MF.Forms.getFormData(B);if(C.email===""){MF.Message.showError(B,"Please enter an email address",MF.Message.Scope.Inline);return false;}if(C.nextStep==="create"){MF.FBConnect.Identify.generateAccount(A.first_name,A.last_name,C.email,A.uid,B);}else{MF.FBConnect.Identify.findUsernames(A.uid,C.email,B);}};};this.findUsernames=function(A,C,B){MF.Dialog.remove();MF.Security.AuthService.findUsernamesFromEmail(C,{onSuccess:function(D){MF.FBConnect.SignIn.show({usernames:D,facebookId:A});}});};this.generateAccount=function(C,B,E,A,D){MF.Security.AuthService.generateAccount(C,B,E,A,MF.Security.Flow==="Join"?MF.mfsid:0,{onSuccess:function(F){if(F.errcode===MF.Security.SignUpForm.ErrorCode.Success){window.location.replace(F.url||"/");}else{if(F.errcode===MF.Security.SignUpForm.ErrorCode.EmailExists){MF.FBConnect.Identify.findUsernames(A,E,D);}}}});};this.showTC=function(){return function(){$("p.js-tc").show("slow");$(this).attr("onkeypress","");};};}).call(MF.FBConnect.Identify);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.FBConnect){MF.FBConnect={};}MF.FBConnect.FBSignIn=JsonML.BST(["a",{"class":"fb-login",href:"#",onclick:"FB.Connect.requireSession(MF.FBConnect.FBSignIn.fbSignIn); return false;","jbst:onload":function(){return this.bindFBConnect(MF.FBConnect.FBApiKey);},"jbst:visible":function(){return this.allowFBConnect();}}," ",["img",{id:"fb_login_image",src:"/images/connect_light_medium_long.gif",alt:"Connect"}]," "]);(function(){this.allowFBConnect=function(){var A=window.location.hostname;return A&&A.indexOf("myfamily")!=-1;};this.bindFBConnect=function(A){FB_RequireFeatures(["XFBML"],function(){FB.Facebook.init(A,("https:"===document.location.protocol)?"/xd_receiver_ssl.htm":"/xd_receiver.htm");FB.XFBML.Host.autoParseDomTree=false;});};this.fbSignIn=function(){FB_RequireFeatures(["Api"],function(){FB.Facebook.apiClient.requireLogin(function(A){FB.Facebook.apiClient.users_getInfo([FB.Facebook.apiClient.get_session().uid],["uid","first_name","last_name","name","pic_big","profile_url","username","status"],function(C,B){MF.Security.AuthService.signInViaExternalId(C[0].uid,MF.Security.Flow==="Join"?MF.mfsid:0,{onSuccess:function(D){if(D.ok){window.location.replace(MF.getQueryParam("url",true)||D.url||"/");}else{if(B){alert(B);}else{if(C){MF.FBConnect.Identify.show(C);}}}}});});});});};}).call(MF.FBConnect.FBSignIn);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.FBConnect){MF.FBConnect={};}MF.FBConnect.SignIn=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind({height:75,width:350,modal:false,data:this.data},this.index,this.count,{$:[""," ",["div",{"class":"modal newsignin"}," ",["div",{"class":"box signin"}," ",["form",{"class":"js-EnableKeys js-signin",onsubmit:"return false;"}," ",["h3","Sign into myfamily.com"]," ",["fieldset"," ",["p"," ",["label","Username:"]," ",function(){return JsonML.BST(MF.FBConnect.SignIn.pickUsernameControl).dataBind(this.data,this.index,this.count);}," "]," ",["p"," ",["label","Password:"]," ",["input",{"class":"text",type:"password",name:"password"}]," "]," ",["p",{"class":"submit"}," ",["a",{"class":"positive js-EnterKeyTarget",href:"#signin",onclick:function(){return MF.FBConnect.SignIn.signIn(this.data.facebookId);}},"Sign in"]," "]," "]," ",["p",{"class":"instruct"}," ",["a",{href:function(){return MF.Security.SignInHelpUrl;}},"Forgot password?"]," "]," "]," "]," "]," "]});});(function(){this.show=function(B){var A=MF.FBConnect.SignIn.bind(B);if(A){document.body.appendChild(A);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}};this.pickUsernameControl=function(){switch(this.data.usernames.length){case 0:return MF.FBConnect.NoUsernames;case 1:return MF.FBConnect.Username;default:return MF.FBConnect.Usernames;}};this.signIn=function(A){return function(){var B=$(".js-signin");var C=MF.Forms.getFormData(B);MF.Forms.disableSubmit(B);MF.Security.AuthService.signIn(C.username,C.password,false,MF.Security.Flow==="Join"?MF.mfsid:0,A,{onSuccess:function(D){if(D.ok){window.location.replace(MF.getQueryParam("url",true)||D.url||"/");}else{if(D.update){MF.Security.UpdateInfoDialog.show(D.fname,D.lname,D.email);}}},onFailure:function(F,D,E){MF.Forms.reset(B[0]);MF.Message.showError(B.find("fieldset"),"We couldn't find this username and password combination. Are you sure it was typed correctly? Or did you forget your password?",MF.Message.Scope.Inline);},onComplete:function(){MF.Forms.enableSubmit(B);}});return false;};};}).call(MF.FBConnect.SignIn);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.FBConnect){MF.FBConnect={};}MF.FBConnect.Username=JsonML.BST(function(){return JsonML.BST([""," ",["strong",function(){return this.data.username;}]," ",["input",{type:"hidden",name:"username",value:function(){return this.data.username;}}]," "]).dataBind(this.data.usernames,this.index,this.count);});}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.FBConnect){MF.FBConnect={};}MF.FBConnect.Usernames=JsonML.BST(["select",{size:"1",name:"username"}," ",function(){return JsonML.BST([""," ",["option",{value:function(){return this.data.username;}},function(){return this.data.username;}]," "]).dataBind(this.data.usernames,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.FBConnect){MF.FBConnect={};}MF.FBConnect.NoUsernames=JsonML.BST(["input",{"class":"text",type:"text",name:"username"}]);}catch(ex){}