text: /*! SmartAdmin - v1.4.1 - 2014-06-26 */!function(a,b){function c(b){a.extend(!0,rb,b)}function d(c,d,j){function k(a){$?(y(),x(),G(),t(a)):l()}function l(){_=d.theme?"ui":"fc",c.addClass("fc"),d.isRTL&&c.addClass("fc-rtl"),d.theme&&c.addClass("ui-widget"),$=a("<div class='fc-content' style='position:relative'/>").prependTo(c),Y=new e(X,d),Z=Y.render(),Z&&c.prepend(Z),s(d.defaultView),a(window).resize(A),r()||n()}function n(){setTimeout(function(){!ab.start&&r()&&t()},0)}function o(){a(window).unbind("resize",A),Y.destroy(),$.remove(),c.removeClass("fc fc-rtl ui-widget")}function p(){return 0!==hb.offsetWidth}function r(){return 0!==a("body")[0].offsetWidth}function s(b){if(!ab||b!=ab.name){kb++,I();var c,d=ab;d?((d.beforeHide||O)(),N($,$.height()),d.element.hide()):N($,1),$.css("overflow","hidden"),ab=ib[b],ab?ab.element.show():ab=ib[b]=new ub[b](c=db=a("<div class='fc-view fc-view-"+b+"' style='position:absolute'/>").appendTo($),X),d&&Y.deactivateButton(d.name),Y.activateButton(b),t(),$.css("overflow",""),d&&N($,1),c||(ab.afterShow||O)(),kb--}}function t(a){if(p()){kb++,I(),cb===b&&y();var d=!1;!ab.start||a||lb<ab.start||lb>=ab.end?(ab.render(lb,a||0),z(!0),d=!0):ab.sizeDirty?(ab.clearEvents(),z(),d=!0):ab.eventsDirty&&(ab.clearEvents(),d=!0),ab.sizeDirty=!1,ab.eventsDirty=!1,B(d),bb=c.outerWidth(),Y.updateTitle(ab.title);var e=new Date;e>=ab.start&&e<ab.end?Y.disableButton("today"):Y.enableButton("today"),kb--,ab.trigger("viewDisplay",hb)}}function w(){x(),p()&&(y(),z(),I(),ab.clearEvents(),ab.renderEvents(mb),ab.sizeDirty=!1)}function x(){a.each(ib,function(a,b){b.sizeDirty=!0})}function y(){cb=d.contentHeight?d.contentHeight:d.height?d.height-(Z?Z.height():0)-J($):Math.round($.width()/Math.max(d.aspectRatio,.5))}function z(a){kb++,ab.setHeight(cb,a),db&&(db.css("position","relative"),db=null),ab.setWidth($.width(),a),kb--}function A(){if(!kb)if(ab.start){var a=++jb;setTimeout(function(){a==jb&&!kb&&p()&&bb!=(bb=c.outerWidth())&&(kb++,w(),ab.trigger("windowResize",hb),kb--)},200)}else n()}function B(a){!d.lazyFetching||fb(ab.visStart,ab.visEnd)?C():a&&F()}function C(){gb(ab.visStart,ab.visEnd)}function D(a){mb=a,F()}function E(a){F(a)}function F(a){G(),p()&&(ab.clearEvents(),ab.renderEvents(mb,a),ab.eventsDirty=!1)}function G(){a.each(ib,function(a,b){b.eventsDirty=!0})}function H(a,c,d){ab.select(a,c,d===b?!0:d)}function I(){ab&&ab.unselect()}function K(){t(-1)}function L(){t(1)}function M(){g(lb,-1),t()}function P(){g(lb,1),t()}function Q(){lb=new Date,t()}function R(a,b,c){a instanceof Date?lb=m(a):q(lb,a,b,c),t()}function S(a,c,d){a!==b&&g(lb,a),c!==b&&h(lb,c),d!==b&&i(lb,d),t()}function T(){return m(lb)}function U(){return ab}function V(a,c){return c===b?d[a]:void(("height"==a||"contentHeight"==a||"aspectRatio"==a)&&(d[a]=c,w()))}function W(a,b){return d[a]?d[a].apply(b||hb,Array.prototype.slice.call(arguments,2)):void 0}var X=this;X.options=d,X.render=k,X.destroy=o,X.refetchEvents=C,X.reportEvents=D,X.reportEventChange=E,X.rerenderEvents=F,X.changeView=s,X.select=H,X.unselect=I,X.prev=K,X.next=L,X.prevYear=M,X.nextYear=P,X.today=Q,X.gotoDate=R,X.incrementDate=S,X.formatDate=function(a,b){return u(a,b,d)},X.formatDates=function(a,b,c){return v(a,b,c,d)},X.getDate=T,X.getView=U,X.option=V,X.trigger=W,f.call(X,d,j);var Y,Z,$,_,ab,bb,cb,db,eb,fb=X.isFetchNeeded,gb=X.fetchEvents,hb=c[0],ib={},jb=0,kb=0,lb=new Date,mb=[];q(lb,d.year,d.month,d.date),d.droppable&&a(document).bind("dragstart",function(b,c){var e=b.target,f=a(e);if(!f.parents(".fc").length){var g=d.dropAccept;(a.isFunction(g)?g.call(e,f):f.is(g))&&(eb=e,ab.dragStart(eb,b,c))}}).bind("dragstop",function(a,b){eb&&(ab.dragStop(eb,a,b),eb=null)})}function e(b,c){function d(){m=c.theme?"ui":"fc";var b=c.header;return b?n=a("<table class='fc-header' style='width:100%'/>").append(a("<tr/>").append(f("left")).append(f("center")).append(f("right"))):void 0}function e(){n.remove()}function f(d){var e=a("<td class='fc-header-"+d+"'/>"),f=c.header[d];return f&&a.each(f.split(" "),function(d){d>0&&e.append("<span class='fc-header-space'/>");var f;a.each(this.split(","),function(d,g){if("title"==g)e.append("<span class='fc-header-title'><h2>&nbsp;</h2></span>"),f&&f.addClass(m+"-corner-right"),f=null;else{var h;if(b[g]?h=b[g]:ub[g]&&(h=function(){k.removeClass(m+"-state-hover"),b.changeView(g)}),h){var i=c.theme?S(c.buttonIcons,g):null,j=S(c.buttonText,g),k=a("<span class='fc-button fc-button-"+g+" "+m+"-state-default'><span class='fc-button-inner'><span class='fc-button-content'>"+(i?"<span class='fc-icon-wrap'><span class='ui-icon ui-icon-"+i+"'/></span>":j)+"</span><span class='fc-button-effect'><span></span></span></span></span>");k&&(k.click(function(){k.hasClass(m+"-state-disabled")||h()}).mousedown(function(){k.not("."+m+"-state-active").not("."+m+"-state-disabled").addClass(m+"-state-down")}).mouseup(function(){k.removeClass(m+"-state-down")}).hover(function(){k.not("."+m+"-state-active").not("."+m+"-state-disabled").addClass(m+"-state-hover")},function(){k.removeClass(m+"-state-hover").removeClass(m+"-state-down")}).appendTo(e),f||k.addClass(m+"-corner-left"),f=k)}}}),f&&f.addClass(m+"-corner-right")}),e}function g(a){n.find("h2").html(a)}function h(a){n.find("span.fc-button-"+a).addClass(m+"-state-active")}function i(a){n.find("span.fc-button-"+a).removeClass(m+"-state-active")}function j(a){n.find("span.fc-button-"+a).addClass(m+"-state-disabled")}function k(a){n.find("span.fc-button-"+a).removeClass(m+"-state-disabled")}var l=this;l.render=d,l.destroy=e,l.updateTitle=g,l.activateButton=h,l.deactivateButton=i,l.disableButton=j,l.enableButton=k;var m,n=a([])}function f(c,d){function e(a,b){return!y||y>a||b>z}function f(a,b){y=a,z=b,I=[];var c=++F,d=E.length;G=d;for(var e=0;d>e;e++)g(E[e],c)}function g(a,b){h(a,function(c){if(b==F){if(c){for(var d=0;d<c.length;d++)c[d].source=a,t(c[d]);I=I.concat(c)}G--,G||C(I)}})}function h(b,d){var e,f,g=tb.sourceFetchers;for(e=0;e<g.length;e++){if(f=g[e](b,y,z,d),f===!0)return;if("object"==typeof f)return void h(f,d)}var i=b.events;if(i)a.isFunction(i)?(q(),i(m(y),m(z),function(a){d(a),s()})):a.isArray(i)?d(i):d();else{var j=b.url;if(j){var k=b.success,l=b.error,n=b.complete,o=a.extend({},b.data||{}),p=$(b.startParam,c.startParam),r=$(b.endParam,c.endParam);p&&(o[p]=Math.round(+y/1e3)),r&&(o[r]=Math.round(+z/1e3)),q(),a.ajax(a.extend({},vb,b,{data:o,success:function(b){b=b||[];var c=Z(k,this,arguments);a.isArray(c)&&(b=c),d(b)},error:function(){Z(l,this,arguments),d()},complete:function(){Z(n,this,arguments),s()}}))}else d()}}function i(a){a=j(a),a&&(G++,g(a,F))}function j(b){return a.isFunction(b)||a.isArray(b)?b={events:b}:"string"==typeof b&&(b={url:b}),"object"==typeof b?(u(b),E.push(b),b):void 0}function k(b){E=a.grep(E,function(a){return!v(a,b)}),I=a.grep(I,function(a){return!v(a.source,b)}),C(I)}function l(a){var b,c,d=I.length,e=B().defaultEventEnd,f=a.start-a._start,g=a.end?a.end-(a._end||e(a)):0;for(b=0;d>b;b++)c=I[b],c._id==a._id&&c!=a&&(c.start=new Date(+c.start+f),c.end=a.end?new Date(c.end?+c.end+g:+e(c)+g):null,c.title=a.title,c.url=a.url,c.allDay=a.allDay,c.className=a.className,c.editable=a.editable,c.color=a.color,c.backgroudColor=a.backgroudColor,c.borderColor=a.borderColor,c.textColor=a.textColor,t(c));t(a),C(I)}function n(a,b){t(a),a.source||(b&&(D.events.push(a),a.source=D),I.push(a)),C(I)}function o(b){if(b){if(!a.isFunction(b)){var c=b+"";b=function(a){return a._id==c}}I=a.grep(I,b,!0);for(var d=0;d<E.length;d++)a.isArray(E[d].events)&&(E[d].events=a.grep(E[d].events,b,!0))}else{I=[];for(var d=0;d<E.length;d++)a.isArray(E[d].events)&&(E[d].events=[])}C(I)}function p(b){return a.isFunction(b)?a.grep(I,b):b?(b+="",a.grep(I,function(a){return a._id==b})):I}function q(){H++||A("loading",null,!0)}function s(){--H||A("loading",null,!1)}function t(a){var d=a.source||{},e=$(d.ignoreTimezone,c.ignoreTimezone);a._id=a._id||(a.id===b?"_fc"+wb++:a.id+""),a.date&&(a.start||(a.start=a.date),delete a.date),a._start=m(a.start=r(a.start,e)),a.end=r(a.end,e),a.end&&a.end<=a.start&&(a.end=null),a._end=a.end?m(a.end):null,a.allDay===b&&(a.allDay=$(d.allDayDefault,c.allDayDefault)),a.className?"string"==typeof a.className&&(a.className=a.className.split(/\s+/)):a.className=[]}function u(a){a.className?"string"==typeof a.className&&(a.className=a.className.split(/\s+/)):a.className=[];for(var b=tb.sourceNormalizers,c=0;c<b.length;c++)b[c](a)}function v(a,b){return a&&b&&w(a)==w(b)}function w(a){return("object"==typeof a?a.events||a.url:"")||a}var x=this;x.isFetchNeeded=e,x.fetchEvents=f,x.addEventSource=i,x.removeEventSource=k,x.updateEvent=l,x.renderEvent=n,x.removeEvents=o,x.clientEvents=p,x.normalizeEvent=t;for(var y,z,A=x.trigger,B=x.getView,C=x.reportEvents,D={events:[]},E=[D],F=0,G=0,H=0,I=[],J=0;J<d.length;J++)j(d[J])}function g(a,b,c){return a.setFullYear(a.getFullYear()+b),c||l(a),a}function h(a,b,c){if(+a){var d=a.getMonth()+b,e=m(a);for(e.setDate(1),e.setMonth(d),a.setMonth(d),c||l(a);a.getMonth()!=e.getMonth();)a.setDate(a.getDate()+(e>a?1:-1))}return a}function i(a,b,c){if(+a){var d=a.getDate()+b,e=m(a);e.setHours(9),e.setDate(d),a.setDate(d),c||l(a),j(a,e)}return a}function j(a,b){if(+a)for(;a.getDate()!=b.getDate();)a.setTime(+a+(b>a?1:-1)*zb)}function k(a,b){return a.setMinutes(a.getMinutes()+b),a}function l(a){return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a}function m(a,b){return b?l(new Date(+a)):new Date(+a)}function n(){var a,b=0;do a=new Date(1970,b++,1);while(a.getHours());return a}function o(a,b,c){for(b=b||1;!a.getDay()||c&&1==a.getDay()||!c&&6==a.getDay();)i(a,b);return a}function p(a,b){return Math.round((m(a,!0)-m(b,!0))/yb)}function q(a,c,d,e){c!==b&&c!=a.getFullYear()&&(a.setDate(1),a.setMonth(0),a.setFullYear(c)),d!==b&&d!=a.getMonth()&&(a.setDate(1),a.setMonth(d)),e!==b&&a.setDate(e)}function r(a,c){return"object"==typeof a?a:"number"==typeof a?new Date(1e3*a):"string"==typeof a?a.match(/^\d+(\.\d+)?$/)?new Date(1e3*parseFloat(a)):(c===b&&(c=!0),s(a,c)||(a?new Date(a):null)):null}function s(a,b){var c=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}))?))?)?)?)?$/);if(!c)return null;var d=new Date(c[1],0,1);if(b||!c[13]){var e=new Date(c[1],0,1,9,0);c[3]&&(d.setMonth(c[3]-1),e.setMonth(c[3]-1)),c[5]&&(d.setDate(c[5]),e.setDate(c[5])),j(d,e),c[7]&&d.setHours(c[7]),c[8]&&d.setMinutes(c[8]),c[10]&&d.setSeconds(c[10]),c[12]&&d.setMilliseconds(1e3*Number("0."+c[12])),j(d,e)}else if(d.setUTCFullYear(c[1],c[3]?c[3]-1:0,c[5]||1),d.setUTCHours(c[7]||0,c[8]||0,c[10]||0,c[12]?1e3*Number("0."+c[12]):0),c[14]){var f=60*Number(c[16])+(c[18]?Number(c[18]):0);f*="-"==c[15]?1:-1,d=new Date(+d+60*f*1e3)}return d}function t(a){if("number"==typeof a)return 60*a;if("object"==typeof a)return 60*a.getHours()+a.getMinutes();var b=a.match(/(\d+)(?::(\d+))?\s*(\w+)?/);if(b){var c=parseInt(b[1],10);return b[3]&&(c%=12,"p"==b[3].toLowerCase().charAt(0)&&(c+=12)),60*c+(b[2]?parseInt(b[2],10):0)}}function u(a,b,c){return v(a,null,b,c)}function v(a,b,c,d){d=d||rb;var e,f,g,h,i=a,j=b,k=c.length,l="";for(e=0;k>e;e++)if(f=c.charAt(e),"'"==f){for(g=e+1;k>g;g++)if("'"==c.charAt(g)){i&&(l+=g==e+1?"'":c.substring(e+1,g),e=g);break}}else if("("==f){for(g=e+1;k>g;g++)if(")"==c.charAt(g)){var m=u(i,c.substring(e+1,g),d);parseInt(m.replace(/\D/,""),10)&&(l+=m),e=g;break}}else if("["==f){for(g=e+1;k>g;g++)if("]"==c.charAt(g)){var n=c.substring(e+1,g),m=u(i,n,d);m!=u(j,n,d)&&(l+=m),e=g;break}}else if("{"==f)i=b,j=a;else if("}"==f)i=a,j=b;else{for(g=k;g>e;g--)if(h=Bb[c.substring(e,g)]){i&&(l+=h(i,d)),e=g-1;break}g==e&&i&&(l+=f)}return l}function w(a){return a.end?x(a.end,a.allDay):i(m(a.start),1)}function x(a,b){return a=m(a),b||a.getHours()||a.getMinutes()?i(a,1):l(a)}function y(a,b){return 100*(b.msLength-a.msLength)+(a.event.start-b.event.start)}function z(a,b){return a.end>b.start&&a.start<b.end}function A(a,b,c,d){var e,f,g,h,i,j,k,l,n=[],o=a.length;for(e=0;o>e;e++)f=a[e],g=f.start,h=b[e],h>c&&d>g&&(c>g?(i=m(c),k=!1):(i=g,k=!0),h>d?(j=m(d),l=!1):(j=h,l=!0),n.push({event:f,start:i,end:j,isStart:k,isEnd:l,msLength:j-i}));return n.sort(y)}function B(a){var b,c,d,e,f,g=[],h=a.length;for(b=0;h>b;b++){for(c=a[b],d=0;;){if(e=!1,g[d])for(f=0;f<g[d].length;f++)if(z(g[d][f],c)){e=!0;break}if(!e)break;d++}g[d]?g[d].push(c):g[d]=[c]}return g}function C(c,d,e){c.unbind("mouseover").mouseover(function(c){for(var f,g,h,i=c.target;i!=this;)f=i,i=i.parentNode;(g=f._fci)!==b&&(f._fci=b,h=d[g],e(h.event,h.element,h),a(c.target).trigger(c)),c.stopPropagation()})}function D(b,c,d){for(var e,f=0;f<b.length;f++)e=a(b[f]),e.width(Math.max(0,c-F(e,d)))}function E(b,c,d){for(var e,f=0;f<b.length;f++)e=a(b[f]),e.height(Math.max(0,c-J(e,d)))}function F(a,b){return G(a)+I(a)+(b?H(a):0)}function G(b){return(parseFloat(a.css(b[0],"paddingLeft",!0))||0)+(parseFloat(a.css(b[0],"paddingRight",!0))||0)}function H(b){return(parseFloat(a.css(b[0],"marginLeft",!0))||0)+(parseFloat(a.css(b[0],"marginRight",!0))||0)}function I(b){return(parseFloat(a.css(b[0],"borderLeftWidth",!0))||0)+(parseFloat(a.css(b[0],"borderRightWidth",!0))||0)}function J(a,b){return K(a)+M(a)+(b?L(a):0)}function K(b){return(parseFloat(a.css(b[0],"paddingTop",!0))||0)+(parseFloat(a.css(b[0],"paddingBottom",!0))||0)}function L(b){return(parseFloat(a.css(b[0],"marginTop",!0))||0)+(parseFloat(a.css(b[0],"marginBottom",!0))||0)}function M(b){return(parseFloat(a.css(b[0],"borderTopWidth",!0))||0)+(parseFloat(a.css(b[0],"borderBottomWidth",!0))||0)}function N(a,b){b="number"==typeof b?b+"px":b,a.each(function(a,c){c.style.cssText+=";min-height:"+b+";_height:"+b})}function O(){}function P(a,b){return a-b}function Q(a){return Math.max.apply(Math,a)}function R(a){return(10>a?"0":"")+a}function S(a,c){if(a[c]!==b)return a[c];for(var d,e=c.split(/(?=[A-Z])/),f=e.length-1;f>=0;f--)if(d=a[e[f].toLowerCase()],d!==b)return d;return a[""]}function T(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")}function U(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/gi,"")}function V(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function W(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function X(a,b){a.each(function(a,c){c.className=c.className.replace(/^fc-\w*/,"fc-"+xb[b.getDay()])})}function Y(a,b){var c=a.source||{},d=a.color,e=c.color,f=b("eventColor"),g=a.backgroundColor||d||c.backgroundColor||e||b("eventBackgroundColor")||f,h=a.borderColor||d||c.borderColor||e||b("eventBorderColor")||f,i=a.textColor||c.textColor||b("eventTextColor"),j=[];return g&&j.push("background-color:"+g),h&&j.push("border-color:"+h),i&&j.push("color:"+i),j.join(";")}function Z(b,c,d){if(a.isFunction(b)&&(b=[b]),b){var e,f;for(e=0;e<b.length;e++)f=b[e].apply(c,d)||f;return f}}function $(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==b)return arguments[a]}function _(a,b){function c(a,b){b&&(h(a,b),a.setDate(1));var c=m(a,!0);c.setDate(1);var j=h(m(c),1),k=m(c),l=m(j),n=e("firstDay"),p=e("weekends")?0:1;p&&(o(k),o(l,-1,!0)),i(k,-((k.getDay()-Math.max(n,p)+7)%7)),i(l,(7-l.getDay()+Math.max(n,p))%7);var q=Math.round((l-k)/(7*yb));"fixed"==e("weekMode")&&(i(l,7*(6-q)),q=6),d.title=g(c,e("titleFormat")),d.start=c,d.end=j,d.visStart=k,d.visEnd=l,f(6,q,p?5:7,!0)}var d=this;d.render=c,cb.call(d,a,b,"month");var e=d.opt,f=d.renderBasic,g=b.formatDate}function ab(a,b){function c(a,b){b&&i(a,7*b);var c=i(m(a),-((a.getDay()-e("firstDay")+7)%7)),h=i(m(c),7),j=m(c),k=m(h),l=e("weekends");l||(o(j),o(k,-1,!0)),d.title=g(j,i(m(k),-1),e("titleFormat")),d.start=c,d.end=h,d.visStart=j,d.visEnd=k,f(1,1,l?7:5,!1)}var d=this;d.render=c,cb.call(d,a,b,"basicWeek");var e=d.opt,f=d.renderBasic,g=b.formatDates}function bb(a,b){function c(a,b){b&&(i(a,b),e("weekends")||o(a,0>b?-1:1)),d.title=g(a,e("titleFormat")),d.start=d.visStart=m(a,!0),d.end=d.visEnd=i(m(d.start),1),f(1,1,1,!1)}var d=this;d.render=c,cb.call(d,a,b,"basicDay");var e=d.opt,f=d.renderBasic,g=b.formatDate}function cb(b,c,d){function e(a,b,c,d){$=b,_=c,f();var e=!O;e?g(a,d):tb(),h(e)}function f(){eb=rb("isRTL"),eb?(fb=-1,gb=_-1):(fb=1,gb=0),hb=rb("firstDay"),ib=rb("weekends")?0:1,kb=rb("theme")?"ui":"fc",pb=rb("columnFormat")}function g(c,d){var e,f,g,h,i=kb+"-widget-header",j=kb+"-widget-content";for(e="<table class='fc-border-separate' style='width:100%' cellspacing='0'><thead><tr>",f=0;_>f;f++)e+="<th class='fc- "+i+"'/>";for(e+="</tr></thead><tbody>",f=0;c>f;f++){for(e+="<tr class='fc-week"+f+"'>",g=0;_>g;g++)e+="<td class='fc- "+j+" fc-day"+(f*_+g)+"'><div>"+(d?"<div class='fc-day-number'/>":"")+"<div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";e+="</tr>"}e+="</tbody></table>",h=a(e).appendTo(b),L=h.find("thead"),M=L.find("th"),O=h.find("tbody"),P=O.find("tr"),Q=O.find("td"),R=Q.filter(":first-child"),S=P.eq(0).find("div.fc-day-content div"),W(L.add(L.find("tr"))),W(P),P.eq(0).addClass("fc-first"),n(Q),T=a("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(b)}function h(b){var c,d,e,f=b||1==$,g=K.start.getMonth(),h=l(new Date);f&&M.each(function(b,e){c=a(e),d=F(b),c.html(xb(d,pb)),X(c,d)}),Q.each(function(b,e){c=a(e),d=F(b),d.getMonth()==g?c.removeClass("fc-other-month"):c.addClass("fc-other-month"),+d==+h?c.addClass(kb+"-state-highlight fc-today"):c.removeClass(kb+"-state-highlight fc-today"),c.find("div.fc-day-number").text(d.getDate()),f&&X(c,d)}),P.each(function(b,c){e=a(c),$>b?(e.show(),b==$-1?e.addClass("fc-last"):e.removeClass("fc-last")):e.hide()})}function j(b){Y=b;var c,d,e,f=Y-L.height();"variable"==rb("weekMode")?c=d=Math.floor(f/(1==$?2:6)):(c=Math.floor(f/$),d=f-c*($-1)),R.each(function(b,f){$>b&&(e=a(f),N(e.find("> div"),(b==$-1?d:c)-J(e)))})}function k(a){U=a,cb.clear(),Z=Math.floor(U/_),D(M.slice(0,-1),Z)}function n(a){a.click(o).mousedown(wb)}function o(a){if(!rb("selectable")){var b=parseInt(this.className.match(/fc\-day(\d+)/)[1]),c=F(b);sb("dayClick",this,c,!0,a)}}function q(a,b,c){c&&ab.build();for(var d=m(K.visStart),e=i(m(d),_),f=0;$>f;f++){var g=new Date(Math.max(d,a)),h=new Date(Math.min(e,b));if(h>g){var j,k;eb?(j=p(h,d)*fb+gb+1,k=p(g,d)*fb+gb+1):(j=p(g,d),k=p(h,d)),n(r(f,j,f,k-1))}i(d,7),i(e,7)}}function r(a,c,d,e){var f=ab.rect(a,c,d,e,b);return ub(f,b)}function s(a){return m(a)}function t(a,b){q(a,i(m(b),1),!0)}function u(){vb()}function v(a,b,c){var d=B(a),e=Q[d.row*_+d.col];sb("dayClick",e,a,b,c)}function w(a,b){bb.start(function(a){vb(),a&&r(a.row,a.col,a.row,a.col)},b)}function x(a,b,c){var d=bb.stop();if(vb(),d){var e=C(d);sb("drop",a,e,!0,b,c)}}function y(a){return m(a.start)}function z(a){return cb.left(a)}function A(a){return cb.right(a)}function B(a){return{row:Math.floor(p(a,K.visStart)/7),col:G(a.getDay())}}function C(a){return E(a.row,a.col)}function E(a,b){return i(m(K.visStart),7*a+b*fb+gb)}function F(a){return E(Math.floor(a/_),a%_)}function G(a){return(a-Math.max(hb,ib)+_)%_*fb+gb}function H(a){return P.eq(a)}function I(){return{left:0,right:U}}var K=this;K.renderBasic=e,K.setHeight=j,K.setWidth=k,K.renderDayOverlay=q,K.defaultSelectionEnd=s,K.renderSelection=t,K.clearSelection=u,K.reportDayClick=v,K.dragStart=w,K.dragStop=x,K.defaultEventEnd=y,K.getHoverListener=function(){return bb},K.colContentLeft=z,K.colContentRight=A,K.dayOfWeekCol=G,K.dateCell=B,K.cellDate=C,K.cellIsAllDay=function(){return!0},K.allDayRow=H,K.allDayBounds=I,K.getRowCnt=function(){return $},K.getColCnt=function(){return _},K.getColWidth=function(){return Z},K.getDaySegmentContainer=function(){return T},jb.call(K,b,c,d),mb.call(K),lb.call(K),db.call(K);var L,M,O,P,Q,R,S,T,U,Y,Z,$,_,ab,bb,cb,eb,fb,gb,hb,ib,kb,pb,rb=K.opt,sb=K.trigger,tb=K.clearEvents,ub=K.renderOverlay,vb=K.clearOverlays,wb=K.daySelectionMousedown,xb=c.formatDate;V(b.addClass("fc-grid")),ab=new nb(function(b,c){var d,e,f;M.each(function(b,g){d=a(g),e=d.offset().left,b&&(f[1]=e),f=[e],c[b]=f}),f[1]=e+d.outerWidth(),P.each(function(c,g){$>c&&(d=a(g),e=d.offset().top,c&&(f[1]=e),f=[e],b[c]=f)}),f[1]=e+d.outerHeight()}),bb=new ob(ab),cb=new qb(function(a){return S.eq(a)})}function db(){function b(a,b){n(a),C(d(a),b)}function c(){o(),t().empty()}function d(b){var c,d,e,f,h,j,k=y(),l=z(),n=m(g.visStart),o=i(m(n),l),p=a.map(b,w),q=[];for(c=0;k>c;c++){for(d=B(A(b,p,n,o)),e=0;e<d.length;e++)for(f=d[e],h=0;h<f.length;h++)j=f[h],j.row=c,j.level=e,q.push(j);i(n,7),i(o,7)}return q}function e(a,b,c){k(a)&&f(a,b),c.isEnd&&l(a)&&D(a,b,c),p(a,b)}function f(a,b){var c,d=u();b.draggable({zIndex:9,delay:50,opacity:h("dragOpacity"),revertDuration:h("dragRevertDuration"),start:function(e,f){j("eventDragStart",b,a,e,f),r(a,b),d.start(function(d,e,f,g){b.draggable("option","revert",!d||!f&&!g),x(),d?(c=7*f+g*(h("isRTL")?-1:1),v(i(m(a.start),c),i(w(a),c))):c=0},e,"drag")},stop:function(e,f){d.stop(),x(),j("eventDragStop",b,a,e,f),c?s(this,a,c,0,a.allDay,e,f):(b.css("filter",""),q(a,b))}})}var g=this;g.renderEvents=b,g.compileDaySegs=d,g.clearEvents=c,g.bindDaySeg=e,kb.call(g);var h=g.opt,j=g.trigger,k=g.isEventDraggable,l=g.isEventResizable,n=g.reportEvents,o=g.reportEventClear,p=g.eventElementHandlers,q=g.showEvents,r=g.hideEvents,s=g.eventDrop,t=g.getDaySegmentContainer,u=g.getHoverListener,v=g.renderDayOverlay,x=g.clearOverlays,y=g.getRowCnt,z=g.getColCnt,C=g.renderDaySegs,D=g.resizableDayEvent}function eb(a,b){function c(a,b){b&&i(a,7*b);var c=i(m(a),-((a.getDay()-e("firstDay")+7)%7)),h=i(m(c),7),j=m(c),k=m(h),l=e("weekends");l||(o(j),o(k,-1,!0)),d.title=g(j,i(m(k),-1),e("titleFormat")),d.start=c,d.end=h,d.visStart=j,d.visEnd=k,f(l?7:5)}var d=this;d.render=c,gb.call(d,a,b,"agendaWeek");var e=d.opt,f=d.renderAgenda,g=b.formatDates}function fb(a,b){function c(a,b){b&&(i(a,b),e("weekends")||o(a,0>b?-1:1));var c=m(a,!0),h=i(m(c),1);d.title=g(a,e("titleFormat")),d.start=d.visStart=c,d.end=d.visEnd=h,f(1)}var d=this;d.render=c,gb.call(d,a,b,"agendaDay");var e=d.opt,f=d.renderAgenda,g=b.formatDate}function gb(c,d,e){function f(a){Ib=a,g(),ab?Yb():h(),j()}function g(){Nb=Wb("theme")?"ui":"fc",Pb=Wb("weekends")?0:1,Ob=Wb("firstDay"),(Qb=Wb("isRTL"))?(Rb=-1,Sb=Ib-1):(Rb=1,Sb=0),Tb=t(Wb("minTime")),Ub=t(Wb("maxTime")),Vb=Wb("columnFormat")}function h(){var b,d,e,f,g,h=Nb+"-widget-header",i=Nb+"-widget-content",j=Wb("slotMinutes")%15==0;for(b="<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'><thead><tr><th class='fc-agenda-axis "+h+"'>&nbsp;</th>",d=0;Ib>d;d++)b+="<th class='fc- fc-col"+d+" "+h+"'/>";for(b+="<th class='fc-agenda-gutter "+h+"'>&nbsp;</th></tr></thead><tbody><tr><th class='fc-agenda-axis "+h+"'>&nbsp;</th>",d=0;Ib>d;d++)b+="<td class='fc- fc-col"+d+" "+i+"'><div><div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";for(b+="<td class='fc-agenda-gutter "+i+"'>&nbsp;</td></tr></tbody></table>",ab=a(b).appendTo(c),bb=ab.find("thead"),cb=bb.find("th").slice(1,-1),db=ab.find("tbody"),eb=db.find("td").slice(0,-1),fb=eb.find("div.fc-day-content div"),gb=eb.eq(0),ib=gb.find("> div"),W(bb.add(bb.find("tr"))),W(db.add(db.find("tr"))),yb=bb.find("th:first"),zb=ab.find(".fc-agenda-gutter"),kb=a("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(c),Wb("allDaySlot")?(pb=a("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(kb),b="<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='"+h+" fc-agenda-axis'>"+Wb("allDayText")+"</th><td><div class='fc-day-content'><div style='position:relative'/></div></td><th class='"+h+" fc-agenda-gutter'>&nbsp;</th></tr></table>",rb=a(b).appendTo(kb),sb=rb.find("tr"),v(sb.find("td")),yb=yb.add(rb.find("th:first")),zb=zb.add(rb.find("th.fc-agenda-gutter")),kb.append("<div class='fc-agenda-divider "+h+"'><div class='fc-agenda-divider-inner'/></div>")):pb=a([]),tb=a("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(kb),ub=a("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(tb),vb=a("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(ub),b="<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>",e=n(),f=k(m(e),Ub),k(e,Tb),Jb=0,d=0;f>e;d++)g=e.getMinutes(),b+="<tr class='fc-slot"+d+" "+(g?"fc-minor":"")+"'><th class='fc-agenda-axis "+h+"'>"+(j&&g?"&nbsp;":dc(e,Wb("axisFormat")))+"</th><td class='"+i+"'><div style='position:relative'>&nbsp;</div></td></tr>",k(e,Wb("slotMinutes")),Jb++;b+="</tbody></table>",wb=a(b).appendTo(ub),xb=wb.find("div:first"),w(wb.find("td")),yb=yb.add(wb.find("th:first"))}function j(){var a,b,c,d,e=l(new Date);for(a=0;Ib>a;a++)d=H(a),b=cb.eq(a),b.html(dc(d,Vb)),c=eb.eq(a),+d==+e?c.addClass(Nb+"-state-highlight fc-today"):c.removeClass(Nb+"-state-highlight fc-today"),X(b.add(c),d)}function o(a,c){a===b&&(a=Cb),Cb=a,ec={};var d=db.position().top,e=tb.position().top,f=Math.min(a-d,wb.height()+e+1);ib.height(f-J(gb)),kb.css("top",d),tb.height(f-e-1),Gb=xb.height()+1,c&&r()}function q(b){Bb=b,Mb.clear(),Db=0,D(yb.width("").each(function(b,c){Db=Math.max(Db,a(c).outerWidth())}),Db);var c=tb[0].clientWidth;Fb=tb.width()-c,Fb?(D(zb,Fb),zb.show().prev().removeClass("fc-last")):zb.hide().prev().addClass("fc-last"),Eb=Math.floor((c-Db)/Ib),D(cb.slice(0,-1),Eb)}function r(){function a(){tb.scrollTop(d)}var b=n(),c=m(b);c.setHours(Wb("firstHour"));var d=L(b,c)+1;a(),setTimeout(a,0)}function s(){Hb=tb.scrollTop()}function u(){tb.scrollTop(Hb)}function v(a){a.click(x).mousedown(bc)}function w(a){a.click(x).mousedown(U)}function x(a){if(!Wb("selectable")){var b=Math.min(Ib-1,Math.floor((a.pageX-ab.offset().left-Db)/Eb)),c=H(b),d=this.parentNode.className.match(/fc-slot(\d+)/);if(d){var e=parseInt(d[1])*Wb("slotMinutes"),f=Math.floor(e/60);c.setHours(f),c.setMinutes(e%60+Tb),Xb("dayClick",eb[b],c,!1,a)}else Xb("dayClick",eb[b],c,!0,a)}}function y(a,b,c){c&&Kb.build();var d,e,f=m(_.visStart);Qb?(d=p(b,f)*Rb+Sb+1,e=p(a,f)*Rb+Sb+1):(d=p(a,f),e=p(b,f)),d=Math.max(0,d),e=Math.min(Ib,e),e>d&&v(z(0,d,0,e-1))}function z(a,b,c,d){var e=Kb.rect(a,b,c,d,kb);return Zb(e,kb)}function A(a,b){for(var c=m(_.visStart),d=i(m(c),1),e=0;Ib>e;e++){var f=new Date(Math.max(c,a)),g=new Date(Math.min(d,b));if(g>f){var h=e*Rb+Sb,j=Kb.rect(0,h,0,h,ub),k=L(c,f),l=L(c,g);j.top=k,j.height=l-k,w(Zb(j,ub))}i(c,1),i(d,1)}}function B(a){return Mb.left(a)}function C(a){return Mb.right(a)}function F(a){return{row:Math.floor(p(a,_.visStart)/7),col:K(a.getDay())}}function G(a){var b=H(a.col),c=a.row;return Wb("allDaySlot")&&c--,c>=0&&k(b,Tb+c*Wb("slotMinutes")),b}function H(a){return i(m(_.visStart),a*Rb+Sb)}function I(a){return Wb("allDaySlot")&&!a.row}function K(a){return(a-Math.max(Ob,Pb)+Ib)%Ib*Rb+Sb}function L(a,c){if(a=m(a,!0),c<k(m(a),Tb))return 0;if(c>=k(m(a),Ub))return wb.height();var d=Wb("slotMinutes"),e=60*c.getHours()+c.getMinutes()-Tb,f=Math.floor(e/d),g=ec[f];return g===b&&(g=ec[f]=wb.find("tr:eq("+f+") td div")[0].offsetTop),Math.max(0,Math.round(g-1+Gb*(e%d/d)))}function M(){return{left:Db,right:Bb-Fb}}function N(){return sb}function O(a){var b=m(a.start);return a.allDay?b:k(b,Wb("defaultEventMinutes"))}function Q(a,b){return b?m(a):k(m(a),Wb("slotMinutes"))}function R(a,b,c){c?Wb("allDaySlot")&&y(a,i(m(b),1),!0):S(a,b)}function S(b,c){var d=Wb("selectHelper");if(Kb.build(),d){var e=p(b,_.visStart)*Rb+Sb;if(e>=0&&Ib>e){var f=Kb.rect(0,e,0,e,ub),g=L(b,b),h=L(b,c);if(h>g){if(f.top=g,f.height=h-g,f.left+=2,f.width-=5,a.isFunction(d)){var i=d(b,c);i&&(f.position="absolute",f.zIndex=8,Ab=a(i).css(f).appendTo(ub))}else f.isStart=!0,f.isEnd=!0,Ab=a(cc({title:"",start:b,end:c,className:["fc-select-helper"],editable:!1},f)),Ab.css("opacity",Wb("dragOpacity"));Ab&&(w(Ab),ub.append(Ab),D(Ab,f.width,!0),E(Ab,f.height,!0))}}}else A(b,c)}function T(){$b(),Ab&&(Ab.remove(),Ab=null)}function U(b){if(1==b.which&&Wb("selectable")){ac(b);var c;Lb.start(function(a,b){if(T(),a&&a.col==b.col&&!I(a)){var d=G(b),e=G(a);c=[d,k(m(d),Wb("slotMinutes")),e,k(m(e),Wb("slotMinutes"))].sort(P),S(c[0],c[3])}else c=null},b),a(document).one("mouseup",function(a){Lb.stop(),c&&(+c[0]==+c[1]&&Y(c[0],!1,a),_b(c[0],c[3],!1,a))})}}function Y(a,b,c){Xb("dayClick",eb[K(a.getDay())],a,b,c)}function Z(a,b){Lb.start(function(a){if($b(),a)if(I(a))z(a.row,a.col,a.row,a.col);else{var b=G(a),c=k(m(b),Wb("defaultEventMinutes"));A(b,c)}},b)}function $(a,b,c){var d=Lb.stop();$b(),d&&Xb("drop",a,G(d),I(d),b,c)}var _=this;_.renderAgenda=f,_.setWidth=q,_.setHeight=o,_.beforeHide=s,_.afterShow=u,_.defaultEventEnd=O,_.timePosition=L,_.dayOfWeekCol=K,_.dateCell=F,_.cellDate=G,_.cellIsAllDay=I,_.allDayRow=N,_.allDayBounds=M,_.getHoverListener=function(){return Lb},_.colContentLeft=B,_.colContentRight=C,_.getDaySegmentContainer=function(){return pb},_.getSlotSegmentContainer=function(){return vb},_.getMinMinute=function(){return Tb},_.getMaxMinute=function(){return Ub},_.getBodyContent=function(){return ub},_.getRowCnt=function(){return 1},_.getColCnt=function(){return Ib},_.getColWidth=function(){return Eb},_.getSlotHeight=function(){return Gb},_.defaultSelectionEnd=Q,_.renderDayOverlay=y,_.renderSelection=R,_.clearSelection=T,_.reportDayClick=Y,_.dragStart=Z,_.dragStop=$,jb.call(_,c,d,e),mb.call(_),lb.call(_),hb.call(_);var ab,bb,cb,db,eb,fb,gb,ib,kb,pb,rb,sb,tb,ub,vb,wb,xb,yb,zb,Ab,Bb,Cb,Db,Eb,Fb,Gb,Hb,Ib,Jb,Kb,Lb,Mb,Nb,Ob,Pb,Qb,Rb,Sb,Tb,Ub,Vb,Wb=_.opt,Xb=_.trigger,Yb=_.clearEvents,Zb=_.renderOverlay,$b=_.clearOverlays,_b=_.reportSelection,ac=_.unselect,bc=_.daySelectionMousedown,cc=_.slotSegHtml,dc=d.formatDate,ec={};V(c.addClass("fc-agenda")),Kb=new nb(function(b,c){function d(a){return Math.max(i,Math.min(j,a))}var e,f,g;cb.each(function(b,d){e=a(d),f=e.offset().left,b&&(g[1]=f),g=[f],c[b]=g}),g[1]=f+e.outerWidth(),Wb("allDaySlot")&&(e=sb,f=e.offset().top,b[0]=[f,f+e.outerHeight()]);for(var h=ub.offset().top,i=tb.offset().top,j=i+tb.outerHeight(),k=0;Jb>k;k++)b.push([d(h+Gb*k),d(h+Gb*(k+1))])}),Lb=new ob(Kb),Mb=new qb(function(a){return fb.eq(a)})}function hb(){function c(a,b){y(a);var c,d=a.length,g=[],i=[];for(c=0;d>c;c++)a[c].allDay?g.push(a[c]):i.push(a[c]);s("allDaySlot")&&(Q(e(g),b),G()),h(f(i),b)}function d(){z(),H().empty(),I().empty()}function e(b){var c,d,e,f,g=B(A(b,a.map(b,w),r.visStart,r.visEnd)),h=g.length,i=[];for(c=0;h>c;c++)for(d=g[c],e=0;e<d.length;e++)f=d[e],f.row=0,f.level=c,i.push(f);return i}function f(b){var c,d,e,f,h,j,l=S(),n=M(),o=L(),p=k(m(r.visStart),n),q=a.map(b,g),s=[];for(c=0;l>c;c++){for(d=B(A(b,q,p,k(m(p),o-n))),ib(d),e=0;e<d.length;e++)for(f=d[e],h=0;h<f.length;h++)j=f[h],j.col=c,j.level=e,s.push(j);i(p,1,!0)}return s}function g(a){return a.end?m(a.end):k(m(a.start),s("defaultEventMinutes"))}function h(c,d){var e,f,g,h,i,k,l,m,o,p,q,r,u,v,w,x,y,z,A,B,D,E,G=c.length,H="",K={},L={},M=I(),Q=S();for((B=s("isRTL"))?(D=-1,E=Q-1):(D=1,E=0),e=0;G>e;e++)f=c[e],g=f.event,h=N(f.start,f.start),i=N(f.start,f.end),k=f.col,l=f.level,m=f.forward||0,o=O(k*D+E),p=P(k*D+E)-o,p=Math.min(p-6,.95*p),q=l?p/(l+m+1):m?2*(p/(m+1)-6):p,r=o+p/(l+m+1)*l*D+(B?p-q:0),f.top=h,f.left=r,f.outerWidth=q,f.outerHeight=i-h,H+=j(g,f);for(M[0].innerHTML=H,u=M.children(),e=0;G>e;e++)f=c[e],g=f.event,v=a(u[e]),w=t("eventRender",g,g,v),w===!1?v.remove():(w&&w!==!0&&(v.remove(),v=a(w).css({position:"absolute",top:f.top,left:f.left}).appendTo(M)),f.element=v,g._id===d?n(g,v,f):v[0]._fci=e,Z(g,v));for(C(M,c,n),e=0;G>e;e++)f=c[e],(v=f.element)&&(y=K[x=f.key=U(v[0])],f.vsides=y===b?K[x]=J(v,!0):y,y=L[x],f.hsides=y===b?L[x]=F(v,!0):y,z=v.find("div.fc-event-content"),z.length&&(f.contentTop=z[0].offsetTop));for(e=0;G>e;e++)f=c[e],(v=f.element)&&(v[0].style.width=Math.max(0,f.outerWidth-f.hsides)+"px",A=Math.max(0,f.outerHeight-f.vsides),v[0].style.height=A+"px",g=f.event,f.contentTop!==b&&A-f.contentTop<10&&(v.find("div.fc-event-time").text(fb(g.start,s("timeFormat"))+" - "+g.title),v.find("div.fc-event-title").remove()),t("eventAfterRender",g,g,v))
  