function initCal(){$("#eventsCal").fullCalendar({header:{left:"",center:"prev prevYear title nextYear next",right:""},theme:!1,slotEventOverlap:!0,allDayDefault:!0,dayClick:function(n){changeView("day"),$("#eventsCal").fullCalendar("gotoDate",n.getFullYear(),n.getMonth(),n.getDate())},eventClick:function(){},eventAfterAllRender:function(n){var t=n.name=="month"?"summary":"detail";t=="summary"&&$("#eventsCal").find(".calPopOver").popover({trigger:"click",delay:{show:200,hide:200},html:!0}),$(".fc-view.fc-view-month.fc-grid").find(".awayGameCalItem").children().prepend('<span class="icon-road"></span> '),$(".fc-view.fc-view-month.fc-grid").find(".homeGameCalItem").children().prepend('<span class="icon-home"></span> '),$(".fc-view.fc-view-month.fc-grid").find(".fc-event-type-Practice").children().prepend('<span class="icon-screenshot"></span> '),$(".fc-view.fc-view-month.fc-grid").find(".fc-event-type-Tournament").children().prepend('<span class="icon-map-marker"></span> '),$(".fc-view.fc-view-month.fc-grid").find(".fc-event-type-Event").children().prepend('<span class="icon-th-list"></span> ')},timeFormat:"h:mmt { - h:mmt }"}),setCalendarDateFromCookie()}function setCalendarDateFromCookie(){var t=cookieHelper(),n=t.read("lastCalDate");n!=undefined&&(n=new Date(n)),$("#eventsCal").fullCalendar("gotoDate",n)}function generateItemData(){return updateEventsDataIfNeeded(),window.calEventsDetail}function generateSummaryData(){return updateEventsDataIfNeeded(),window.calEventsSummary}function changeCalData(n){var t,i,r;$("#eventsCalLoadingContainer").show(),t=$("#eventsCal"),n==null&&(i=t.fullCalendar("getView").name,n=i=="month"?"details":"summary"),t.fullCalendar("removeEvents"),$(".monthViewButton").removeClass("active"),n==="summary"?(window.calEventsSummary=null,r=generateSummaryData(),t.fullCalendar("removeEventSource",window.calEventsDetail),t.fullCalendar("addEventSource",window.calEventsSummary),t.find(".calPopOver").popover({trigger:"click",delay:{show:200,hide:200},html:!0}),showCalDataSummaryUi()):(r=generateItemData(),t.fullCalendar("removeEventSource",window.calEventsSummary),t.fullCalendar("addEventSource",window.calEventsDetail),showCalDataDetailsUi()),t.fullCalendar("rerenderEvents"),fixTbaTimes()}function updateEventsDataIfNeeded(){var i=$("#eventsCal"),f=i.fullCalendar("getView"),n=$(".fc-day").data("date"),t=$(".fc-day:last").data("date"),r=new Date(n),u=new Date(t);(window.calEventsSummary==null||window.calEventsDetail==null||window.dataDateStart==null||window.dataDateEnd==null||r<window.dataDateStart||u>window.dataDateEnd)&&getEventsFromServer(n,t)}function getEventsFromServer(n,t){var i=$("#eventsCal"),r,u,f;i.fullCalendar("removeEvents"),r=n,u=t,(r==null||u==null)&&(i.view!=undefined?(r=i.view.start,u=i.view.end):(f=i.fullCalendar("getDate"),f==null&&(f=new Date),r=f.moveToFirstDayOfMonth().moveToDayOfWeek(0,-1),u=f.moveToLastDayOfMonth().moveToDayOfWeek(0,-1).addDays(6))),ajaxUrl="/School/GetEventsByEntity/",ajaxData={startDate:r.toString("yyyy-M-d"),endDate:u.toString("yyyy-M-d")},$.ajax({type:"POST",async:!1,cache:!1,dataType:"json",url:ajaxUrl,data:ajaxData,beforeSend:function(){},error:function(){},complete:function(){},success:function(n,t){t==="success"&&(window.calEventsSummary=$.parseJSON(n.EventsFilteredSummaryString),window.calEventsDetail=$.parseJSON(n.EventsFilteredDetailString),window.dataDateStart=new Date(n.DataDateStart),window.dataDateEnd=new Date(n.DataDateEnd))}})}function showCalDataDetailsUi(){$("#eventsCalLoadingContainer").hide()}function showCalDataSummaryUi(){$("#eventsCalLoadingContainer").hide()}function changeCalDate(n){var t=new Date($("#yearLabel").html(),n-1,1),i=new Date(t).moveToLastDayOfMonth(),r=$("#eventsCal");$("#monthPickerContainer").hide(),r.fullCalendar("gotoDate",t),changeToNewDatesIfNeeded(t,i),changeView("month"),changeCalData("detail"),fixTbaTimes()}function getDayDetails(n){for(var i=generateItemData(),r="",f,t=0,u=i.length;t<u;t++)f=i[t].start,n.toString("yyyy-MM-dd")==f.toString("yyyy-MM-dd")&&(r+=i[t].title+"<hr/>");return r}function changeToNewDates(n,t){typeof n=="string"&&(n=Date.parse(n)),typeof t=="string"&&(t=Date.parse(t)),getEventsFromServer(n,t)}function changeToNewDatesIfNeeded(n,t){typeof n=="string"&&(n=Date.parse(n)),typeof t=="string"&&(t=Date.parse(t)),(n.isBefore(window.dataDateStart)||t.isAfter(window.dataDateEnd))&&changeToNewDates(n,t)}function changeView(n){var e,u,f,t,s;if($("#eventsCalLoadingContainer").show(),n&&n!=="undefined"&&n.length!=0){n==="month"&&$(".popover").hide(),e=cookieHelper(),e.create("lastView",n,999);var i=$("#eventsCal"),o=i.fullCalendar("getView"),r=o.start,h=o.end;initViewNav(n);switch(n){case"month":$("#calToolbar").show(),t=i.fullCalendar("getDate"),t&&t!=null&&(u=Date.parse(t.toString("yyyy-MM-dd")).moveToFirstDayOfMonth(),f=Date.parse(t.toString("yyyy-MM-dd")).moveToLastDayOfMonth(),changeToNewDatesIfNeeded(u,f)),displayCalView(),i.find(".fc-widget-header").css({"border-top":"none","border-bottom":"none",color:"#8d8d8d"}),i.fullCalendar("changeView",n),i.find(".calPopOver").popover({trigger:"click",delay:{show:200,hide:200},html:!0});break;case"week":case"basicWeek":$("#calToolbar").hide();var t=i.fullCalendar("getDate"),u=t.getDay()>0?Date.parse(t.toString("yyyy-MM-dd")).moveToDayOfWeek(0,-1):Date.parse(t.toString("yyyy-MM-dd")),f=Date.parse(t.toString("yyyy-MM-dd")).addDays(6);changeToNewDatesIfNeeded(u,f),displayCalView(),i.fullCalendar("changeView","basicWeek");break;case"day":case"agendaDay":$("#calToolbar").hide(),$(".fc-agenda-days").find("thead").hide(),localStorage.getItem("hasDayViewLoadBefore")===null&&localStorage.setItem("hasDayViewLoadBefore",!0),t=i.fullCalendar("getDate"),changeToNewDatesIfNeeded(t,t),displayCalView(),i.fullCalendar("changeView","agendaDay")}isValidDate(r)||(r=new Date),isValidDate(r)&&i.fullCalendar("gotoDate",r),localStorage.getItem("hasDayViewLoadBefore")==="true"&&(i.fullCalendar("gotoDate",new Date),s=cookieHelper(),s.create("lastCalDate",new Date),localStorage.setItem("hasDayViewLoadBefore",!1)),changeCalData(),changeCalenderViewBtnTitle(n)}}function initViewNav(n){$(".gamesViewNavItem").removeClass("active");switch(n){case"list":$("#gamesViewNavList").addClass("active"),$("#monthDetailsSummaryContainer").hide();break;case"month":$("#monthDetailsSummaryContainer").show();break;case"week":case"basicWeek":$("#gamesViewNavWeek").addClass("active"),$("#eventsCal").fullCalendar("changeView","basicWeek"),$("#monthDetailsSummaryContainer").show();break;case"day":case"agendaDay":$("#monthDetailsSummaryContainer").hide()}}function displayListView(){$("#scheduleTableContainer").show(),$("#filterContainerDate").show(),$("#gameCountTitle").show(),$("#calToolbar").hide(),$("#calView").hide(),$("#listViewContainer").show(),$("#gridOptionsContainer").show(),$("#gridFooter").show(),$(".checkAllContainerOuter").show(),$("#scheduleTable").find(".listCheckbox").show()}function displayCalView(){$("#filterContainerDate").hide(),$("#scheduleTableContainer").hide(),$("#gridOptionsContainer").hide(),$("#gridFooter").hide(),$(".checkAllContainerOuter").hide(),$("#scheduleTable").find(".listCheckbox").hide(),$("#listViewContainer").hide(),$("#calView").show(),$(".fc-view").html().length==0&&$("#eventsCal").fullCalendar("render")}function printEvents(){}function fixTbaTimes(){$("#eventsCal").find(".fc-event-time").each(function(){var t=$(this).text();t.indexOf("12:01")!=-1&&$(this).text("TBA")})}function changeCalenderViewBtnTitle(n){switch(n){case"month":$("#gamesViewNavMonthReskin").addClass("btnactive"),$("#gamesViewNavDayReskin").removeClass("btnactive"),$(".fc-button-next").attr("title","Next Month"),$(".fc-button-prev").attr("title","Previous Month");break;case"day":case"agendaDay":$("#gamesViewNavDayReskin").addClass("btnactive"),$("#gamesViewNavMonthReskin").removeClass("btnactive"),$(".fc-button-next").attr("title","Next Day"),$(".fc-button-prev").attr("title","Previous Day")}}var priorView,resizeTimer;!function(n){var t=function(t){this.element=n(t)};t.prototype={constructor:t,show:function(){var t=this.element,f=t.closest("ul:not(.dropdown-menu)"),i=t.attr("data-target"),r,u;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=f.find(".active a").last()[0],t.trigger({type:"show",relatedTarget:r}),u=n(i),this.activate(t.parent("li"),f),this.activate(u,u.parent(),function(){t.trigger({type:"shown",relatedTarget:r})}))},activate:function(t,i,r){function e(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),f?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var u=i.find("> .active"),f=r&&n.support.transition&&u.hasClass("fade");f?u.one(n.support.transition.end,e):e(),u.removeClass("in")}},n.fn.tab=function(i){return this.each(function(){var u=n(this),r=u.data("tab");r||u.data("tab",r=new t(this)),typeof i=="string"&&r[i]()})},n.fn.tab.Constructor=t,n(function(){n("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),n(this).tab("show")})})}(window.jQuery),function(n){function o(t,r,u,f){var o={data:f||(r?r.data:{}),_wrap:r?r._wrap:null,tmpl:null,parent:r||null,nodes:[],calls:nt,nest:tt,wrap:it,html:d,update:rt};return t&&n.extend(o,t,{nodes:[],parent:r}),u&&(o.tmpl=u,o._ctnt=o._ctnt||o.tmpl(n,o),o.key=++e,(c.length?s:i)[e]=o),o}function f(t,i,r){var e,o=r?n.map(r,function(n){return typeof n=="string"?t.key?n.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+u+'="'+t.key+'" $2'):n:f(n,t,n._ctnt)}):t;return i?o:(o=o.join(""),o.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(t,i,r,u){e=n(r).get(),y(e),i&&(e=a(i).concat(e)),u&&(e=e.concat(a(u)))}),e?e:a(o))}function a(t){var i=document.createElement("div");return i.innerHTML=t,n.makeArray(i.childNodes)}function w(t){return new Function("jQuery","$item","var $=jQuery,call,_=[],$data=$item.data;with($data){_.push('"+n.trim(t).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(t,i,r,u,f,e,o){var h=n.tmpl.tag[r],c,s,a;if(!h)throw"Template command not found: "+r;return c=h._default||[],e&&!/\w$/.test(f)&&(f+=e,e=""),f?(f=l(f),o=o?","+l(o)+")":e?")":"",s=e?f.indexOf(".")>-1?f+e:"("+f+").call($item"+o:f,a=e?s:"(typeof("+f+")==='function'?("+f+").call($item):("+f+"))"):a=s=c.$1||"null",u=l(u),"');"+h[i?"close":"open"].split("$notnull_1").join(f?"typeof("+f+")!=='undefined' && ("+f+")!=null":"true").split("$1a").join(a).split("$1").join(s).split("$2").join(u?u.replace(/\s*([^\(]+)\s*(\((.*?)\))?/g,function(n,t,i,r){return r=r?","+r+")":i?")":"",r?"("+t+").call($item"+r:n}):c.$2||"")+"_.push('"})+"');}return _;")}function p(t,i){t._wrap=f(t,!0,n.isArray(i)?i:[b.test(i)?i:n(i).html()]).join("")}function l(n){return n?n.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function g(n){var t=document.createElement("div");return t.appendChild(n.cloneNode(!0)),t.innerHTML}function y(t){function p(t){function p(n){n=n+a,f=v[n]=v[n]||o(f,i[f.parent.key+a]||f.parent,null,!0)}var y,h=t,c,f,l;if(l=t.getAttribute(u)){while(h.parentNode&&(h=h.parentNode).nodeType===1&&!(y=h.getAttribute(u)));y!==l&&(h=h.parentNode?h.nodeType===11?0:h.getAttribute(u)||0:0,(f=i[l])||(f=s[l],f=o(f,i[h]||s[h],null,!0),f.key=++e,i[e]=f),r&&p(l)),t.removeAttribute(u)}else r&&(f=n.data(t,"tmplItem"))&&(p(f.key),i[f.key]=f,h=n.data(t.parentNode,"tmplItem"),h=h?h.key:0);if(f){for(c=f;c&&c.key!=h;)c.nodes.push(t),c=c.parent;delete f._ctnt,delete f._wrap,n.data(t,"tmplItem",f)}}for(var a="_"+r,c,l,v={},h,f=0,y=t.length;f<y;f++)if((c=t[f]).nodeType===1){for(l=c.getElementsByTagName("*"),h=l.length-1;h>=0;h--)p(l[h]);p(c)}}function nt(n,t,i,r){if(!n)return c.pop();c.push({_:n,tmpl:t,item:this,data:i,options:r})}function tt(t,i,r){return n.tmpl(n.template(t),i,r,this)}function it(t,i){var r=t.options||{};return r.wrapped=i,n.tmpl(n.template(t.tmpl),t.data,r,t.item)}function d(t,i){var r=this._wrap;return n.map(n(n.isArray(r)?r.join(""):r).filter(t||"*"),function(n){return i?n.innerText||n.textContent:n.outerHTML||g(n)})}function rt(){var t=this.nodes;n.tmpl(null,null,null,this).insertBefore(t[0]),n(t).remove()}var k=n.fn.domManip,u="_tmplitem",b=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,i={},s={},h,v={key:0,data:{}},e=0,r=0,c=[];n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,u){n.fn[t]=function(f){var e=[],s=n(f),c,o,a,v,l=this.length===1&&this[0].parentNode;if(h=i||{},l&&l.nodeType===11&&l.childNodes.length===1&&s.length===1)s[u](this[0]),e=this;else{for(o=0,a=s.length;o<a;o++)r=o,c=(o>0?this.clone(!0):this).get(),n.fn[u].apply(n(s[o]),c),e=e.concat(c);r=0,e=this.pushStack(e,t,s.selector)}return v=h,h=null,n.tmpl.complete(v),e}}),n.fn.extend({tmpl:function(t,i,r){return n.tmpl(this[0],t,i,r)},tmplItem:function(){return n.tmplItem(this[0])},template:function(t){return n.template(t,this[0])},domManip:function(t,u,f){if(t[0]&&t[0].nodeType){for(var o=n.makeArray(arguments),s=t.length,c=0,l;c<s&&!(l=n.data(t[c++],"tmplItem")););s>1&&(o[0]=[n.makeArray(t)]),l&&r&&(o[2]=function(t){n.tmpl.afterManip(this,t,f)}),k.apply(this,o)}else k.apply(this,arguments);return r=0,h||n.tmpl.complete(i),this}}),n.extend({tmpl:function(t,r,u,e){var h,c=!e;if(c)e=v,t=n.template[t]||n.template(null,t),s={};else if(!t)return t=e.tmpl,i[e.key]=e,e.nodes=[],e.wrapped&&p(e,e.wrapped),n(f(e,null,e.tmpl(n,e)));return t?(typeof r=="function"&&(r=r.call(e||{})),u&&u.wrapped&&p(u,u.wrapped),h=n.isArray(r)?n.map(r,function(n){return n?o(u,e,t,n):null}):[o(u,e,t,r)],c?n(f(e,null,h)):h):[]},tmplItem:function(t){var i;for(t instanceof n&&(t=t[0]);t&&t.nodeType===1&&!(i=n.data(t,"tmplItem"))&&(t=t.parentNode););return i||v},template:function(t,i){return i?(typeof i=="string"?i=w(i):i instanceof n&&(i=i[0]||{}),i.nodeType&&(i=n.data(i,"tmpl")||n.data(i,"tmpl",w(i.innerHTML))),typeof t=="string"?n.template[t]=i:i):t?typeof t!="string"?n.template(null,t):n.template[t]||n.template(null,b.test(t)?t:n(t)):null},encode:function(n){return(""+n).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}}),n.extend(n.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){_=_.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(_,$1,$2);_=[];",close:"call=$item.calls();_=call._.concat($item.wrap(call,_));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){_.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){_.push($.encode($1a));}"},"!":{open:""}},complete:function(){i={}},afterManip:function(t,i,u){var f=i.nodeType===11?n.makeArray(i.childNodes):i.nodeType===1?[i]:[];u.call(t,i),y(f),r++}})}(jQuery),!function(n){var i=function(i,r){if(this.element=n(i),this.format=t.parseFormat(r.format||this.element.data("date-format")||"mm/dd/yyyy"),this.picker=n(t.template).appendTo("body").on("mousedown",n.proxy(this.mousedown,this)).on("click",n.proxy(this.click,this)),this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on"):!1,this.isInput)this.element.on({focus:n.proxy(this.show,this),click:n.proxy(this.show,this),blur:n.proxy(this.blur,this),keyup:n.proxy(this.update,this),keydown:n.proxy(this.keydown,this)});else if(this.component)this.component.on("click",n.proxy(this.show,this));else this.element.on("click",n.proxy(this.show,this));this.viewMode=0,this.weekStart=r.weekStart||this.element.data("date-weekstart")||0,this.weekEnd=this.weekStart==0?6:this.weekStart-1,this.fillDow(),this.fillMonths(),this.update(),this.showMode()},t;i.prototype={constructor:i,show:function(t){this.update(),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place();n(window).on("resize",n.proxy(this.place,this));n("body").on("click",n.proxy(this.hide,this));if(t&&(t.stopPropagation(),t.preventDefault()),!this.isInput)n(document).on("mousedown",n.proxy(this.hide,this));this.element.trigger({type:"show",date:this.date})},setValue:function(){var n=t.formatDate(this.date,this.format);this.isInput?this.element.prop("value",n):(this.component&&this.element.find("input").prop("value",n),this.element.data("date",n))},place:function(){var n=this.component?this.component.offset():this.element.offset();this.picker.css({top:n.top+this.height,left:n.left})},update:function(){this.date=t.parseDate(this.isInput?this.element.prop("value"):this.element.data("date"),this.format),this.viewDate=new Date(this.date),this.fill()},fillDow:function(){for(var i=this.weekStart,n="<tr>";i<this.weekStart+7;)n+='<th class="dow">'+t.dates.daysMin[i++%7]+"</th>";n+="</tr>",this.picker.find(".datepicker-days thead").append(n)},fillMonths:function(){for(var n="",i=0;i<12;)n+='<span class="month">'+t.dates.monthsShort[i++]+"</span>";this.picker.find(".datepicker-months td").append(n)},fill:function(){var c=new Date(this.viewDate),i=c.getFullYear(),o=c.getMonth(),v=this.date.valueOf(),n,s,u,r,f,h,l,a,e;for(this.picker.find(".datepicker-days th:eq(1)").text(t.dates.months[o]+" "+i),n=new Date(i,o-1,28,0,0,0,0),s=t.getDaysInMonth(n.getFullYear(),n.getMonth()),n.setDate(s),n.setDate(s-(n.getDay()-this.weekStart+7)%7),u=new Date(n),u.setDate(u.getDate()+42),u=u.valueOf(),r=[];n.valueOf()<u;)n.getDay()==this.weekStart&&r.push("<tr>"),f="",n.getMonth()<o?f+=" old":n.getMonth()>o&&(f+=" new"),n.valueOf()==v&&(f+=" active"),r.push('<td class="day'+f+'">'+n.getDate()+"</td>"),n.getDay()==this.weekEnd&&r.push("</tr>"),n.setDate(n.getDate()+1);for(this.picker.find(".datepicker-days tbody").empty().append(r.join("")),h=this.date.getFullYear(),l=this.picker.find(".datepicker-months").find("th:eq(1)").text(i).end().find("span").removeClass("active"),h==i&&l.eq(this.date.getMonth()).addClass("active"),r="",i=parseInt(i/10,10)*10,a=this.picker.find(".datepicker-years").find("th:eq(1)").text(i+"-"+(i+9)).end().find("td"),i-=1,e=-1;e<11;e++)r+='<span class="year'+(e==-1||e==10?" old":"")+(h==i?" active":"")+'">'+i+"</span>",i+=1;a.html(r)},blur:function(){},hide:function(){this.picker.hide(),n(window).off("resize",this.place),this.viewMode=0,this.showMode(),this.isInput||n(document).off("mousedown",this.hide),n("body").off("click",n.proxy(this.click,this))},click:function(n){n.stopPropagation(),n.preventDefault()},mousedown:function(i){var r,e,u,f;if(i.stopPropagation(),i.preventDefault(),r=n(i.target).closest("span, td, th"),r.length==1)switch(r[0].nodeName.toLowerCase()){case"th":switch(r[0].className){case"switch":this.showMode(1);break;case"prev":case"next":this.viewDate["set"+t.modes[this.viewMode].navFnc].call(this.viewDate,this.viewDate["get"+t.modes[this.viewMode].navFnc].call(this.viewDate)+t.modes[this.viewMode].navStep*(r[0].className=="prev"?-1:1)),this.fill()}break;case"span":r.is(".month")?(u=r.parent().find("span").index(r),this.viewDate.setMonth(u)):(f=parseInt(r.text(),10)||0,this.viewDate.setFullYear(f)),this.showMode(-1),this.fill();break;case"td":r.is(".day")&&(e=parseInt(r.text(),10)||1,u=this.viewDate.getMonth(),r.is(".old")?u-=1:r.is(".new")&&(u+=1),f=this.viewDate.getFullYear(),this.date=new Date(f,u,e,0,0,0,0),this.viewDate=new Date(f,u,e,0,0,0,0),this.fill(),this.setValue(),this.element.trigger({type:"changeDate",date:this.date}),this.hide())}},keydown:function(n){var t=n.keyCode||n.which;t==9&&this.hide()},showMode:function(n){n&&(this.viewMode=Math.max(0,Math.min(2,this.viewMode+n))),this.picker.find(">div").hide().filter(".datepicker-"+t.modes[this.viewMode].clsName).show()}},n.fn.datepicker=function(t){return this.each(function(){var u=n(this),r=u.data("datepicker"),f=typeof t=="object"&&t;r||u.data("datepicker",r=new i(this,n.extend({},n.fn.datepicker.defaults,f))),typeof t=="string"&&r[t]()})},n.fn.datepicker.defaults={},n.fn.datepicker.Constructor=i,t={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],dates:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},isLeapYear:function(n){return n%4==0&&n%100!=0||n%400==0},getDaysInMonth:function(n,i){return[31,t.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][i]},parseFormat:function(n){var i=n.match(/[.\/-].*?/),t=n.split(/\W+/);if(!i||!t||t.length==0)throw new Error("Invalid date format.");return{separator:i,parts:t}},parseDate:function(n,t){var u=new Date,f=n.split(t.separator),n=new Date(u.getFullYear(),u.getMonth(),u.getDate(),0,0,0),i,r,e;if(f.length==t.parts.length)for(r=0,e=t.parts.length;r<e;r++){i=parseInt(f[r],10)||1;switch(t.parts[r]){case"dd":case"d":n.setDate(i);break;case"mm":case"m":n.setMonth(i-1);break;case"yy":i<100?n.setFullYear(2e3+i):n.setFullYear(i);break;case"yyyy":n.setFullYear(i)}}return n},formatDate:function(n,t){var i={d:n.getDate(),m:n.getMonth()+1,yy:n.getFullYear().toString().substring(2),yyyy:n.getFullYear()},n,r,u;for(i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m,n=[],r=0,u=t.parts.length;r<u;r++)n.push(i[t.parts[r]]);return n.join(t.separator)},headTemplate:'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>'},t.template='<div class="datepicker dropdown-menu"><div class="datepicker-days"><table class=" table-condensed">'+t.headTemplate+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+t.headTemplate+t.contTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+t.headTemplate+t.contTemplate+"</table></div></div>"}(window.jQuery),!function(n){function r(t){var r=this.options,o=this,f=this.$element.find("ul"),u,i,e;if(!(r.total<=r.pageRows))for(u=f.find("li:last"),i=t;i<t+r.length;i++){if(i==this.totalPages)break;e=n("<li/>").insertBefore(u).append(n("<a>").attr("rel",i+1).attr("href","#").text(i+1))}}function i(n){for(var t=this.options,f=this.$element.find("ul"),s,i,o,e=f.find("li").size()-2;e>0;e--)f.find("li").eq(e).remove();s=n,i=t.length/2,t.length%2>0&&(i=(t.length+1)/2),o=0,n>=0&&n<this.totalPages&&(n>=i&&(this.totalPages-n>i?o=n-(i-1):this.totalPages>t.length&&(o=this.totalPages-t.length)),r.call(this,o),f.find("li").removeClass("active"),f.find("li a[rel="+(s+1)+"]").parent().addClass("active")),u.call(this)}function u(){var n=this.options;this.totalPages>1?(this.currentPage>0?this.btnPrev.removeClass("disabled"):this.btnPrev.addClass("disabled"),this.currentPage==this.totalPages-1?this.btnNext.addClass("disabled"):this.btnNext.removeClass("disabled")):(this.btnPrev.addClass("disabled"),this.btnNext.addClass("disabled"))}var t=function(t,i){var r=this;this.options=i,this.$element=n(t).addClass("pagination").empty();var u=n("<ul/>").appendTo(this.$element),f=this.btnPrev=n('<li class="prev"><a href="#">'+this.options.prev+"</a></li>"),e=this.btnNext=n('<li class="next"><a href="#">'+this.options.next+"</a></li>");u.append(f).append(e),this.$element.delegate("li:enabled, li","click.pagination",function(t){t.preventDefault();var i=n(this),u=r.$element.find("ul");r.currentPage=i.hasClass("prev")?parseInt(u.find("li.active a").text())-1:i.hasClass("next")?parseInt(u.find("li.active a").text())+1:parseInt(i.text()),r.load(--r.currentPage)})};t.prototype={constructor:t,show:function(n,t){this.options.start=t||this.options.start,this.options.total=n||this.options.total,this.currentPage=this.options.start-1,this.totalPages=parseInt(this.options.total/this.options.pageRows),this.options.total%this.options.pageRows>0&&this.totalPages++,i.call(this,this.currentPage),this.options.initLoad&&this.load(this.currentPage)},load:function(n){if(i.call(this,n),this.options.onChange)this.options.onChange(this.currentPage+1)}},n.fn.pagination=function(i){var r=Array.prototype.slice.call(arguments);return r.shift(),this.each(function(){var f=n(this),u=f.data("pagination"),e=n.extend({},n.fn.pagination.defaults,typeof i=="object"&&i);u||f.data("pagination",u=new t(this,e)),typeof i=="string"&&u[i].apply(u,r)})},n.fn.pagination.defaults={total:0,pageRows:0,length:10,next:"Next",prev:"Prev",first:"First",last:"Last",start:1,initLoad:!1,onChange:null},n.fn.pagination.Constructor=t}(window.jQuery),!function(n){var t=function(n,t){this.init("tooltip",n,t)};t.prototype={constructor:t,init:function(t,i,r){var u,f;if(this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger!="manual"){u=this.options.trigger=="hover"?"mouseenter":"focus",f=this.options.trigger=="hover"?"mouseleave":"blur";this.$element.on(u,this.options.selector,n.proxy(this.enter,this));this.$element.on(f,this.options.selector,n.proxy(this.leave,this))}this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=n.extend({},n.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var i=n(t.currentTarget)[this.type](this._options).data(this.type);i.options.delay&&i.options.delay.show?(i.hoverState="in",setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)):i.show()},leave:function(t){var i=n(t.currentTarget)[this.type](this._options).data(this.type);i.options.delay&&i.options.delay.hide?(i.hoverState="out",setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)):i.hide()},show:function(){var t,u,n,f,e,i,r;if(this.hasContent()&&this.enabled){t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),i=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,u=/in/.test(i),t.remove().css({top:0,left:0,display:"block"}).appendTo(u?this.$element:document.body),n=this.getPosition(u),f=t[0].offsetWidth,e=t[0].offsetHeight;switch(u?i.split(" ")[1]:i){case"bottom":r={top:n.top+n.height,left:n.left+n.width/2-f/2};break;case"top":r={top:n.top-e,left:n.left+n.width/2-f/2};break;case"left":r={top:n.top+n.height/2-e/2,left:n.left-f};break;case"right":r={top:n.top+n.height/2-e/2,left:n.left+n.width}}t.css(r).addClass(i).addClass("in")}},setContent:function(){var n=this.tip();n.find(".tooltip-inner").html(this.getTitle()),n.removeClass("fade in top bottom left right")},hide:function(){function i(){var i=setTimeout(function(){t.off(n.support.transition.end).remove()},500);t.one(n.support.transition.end,function(){clearTimeout(i),t.remove()})}var r=this,t=this.tip();t.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?i():t.remove()},fixTitle:function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return n.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var n,i=this.$element,t=this.options;return n=i.attr("data-original-title")||(typeof t.title=="function"?t.title.call(i[0]):t.title),n=n.toString().replace(/(^\s*|\s*$)/,"")},tip:function(){return this.$tip=this.$tip||n(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},n.fn.tooltip=function(i){return this.each(function(){var u=n(this),r=u.data("tooltip"),f=typeof i=="object"&&i;r||u.data("tooltip",r=new t(this,f)),typeof i=="string"&&r[i]()})},n.fn.tooltip.Constructor=t,n.fn.tooltip.defaults={animation:!0,delay:0,selector:!1,placement:"top",trigger:"hover",title:"",template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'}}(window.jQuery),function(n,t){function dt(t){n.extend(!0,nt,t)}function br(u,f,e){function di(n){v?(ct(),wt(),yt(),w(n)):gi()}function gi(){pi=f.theme?"ui":"fc",u.addClass("fc"),f.isRTL?u.addClass("fc-rtl"):u.addClass("fc-ltr"),f.theme&&u.addClass("ui-widget"),v=n("<div class='fc-content' style='position:relative'/>").prependTo(u),b=new sr(h,f),d=b.render(),d&&u.prepend(d),ni(f.defaultView),n(window).resize(pt),kt()||dt()}function dt(){setTimeout(function(){!o.start&&kt()&&w()},0)}function nr(){n(window).unbind("resize",pt),b.destroy(),v.remove(),u.removeClass("fc fc-rtl ui-widget")}function nt(){return ft.offsetWidth!==0}function kt(){return n("body")[0].offsetWidth!==0}function ni(t){if(!o||t!=o.name){p++,rt();var i=o,r;i?((i.beforeHide||ui)(),l(v,v.height()),i.element.hide()):l(v,1),v.css("overflow","hidden"),o=ut[t],o?o.element.show():o=ut[t]=new s[t](r=it=n("<div class='fc-view fc-view-"+t+"' style='position:absolute'/>").appendTo(v),h),i&&b.deactivateButton(i.name),b.activateButton(t),w(),v.css("overflow",""),i&&l(v,1),r||(o.afterShow||ui)(),p--}}function w(n){var i,r;nt()&&(p++,rt(),g===t&&ct(),i=!1,!o.start||n||c<o.start||c>=o.end?(o.render(c,n||0),ht(!0),i=!0):o.sizeDirty?(o.clearEvents(),ht(),i=!0):o.eventsDirty&&(o.clearEvents(),i=!0),o.sizeDirty=!1,o.eventsDirty=!1,ki(i),lt=u.outerWidth(),b.updateTitle(o.title),r=new Date,r>=o.start&&r<o.end?b.disableButton("today"):b.enableButton("today"),p--,o.trigger("viewDisplay",ft))}function bt(){wt(),nt()&&(ct(),ht(),rt(),o.clearEvents(),o.renderEvents(st),o.sizeDirty=!1)}function wt(){n.each(ut,function(n,t){t.sizeDirty=!0})}function ct(){g=f.contentHeight?f.contentHeight:f.height?f.height-(d?d.height():0)-y(v):Math.round(v.width()/Math.max(f.aspectRatio,.5))}function ht(n){p++,o.setHeight(g,n),it&&(it.css("position","relative"),it=null),o.setWidth(v.width(),n),p--}function pt(){if(!p)if(o.start){var n=++gt;setTimeout(function(){n==gt&&!p&&nt()&&lt!=(lt=u.outerWidth())&&(p++,bt(),o.trigger("windowResize",ft),p--)},200)}else dt()}function ki(n){!f.lazyFetching||tr(o.visStart,o.visEnd)?at():n&&ot()}function at(){yi(o.visStart,o.visEnd)}function bi(n){st=n,ot()}function wi(n){ot(n)}function ot(n){yt(),nt()&&(o.clearEvents(),o.renderEvents(st,n),o.eventsDirty=!1)}function yt(){n.each(ut,function(n,t){t.eventsDirty=!0})}function vi(n,i,r){o.select(n,i,r===t?!0:r)}function rt(){o&&o.unselect()}function ai(){w(-1)}function li(){w(1)}function ci(){vt(c,-1),w()}function si(){vt(c,1),w()}function oi(){c=new Date,w()}function ei(n,t,r){n instanceof Date?c=i(n):hi(c,n,t,r),w()}function fi(n,i,u){n!==t&&vt(c,n),i!==t&&tt(c,i),u!==t&&r(c,u),w()}function ri(){return i(c)}function ii(){return o}function ti(n,i){if(i===t)return f[n];(n=="height"||n=="contentHeight"||n=="aspectRatio")&&(f[n]=i,bt())}function ir(n,t){if(f[n])return f[n].apply(t||ft,Array.prototype.slice.call(arguments,2))}var h=this;h.options=f,h.render=di,h.destroy=nr,h.refetchEvents=at,h.reportEvents=bi,h.reportEventChange=wi,h.rerenderEvents=ot,h.changeView=ni,h.select=vi,h.unselect=rt,h.prev=ai,h.next=li,h.prevYear=ci,h.nextYear=si,h.today=oi,h.gotoDate=ei,h.incrementDate=fi,h.formatDate=function(n,t){return a(n,t,f)},h.formatDates=function(n,t,i){return et(n,t,i,f)},h.getDate=ri,h.getView=ii,h.option=ti,h.trigger=ir,rr.call(h,f,e);var tr=h.isFetchNeeded,yi=h.fetchEvents,ft=u[0],b,d,v,pi,o,ut={},lt,g,it,gt=0,p=0,c=new Date,st=[],k;hi(c,f.year,f.month,f.date),f.droppable&&n(document).bind("dragstart",function(t,i){var u=t.target,e=n(u),r;e.parents(".fc").length||(r=f.dropAccept,(n.isFunction(r)?r.call(u,e):e.is(r))&&(k=u,o.dragStart(k,t,i)))}).bind("dragstop",function(n,t){k&&(o.dragStop(k,n,t),k=null)})}function sr(t,i){function o(){r=i.theme?"ui":"fc";var t=i.header;if(t)return u=n("<table class='fc-header' style='width:100%'/>").append(n("<tr/>").append(e("left")).append(e("center")).append(e("right")))}function h(){u.remove()}function e(u){var f=n("<td class='fc-header-"+u+"'/>"),e=i.header[u];return e&&n.each(e.split(" "),function(u){u>0&&f.append("<span class='fc-header-space'/>");var e;n.each(this.split(","),function(u,o){var l,h;if(o=="title")f.append("<span class='fc-header-title'><h2>&nbsp;</h2></span>"),f.append("<span id='calTitleContainer' class='fc-header-title'><h3 id='calTitle' onclick='$(\"#monthPickerContainer\").slideDown();' title='Pick from Years and Months'>&nbsp;</h3></span>"),e&&e.addClass(r+"-corner-right"),e=null;else if(t[o]?l=t[o]:s[o]&&(l=function(){h.removeClass(r+"-state-hover"),t.changeView(o)}),l){var a=i.theme?rt(i.buttonIcons,o):null,v=rt(i.buttonText,o),c="";switch(o){case"prev":c="Previous Month";break;case"next":c="Next Month";break;case"prevYear":c="Previous Year";break;case"nextYear":c="Next Year";break;case"today":c="Today"}h=n("<span class='fc-button fc-button-"+o+" "+r+"'-state-default' title='"+c+"'>"+(a?"<span class='fc-icon-wrap'><span class='ui-icon ui-icon-"+a+"'/></span>":v)+"</span>").click(function(){if(!h.hasClass(r+"-state-disabled")){l();var t="summary";t=n("button:disabled").text().trim().toLowerCase(),changeCalData(t),fixTbaTimes()}}).mousedown(function(){h.not("."+r+"-state-active").not("."+r+"-state-disabled").addClass(r+"-state-down")}).mouseup(function(){h.removeClass(r+"-state-down")}).hover(function(){h.not("."+r+"-state-active").not("."+r+"-state-disabled").addClass(r+"-state-hover")},function(){h.removeClass(r+"-state-hover").removeClass(r+"-state-down")}).appendTo(f),k(h),e||h.addClass(r+"-corner-left"),e=h}}),e&&e.addClass(r+"-corner-right")}),f}function c(t){t+="<span id='monthChangerIcon'><i class='fa-solid fa-angle-down'></i></span>",n("#calTitle").html(t)}function l(n){u.find("span.fc-button-"+n).addClass(r+"-state-active")}function a(n){u.find("span.fc-button-"+n).removeClass(r+"-state-active")}function v(n){u.find("span.fc-button-"+n).addClass(r+"-state-disabled")}function y(n){u.find("span.fc-button-"+n).removeClass(r+"-state-disabled")}var f=this,u,r;f.render=o,f.destroy=h,f.updateTitle=c,f.activateButton=l,f.deactivateButton=a,f.disableButton=v,f.enableButton=y,u=n([])}function rr(r,u){function bt(n,t){return!h||n<h||t>c}function ot(n,t){var u,r,i;for(h=n,c=t,e=[],u=++b,r=s.length,y=r,i=0;i<r;i++)et(s[i],u)}function et(t,i){tt(t,function(u){if(i==b){if(u){r.eventDataTransform&&(u=n.map(u,r.eventDataTransform)),t.eventDataTransform&&(u=n.map(u,t.eventDataTransform));for(var f=0;f<u.length;f++)u[f].source=t,l(u[f]);e=e.concat(u)}y--,y||a(e)}})}function tt(t,u){for(var a=f.sourceFetchers,s,e,y,o=0;o<a.length;o++){if(s=a[o](t,h,c,u),s===!0)return;if(typeof s=="object"){tt(s,u);return}}if(e=t.events,e)n.isFunction(e)?(nt(),e(i(h),i(c),function(n){u(n),k()})):n.isArray(e)?u(e):u();else if(y=t.url,y){var b=t.success,d=t.error,it=t.complete,l=n.extend({},t.data||{}),p=v(t.startParam,r.startParam),w=v(t.endParam,r.endParam);p&&(l[p]=Math.round(+h/1e3)),w&&(l[w]=Math.round(+c/1e3)),nt(),n.ajax(n.extend({},wi,t,{data:l,success:function(t){t=t||[];var i=g(b,this,arguments);n.isArray(i)&&(t=i),u(t)},error:function(){g(d,this,arguments),u()},complete:function(){g(it,this,arguments),k()}}))}else u()}function st(n){n=d(n),n&&(y++,et(n,b))}function d(t){return n.isFunction(t)||n.isArray(t)?t={events:t}:typeof t=="string"&&(t={url:t}),typeof t=="object"?(wt(t),s.push(t),t):void 0}function ht(t){s=n.grep(s,function(n){return!rt(n,t)}),e=n.grep(e,function(n){return!rt(n.source,t)}),a(e)}function ct(n){for(var f=e.length,t,r=pt().defaultEventEnd,o=n.start-n._start,u=n.end?n.end-(n._end||r(n)):0,i=0;i<f;i++)t=e[i],t._id==n._id&&t!=n&&(t.start=new Date(+t.start+o),t.end=n.end?t.end?new Date(+t.end+u):new Date(+r(t)+u):null,t.title=n.title,t.url=n.url,t.allDay=n.allDay,t.className=n.className,t.editable=n.editable,t.color=n.color,t.backgroudColor=n.backgroudColor,t.borderColor=n.borderColor,t.textColor=n.textColor,l(t));l(n),a(e)}function lt(n,t){l(n),n.source||(t&&(w.events.push(n),n.source=w),e.push(n)),a(e)}function at(t){var r,i;if(t)for(n.isFunction(t)||(r=t+"",t=function(n){return n._id==r}),e=n.grep(e,t,!0),i=0;i<s.length;i++)n.isArray(s[i].events)&&(s[i].events=n.grep(s[i].events,t,!0));else for(e=[],i=0;i<s.length;i++)n.isArray(s[i].events)&&(s[i].events=[]);a(e)}function vt(t){return n.isFunction(t)?n.grep(e,t):t?(t+="",n.grep(e,function(n){return n._id==t})):e}function nt(){ut++||ft("loading",null,!0)}function k(){--ut||ft("loading",null,!1)}function l(n){var u=n.source||{},f=v(u.ignoreTimezone,r.ignoreTimezone);n._id=n._id||(n.id===t?"_fc"+li++:n.id+""),n.date&&(n.start||(n.start=n.date),delete n.date),n._start=i(n.start=yt(n.start,f)),n.end=yt(n.end,f),n.end&&n.end<=n.start&&(n.end=null),n._end=n.end?i(n.end):null,n.allDay===t&&(n.allDay=v(u.allDayDefault,r.allDayDefault)),n.className?typeof n.className=="string"&&(n.className=n.className.split(/\s+/)):n.className=[]}function wt(n){var i,t;for(n.className?typeof n.className=="string"&&(n.className=n.className.split(/\s+/)):n.className=[],i=f.sourceNormalizers,t=0;t<i.length;t++)i[t](n)}function rt(n,t){return n&&t&&it(n)==it(t)}function it(n){return(typeof n=="object"?n.events||n.url:"")||n}var o=this,p;o.isFetchNeeded=bt,o.fetchEvents=ot,o.addEventSource=st,o.removeEventSource=ht,o.updateEvent=ct,o.renderEvent=lt,o.removeEvents=at,o.clientEvents=vt,o.normalizeEvent=l;var ft=o.trigger,pt=o.getView,a=o.reportEvents,w={events:[]},s=[w],h,c,b=0,y=0,ut=0,e=[];for(p=0;p<u.length;p++)d(u[p])}function vt(n,t,i){return n.setFullYear(n.getFullYear()+t),i||h(n),n}function tt(n,t,r){if(+n){var f=n.getMonth()+t,u=i(n);for(u.setDate(1),u.setMonth(f),n.setMonth(f),r||h(n);n.getMonth()!=u.getMonth();)n.setDate(n.getDate()+(n<u?1:-1))}return n}function r(n,t,r){if(+n){var f=n.getDate()+t,u=i(n);u.setHours(9),u.setDate(f),n.setDate(f),r||h(n),ct(n,u)}return n}function ct(n,t){if(+n)while(n.getDate()!=t.getDate())n.setTime(+n+(n<t?1:-1)*ki)}function u(n,t){return n.setMinutes(n.getMinutes()+t),n}function h(n){return n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0),n}function i(n,t){return t?h(new Date(+n)):new Date(+n)}function yi(){var t=0,n;do n=new Date(1970,t++,1);while(n.getHours());return n}function o(n,t,i){for(t=t||1;!n.getDay()||i&&n.getDay()==1||!i&&n.getDay()==6;)r(n,t);return n}function e(n,t){return Math.round((i(n,!0)-i(t,!0))/pi)}function hi(n,i,r,u){i!==t&&i!=n.getFullYear()&&(n.setDate(1),n.setMonth(0),n.setFullYear(i)),r!==t&&r!=n.getMonth()&&(n.setDate(1),n.setMonth(r)),u!==t&&n.setDate(u)}function yt(n,i){return typeof n=="object"?n:typeof n=="number"?new Date(n*1e3):typeof n=="string"?n.match(/^\d+(\.\d+)?$/)?new Date(parseFloat(n)*1e3):(i===t&&(i=!0),ht(n,i)||(n?new Date(n):null)):null}function ht(n,t){var i=n.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/),r,u,f;return i?(r=new Date(i[1],0,1),t||!i[13]?(u=new Date(i[1],0,1,9,0),i[3]&&(r.setMonth(i[3]-1),u.setMonth(i[3]-1)),i[5]&&(r.setDate(i[5]),u.setDate(i[5])),ct(r,u),i[7]&&r.setHours(i[7]),i[8]&&r.setMinutes(i[8]),i[10]&&r.setSeconds(i[10]),i[12]&&r.setMilliseconds(Number("0."+i[12])*1e3),ct(r,u)):(r.setUTCFullYear(i[1],i[3]?i[3]-1:0,i[5]||1),r.setUTCHours(i[7]||0,i[8]||0,i[10]||0,i[12]?Number("0."+i[12])*1e3:0),i[14]&&(f=Number(i[16])*60+(i[18]?Number(i[18]):0),f*=i[15]=="-"?1:-1,r=new Date(+r+f*6e4))),r):null}function lt(n){var t,i;return typeof n=="number"?n*60:typeof n=="object"?n.getHours()*60+n.getMinutes():(t=n.match(/(\d+)(?::(\d+))?\s*(\w+)?/),t?(i=parseInt(t[1],10),t[3]&&(i%=12,t[3].toLowerCase().charAt(0)=="p"&&(i+=12)),i*60+(t[2]?parseInt(t[2],10):0)):void 0)}function a(n,t,i){return et(n,null,t,i)}function et(n,t,i,r){var v,h;r=r||nt;for(var e=n,l=t,c=i.length,o,u,y,s="",f=0;f<c;f++)if(o=i.charAt(f),o=="'"){for(u=f+1;u<c;u++)if(i.charAt(u)=="'"){e&&(s+=u==f+1?"'":i.substring(f+1,u),f=u);break}}else if(o=="("){for(u=f+1;u<c;u++)if(i.charAt(u)==")"){h=a(e,i.substring(f+1,u),r),parseInt(h.replace(/\D/,""),10)&&(s+=h),f=u;break}}else if(o=="["){for(u=f+1;u<c;u++)if(i.charAt(u)=="]"){v=i.substring(f+1,u),h=a(e,v,r),h!=a(l,v,r)&&(s+=h),f=u;break}}else if(o=="{")e=t,l=n;else if(o=="}")e=n,l=t;else{for(u=c;u>f;u--)if(y=st[i.substring(f,u)]){e&&(s+=y(e,r)),f=u-1;break}u==f&&e&&(s+=o)}return s}function or(n){var i,t=new Date(n.getTime());return t.setDate(t.getDate()+4-(t.getDay()||7)),i=t.getTime(),t.setMonth(0),t.setDate(1),Math.floor(Math.round((i-t)/864e5)/7)+1}function p(n){return n.end?hr(n.end,n.allDay):r(i(n.start),1)}function hr(n,t){return n=i(n),t||n.getHours()||n.getMinutes()?r(n,1):h(n)}function lr(n,t){return(t.msLength-n.msLength)*100+(n.event.start-t.event.start)}function ci(n,t){return n.end>t.start&&n.start<t.end}function ft(n,t,r,u){for(var v=[],y=n.length,c,e,o,s,h,l,a,f=0;f<y;f++)c=n[f],e=c.start,o=t[f],o>r&&e<u&&(e<r?(s=i(r),l=!1):(s=e,l=!0),o>u?(h=i(u),a=!1):(h=o,a=!0),v.push({event:c,start:s,end:h,isStart:l,isEnd:a,msLength:h-s}));return v.sort(lr)}function ut(n){for(var i=[],o=n.length,u,t,e,f,r=0;r<o;r++){for(u=n[r],t=0;;){if(e=!1,i[t])for(f=0;f<i[t].length;f++)if(ci(i[t][f],u)){e=!0;break}if(e)t++;else break}i[t]?i[t].push(u):i[t]=[u]}return i}function vi(i,r,u){i.unbind("mouseover").mouseover(function(i){for(var f=i.target,o,s,e;f!=this;)o=f,f=f.parentNode;(s=o._fci)!==t&&(o._fci=t,e=r[s],u(e.event,e.element,e),n(i.target).trigger(i)),i.stopPropagation()})}function w(t,i,r){for(var u=0,f;u<t.length;u++)f=n(t[u]),f.width(Math.max(0,i-it(f,r)))}function ai(t,i,r){for(var u=0,f;u<t.length;u++)f=n(t[u]),f.height(Math.max(0,i-y(f,r)))}function it(n,t){return yr(n)+wr(n)+(t?pr(n):0)}function yr(t){return(parseFloat(n.css(t[0],"paddingLeft",!0))||0)+(parseFloat(n.css(t[0],"paddingRight",!0))||0)}function pr(t){return(parseFloat(n.css(t[0],"marginLeft",!0))||0)+(parseFloat(n.css(t[0],"marginRight",!0))||0)}function wr(t){return(parseFloat(n.css(t[0],"borderLeftWidth",!0))||0)+(parseFloat(n.css(t[0],"borderRightWidth",!0))||0)}function y(n,t){return fr(n)+dr(n)+(t?oi(n):0)}function fr(t){return(parseFloat(n.css(t[0],"paddingTop",!0))||0)+(parseFloat(n.css(t[0],"paddingBottom",!0))||0)}function oi(t){return(parseFloat(n.css(t[0],"marginTop",!0))||10)+(parseFloat(n.css(t[0],"marginBottom",!0))||10)}function dr(t){return(parseFloat(n.css(t[0],"borderTopWidth",!0))||10)+(parseFloat(n.css(t[0],"borderBottomWidth",!0))||10)}function l(n,t){t=typeof t=="number"?t+"px":t,n.each(function(n,i){i.style.cssText+=";min-height:"+t+";_height:"+t})}function ui(){}function ri(n,t){return n-t}function ii(n){return Math.max.apply(Math,n)}function c(n){return(n<10?"0":"")+n}function rt(n,i){if(n[i]!==t)return n[i];for(var f=i.split(/(?=[A-Z])/),r=f.length-1,u;r>=0;r--)if(u=n[f[r].toLowerCase()],u!==t)return u;return n[""]}function b(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")}function gt(n){return n.id+"/"+n.className+"/"+n.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function k(n){n.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function d(n){n.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function cr(n,t){n.each(function(n,i){i.className=i.className.replace(/^fc-\w*/,"fc-"+at[t.getDay()])})}function pt(n,t){var i=n.source||{},u=n.color,f=i.color,e=t("eventColor"),o=n.backgroundColor||u||i.backgroundColor||f||t("eventBackgroundColor")||e,s=n.borderColor||u||i.borderColor||f||t("eventBorderColor")||e,h=n.textColor||i.textColor||t("eventTextColor"),r=[];return o&&r.push("background-color:"+o),s&&r.push("border-color:"+s),h&&r.push("color:"+h),r.join(";")}function g(t,i,r){if(n.isFunction(t)&&(t=[t]),t){for(var f,u=0;u<t.length;u++)f=t[u].apply(i,r)||f;return f}}function v(){for(var n=0;n<arguments.length;n++)if(arguments[n]!==t)return arguments[n]}function er(n,t){function h(n,t){var h,v;t&&(tt(n,t),n.setDate(1)),h=i(n,!0),h.setDate(1);var y=tt(i(h),1),l=i(h),c=i(y),p=f("firstDay"),a=f("weekends")?0:1;a&&(o(l),o(c,-1,!0)),r(l,-((l.getDay()-Math.max(p,a)+7)%7)),r(c,(7-c.getDay()+Math.max(p,a))%7),v=Math.round((c-l)/(pi*7)),f("weekMode")=="fixed"&&(r(c,(6-v)*7),v=6),u.title=s(h,f("titleFormat")),u.start=h,u.end=y,u.visStart=l,u.visEnd=c,e(v,a?5:7,!0)}var u=this;u.render=h,ot.call(u,n,t,"month");var f=u.opt,e=u.renderBasic,s=t.formatDate}function ur(n,t){function h(n,t){t&&r(n,t*7);var h=r(i(n),-((n.getDay()-f("firstDay")+7)%7)),a=r(i(h),7),c=i(h),l=i(a),v=f("weekends");v||(o(c),o(l,-1,!0)),u.title=s(c,r(i(l),-1),f("titleFormat")),u.start=h,u.end=a,u.visStart=c,u.visEnd=l,e(1,v?7:5,!1)}var u=this;u.render=h,ot.call(u,n,t,"basicWeek");var f=u.opt,e=u.renderBasic,s=t.formatDates}function kr(n,t){function h(n,t){t&&(r(n,t),f("weekends")||o(n,t<0?-1:1)),u.title=s(n,f("titleFormat")),u.start=u.visStart=i(n,!0),u.end=u.visEnd=r(i(u.start),1),e(1,1,!1)}var u=this;u.render=h,ot.call(u,n,t,"basicDay");var f=u.opt,e=u.renderBasic,s=t.formatDate}function ot(t,u,f){function gr(n,t,i){a=n,s=t,dr();var r=!it;r?kr():rr(),br(i)}function dr(){pt=c("isRTL"),pt?(nt=-1,g=s-1):(nt=1,g=0),pi=c("firstDay"),vi=c("weekends")?0:1,ut=c("theme")?"ui":"fc",gi=c("columnFormat"),b=c("weekNumbers"),ui=c("weekNumberTitle"),yt=c("weekNumberCalculation")!="iso"?"w":"W"}function kr(){di=n("<div style='position:absolute;z-index:8;top:5px;left:0'/>").appendTo(t)}function br(i){var r="",u,c,l=ut+"-widget-header",y=ut+"-widget-content",w=o.start.getMonth(),k=h(new Date),f,e,g;for(r+="<table class='fc-border-separate' style='width:100%' cellspacing='0'><thead><tr>",b&&(r+="<th class='fc-week-number "+l+"'/>"),u=0;u<s;u++)r+="<th class='proximaNova_400_16px calender-header fc-day-header fc-"+at[u]+" "+l+"'/>";for(r+="</tr></thead><tbody>",u=0;u<a;u++){for(r+="<tr class='fc-week'>",b&&(r+="<td class='fc-week-number "+y+"'><div/></td>"),c=0;c<s;c++)f=lt(u,c),e=["fc-day","fc-"+at[f.getDay()],y],f.getMonth()!=w&&e.push("fc-other-month"),+f==+k&&(e.push("fc-today"),e.push(ut+"-state-highlight")),r+="<td class='"+e.join(" ")+"' data-date='"+wt(f,"yyyy-MM-dd")+"'><div>",i&&(r+="<div class='fc-day-number'>"+f.getDate()+"</div>"),r+="<div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";r+="</tr>"}r+="</tbody></table>",nr(),tt&&tt.remove(),tt=n(r).appendTo(t),p=tt.find("thead"),ft=p.find(".fc-day-header"),it=tt.find("tbody"),v=it.find("tr"),et=it.find(".fc-day"),yi=v.find("td:first-child"),wi=v.eq(0).find(".fc-day-content > div"),d(p.add(p.find("tr"))),d(v),v.eq(0).addClass("fc-first"),v.filter(":last").addClass("fc-last"),b&&p.find(".fc-week-number").text(ui),ft.each(function(t,i){var r=ci(t);n(i).text(wt(r,gi))}),b&&it.find(".fc-week-number > div").each(function(t,i){var r=lt(t,0);n(i).text(wt(r,yt))}),et.each(function(t,i){var r=ci(t);vt("dayRender",o,r,n(i))}),hi(et)}function wr(t){ki=t;var r=ki-p.height(),i,u,f;c("weekMode")=="variable"?i=u=Math.floor(r/(a==1?2:6)):(i=Math.floor(r/a),u=r-i*(a-1)),yi.each(function(t,r){t<a&&(f=n(r),l(f.find("> div"),(t==a-1?u:i)-y(f)))}),tu()}function pr(n){dt=n,ot.clear(),rt=0,b&&(rt=p.find("th.fc-week-number").outerWidth()),kt=Math.floor((dt-rt)/s),w(ft.slice(0,-1),kt)}function hi(n){n.click(yr).mousedown(fr)}function yr(t){if(!c("selectable")){var i=ht(n(this).data("date"));vt("dayClick",this,i,!0,t)}}function ii(n,t,u){var f,v,h,c,l,y,p;for(u&&ct.build(),f=i(o.visStart),v=r(i(f),s),h=0;h<a;h++)c=new Date(Math.max(f,n)),l=new Date(Math.min(v,t)),c<l&&(pt?(y=e(l,f)*nt+g+1,p=e(c,f)*nt+g+1):(y=e(c,f),p=e(l,f)),hi(ri(h,y,h,p-1))),r(f,7),r(v,7)}function ri(n,i,r,u){var f=ct.rect(n,i,r,u,t);return ur(f,t)}function vr(n){return i(n)}function ar(n,t){ii(n,r(i(t),1),!0)}function lr(){gt()}function cr(n,t,i){var r=ai(n),u=et[r.row*s+r.col];vt("dayClick",u,n,t,i)}function nu(n,t){st.start(function(n){gt(),n&&ri(n.row,n.col,n.row,n.col)},t)}function hr(n,t,i){var r=st.stop(),u;gt(),r&&(u=oi(r),vt("drop",n,u,!0,t,i))}function sr(n){return i(n.start)}function or(n){return ot.left(n)}function er(n){return ot.right(n)}function ai(n){return{row:Math.floor(e(n,o.visStart)/7),col:li(n.getDay())}}function oi(n){return lt(n.row,n.col)}function lt(n,t){return r(i(o.visStart),n*7+t*nt+g)}function ci(n){return lt(Math.floor(n/s),n%s)}function li(n){return(n-Math.max(pi,vi)+s)%s*nt+g}function ir(n){return v.eq(n)}function tr(){var t=0;return b&&(t+=rt),{left:t,right:dt}}function nr(){l(t,t.height())}function tu(){l(t,1)}var o=this;o.renderBasic=gr,o.setHeight=wr,o.setWidth=pr,o.renderDayOverlay=ii,o.defaultSelectionEnd=vr,o.renderSelection=ar,o.clearSelection=lr,o.reportDayClick=cr,o.dragStart=nu,o.dragStop=hr,o.defaultEventEnd=sr,o.getHoverListener=function(){return st},o.colContentLeft=or,o.colContentRight=er,o.dayOfWeekCol=li,o.dateCell=ai,o.cellDate=oi,o.cellIsAllDay=function(){return!0},o.allDayRow=ir,o.allDayBounds=tr,o.getRowCnt=function(){return a},o.getColCnt=function(){return s},o.getColWidth=function(){return kt},o.getDaySegmentContainer=function(){return di},fi.call(o,t,u,f),ei.call(o),bt.call(o),bi.call(o);var c=o.opt,vt=o.trigger,rr=o.clearEvents,ur=o.renderOverlay,gt=o.clearOverlays,fr=o.daySelectionMousedown,wt=u.formatDate,tt,p,ft,it,v,et,yi,wi,di,dt,ki,kt,rt,a,s,ct,st,ot,pt,nt,g,pi,vi,ut,gi,b,ui,yt;k(t.addClass("fc-grid")),ct=new ni(function(t,i){var f,r,u;ft.each(function(t,e){f=n(e),r=f.offset().left,t&&(u[1]=r),u=[r],i[t]=u}),u[1]=r+f.outerWidth(),v.each(function(i,e){i<a&&(f=n(e),r=f.offset().top,i&&(u[1]=r),u=[r],t[i]=u)}),u[1]=r+f.outerHeight()}),st=new ti(ct),ot=new si(function(n){return wi.eq(n)})}function bi(){function h(n,t){it(n),l(e(n),t),f("eventAfterAllRender")}function s(){tt(),w().empty()}function e(u){for(var b=v(),k=a(),h=i(t.visStart),y=r(i(h),k),d=n.map(u,p),c,f,l,o,s,w=[],e=0;e<b;e++){for(c=ut(ft(u,d,h,y)),f=0;f<c.length;f++)for(l=c[f],o=0;o<l.length;o++)s=l[o],s.row=e,s.level=f,w.push(s);r(h,7),r(y,7)}return w}function b(n,t,i){et(n)&&st(n,t),i.isEnd&&rt(n)&&c(n,t,i),nt(n,t)}function st(n,t){var s=ot(),e;t.draggable({zIndex:9,delay:50,opacity:u("dragOpacity"),revertDuration:u("dragRevertDuration"),start:function(h,c){f("eventDragStart",t,n,h,c),d(n,t),s.start(function(f,s,h,c){t.draggable("option","revert",!f||!h&&!c),o(),f?(e=h*7+c*(u("isRTL")?-1:1),y(r(i(n.start),e),r(p(n),e))):e=0},h,"drag")},stop:function(i,r){s.stop(),o(),f("eventDragStop",t,n,i,r),e?k(this,n,e,0,n.allDay,i,r):(t.css("filter",""),g(n,t))}})}var t=this;t.renderEvents=h,t.compileDaySegs=e,t.clearEvents=s,t.bindDaySeg=b,wt.call(t);var u=t.opt,f=t.trigger,et=t.isEventDraggable,rt=t.isEventResizable,it=t.reportEvents,tt=t.reportEventClear,nt=t.eventElementHandlers,g=t.showEvents,d=t.hideEvents,k=t.eventDrop,w=t.getDaySegmentContainer,ot=t.getHoverListener,y=t.renderDayOverlay,o=t.clearOverlays,v=t.getRowCnt,a=t.getColCnt,l=t.renderDaySegs,c=t.resizableDayEvent}function ir(n,t){function h(n,t){t&&r(n,t*7);var h=r(i(n),-((n.getDay()-f("firstDay")+7)%7)),a=r(i(h),7),c=i(h),l=i(a),v=f("weekends");v||(o(c),o(l,-1,!0)),u.title=s(c,r(i(l),-1),f("titleFormat")),u.start=h,u.end=a,u.visStart=c,u.visEnd=l,e(v?7:5)}var u=this;u.render=h,kt.call(u,n,t,"agendaWeek");var f=u.opt,e=u.renderAgenda,s=t.formatDates}function tr(n,t){function h(n,t){t&&(r(n,t),f("weekends")||o(n,t<0?-1:1));var h=i(n,!0),c=r(i(h),1);u.title=s(n,f("titleFormat")),u.start=u.visStart=h,u.end=u.visEnd=c,e(1)}var u=this;u.render=h,kt.call(u,n,t,"agendaDay");var f=u.opt,e=u.renderAgenda,s=t.formatDate}function kt(f,o,s){function of(n){a=n,ef(),at?lu():ku(),ff()}function ef(){pt=l("theme")?"ui":"fc",eu=l("weekends")?0:1,su=l("firstDay"),(di=l("isRTL"))?(nt=-1,g=a-1):(nt=1,g=0),rt=lt(l("minTime")),ui=lt(l("maxTime")),ou=l("columnFormat"),fr=l("weekNumbers"),ur=l("weekNumberTitle"),bi=l("weekNumberCalculation")!="iso"?"w":"W",ot=l("snapMinutes")||l("slotMinutes")}function ku(){var e=pt+"-widget-header",s=pt+"-widget-content",t,r,o,c,h,v=l("slotMinutes")%15==0;for(t="<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'><thead><tr>",t+=fr?"<th class='fc-agenda-axis fc-week-number "+e+"'/>":"<th class='fc-agenda-axis "+e+"'>&nbsp;</th>",r=0;r<a;r++)t+="<th class='fc- fc-col"+r+" "+e+"'/>";for(t+="<th class='fc-agenda-gutter "+e+"'>&nbsp;</th></tr></thead><tbody><tr><th class='fc-agenda-axis "+e+"'>&nbsp;</th>",r=0;r<a;r++)t+="<td class='fc- fc-col"+r+" "+s+"'><div><div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";for(t+="<td class='fc-agenda-gutter "+s+"'>&nbsp;</td></tr></tbody></table>",at=n(t).appendTo(f),ct=at.find("thead"),li=ct.find("th").slice(1,-1),kt=at.find("tbody"),et=kt.find("td").slice(0,-1),uu=et.find("div.fc-day-content div"),or=et.eq(0),ru=or.find("> div"),d(ct.add(ct.find("tr"))),d(kt.add(kt.find("tr"))),ht=ct.find("th:first"),yt=at.find(".fc-agenda-gutter"),tt=n("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(f),l("allDaySlot")?(hr=n("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(tt),t="<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='"+e+" fc-agenda-axis'>"+l("allDayText")+"</th><td><div class='fc-day-content'><div style='position:relative'/></div></td><th class='"+e+" fc-agenda-gutter'>&nbsp;</th></tr></table>",pi=n(t).appendTo(tt),vi=pi.find("tr"),ar(vi.find("td")),ht=ht.add(pi.find("th:first")),yt=yt.add(pi.find("th.fc-agenda-gutter")),tt.append("<div class='fc-agenda-divider "+e+"'><div class='fc-agenda-divider-inner'/></div>")):hr=n([]),p=n("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(tt),b=n("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(p),tu=n("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(b),t="<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>",o=yi(),c=u(i(o),ui),u(o,rt),er=0,r=0;o<c;r++)h=o.getMinutes(),t+="<tr class='fc-slot"+r+" "+(h?"fc-minor":"")+"'><th class='fc-agenda-axis "+e+"'>"+(!v||!h?tr(o,l("axisFormat")):"&nbsp;")+"</th><td class='"+s+"'><div style='position:relative'>&nbsp;</div></td></tr>",u(o,l("slotMinutes")),er++;t+="</tbody></table>",ut=n(t).appendTo(b),pr=ut.find("div:first"),rr(ut.find("td")),ht=ht.add(ut.find("th:first"))}function ff(){var n,u,i,r,f=h(new Date),t;for(fr&&(t=tr(oi(0),bi),t=di?t+ur:ur+t,ct.find(".fc-week-number").text(t)),n=0;n<a;n++)r=oi(n),u=li.eq(n),u.html(tr(r,ou)),i=et.eq(n),+r==+f?i.addClass(pt+"-state-highlight fc-today"):i.removeClass(pt+"-state-highlight fc-today"),cr(u.add(i),r)}function uf(n,i){n===t&&(n=nu),nu=n,ir={};var r=kt.position().top,u=p.position().top,f=Math.min(n-r,ut.height()+u+1);ru.height(f-y(or)),tt.css("top",r),p.height(f-u-1),lr=pr.height()+1,sr=l("slotMinutes")/ot,dt=lr/sr,i&&tf()}function rf(t){dr=t,ci.clear(),it=0,w(ht.width("").each(function(t,i){it=Math.max(it,n(i).outerWidth())}),it);var i=p[0].clientWidth;gt=p.width()-i,gt?(w(yt,gt),yt.show().prev().removeClass("fc-last")):yt.hide().prev().addClass("fc-last"),ii=Math.floor((i-it)/a),w(li.slice(0,-1),ii)}function tf(){function u(){p.scrollTop(r)}var n=yi(),t=i(n),r;t.setHours(l("firstHour")),r=vt(n,t)+1,u(),setTimeout(u,0)}function nf(){hu=p.scrollTop()}function gu(){p.scrollTop(hu)}function ar(n){n.click(kr).mousedown(cf)}function rr(n){n.click(kr).mousedown(wu)}function kr(n){var r,f;if(!l("selectable")){var i=Math.min(a-1,Math.floor((n.pageX-at.offset().left-it)/ii)),t=oi(i),u=this.parentNode.className.match(/fc-slot(\d+)/);u?(r=parseInt(u[1])*l("slotMinutes"),f=Math.floor(r/60),t.setHours(f),t.setMinutes(r%60+rt),wi("dayClick",et[i],t,!1,n)):wi("dayClick",et[i],t,!0,n)}}function vr(n,t,r){r&&ft.build();var o=i(c.visStart),u,f;di?(u=e(t,o)*nt+g+1,f=e(n,o)*nt+g+1):(u=e(n,o),f=e(t,o)),u=Math.max(0,u),f=Math.min(a,f),u<f&&ar(wr(0,u,0,f-1))}function wr(n,t,i,r){var u=ft.rect(n,t,i,r,tt);return yr(u,tt)}function br(n,t){for(var u=i(c.visStart),h=r(i(u),1),e,o,f=0;f<a;f++){if(e=new Date(Math.max(u,n)),o=new Date(Math.min(h,t)),e<o){var l=f*nt+g,s=ft.rect(0,l,0,l,b),v=vt(u,e),y=vt(u,o);s.top=v,s.height=y-v,rr(yr(s,b))}r(u,1),r(h,1)}}function du(n){return ci.left(n)}function vf(n){return ci.right(n)}function bu(n){return{row:Math.floor(e(n,c.visStart)/7),col:nr(n.getDay())}}function wt(n){var i=oi(n.col),t=n.row;return l("allDaySlot")&&t--,t>=0&&u(i,rt+t*ot),i}function oi(n){return r(i(c.visStart),n*nt+g)}function hi(n){return l("allDaySlot")&&!n.row}function nr(n){return(n-Math.max(su,eu)+a)%a*nt+g}function vt(n,r){if(n=i(n,!0),r<u(i(n),rt))return 0;if(r>=u(i(n),ui))return ut.height();var f=l("slotMinutes"),s=r.getHours()*60+r.getMinutes()-rt,e=Math.floor(s/f),o=ir[e];return o===t&&(o=ir[e]=ut.find("tr:eq("+e+") td div")[0].offsetTop),Math.max(0,Math.round(o-1+lr*(s%f/f)))}function au(){return{left:it,right:dr-gt}}function vu(){return vi}function yu(n){var t=i(n.start);return n.allDay?t:u(t,l("defaultEventMinutes"))}function pu(n,t){return t?i(n):u(i(n),l("slotMinutes"))}function cu(n,t,u){u?l("allDaySlot")&&vr(n,r(i(t),1),!0):gr(n,t)}function gr(t,i){var f=l("selectHelper"),u,s;if(ft.build(),f){if(u=e(t,c.visStart)*nt+g,u>=0&&u<a){var r=ft.rect(0,u,0,u,b),o=vt(t,t),h=vt(t,i);h>o&&(r.top=o,r.height=h-o,r.left+=2,r.width-=5,n.isFunction(f)?(s=f(t,i),s&&(r.position="absolute",r.zIndex=8,v=n(s).css(r).appendTo(b))):(r.isStart=!0,r.isEnd=!0,v=n(lf({title:"",start:t,end:i,className:["fc-select-helper"],editable:!1},r)),v.css("opacity",l("dragOpacity"))),v&&(rr(v),b.append(v),w(v,r.width,!0),ai(v,r.height,!0)))}}else br(t,i)}function iu(){ki(),v&&(v.remove(),v=null)}function wu(t){if(t.which==1&&l("selectable")){hf(t);var r;st.start(function(n,t){if(iu(),n&&n.col==t.col&&!hi(n)){var f=wt(t),e=wt(n);r=[f,u(i(f),ot),e,u(i(e),ot)].sort(ri),gr(r[0],r[3])}else r=null},t);n(document).one("mouseup",function(n){st.stop(),r&&(+r[0]==+r[1]&&fu(r[0],!1,n),sf(r[0],r[3],!1,n))})}}function fu(n,t,i){wi("dayClick",et[nr(n.getDay())],n,t,i)}function af(n,t){st.start(function(n){if(ki(),n)if(hi(n))wr(n.row,n.col,n.row,n.col);else{var t=wt(n),r=u(i(t),l("defaultEventMinutes"));br(t,r)}},t)}function yf(n,t,i){var r=st.stop();ki(),r&&wi("drop",n,wt(r),hi(r),t,i)}var c=this;c.renderAgenda=of,c.setWidth=rf,c.setHeight=uf,c.beforeHide=nf,c.afterShow=gu,c.defaultEventEnd=yu,c.timePosition=vt,c.dayOfWeekCol=nr,c.dateCell=bu,c.cellDate=wt,c.cellIsAllDay=hi,c.allDayRow=vu,c.allDayBounds=au,c.getHoverListener=function(){return st},c.colContentLeft=du,c.colContentRight=vf,c.getDaySegmentContainer=function(){return hr},c.getSlotSegmentContainer=function(){return tu},c.getMinMinute=function(){return rt},c.getMaxMinute=function(){return ui},c.getBodyContent=function(){return b},c.getRowCnt=function(){return 1},c.getColCnt=function(){return a},c.getColWidth=function(){return ii},c.getSnapHeight=function(){return dt},c.getSnapMinutes=function(){return ot},c.defaultSelectionEnd=pu,c.renderDayOverlay=vr,c.renderSelection=cu,c.clearSelection=iu,c.reportDayClick=fu,c.dragStart=af,c.dragStop=yf,fi.call(c,f,o,s),ei.call(c),bt.call(c),gi.call(c);var l=c.opt,wi=c.trigger,lu=c.clearEvents,yr=c.renderOverlay,ki=c.clearOverlays,sf=c.reportSelection,hf=c.unselect,cf=c.daySelectionMousedown,lf=c.slotSegHtml,tr=o.formatDate,at,ct,li,kt,et,uu,or,ru,tt,hr,pi,vi,p,b,tu,ut,pr,ht,yt,v,dr,nu,it,ii,gt,lr,ot,sr,dt,a,er,ft,st,ci,ir={},hu,pt,su,eu,di,nt,g,rt,ui,ou,fr,ur,bi;k(f.addClass("fc-agenda")),ft=new ni(function(t,i){function h(n){return Math.max(s,Math.min(c,n))}var u,r,e,f;li.each(function(t,f){u=n(f),r=u.offset().left,t&&(e[1]=r),e=[r],i[t]=e}),e[1]=r+u.outerWidth(),l("allDaySlot")&&(u=vi,r=u.offset().top,t[0]=[r,r+u.outerHeight()]);var o=b.offset().top,s=p.offset().top,c=s+p.outerHeight();for(f=0;f<er*sr;f++)t.push([h(o+dt*f),h(o+dt*(f+1))])}),st=new ti(ft),ci=new si(function(n){return uu.eq(n)})}function gi(){function ti(n,t){oi(n);for(var f=n.length,r=[],u=[],i=0;i<f;i++)n[i].allDay?r.push(n[i]):u.push(n[i]);e("allDaySlot")&&(pi(nt(r),t),fi()),yt(kt(u),t),o("eventAfterAllRender")}function ni(){li(),ui().empty(),at().empty()}function nt(t){for(var o=ut(ft(t,n.map(t,p),f.visStart,f.visEnd)),h=o.length,e,r,u,s=[],i=0;i<h;i++)for(e=o[i],r=0;r<e.length;r++)u=e[r],u.row=0,u.level=i,s.push(u);return s}function kt(t){for(var w=v(),y=ct(),b=ki(),l=u(i(f.visStart),y),k=n.map(t,bt),s,e,a,h,c,p=[],o=0;o<w;o++){for(s=ut(ft(t,k,l,u(i(l),b-y))),di(s),e=0;e<s.length;e++)for(a=s[e],h=0;h<a.length;h++)c=a[h],c.col=o,c.level=e,p.push(c);r(l,1,!0)}return p}function bt(n){return n.end?i(n.end):u(i(n.start),e("defaultEventMinutes"))}function yt(i,r){var s,nt=i.length,u,h,ni,ft,bt,rt,k,w,ut,c,p,vt,wt="",pt,f,a,yt={},kt={},tt,l,ct,ot,g=at(),lt,b,d,dt=v();for((lt=e("isRTL"))?(b=-1,d=dt-1):(b=1,d=0),s=0;s<nt;s++)u=i[s],h=u.event,ft=ht(u.start,u.start),bt=ht(u.start,u.end),rt=u.col,k=u.level,w=u.forward||0,ut=bi(rt*b+d),c=wi(rt*b+d)-ut,c=Math.min(c-6,c*.95),p=k?c/(k+w+1):w?(c/(w+1)-6)*2:c,vt=ut+c/(k+w+1)*k*b+(lt?c-p:0),u.top=ft,u.left=vt,u.outerWidth=p,u.outerHeight=bt-ft,wt+=et(h,u);for(g[0].innerHTML=wt,pt=g.children(),s=0;s<nt;s++)u=i[s],h=u.event,f=n(pt[s]),a=o("eventRender",h,h,f),a===!1?f.remove():(a&&a!==!0&&(f.remove(),f=n(a).css({position:"absolute",top:u.top,left:u.left}).appendTo(g)),u.element=f,h._id===r?st(h,f,u):f[0]._fci=s,si(h,f));for(vi(g,i,st),s=0;s<nt;s++)u=i[s],(f=u.element)&&(l=yt[tt=u.key=gt(f[0])],u.vsides=l===t?yt[tt]=y(f,!0):l,l=kt[tt],u.hsides=l===t?kt[tt]=it(f,!0):l,ct=f.find(".fc-event-title"),ct.length&&(u.contentTop=ct[0].offsetTop));for(s=0;s<nt;s++)u=i[s],(f=u.element)&&(f[0].style.width=Math.max(0,u.outerWidth-u.hsides)+"px",ot=Math.max(0,u.outerHeight-u.vsides),f[0].style.height=ot+"px",h=u.event,u.contentTop!==t&&ot-u.contentTop<10&&(f.find("div.fc-event-time").text(ii(h.start,e("timeFormat"))+" - "+h.title),f.find("div.fc-event-title").remove()),o("eventAfterRender",h,h,f))}function et(n,t){var r="<",u=n.url,f=pt(n,e),i=["fc-event","fc-event-vert"];return d(n)&&i.push("fc-event-draggable"),t.isStart&&i.push("fc-event-start"),t.isEnd&&i.push("fc-event-end"),i=i.concat(n.className),n.source&&(i=i.concat(n.source.className||[])),r+=u?"a href='"+b(n.url)+"'":"div",r+=" class='"+i.join(" ")+"' style='position:absolute;z-index:8;top:"+t.top+"px;left:"+t.left+"px;"+f+"'><div class='fc-event-inner'><div class='fc-event-time'>"+b(h(n.start,n.end,e("timeFormat")))+"</div><div class='fc-event-title'>"+n.title+"</div></div><div class='fc-event-bg'></div>",t.isEnd&&k(n)&&(r+="<div class='ui-resizable-handle ui-resizable-s'>=</div>"),r+="</"+(u?"a":"div")+">"}function ri(n,t,i){d(n)&&dt(n,t,i.isStart),i.isEnd&&k(n)&&yi(n,t,i),ot(n,t)}function st(n,t,i){var r=t.find("div.fc-event-time");d(n)&&ci(n,t,r),i.isEnd&&k(n)&&tr(n,t,r),ot(n,t)}function dt(n,t,u){function y(){h||(t.width(b).height("").draggable("option","grid",null),h=!0)}var b,f,h=!0,v,it=e("isRTL")?-1:1,k=lt(),d=tt(),g=a(),nt=w(),ut=ct();t.draggable({zIndex:9,opacity:e("dragOpacity","month"),revertDuration:e("dragRevertDuration"),start:function(l,a){o("eventDragStart",t,n,l,a),c(n,t),b=t.width(),k.start(function(o,c,l,a){s(),o?(f=!1,v=a*it,o.row?u?h&&(t.width(d-10),ai(t,g*Math.round((n.end?(n.end-n.start)/nr:e("defaultEventMinutes"))/nt)),t.draggable("option","grid",[d,1]),h=!1):f=!0:(rt(r(i(n.start),v),r(p(n),v)),y()),f=f||h&&!v):(y(),f=!0),t.draggable("option","revert",f)},l,"drag")},stop:function(i,r){if(k.stop(),s(),o("eventDragStop",t,n,i,r),f)y(),t.css("filter",""),l(n,t);else{var u=0;h||(u=Math.round((t.offset().top-hi().offset().top)/g)*nt+ut-(n.start.getHours()*60+n.start.getMinutes())),vt(this,n,v,u,h,i,r)}}})}function ci(n,t,f){function ft(t){var o=u(i(n.start),t),r;n.end&&(r=u(i(n.end),t)),f.text(h(o,r,e("timeFormat")))}function et(){y&&(f.css("display",""),t.draggable("option","grid",[ut,nt]),y=!1)}var d,y=!1,k,b,g,ot=e("isRTL")?-1:1,it=lt(),st=v(),ut=tt(),nt=a(),ht=w();t.draggable({zIndex:9,scroll:!1,grid:[ut,nt],axis:st==1?"y":!1,opacity:e("dragOpacity"),revertDuration:e("dragRevertDuration"),start:function(u,h){o("eventDragStart",t,n,u,h),c(n,t),d=t.position(),b=g=0,it.start(function(u,o,h,c){t.draggable("option","revert",!u),s(),u&&(k=c*ot,e("allDaySlot")&&!u.row?(y||(y=!0,f.hide(),t.draggable("option","grid",null)),rt(r(i(n.start),k),r(p(n),k))):et())},u,"drag")},drag:function(n,t){b=Math.round((t.position.top-d.top)/nt)*ht,b!=g&&(y||ft(b),g=b)},stop:function(i,r){var u=it.stop();s(),o("eventDragStop",t,n,i,r),u&&(k||b||y)?vt(this,n,k,y?0:b,y,i,r):(et(),t.css("filter",""),t.css(d),ft(0),l(n,t))}})}function tr(n,t,i){var r,f,s=a(),v=w();t.resizable({handles:{s:".ui-resizable-handle"},grid:s,start:function(i,u){r=f=0,c(n,t),t.css("z-index",9),o("eventResizeStart",this,n,i,u)},resize:function(o,c){r=Math.round((Math.max(s,t.height())-c.originalSize.height)/s),r!=f&&(i.text(h(n.start,!r&&!n.end?null:u(ei(n),v*r),e("timeFormat"))),f=r)},stop:function(i,u){o("eventResizeStop",this,n,i,u),r?gi(this,n,0,v*r,i,u):(t.css("z-index",8),l(n,t))}})}var f=this;f.renderEvents=ti,f.compileDaySegs=nt,f.clearEvents=ni,f.slotSegHtml=et,f.bindDaySeg=ri,wt.call(f);var e=f.opt,o=f.trigger,d=f.isEventDraggable,k=f.isEventResizable,ei=f.eventEnd,oi=f.reportEvents,li=f.reportEventClear,ot=f.eventElementHandlers,fi=f.setHeight,ui=f.getDaySegmentContainer,at=f.getSlotSegmentContainer,lt=f.getHoverListener,ki=f.getMaxMinute,ct=f.getMinMinute,ht=f.timePosition,bi=f.colContentLeft,wi=f.colContentRight,pi=f.renderDaySegs,yi=f.resizableDayEvent,v=f.getColCnt,tt=f.getColWidth,a=f.getSnapHeight,w=f.getSnapMinutes,hi=f.getBodyContent,si=f.reportEventElement,l=f.showEvents,c=f.hideEvents,vt=f.eventDrop,gi=f.eventResize,rt=f.renderDayOverlay,s=f.clearOverlays,g=f.calendar,ii=g.formatDate,h=g.formatDates}function di(n){for(var i,r,f,e,u,t=n.length-1;t>0;t--)for(f=n[t],i=0;i<f.length;i++)for(e=f[i],r=0;r<n[t-1].length;r++)u=n[t-1][r],ci(e,u)&&(u.forward=Math.max(u.forward||0,(e.forward||0)+1))}function fi(n,f,e){function a(n,t){var i=y[n];return typeof i=="object"?rt(i,t||e):i}function h(n,t){return f.trigger.apply(f,[n,t||o].concat(Array.prototype.slice.call(arguments,2),[o]))}function at(n){return b(n)&&!a("disableDragging")}function tt(n){return b(n)&&!a("disableResizing")}function b(n){return v(n.editable,(n.source||{}).editable,a("editable"))}function it(n){s={};for(var r=n.length,t,i=0;i<r;i++)t=n[i],s[t._id]?s[t._id].push(t):s[t._id]=[t]}function w(n){return n.end?i(n.end):ht(n)}function ut(n,t){d.push(t),c[n._id]?c[n._id].push(t):c[n._id]=[t]}function ft(){d=[],c={}}function et(n,t){t.click(function(i){if(!t.hasClass("ui-draggable-dragging")&&!t.hasClass("ui-resizable-resizing"))return h("eventClick",this,n,i)}).hover(function(t){h("eventMouseover",this,n,t)},function(t){h("eventMouseout",this,n,t)})}function ot(n,t){p(n,t,"show")}function st(n,t){p(n,t,"hide")}function p(n,t,i){for(var u=c[n._id],f=u.length,r=0;r<f;r++)t&&u[r][0]==t[0]||u[r][i]()}function ct(n,t,i,r,u,f,e){var c=t.allDay,o=t._id;nt(s[o],i,r,u),h("eventDrop",n,t,i,r,u,function(){nt(s[o],-i,-r,c),l(o)},f,e),l(o)}function lt(n,t,i,r,u,f){var e=t._id;k(s[e],i,r),h("eventResize",n,t,i,r,function(){k(s[e],-i,-r),l(e)},u,f),l(e)}function nt(n,i,f,e){f=f||0;for(var o,h=n.length,s=0;s<h;s++)o=n[s],e!==t&&(o.allDay=e),u(r(o.start,i,!0),f),o.end&&(o.end=u(r(o.end,i,!0),f)),g(o,y)}function k(n,t,i){i=i||0;for(var f,o=n.length,e=0;e<o;e++)f=n[e],f.end=u(r(w(f),t,!0),i),g(f,y)}var o=this;o.element=n,o.calendar=f,o.name=e,o.opt=a,o.trigger=h,o.isEventDraggable=at,o.isEventResizable=tt,o.reportEvents=it,o.eventEnd=w,o.reportEventElement=ut,o.reportEventClear=ft,o.eventElementHandlers=et,o.showEvents=ot,o.hideEvents=st,o.eventDrop=ct,o.eventResize=lt;var ht=o.defaultEventEnd,g=f.normalizeEvent,l=f.reportEventChange,s={},d=[],c={},y=f.options}function wt(){function st(n,t){var h=c(),a,b=s(),k=w(),v=0,r,it,u,f,ut=n.length,i,e,o;for(h[0].innerHTML=y(n),p(n,h.children()),ft(n),ot(n,h,t),d(n),g(n),nt(n),a=tt(),r=0;r<b;r++){for(it=0,u=[],f=0;f<k;f++)u[f]=0;while(v<ut&&(i=n[v]).row==r){for(e=ii(u.slice(i.startCol,i.endCol)),i.top=e,e+=i.outerHeight,o=i.startCol;o<i.endCol;o++)u[o]=e;v++}a[r].height(ii(u))}l(n,rt(a))}function et(t,i,r){var o=n("<div/>"),u,s=c(),f,h=t.length,e;for(o[0].innerHTML=y(t),u=o.children(),s.append(u),p(t,u),d(t),g(t),nt(t),l(t,rt(tt())),u=[],f=0;f<h;f++)e=t[f].element,e&&(t[f].row===i&&e.css("top",r),u.push(e[0]));return n(u)}function y(n){for(var p=f("isRTL"),nt=n.length,t,i,l,r,g=vt(),k=g.left,d=g.right,e,s,h,y,w,u="",c=0;c<nt;c++)t=n[c],i=t.event,r=["fc-event","fc-event-hori"],ri(i)&&r.push("fc-event-draggable"),t.isStart&&r.push("fc-event-start"),t.isEnd&&r.push("fc-event-end"),p?(e=o(t.end.getDay()-1),s=o(t.start.getDay()),h=t.isEnd?v(e):k,y=t.isStart?a(s):d):(e=o(t.start.getDay()),s=o(t.end.getDay()-1),h=t.isStart?v(e):k,y=t.isEnd?a(s):d),r=r.concat(i.className),i.source&&(r=r.concat(i.source.className||[])),l=i.url,w=pt(i,f),u+=l?"<a href='"+b(l)+"'":"<div",u+=" class='"+r.join(" ")+"' style='position:absolute;z-index:8;left:"+h+"px;"+w+"'><div class='fc-event-inner'>",!i.allDay&&t.isStart&&(u+="<span class='fc-event-time'>"+b(lt(i.start,i.end,f("timeFormat")))+"</span><br/>"),u+="<span class='fc-event-title'>"+i.title+"</span></div>",t.isEnd&&ti(i)&&(u+="<div class='ui-resizable-handle ui-resizable-"+(p?"w":"e")+"'>&nbsp;&nbsp;&nbsp;</div>"),u+="</"+(l?"a":"div")+">",t.left=h,t.outerWidth=y-h,t.startCol=e,t.endCol=s+1;return u}function p(t,i){for(var h=t.length,o,s,u,r,f=0;f<h;f++)o=t[f],s=o.event,u=n(i[f]),r=e("eventRender",s,s,u),r===!1?u.remove():(r&&r!==!0&&(r=n(r).css({position:"absolute",left:o.left}),u.replaceWith(r),u=r),o.element=u)}function ft(n){for(var u=n.length,i,r,t=0;t<u;t++)i=n[t],r=i.element,r&&dt(i.event,r)}function ot(n,t,i){for(var o=n.length,u,f,e,r=0;r<o;r++)u=n[r],f=u.element,f&&(e=u.event,e._id===i?h(e,f,u):f[0]._fci=r);vi(t,n,h)}function d(n){for(var s=n.length,r,u,e,f,o={},i=0;i<s;i++)r=n[i],u=r.element,u&&(e=r.key=gt(u[0]),f=o[e],f===t&&(f=o[e]=it(u,!0)),r.hsides=f)}function g(n){for(var u=n.length,i,r,t=0;t<u;t++)i=n[t],r=i.element,r&&(r[0].style.width=Math.max(0,i.outerWidth-i.hsides)+"px")}function nt(n){for(var s=n.length,r,u,e,f,o={},i=0;i<s;i++)r=n[i],u=r.element,u&&(e=r.key,f=o[e],f===t&&(f=o[e]=oi(u)),r.outerHeight=u[0].offsetHeight+f)}function tt(){for(var i=s(),t=[],n=0;n<i;n++)t[n]=yt(n).find("div.fc-day-content > div");return t}function rt(n){for(var r=n.length,i=[],t=0;t<r;t++)i[t]=n[t][0].offsetTop;return i}function l(n,t){for(var o=n.length,i,u,f,r=0;r<o;r++)i=n[r],u=i.element,u&&(u[0].style.top=t[i.row]+(i.top||0)+"px",f=i.event,e("eventAfterRender",f,f,u))}function fi(t,o,h){var c=f("isRTL"),l=c?"w":"e",v=o.find(".ui-resizable-"+l),a=!1;k(o),o.mousedown(function(n){n.preventDefault()}).click(function(n){a&&(n.preventDefault(),n.stopImmediatePropagation())}),v.mousedown(function(f){function rt(i){e("eventResizeStop",this,t,i),n("body").css("cursor",""),b.stop(),ut(),y&&wt(this,t,y,0,i),setTimeout(function(){a=!1},0)}if(f.which==1){a=!0;var b=u.getHoverListener(),nt=s(),tt=w(),k=c?-1:1,d=c?tt-1:0,it=o.css("top"),y,v,g=n.extend({},t),p=at(t.start);ht();n("body").css("cursor",l+"-resize").one("mouseup",rt);e("eventResizeStart",this,t,f),b.start(function(n,u){var e,f,o,s;n&&(e=Math.max(p.row,n.row),f=n.col,nt==1&&(e=0),e==p.row&&(f=c?Math.min(p.col,f):Math.max(p.col,f)),y=e*7+f*k+d-(u.row*7+u.col*k+d),o=r(ni(t),y,!0),y?(g.end=o,s=v,v=et(ct([g]),h.row,it),v.find("*").css("cursor",l+"-resize"),s&&s.remove(),bt(t)):v&&(kt(t),v.remove(),v=null),ut(),ui(t.start,r(i(o),1)))},f)}})}var u=this;u.renderDaySegs=st,u.resizableDayEvent=fi;var f=u.opt,e=u.trigger,ri=u.isEventDraggable,ti=u.isEventResizable,ni=u.eventEnd,dt=u.reportEventElement,kt=u.showEvents,bt=u.hideEvents,wt=u.eventResize,s=u.getRowCnt,w=u.getColCnt,ei=u.getColWidth,yt=u.allDayRow,vt=u.allDayBounds,v=u.colContentLeft,a=u.colContentRight,o=u.dayOfWeekCol,at=u.dateCell,ct=u.compileDaySegs,c=u.getDaySegmentContainer,h=u.bindDaySeg,lt=u.calendar.formatDates,ui=u.renderDayOverlay,ut=u.clearOverlays,ht=u.clearSelection}function bt(){function c(n,t,i){r(),t||(t=h(n,i)),o(n,t,i),f(n,t,i)}function r(n){u&&(u=!1,s(),e("unselect",null,n))}function f(n,t,i,r){u=!0,e("select",null,n,t,i,r)}function l(u){var h=t.cellDate,l=t.cellIsAllDay,c=t.getHoverListener(),a=t.reportDayClick,v,e;if(u.which==1&&i("selectable")){r(u),v=this,c.start(function(n,t){s(),n&&l(n)?(e=[h(t),h(n)].sort(ri),o(e[0],e[1],!0)):e=null},u);n(document).one("mouseup",function(n){c.stop(),e&&(+e[0]==+e[1]&&a(e[0],!0,n),f(e[0],e[1],!0,n))})}}var t=this;t.select=c,t.unselect=r,t.reportSelection=f,t.daySelectionMousedown=l;var i=t.opt,e=t.trigger,h=t.defaultSelectionEnd,o=t.renderSelection,s=t.clearSelection,u=!1;i("selectable")&&i("unselectAuto")&&n(document).mousedown(function(t){var u=i("unselectCancel");u&&n(t.target).parents(u).length||r(t)})}function ei(){function u(r,u){var f=i.shift();return f||(f=n("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>")),f[0].parentNode!=u[0]&&f.appendTo(u),t.push(f.css(r).show()),f}function f(){for(var n;n=t.shift();)i.push(n.hide().unbind())}var r=this,t,i;r.renderOverlay=u,r.clearOverlays=f,t=[],i=[]}function ni(n){var r=this,t,i;r.build=function(){t=[],i=[],n(t,i)},r.cell=function(n,r){for(var o=t.length,s=i.length,f=-1,e=-1,u=0;u<o;u++)if(r>=t[u][0]&&r<t[u][1]){f=u;break}for(u=0;u<s;u++)if(n>=i[u][0]&&n<i[u][1]){e=u;break}return f>=0&&e>=0?{row:f,col:e}:null},r.rect=function(n,r,u,f,e){var o=e.offset();return{top:t[n][0]-o.top,left:i[r][0]-o.left,width:i[f][1]-i[r][0],height:t[u][1]-t[n][0]}}}function ti(t){function e(n){ar(n);var u=t.cell(n.pageX,n.pageY);(!u!=!r||u&&(u.row!=r.row||u.col!=r.col))&&(u?(i||(i=u),f(u,i,u.row-i.row,u.col-i.col)):f(u,i),r=u)}var o=this,u,f,i,r;o.start=function(o,s,h){f=o,i=r=null,t.build(),e(s),u=h||"mousemove",n(document).bind(u,e)},o.stop=function(){return n(document).unbind(u,e),r}}function ar(n){n.pageX===t&&(n.pageX=n.originalEvent.pageX,n.pageY=n.originalEvent.pageY)}function si(n){function e(t){return f[t]=f[t]||n(t)}var i=this,f={},r={},u={};i.left=function(n){return r[n]=r[n]===t?e(n).position().left:r[n]},i.right=function(n){return u[n]=u[n]===t?i.left(n)+e(n).width():u[n]},i.clear=function(){f={},r={},u={}}}var nt={defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"iso",weekNumberTitle:"W",allDayDefault:!0,ignoreTimezone:!0,lazyFetching:!0,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:!1,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:"<span class='fc-text-arrow'>&lsaquo;</span>",next:"<span class='fc-text-arrow'>&rsaquo;</span>",prevYear:"<span class='fc-text-arrow'>&laquo;</span>",nextYear:"<span class='fc-text-arrow'>&raquo;</span>",today:"Today",month:"month",week:"week",day:"day"},theme:!1,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:!0,dropAccept:"*"},vr={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"<span class='fc-text-arrow'>&rsaquo;</span>",next:"<span class='fc-text-arrow'>&lsaquo;</span>",prevYear:"<span class='fc-text-arrow'>&raquo;</span>",nextYear:"<span class='fc-text-arrow'>&laquo;</span>"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},f=n.fullCalendar={version:"1.6.0"},s=f.views={},wi,li,st;n.fn.fullCalendar=function(i){var f,r,u;return typeof i=="string"?(f=Array.prototype.slice.call(arguments,1),this.each(function(){var u=n.data(this,"fullCalendar"),e;u&&n.isFunction(u[i])&&(e=u[i].apply(u,f),r===t&&(r=e),i=="destroy"&&n.removeData(this,"fullCalendar"))}),r!==t)?r:this:(u=i.eventSources||[],delete i.eventSources,i.events&&(u.push(i.events),delete i.events),i=n.extend(!0,{},nt,i.isRTL||i.isRTL===t&&nt.isRTL?vr:{},i),this.each(function(t,r){var f=n(r),e=new br(f,i,u);f.data("fullCalendar",e),e.render()}),this)},f.sourceNormalizers=[],f.sourceFetchers=[],wi={dataType:"json",cache:!1},li=1,f.addDays=r,f.cloneDate=i,f.parseDate=yt,f.parseISO8601=ht,f.parseTime=lt,f.formatDate=a,f.formatDates=et;var at=["sun","mon","tue","wed","thu","fri","sat"],pi=864e5,ki=36e5,nr=6e4;st={s:function(n){return n.getSeconds()},ss:function(n){return c(n.getSeconds())},m:function(n){return n.getMinutes()},mm:function(n){return c(n.getMinutes())},h:function(n){return n.getHours()%12||12},hh:function(n){return c(n.getHours()%12||12)},H:function(n){return n.getHours()},HH:function(n){return c(n.getHours())},d:function(n){return n.getDate()},dd:function(n){return c(n.getDate())},ddd:function(n,t){return t.dayNamesShort[n.getDay()]},dddd:function(n,t){return t.dayNames[n.getDay()]},M:function(n){return n.getMonth()+1},MM:function(n){return c(n.getMonth()+1)},MMM:function(n,t){return t.monthNamesShort[n.getMonth()]},MMMM:function(n,t){return t.monthNames[n.getMonth()]},yy:function(n){return(n.getFullYear()+"").substring(2)},yyyy:function(n){return n.getFullYear()},t:function(n){return n.getHours()<12?"a":"p"},tt:function(n){return n.getHours()<12?"am":"pm"},T:function(n){return n.getHours()<12?"A":"P"},TT:function(n){return n.getHours()<12?"AM":"PM"},u:function(n){return a(n,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(n){var t=n.getDate();return t>10&&t<20?"th":["st","nd","rd"][t%10-1]||"th"},w:function(n,t){return t.weekNumberCalculation(n)},W:function(n){return or(n)}},f.dateFormatters=st,f.applyAll=g,s.month=er,s.basicWeek=ur,s.basicDay=kr,dt({weekMode:"fixed"}),s.agendaWeek=ir,s.agendaDay=tr,dt({allDaySlot:!0,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:.5},minTime:0,maxTime:24})}(jQuery),priorView="",$(function(){var t,n;updateNav("Calendar"),t=cookieHelper(),initCal(),priorView=t.read("lastView"),n=$("#eventsCal").fullCalendar("getView").name,priorView&&priorView!==undefined&&priorView.length!==0||(priorView="month"),priorView!=n?changeView(priorView):initViewNav(n),changeCalData(priorView=="month"?"detail":"summary"),setCalendarDateFromCookie(),$("#eventsCal").find(".fc-header-right").append($("#monthDetailsSummaryContainer").clone("true")),$("#pageTitleContainer").find("#monthDetailsSummaryContainer").remove()});$(window).on("unload",function(){var t=cookieHelper(),n=$("#eventsCal").fullCalendar("getView").name;n&&n!=undefined&&n.length!==0||(n="list"),$("#gamesViewNavList").hasClass("active")&&(n="list"),t.create("lastView",n,999),n!=="list"&&t.create("lastCalDate",$("#eventsCal").fullCalendar("getDate").toString("d"),999)});$(document).ready(function(){$("#gamesViewNavDayReskin").click(function(){$(".fc-button-next").attr("title","Next Day"),$(".fc-button-prev").attr("title","Previous Day")}),$("#gamesViewNavMonthReskin").click(function(){$(".fc-button-next").attr("title","Next Month"),$(".fc-button-prev").attr("title","Previous Month")})}),$(window).resize(function(){clearTimeout(resizeTimer),resizeTimer=setTimeout(fixTbaTimes,500)})