try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.Service=new JsonFx.IO.Service("/Features/Calendar/CalendarService.jrpc");MF.Calendar.Service.createAsActivity=function(title,eventDate,timezoneOffset,isAllDay,isYearly,location,description,eventType,opt){this.invoke("createAsActivity",[title,eventDate,timezoneOffset,isAllDay,isYearly,location,description,eventType],opt);};MF.Calendar.Service.createEvent=function(title,eventDate,timezoneOffset,isAllDay,isYearly,location,description,eventType,opt){this.invoke("createEvent",[title,eventDate,timezoneOffset,isAllDay,isYearly,location,description,eventType],opt);};MF.Calendar.Service.deleteEvent=function(calEventID,removalType,opt){this.invoke("deleteEvent",[calEventID,removalType],opt);};MF.Calendar.Service.getUpcomingEvents=function(start,count,opt){this.invoke("getUpcomingEvents",[start,count],opt);};MF.Calendar.Service.getEvents=function(start,count,startDate,eventType,sortCol,sortAsc,userIDs,opt){this.invoke("getEvents",[start,count,startDate,eventType,sortCol,sortAsc,userIDs],opt);};MF.Calendar.Service.getMonthlyEvents=function(date,opt){this.invoke("getMonthlyEvents",[date],opt);};MF.Calendar.Service.getEvent=function(calEventID,opt){this.invoke("getEvent",[calEventID],opt);};MF.Calendar.Service.setTitlePref=function(showTitle,opt){this.invoke("setTitlePref",[showTitle],opt);};MF.Calendar.Service.setCalendarPreferences=function(prefs,opt){this.invoke("setCalendarPreferences",[prefs],opt);};MF.Calendar.Service.updateEvent=function(calEventID,title,eventDate,timezoneOffset,allDay,isYearly,location,description,eventType,opt){this.invoke("updateEvent",[calEventID,title,eventDate,timezoneOffset,allDay,isYearly,location,description,eventType],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.Month=JsonML.BST([""," ",function(){this.canAdd=this.data.canAdd;this.showTitle=false;this.setPreferences(this.data.preferences);if(window.location.hash.length>0){this.currentDate=Date.parse(window.location.hash.substr(1));if(!this.currentDate||this.currentDate==null){this.currentDate=Date.today();}}else{this.currentDate=this.data.date;}this.initializeHistory();if(!this.keypressRegistered){this.keypressRegistered=true;$(document).keyup(this.handleArrowNav);}}," ",["div",{"class":"js-MonthView"}," ",["div",{"class":"page-title"}," ",["h2",{ondblclick:function(){return this.titleClicked;},"class":"js-PageTitle","jbst:visible":function(){return this.showTitle;}},"Events calendar"]," ",["h2",{"class":"js-PageTitle","jbst:visible":function(){return !this.showTitle;}}," ",["a",{title:"Previous Month",onclick:function(){return this.gotoPrevMonth(this.currentDate);},href:function(){return this.getPrevMonthHash(this.currentDate);}},["span","\u00AB"]]," ",["span",{ondblclick:function(){return this.titleClicked;}},["strong",function(){return this.currentDate.toString("MMMM yyyy");}]]," ",["a",{title:"Next Month",onclick:function(){return this.gotoNextMonth(this.currentDate);},href:function(){return this.getNextMonthHash(this.currentDate);}},["span","\u00BB"]]," "]," "]," ",["div",{"class":"backlinks",id:"backLinksDiv","jbst:visible":function(){return this.currentDate.toString("MMyyyy")!==Date.today().toString("MMyyyy");}},["a",{href:function(){return window.location.pathname+"#"+Date.today().toString("yyyy-MM-dd");}},"\u00AB Go to today"]]," ",["div",{"class":"admin full"}," ",["p",{"class":"add create-media","jbst:visible":function(){return this.data.canAdd;}},["a",{onclick:function(){return this.addEvent;},href:function(){return window.location.pathname+"/add";}},"Create new event"]," "]," ",["p",{"class":"sort calnav","jbst:visible":function(){return this.showTitle;}}," ",["a",{onclick:function(){return this.gotoPrevMonth(this.currentDate);},href:function(){return this.getPrevMonthHash(this.currentDate);},"class":"prev"},["span","PREV"]]," ",["a",{href:"","class":"this"},["span",{"class":"first"},function(){return this.currentDate.toString("MMMM yyyy");}]]," ",["a",{onclick:function(){return this.gotoNextMonth(this.currentDate);},href:function(){return this.getNextMonthHash(this.currentDate);},"class":"next last"},["span","NEXT"]]," "]," ",["ul",{"class":"view"}," ",["li",{"class":"cal active"},["a",{href:""},["span","View calendar"]]]," ",["li",{"class":"list"},["a",{onclick:function(){return this.viewAsList;},href:function(){return window.location.pathname+"?view=list";}},["span","View as list"]]]," "]," "]," ",["table",{"class":"calendar",cellpadding:"0",cellspacing:"0"}," ",["tr"," ",["th",{"class":"weekend"},"Sunday"]," ",["th",{"class":"weekday"},"Monday"]," ",["th",{"class":"weekday"},"Tuesday"]," ",["th",{"class":"weekday"},"Wednesday"]," ",["th",{"class":"weekday"},"Thursday"]," ",["th",{"class":"weekday"},"Friday"]," ",["th",{"class":"weekend"},"Saturday"]," "]," ",function(){return JsonML.BST([""," ",["tr"," ",function(){return JsonML.BST([""," ",["td",{"class":function(){return this.data.date.equals(Date.today())?"today":"";}},["a",{onclick:function(){return MF.Calendar.Month.canAdd?MF.Calendar.Month.addEventOnDay(this.data.date):null;},href:function(){return MF.Calendar.Month.canAdd?"#add":null;}},["span",{"class":function(){return this.data.off?"date-off":"date";}},function(){return this.data.day;}]]," ",["div",{id:function(){return"js-"+this.data.date.toString("MMdd");}}," ",function(){return JsonML.BST(MF.Calendar.MonthEventItem).dataBind(this.data.items,this.index,this.count);}," "]," ",["div",{"class":"js-thumbnail","jbst:visible":function(){return this.data.preview!=null;},style:function(){return MF.Calendar.Month.getStyle("thumbnail");}}," ",["a",{href:function(){return this.data.preview?this.data.preview.url:"";}}," ",["img",{src:function(){return this.data.preview?this.data.preview.image:"";},title:function(){return this.data.preview?this.data.preview.title:"";}}]," "]," "]," "]," "]).dataBind(this.data.days,this.index,this.count);}," "]," "]).dataBind(this.buildMonth(),this.index,this.count);}," "]," ",["p",{"class":"events-legend"},["strong","Show:"]," ",["input",{onclick:function(){return this.toggleEventType("anniversary");},type:"checkbox",checked:function(){return this.canShowEventType("anniversary")?"checked":"";},defaultChecked:function(){return this.canShowEventType("anniversary")?"defaultChecked":"";},name:"",value:""}],["span",{"class":"anniversary"},"Anniversaries"]," ",["input",{onclick:function(){return this.toggleEventType("birthday");},type:"checkbox",checked:function(){return this.canShowEventType("birthday")?"checked":"";},defaultChecked:function(){return this.canShowEventType("birthday")?"defaultChecked":"";},name:"",value:""}],["span",{"class":"birthday"},"Birthdays"]," ",["input",{onclick:function(){return this.toggleEventType("holiday");},type:"checkbox",checked:function(){return this.canShowEventType("holiday")?"checked":"";},defaultChecked:function(){return this.canShowEventType("holiday")?"defaultChecked":"";},name:"",value:""}],["span",{"class":"holiday"},"Holidays"]," ",["input",{onclick:function(){return this.toggleEventType("reunion");},type:"checkbox",checked:function(){return this.canShowEventType("reunion")?"checked":"";},defaultChecked:function(){return this.canShowEventType("reunion")?"defaultChecked":"";},name:"",value:""}],["span",{"class":"reunion"},"Reunions"]," ",["input",{onclick:function(){return this.toggleEventType("wedding");},type:"checkbox",checked:function(){return this.canShowEventType("wedding")?"checked":"";},defaultChecked:function(){return this.canShowEventType("wedding")?"defaultChecked":"";},name:"",value:""}],["span",{"class":"wedding"},"Weddings"]," ",["input",{onclick:function(){return this.toggleEventType("general");},type:"checkbox",checked:function(){return this.canShowEventType("general")?"checked":"";},defaultChecked:function(){return this.canShowEventType("general")?"defaultChecked":"";},name:"",value:""}],["span",{"class":"general"},"General"]," ",["input",{onclick:function(){return this.toggleThumbnails;},type:"checkbox",checked:function(){return this.canShowEventType("thumbnail")?"checked":"";},defaultChecked:function(){return this.canShowEventType("thumbnail")?"defaultChecked":"";},name:"",value:""}],["span",{"class":"general"},"Thumbnails"]," "]," "]]);(function(){var B="yyyy-MM-dd";var C={};var E={"anniversary":true,"birthday":true,"holiday":true,"reunion":true,"wedding":true,"general":true,"thumbnail":true};function G(I){return I.toString("yyyyMM");}function A(I){return I.toString("MMdd");}function H(M){var K={events:[],preview:null};var J=C[G(M)];if(!J){if(M.getDate()<6){J=C[G(M.clone().addMonths(-1))];}else{if(M.getDate()>22){J=C[G(M.clone().addMonths(1))];}}}if(J){var L=A(M);for(var I=0;I<J.length;I++){if(J[I].day===L){K={events:J[I].events,preview:J[I].preview};break;}}}return K;}function F(J){var I=G(J);var K=C.hasOwnProperty(I);if(!K){MF.Calendar.Service.getMonthlyEvents(J,{onSuccess:function(L){C[I]=L.items;if(J.equals(MF.Calendar.Month.currentDate)){D();}}});}return !K;}function D(){var I=MF.Calendar.Month.bind({canAdd:MF.Calendar.Month.canAdd,date:MF.Calendar.Month.currentDate,showTitle:MF.Calendar.Month.showTitle});$("div.js-MonthView").replaceWith(I);}this.showTitle=false;this.historyEnabled=false;this.currentDate=Date.today();this.buildMonth=function(){var N=MF.Calendar.Month.currentDate;if(!(N instanceof Date)){N=Date.today();}F(N);var P=N.getMonth(),J=N.clone().moveToFirstDayOfMonth().clearTime(),O=N.clone().moveToLastDayOfMonth().moveToDayOfWeek(0).clearTime(),L=[],K;if(J.getDay()){J.moveToDayOfWeek(0,-1);}for(;J.isBefore(O);J.addDays(1)){if(!J.getDay()){K={days:[]};L.push(K);}var M=H(J);var I={date:J.clone(),day:J.getDate(),off:J.getMonth()<P||J.getMonth()>P,items:M.events,preview:M.preview};K.days.push(I);}return L;};this.getPrevMonthHash=function(I){return"#"+I.clone().addMonths(-1).toString(B);};this.getNextMonthHash=function(I){return"#"+I.clone().addMonths(1).toString(B);};this.gotoPrevMonth=function(I){return function(){window.location.hash=MF.Calendar.Month.getPrevMonthHash(I);};};this.gotoNextMonth=function(I){return function(){window.location.hash=MF.Calendar.Month.getNextMonthHash(I);};};this.canShowEventType=function(I){I=I.toLowerCase();if(E.hasOwnProperty(I)){return E[I];}return true;};this.toggleEventType=function(I){return function(){I=I.toLowerCase();var J=$(this);if(J.is(":checked")){E[I]=true;$("span.js-DayItem."+I).show();}else{E[I]=false;$("span.js-DayItem."+I).hide();}MF.Calendar.Month.savePreferences();};};this.toggleThumbnails=function(){eventType="thumbnail";var I=$(this);if(I.is(":checked")){E[eventType]=true;$("div.js-thumbnail").show();}else{E[eventType]=false;$("div.js-thumbnail").hide();}MF.Calendar.Month.savePreferences();};this.getStyle=function(I){return MF.Calendar.Month.canShowEventType(I)?"":"display:none;";};this.getThisUrl=function(){return MF.Calendar.Month.listUrlFmt.replace("{date}",MF.Calendar.Month.currentDate.toString(B));};this.viewAsList=function(){window.location.href=MF.Calendar.Month.getThisUrl()+"?view=list";return false;};this.addEvent=function(){MF.Calendar.Month.addEventOnDay(MF.Calendar.Month.currentDate)();return false;};this.addEventOnDay=function(I){return function(){MF.Calendar.AddEventDialog.showAddEvent(I,MF.Calendar.Month.onEventAdded);return false;};};this.onEventAdded=function(K){MF.Dialog.remove();var I="#js-"+K.item.date.toString("MMdd");var J=MF.Calendar.MonthEventItem.bind(K.item);$(J).hide().appendTo(I).show("slow");};this.initializeHistory=function(){if(!this.historyEnabled){$.History.bind(D);this.historyEnabled=true;}};this.titleClicked=function(I){MF.Calendar.Month.showTitle=false;MF.Calendar.Service.setTitlePref(MF.Calendar.Month.showTitle);D();};this.handleArrowNav=function(K){var J=K||window.event;var I=J.srcElement||J.target;if(I&&I.form){return;}if(J.keyCode==39){MF.Calendar.Month.gotoNextMonth(MF.Calendar.Month.currentDate)();}else{if(J.keyCode==37){MF.Calendar.Month.gotoPrevMonth(MF.Calendar.Month.currentDate)();}}};this.setPreferences=function(I){if(I!=null){E=I;}};this.savePreferences=function(){MF.Calendar.Service.setCalendarPreferences(E);};}).call(MF.Calendar.Month);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.MonthEventItem=JsonML.BST(["span",{"class":function(){return"js-DayItem "+this.data.type.toLowerCase();},style:function(){return MF.Calendar.Month.getStyle(this.data.type);}}," ",["a",{href:function(){return this.data.url;}},["strong",{"jbst:visible":function(){return !this.data.allDay;}},function(){return this.data.date.toString(MF.ShortTimeFormat);}]," ",function(){return this.data.title;}]]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.AddEventDialog=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind({height:125,width:600,modal:true,data:this.data},this.index,this.count,{$:[""," ",["div",{"class":"events"}," ",["h2",function(){return this.data.id===0?"Create event":"Edit event";}]," ",function(){return JsonML.BST(MF.Calendar.EditEvent).dataBind(this.data,this.index,this.count);}," "]," "]});});(function(){this.showAddEvent=function(B,D){var C={allDay:true,date:B,description:"",id:0,isRecurring:false,location:"",parentId:0,title:"",type:"General"};if(D){MF.Calendar.EditEvent.onSaveCallback=D;}var A=MF.Calendar.AddEventDialog.bind(C);if(A){document.body.appendChild(A);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}};}).call(MF.Calendar.AddEventDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.EditEvent=JsonML.BST([""," ",["div",{"class":"addnew add-event"}," ",["form",{id:"UpdateEvent","class":"js-UnsavedData js-EnableKeys",title:"You haven't saved your event. Are you sure you want to leave this page?",onsubmit:"return false"}," ",["input",{type:"hidden",name:"cid",value:function(){return this.data.id;}}]," ",["p",["label",{"for":"event-title"},"Title"]," ",["input",{type:"text","jbst:onload":"this.focus();","class":"text active",name:"eventtitle",value:function(){return this.data.title;}}]]," ",["p",{"class":"add-date"},["label",{"for":"event-date"},"Date"]," ",["input",{type:"text","class":"text active",name:"date",value:function(){return this.data.date.toString(MF.LongDateFormat);},onfocus:"this.select()",onblur:function(){return this.updateDate(this.data);}}]," ",["label",{"for":"event-time","class":"event-time"},"Time"]," ",["input",{type:"text","class":"text active",name:"time",value:function(){return this.data.allDay?this.formatTime(this.data.date.clearTime()):this.formatTime(this.data.date);},onfocus:"this.select()",onblur:function(){return this.updateTime(this.data);}}]," ",["label",{"class":"event-recurring"}," ",["input",{id:"recurrence",type:"checkbox",name:"recurrence",value:"1","jbst:visible":function(){return !this.data.isRecurring;}}]," ",["span",{"jbst:visible":function(){return !this.data.isRecurring;},onclick:"$('#recurrence')[0].checked = !$('#recurrence')[0].checked;return false;"},["strong","Repeat annually"]]]," "]," ",["p",{"class":"add-loc"},["label",{"for":"event-loc"},"Location"]," ",["input",{type:"text","class":"text active",name:"location",value:function(){return this.data.location;}}]," ",["select",{size:"1",name:"eventtype"}," ",["option",{selected:function(){return !this.data.type||this.data.type=="General"?"selected":"";},value:"General"},"General"]," ",["option",{selected:function(){return this.data.type=="Anniversary"?"selected":"";},value:"Anniversary"},"Anniversary"]," ",["option",{selected:function(){return this.data.type=="Birthday"?"selected":"";},value:"Birthday"},"Birthday"]," ",["option",{selected:function(){return this.data.type=="Holiday"?"selected":"";},value:"Holiday"},"Holiday"]," ",["option",{selected:function(){return this.data.type=="Reunion"?"selected":"";},value:"Reunion"},"Reunion"]," ",["option",{selected:function(){return this.data.type=="Wedding"?"selected":"";},value:"Wedding"},"Wedding"]," "]]," ",["p",["label",{"for":"event-desc"},"Description"]," ",["textarea",{"class":"active js-expand",name:"description"},function(){return this.data.description;}]]," ",function(){return JsonML.BST(MF.Help.FormatGuide).dataBind(this.data,this.index,this.count);}," ",["p",{"class":"submit"}," ",["a",{href:"",onclick:function(){return this.updateEvent;},"class":"positive"},function(){return JsonFx.Lang.get("Global,SaveChanges");}]," or ",["a",{"class":"js-EscKeyTarget",onclick:function(){return this.cancelEdit;},href:function(){return this.cancelUrl||"#";}},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]]," "]," "],""," "]);(function(){var A="All Day";this.updateEvent=function(){var D=this.form;MF.Message.clear(D,MF.Message.Scope.Column);var F=MF.Forms.getFormData(D);if(!F.eventtitle){MF.Message.showError(D,"Please enter a title.",MF.Message.Scope.Column);return false;}var C=Date.parse(F.date);var E=true;if(F.time!==A){var B=Date.parse(F.time);if(!(C instanceof Date)||!(B instanceof Date)){MF.Message.showError(D,"Please enter a date and time.",MF.Message.Scope.Column);return false;}C=C.set({hour:B.getHours(),minute:B.getMinutes(),second:0});E=false;}if(!F.recurrence){F.recurrence=false;}else{F.recurrence=F.recurrence==="1";}MF.Forms.disableSubmit(D);if(F.cid>0){MF.Calendar.Service.updateEvent(F.cid,F.eventtitle,MF.TimeZone.AsISO8601UTC(C),C.getTimezoneOffset(),E,F.recurrence,F.location,F.description,F.eventtype,{onSuccess:function(G){if(D.markClean){D.markClean();}if(MF.Calendar.EditEvent.onSaveCallback){MF.Calendar.EditEvent.onSaveCallback(G);}else{window.location.pathname=G.url;}},onComplete:function(){MF.Forms.enableSubmit(D);}});}else{MF.Calendar.Service.createEvent(F.eventtitle,MF.TimeZone.AsISO8601UTC(C),C.getTimezoneOffset(),E,F.recurrence,F.location,F.description,F.eventtype,{onSuccess:function(G){if(D.markClean){D.markClean();}if(MF.Calendar.EditEvent.onSaveCallback){MF.Calendar.EditEvent.onSaveCallback(G);}else{if("function"===typeof MF.Calendar.EditEvent.saveTagsFunction){MF.Calendar.EditEvent.saveTagsFunction(G.contentId,function(H){window.location.pathname=G.url;});}}},onComplete:function(){MF.Forms.enableSubmit(D);}});}return false;};this.cancelEdit=function(){var B=$("#UpdateEvent")[0];if(B.markClean){B.markClean();}if(!MF.Calendar.EditEvent.cancelUrl){MF.Dialog.remove();return false;}};this.updateDate=function(B){return function(){var D=MF.Calendar.EditEvent.formatDate(Date.parse(this.value));var C=MF.Calendar.EditEvent.formatDate(B.date);if(D.length===0){this.value=C;}else{this.value=D;}};};this.updateTime=function(B){return function(){var D=MF.Calendar.EditEvent.formatTime(this.value);var C=MF.Calendar.EditEvent.formatTime(B.date);if(D.length===0){this.value=A;}else{this.value=D;}};};this.formatDate=function(B){if(B instanceof Date&&B.getUTCFullYear()>=1753){return B.toString(MF.LongDateFormat);}return"";};this.formatTime=function(B){if(B instanceof Date){if(B.getHours()==0&&B.getMinutes()==0){return A;}else{return B.toString(MF.ShortTimeFormat);}}else{if(B&&B.length>0){if(B.toLowerCase().indexOf("all")!=-1){return A;}else{return MF.Calendar.EditEvent.formatTime(Date.parse(B));}}}return"";};}).call(MF.Calendar.EditEvent);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.DeleteEventDialog=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind(this.data.recurring?{height:125,width:460,modal:false,data:this.data}:{height:125,width:200,modal:false,data:this.data},this.index,this.count,{$:[""," ",["h2"," Delete event "]," ",["p",{"jbst:visible":function(){return this.data.recurring;}}," This event is a recurring event. You can delete only this occurrence, this occurrence and all future occurrences, or all occurrences. "]," ",["p",{"jbst:visible":function(){return !this.data.recurring;}}," All edits and comments will be lost. "]," ",["p",{"class":"submit"}," ",["a",{"class":"positive",onclick:function(){return MF.Calendar.DeleteEventDialog.doDelete(MF.Calendar.DeleteEventDialog.DeleteOne,this.data.callback);}},"Delete ",function(){return this.data.recurring?"only":"";}," this event"]," ",["a",{"jbst:visible":function(){return this.data.recurring;},"class":"positive",onclick:function(){return MF.Calendar.DeleteEventDialog.doDelete(MF.Calendar.DeleteEventDialog.DeleteFuture,this.data.callback);}},"Delete future events"]," ",["a",{"jbst:visible":function(){return this.data.recurring;},"class":"positive",onclick:function(){return MF.Calendar.DeleteEventDialog.doDelete(MF.Calendar.DeleteEventDialog.DeleteAll,this.data.callback);}},"Delete all events"]," or ",["a",{href:"#cancel",onclick:function(){return MF.Dialog.remove;}},["strong","cancel"]]," "],"\n"]});});(function(){this.DeleteAll=1;this.DeleteFuture=2;this.DeleteOne=3;this.doDelete=function(A,B){return function(){if(this.disabled){return false;}this.disabled=true;B(A,MF.Dialog.remove);return false;};};this.showDlg=function(A,B,D){var C=MF.Calendar.DeleteEventDialog.bind({callback:D,recurring:A,title:B});if(C){document.body.appendChild(C);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}};this.getTitle=function(B){var A="Delete the event";if(B.recurring){A+="(s)";}return A+' "'+B.title+'"?';};}).call(MF.Calendar.DeleteEventDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.EditEventDialog=JsonML.BST(function(){return JsonML.BST(MF.Dialog).dataBind({height:125,width:460,modal:false,data:this.data},this.index,this.count,{$:[""," ",["h2","Edit only this event"]," ",["p"," This event is a recurring event. Any edits will only affect this single occurrence. To make changes to a recurring event please delete it and create a new one. "]," ",["p",{"class":"submit"}," ",["a",{"class":"positive",onclick:function(){return MF.Calendar.EditEventDialog.doEdit(this.data.callback);}},"Edit event"]," or ",["a",{href:"#cancel",onclick:function(){return MF.Dialog.remove;}},["strong","Don't edit"]]," "]," "]});});(function(){this.doEdit=function(A){return function(){if(this.disabled){return false;}this.disabled=true;A(MF.Dialog.remove);return false;};};this.showDlg=function(B){var A=MF.Calendar.EditEventDialog.bind({callback:B});if(A){document.body.appendChild(A);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}}};}).call(MF.Calendar.EditEventDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.EventDetail=JsonML.BST([""," ",["div",{"class":"page-title"}," ",["h2",function(){return this.data.title;}]," ",["p",{"class":function(){return this.data.type.toLowerCase();}},function(){return this.data.type;}]," "]," ",["div",{"class":"event-details"}," ",["div",{"class":"event-date"}," ",["div",{"class":"date"}," ",["span",{"class":"month"},function(){return this.data.date.toString("ddd");}]," ",["span",{"class":"day"},function(){return this.data.date.toString("dd");}]," "]," "]," ",["p"," ",["strong","When:"]," ",function(){return this.data.date.toString(MF.LongDateFormat);}," ",function(){return this.data.allDay?"":("at "+this.data.date.toString(MF.ShortTimeFormat));},["br"]," ",["strong","Where:"]," ",function(){return this.data.location;}," "]," ",["p",{"class":"event-description"},function(){return JsonML.raw(this.data.description);}]," "]," "]);(function(){this.deleteEventClosure=function(A){return function(){MF.Calendar.Service.getEvent(A,{onSuccess:function(B){MF.Calendar.DeleteEventDialog.showDlg(B.isRecurring,B.title,function(C,D){MF.Calendar.Service.deleteEvent(A,C,{onSuccess:function(E){D();window.location.href=E.url;}});});}});return false;};};this.editEvent=function(A){MF.Calendar.Service.getEvent(A,{onSuccess:function(B){if(B.isRecurring){MF.Calendar.EditEventDialog.showDlg(function(){window.location.href=window.location.href+"/edit";});}else{window.location.href=window.location.href+"/edit";}}});return false;};}).call(MF.Calendar.EventDetail);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.EventsGrid=JsonML.BST(["div",{"class":"js-EventsGrid"}," ",function(){return JsonML.BST(MF.Toolbars.FilterBar).dataBind(MF.Calendar.EventsGrid.getSortBarData(this.data),this.index,this.count);}," ",function(){return JsonML.BST(MF.Calendar.EventsList).dataBind(this.data,this.index,this.count);}," ",["div",{"class":function(){return this.getNoResultsCss(this.data);},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"No results match that criteria."]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,MF.Calendar.EventsGrid.getEvents),this.index,this.count);}," "]);(function(){var F="yyyy-MM-dd";var O="";var M;var K;var A=null;var H=null;var G=null;var I=new MF.Toolbars.FilterBarMenu.Menu("Show",["All","Anniversary","Birthday","General","Holiday","Reunion","Wedding"],N);var E=new MF.Toolbars.FilterBarPeopleMenu.Menu(D);var B=new MF.Toolbars.FilterBarMenu.Menu("Sort",[{label:"Title",asc:true},{label:"Type",asc:true},{label:"Event date",asc:true}],L);var C=false;function J(P){var R="?view=list";if(P!==0){R+="&start="+P;}var Q=O;if(Q.length>0&&Q!=="Unknown"){R+="&et="+Q;}var S=E.getSelectedAsString();if(S.length>0){R+="&u="+S;}return R;}function N(Q,R,P){if(R===0){O="Unknown";}else{O=Q;}MF.Calendar.EventsGrid.getEvents(0);}function D(){MF.Calendar.EventsGrid.getEvents(0);}function L(S,P,R){if(R.selectedIdx===P){S.asc=!S.asc;}var Q=MF.getQueryParam("start",true,0);if(O.length===0){O="Unknown";}MF.Calendar.Service.getEvents(Q,M,K,O,P,S.asc,E.getSelectedUsers(),{onSuccess:function(T){T=MF.Calendar.EventsGrid.bind(T);$("div.js-EventsGrid").replaceWith(T);document.body.scrollIntoView(true);}});return true;}this.getEvents=function(Q,P){window.location.href=MF.Calendar.ThisUrl+J(Q);};this.getUrl=function(P){return MF.Calendar.EventsGrid.listUrlFmt.replace("{date}",P.toString(F))+J(0);};this.getSortBarData=function(P){if(!C){M=P.count;K=P.startDate;if(P.canAdd){A=new MF.Toolbars.FilterBarButton.Button("Create new event",MF.Calendar.NewUrl);}B.setSelection(P.sortData.colIdx).asc=P.sortData.asc;I.setSelection(P.sortData.filter);O=P.sortData.filter;H=new MF.Calendar.EventToolbarToggle.Toggle(window.location.pathname+"?view=month");G=new MF.Calendar.EventToolbarNav.Nav(P.startDate);C=true;}return{items:[A,G,I,E,B,H]};};this.getNoResultsCss=function(P){if(P.sortData.filter!=="Unknown"||E.getSelectionType()>0){return"";}else{return("events-empty"+(P.canAdd?"":" nopermission"));}};}).call(MF.Calendar.EventsGrid);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.EventsList=JsonML.BST(["table",{"class":"data",cellpadding:"0",cellspacing:"0","jbst:visible":function(){return this.data.total>0;}}," ",["tr"," ",["th",{"class":"title",width:"40%"},"Title"]," ",["th",{"class":"title"},"Type"]," ",["th",{"class":"author",width:"15%"},"Created by"]," ",["th",{"class":"meta"},"Views"]," ",["th",{"class":"meta"},"Comments"]," ",["th","Event date"]," "]," ",function(){return JsonML.BST(MF.Calendar.EventsGridItem).dataBind(this.data.items,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.EventsGridItem=JsonML.BST(["tr",{"class":function(){return this.index%2===0?"odd":"";}}," ",["td",{"class":"title"},["a",{href:function(){return this.data.url;}},function(){return this.data.title;}]]," ",["td",{"class":"type"},["span",{"class":function(){return this.getEventCss(this.data.type);}},function(){return this.data.type;}]],["td",{"class":"author"},["span",["a",{href:function(){return this.data.authorUrl;}},function(){return this.data.author;}]]]," ",["td",{"class":"meta"},function(){return this.data.viewCount;}," "],["td",{"class":"meta"},function(){return this.data.commentCount;}," "],["td",{"class":"date"},function(){return this.data.date.toString(MF.MediumDateFormat);}," ",["span",{"jbst:visible":function(){return !this.data.allDay;}},"\u2022 ",function(){return this.data.date.toString(MF.ShortTimeFormat);}]]," "]);(function(){this.getEventCss=function(A){return A.toLowerCase();};}).call(MF.Calendar.EventsGridItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.EventToolbarNav=JsonML.BST(["p",{"class":"sort calnav"}," ",["a",{href:function(){return MF.Calendar.EventsGrid.getUrl(this.data.startDate.clone().addYears(-1));},"class":"prev"},["span","PREV"]]," ",["a",{href:"","class":"this"},["span",{"class":"first"},function(){return this.data.startDate.toString("yyyy");}]]," ",["a",{href:function(){return MF.Calendar.EventsGrid.getUrl(this.data.startDate.clone().addYears(1));},"class":"next last"},["span","NEXT"]]," "]);(function(){this.Nav=function(A){this.type="eventnav";this.jbst=MF.Calendar.EventToolbarNav;this.startDate=A;};}).call(MF.Calendar.EventToolbarNav);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.EventToolbarToggle=JsonML.BST(["ul",{"class":"view"}," ",["li",{"class":"cal"},["a",{href:function(){return this.data.url;}},["span","View as Long"]]]," ",["li",{"class":"list active"},["a",{href:""},["span","View as List"]]]," "]);(function(){this.Toggle=function(A){this.type="eventtoggle";this.jbst=MF.Calendar.EventToolbarToggle;this.url=A;};}).call(MF.Calendar.EventToolbarToggle);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.EventPublisher=JsonML.BST(["div",{"class":"add-panel add-event js-add-panel"}," ",["form",{id:"event-publisher"}," ",["p",["label",{"for":"eventTitle"},"Title"]," ",["input",{type:"text","class":"text active",name:"eventTitle"}]]," ",["p",{"class":"add-date"},["label",{"for":"eventDate"},"Date"]," ",["input",{type:"text",name:"eventDate","class":"text js-InlineInstruction",title:function(){return MF.MediumDateFormat.toLowerCase();},value:function(){return this.formatDate(Date.today());},onfocus:"this.select()",onchange:"this.value=MF.Calendar.EventPublisher.formatDate(Date.parse(this.value));"}]," ",["label",{"for":"event-time","class":"event-time"},"Time"]," ",["input",{type:"text","class":"text active",name:"time",value:function(){return this.formatTime(this.data);},onfocus:"this.select()",onchange:"this.value=MF.Calendar.EventPublisher.formatTime(this.value);"}]," ",["label",{"class":"event-recurring"},["input",{id:"recurrence",type:"checkbox",name:"recurrence",value:"1"}]," ",["span",{onclick:"$('#recurrence')[0].checked = !$('#recurrence')[0].checked;return false;"},["strong","Repeat annually"]]]," "]," ",["p",{"class":"add-loc"},["label",{"for":"location"},"Location"]," ",["input",{type:"text","class":"text active",name:"location"}]," ",["select",{name:"eventType"}," ",["option",{selected:"selected",value:"General"},"General"]," ",["option",{value:"Anniversary"},"Anniversary"]," ",["option",{value:"Birthday"},"Birthday"]," ",["option",{value:"Holiday"},"Holiday"]," ",["option",{value:"Reunion"},"Reunion"]," ",["option",{value:"Wedding"},"Wedding"]," "]]," ",["p",["label",{"for":"description"},"Description"]," ",["textarea",{name:"description","class":"active"}]]," ",function(){return JsonML.BST(MF.Help.FormatGuide).dataBind(this.data,this.index,this.count);}," ",["p",{"class":"submit"},["a",{href:"#createevent","class":"positive",onclick:function(){return MF.Calendar.EventPublisher.post;}},"Post event"]," or ",["a",{href:"#cancel",onclick:function(){return MF.Publisher.Module.reset;}},["strong","cancel"]]]," "]," "]);(function(){var A="All Day";this.post=function(){var C=this.form;MF.Message.clear(C,MF.Message.Scope.Column);var E=MF.Forms.getFormData(C);if(!E.eventTitle){MF.Message.showError(C,"Please enter a title.",MF.Message.Scope.Column);return false;}E.eventDate=Date.parse(E.eventDate);var D=true;if(E.time!==A){var B=Date.parse(E.time);if(!(E.eventDate instanceof Date)||!(B instanceof Date)){MF.Message.showError(C,"Please enter a date and time.",MF.Message.Scope.Column);return false;}E.eventDate=E.eventDate.set({hour:B.getHours(),minute:B.getMinutes(),second:0});D=false;}if(!E.recurrence){E.recurrence=false;}else{E.recurrence=E.recurrence==="1";}MF.Forms.disableSubmit(C);MF.Calendar.Service.createAsActivity(E.eventTitle,MF.TimeZone.AsISO8601UTC(E.eventDate),E.eventDate.getTimezoneOffset(),D,E.recurrence,E.location,E.description,E.eventType,{onSuccess:function(F){MF.Activities.List.display(F);MF.Publisher.Module.reset.call(C);},onComplete:function(){MF.Forms.enableSubmit(C);}});return false;};this.updateTime=function(B){return function(){var D=MF.Calendar.EventPublisher.formatTime(this.value);var C=MF.Calendar.EventPublisher.formatTime(B.date);if(D.length===0){this.value=C;}else{this.value=D;}};};this.formatDate=function(B){if(B instanceof Date&&B.getUTCFullYear()>=1753){return B.toString(MF.MediumDateFormat);}return"";};this.formatTime=function(B){if(B instanceof Date){if(B.getHours()==0&&B.getMinutes()==0){return A;}else{return B.toString(MF.ShortTimeFormat);}}else{if(B&&B.length>0){if(B.toLowerCase().indexOf("all")!=-1){return A;}else{return MF.Calendar.EventPublisher.formatTime(Date.parse(B));}}}return A;};}).call(MF.Calendar.EventPublisher);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.UpcomingEventList=JsonML.BST(["div",{"jbst:visible":function(){return this.data.total>0;}}," ",["div",{"class":"section-title"}," ",["h3",function(){return JsonFx.Lang.get("Global,EventsList");}]," ",["p",{"class":"section-title-extra","jbst:visible":function(){return this.data.addUrl.length>0;}},["a",{"class":"add",href:function(){return this.data.addUrl;}},"Add new"]]," "]," ",["div",{"class":"box events"}," ",function(){return JsonML.BST(MF.Calendar.UpcomingEventListItem).dataBind(this.data.items,this.index,this.count);}," ",["p",{"class":"extra","jbst:visible":function(){return this.data.total>this.data.count;}}," ",["a",{href:function(){return this.data.url;}},function(){return JsonFx.Lang.get("Global,EventListMore");}]," "]," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Calendar){MF.Calendar={};}MF.Calendar.UpcomingEventListItem=JsonML.BST(["div",{"class":"event-details"}," ",["p",["a",{href:function(){return this.data.url;}},function(){return this.data.label;}],["br"]," ",function(){return this.data.date.toString(MF.EventDateFormat)+(this.data.allDay?"":" at "+this.data.date.toString(MF.ShortTimeFormat));},["br"]," ",function(){return this.data.location;}]," ",["div",{"class":"event-date"}," ",["a",{href:function(){return this.data.url;}},["span",function(){return this.data.label;}]]," ",["div",{"class":"date"}," ",["span",{"class":"month"},function(){return this.data.date.toString("MMM");}]," ",["span",{"class":"day"},function(){return this.data.date.toString("dd");}]," "]," "]," "]);}catch(ex){}