RishiShreshtha

Untitled

Apr 15th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  
  3.  FullCalendar v1.5.4
  4.  http://arshaw.com/fullcalendar/
  5.  
  6.  Use fullcalendar.css for basic styling.
  7.  For event drag & drop, requires jQuery UI draggable.
  8.  For event resizing, requires jQuery UI resizable.
  9.  
  10.  Copyright (c) 2011 Adam Shaw
  11.  Dual licensed under the MIT and GPL licenses, located in
  12.  MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
  13.  
  14.  Date: Tue Sep 4 23:38:33 2012 -0700
  15.  
  16. */
  17. (function (m, ma) {
  18.     function wb(a) {
  19.         m.extend(true, Ya, a)
  20.     }
  21.  
  22.     function Yb(a, b, e) {
  23.         function d(k) {
  24.             if (E) {
  25.                 u();
  26.                 q();
  27.                 na();
  28.                 S(k)
  29.             } else f()
  30.         }
  31.  
  32.         function f() {
  33.             B = b.theme ? "ui" : "fc";
  34.             a.addClass("fc");
  35.             b.isRTL && a.addClass("fc-rtl");
  36.             b.theme && a.addClass("ui-widget");
  37.             E = m("<div class='fc-content' style='position:relative'/>").prependTo(a);
  38.             C = new Zb(X, b);
  39.             (P = C.render()) && a.prepend(P);
  40.             y(b.defaultView);
  41.             m(window).resize(oa);
  42.             t() || g()
  43.         }
  44.  
  45.         function g() {
  46.             setTimeout(function () {
  47.                 !n.start && t() && S()
  48.             }, 0)
  49.         }
  50.  
  51.         function l() {
  52.             m(window).unbind("resize", oa);
  53.             C.destroy();
  54.             E.remove();
  55.             a.removeClass("fc fc-rtl ui-widget")
  56.         }
  57.  
  58.         function j() {
  59.             return i.offsetWidth !== 0
  60.         }
  61.  
  62.         function t() {
  63.             return m("body")[0].offsetWidth !== 0
  64.         }
  65.  
  66.         function y(k) {
  67.             if (!n || k != n.name) {
  68.                 F++;
  69.                 pa();
  70.                 var D = n,
  71.                     Z;
  72.                 if (D) {
  73.                     (D.beforeHide || xb)();
  74.                     Za(E, E.height());
  75.                     D.element.hide()
  76.                 } else Za(E, 1);
  77.                 E.css("overflow", "hidden");
  78.                 if (n = Y[k]) n.element.show();
  79.                 else n = Y[k] = new Ja[k](Z = s = m("<div class='fc-view fc-view-" + k + "' style='position:absolute'/>").appendTo(E), X);
  80.                 D && C.deactivateButton(D.name);
  81.                 C.activateButton(k);
  82.                 S();
  83.                 E.css("overflow", "");
  84.                 D && Za(E, 1);
  85.                 Z || (n.afterShow || xb)();
  86.                 F--
  87.             }
  88.         }
  89.  
  90.         function S(k) {
  91.             if (j()) {
  92.                 F++;
  93.                 pa();
  94.                 o === ma && u();
  95.                 var D = false;
  96.                 if (!n.start || k || r < n.start || r >= n.end) {
  97.                     n.render(r, k || 0);
  98.                     fa(true);
  99.                     D = true
  100.                 } else if (n.sizeDirty) {
  101.                     n.clearEvents();
  102.                     fa();
  103.                     D = true
  104.                 } else if (n.eventsDirty) {
  105.                     n.clearEvents();
  106.                     D = true
  107.                 }
  108.                 n.sizeDirty = false;
  109.                 n.eventsDirty = false;
  110.                 ga(D);
  111.                 W = a.outerWidth();
  112.                 C.updateTitle(n.title);
  113.                 k = new Date;
  114.                 k >= n.start && k < n.end ? C.disableButton("today") : C.enableButton("today");
  115.                 F--;
  116.                 n.trigger("viewDisplay", i)
  117.             }
  118.         }
  119.  
  120.         function Q() {
  121.             q();
  122.             if (j()) {
  123.                 u();
  124.                 fa();
  125.                 pa();
  126.                 n.clearEvents();
  127.                 n.renderEvents(J);
  128.                 n.sizeDirty = false
  129.             }
  130.         }
  131.  
  132.         function q() {
  133.             m.each(Y, function (k, D) {
  134.                 D.sizeDirty = true
  135.             })
  136.         }
  137.  
  138.         function u() {
  139.             o = b.contentHeight ? b.contentHeight : b.height ? b.height - (P ? P.height() : 0) - Sa(E) : Math.round(E.width() / Math.max(b.aspectRatio, 0.5))
  140.         }
  141.  
  142.         function fa(k) {
  143.             F++;
  144.             n.setHeight(o, k);
  145.             if (s) {
  146.                 s.css("position", "relative");
  147.                 s = null
  148.             }
  149.             n.setWidth(E.width(), k);
  150.             F--
  151.         }
  152.  
  153.         function oa() {
  154.             if (!F) if (n.start) {
  155.                 var k = ++v;
  156.                 setTimeout(function () {
  157.                     if (k == v && !F && j()) if (W != (W = a.outerWidth())) {
  158.                         F++;
  159.                         Q();
  160.                         n.trigger("windowResize", i);
  161.                         F--
  162.                     }
  163.                 }, 200)
  164.             } else g()
  165.         }
  166.  
  167.         function ga(k) {
  168.             if (!b.lazyFetching || ya(n.visStart, n.visEnd)) ra();
  169.             else k && da()
  170.         }
  171.  
  172.         function ra() {
  173.             K(n.visStart, n.visEnd)
  174.         }
  175.  
  176.         function sa(k) {
  177.             J = k;
  178.             da()
  179.         }
  180.  
  181.         function ha(k) {
  182.             da(k)
  183.         }
  184.  
  185.         function da(k) {
  186.             na();
  187.             if (j()) {
  188.                 n.clearEvents();
  189.                 n.renderEvents(J, k);
  190.                 n.eventsDirty = false
  191.             }
  192.         }
  193.  
  194.         function na() {
  195.             m.each(Y, function (k, D) {
  196.                 D.eventsDirty = true
  197.             })
  198.         }
  199.  
  200.         function ua(k, D, Z) {
  201.             n.select(k, D, Z === ma ? true : Z)
  202.         }
  203.  
  204.         function pa() {
  205.             n && n.unselect()
  206.         }
  207.  
  208.         function U() {
  209.             S(-1)
  210.         }
  211.  
  212.         function ca() {
  213.             S(1)
  214.         }
  215.  
  216.         function ka() {
  217.             gb(r, -1);
  218.             S()
  219.         }
  220.  
  221.         function qa() {
  222.             gb(r, 1);
  223.             S()
  224.         }
  225.  
  226.         function G() {
  227.             r = new Date;
  228.             S()
  229.         }
  230.  
  231.         function p(k, D, Z) {
  232.             if (k instanceof Date) r = N(k);
  233.             else yb(r, k, D, Z);
  234.             S()
  235.         }
  236.  
  237.         function L(k, D, Z) {
  238.             k !== ma && gb(r, k);
  239.             D !== ma && hb(r, D);
  240.             Z !== ma && ba(r, Z);
  241.             S()
  242.         }
  243.  
  244.         function c() {
  245.             return N(r)
  246.         }
  247.  
  248.         function z() {
  249.             return n
  250.         }
  251.  
  252.         function H(k, D) {
  253.             if (D === ma) return b[k];
  254.             if (k == "height" || k == "contentHeight" || k == "aspectRatio") {
  255.                 b[k] = D;
  256.                 Q()
  257.             }
  258.         }
  259.  
  260.         function T(k, D) {
  261.             if (b[k]) return b[k].apply(D || i, Array.prototype.slice.call(arguments, 2))
  262.         }
  263.         var X = this;
  264.         X.options = b;
  265.         X.render = d;
  266.         X.destroy = l;
  267.         X.refetchEvents = ra;
  268.         X.reportEvents = sa;
  269.         X.reportEventChange = ha;
  270.         X.rerenderEvents = da;
  271.         X.changeView = y;
  272.         X.select = ua;
  273.         X.unselect = pa;
  274.         X.prev = U;
  275.         X.next = ca;
  276.         X.prevYear = ka;
  277.         X.nextYear = qa;
  278.         X.today = G;
  279.         X.gotoDate = p;
  280.         X.incrementDate = L;
  281.         X.formatDate = function (k, D) {
  282.             return Oa(k, D, b)
  283.         };
  284.         X.formatDates = function (k, D, Z) {
  285.             return ib(k, D, Z, b)
  286.         };
  287.         X.getDate = c;
  288.         X.getView = z;
  289.         X.option = H;
  290.         X.trigger = T;
  291.         $b.call(X, b, e);
  292.         var ya = X.isFetchNeeded,
  293.             K = X.fetchEvents,
  294.             i = a[0],
  295.             C, P, E, B, n, Y = {},
  296.             W, o, s, v = 0,
  297.             F = 0,
  298.             r = new Date,
  299.             J = [],
  300.             M;
  301.         yb(r, b.year, b.month, b.date);
  302.         b.droppable && m(document).bind("dragstart", function (k, D) {
  303.             var Z = k.target,
  304.                 ja = m(Z);
  305.             if (!ja.parents(".fc").length) {
  306.                 var ia = b.dropAccept;
  307.                 if (m.isFunction(ia) ? ia.call(Z, ja) : ja.is(ia)) {
  308.                     M = Z;
  309.                     n.dragStart(M, k, D)
  310.                 }
  311.             }
  312.         }).bind("dragstop", function (k, D) {
  313.             if (M) {
  314.                 n.dragStop(M, k, D);
  315.                 M = null
  316.             }
  317.         })
  318.     }
  319.  
  320.     function Zb(a, b) {
  321.         function e() {
  322.             q = b.theme ? "ui" : "fc";
  323.             if (b.header) return Q = m("<table class='fc-header' style='width:100%'/>").append(m("<tr/>").append(f("left")).append(f("center")).append(f("right")))
  324.         }
  325.  
  326.         function d() {
  327.             Q.remove()
  328.         }
  329.  
  330.         function f(u) {
  331.             var fa = m("<td class='fc-header-" + u + "'/>");
  332.             (u = b.header[u]) && m.each(u.split(" "), function (oa) {
  333.                 oa > 0 && fa.append("<span class='fc-header-space'/>");
  334.                 var ga;
  335.                 m.each(this.split(","), function (ra, sa) {
  336.                     if (sa == "title") {
  337.                         fa.append("<span class='fc-header-title'><h2>&nbsp;</h2></span>");
  338.                         ga && ga.addClass(q + "-corner-right");
  339.                         ga = null
  340.                     } else {
  341.                         var ha;
  342.                         if (a[sa]) ha = a[sa];
  343.                         else if (Ja[sa]) ha = function () {
  344.                             na.removeClass(q + "-state-hover");
  345.                             a.changeView(sa)
  346.                         };
  347.                         if (ha) {
  348.                             ra = b.theme ? jb(b.buttonIcons, sa) : null;
  349.                             var da = jb(b.buttonText, sa),
  350.                                 na = m("<span class='fc-button fc-button-" + sa + " " + q + "-state-default'><span class='fc-button-inner'><span class='fc-button-content'>" + (ra ? "<span class='fc-icon-wrap'><span class='ui-icon ui-icon-" + ra + "'/></span>" : da) + "</span><span class='fc-button-effect'><span></span></span></span></span>");
  351.                             if (na) {
  352.                                 na.click(function () {
  353.                                     na.hasClass(q + "-state-disabled") || ha()
  354.                                 }).mousedown(function () {
  355.                                     na.not("." + q + "-state-active").not("." + q + "-state-disabled").addClass(q + "-state-down")
  356.                                 }).mouseup(function () {
  357.                                     na.removeClass(q + "-state-down")
  358.                                 }).hover(function () {
  359.                                     na.not("." + q + "-state-active").not("." + q + "-state-disabled").addClass(q + "-state-hover")
  360.                                 }, function () {
  361.                                     na.removeClass(q + "-state-hover").removeClass(q + "-state-down")
  362.                                 }).appendTo(fa);
  363.                                 ga || na.addClass(q + "-corner-left");
  364.                                 ga = na
  365.                             }
  366.                         }
  367.                     }
  368.                 });
  369.                 ga && ga.addClass(q + "-corner-right")
  370.             });
  371.             return fa
  372.         }
  373.  
  374.         function g(u) {
  375.             Q.find("h2").html(u)
  376.         }
  377.  
  378.         function l(u) {
  379.             Q.find("span.fc-button-" + u).addClass(q + "-state-active")
  380.         }
  381.  
  382.         function j(u) {
  383.             Q.find("span.fc-button-" + u).removeClass(q + "-state-active")
  384.         }
  385.  
  386.         function t(u) {
  387.             Q.find("span.fc-button-" + u).addClass(q + "-state-disabled")
  388.         }
  389.  
  390.         function y(u) {
  391.             Q.find("span.fc-button-" + u).removeClass(q + "-state-disabled")
  392.         }
  393.         var S = this;
  394.         S.render = e;
  395.         S.destroy = d;
  396.         S.updateTitle = g;
  397.         S.activateButton = l;
  398.         S.deactivateButton = j;
  399.         S.disableButton = t;
  400.         S.enableButton = y;
  401.         var Q = m([]),
  402.             q
  403.     }
  404.  
  405.     function $b(a, b) {
  406.         function e(c, z) {
  407.             return !ca || c < ca || z > ka
  408.         }
  409.  
  410.         function d(c, z) {
  411.             ca = c;
  412.             ka = z;
  413.             L = [];
  414.             c = ++qa;
  415.             G = z = U.length;
  416.             for (var H = 0; H < z; H++) f(U[H], c)
  417.         }
  418.  
  419.         function f(c, z) {
  420.             g(c, function (H) {
  421.                 if (z == qa) {
  422.                     if (H) {
  423.                         for (var T = 0; T < H.length; T++) {
  424.                             H[T].source = c;
  425.                             oa(H[T])
  426.                         }
  427.                         L = L.concat(H)
  428.                     }
  429.                     G--;
  430.                     G || ua(L)
  431.                 }
  432.             })
  433.         }
  434.  
  435.         function g(c, z) {
  436.             var H, T = Aa.sourceFetchers,
  437.                 X;
  438.             for (H = 0; H < T.length; H++) {
  439.                 X = T[H](c, ca, ka, z);
  440.                 if (X === true) return;
  441.                 else if (typeof X == "object") {
  442.                     g(X, z);
  443.                     return
  444.                 }
  445.             }
  446.             if (H = c.events) if (m.isFunction(H)) {
  447.                 u();
  448.                 H(N(ca), N(ka), function (C) {
  449.                     z(C);
  450.                     fa()
  451.                 })
  452.             } else m.isArray(H) ? z(H) : z();
  453.             else if (c.url) {
  454.                 var ya = c.success,
  455.                     K = c.error,
  456.                     i = c.complete;
  457.                 H = m.extend({}, c.data || {});
  458.                 T = Ta(c.startParam, a.startParam);
  459.                 X = Ta(c.endParam, a.endParam);
  460.                 if (T) H[T] = Math.round(+ca / 1E3);
  461.                 if (X) H[X] = Math.round(+ka / 1E3);
  462.                 u();
  463.                 m.ajax(m.extend({}, ac, c, {
  464.                     data: H,
  465.                     success: function (C) {
  466.                         C = C || [];
  467.                         var P = $a(ya, this, arguments);
  468.                         if (m.isArray(P)) C = P;
  469.                         z(C)
  470.                     },
  471.                     error: function () {
  472.                         $a(K, this, arguments);
  473.                         z()
  474.                     },
  475.                     complete: function () {
  476.                         $a(i, this, arguments);
  477.                         fa()
  478.                     }
  479.                 }))
  480.             } else z()
  481.         }
  482.  
  483.         function l(c) {
  484.             if (c = j(c)) {
  485.                 G++;
  486.                 f(c, qa)
  487.             }
  488.         }
  489.  
  490.         function j(c) {
  491.             if (m.isFunction(c) || m.isArray(c)) c = {
  492.                 events: c
  493.             };
  494.             else if (typeof c == "string") c = {
  495.                 url: c
  496.             };
  497.             if (typeof c == "object") {
  498.                 ga(c);
  499.                 U.push(c);
  500.                 return c
  501.             }
  502.         }
  503.  
  504.         function t(c) {
  505.             U = m.grep(U, function (z) {
  506.                 return !ra(z, c)
  507.             });
  508.             L = m.grep(L, function (z) {
  509.                 return !ra(z.source, c)
  510.             });
  511.             ua(L)
  512.         }
  513.  
  514.         function y(c) {
  515.             var z, H = L.length,
  516.                 T, X = na().defaultEventEnd,
  517.                 ya = c.start - c._start,
  518.                 K = c.end ? c.end - (c._end || X(c)) : 0;
  519.             for (z = 0; z < H; z++) {
  520.                 T = L[z];
  521.                 if (T._id == c._id && T != c) {
  522.                     T.start = new Date(+T.start + ya);
  523.                     T.end = c.end ? T.end ? new Date(+T.end + K) : new Date(+X(T) + K) : null;
  524.                     T.title = c.title;
  525.                     T.url = c.url;
  526.                     T.allDay = c.allDay;
  527.                     T.className = c.className;
  528.                     T.editable = c.editable;
  529.                     T.color = c.color;
  530.                     T.backgroudColor = c.backgroudColor;
  531.                     T.borderColor = c.borderColor;
  532.                     T.textColor = c.textColor;
  533.                     oa(T)
  534.                 }
  535.             }
  536.             oa(c);
  537.             ua(L)
  538.         }
  539.  
  540.         function S(c, z) {
  541.             oa(c);
  542.             if (!c.source) {
  543.                 if (z) {
  544.                     pa.events.push(c);
  545.                     c.source = pa
  546.                 }
  547.                 L.push(c)
  548.             }
  549.             ua(L)
  550.         }
  551.  
  552.         function Q(c) {
  553.             if (c) {
  554.                 if (!m.isFunction(c)) {
  555.                     var z = c + "";
  556.                     c = function (T) {
  557.                         return T._id == z
  558.                     }
  559.                 }
  560.                 L = m.grep(L, c, true);
  561.                 for (H = 0; H < U.length; H++) if (m.isArray(U[H].events)) U[H].events = m.grep(U[H].events, c, true)
  562.             } else {
  563.                 L = [];
  564.                 for (var H = 0; H < U.length; H++) if (m.isArray(U[H].events)) U[H].events = []
  565.             }
  566.             ua(L)
  567.         }
  568.  
  569.         function q(c) {
  570.             if (m.isFunction(c)) return m.grep(L, c);
  571.             else if (c) {
  572.                 c += "";
  573.                 return m.grep(L, function (z) {
  574.                     return z._id == c
  575.                 })
  576.             }
  577.             return L
  578.         }
  579.  
  580.         function u() {
  581.             p++ || da("loading", null, true)
  582.         }
  583.  
  584.         function fa() {
  585.             --p || da("loading", null, false)
  586.         }
  587.  
  588.         function oa(c) {
  589.             var z = c.source || {},
  590.                 H = Ta(z.ignoreTimezone, a.ignoreTimezone);
  591.             c._id = c._id || (c.id === ma ? "_fc" + bc++ : c.id + "");
  592.             if (c.date) {
  593.                 if (!c.start) c.start = c.date;
  594.                 delete c.date
  595.             }
  596.             c._start = N(c.start = kb(c.start, H));
  597.             c.end = kb(c.end, H);
  598.             if (c.end && c.end <= c.start) c.end = null;
  599.             c._end = c.end ? N(c.end) : null;
  600.             if (c.allDay === ma) c.allDay = Ta(z.allDayDefault, a.allDayDefault);
  601.             if (c.className) {
  602.                 if (typeof c.className == "string") c.className = c.className.split(/\s+/)
  603.             } else c.className = []
  604.         }
  605.  
  606.         function ga(c) {
  607.             if (c.className) {
  608.                 if (typeof c.className == "string") c.className = c.className.split(/\s+/)
  609.             } else c.className = [];
  610.             for (var z = Aa.sourceNormalizers, H = 0; H < z.length; H++) z[H](c)
  611.         }
  612.  
  613.         function ra(c, z) {
  614.             return c && z && sa(c) == sa(z)
  615.         }
  616.  
  617.         function sa(c) {
  618.             return (typeof c == "object" ? c.events || c.url : "") || c
  619.         }
  620.         var ha = this;
  621.         ha.isFetchNeeded = e;
  622.         ha.fetchEvents = d;
  623.         ha.addEventSource = l;
  624.         ha.removeEventSource = t;
  625.         ha.updateEvent = y;
  626.         ha.renderEvent = S;
  627.         ha.removeEvents = Q;
  628.         ha.clientEvents = q;
  629.         ha.normalizeEvent = oa;
  630.         var da = ha.trigger,
  631.             na = ha.getView,
  632.             ua = ha.reportEvents,
  633.             pa = {
  634.                 events: []
  635.             },
  636.             U = [pa],
  637.             ca, ka, qa = 0,
  638.             G = 0,
  639.             p = 0,
  640.             L = [];
  641.         for (ha = 0; ha < b.length; ha++) j(b[ha])
  642.     }
  643.  
  644.     function gb(a, b, e) {
  645.         a.setFullYear(a.getFullYear() + b);
  646.         e || Ka(a);
  647.         return a
  648.     }
  649.  
  650.     function hb(a, b, e) {
  651.         if (+a) {
  652.             b = a.getMonth() + b;
  653.             var d = N(a);
  654.             d.setDate(1);
  655.             d.setMonth(b);
  656.             a.setMonth(b);
  657.             for (e || Ka(a); a.getMonth() != d.getMonth();) a.setDate(a.getDate() + (a < d ? 1 : -1))
  658.         }
  659.         return a
  660.     }
  661.  
  662.     function ba(a, b, e) {
  663.         if (+a) {
  664.             b = a.getDate() + b;
  665.             var d = N(a);
  666.             d.setHours(9);
  667.             d.setDate(b);
  668.             a.setDate(b);
  669.             e || Ka(a);
  670.             lb(a, d)
  671.         }
  672.         return a
  673.     }
  674.  
  675.     function lb(a, b) {
  676.         if (+a) for (; a.getDate() != b.getDate();) a.setTime(+a + (a < b ? 1 : -1) * cc)
  677.     }
  678.  
  679.     function xa(a, b) {
  680.         a.setMinutes(a.getMinutes() + b);
  681.         return a
  682.     }
  683.  
  684.     function Ka(a) {
  685.         a.setHours(0);
  686.         a.setMinutes(0);
  687.         a.setSeconds(0);
  688.         a.setMilliseconds(0);
  689.         return a
  690.     }
  691.  
  692.     function N(a, b) {
  693.         if (b) return Ka(new Date(+a));
  694.         return new Date(+a)
  695.     }
  696.  
  697.     function zb() {
  698.         var a = 0,
  699.             b;
  700.         do b = new Date(1970, a++, 1);
  701.         while (b.getHours());
  702.         return b
  703.     }
  704.  
  705.     function Fa(a, b, e) {
  706.         for (b = b || 1; !a.getDay() || e && a.getDay() == 1 || !e && a.getDay() == 6;) ba(a, b);
  707.         return a
  708.     }
  709.  
  710.     function Ca(a, b) {
  711.         return Math.round((N(a, true) - N(b, true)) / Ab)
  712.     }
  713.  
  714.     function yb(a, b, e, d) {
  715.         if (b !== ma && b != a.getFullYear()) {
  716.             a.setDate(1);
  717.             a.setMonth(0);
  718.             a.setFullYear(b)
  719.         }
  720.         if (e !== ma && e != a.getMonth()) {
  721.             a.setDate(1);
  722.             a.setMonth(e)
  723.         }
  724.         d !== ma && a.setDate(d)
  725.     }
  726.  
  727.     function kb(a, b) {
  728.         if (typeof a == "object") return a;
  729.         if (typeof a == "number") return new Date(a * 1E3);
  730.         if (typeof a == "string") {
  731.             if (a.match(/^\d+(\.\d+)?$/)) return new Date(parseFloat(a) * 1E3);
  732.             if (b === ma) b = true;
  733.             return Bb(a, b) || (a ? new Date(a) : null)
  734.         }
  735.         return null
  736.     }
  737.  
  738.     function Bb(a, b) {
  739.         a = a.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}))?))?)?)?)?$/);
  740.         if (!a) return null;
  741.         var e = new Date(a[1], 0, 1);
  742.         if (b || !a[13]) {
  743.             b = new Date(a[1], 0, 1, 9, 0);
  744.             if (a[3]) {
  745.                 e.setMonth(a[3] - 1);
  746.                 b.setMonth(a[3] - 1)
  747.             }
  748.             if (a[5]) {
  749.                 e.setDate(a[5]);
  750.                 b.setDate(a[5])
  751.             }
  752.             lb(e, b);
  753.             a[7] && e.setHours(a[7]);
  754.             a[8] && e.setMinutes(a[8]);
  755.             a[10] && e.setSeconds(a[10]);
  756.             a[12] && e.setMilliseconds(Number("0." + a[12]) * 1E3);
  757.             lb(e, b)
  758.         } else {
  759.             e.setUTCFullYear(a[1], a[3] ? a[3] - 1 : 0, a[5] || 1);
  760.             e.setUTCHours(a[7] || 0, a[8] || 0, a[10] || 0, a[12] ? Number("0." + a[12]) * 1E3 : 0);
  761.             if (a[14]) {
  762.                 b = Number(a[16]) * 60 + (a[18] ? Number(a[18]) : 0);
  763.                 b *= a[15] == "-" ? 1 : -1;
  764.                 e = new Date(+e + b * 60 * 1E3)
  765.             }
  766.         }
  767.         return e
  768.     }
  769.  
  770.     function mb(a) {
  771.         if (typeof a == "number") return a * 60;
  772.         if (typeof a == "object") return a.getHours() * 60 + a.getMinutes();
  773.         if (a = a.match(/(\d+)(?::(\d+))?\s*(\w+)?/)) {
  774.             var b = parseInt(a[1], 10);
  775.             if (a[3]) {
  776.                 b %= 12;
  777.                 if (a[3].toLowerCase().charAt(0) == "p") b += 12
  778.             }
  779.             return b * 60 + (a[2] ? parseInt(a[2], 10) : 0)
  780.         }
  781.     }
  782.  
  783.     function Oa(a, b, e) {
  784.         return ib(a, null, b, e)
  785.     }
  786.  
  787.     function ib(a, b, e, d) {
  788.         d = d || Ya;
  789.         var f = a,
  790.             g = b,
  791.             l, j = e.length,
  792.             t, y, S, Q = "";
  793.         for (l = 0; l < j; l++) {
  794.             t = e.charAt(l);
  795.             if (t == "'") for (y = l + 1; y < j; y++) {
  796.                 if (e.charAt(y) == "'") {
  797.                     if (f) {
  798.                         Q += y == l + 1 ? "'" : e.substring(l + 1, y);
  799.                         l = y
  800.                     }
  801.                     break
  802.                 }
  803.             } else if (t == "(") for (y = l + 1; y < j; y++) {
  804.                 if (e.charAt(y) == ")") {
  805.                     l = Oa(f, e.substring(l + 1, y), d);
  806.                     if (parseInt(l.replace(/\D/, ""), 10)) Q += l;
  807.                     l = y;
  808.                     break
  809.                 }
  810.             } else if (t == "[") for (y = l + 1; y < j; y++) {
  811.                 if (e.charAt(y) == "]") {
  812.                     t = e.substring(l + 1, y);
  813.                     l = Oa(f, t, d);
  814.                     if (l != Oa(g, t, d)) Q += l;
  815.                     l = y;
  816.                     break
  817.                 }
  818.             } else if (t == "{") {
  819.                 f = b;
  820.                 g = a
  821.             } else if (t == "}") {
  822.                 f = a;
  823.                 g = b
  824.             } else {
  825.                 for (y = j; y > l; y--) if (S = dc[e.substring(l, y)]) {
  826.                     if (f) Q += S(f, d);
  827.                     l = y - 1;
  828.                     break
  829.                 }
  830.                 if (y == l) if (f) Q += t
  831.             }
  832.         }
  833.         return Q
  834.     }
  835.  
  836.     function Ua(a) {
  837.         return a.end ? ec(a.end, a.allDay) : ba(N(a.start), 1)
  838.     }
  839.  
  840.     function ec(a, b) {
  841.         a = N(a);
  842.         return b || a.getHours() || a.getMinutes() ? ba(a, 1) : Ka(a)
  843.     }
  844.  
  845.     function fc(a, b) {
  846.         return (b.msLength - a.msLength) * 100 + (a.event.start - b.event.start)
  847.     }
  848.  
  849.     function Cb(a, b) {
  850.         return a.end > b.start && a.start < b.end
  851.     }
  852.  
  853.     function nb(a, b, e, d) {
  854.         var f = [],
  855.             g, l = a.length,
  856.             j, t, y, S, Q;
  857.         for (g = 0; g < l; g++) {
  858.             j = a[g];
  859.             t = j.start;
  860.             y = b[g];
  861.             if (y > e && t < d) {
  862.                 if (t < e) {
  863.                     t = N(e);
  864.                     S = false
  865.                 } else {
  866.                     t = t;
  867.                     S = true
  868.                 }
  869.                 if (y > d) {
  870.                     y = N(d);
  871.                     Q = false
  872.                 } else {
  873.                     y = y;
  874.                     Q = true
  875.                 }
  876.                 f.push({
  877.                     event: j,
  878.                     start: t,
  879.                     end: y,
  880.                     isStart: S,
  881.                     isEnd: Q,
  882.                     msLength: y - t
  883.                 })
  884.             }
  885.         }
  886.         return f.sort(fc)
  887.     }
  888.  
  889.     function ob(a) {
  890.         var b = [],
  891.             e, d = a.length,
  892.             f, g, l, j;
  893.         for (e = 0; e < d; e++) {
  894.             f = a[e];
  895.             for (g = 0;;) {
  896.                 l = false;
  897.                 if (b[g]) for (j = 0; j < b[g].length; j++) if (Cb(b[g][j], f)) {
  898.                     l = true;
  899.                     break
  900.                 }
  901.                 if (l) g++;
  902.                 else break
  903.             }
  904.             if (b[g]) b[g].push(f);
  905.             else b[g] = [f]
  906.         }
  907.         return b
  908.     }
  909.  
  910.     function Db(a, b, e) {
  911.         a.unbind("mouseover").mouseover(function (d) {
  912.             for (var f = d.target, g; f != this;) {
  913.                 g = f;
  914.                 f = f.parentNode
  915.             }
  916.             if ((f = g._fci) !== ma) {
  917.                 g._fci = ma;
  918.                 g = b[f];
  919.                 e(g.event, g.element, g);
  920.                 m(d.target).trigger(d)
  921.             }
  922.             d.stopPropagation()
  923.         })
  924.     }
  925.  
  926.     function Va(a, b, e) {
  927.         for (var d = 0, f; d < a.length; d++) {
  928.             f = m(a[d]);
  929.             f.width(Math.max(0, b - pb(f, e)))
  930.         }
  931.     }
  932.  
  933.     function Eb(a, b, e) {
  934.         for (var d = 0, f; d < a.length; d++) {
  935.             f = m(a[d]);
  936.             f.height(Math.max(0, b - Sa(f, e)))
  937.         }
  938.     }
  939.  
  940.     function pb(a, b) {
  941.         return gc(a) + hc(a) + (b ? ic(a) : 0)
  942.     }
  943.  
  944.     function gc(a) {
  945.         return (parseFloat(m.css(a[0], "paddingLeft", true)) || 0) + (parseFloat(m.css(a[0], "paddingRight", true)) || 0)
  946.     }
  947.  
  948.     function ic(a) {
  949.         return (parseFloat(m.css(a[0], "marginLeft", true)) || 0) + (parseFloat(m.css(a[0], "marginRight", true)) || 0)
  950.     }
  951.  
  952.     function hc(a) {
  953.         return (parseFloat(m.css(a[0], "borderLeftWidth", true)) || 0) + (parseFloat(m.css(a[0], "borderRightWidth", true)) || 0)
  954.     }
  955.  
  956.     function Sa(a, b) {
  957.         return jc(a) + kc(a) + (b ? Fb(a) : 0)
  958.     }
  959.  
  960.     function jc(a) {
  961.         return (parseFloat(m.css(a[0], "paddingTop", true)) || 0) + (parseFloat(m.css(a[0], "paddingBottom", true)) || 0)
  962.     }
  963.  
  964.     function Fb(a) {
  965.         return (parseFloat(m.css(a[0], "marginTop", true)) || 0) + (parseFloat(m.css(a[0], "marginBottom", true)) || 0)
  966.     }
  967.  
  968.     function kc(a) {
  969.         return (parseFloat(m.css(a[0], "borderTopWidth", true)) || 0) + (parseFloat(m.css(a[0], "borderBottomWidth", true)) || 0)
  970.     }
  971.  
  972.     function Za(a, b) {
  973.         b = typeof b == "number" ? b + "px" : b;
  974.         a.each(function (e, d) {
  975.             d.style.cssText += ";min-height:" + b + ";_height:" + b
  976.         })
  977.     }
  978.  
  979.     function xb() {}
  980.  
  981.     function Gb(a, b) {
  982.         return a - b
  983.     }
  984.  
  985.     function Hb(a) {
  986.         return Math.max.apply(Math, a)
  987.     }
  988.  
  989.     function Pa(a) {
  990.         return (a < 10 ? "0" : "") + a
  991.     }
  992.  
  993.     function jb(a, b) {
  994.         if (a[b] !== ma) return a[b];
  995.         b = b.split(/(?=[A-Z])/);
  996.         for (var e = b.length - 1, d; e >= 0; e--) {
  997.             d = a[b[e].toLowerCase()];
  998.             if (d !== ma) return d
  999.         }
  1000.         return a[""]
  1001.     }
  1002.  
  1003.     function Qa(a) {
  1004.         return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&#039;").replace(/"/g, "&quot;").replace(/\n/g, "<br />")
  1005.     }
  1006.  
  1007.     function Ib(a) {
  1008.         return a.id + "/" + a.className + "/" + a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig, "")
  1009.     }
  1010.  
  1011.     function qb(a) {
  1012.         a.attr("unselectable", "on").css("MozUserSelect", "none").bind("selectstart.ui", function () {
  1013.             return false
  1014.         })
  1015.     }
  1016.  
  1017.     function ab(a) {
  1018.         a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")
  1019.     }
  1020.  
  1021.     function rb(a, b) {
  1022.         a.each(function (e, d) {
  1023.             d.className = d.className.replace(/^fc-\w*/, "fc-" + lc[b.getDay()])
  1024.         })
  1025.     }
  1026.  
  1027.     function Jb(a, b) {
  1028.         var e = a.source || {},
  1029.             d = a.color,
  1030.             f = e.color,
  1031.             g = b("eventColor"),
  1032.             l = a.backgroundColor || d || e.backgroundColor || f || b("eventBackgroundColor") || g;
  1033.         d = a.borderColor || d || e.borderColor || f || b("eventBorderColor") || g;
  1034.         a = a.textColor || e.textColor || b("eventTextColor");
  1035.         b = [];
  1036.         l && b.push("background-color:" + l);
  1037.         d && b.push("border-color:" + d);
  1038.         a && b.push("color:" + a);
  1039.         return b.join(";")
  1040.     }
  1041.  
  1042.     function $a(a, b, e) {
  1043.         if (m.isFunction(a)) a = [a];
  1044.         if (a) {
  1045.             var d, f;
  1046.             for (d = 0; d < a.length; d++) f = a[d].apply(b, e) || f;
  1047.             return f
  1048.         }
  1049.     }
  1050.  
  1051.     function Ta() {
  1052.         for (var a = 0; a < arguments.length; a++) if (arguments[a] !== ma) return arguments[a]
  1053.     }
  1054.  
  1055.     function mc(a, b) {
  1056.         function e(j, t) {
  1057.             if (t) {
  1058.                 hb(j, t);
  1059.                 j.setDate(1)
  1060.             }
  1061.             j = N(j, true);
  1062.             j.setDate(1);
  1063.             t = hb(N(j), 1);
  1064.             var y = N(j),
  1065.                 S = N(t),
  1066.                 Q = f("firstDay"),
  1067.                 q = f("weekends") ? 0 : 1;
  1068.             if (q) {
  1069.                 Fa(y);
  1070.                 Fa(S, -1, true)
  1071.             }
  1072.             ba(y, -((y.getDay() - Math.max(Q, q) + 7) % 7));
  1073.             ba(S, (7 - S.getDay() + Math.max(Q, q)) % 7);
  1074.             Q = Math.round((S - y) / (Ab * 7));
  1075.             if (f("weekMode") == "fixed") {
  1076.                 ba(S, (6 - Q) * 7);
  1077.                 Q = 6
  1078.             }
  1079.             d.title = l(j, f("titleFormat"));
  1080.             d.start = j;
  1081.             d.end = t;
  1082.             d.visStart = y;
  1083.             d.visEnd = S;
  1084.             g(6, Q, q ? 5 : 7, true)
  1085.         }
  1086.         var d = this;
  1087.         d.render = e;
  1088.         sb.call(d, a, b, "month");
  1089.         var f = d.opt,
  1090.             g = d.renderBasic,
  1091.             l = b.formatDate
  1092.     }
  1093.  
  1094.     function nc(a, b) {
  1095.         function e(j, t) {
  1096.             t && ba(j, t * 7);
  1097.             j = ba(N(j), -((j.getDay() - f("firstDay") + 7) % 7));
  1098.             t = ba(N(j), 7);
  1099.             var y = N(j),
  1100.                 S = N(t),
  1101.                 Q = f("weekends");
  1102.             if (!Q) {
  1103.                 Fa(y);
  1104.                 Fa(S, -1, true)
  1105.             }
  1106.             d.title = l(y, ba(N(S), -1), f("titleFormat"));
  1107.             d.start = j;
  1108.             d.end = t;
  1109.             d.visStart = y;
  1110.             d.visEnd = S;
  1111.             g(1, 1, Q ? 7 : 5, false)
  1112.         }
  1113.         var d = this;
  1114.         d.render = e;
  1115.         sb.call(d, a, b, "basicWeek");
  1116.         var f = d.opt,
  1117.             g = d.renderBasic,
  1118.             l = b.formatDates
  1119.     }
  1120.  
  1121.     function oc(a, b) {
  1122.         function e(j, t) {
  1123.             if (t) {
  1124.                 ba(j, t);
  1125.                 f("weekends") || Fa(j, t < 0 ? -1 : 1)
  1126.             }
  1127.             d.title = l(j, f("titleFormat"));
  1128.             d.start = d.visStart = N(j, true);
  1129.             d.end = d.visEnd = ba(N(d.start), 1);
  1130.             g(1, 1, 1, false)
  1131.         }
  1132.         var d = this;
  1133.         d.render = e;
  1134.         sb.call(d, a, b, "basicDay");
  1135.         var f = d.opt,
  1136.             g = d.renderBasic,
  1137.             l = b.formatDate
  1138.     }
  1139.  
  1140.     function sb(a, b, e) {
  1141.         function d(w, I, R, V) {
  1142.             v = I;
  1143.             F = R;
  1144.             f();
  1145.             (I = !C) ? g(w, V) : z();
  1146.             l(I)
  1147.         }
  1148.  
  1149.         function f() {
  1150.             if (k = L("isRTL")) {
  1151.                 D = -1;
  1152.                 Z = F - 1
  1153.             } else {
  1154.                 D = 1;
  1155.                 Z = 0
  1156.             }
  1157.             ja = L("firstDay");
  1158.             ia = L("weekends") ? 0 : 1;
  1159.             la = L("theme") ? "ui" : "fc";
  1160.             $ = L("columnFormat")
  1161.         }
  1162.  
  1163.         function g(w, I) {
  1164.             var R, V = la + "-widget-header",
  1165.                 ea = la + "-widget-content",
  1166.                 aa;
  1167.             R = "<table class='fc-border-separate' style='width:100%' cellspacing='0'><thead><tr>";
  1168.             for (aa = 0; aa < F; aa++) R += "<th class='fc- " + V + "'/>";
  1169.             R += "</tr></thead><tbody>";
  1170.             for (aa = 0; aa < w; aa++) {
  1171.                 R += "<tr class='fc-week" + aa + "'>";
  1172.                 for (V = 0; V < F; V++) R += "<td class='fc- " + ea + " fc-day" + (aa * F + V) + "'><div>" + (I ? "<div class='fc-day-number'/>" : "") + "<div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";
  1173.                 R += "</tr>"
  1174.             }
  1175.             R += "</tbody></table>";
  1176.             w = m(R).appendTo(a);
  1177.             K = w.find("thead");
  1178.             i = K.find("th");
  1179.             C = w.find("tbody");
  1180.             P = C.find("tr");
  1181.             E = C.find("td");
  1182.             B = E.filter(":first-child");
  1183.             n = P.eq(0).find("div.fc-day-content div");
  1184.             ab(K.add(K.find("tr")));
  1185.             ab(P);
  1186.             P.eq(0).addClass("fc-first");
  1187.             y(E);
  1188.             Y = m("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(a)
  1189.         }
  1190.  
  1191.         function l(w) {
  1192.             var I = w || v == 1,
  1193.                 R = p.start.getMonth(),
  1194.                 V = Ka(new Date),
  1195.                 ea, aa, va;
  1196.             I && i.each(function (wa, Ga) {
  1197.                 ea = m(Ga);
  1198.                 aa = ca(wa);
  1199.                 ea.html(ya(aa, $));
  1200.                 rb(ea, aa)
  1201.             });
  1202.             E.each(function (wa, Ga) {
  1203.                 ea = m(Ga);
  1204.                 aa = ca(wa);
  1205.                 aa.getMonth() == R ? ea.removeClass("fc-other-month") : ea.addClass("fc-other-month"); + aa == +V ? ea.addClass(la + "-state-highlight fc-today") : ea.removeClass(la + "-state-highlight fc-today");
  1206.                 ea.find("div.fc-day-number").text(aa.getDate());
  1207.                 I && rb(ea, aa)
  1208.             });
  1209.             P.each(function (wa, Ga) {
  1210.                 va = m(Ga);
  1211.                 if (wa < v) {
  1212.                     va.show();
  1213.                     wa == v - 1 ? va.addClass("fc-last") : va.removeClass("fc-last")
  1214.                 } else va.hide()
  1215.             })
  1216.         }
  1217.  
  1218.         function j(w) {
  1219.             o = w;
  1220.             w = o - K.height();
  1221.             var I, R, V;
  1222.             if (L("weekMode") == "variable") I = R = Math.floor(w / (v == 1 ? 2 : 6));
  1223.             else {
  1224.                 I = Math.floor(w / v);
  1225.                 R = w - I * (v - 1)
  1226.             }
  1227.             B.each(function (ea, aa) {
  1228.                 if (ea < v) {
  1229.                     V = m(aa);
  1230.                     Za(V.find("> div"), (ea == v - 1 ? R : I) - Sa(V))
  1231.                 }
  1232.             })
  1233.         }
  1234.  
  1235.         function t(w) {
  1236.             W = w;
  1237.             M.clear();
  1238.             s = Math.floor(W / F);
  1239.             Va(i.slice(0, -1), s)
  1240.         }
  1241.  
  1242.         function y(w) {
  1243.             w.click(S).mousedown(X)
  1244.         }
  1245.  
  1246.         function S(w) {
  1247.             if (!L("selectable")) {
  1248.                 var I = parseInt(this.className.match(/fc\-day(\d+)/)[1]);
  1249.                 I = ca(I);
  1250.                 c("dayClick", this, I, true, w)
  1251.             }
  1252.         }
  1253.  
  1254.         function Q(w, I, R) {
  1255.             R && r.build();
  1256.             R = N(p.visStart);
  1257.             for (var V = ba(N(R), F), ea = 0; ea < v; ea++) {
  1258.                 var aa = new Date(Math.max(R, w)),
  1259.                     va = new Date(Math.min(V, I));
  1260.                 if (aa < va) {
  1261.                     var wa;
  1262.                     if (k) {
  1263.                         wa = Ca(va, R) * D + Z + 1;
  1264.                         aa = Ca(aa, R) * D + Z + 1
  1265.                     } else {
  1266.                         wa = Ca(aa, R);
  1267.                         aa = Ca(va, R)
  1268.                     }
  1269.                     y(q(ea, wa, ea, aa - 1))
  1270.                 }
  1271.                 ba(R, 7);
  1272.                 ba(V, 7)
  1273.             }
  1274.         }
  1275.  
  1276.         function q(w, I, R, V) {
  1277.             w = r.rect(w, I, R, V, a);
  1278.             return H(w, a)
  1279.         }
  1280.  
  1281.         function u(w) {
  1282.             return N(w)
  1283.         }
  1284.  
  1285.         function fa(w, I) {
  1286.             Q(w, ba(N(I), 1), true)
  1287.         }
  1288.  
  1289.         function oa() {
  1290.             T()
  1291.         }
  1292.  
  1293.         function ga(w, I, R) {
  1294.             var V = ua(w);
  1295.             c("dayClick", E[V.row * F + V.col], w, I, R)
  1296.         }
  1297.  
  1298.         function ra(w, I) {
  1299.             J.start(function (R) {
  1300.                 T();
  1301.                 R && q(R.row, R.col, R.row, R.col)
  1302.             }, I)
  1303.         }
  1304.  
  1305.         function sa(w, I, R) {
  1306.             var V = J.stop();
  1307.             T();
  1308.             if (V) {
  1309.                 V = pa(V);
  1310.                 c("drop", w, V, true, I, R)
  1311.             }
  1312.         }
  1313.  
  1314.         function ha(w) {
  1315.             return N(w.start)
  1316.         }
  1317.  
  1318.         function da(w) {
  1319.             return M.left(w)
  1320.         }
  1321.  
  1322.         function na(w) {
  1323.             return M.right(w)
  1324.         }
  1325.  
  1326.         function ua(w) {
  1327.             return {
  1328.                 row: Math.floor(Ca(w, p.visStart) / 7),
  1329.                 col: ka(w.getDay())
  1330.             }
  1331.         }
  1332.  
  1333.         function pa(w) {
  1334.             return U(w.row, w.col)
  1335.         }
  1336.  
  1337.         function U(w, I) {
  1338.             return ba(N(p.visStart), w * 7 + I * D + Z)
  1339.         }
  1340.  
  1341.         function ca(w) {
  1342.             return U(Math.floor(w / F), w % F)
  1343.         }
  1344.  
  1345.         function ka(w) {
  1346.             return (w - Math.max(ja, ia) + F) % F * D + Z
  1347.         }
  1348.  
  1349.         function qa(w) {
  1350.             return P.eq(w)
  1351.         }
  1352.  
  1353.         function G() {
  1354.             return {
  1355.                 left: 0,
  1356.                 right: W
  1357.             }
  1358.         }
  1359.         var p = this;
  1360.         p.renderBasic = d;
  1361.         p.setHeight = j;
  1362.         p.setWidth = t;
  1363.         p.renderDayOverlay = Q;
  1364.         p.defaultSelectionEnd = u;
  1365.         p.renderSelection = fa;
  1366.         p.clearSelection = oa;
  1367.         p.reportDayClick = ga;
  1368.         p.dragStart = ra;
  1369.         p.dragStop = sa;
  1370.         p.defaultEventEnd = ha;
  1371.         p.getHoverListener = function () {
  1372.             return J
  1373.         };
  1374.         p.colContentLeft = da;
  1375.         p.colContentRight = na;
  1376.         p.dayOfWeekCol = ka;
  1377.         p.dateCell = ua;
  1378.         p.cellDate = pa;
  1379.         p.cellIsAllDay = function () {
  1380.             return true
  1381.         };
  1382.         p.allDayRow = qa;
  1383.         p.allDayBounds = G;
  1384.         p.getRowCnt = function () {
  1385.             return v
  1386.         };
  1387.         p.getColCnt = function () {
  1388.             return F
  1389.         };
  1390.         p.getColWidth = function () {
  1391.             return s
  1392.         };
  1393.         p.getDaySegmentContainer = function () {
  1394.             return Y
  1395.         };
  1396.         Kb.call(p, a, b, e);
  1397.         Lb.call(p);
  1398.         Mb.call(p);
  1399.         pc.call(p);
  1400.         var L = p.opt,
  1401.             c = p.trigger,
  1402.             z = p.clearEvents,
  1403.             H = p.renderOverlay,
  1404.             T = p.clearOverlays,
  1405.             X = p.daySelectionMousedown,
  1406.             ya = b.formatDate,
  1407.             K, i, C, P, E, B, n, Y, W, o, s, v, F, r, J, M, k, D, Z, ja, ia, la, $;
  1408.         qb(a.addClass("fc-grid"));
  1409.         r = new Nb(function (w, I) {
  1410.             var R, V, ea;
  1411.             i.each(function (aa, va) {
  1412.                 R = m(va);
  1413.                 V = R.offset().left;
  1414.                 if (aa) ea[1] = V;
  1415.                 ea = [V];
  1416.                 I[aa] = ea
  1417.             });
  1418.             ea[1] = V + R.outerWidth();
  1419.             P.each(function (aa, va) {
  1420.                 if (aa < v) {
  1421.                     R = m(va);
  1422.                     V = R.offset().top;
  1423.                     if (aa) ea[1] = V;
  1424.                     ea = [V];
  1425.                     w[aa] = ea
  1426.                 }
  1427.             });
  1428.             ea[1] = V + R.outerHeight()
  1429.         });
  1430.         J = new Ob(r);
  1431.         M = new Pb(function (w) {
  1432.             return n.eq(w)
  1433.         })
  1434.     }
  1435.  
  1436.     function pc() {
  1437.         function a(U, ca) {
  1438.             S(U);
  1439.             ua(e(U), ca)
  1440.         }
  1441.  
  1442.         function b() {
  1443.             Q();
  1444.             ga().empty()
  1445.         }
  1446.  
  1447.         function e(U) {
  1448.             var ca = da(),
  1449.                 ka = na(),
  1450.                 qa = N(g.visStart);
  1451.             ka = ba(N(qa), ka);
  1452.             var G = m.map(U, Ua),
  1453.                 p, L, c, z, H, T, X = [];
  1454.             for (p = 0; p < ca; p++) {
  1455.                 L = ob(nb(U, G, qa, ka));
  1456.                 for (c = 0; c < L.length; c++) {
  1457.                     z = L[c];
  1458.                     for (H = 0; H < z.length; H++) {
  1459.                         T = z[H];
  1460.                         T.row = p;
  1461.                         T.level = c;
  1462.                         X.push(T)
  1463.                     }
  1464.                 }
  1465.                 ba(qa, 7);
  1466.                 ba(ka, 7)
  1467.             }
  1468.             return X
  1469.         }
  1470.  
  1471.         function d(U, ca, ka) {
  1472.             t(U) && f(U, ca);
  1473.             ka.isEnd && y(U) && pa(U, ca, ka);
  1474.             q(U, ca)
  1475.         }
  1476.  
  1477.         function f(U, ca) {
  1478.             var ka = ra(),
  1479.                 qa;
  1480.             ca.draggable({
  1481.                 zIndex: 9,
  1482.                 delay: 50,
  1483.                 opacity: l("dragOpacity"),
  1484.                 revertDuration: l("dragRevertDuration"),
  1485.                 start: function (G, p) {
  1486.                     j("eventDragStart", ca, U, G, p);
  1487.                     fa(U, ca);
  1488.                     ka.start(function (L, c, z, H) {
  1489.                         ca.draggable("option", "revert", !L || !z && !H);
  1490.                         ha();
  1491.                         if (L) {
  1492.                             qa = z * 7 + H * (l("isRTL") ? -1 : 1);
  1493.                             sa(ba(N(U.start), qa), ba(Ua(U), qa))
  1494.                         } else qa = 0
  1495.                     }, G, "drag")
  1496.                 },
  1497.                 stop: function (G, p) {
  1498.                     ka.stop();
  1499.                     ha();
  1500.                     j("eventDragStop", ca, U, G, p);
  1501.                     if (qa) oa(this, U, qa, 0, U.allDay, G, p);
  1502.                     else {
  1503.                         ca.css("filter", "");
  1504.                         u(U, ca)
  1505.                     }
  1506.                 }
  1507.             })
  1508.         }
  1509.         var g = this;
  1510.         g.renderEvents = a;
  1511.         g.compileDaySegs = e;
  1512.         g.clearEvents = b;
  1513.         g.bindDaySeg = d;
  1514.         Qb.call(g);
  1515.         var l = g.opt,
  1516.             j = g.trigger,
  1517.             t = g.isEventDraggable,
  1518.             y = g.isEventResizable,
  1519.             S = g.reportEvents,
  1520.             Q = g.reportEventClear,
  1521.             q = g.eventElementHandlers,
  1522.             u = g.showEvents,
  1523.             fa = g.hideEvents,
  1524.             oa = g.eventDrop,
  1525.             ga = g.getDaySegmentContainer,
  1526.             ra = g.getHoverListener,
  1527.             sa = g.renderDayOverlay,
  1528.             ha = g.clearOverlays,
  1529.             da = g.getRowCnt,
  1530.             na = g.getColCnt,
  1531.             ua = g.renderDaySegs,
  1532.             pa = g.resizableDayEvent
  1533.     }
  1534.  
  1535.     function qc(a, b) {
  1536.         function e(j, t) {
  1537.             t && ba(j, t * 7);
  1538.             j = ba(N(j), -((j.getDay() - f("firstDay") + 7) % 7));
  1539.             t = ba(N(j), 7);
  1540.             var y = N(j),
  1541.                 S = N(t),
  1542.                 Q = f("weekends");
  1543.             if (!Q) {
  1544.                 Fa(y);
  1545.                 Fa(S, -1, true)
  1546.             }
  1547.             d.title = l(y, ba(N(S), -1), f("titleFormat"));
  1548.             d.start = j;
  1549.             d.end = t;
  1550.             d.visStart = y;
  1551.             d.visEnd = S;
  1552.             g(Q ? 7 : 5)
  1553.         }
  1554.         var d = this;
  1555.         d.render = e;
  1556.         Rb.call(d, a, b, "agendaWeek");
  1557.         var f = d.opt,
  1558.             g = d.renderAgenda,
  1559.             l = b.formatDates
  1560.     }
  1561.  
  1562.     function rc(a, b) {
  1563.         function e(j, t) {
  1564.             if (t) {
  1565.                 ba(j, t);
  1566.                 f("weekends") || Fa(j, t < 0 ? -1 : 1)
  1567.             }
  1568.             t = N(j, true);
  1569.             var y = ba(N(t), 1);
  1570.             d.title = l(j, f("titleFormat"));
  1571.             d.start = d.visStart = t;
  1572.             d.end = d.visEnd = y;
  1573.             g(1)
  1574.         }
  1575.         var d = this;
  1576.         d.render = e;
  1577.         Rb.call(d, a, b, "agendaDay");
  1578.         var f = d.opt,
  1579.             g = d.renderAgenda,
  1580.             l = b.formatDate
  1581.     }
  1582.  
  1583.     function Rb(a, b, e) {
  1584.         function d(h) {
  1585.             Ba = h;
  1586.             f();
  1587.             v ? P() : g();
  1588.             l()
  1589.         }
  1590.  
  1591.         function f() {
  1592.             Wa = i("theme") ? "ui" : "fc";
  1593.             Sb = i("weekends") ? 0 : 1;
  1594.             Tb = i("firstDay");
  1595.             if (Ub = i("isRTL")) {
  1596.                 Ha = -1;
  1597.                 Ia = Ba - 1
  1598.             } else {
  1599.                 Ha = 1;
  1600.                 Ia = 0
  1601.             }
  1602.             La = mb(i("minTime"));
  1603.             bb = mb(i("maxTime"));
  1604.             Vb = i("columnFormat")
  1605.         }
  1606.  
  1607.         function g() {
  1608.             var h = Wa + "-widget-header",
  1609.                 O = Wa + "-widget-content",
  1610.                 x, A, ta, za, Da, Ea = i("slotMinutes") % 15 == 0;
  1611.             x = "<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'><thead><tr><th class='fc-agenda-axis " + h + "'>&nbsp;</th>";
  1612.             for (A = 0; A < Ba; A++) x += "<th class='fc- fc-col" + A + " " + h + "'/>";
  1613.             x += "<th class='fc-agenda-gutter " + h + "'>&nbsp;</th></tr></thead><tbody><tr><th class='fc-agenda-axis " + h + "'>&nbsp;</th>";
  1614.             for (A = 0; A < Ba; A++) x += "<td class='fc- fc-col" + A + " " + O + "'><div><div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";
  1615.             x += "<td class='fc-agenda-gutter " + O + "'>&nbsp;</td></tr></tbody></table>";
  1616.             v = m(x).appendTo(a);
  1617.             F = v.find("thead");
  1618.             r = F.find("th").slice(1, -1);
  1619.             J = v.find("tbody");
  1620.             M = J.find("td").slice(0, -1);
  1621.             k = M.find("div.fc-day-content div");
  1622.             D = M.eq(0);
  1623.             Z = D.find("> div");
  1624.             ab(F.add(F.find("tr")));
  1625.             ab(J.add(J.find("tr")));
  1626.             aa = F.find("th:first");
  1627.             va = v.find(".fc-agenda-gutter");
  1628.             ja = m("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(a);
  1629.             if (i("allDaySlot")) {
  1630.                 ia = m("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(ja);
  1631.                 x = "<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='" + h + " fc-agenda-axis'>" + i("allDayText") + "</th><td><div class='fc-day-content'><div style='position:relative'/></div></td><th class='" + h + " fc-agenda-gutter'>&nbsp;</th></tr></table>";
  1632.                 la = m(x).appendTo(ja);
  1633.                 $ = la.find("tr");
  1634.                 q($.find("td"));
  1635.                 aa = aa.add(la.find("th:first"));
  1636.                 va = va.add(la.find("th.fc-agenda-gutter"));
  1637.                 ja.append("<div class='fc-agenda-divider " + h + "'><div class='fc-agenda-divider-inner'/></div>")
  1638.             } else ia = m([]);
  1639.             w = m("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(ja);
  1640.             I = m("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(w);
  1641.             R = m("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(I);
  1642.             x = "<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>";
  1643.             ta = zb();
  1644.             za = xa(N(ta), bb);
  1645.             xa(ta, La);
  1646.             for (A = tb = 0; ta < za; A++) {
  1647.                 Da = ta.getMinutes();
  1648.                 x += "<tr class='fc-slot" + A + " " + (!Da ? "" : "fc-minor") + "'><th class='fc-agenda-axis " + h + "'>" + (!Ea || !Da ? s(ta, i("axisFormat")) : "&nbsp;") + "</th><td class='" + O + "'><div style='position:relative'>&nbsp;</div></td></tr>";
  1649.                 xa(ta, i("slotMinutes"));
  1650.                 tb++
  1651.             }
  1652.             x += "</tbody></table>";
  1653.             V = m(x).appendTo(I);
  1654.             ea = V.find("div:first");
  1655.             u(V.find("td"));
  1656.             aa = aa.add(V.find("th:first"))
  1657.         }
  1658.  
  1659.         function l() {
  1660.             var h, O, x, A, ta = Ka(new Date);
  1661.             for (h = 0; h < Ba; h++) {
  1662.                 A = ua(h);
  1663.                 O = r.eq(h);
  1664.                 O.html(s(A, Vb));
  1665.                 x = M.eq(h); + A == +ta ? x.addClass(Wa + "-state-highlight fc-today") : x.removeClass(Wa + "-state-highlight fc-today");
  1666.                 rb(O.add(x), A)
  1667.             }
  1668.         }
  1669.  
  1670.         function j(h, O) {
  1671.             if (h === ma) h = Wb;
  1672.             Wb = h;
  1673.             ub = {};
  1674.             var x = J.position().top,
  1675.                 A = w.position().top;
  1676.             h = Math.min(h - x, V.height() + A + 1);
  1677.             Z.height(h - Sa(D));
  1678.             ja.css("top", x);
  1679.             w.height(h - A - 1);
  1680.             Xa = ea.height() + 1;
  1681.             O && y()
  1682.         }
  1683.  
  1684.         function t(h) {
  1685.             Ga = h;
  1686.             cb.clear();
  1687.             Ma = 0;
  1688.             Va(aa.width("").each(function (O, x) {
  1689.                 Ma = Math.max(Ma, m(x).outerWidth())
  1690.             }), Ma);
  1691.             h = w[0].clientWidth;
  1692.             if (vb = w.width() - h) {
  1693.                 Va(va, vb);
  1694.                 va.show().prev().removeClass("fc-last")
  1695.             } else va.hide().prev().addClass("fc-last");
  1696.             db = Math.floor((h - Ma) / Ba);
  1697.             Va(r.slice(0, -1), db)
  1698.         }
  1699.  
  1700.         function y() {
  1701.             function h() {
  1702.                 w.scrollTop(A)
  1703.             }
  1704.             var O = zb(),
  1705.                 x = N(O);
  1706.             x.setHours(i("firstHour"));
  1707.             var A = ca(O, x) + 1;
  1708.             h();
  1709.             setTimeout(h, 0)
  1710.         }
  1711.  
  1712.         function S() {
  1713.             Xb = w.scrollTop()
  1714.         }
  1715.  
  1716.         function Q() {
  1717.             w.scrollTop(Xb)
  1718.         }
  1719.  
  1720.         function q(h) {
  1721.             h.click(fa).mousedown(W)
  1722.         }
  1723.  
  1724.         function u(h) {
  1725.             h.click(fa).mousedown(H)
  1726.         }
  1727.  
  1728.         function fa(h) {
  1729.             if (!i("selectable")) {
  1730.                 var O = Math.min(Ba - 1, Math.floor((h.pageX - v.offset().left - Ma) / db)),
  1731.                     x = ua(O),
  1732.                     A = this.parentNode.className.match(/fc-slot(\d+)/);
  1733.                 if (A) {
  1734.                     A = parseInt(A[1]) * i("slotMinutes");
  1735.                     var ta = Math.floor(A / 60);
  1736.                     x.setHours(ta);
  1737.                     x.setMinutes(A % 60 + La);
  1738.                     C("dayClick", M[O], x, false, h)
  1739.                 } else C("dayClick", M[O], x, true, h)
  1740.             }
  1741.         }
  1742.  
  1743.         function oa(h, O, x) {
  1744.             x && Na.build();
  1745.             var A = N(K.visStart);
  1746.             if (Ub) {
  1747.                 x = Ca(O, A) * Ha + Ia + 1;
  1748.                 h = Ca(h, A) * Ha + Ia + 1
  1749.             } else {
  1750.                 x = Ca(h, A);
  1751.                 h = Ca(O, A)
  1752.             }
  1753.             x = Math.max(0, x);
  1754.             h = Math.min(Ba, h);
  1755.             x < h && q(ga(0, x, 0, h - 1))
  1756.         }
  1757.  
  1758.         function ga(h, O, x, A) {
  1759.             h = Na.rect(h, O, x, A, ja);
  1760.             return E(h, ja)
  1761.         }
  1762.  
  1763.         function ra(h, O) {
  1764.             for (var x = N(K.visStart), A = ba(N(x), 1), ta = 0; ta < Ba; ta++) {
  1765.                 var za = new Date(Math.max(x, h)),
  1766.                     Da = new Date(Math.min(A, O));
  1767.                 if (za < Da) {
  1768.                     var Ea = ta * Ha + Ia;
  1769.                     Ea = Na.rect(0, Ea, 0, Ea, I);
  1770.                     za = ca(x, za);
  1771.                     Da = ca(x, Da);
  1772.                     Ea.top = za;
  1773.                     Ea.height = Da - za;
  1774.                     u(E(Ea, I))
  1775.                 }
  1776.                 ba(x, 1);
  1777.                 ba(A, 1)
  1778.             }
  1779.         }
  1780.  
  1781.         function sa(h) {
  1782.             return cb.left(h)
  1783.         }
  1784.  
  1785.         function ha(h) {
  1786.             return cb.right(h)
  1787.         }
  1788.  
  1789.         function da(h) {
  1790.             return {
  1791.                 row: Math.floor(Ca(h, K.visStart) / 7),
  1792.                 col: U(h.getDay())
  1793.             }
  1794.         }
  1795.  
  1796.         function na(h) {
  1797.             var O = ua(h.col);
  1798.             h = h.row;
  1799.             i("allDaySlot") && h--;
  1800.             h >= 0 && xa(O, La + h * i("slotMinutes"));
  1801.             return O
  1802.         }
  1803.  
  1804.         function ua(h) {
  1805.             return ba(N(K.visStart), h * Ha + Ia)
  1806.         }
  1807.  
  1808.         function pa(h) {
  1809.             return i("allDaySlot") && !h.row
  1810.         }
  1811.  
  1812.         function U(h) {
  1813.             return (h - Math.max(Tb, Sb) + Ba) % Ba * Ha + Ia
  1814.         }
  1815.  
  1816.         function ca(h, O) {
  1817.             h = N(h, true);
  1818.             if (O < xa(N(h), La)) return 0;
  1819.             if (O >= xa(N(h), bb)) return V.height();
  1820.             h = i("slotMinutes");
  1821.             O = O.getHours() * 60 + O.getMinutes() - La;
  1822.             var x = Math.floor(O / h),
  1823.                 A = ub[x];
  1824.             if (A === ma) A = ub[x] = V.find("tr:eq(" + x + ") td div")[0].offsetTop;
  1825.             return Math.max(0, Math.round(A - 1 + Xa * (O % h / h)))
  1826.         }
  1827.  
  1828.         function ka() {
  1829.             return {
  1830.                 left: Ma,
  1831.                 right: Ga - vb
  1832.             }
  1833.         }
  1834.  
  1835.         function qa() {
  1836.             return $
  1837.         }
  1838.  
  1839.         function G(h) {
  1840.             var O = N(h.start);
  1841.             if (h.allDay) return O;
  1842.             return xa(O, i("defaultEventMinutes"))
  1843.         }
  1844.  
  1845.         function p(h, O) {
  1846.             if (O) return N(h);
  1847.             return xa(N(h), i("slotMinutes"))
  1848.         }
  1849.  
  1850.         function L(h, O, x) {
  1851.             if (x) i("allDaySlot") && oa(h, ba(N(O), 1), true);
  1852.             else c(h, O)
  1853.         }
  1854.  
  1855.         function c(h, O) {
  1856.             var x = i("selectHelper");
  1857.             Na.build();
  1858.             if (x) {
  1859.                 var A = Ca(h, K.visStart) * Ha + Ia;
  1860.                 if (A >= 0 && A < Ba) {
  1861.                     A = Na.rect(0, A, 0, A, I);
  1862.                     var ta = ca(h, h),
  1863.                         za = ca(h, O);
  1864.                     if (za > ta) {
  1865.                         A.top = ta;
  1866.                         A.height = za - ta;
  1867.                         A.left += 2;
  1868.                         A.width -= 5;
  1869.                         if (m.isFunction(x)) {
  1870.                             if (h = x(h, O)) {
  1871.                                 A.position = "absolute";
  1872.                                 A.zIndex = 8;
  1873.                                 wa = m(h).css(A).appendTo(I)
  1874.                             }
  1875.                         } else {
  1876.                             A.isStart = true;
  1877.                             A.isEnd = true;
  1878.                             wa = m(o({
  1879.                                 title: "",
  1880.                                 start: h,
  1881.                                 end: O,
  1882.                                 className: ["fc-select-helper"],
  1883.                                 editable: false
  1884.                             }, A));
  1885.                             wa.css("opacity", i("dragOpacity"))
  1886.                         }
  1887.                         if (wa) {
  1888.                             u(wa);
  1889.                             I.append(wa);
  1890.                             Va(wa, A.width, true);
  1891.                             Eb(wa, A.height, true)
  1892.                         }
  1893.                     }
  1894.                 }
  1895.             } else ra(h, O)
  1896.         }
  1897.  
  1898.         function z() {
  1899.             B();
  1900.             if (wa) {
  1901.                 wa.remove();
  1902.                 wa = null
  1903.             }
  1904.         }
  1905.  
  1906.         function H(h) {
  1907.             if (h.which == 1 && i("selectable")) {
  1908.                 Y(h);
  1909.                 var O;
  1910.                 Ra.start(function (x, A) {
  1911.                     z();
  1912.                     if (x && x.col == A.col && !pa(x)) {
  1913.                         A = na(A);
  1914.                         x = na(x);
  1915.                         O = [A, xa(N(A), i("slotMinutes")), x, xa(N(x), i("slotMinutes"))].sort(Gb);
  1916.                         c(O[0], O[3])
  1917.                     } else O = null
  1918.                 }, h);
  1919.                 m(document).one("mouseup", function (x) {
  1920.                     Ra.stop();
  1921.                     if (O) {
  1922.                         +O[0] == +O[1] && T(O[0], false, x);
  1923.                         n(O[0], O[3], false, x)
  1924.                     }
  1925.                 })
  1926.             }
  1927.         }
  1928.  
  1929.         function T(h, O, x) {
  1930.             C("dayClick", M[U(h.getDay())], h, O, x)
  1931.         }
  1932.  
  1933.         function X(h, O) {
  1934.             Ra.start(function (x) {
  1935.                 B();
  1936.                 if (x) if (pa(x)) ga(x.row, x.col, x.row, x.col);
  1937.                 else {
  1938.                     x = na(x);
  1939.                     var A = xa(N(x), i("defaultEventMinutes"));
  1940.                     ra(x, A)
  1941.                 }
  1942.             }, O)
  1943.         }
  1944.  
  1945.         function ya(h, O, x) {
  1946.             var A = Ra.stop();
  1947.             B();
  1948.             A && C("drop", h, na(A), pa(A), O, x)
  1949.         }
  1950.         var K = this;
  1951.         K.renderAgenda = d;
  1952.         K.setWidth = t;
  1953.         K.setHeight = j;
  1954.         K.beforeHide = S;
  1955.         K.afterShow = Q;
  1956.         K.defaultEventEnd = G;
  1957.         K.timePosition = ca;
  1958.         K.dayOfWeekCol = U;
  1959.         K.dateCell = da;
  1960.         K.cellDate = na;
  1961.         K.cellIsAllDay = pa;
  1962.         K.allDayRow = qa;
  1963.         K.allDayBounds = ka;
  1964.         K.getHoverListener = function () {
  1965.             return Ra
  1966.         };
  1967.         K.colContentLeft = sa;
  1968.         K.colContentRight = ha;
  1969.         K.getDaySegmentContainer = function () {
  1970.             return ia
  1971.         };
  1972.         K.getSlotSegmentContainer = function () {
  1973.             return R
  1974.         };
  1975.         K.getMinMinute = function () {
  1976.             return La
  1977.         };
  1978.         K.getMaxMinute = function () {
  1979.             return bb
  1980.         };
  1981.         K.getBodyContent = function () {
  1982.             return I
  1983.         };
  1984.         K.getRowCnt = function () {
  1985.             return 1
  1986.         };
  1987.         K.getColCnt = function () {
  1988.             return Ba
  1989.         };
  1990.         K.getColWidth = function () {
  1991.             return db
  1992.         };
  1993.         K.getSlotHeight = function () {
  1994.             return Xa
  1995.         };
  1996.         K.defaultSelectionEnd = p;
  1997.         K.renderDayOverlay = oa;
  1998.         K.renderSelection = L;
  1999.         K.clearSelection = z;
  2000.         K.reportDayClick = T;
  2001.         K.dragStart = X;
  2002.         K.dragStop = ya;
  2003.         Kb.call(K, a, b, e);
  2004.         Lb.call(K);
  2005.         Mb.call(K);
  2006.         sc.call(K);
  2007.         var i = K.opt,
  2008.             C = K.trigger,
  2009.             P = K.clearEvents,
  2010.             E = K.renderOverlay,
  2011.             B = K.clearOverlays,
  2012.             n = K.reportSelection,
  2013.             Y = K.unselect,
  2014.             W = K.daySelectionMousedown,
  2015.             o = K.slotSegHtml,
  2016.             s = b.formatDate,
  2017.             v, F, r, J, M, k, D, Z, ja, ia, la, $, w, I, R, V, ea, aa, va, wa, Ga, Wb, Ma, db, vb, Xa, Xb, Ba, tb, Na, Ra, cb, ub = {},
  2018.             Wa, Tb, Sb, Ub, Ha, Ia, La, bb, Vb;
  2019.         qb(a.addClass("fc-agenda"));
  2020.         Na = new Nb(function (h, O) {
  2021.             function x(eb) {
  2022.                 return Math.max(Ea, Math.min(tc, eb))
  2023.             }
  2024.             var A, ta, za;
  2025.             r.each(function (eb, uc) {
  2026.                 A = m(uc);
  2027.                 ta = A.offset().left;
  2028.                 if (eb) za[1] = ta;
  2029.                 za = [ta];
  2030.                 O[eb] = za
  2031.             });
  2032.             za[1] = ta + A.outerWidth();
  2033.             if (i("allDaySlot")) {
  2034.                 A = $;
  2035.                 ta = A.offset().top;
  2036.                 h[0] = [ta, ta + A.outerHeight()]
  2037.             }
  2038.             for (var Da = I.offset().top, Ea = w.offset().top, tc = Ea + w.outerHeight(), fb = 0; fb < tb; fb++) h.push([x(Da + Xa * fb), x(Da + Xa * (fb + 1))])
  2039.         });
  2040.         Ra = new Ob(Na);
  2041.         cb = new Pb(function (h) {
  2042.             return k.eq(h)
  2043.         })
  2044.     }
  2045.  
  2046.     function sc() {
  2047.         function a(o, s) {
  2048.             sa(o);
  2049.             var v, F = o.length,
  2050.                 r = [],
  2051.                 J = [];
  2052.             for (v = 0; v < F; v++) o[v].allDay ? r.push(o[v]) : J.push(o[v]);
  2053.             if (u("allDaySlot")) {
  2054.                 L(e(r), s);
  2055.                 na()
  2056.             }
  2057.             g(d(J), s)
  2058.         }
  2059.  
  2060.         function b() {
  2061.             ha();
  2062.             ua().empty();
  2063.             pa().empty()
  2064.         }
  2065.  
  2066.         function e(o) {
  2067.             o = ob(nb(o, m.map(o, Ua), q.visStart, q.visEnd));
  2068.             var s, v = o.length,
  2069.                 F, r, J, M = [];
  2070.             for (s = 0; s < v; s++) {
  2071.                 F = o[s];
  2072.                 for (r = 0; r < F.length; r++) {
  2073.                     J = F[r];
  2074.                     J.row = 0;
  2075.                     J.level = s;
  2076.                     M.push(J)
  2077.                 }
  2078.             }
  2079.             return M
  2080.         }
  2081.  
  2082.         function d(o) {
  2083.             var s = z(),
  2084.                 v = ka(),
  2085.                 F = ca(),
  2086.                 r = xa(N(q.visStart), v),
  2087.                 J = m.map(o, f),
  2088.                 M, k, D, Z, ja, ia, la = [];
  2089.             for (M = 0; M < s; M++) {
  2090.                 k = ob(nb(o, J, r, xa(N(r), F - v)));
  2091.                 vc(k);
  2092.                 for (D = 0; D < k.length; D++) {
  2093.                     Z = k[D];
  2094.                     for (ja = 0; ja < Z.length; ja++) {
  2095.                         ia = Z[ja];
  2096.                         ia.col = M;
  2097.                         ia.level = D;
  2098.                         la.push(ia)
  2099.                     }
  2100.                 }
  2101.                 ba(r, 1, true)
  2102.             }
  2103.             return la
  2104.         }
  2105.  
  2106.         function f(o) {
  2107.             return o.end ? N(o.end) : xa(N(o.start), u("defaultEventMinutes"))
  2108.         }
  2109.  
  2110.         function g(o, s) {
  2111.             var v, F = o.length,
  2112.                 r, J, M, k, D, Z, ja, ia, la, $ = "",
  2113.                 w, I, R = {},
  2114.                 V = {},
  2115.                 ea = pa(),
  2116.                 aa;
  2117.             v = z();
  2118.             if (w = u("isRTL")) {
  2119.                 I = -1;
  2120.                 aa = v - 1
  2121.             } else {
  2122.                 I = 1;
  2123.                 aa = 0
  2124.             }
  2125.             for (v = 0; v < F; v++) {
  2126.                 r = o[v];
  2127.                 J = r.event;
  2128.                 M = qa(r.start, r.start);
  2129.                 k = qa(r.start, r.end);
  2130.                 D = r.col;
  2131.                 Z = r.level;
  2132.                 ja = r.forward || 0;
  2133.                 ia = G(D * I + aa);
  2134.                 la = p(D * I + aa) - ia;
  2135.                 la = Math.min(la - 6, la * 0.95);
  2136.                 D = Z ? la / (Z + ja + 1) : ja ? (la / (ja + 1) - 6) * 2 : la;
  2137.                 Z = ia + la / (Z + ja + 1) * Z * I + (w ? la - D : 0);
  2138.                 r.top = M;
  2139.                 r.left = Z;
  2140.                 r.outerWidth = D;
  2141.                 r.outerHeight = k - M;
  2142.                 $ += l(J, r)
  2143.             }
  2144.             ea[0].innerHTML = $;
  2145.             w = ea.children();
  2146.             for (v = 0; v < F; v++) {
  2147.                 r = o[v];
  2148.                 J = r.event;
  2149.                 $ = m(w[v]);
  2150.                 I = fa("eventRender", J, J, $);
  2151.                 if (I === false) $.remove();
  2152.                 else {
  2153.                     if (I && I !== true) {
  2154.                         $.remove();
  2155.                         $ = m(I).css({
  2156.                             position: "absolute",
  2157.                             top: r.top,
  2158.                             left: r.left
  2159.                         }).appendTo(ea)
  2160.                     }
  2161.                     r.element = $;
  2162.                     if (J._id === s) t(J, $, r);
  2163.                     else $[0]._fci = v;
  2164.                     ya(J, $)
  2165.                 }
  2166.             }
  2167.             Db(ea, o, t);
  2168.             for (v = 0; v < F; v++) {
  2169.                 r = o[v];
  2170.                 if ($ = r.element) {
  2171.                     J = R[s = r.key = Ib($[0])];
  2172.                     r.vsides = J === ma ? (R[s] = Sa($, true)) : J;
  2173.                     J = V[s];
  2174.                     r.hsides = J === ma ? (V[s] = pb($, true)) : J;
  2175.                     s = $.find("div.fc-event-content");
  2176.                     if (s.length) r.contentTop = s[0].offsetTop
  2177.                 }
  2178.             }
  2179.             for (v = 0; v < F; v++) {
  2180.                 r = o[v];
  2181.                 if ($ = r.element) {
  2182.                     $[0].style.width = Math.max(0, r.outerWidth - r.hsides) + "px";
  2183.                     R = Math.max(0, r.outerHeight - r.vsides);
  2184.                     $[0].style.height = R + "px";
  2185.                     J = r.event;
  2186.                     if (r.contentTop !== ma && R - r.contentTop < 10) {
  2187.                         $.find("div.fc-event-time").text(Y(J.start, u("timeFormat")) + " - " + J.title);
  2188.                         $.find("div.fc-event-title").remove()
  2189.                     }
  2190.                     fa("eventAfterRender", J, J, $)
  2191.                 }
  2192.             }
  2193.         }
  2194.  
  2195.         function l(o, s) {
  2196.             var v = "<",
  2197.                 F = o.url,
  2198.                 r = Jb(o, u),
  2199.                 J = r ? " style='" + r + "'" : "",
  2200.                 M = ["fc-event", "fc-event-skin", "fc-event-vert"];
  2201.             oa(o) && M.push("fc-event-draggable");
  2202.             s.isStart && M.push("fc-corner-top");
  2203.             s.isEnd && M.push("fc-corner-bottom");
  2204.             M = M.concat(o.className);
  2205.             if (o.source) M = M.concat(o.source.className || []);
  2206.             v += F ? "a href='" + Qa(o.url) + "'" : "div";
  2207.             v += " class='" + M.join(" ") + "' style='position:absolute;z-index:8;top:" + s.top + "px;left:" + s.left + "px;" + r + "'><div class='fc-event-inner fc-event-skin'" + J + "><div class='fc-event-head fc-event-skin'" + J + "><div class='fc-event-time'>" + Qa(W(o.start, o.end, u("timeFormat"))) + "</div></div><div class='fc-event-content'><div class='fc-event-title'>" + Qa(o.title) + "</div></div><div class='fc-event-bg'></div></div>";
  2208.             if (s.isEnd && ga(o)) v += "<div class='ui-resizable-handle ui-resizable-s'>=</div>";
  2209.             v += "</" + (F ? "a" : "div") + ">";
  2210.             return v
  2211.         }
  2212.  
  2213.         function j(o, s, v) {
  2214.             oa(o) && y(o, s, v.isStart);
  2215.             v.isEnd && ga(o) && c(o, s, v);
  2216.             da(o, s)
  2217.         }
  2218.  
  2219.         function t(o, s, v) {
  2220.             var F = s.find("div.fc-event-time");
  2221.             oa(o) && S(o, s, F);
  2222.             v.isEnd && ga(o) && Q(o, s, F);
  2223.             da(o, s)
  2224.         }
  2225.  
  2226.         function y(o, s, v) {
  2227.             function F() {
  2228.                 if (!M) {
  2229.                     s.width(r).height("").draggable("option", "grid", null);
  2230.                     M = true
  2231.                 }
  2232.             }
  2233.             var r, J, M = true,
  2234.                 k, D = u("isRTL") ? -1 : 1,
  2235.                 Z = U(),
  2236.                 ja = H(),
  2237.                 ia = T(),
  2238.                 la = ka();
  2239.             s.draggable({
  2240.                 zIndex: 9,
  2241.                 opacity: u("dragOpacity", "month"),
  2242.                 revertDuration: u("dragRevertDuration"),
  2243.                 start: function ($, w) {
  2244.                     fa("eventDragStart", s, o, $, w);
  2245.                     i(o, s);
  2246.                     r = s.width();
  2247.                     Z.start(function (I, R, V, ea) {
  2248.                         B();
  2249.                         if (I) {
  2250.                             J = false;
  2251.                             k = ea * D;
  2252.                             if (I.row) if (v) {
  2253.                                 if (M) {
  2254.                                     s.width(ja - 10);
  2255.                                     Eb(s, ia * Math.round((o.end ? (o.end - o.start) / wc : u("defaultEventMinutes")) / u("slotMinutes")));
  2256.                                     s.draggable("option", "grid", [ja, 1]);
  2257.                                     M = false
  2258.                                 }
  2259.                             } else J = true;
  2260.                             else {
  2261.                                 E(ba(N(o.start), k), ba(Ua(o), k));
  2262.                                 F()
  2263.                             }
  2264.                             J = J || M && !k
  2265.                         } else {
  2266.                             F();
  2267.                             J = true
  2268.                         }
  2269.                         s.draggable("option", "revert", J)
  2270.                     }, $, "drag")
  2271.                 },
  2272.                 stop: function ($, w) {
  2273.                     Z.stop();
  2274.                     B();
  2275.                     fa("eventDragStop", s, o, $, w);
  2276.                     if (J) {
  2277.                         F();
  2278.                         s.css("filter", "");
  2279.                         K(o, s)
  2280.                     } else {
  2281.                         var I = 0;
  2282.                         M || (I = Math.round((s.offset().top - X().offset().top) / ia) * u("slotMinutes") + la - (o.start.getHours() * 60 + o.start.getMinutes()));
  2283.                         C(this, o, k, I, M, $, w)
  2284.                     }
  2285.                 }
  2286.             })
  2287.         }
  2288.  
  2289.         function S(o, s, v) {
  2290.             function F(I) {
  2291.                 var R = xa(N(o.start), I),
  2292.                     V;
  2293.                 if (o.end) V = xa(N(o.end), I);
  2294.                 v.text(W(R, V, u("timeFormat")))
  2295.             }
  2296.  
  2297.             function r() {
  2298.                 if (M) {
  2299.                     v.css("display", "");
  2300.                     s.draggable("option", "grid", [$, w]);
  2301.                     M = false
  2302.                 }
  2303.             }
  2304.             var J, M = false,
  2305.                 k, D, Z, ja = u("isRTL") ? -1 : 1,
  2306.                 ia = U(),
  2307.                 la = z(),
  2308.                 $ = H(),
  2309.                 w = T();
  2310.             s.draggable({
  2311.                 zIndex: 9,
  2312.                 scroll: false,
  2313.                 grid: [$, w],
  2314.                 axis: la == 1 ? "y" : false,
  2315.                 opacity: u("dragOpacity"),
  2316.                 revertDuration: u("dragRevertDuration"),
  2317.                 start: function (I, R) {
  2318.                     fa("eventDragStart", s, o, I, R);
  2319.                     i(o, s);
  2320.                     J = s.position();
  2321.                     D = Z = 0;
  2322.                     ia.start(function (V, ea, aa, va) {
  2323.                         s.draggable("option", "revert", !V);
  2324.                         B();
  2325.                         if (V) {
  2326.                             k = va * ja;
  2327.                             if (u("allDaySlot") && !V.row) {
  2328.                                 if (!M) {
  2329.                                     M = true;
  2330.                                     v.hide();
  2331.                                     s.draggable("option", "grid", null)
  2332.                                 }
  2333.                                 E(ba(N(o.start), k), ba(Ua(o), k))
  2334.                             } else r()
  2335.                         }
  2336.                     }, I, "drag")
  2337.                 },
  2338.                 drag: function (I, R) {
  2339.                     D = Math.round((R.position.top - J.top) / w) * u("slotMinutes");
  2340.                     if (D != Z) {
  2341.                         M || F(D);
  2342.                         Z = D
  2343.                     }
  2344.                 },
  2345.                 stop: function (I, R) {
  2346.                     var V = ia.stop();
  2347.                     B();
  2348.                     fa("eventDragStop", s, o, I, R);
  2349.                     if (V && (k || D || M)) C(this, o, k, M ? 0 : D, M, I, R);
  2350.                     else {
  2351.                         r();
  2352.                         s.css("filter", "");
  2353.                         s.css(J);
  2354.                         F(0);
  2355.                         K(o, s)
  2356.                     }
  2357.                 }
  2358.             })
  2359.         }
  2360.  
  2361.         function Q(o, s, v) {
  2362.             var F, r, J = T();
  2363.             s.resizable({
  2364.                 handles: {
  2365.                     s: "div.ui-resizable-s"
  2366.                 },
  2367.                 grid: J,
  2368.                 start: function (M, k) {
  2369.                     F = r = 0;
  2370.                     i(o, s);
  2371.                     s.css("z-index", 9);
  2372.                     fa("eventResizeStart", this, o, M, k)
  2373.                 },
  2374.                 resize: function (M, k) {
  2375.                     F = Math.round((Math.max(J, s.height()) - k.originalSize.height) / J);
  2376.                     if (F != r) {
  2377.                         v.text(W(o.start, !F && !o.end ? null : xa(ra(o), u("slotMinutes") * F), u("timeFormat")));
  2378.                         r = F
  2379.                     }
  2380.                 },
  2381.                 stop: function (M, k) {
  2382.                     fa("eventResizeStop", this, o, M, k);
  2383.                     if (F) P(this, o, 0, u("slotMinutes") * F, M, k);
  2384.                     else {
  2385.                         s.css("z-index", 8);
  2386.                         K(o, s)
  2387.                     }
  2388.                 }
  2389.             })
  2390.         }
  2391.         var q = this;
  2392.         q.renderEvents = a;
  2393.         q.compileDaySegs = e;
  2394.         q.clearEvents = b;
  2395.         q.slotSegHtml = l;
  2396.         q.bindDaySeg = j;
  2397.         Qb.call(q);
  2398.         var u = q.opt,
  2399.             fa = q.trigger,
  2400.             oa = q.isEventDraggable,
  2401.             ga = q.isEventResizable,
  2402.             ra = q.eventEnd,
  2403.             sa = q.reportEvents,
  2404.             ha = q.reportEventClear,
  2405.             da = q.eventElementHandlers,
  2406.             na = q.setHeight,
  2407.             ua = q.getDaySegmentContainer,
  2408.             pa = q.getSlotSegmentContainer,
  2409.             U = q.getHoverListener,
  2410.             ca = q.getMaxMinute,
  2411.             ka = q.getMinMinute,
  2412.             qa = q.timePosition,
  2413.             G = q.colContentLeft,
  2414.             p = q.colContentRight,
  2415.             L = q.renderDaySegs,
  2416.             c = q.resizableDayEvent,
  2417.             z = q.getColCnt,
  2418.             H = q.getColWidth,
  2419.             T = q.getSlotHeight,
  2420.             X = q.getBodyContent,
  2421.             ya = q.reportEventElement,
  2422.             K = q.showEvents,
  2423.             i = q.hideEvents,
  2424.             C = q.eventDrop,
  2425.             P = q.eventResize,
  2426.             E = q.renderDayOverlay,
  2427.             B = q.clearOverlays,
  2428.             n = q.calendar,
  2429.             Y = n.formatDate,
  2430.             W = n.formatDates
  2431.     }
  2432.  
  2433.     function vc(a) {
  2434.         var b, e, d, f, g, l;
  2435.         for (b = a.length - 1; b > 0; b--) {
  2436.             f = a[b];
  2437.             for (e = 0; e < f.length; e++) {
  2438.                 g = f[e];
  2439.                 for (d = 0; d < a[b - 1].length; d++) {
  2440.                     l = a[b - 1][d];
  2441.                     if (Cb(g, l)) l.forward = Math.max(l.forward || 0, (g.forward || 0) + 1)
  2442.                 }
  2443.             }
  2444.         }
  2445.     }
  2446.  
  2447.     function Kb(a, b, e) {
  2448.         function d(G, p) {
  2449.             G = qa[G];
  2450.             if (typeof G == "object") return jb(G, p || e);
  2451.             return G
  2452.         }
  2453.  
  2454.         function f(G, p) {
  2455.             return b.trigger.apply(b, [G, p || da].concat(Array.prototype.slice.call(arguments, 2), [da]))
  2456.         }
  2457.  
  2458.         function g(G) {
  2459.             return j(G) && !d("disableDragging")
  2460.         }
  2461.  
  2462.         function l(G) {
  2463.             return j(G) && !d("disableResizing")
  2464.         }
  2465.  
  2466.         function j(G) {
  2467.             return Ta(G.editable, (G.source || {}).editable, d("editable"))
  2468.         }
  2469.  
  2470.         function t(G) {
  2471.             U = {};
  2472.             var p, L = G.length,
  2473.                 c;
  2474.             for (p = 0; p < L; p++) {
  2475.                 c = G[p];
  2476.                 if (U[c._id]) U[c._id].push(c);
  2477.                 else U[c._id] = [c]
  2478.             }
  2479.         }
  2480.  
  2481.         function y(G) {
  2482.             return G.end ? N(G.end) : na(G)
  2483.         }
  2484.  
  2485.         function S(G, p) {
  2486.             ca.push(p);
  2487.             if (ka[G._id]) ka[G._id].push(p);
  2488.             else ka[G._id] = [p]
  2489.         }
  2490.  
  2491.         function Q() {
  2492.             ca = [];
  2493.             ka = {}
  2494.         }
  2495.  
  2496.         function q(G, p) {
  2497.             p.click(function (L) {
  2498.                 if (!p.hasClass("ui-draggable-dragging") && !p.hasClass("ui-resizable-resizing")) return f("eventClick", this, G, L)
  2499.             }).hover(function (L) {
  2500.                 f("eventMouseover", this, G, L)
  2501.             }, function (L) {
  2502.                 f("eventMouseout", this, G, L)
  2503.             })
  2504.         }
  2505.  
  2506.         function u(G, p) {
  2507.             oa(G, p, "show")
  2508.         }
  2509.  
  2510.         function fa(G, p) {
  2511.             oa(G, p, "hide")
  2512.         }
  2513.  
  2514.         function oa(G, p, L) {
  2515.             G = ka[G._id];
  2516.             var c, z = G.length;
  2517.             for (c = 0; c < z; c++) if (!p || G[c][0] != p[0]) G[c][L]()
  2518.         }
  2519.  
  2520.         function ga(G, p, L, c, z, H, T) {
  2521.             var X = p.allDay,
  2522.                 ya = p._id;
  2523.             sa(U[ya], L, c, z);
  2524.             f("eventDrop", G, p, L, c, z, function () {
  2525.                 sa(U[ya], -L, -c, X);
  2526.                 pa(ya)
  2527.             }, H, T);
  2528.             pa(ya)
  2529.         }
  2530.  
  2531.         function ra(G, p, L, c, z, H) {
  2532.             var T = p._id;
  2533.             ha(U[T], L, c);
  2534.             f("eventResize", G, p, L, c, function () {
  2535.                 ha(U[T], -L, -c);
  2536.                 pa(T)
  2537.             }, z, H);
  2538.             pa(T)
  2539.         }
  2540.  
  2541.         function sa(G, p, L, c) {
  2542.             L = L || 0;
  2543.             for (var z, H = G.length, T = 0; T < H; T++) {
  2544.                 z = G[T];
  2545.                 if (c !== ma) z.allDay = c;
  2546.                 xa(ba(z.start, p, true), L);
  2547.                 if (z.end) z.end = xa(ba(z.end, p, true), L);
  2548.                 ua(z, qa)
  2549.             }
  2550.         }
  2551.  
  2552.         function ha(G, p, L) {
  2553.             L = L || 0;
  2554.             for (var c, z = G.length, H = 0; H < z; H++) {
  2555.                 c = G[H];
  2556.                 c.end = xa(ba(y(c), p, true), L);
  2557.                 ua(c, qa)
  2558.             }
  2559.         }
  2560.         var da = this;
  2561.         da.element = a;
  2562.         da.calendar = b;
  2563.         da.name = e;
  2564.         da.opt = d;
  2565.         da.trigger = f;
  2566.         da.isEventDraggable = g;
  2567.         da.isEventResizable = l;
  2568.         da.reportEvents = t;
  2569.         da.eventEnd = y;
  2570.         da.reportEventElement = S;
  2571.         da.reportEventClear = Q;
  2572.         da.eventElementHandlers = q;
  2573.         da.showEvents = u;
  2574.         da.hideEvents = fa;
  2575.         da.eventDrop = ga;
  2576.         da.eventResize = ra;
  2577.         var na = da.defaultEventEnd,
  2578.             ua = b.normalizeEvent,
  2579.             pa = b.reportEventChange,
  2580.             U = {},
  2581.             ca = [],
  2582.             ka = {},
  2583.             qa = b.options
  2584.     }
  2585.  
  2586.     function Qb() {
  2587.         function a(i, C) {
  2588.             var P = z(),
  2589.                 E = pa(),
  2590.                 B = U(),
  2591.                 n = 0,
  2592.                 Y, W, o = i.length,
  2593.                 s, v;
  2594.             P[0].innerHTML = e(i);
  2595.             d(i, P.children());
  2596.             f(i);
  2597.             g(i, P, C);
  2598.             l(i);
  2599.             j(i);
  2600.             t(i);
  2601.             C = y();
  2602.             for (P = 0; P < E; P++) {
  2603.                 Y = [];
  2604.                 for (W = 0; W < B; W++) Y[W] = 0;
  2605.                 for (; n < o && (s = i[n]).row == P;) {
  2606.                     W = Hb(Y.slice(s.startCol, s.endCol));
  2607.                     s.top = W;
  2608.                     W += s.outerHeight;
  2609.                     for (v = s.startCol; v < s.endCol; v++) Y[v] = W;
  2610.                     n++
  2611.                 }
  2612.                 C[P].height(Hb(Y))
  2613.             }
  2614.             Q(i, S(C))
  2615.         }
  2616.  
  2617.         function b(i, C, P) {
  2618.             var E = m("<div/>"),
  2619.                 B = z(),
  2620.                 n = i.length,
  2621.                 Y;
  2622.             E[0].innerHTML = e(i);
  2623.             E = E.children();
  2624.             B.append(E);
  2625.             d(i, E);
  2626.             l(i);
  2627.             j(i);
  2628.             t(i);
  2629.             Q(i, S(y()));
  2630.             E = [];
  2631.             for (B = 0; B < n; B++) if (Y = i[B].element) {
  2632.                 i[B].row === C && Y.css("top", P);
  2633.                 E.push(Y[0])
  2634.             }
  2635.             return m(E)
  2636.         }
  2637.  
  2638.         function e(i) {
  2639.             var C = fa("isRTL"),
  2640.                 P, E = i.length,
  2641.                 B, n, Y, W;
  2642.             P = ka();
  2643.             var o = P.left,
  2644.                 s = P.right,
  2645.                 v, F, r, J, M, k = "";
  2646.             for (P = 0; P < E; P++) {
  2647.                 B = i[P];
  2648.                 n = B.event;
  2649.                 W = ["fc-event", "fc-event-skin", "fc-event-hori"];
  2650.                 ga(n) && W.push("fc-event-draggable");
  2651.                 if (C) {
  2652.                     B.isStart && W.push("fc-corner-right");
  2653.                     B.isEnd && W.push("fc-corner-left");
  2654.                     v = p(B.end.getDay() - 1);
  2655.                     F = p(B.start.getDay());
  2656.                     r = B.isEnd ? qa(v) : o;
  2657.                     J = B.isStart ? G(F) : s
  2658.                 } else {
  2659.                     B.isStart && W.push("fc-corner-left");
  2660.                     B.isEnd && W.push("fc-corner-right");
  2661.                     v = p(B.start.getDay());
  2662.                     F = p(B.end.getDay() - 1);
  2663.                     r = B.isStart ? qa(v) : o;
  2664.                     J = B.isEnd ? G(F) : s
  2665.                 }
  2666.                 W = W.concat(n.className);
  2667.                 if (n.source) W = W.concat(n.source.className || []);
  2668.                 Y = n.url;
  2669.                 M = Jb(n, fa);
  2670.                 k += Y ? "<a href='" + Qa(Y) + "'" : "<div";
  2671.                 k += " class='" + W.join(" ") + "' style='position:absolute;z-index:8;left:" + r + "px;" + M + "'><div class='fc-event-inner fc-event-skin'" + (M ? " style='" + M + "'" : "") + ">";
  2672.                 if (!n.allDay && B.isStart) k += "<span class='fc-event-time'>" + Qa(T(n.start, n.end, fa("timeFormat"))) + "</span>";
  2673.                 k += "<span class='fc-event-title'>" + Qa(n.title) + "</span></div>";
  2674.                 if (B.isEnd && ra(n)) k += "<div class='ui-resizable-handle ui-resizable-" + (C ? "w" : "e") + "'>&nbsp;&nbsp;&nbsp;</div>";
  2675.                 k += "</" + (Y ? "a" : "div") + ">";
  2676.                 B.left = r;
  2677.                 B.outerWidth = J - r;
  2678.                 B.startCol = v;
  2679.                 B.endCol = F + 1
  2680.             }
  2681.             return k
  2682.         }
  2683.  
  2684.         function d(i, C) {
  2685.             var P, E = i.length,
  2686.                 B, n, Y;
  2687.             for (P = 0; P < E; P++) {
  2688.                 B = i[P];
  2689.                 n = B.event;
  2690.                 Y = m(C[P]);
  2691.                 n = oa("eventRender", n, n, Y);
  2692.                 if (n === false) Y.remove();
  2693.                 else {
  2694.                     if (n && n !== true) {
  2695.                         n = m(n).css({
  2696.                             position: "absolute",
  2697.                             left: B.left
  2698.                         });
  2699.                         Y.replaceWith(n);
  2700.                         Y = n
  2701.                     }
  2702.                     B.element = Y
  2703.                 }
  2704.             }
  2705.         }
  2706.  
  2707.         function f(i) {
  2708.             var C, P = i.length,
  2709.                 E, B;
  2710.             for (C = 0; C < P; C++) {
  2711.                 E = i[C];
  2712.                 (B = E.element) && ha(E.event, B)
  2713.             }
  2714.         }
  2715.  
  2716.         function g(i, C, P) {
  2717.             var E, B = i.length,
  2718.                 n, Y, W;
  2719.             for (E = 0; E < B; E++) {
  2720.                 n = i[E];
  2721.                 if (Y = n.element) {
  2722.                     W = n.event;
  2723.                     if (W._id === P) H(W, Y, n);
  2724.                     else Y[0]._fci = E
  2725.                 }
  2726.             }
  2727.             Db(C, i, H)
  2728.         }
  2729.  
  2730.         function l(i) {
  2731.             var C, P = i.length,
  2732.                 E, B, n, Y, W = {};
  2733.             for (C = 0; C < P; C++) {
  2734.                 E = i[C];
  2735.                 if (B = E.element) {
  2736.                     n = E.key = Ib(B[0]);
  2737.                     Y = W[n];
  2738.                     if (Y === ma) Y = W[n] = pb(B, true);
  2739.                     E.hsides = Y
  2740.                 }
  2741.             }
  2742.         }
  2743.  
  2744.         function j(i) {
  2745.             var C, P = i.length,
  2746.                 E, B;
  2747.             for (C = 0; C < P; C++) {
  2748.                 E = i[C];
  2749.                 if (B = E.element) B[0].style.width = Math.max(0, E.outerWidth - E.hsides) + "px"
  2750.             }
  2751.         }
  2752.  
  2753.         function t(i) {
  2754.             var C, P = i.length,
  2755.                 E, B, n, Y, W = {};
  2756.             for (C = 0; C < P; C++) {
  2757.                 E = i[C];
  2758.                 if (B = E.element) {
  2759.                     n = E.key;
  2760.                     Y = W[n];
  2761.                     if (Y === ma) Y = W[n] = Fb(B);
  2762.                     E.outerHeight = B[0].offsetHeight + Y
  2763.                 }
  2764.             }
  2765.         }
  2766.  
  2767.         function y() {
  2768.             var i, C = pa(),
  2769.                 P = [];
  2770.             for (i = 0; i < C; i++) P[i] = ca(i).find("td:first div.fc-day-content > div");
  2771.             return P
  2772.         }
  2773.  
  2774.         function S(i) {
  2775.             var C, P = i.length,
  2776.                 E = [];
  2777.             for (C = 0; C < P; C++) E[C] = i[C][0].offsetTop;
  2778.             return E
  2779.         }
  2780.  
  2781.         function Q(i, C) {
  2782.             var P, E = i.length,
  2783.                 B, n;
  2784.             for (P = 0; P < E; P++) {
  2785.                 B = i[P];
  2786.                 if (n = B.element) {
  2787.                     n[0].style.top = C[B.row] + (B.top || 0) + "px";
  2788.                     B = B.event;
  2789.                     oa("eventAfterRender", B, B, n)
  2790.                 }
  2791.             }
  2792.         }
  2793.  
  2794.         function q(i, C, P) {
  2795.             var E = fa("isRTL"),
  2796.                 B = E ? "w" : "e",
  2797.                 n = C.find("div.ui-resizable-" + B),
  2798.                 Y = false;
  2799.             qb(C);
  2800.             C.mousedown(function (W) {
  2801.                 W.preventDefault()
  2802.             }).click(function (W) {
  2803.                 if (Y) {
  2804.                     W.preventDefault();
  2805.                     W.stopImmediatePropagation()
  2806.                 }
  2807.             });
  2808.             n.mousedown(function (W) {
  2809.                 function o(ia) {
  2810.                     oa("eventResizeStop", this, i, ia);
  2811.                     m("body").css("cursor", "");
  2812.                     s.stop();
  2813.                     ya();
  2814.                     k && ua(this, i, k, 0, ia);
  2815.                     setTimeout(function () {
  2816.                         Y = false
  2817.                     }, 0)
  2818.                 }
  2819.                 if (W.which == 1) {
  2820.                     Y = true;
  2821.                     var s = u.getHoverListener(),
  2822.                         v = pa(),
  2823.                         F = U(),
  2824.                         r = E ? -1 : 1,
  2825.                         J = E ? F - 1 : 0,
  2826.                         M = C.css("top"),
  2827.                         k, D, Z = m.extend({}, i),
  2828.                         ja = L(i.start);
  2829.                     K();
  2830.                     m("body").css("cursor", B + "-resize").one("mouseup", o);
  2831.                     oa("eventResizeStart", this, i, W);
  2832.                     s.start(function (ia, la) {
  2833.                         if (ia) {
  2834.                             var $ = Math.max(ja.row, ia.row);
  2835.                             ia = ia.col;
  2836.                             if (v == 1) $ = 0;
  2837.                             if ($ == ja.row) ia = E ? Math.min(ja.col, ia) : Math.max(ja.col, ia);
  2838.                             k = $ * 7 + ia * r + J - (la.row * 7 + la.col * r + J);
  2839.                             la = ba(sa(i), k, true);
  2840.                             if (k) {
  2841.                                 Z.end = la;
  2842.                                 $ = D;
  2843.                                 D = b(c([Z]), P.row, M);
  2844.                                 D.find("*").css("cursor", B + "-resize");
  2845.                                 $ && $.remove();
  2846.                                 na(i)
  2847.                             } else if (D) {
  2848.                                 da(i);
  2849.                                 D.remove();
  2850.                                 D = null
  2851.                             }
  2852.                             ya();
  2853.                             X(i.start, ba(N(la), 1))
  2854.                         }
  2855.                     }, W)
  2856.                 }
  2857.             })
  2858.         }
  2859.         var u = this;
  2860.         u.renderDaySegs = a;
  2861.         u.resizableDayEvent = q;
  2862.         var fa = u.opt,
  2863.             oa = u.trigger,
  2864.             ga = u.isEventDraggable,
  2865.             ra = u.isEventResizable,
  2866.             sa = u.eventEnd,
  2867.             ha = u.reportEventElement,
  2868.             da = u.showEvents,
  2869.             na = u.hideEvents,
  2870.             ua = u.eventResize,
  2871.             pa = u.getRowCnt,
  2872.             U = u.getColCnt,
  2873.             ca = u.allDayRow,
  2874.             ka = u.allDayBounds,
  2875.             qa = u.colContentLeft,
  2876.             G = u.colContentRight,
  2877.             p = u.dayOfWeekCol,
  2878.             L = u.dateCell,
  2879.             c = u.compileDaySegs,
  2880.             z = u.getDaySegmentContainer,
  2881.             H = u.bindDaySeg,
  2882.             T = u.calendar.formatDates,
  2883.             X = u.renderDayOverlay,
  2884.             ya = u.clearOverlays,
  2885.             K = u.clearSelection
  2886.     }
  2887.  
  2888.     function Mb() {
  2889.         function a(Q, q, u) {
  2890.             b();
  2891.             q || (q = j(Q, u));
  2892.             t(Q, q, u);
  2893.             e(Q, q, u)
  2894.         }
  2895.  
  2896.         function b(Q) {
  2897.             if (S) {
  2898.                 S = false;
  2899.                 y();
  2900.                 l("unselect", null, Q)
  2901.             }
  2902.         }
  2903.  
  2904.         function e(Q, q, u, fa) {
  2905.             S = true;
  2906.             l("select", null, Q, q, u, fa)
  2907.         }
  2908.  
  2909.         function d(Q) {
  2910.             var q = f.cellDate,
  2911.                 u = f.cellIsAllDay,
  2912.                 fa = f.getHoverListener(),
  2913.                 oa = f.reportDayClick;
  2914.             if (Q.which == 1 && g("selectable")) {
  2915.                 b(Q);
  2916.                 var ga;
  2917.                 fa.start(function (ra, sa) {
  2918.                     y();
  2919.                     if (ra && u(ra)) {
  2920.                         ga = [q(sa), q(ra)].sort(Gb);
  2921.                         t(ga[0], ga[1], true)
  2922.                     } else ga = null
  2923.                 }, Q);
  2924.                 m(document).one("mouseup", function (ra) {
  2925.                     fa.stop();
  2926.                     if (ga) {
  2927.                         +ga[0] == +ga[1] && oa(ga[0], true, ra);
  2928.                         e(ga[0], ga[1], true, ra)
  2929.                     }
  2930.                 })
  2931.             }
  2932.         }
  2933.         var f = this;
  2934.         f.select = a;
  2935.         f.unselect = b;
  2936.         f.reportSelection = e;
  2937.         f.daySelectionMousedown = d;
  2938.         var g = f.opt,
  2939.             l = f.trigger,
  2940.             j = f.defaultSelectionEnd,
  2941.             t = f.renderSelection,
  2942.             y = f.clearSelection,
  2943.             S = false;
  2944.         g("selectable") && g("unselectAuto") && m(document).mousedown(function (Q) {
  2945.             var q = g("unselectCancel");
  2946.             if (q) if (m(Q.target).parents(q).length) return;
  2947.             b(Q)
  2948.         })
  2949.     }
  2950.  
  2951.     function Lb() {
  2952.         function a(g, l) {
  2953.             var j = f.shift();
  2954.             j || (j = m("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>"));
  2955.             j[0].parentNode != l[0] && j.appendTo(l);
  2956.             d.push(j.css(g).show());
  2957.             return j
  2958.         }
  2959.  
  2960.         function b() {
  2961.             for (var g; g = d.shift();) f.push(g.hide().unbind())
  2962.         }
  2963.         var e = this;
  2964.         e.renderOverlay = a;
  2965.         e.clearOverlays = b;
  2966.         var d = [],
  2967.             f = []
  2968.     }
  2969.  
  2970.     function Nb(a) {
  2971.         var b = this,
  2972.             e, d;
  2973.         b.build = function () {
  2974.             e = [];
  2975.             d = [];
  2976.             a(e, d)
  2977.         };
  2978.         b.cell = function (f, g) {
  2979.             var l = e.length,
  2980.                 j = d.length,
  2981.                 t, y = -1,
  2982.                 S = -1;
  2983.             for (t = 0; t < l; t++) if (g >= e[t][0] && g < e[t][1]) {
  2984.                 y = t;
  2985.                 break
  2986.             }
  2987.             for (t = 0; t < j; t++) if (f >= d[t][0] && f < d[t][1]) {
  2988.                 S = t;
  2989.                 break
  2990.             }
  2991.             return y >= 0 && S >= 0 ? {
  2992.                 row: y,
  2993.                 col: S
  2994.             } : null
  2995.         };
  2996.         b.rect = function (f, g, l, j, t) {
  2997.             t = t.offset();
  2998.             return {
  2999.                 top: e[f][0] - t.top,
  3000.                 left: d[g][0] - t.left,
  3001.                 width: d[j][1] - d[g][0],
  3002.                 height: e[l][1] - e[f][0]
  3003.             }
  3004.         }
  3005.     }
  3006.  
  3007.     function Ob(a) {
  3008.         function b(j) {
  3009.             xc(j);
  3010.             j = a.cell(j.pageX, j.pageY);
  3011.             if (!j != !l || j && (j.row != l.row || j.col != l.col)) {
  3012.                 if (j) {
  3013.                     g || (g = j);
  3014.                     f(j, g, j.row - g.row, j.col - g.col)
  3015.                 } else f(j, g);
  3016.                 l = j
  3017.             }
  3018.         }
  3019.         var e = this,
  3020.             d, f, g, l;
  3021.         e.start = function (j, t, y) {
  3022.             f = j;
  3023.             g = l = null;
  3024.             a.build();
  3025.             b(t);
  3026.             d = y || "mousemove";
  3027.             m(document).bind(d, b)
  3028.         };
  3029.         e.stop = function () {
  3030.             m(document).unbind(d, b);
  3031.             return l
  3032.         }
  3033.     }
  3034.  
  3035.     function xc(a) {
  3036.         if (a.pageX === ma) {
  3037.             a.pageX = a.originalEvent.pageX;
  3038.             a.pageY = a.originalEvent.pageY
  3039.         }
  3040.     }
  3041.  
  3042.     function Pb(a) {
  3043.         function b(l) {
  3044.             return d[l] = d[l] || a(l)
  3045.         }
  3046.         var e = this,
  3047.             d = {},
  3048.             f = {},
  3049.             g = {};
  3050.         e.left = function (l) {
  3051.             return f[l] = f[l] === ma ? b(l).position().left : f[l]
  3052.         };
  3053.         e.right = function (l) {
  3054.             return g[l] = g[l] === ma ? e.left(l) + b(l).width() : g[l]
  3055.         };
  3056.         e.clear = function () {
  3057.             d = {};
  3058.             f = {};
  3059.             g = {}
  3060.         }
  3061.     }
  3062.     var Ya = {
  3063.         defaultView: "month",
  3064.         aspectRatio: 1.35,
  3065.         header: {
  3066.             left: "title",
  3067.             center: "",
  3068.             right: "today prev,next"
  3069.         },
  3070.         weekends: true,
  3071.         allDayDefault: true,
  3072.         ignoreTimezone: true,
  3073.         lazyFetching: true,
  3074.         startParam: "start",
  3075.         endParam: "end",
  3076.         titleFormat: {
  3077.             month: "MMMM yyyy",
  3078.             week: "MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}",
  3079.             day: "dddd, MMM d, yyyy"
  3080.         },
  3081.         columnFormat: {
  3082.             month: "ddd",
  3083.             week: "ddd M/d",
  3084.             day: "dddd M/d"
  3085.         },
  3086.         timeFormat: {
  3087.             "": "h(:mm)t"
  3088.         },
  3089.         isRTL: false,
  3090.         firstDay: 0,
  3091.         monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  3092.         monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  3093.         dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  3094.         dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  3095.         buttonText: {
  3096.             prev: "<< Prev",
  3097.             next: "Next >>",
  3098.             prevYear: "&nbsp;&lt;&lt;&nbsp;",
  3099.             nextYear: "&nbsp;&gt;&gt;&nbsp;",
  3100.             today: "today",
  3101.             month: "month",
  3102.             week: "week",
  3103.             day: "day"
  3104.         },
  3105.         theme: false,
  3106.         buttonIcons: {
  3107.             prev: "circle-triangle-w",
  3108.             next: "circle-triangle-e"
  3109.         },
  3110.         unselectAuto: true,
  3111.         dropAccept: "*"
  3112.     },
  3113.         yc = {
  3114.             header: {
  3115.                 left: "next,prev today",
  3116.                 center: "",
  3117.                 right: "title"
  3118.             },
  3119.             buttonText: {
  3120.                 prev: "Next >>",
  3121.                 next: "<< Prev",
  3122.                 prevYear: "&nbsp;&gt;&gt;&nbsp;",
  3123.                 nextYear: "&nbsp;&lt;&lt;&nbsp;"
  3124.             },
  3125.             buttonIcons: {
  3126.                 prev: "circle-triangle-e",
  3127.                 next: "circle-triangle-w"
  3128.             }
  3129.         },
  3130.         Aa = m.fullCalendar = {
  3131.             version: "1.5.4"
  3132.         },
  3133.         Ja = Aa.views = {};
  3134.     m.fn.fullCalendar = function (a) {
  3135.         if (typeof a == "string") {
  3136.             var b = Array.prototype.slice.call(arguments, 1),
  3137.                 e;
  3138.             this.each(function () {
  3139.                 var f = m.data(this, "fullCalendar");
  3140.                 if (f && m.isFunction(f[a])) {
  3141.                     f = f[a].apply(f, b);
  3142.                     if (e === ma) e = f;
  3143.                     a == "destroy" && m.removeData(this, "fullCalendar")
  3144.                 }
  3145.             });
  3146.             if (e !== ma) return e;
  3147.             return this
  3148.         }
  3149.         var d = a.eventSources || [];
  3150.         delete a.eventSources;
  3151.         if (a.events) {
  3152.             d.push(a.events);
  3153.             delete a.events
  3154.         }
  3155.         a = m.extend(true, {}, Ya, a.isRTL || a.isRTL === ma && Ya.isRTL ? yc : {}, a);
  3156.         this.each(function (f, g) {
  3157.             f = m(g);
  3158.             g = new Yb(f, a, d);
  3159.             f.data("fullCalendar", g);
  3160.             g.render()
  3161.         });
  3162.         return this
  3163.     };
  3164.     Aa.sourceNormalizers = [];
  3165.     Aa.sourceFetchers = [];
  3166.     var ac = {
  3167.         dataType: "json",
  3168.         cache: false
  3169.     },
  3170.         bc = 1;
  3171.     Aa.addDays = ba;
  3172.     Aa.cloneDate = N;
  3173.     Aa.parseDate = kb;
  3174.     Aa.parseISO8601 = Bb;
  3175.     Aa.parseTime = mb;
  3176.     Aa.formatDate = Oa;
  3177.     Aa.formatDates = ib;
  3178.     var lc = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"],
  3179.         Ab = 864E5,
  3180.         cc = 36E5,
  3181.         wc = 6E4,
  3182.         dc = {
  3183.             s: function (a) {
  3184.                 return a.getSeconds()
  3185.             },
  3186.             ss: function (a) {
  3187.                 return Pa(a.getSeconds())
  3188.             },
  3189.             m: function (a) {
  3190.                 return a.getMinutes()
  3191.             },
  3192.             mm: function (a) {
  3193.                 return Pa(a.getMinutes())
  3194.             },
  3195.             h: function (a) {
  3196.                 return a.getHours() % 12 || 12
  3197.             },
  3198.             hh: function (a) {
  3199.                 return Pa(a.getHours() % 12 || 12)
  3200.             },
  3201.             H: function (a) {
  3202.                 return a.getHours()
  3203.             },
  3204.             HH: function (a) {
  3205.                 return Pa(a.getHours())
  3206.             },
  3207.             d: function (a) {
  3208.                 return a.getDate()
  3209.             },
  3210.             dd: function (a) {
  3211.                 return Pa(a.getDate())
  3212.             },
  3213.             ddd: function (a, b) {
  3214.                 return b.dayNamesShort[a.getDay()]
  3215.             },
  3216.             dddd: function (a, b) {
  3217.                 return b.dayNames[a.getDay()]
  3218.             },
  3219.             M: function (a) {
  3220.                 return a.getMonth() + 1
  3221.             },
  3222.             MM: function (a) {
  3223.                 return Pa(a.getMonth() + 1)
  3224.             },
  3225.             MMM: function (a, b) {
  3226.                 return b.monthNamesShort[a.getMonth()]
  3227.             },
  3228.             MMMM: function (a, b) {
  3229.                 return b.monthNames[a.getMonth()]
  3230.             },
  3231.             yy: function (a) {
  3232.                 return (a.getFullYear() + "").substring(2)
  3233.             },
  3234.             yyyy: function (a) {
  3235.                 return a.getFullYear()
  3236.             },
  3237.             t: function (a) {
  3238.                 return a.getHours() < 12 ? "a" : "p"
  3239.             },
  3240.             tt: function (a) {
  3241.                 return a.getHours() < 12 ? "am" : "pm"
  3242.             },
  3243.             T: function (a) {
  3244.                 return a.getHours() < 12 ? "A" : "P"
  3245.             },
  3246.             TT: function (a) {
  3247.                 return a.getHours() < 12 ? "AM" : "PM"
  3248.             },
  3249.             u: function (a) {
  3250.                 return Oa(a, "yyyy-MM-dd'T'HH:mm:ss'Z'")
  3251.             },
  3252.             S: function (a) {
  3253.                 a = a.getDate();
  3254.                 if (a > 10 && a < 20) return "th";
  3255.                 return ["st", "nd", "rd"][a % 10 - 1] || "th"
  3256.             }
  3257.         };
  3258.     Aa.applyAll = $a;
  3259.     Ja.month = mc;
  3260.     Ja.basicWeek = nc;
  3261.     Ja.basicDay = oc;
  3262.     wb({
  3263.         weekMode: "fixed"
  3264.     });
  3265.     Ja.agendaWeek = qc;
  3266.     Ja.agendaDay = rc;
  3267.     wb({
  3268.         allDaySlot: true,
  3269.         allDayText: "all-day",
  3270.         firstHour: 6,
  3271.         slotMinutes: 30,
  3272.         defaultEventMinutes: 120,
  3273.         axisFormat: "h(:mm)tt",
  3274.         timeFormat: {
  3275.             agenda: "h:mm{ - h:mm}"
  3276.         },
  3277.         dragOpacity: {
  3278.             agenda: 0.5
  3279.         },
  3280.         minTime: 0,
  3281.         maxTime: 24
  3282.     })
  3283. })(jQuery);
Add Comment
Please, Sign In to add comment