!function(t,e){var n,r={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]{ '—'[ 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:"‹",next:"›",prevYear:"«",nextYear:"»",today:"today",month:"month",week:"week",day:"day"},theme:!1,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:!0,dropAccept:"*",handleWindowResize:!0},a={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"›",next:"‹",prevYear:"»",nextYear:"«"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},o=t.fullCalendar={version:"1.6.7"},i=o.views={};function s(e){t.extend(!0,r,e)}function l(n,r,a){var s=this;s.options=r,s.render=function(e){v?W()&&(Y(),P(e)):function(){r.theme?"ui":"fc",n.addClass("fc"),r.isRTL?n.addClass("fc-rtl"):n.addClass("fc-ltr");r.theme&&n.addClass("ui-widget");v=t("
").prependTo(n),l=new c(s,r),(d=l.render())&&n.prepend(d);O(r.defaultView),r.handleWindowResize&&t(window).resize(j);A()||z()}()},s.destroy=function(){h&&(K("viewDestroy",h,h,h.element),h.triggerEventDestroy());t(window).unbind("resize",j),l.destroy(),v.remove(),n.removeClass("fc fc-rtl ui-widget")},s.refetchEvents=function(){U(),Z()},s.reportEvents=function(t){N=t,X()},s.reportEventChange=function(t){I(t)},s.rerenderEvents=I,s.changeView=O,s.select=function(t,n,r){h.select(t,n,r===e||r)},s.unselect=G,s.prev=function(){_(-1)},s.next=function(){_(1)},s.prevYear=function(){p(R,-1),_()},s.nextYear=function(){p(R,1),_()},s.today=function(){R=new Date,_()},s.gotoDate=function(t,e,n){t instanceof Date?R=C(t):S(R,t,e,n);_()},s.incrementDate=function(t,n,r){t!==e&&p(R,t);n!==e&&m(R,n);r!==e&&y(R,r);_()},s.formatDate=function(t,e){return H(t,e,r)},s.formatDates=function(t,e,n){return F(t,e,n,r)},s.getDate=function(){return C(R)},s.getView=function(){return h},s.option=function(t,n){if(n===e)return r[t];"height"!=t&&"contentHeight"!=t&&"aspectRatio"!=t||(r[t]=n,q())},s.trigger=K,function(n,r){var a=this;a.isFetchNeeded=function(t,e){return!i||ts},a.fetchEvents=function(t,e){i=t,s=e,y=[];var n=++g,r=h.length;p=r;for(var a=0;a").appendTo(v),s),_(),Q(),k--}(e)}function _(t){(!h.start||t||R=h.end)&&W()&&P(t)}function P(t){var e;k++,h.start&&(K("viewDestroy",h,h,h.element),G(),U()),$(),h.render(R,t||0),B(),Q(),(h.afterRender||function(){})(),l.updateTitle(h.title),(e=new Date)>=h.start&&e").append(t("
").append(s("left")).append(s("center")).append(s("right")))},r.destroy=function(){o.remove()},r.updateTitle=function(t){o.find("h2").html(t)},r.activateButton=function(t){o.find("span.fc-button-"+t).addClass(a+"-state-active")},r.deactivateButton=function(t){o.find("span.fc-button-"+t).removeClass(a+"-state-active")},r.disableButton=function(t){o.find("span.fc-button-"+t).addClass(a+"-state-disabled")},r.enableButton=function(t){o.find("span.fc-button-"+t).removeClass(a+"-state-disabled")};var a,o=t([]);function s(r){var o=t(""),s=n.header[r];return s&&t.each(s.split(" "),function(r){var s;r>0&&o.append(""),t.each(this.split(","),function(r,l){var c;if("title"==l)o.append(""),s&&s.addClass(a+"-corner-right"),s=null;else if(e[l]?c=e[l]:i[l]&&(c=function(){d.removeClass(a+"-state-hover"),e.changeView(l)}),c){var u=n.theme?Y(n.buttonIcons,l):null,f=Y(n.buttonText,l),d=t(""+(u?"":f)+"").click(function(){d.hasClass(a+"-state-disabled")||c()}).mousedown(function(){d.not("."+a+"-state-active").not("."+a+"-state-disabled").addClass(a+"-state-down")}).mouseup(function(){d.removeClass(a+"-state-down")}).hover(function(){d.not("."+a+"-state-active").not("."+a+"-state-disabled").addClass(a+"-state-hover")},function(){d.removeClass(a+"-state-hover").removeClass(a+"-state-down")}).appendTo(o);j(d),s||d.addClass(a+"-corner-left"),s=d}}),s&&s.addClass(a+"-corner-right")}),o}}t.fn.fullCalendar=function(o){if(n=t(this),"string"==typeof o){var i,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=t.data(this,"fullCalendar");if(n&&t.isFunction(n[o])){var r=n[o].apply(n,s);i===e&&(i=r),"destroy"==o&&t.removeData(this,"fullCalendar")}}),i!==e?i:this}var c=(o=o||{}).eventSources||[];return delete o.eventSources,o.events&&(c.push(o.events),delete o.events),o=t.extend(!0,{},r,o.isRTL||o.isRTL===e&&r.isRTL?a:{},o),this.each(function(e,n){var r=t(n),a=new l(r,o,c);r.data("fullCalendar",a),a.render()}),this},o.sourceNormalizers=[],o.sourceFetchers=[];var u={dataType:"json",cache:!1},f=1;o.addDays=y,o.cloneDate=C,o.parseDate=T,o.parseISO8601=x,o.parseTime=k,o.formatDate=H,o.formatDates=F;var d=["sun","mon","tue","wed","thu","fri","sat"],v=864e5,h=36e5,g=6e4;function p(t,e,n){return t.setFullYear(t.getFullYear()+e),n||D(t),t}function m(t,e,n){if(+t){var r=t.getMonth()+e,a=C(t);for(a.setDate(1),a.setMonth(r),t.setMonth(r),n||D(t);t.getMonth()!=a.getMonth();)t.setDate(t.getDate()+(to;s--)if(l=R[n.substring(o,s)]){c&&(d+=l(c,a)),o=s-1;break}s==o&&c&&(d+=i)}return d}var R={s:function(t){return t.getSeconds()},ss:function(t){return q(t.getSeconds())},m:function(t){return t.getMinutes()},mm:function(t){return q(t.getMinutes())},h:function(t){return t.getHours()%12||12},hh:function(t){return q(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return q(t.getHours())},d:function(t){return t.getDate()},dd:function(t){return q(t.getDate())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return q(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},yy:function(t){return(t.getFullYear()+"").substring(2)},yyyy:function(t){return t.getFullYear()},t:function(t){return t.getHours()<12?"a":"p"},tt:function(t){return t.getHours()<12?"am":"pm"},T:function(t){return t.getHours()<12?"A":"P"},TT:function(t){return t.getHours()<12?"AM":"PM"},u:function(t){return H(t,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(t){var e=t.getDate();return e>10&&e<20?"th":["st","nd","rd"][e%10-1]||"th"},w:function(t,e){return e.weekNumberCalculation(t)},W:function(t){return(n=new Date(t.getTime())).setDate(n.getDate()+4-(n.getDay()||7)),e=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((e-n)/864e5)/7)+1;var e,n}};function N(t){return t.end?(e=t.end,n=t.allDay,e=C(e),n||e.getHours()||e.getMinutes()?y(e,1):D(e)):y(C(t.start),1);var e,n}function z(n,r,a){n.unbind("mouseover").mouseover(function(n){for(var o,i,s,l=n.target;l!=this;)o=l,l=l.parentNode;(i=o._fci)!==e&&(o._fci=e,s=r[i],a(s.event,s.element,s),t(n.target).trigger(n)),n.stopPropagation()})}function W(e,n,r){for(var a,o=0;o=0;o--)if((r=t[a[o].toLowerCase()])!==e)return r;return t[""]}function B(t){return t.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function j(t){t.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function I(t){t.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function X(t,e){var n=t.source||{},r=t.color,a=n.color,o=e("eventColor"),i=t.backgroundColor||r||n.backgroundColor||a||e("eventBackgroundColor")||o,s=t.borderColor||r||n.borderColor||a||e("eventBorderColor")||o,l=t.textColor||n.textColor||e("eventTextColor"),c=[];return i&&c.push("background-color:"+i),s&&c.push("border-color:"+s),l&&c.push("color:"+l),c.join(";")}function J(e,n,r){if(t.isFunction(e)&&(e=[e]),e){var a,o;for(a=0;a").appendTo(e));!function(){var n=""+function(){var t,e,n=F+"-widget-header",r="";for(r+="",N&&(r+=""+B(z)+" | "),t=0;t
"}()+function(){var t,e,n,r=F+"-widget-content",a="";for(a+="",t=0;t",N&&(n=X(t,0),a+=""+B(U(n,A))+" | "),e=0;e"}return a+=""}()+"
";o&&o.remove();o=t(n).appendTo(e),i=o.find("thead"),s=i.find(".fc-day-header"),l=o.find("tbody"),c=l.find("tr"),u=l.find(".fc-day"),f=c.find("td:first-child"),v=c.eq(0).find(".fc-day > div"),h=c.eq(0).find(".fc-day-content > div"),I(i.add(i.find("tr"))),I(c),c.eq(0).addClass("fc-first"),c.filter(":last").addClass("fc-last"),u.each(function(e,n){var r=X(Math.floor(e/M),e%M);_("dayRender",a,r,t(n))}),G(u)}()},a.setHeight=function(e){var n,r,a,o=e-i.height();"variable"==O("weekMode")?n=r=Math.floor(o/(1==b?2:6)):(n=Math.floor(o/b),r=o-n*(b-1));f.each(function(e,o){e div").css("min-height",(e==b-1?r:n)-L(a))})},a.setWidth=function(t){p=t,k.clear(),H.clear(),w=0,N&&(w=i.find("th.fc-week-number").outerWidth());m=Math.floor((p-w)/M),W(s.slice(0,-1),m)},a.renderDayOverlay=Q,a.defaultSelectionEnd=function(t,e){return C(t)},a.renderSelection=function(t,e,n){Q(t,y(C(e),1),!0)},a.clearSelection=function(){q()},a.reportDayClick=function(t,e,n){var r=J(t),a=u[r.row*M+r.col];_("dayClick",a,t,e,n)},a.dragStart=function(t,e,n){T.start(function(t){q(),t&&K(t.row,t.col,t.row,t.col)},e)},a.dragStop=function(t,e,n){var r=T.stop();if(q(),r){var a=X(r);_("drop",t,a,!0,e,n)}},a.defaultEventEnd=function(t){return C(t.start)},a.getHoverListener=function(){return T},a.colLeft=function(t){return k.left(t)},a.colRight=function(t){return k.right(t)},a.colContentLeft=function(t){return H.left(t)},a.colContentRight=function(t){return H.right(t)},a.getIsCellAllDay=function(){return!0},a.allDayRow=function(t){return c.eq(t)},a.getRowCnt=function(){return b},a.getColCnt=function(){return M},a.getColWidth=function(){return m},a.getDaySegmentContainer=function(){return g},nt.call(a,e,n,r),lt.call(a),st.call(a),function(){var t=this;t.renderEvents=function(e,n){t.renderDayEvents(e,n)},t.clearEvents=function(){t.getDaySegmentContainer().empty()},rt.call(t)}.call(a);var o,i,s,l,c,u,f,v,h,g,p,m,w,b,M,E,S,T,k,H,F,R,N,z,A,O=a.opt,_=a.trigger,P=a.renderOverlay,q=a.clearOverlays,Y=a.daySelectionMousedown,X=a.cellToDate,J=a.dateToCell,V=a.rangeToSegments,U=n.formatDate;function Z(t){var e=F+"-widget-content",n=a.start.getMonth(),r=D(new Date),o="",i=["fc-day","fc-"+d[t.getDay()],e];return t.getMonth()!=n&&i.push("fc-other-month"),+t==+r?i.push("fc-today",F+"-state-highlight"):t",E&&(o+="
"+t.getDate()+"
"),o+="
"}function G(t){t.click($).mousedown(Y)}function $(e){if(!O("selectable")){var n=x(t(this).data("date"));_("dayClick",this,n,!0,e)}}function Q(t,e,n){n&&S.build();for(var r=V(t,e),a=0;a").appendTo(n),Dt("allDaySlot")?(w=t("").appendTo(m),e="",S=t(e).appendTo(m),At((T=S.find("tr")).find("td")),m.append("")):w=t([]);for(x=t("").appendTo(m),H=t("").appendTo(x),F=t("").appendTo(H),e="",r=M(),o=b(C(r),pt),b(r,gt),tt=0,a=0;r"+(c&&i?" ":Nt(r,Dt("axisFormat")))+" | | ",b(r,Dt("slotMinutes")),tt++;Ot((R=t(e+="
").appendTo(H)).find("td"))}()},o.setWidth=function(e){e,it.clear(),dt.clear();var n=s.find("th:first");S&&(n=n.add(S.find("th:first")));n=n.add(R.find("th:first")),Y=0,W(n.width("").each(function(e,n){Y=Math.max(Y,t(n).outerWidth())}),Y);var r=i.find(".fc-agenda-gutter");S&&(r=r.add(S.find("th.fc-agenda-gutter")));var a=x[0].clientWidth;(V=x.width()-a)?(W(r,V),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last");J=Math.floor((a-Y)/K),W(l.slice(0,-1),J)},o.setHeight=function(t){t===e&&(t=q);q=t,zt={};var n=c.position().top,r=x.position().top,a=Math.min(t-n,R.height()+r+1);p.height(a-L(h)),m.css("top",n),x.height(a-r-1),U=R.find("tr:first").height()+1,$=Dt("slotMinutes")/Z,Q=U/$},o.afterRender=function(){!function(){var t=M(),e=C(t);e.setHours(Dt("firstHour"));var n=jt(t,e)+1;function r(){x.scrollTop(n)}r(),setTimeout(r,0)}()},o.defaultEventEnd=function(t){var e=C(t.start);if(t.allDay)return e;return b(e,Dt("defaultEventMinutes"))},o.timePosition=jt,o.getIsCellAllDay=Yt,o.allDayRow=function(t){return T},o.getCoordinateGrid=function(){return at},o.getHoverListener=function(){return ot},o.colLeft=function(t){return it.left(t)},o.colRight=function(t){return it.right(t)},o.colContentLeft=function(t){return dt.left(t)},o.colContentRight=function(t){return dt.right(t)},o.getDaySegmentContainer=function(){return w},o.getSlotSegmentContainer=function(){return F},o.getMinMinute=function(){return gt},o.getMaxMinute=function(){return pt},o.getSlotContainer=function(){return H},o.getRowCnt=function(){return 1},o.getColCnt=function(){return K},o.getColWidth=function(){return J},o.getSnapHeight=function(){return Q},o.getSnapMinutes=function(){return Z},o.defaultSelectionEnd=function(t,e){if(e)return C(t);return b(C(t),Dt("slotMinutes"))},o.renderDayOverlay=_t,o.renderSelection=function(t,e,n){n?Dt("allDaySlot")&&_t(t,y(C(e),1),!0):It(t,e)},o.clearSelection=Xt,o.reportDayClick=Vt,o.dragStart=function(t,e,n){ot.start(function(t){if(Et(),t)if(Yt(t))Pt(t.row,t.col,t.row,t.col);else{var e=Bt(t),n=b(C(e),Dt("defaultEventMinutes"));qt(e,n)}},e)},o.dragStop=function(t,e,n){var r=ot.stop();Et(),r&&Ct("drop",t,Bt(r),Yt(r),e,n)},nt.call(o,n,r,a),lt.call(o),st.call(o),function(){var n=this;n.renderEvents=function(n,o){var i,s=n.length,l=[],u=[];for(i=0;in&&ir?(c=C(r),f=!1):(c=s,f=!0),d.push({event:o,start:l,end:c,isStart:u,isEnd:f}));return d.sort(et)}function Z(t){return t.end?C(t.end):b(C(t.start),r("defaultEventMinutes"))}function $(t,e){var n="<",a=t.url,s=X(t,r),l=["fc-event","fc-event-vert"];return o(t)&&l.push("fc-event-draggable"),e.isStart&&l.push("fc-event-start"),e.isEnd&&l.push("fc-event-end"),l=l.concat(t.className),t.source&&(l=l.concat(t.source.className||[])),n+=a?"a href='"+B(t.url)+"'":"div",n+=" class='"+l.join(" ")+"' style='position:absolute;top:"+e.top+"px;left:"+e.left+"px;"+s+"'>"+B(V(t.start,t.end,r("timeFormat")))+"
"+B(t.title||"")+"
",e.isEnd&&i(t)&&(n+="=
"),n+=""+(a?"a":"div")+">"}function Q(t,e,c){var u=e.find("div.fc-event-time");o(t)&&function(t,e,o){var i,s,l,c,u,f,d,v,h,g,p,w=n.getCoordinateGrid(),D=S(),H=T(),F=x(),z=k();function A(){Y(),l&&(u?(o.hide(),e.draggable("option","grid",null),q(y(C(t.start),h),y(N(t),h))):(!function(e){var n,a=b(C(t.start),e);t.end&&(n=b(C(t.end),e));o.text(V(a,n,r("timeFormat")))}(g),o.css("display",""),e.draggable("option","grid",[H,F])))}e.draggable({scroll:!1,grid:[H,F],axis:1==D&&"y",opacity:r("dragOpacity"),revertDuration:r("dragRevertDuration"),start:function(n,r){a("eventDragStart",e,t,n,r),W(t,e),w.build(),i=e.position(),s=w.cell(n.pageX,n.pageY),l=c=!0,u=f=m(s),d=v=0,h=0,g=p=0},drag:function(t,n){var r=w.cell(t.pageX,t.pageY);if(l=!!r){if(u=m(r),(d=Math.round((n.position.left-i.left)/H))!=v){var a=M(0,s.col),o=s.col+d;o=Math.max(0,o),o=Math.min(D-1,o);var y=M(0,o);h=E(y,a)}u||(g=Math.round((n.position.top-i.top)/F)*z)}l==c&&u==f&&d==v&&g==p||(A(),c=l,f=u,v=d,p=g),e.draggable("option","revert",!l)},stop:function(n,r){Y(),a("eventDragStop",e,t,n,r),l&&(u||h||g)?_(this,t,h,u?0:g,u,n,r):(l=!0,u=!1,d=0,h=0,g=0,A(),e.css("filter",""),e.css(i),R(t,e))}})}(t,e,u),c.isEnd&&i(t)&&function(t,e,n){var o,i,l=x(),c=k();e.resizable({handles:{s:".ui-resizable-handle"},grid:l,start:function(n,r){o=i=0,W(t,e),a("eventResizeStart",this,t,n,r)},resize:function(a,u){(o=Math.round((Math.max(l,e.height())-u.originalSize.height)/l))!=i&&(n.text(V(t.start,o||t.end?b(s(t),c*o):null,r("timeFormat"))),i=o)},stop:function(n,r){a("eventResizeStop",this,t,n,r),o?P(this,t,0,c*o,n,r):R(t,e)}})}(t,e,u),l(t,e)}n.draggableDayEvent=function(t,e,n){var o,i,s,l=n.isStart,c=!0,u=d(),f=T(),v=x(),p=k(),m=h();function w(){c||(e.width(o).height("").draggable("option","grid",null),c=!0)}e.draggable({opacity:r("dragOpacity","month"),revertDuration:r("dragRevertDuration"),start:function(n,d){a("eventDragStart",e,t,n,d),W(t,e),o=e.width(),u.start(function(n,a){if(Y(),n){i=!1;var o=M(0,a.col),u=M(0,n.col);s=E(u,o),n.row?l?c&&(e.width(f-10),A(e,v*Math.round((t.end?(t.end-t.start)/g:r("defaultEventMinutes"))/p)),e.draggable("option","grid",[f,1]),c=!1):i=!0:(q(y(C(t.start),s),y(N(t),s)),w()),i=i||c&&!s}else w(),i=!0;e.draggable("option","revert",i)},n,"drag")},stop:function(n,r){if(u.stop(),Y(),a("eventDragStop",e,t,n,r),i)w(),e.css("filter",""),R(t,e);else{var o=0;c||(o=Math.round((e.offset().top-H().offset().top)/v)*p+m-(60*t.start.getHours()+t.start.getMinutes())),_(this,t,s,o,c,n,r)}}})}}.call(o);var i,s,l,c,u,f,v,h,p,m,w,S,T,x,H,F,R,P,q,Y,J,V,U,Z,$,Q,K,tt,at,ot,it,dt,vt,ht,gt,pt,mt,yt,wt,bt,Dt=o.opt,Ct=o.trigger,Mt=o.renderOverlay,Et=o.clearOverlays,St=o.reportSelection,Tt=o.unselect,xt=o.daySelectionMousedown,kt=o.slotSegHtml,Ht=o.cellToDate,Ft=o.dateToCell,Rt=o.rangeToSegments,Nt=r.formatDate,zt={};function Wt(){var e=""+function(){var t,e,n,r=vt+"-widget-header",a="";for(a+="",yt?(t=Ht(0,0),e=Nt(t,bt),ht?e+=wt:e=wt+e,a+=""+B(e)+" | "):a+=" | ",n=0;n"+B(Nt(t,mt))+"";return a+=" |
"}()+function(){var t,e,n,r,a,o=vt+"-widget-header",i=vt+"-widget-content",s=D(new Date),l="";for(l+=" | ",n="",e=0;e",n+=r;return l+=n,l+=" |
"}()+"
";i&&i.remove(),i=t(e).appendTo(n),s=i.find("thead"),l=s.find("th").slice(1,-1),c=i.find("tbody"),u=c.find("td").slice(0,-1),f=u.find("> div"),v=u.find(".fc-day-content > div"),h=u.eq(0),p=f.eq(0),I(s.add(s.find("tr"))),I(c.add(c.find("tr")))}function At(t){t.click(Lt).mousedown(xt)}function Ot(t){t.click(Lt).mousedown(Jt)}function Lt(t){if(!Dt("selectable")){var e=Math.min(K-1,Math.floor((t.pageX-i.offset().left-Y)/J)),n=Ht(0,e),r=this.parentNode.className.match(/fc-slot(\d+)/);if(r){var a=parseInt(r[1])*Dt("slotMinutes"),o=Math.floor(a/60);n.setHours(o),n.setMinutes(a%60+gt),Ct("dayClick",u[e],n,!1,t)}else Ct("dayClick",u[e],n,!0,t)}}function _t(t,e,n){n&&at.build();for(var r=Rt(t,e),a=0;a=0&&b(e,gt+n*Z),e}function jt(t,n){if(t=C(t,!0),n=b(C(t),pt))return R.height();var r=Dt("slotMinutes"),a=60*n.getHours()+n.getMinutes()-gt,o=Math.floor(a/r),i=zt[o];return i===e&&(i=zt[o]=R.find("tr").eq(o).find("td div")[0].offsetTop),Math.max(0,Math.round(i-1+U*(a%r/r)))}function It(e,n){var r=Dt("selectHelper");if(at.build(),r){var a=Ft(e).col;if(a>=0&&ai){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,t.isFunction(r)){var l=r(e,n);l&&(o.position="absolute",P=t(l).css(o).appendTo(H))}else o.isStart=!0,o.isEnd=!0,(P=t(kt({title:"",start:e,end:n,className:["fc-select-helper"],editable:!1},o))).css("opacity",Dt("dragOpacity"));P&&(Ot(P),H.append(P),W(P,o.width,!0),A(P,o.height,!0))}}}else qt(e,n)}function Xt(){Et(),P&&(P.remove(),P=null)}function Jt(e){var n;1==e.which&&Dt("selectable")&&(Tt(e),ot.start(function(t,e){if(Xt(),t&&t.col==e.col&&!Yt(t)){var r=Bt(e),a=Bt(t);It((n=[r,b(C(r),Z),a,b(C(a),Z)].sort(_))[0],n[3])}else n=null},e),t(document).one("mouseup",function(t){ot.stop(),n&&(+n[0]==+n[1]&&Vt(n[0],!1,t),St(n[0],n[3],!1,t))}))}function Vt(t,e,n){Ct("dayClick",u[Ft(t).col],t,e,n)}j(n.addClass("fc-agenda")),at=new ct(function(e,n){var r,a,o;l.each(function(e,i){r=t(i),a=r.offset().left,e&&(o[1]=a),o=[a],n[e]=o}),o[1]=a+r.outerWidth(),Dt("allDaySlot")&&(a=(r=T).offset().top,e[0]=[a,a+r.outerHeight()]);var i=H.offset().top,s=x.offset().top,c=s+x.outerHeight();function u(t){return Math.max(s,Math.min(c,t))}for(var f=0;fo.start&&a.start"):c,f=function(t){for(var e=[],n=0;n div");return n}(),a=[];if(e)for(var o=0;o",!a.allDay&&t.isStart&&(e+=""+B(S(a.start,a.end,r("timeFormat")))+""),e+=""+B(a.title||"")+"
",t.isEnd&&i(a)&&(e+="
"),e+=""+(s?"a":"div")+">"}function J(t){for(var e=[],n=function(t){t.sort(it);for(var e=[],n=0;n=t.leftCol)return!0}return!1}function ot(t,e){for(var n=0;n"));o[0].parentNode!=a[0]&&o.appendTo(a);return e.push(o.css(r).show()),o},this.clearOverlays=function(){var t;for(;t=e.shift();)n.push(t.hide().unbind())};var e=[],n=[]}function ct(t){var e,n,r=this;r.build=function(){t(e=[],n=[])},r.cell=function(t,r){var a,o=e.length,i=n.length,s=-1,l=-1;for(a=0;a=e[a][0]&&r=n[a][0]&&t=0&&l>=0?{row:s,col:l}:null},r.rect=function(t,r,a,o,i){var s=i.offset();return{top:e[t][0]-s.top,left:n[r][0]-s.left,width:n[o][1]-n[r][0],height:e[a][1]-e[t][0]}}}function ut(n){var r,a,o,i;function s(t){var r;(r=t).pageX===e&&(r.pageX=r.originalEvent.pageX,r.pageY=r.originalEvent.pageY);var s=n.cell(t.pageX,t.pageY);(!s!=!i||s&&(s.row!=i.row||s.col!=i.col))&&(s?(o||(o=s),a(s,o,s.row-o.row,s.col-o.col)):a(s,o),i=s)}this.start=function(e,l,c){a=e,o=i=null,n.build(),s(l),r=c||"mousemove",t(document).bind(r,s)},this.stop=function(){return t(document).unbind(r,s),i}}function ft(t){var n=this,r={},a={},o={};function i(e){return r[e]=r[e]||t(e)}n.left=function(t){return a[t]=a[t]===e?i(t).position().left:a[t]},n.right=function(t){return o[t]=o[t]===e?n.left(t)+i(t).width():o[t]},n.clear=function(){r={},a={},o={}}}o.dateFormatters=R,o.applyAll=J,i.month=function(t,e){var n=this;n.render=function(t,e){e&&(m(t,e),t.setDate(1));var l=r("firstDay"),c=C(t,!0);c.setDate(1);var u=m(C(c),1),f=C(c);y(f,-(f.getDay()-l+7)%7),o(f);var d=C(u);y(d,(7-d.getDay()+l)%7),o(d,-1,!0);var v=i(),h=Math.round(E(d,f)/7);"fixed"==r("weekMode")&&(y(d,7*(6-h)),h=6);n.title=s(c,r("titleFormat")),n.start=c,n.end=u,n.visStart=f,n.visEnd=d,a(h,v,!0)},U.call(n,t,e,"month");var r=n.opt,a=n.renderBasic,o=n.skipHiddenDays,i=n.getCellsPerWeek,s=e.formatDate},i.basicWeek=function(t,e){var n=this;n.render=function(t,e){e&&y(t,7*e);var l=y(C(t),-(t.getDay()-r("firstDay")+7)%7),c=y(C(l),7),u=C(l);o(u);var f=C(c);o(f,-1,!0);var d=i();n.start=l,n.end=c,n.visStart=u,n.visEnd=f,n.title=s(u,y(C(f),-1),r("titleFormat")),a(1,d,!1)},U.call(n,t,e,"basicWeek");var r=n.opt,a=n.renderBasic,o=n.skipHiddenDays,i=n.getCellsPerWeek,s=e.formatDates},i.basicDay=function(t,e){var n=this;n.render=function(t,e){e&&y(t,e);o(t,e<0?-1:1);var s=C(t,!0),l=y(C(s),1);n.title=i(t,r("titleFormat")),n.start=n.visStart=s,n.end=n.visEnd=l,a(1,1,!1)},U.call(n,t,e,"basicDay");var r=n.opt,a=n.renderBasic,o=n.skipHiddenDays,i=e.formatDate},s({weekMode:"fixed"}),i.agendaWeek=function(t,e){var n=this;n.render=function(t,e){e&&y(t,7*e);var l=y(C(t),-(t.getDay()-r("firstDay")+7)%7),c=y(C(l),7),u=C(l);o(u);var f=C(c);o(f,-1,!0);var d=i();n.title=s(u,y(C(f),-1),r("titleFormat")),n.start=l,n.end=c,n.visStart=u,n.visEnd=f,a(d)},Z.call(n,t,e,"agendaWeek");var r=n.opt,a=n.renderAgenda,o=n.skipHiddenDays,i=n.getCellsPerWeek,s=e.formatDates},i.agendaDay=function(t,e){var n=this;n.render=function(t,e){e&&y(t,e);o(t,e<0?-1:1);var s=C(t,!0),l=y(C(s),1);n.title=i(t,r("titleFormat")),n.start=n.visStart=s,n.end=n.visEnd=l,a(1)},Z.call(n,t,e,"agendaDay");var r=n.opt,a=n.renderAgenda,o=n.skipHiddenDays,i=e.formatDate},s({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,slotEventOverlap:!0})}(jQuery);