text: /*
  
   FullCalendar v1.5.1
   http://arshaw.com/fullcalendar/
  
   Use fullcalendar.css for basic styling.
   For event drag & drop, requires jQuery UI draggable.
   For event resizing, requires jQuery UI resizable.
  
   Copyright (c) 2011 Adam Shaw
   Dual licensed under the MIT and GPL licenses, located in
   MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
  
   Date: Sat Apr 9 14:09:51 2011 -0700
  
  */
  (function(a,c){function b(d){a.extend(!0,ca,d)}function d(d,b,z){function mb(){d.addClass("fc");b.isRTL&&d.addClass("fc-rtl");b.theme&&d.addClass("ui-widget");A=a("<div class='fc-content' style='position:relative'/>").prependTo(d);G=new e(k,b);(T=G.render())&&d.prepend(T);l(b.defaultView);a(window).resize(ua);0!==a("body")[0].offsetWidth||Q();var c=a(".fc-view-"+b.defaultView,d).height();setTimeout(function(){a(".fc-view-search",d).css("height",c).hide()},200)}function Q(){setTimeout(function(){!t.start&&
  0!==a("body")[0].offsetWidth&&D()},0)}function l(b){if(!t||b!=t.name){J++;s();var d=t,c;d?((d.beforeHide||Ya)(),Ca(A,A.height()),d.element.hide()):Ca(A,1);A.css("overflow","hidden");(t=R[b])?t.element.show():t=R[b]=new da[b](c=S=a("<div class='fc-view fc-view-"+b+"' style='position:absolute'/>").appendTo(A),k);a("#b_search_cal").hasClass("ui-state-active")&&a("#b_search_cal").trigger("click");d&&G.deactivateButton(d.name);G.activateButton(b);D();A.css("overflow","");d&&Ca(A,1);c||(t.afterShow||Ya)();
  J--}}function D(a){if(0!==u.offsetWidth){J++;s();ba===c&&r();var e=!1;!t.start||a||y<t.start||y>=t.end?(t.render(y,a||0),p(!0),e=!0):t.sizeDirty?(t.clearEvents(),p(),e=!0):t.eventsDirty&&(t.clearEvents(),e=!0);t.sizeDirty=!1;t.eventsDirty=!1;a=e;!b.lazyFetching||q(t.visStart,t.visEnd)?j():a&&n();Z=d.outerWidth();G.updateTitle(t.title);a=new Date;a>=t.start&&a<t.end?G.disableButton("today"):G.enableButton("today");J--;t.trigger("viewDisplay",u)}}function Da(){ea();if(0!==u.offsetWidth)r(),p(),s(),
  t.clearEvents(),t.renderEvents(K),t.sizeDirty=!1}function ea(){a.each(R,function(a,b){b.sizeDirty=!0})}function r(){ba=b.contentHeight?b.contentHeight:b.height?b.height-(T?T.height():0)-va(A):Math.round(A.width()/Math.max(b.aspectRatio,0.5))}function p(a){J++;t.setHeight(ba,a);S&&(S.css("position","relative"),S=null);t.setWidth(A.width(),a);J--}function ua(){if(!J)if(t.start){var a=++L;setTimeout(function(){if(a==L&&!J&&0!==u.offsetWidth&&Z!=(Z=d.outerWidth()))J++,Da(),t.trigger("windowResize",u),
  J--},200)}else Q()}function j(){w(t.visStart,t.visEnd)}function n(a){m();if(0!==u.offsetWidth)t.clearEvents(),t.renderEvents(K,a),t.eventsDirty=!1}function m(){a.each(R,function(a,b){b.eventsDirty=!0})}function s(){t&&t.unselect()}var k=this;k.options=b;k.render=function(a){A?(r(),ea(),m(),D(a)):mb()};k.destroy=function(){a(window).unbind("resize",ua);G.destroy();A.remove();d.removeClass("fc fc-rtl ui-widget")};k.refetchEvents=j;k.reportEvents=function(a){K=a;n()};k.reportEventChange=function(a){n(a)};
  k.rerenderEvents=n;k.changeView=l;k.select=function(a,b,d){t.select(a,b,d===c?!0:d)};k.unselect=s;k.prev=function(){D(-1)};k.next=function(){D(1)};k.prevYear=function(){g(y,-1);D()};k.nextYear=function(){g(y,1);D()};k.today=function(){y=new Date;D()};k.gotoDate=function(a,b,d){a instanceof Date?y=o(a):x(y,a,b,d);D()};k.incrementDate=function(a,b,d){a!==c&&g(y,a);b!==c&&i(y,b);d!==c&&h(y,d);D()};k.formatDate=function(a,d){return F(a,d,b)};k.formatDates=function(a,d,c){return fa(a,d,c,b)};k.getDate=
  function(){return o(y)};k.getView=function(){return t};k.option=function(a,d){if(d===c)return b[a];if("height"==a||"contentHeight"==a||"aspectRatio"==a)b[a]=d,Da()};k.trigger=function(a,d){if(b[a])return b[a].apply(d||u,Array.prototype.slice.call(arguments,2))};f.call(k,b,z);var q=k.isFetchNeeded,w=k.fetchEvents,u=d[0],G,T,A,t,R={},Z,ba,S,L=0,J=0,y=new Date,K=[],v;x(y,b.year,b.month,b.date);b.droppable&&a(document).bind("dragstart",function(d,c){var e=d.target,B=a(e);if(!B.parents(".fc").length){var f=
  b.dropAccept;if(a.isFunction(f)?f.call(e,B):B.is(f))v=e,t.dragStart(v,d,c)}}).bind("dragstop",function(a,d){v&&(t.dragStop(v,a,d),v=null)})}function e(d,b){function c(e){var z=a("<td class='fc-header-"+e+"'/>");(e=b.header[e])&&a.each(e.split(" "),function(c){0<c&&z.append("<span class='fc-header-space'/>");var e;a.each(this.split(","),function(c,g){if("title"==g)z.append("<span class='fc-header-title'><h2>&nbsp;</h2></span>"),e&&e.addClass(f+"-corner-right"),e=null;else{var h;d[g]?h=d[g]:da[g]&&
  (h=function(){l.removeClass(f+"-state-hover");d.changeView(g)});if(h){var o=b.theme?Ja(b.buttonIcons,g):null,i=Ja(b.buttonText,g),l=a("<span class='fc-button fc-button-"+g+" "+f+"-state-default'><span class='fc-button-inner'><span class='fc-button-content'>"+(o?"<span class='fc-icon-wrap'><span class='ui-icon ui-icon-"+o+"'/></span>":i)+"</span><span class='fc-button-effect'><span></span></span></span></span>");l&&(l.click(function(){l.hasClass(f+"-state-disabled")||h()}).mousedown(function(){l.not("."+
  f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-down")}).mouseup(function(){l.removeClass(f+"-state-down")}).hover(function(){l.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-hover")},function(){l.removeClass(f+"-state-hover").removeClass(f+"-state-down")}).appendTo(z),e||l.addClass(f+"-corner-left"),e=l)}}});e&&e.addClass(f+"-corner-right")});return z}this.render=function(){f=b.theme?"ui":"fc";if(b.header)return e=a("<table class='fc-header' style='width:100%'/>").append(a("<tr/>").append(c("left")).append(c("center")).append(c("right")))};
  this.destroy=function(){e.remove()};this.updateTitle=function(a){e.find("h2").html(a)};this.activateButton=function(a){e.find("span.fc-button-"+a).addClass(f+"-state-active")};this.deactivateButton=function(a){e.find("span.fc-button-"+a).removeClass(f+"-state-active")};this.disableButton=function(a){e.find("span.fc-button-"+a).addClass(f+"-state-disabled")};this.enableButton=function(a){e.find("span.fc-button-"+a).removeClass(f+"-state-disabled")};var e=a([]),f}function f(d,b){function e(a,d){f(a,
  function(b){if(d==v){if(b){for(var c=0;c<b.length;c++)b[c].source=a,l(b[c]);u=u.concat(b)}q--;q||j(u)}})}function f(b,c){var e,z=W.sourceFetchers,g;for(e=0;e<z.length;e++){g=z[e](b,s,x,c);if(!0===g)return;if("object"==typeof g){f(g,c);return}}if(e=b.events)a.isFunction(e)?(h(),e(o(s),o(x),function(a){c(a);i()})):a.isArray(e)?c(e):c();else if(b.url){var lb=b.success,l=b.error,Q=b.complete;e=a.extend({},b.data||{});z=wa(b.startParam,d.startParam);g=wa(b.endParam,d.endParam);z&&(e[z]=Math.round(+s/1E3));
  g&&(e[g]=Math.round(+x/1E3));h();a.ajax(a.extend({},ob,b,{data:e,success:function(b){var b=b||[],d=Ea(lb,this,arguments);a.isArray(d)&&(b=d);c(b)},error:function(){Ea(l,this,arguments);c()},complete:function(){Ea(Q,this,arguments);i()}}))}else c()}function g(b){a.isFunction(b)||a.isArray(b)?b={events:b}:"string"==typeof b&&(b={url:b});if("object"==typeof b){var d=b;if(d.className){if("string"==typeof d.className)d.className=d.className.split(/\s+/)}else d.className=[];for(var c=W.sourceNormalizers,
  e=0;e<c.length;e++)c[e](d);m.push(b);return b}}function h(){w++||r("loading",null,!0)}function i(){--w||r("loading",null,!1)}function l(a){var b=a.source||{},e=wa(b.ignoreTimezone,d.ignoreTimezone);a._id=a._id||(a.id===c?"_fc"+pb++:a.id+"");if(a.date){if(!a.start)a.start=a.date;delete a.date}a._start=o(a.start=k(a.start,e));a.end=k(a.end,e);if(a.end&&a.end<=a.start)a.end=null;a._end=a.end?o(a.end):null;if(a.allDay===c)a.allDay=wa(b.allDayDefault,d.allDayDefault);if(a.className){if("string"==typeof a.className)a.className=
  a.className.split(/\s+/)}else a.className=[]}function ea(a){return("object"==typeof a?a.events||a.url:"")||a}this.isFetchNeeded=function(a,b){return!s||a<s||b>x};this.fetchEvents=function(a,b){s=a;x=b;u=[];var d=++v,c=m.length;q=c;for(var B=0;B<c;B++)e(m[B],d)};this.addEventSource=function(a){if(a=g(a))q++,e(a,v)};this.removeEventSource=function(b){m=a.grep(m,function(a){return!(a&&b&&ea(a)==ea(b))});u=a.grep(u,function(a){return!(a.source&&b&&ea(a.source)==ea(b))});j(u)};this.updateEvent=function(a){var b,
  d=u.length,c,e=p().defaultEventEnd,B=a.start-a._start,f=a.end?a.end-(a._end||e(a)):0;for(b=0;b<d;b++)if(c=u[b],c._id==a._id&&c!=a)c.start=new Date(+c.start+B),c.end=a.end?c.end?new Date(+c.end+f):new Date(+e(c)+f):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,l(c);l(a);j(u)};this.renderEvent=function(a,b){l(a);if(!a.source){if(b)n.events.push(a),
  a.source=n;u.push(a)}j(u)};this.removeEvents=function(b){if(b){if(!a.isFunction(b))var d=b+"",b=function(a){return a._id==d};u=a.grep(u,b,!0);for(c=0;c<m.length;c++)if(a.isArray(m[c].events))m[c].events=a.grep(m[c].events,b,!0)}else{u=[];for(var c=0;c<m.length;c++)if(a.isArray(m[c].events))m[c].events=[]}j(u)};this.clientEvents=function(b){if(a.isFunction(b))return a.grep(u,b);return b?(b+="",a.grep(u,function(a){return a._id==b})):u};this.normalizeEvent=l;for(var r=this.trigger,p=this.getView,j=
  this.reportEvents,n={events:[]},m=[n],s,x,v=0,q=0,w=0,u=[],G=0;G<b.length;G++)g(b[G])}function g(a,b,d){a.setFullYear(a.getFullYear()+b);d||m(a);return a}function i(a,b,d){if(+a){var b=a.getMonth()+b,c=o(a);c.setDate(1);c.setMonth(b);a.setMonth(b);for(d||m(a);a.getMonth()!=c.getMonth();)a.setDate(a.getDate()+(a<c?1:-1))}return a}function h(a,b,d){if(+a){var b=a.getDate()+b,c=o(a);c.setHours(9);c.setDate(b);a.setDate(b);d||m(a);j(a,c)}return a}function j(a,b){if(+a)for(;a.getDate()!=b.getDate();)a.setTime(+a+
  (a<b?1:-1)*qb)}function l(a,b){a.setMinutes(a.getMinutes()+b);return a}function m(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a}function o(a,b){return b?m(new Date(+a)):new Date(+a)}function r(){var a=0,b;do b=new Date(1970,a++,1);while(b.getHours());return b}function n(a,b,d){for(b=b||1;!a.getDay()||d&&1==a.getDay()||!d&&6==a.getDay();)h(a,b);return a}function s(a,b){return Math.round((o(a,!0)-o(b,!0))/$a)}function x(a,b,d,e){b!==c&&b!=a.getFullYear()&&(a.setDate(1),
  a.setMonth(0),a.setFullYear(b));d!==c&&d!=a.getMonth()&&(a.setDate(1),a.setMonth(d));e!==c&&a.setDate(e)}function k(a,b){if("object"==typeof a)return a;if("number"==typeof a)return new Date(1E3*a);if("string"==typeof a){if(a.match(/^\d+(\.\d+)?$/))return new Date(1E3*parseFloat(a));b===c&&(b=!0);return v(a,b)||(a?new Date(a):null)}return null}function v(a,b){var d=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(!d)return null;var c=new Date(d[1],0,1);if(b||!d[13]){var e=new Date(d[1],0,1,9,0);d[3]&&(c.setMonth(d[3]-1),e.setMonth(d[3]-1));d[5]&&(c.setDate(d[5]),e.setDate(d[5]));j(c,e);d[7]&&c.setHours(d[7]);d[8]&&c.setMinutes(d[8]);d[10]&&c.setSeconds(d[10]);d[12]&&c.setMilliseconds(1E3*Number("0."+d[12]));j(c,e)}else c.setUTCFullYear(d[1],d[3]?d[3]-1:0,d[5]||1),c.setUTCHours(d[7]||0,d[8]||0,d[10]||0,d[12]?1E3*Number("0."+d[12]):0),d[14]&&(e=60*Number(d[16])+(d[18]?Number(d[18]):0),e*="-"==d[15]?1:-1,
  c=new Date(+c+6E4*e));return c}function C(a){if("number"==typeof a)return 60*a;if("object"==typeof a)return 60*a.getHours()+a.getMinutes();if(a=a.match(/(\d+)(?::(\d+))?\s*(\w+)?/)){var b=parseInt(a[1],10);a[3]&&(b%=12,"p"==a[3].toLowerCase().charAt(0)&&(b+=12));return 60*b+(a[2]?parseInt(a[2],10):0)}}function F(a,b,d){return fa(a,null,b,d)}function fa(a,b,d,c){var c=c||ca,e=a,f=b,g,h=d.length,o,i,l,m="";for(g=0;g<h;g++)if(o=d.charAt(g),"'"==o)for(i=g+1;i<h;i++){if("'"==d.charAt(i)){e&&(m=i==g+1?
  m+"'":m+d.substring(g+1,i),g=i);break}}else if("("==o)for(i=g+1;i<h;i++){if(")"==d.charAt(i)){g=F(e,d.substring(g+1,i),c);parseInt(g.replace(/\D/,""),10)&&(m+=g);g=i;break}}else if("["==o)for(i=g+1;i<h;i++){if("]"==d.charAt(i)){o=d.substring(g+1,i);g=F(e,o,c);g!=F(f,o,c)&&(m+=g);g=i;break}}else if("{"==o)e=b,f=a;else if("}"==o)e=a,f=b;else{for(i=h;i>g;i--)if(l=rb[d.substring(g,i)]){e&&(m+=l(e,c));g=i-1;break}i==g&&e&&(m+=o)}return m}function O(a){var b;a.end?(b=a.end,a=a.allDay,b=o(b),b=a||b.getHours()||
  b.getMinutes()?h(b,1):m(b)):b=h(o(a.start),1);return b}function X(a,b){return 100*(b.msLength-a.msLength)+(a.event.start-b.event.start)}function xa(a,b,d,c){var e=[],f,g=a.length,h,i,l,m,j;for(f=0;f<g;f++)h=a[f],i=h.start,l=b[f],l>d&&i<c&&(i<d?(i=o(d),m=!1):m=!0,l>c?(l=o(c),j=!1):j=!0,e.push({event:h,start:i,end:l,isStart:m,isEnd:j,msLength:l-i}));return e.sort(X)}function Y(a){var b=[],d,c=a.length,e,f,g,h;for(d=0;d<c;d++){e=a[d];for(f=0;;){g=!1;if(b[f])for(h=0;h<b[f].length;h++)if(b[f][h].end>e.start&&
  b[f][h].start<e.end){g=!0;break}if(g)f++;else break}b[f]?b[f].push(e):b[f]=[e]}return b}function ya(b,d,e){b.unbind("mouseover").mouseover(function(b){for(var f=b.target,g;f!=this;)g=f,f=f.parentNode;if((f=g._fci)!==c)g._fci=c,g=d[f],e(g.event,g.element,g),a(b.target).trigger(b);b.stopPropagation()})}function za(b,d,c){for(var e=0,f;e<b.length;e++)f=a(b[e]),f.width(Math.max(0,d-(Ka(f)+La(f)+(c?Ma(f):0))))}function ab(b,d,c){for(var e=0,f;e<b.length;e++)f=a(b[e]),f.height(Math.max(0,d-va(f,c)))}function Ka(b){return(parseFloat(a.css(b[0],
  "paddingLeft",!0))||0)+(parseFloat(a.css(b[0],"paddingRight",!0))||0)}function Ma(b){return(parseFloat(a.css(b[0],"marginLeft",!0))||0)+(parseFloat(a.css(b[0],"marginRight",!0))||0)}function La(b){return(parseFloat(a.css(b[0],"borderLeftWidth",!0))||0)+(parseFloat(a.css(b[0],"borderRightWidth",!0))||0)}function va(b,d){return(parseFloat(a.css(b[0],"paddingTop",!0))||0)+(parseFloat(a.css(b[0],"paddingBottom",!0))||0)+((parseFloat(a.css(b[0],"borderTopWidth",!0))||0)+(parseFloat(a.css(b[0],"borderBottomWidth",
  !0))||0))+(d?bb(b):0)}function bb(b){return(parseFloat(a.css(b[0],"marginTop",!0))||0)+(parseFloat(a.css(b[0],"marginBottom",!0))||0)}function Ca(a,b){b="number"==typeof b?b+"px":b;a.each(function(a,d){d.style.cssText+=";min-height:"+b+";_height:"+b})}function Ya(){}function cb(a,b){return a-b}function ha(a){return(10>a?"0":"")+a}function Ja(a,b){if(a[b]!==c)return a[b];for(var d=b.split(/(?=[A-Z])/),e=d.length-1,f;0<=e;e--)if(f=a[d[e].toLowerCase()],f!==c)return f;return a[""]}function qa(a){return a.replace(/&/g,
  "&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")}function db(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function Fa(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function Ga(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}
  function Na(a,b){a.each(function(a,d){d.className=d.className.replace(/^fc-\w*/,"fc-"+sb[b.getDay()])})}function eb(a,b){var d=a.source||{},c=a.color,e=d.color,f=b("eventColor"),g=a.backgroundColor||c||d.backgroundColor||e||b("eventBackgroundColor")||f,c=a.borderColor||c||d.borderColor||e||b("eventBorderColor")||f,d=a.textColor||d.textColor||b("eventTextColor"),e=[];g&&e.push("background-color:"+g);c&&e.push("border-color:"+c);d&&e.push("color:"+d);return e.join(";")}function Ea(b,d,c){a.isFunction(b)&&
  (b=[b]);if(b){var e,f;for(e=0;e<b.length;e++)f=b[e].apply(d,c)||f;return f}}function wa(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==c)return arguments[a]}function tb(b,d,c){function e(b){var d=m(new Date),c;T.each(function(e,f){if(!p.curYear)p.curYear=p.start;var g=o(p.start);g.setFullYear(g.getFullYear(),e,1);g.setFullYear(g.getFullYear(),e,1-g.getDay());a(f).find("td").each(function(f,o){var i;c=a(o);g.getMonth()==e?(c.removeClass("fc-other-month"),i=F(g,"-yyyy-MM-dd")):(c.addClass("fc-other-month"),
  i=" ui-state-disabled");+g==+d&&g.getMonth()==e?c.addClass(E+"-state-highlight fc-today"):c.removeClass(E+"-state-highlight fc-today");var l=c.find("div.fc-day-number");l.text(g.getDate());var z=l.parent().parent();b||(l=z.attr("class").split(" "),a.each(l,function(a,b){-1!==b.indexOf("fc-day")&&z.removeClass(b);z.removeClass("ui-state-disabled")}));z.addClass(E+"-widget-content fc-day"+i);h(g,1)})});G.filter(".fc-year-have-event").removeClass("fc-year-have-event ui-state-default")}function f(a){if(n("selectable")){var b=
  this.className.search("fc-day-");-1!=b&&(b=this.className.substring(b+7,b+7+10),b=b.split("-"),b=new Date(parseInt(b[0],10),parseInt(b[1],10)-1,parseInt(b[2],10),0,0,0),k("reportDayClick",this,b,!0,a))}}function g(a,b,d){d&&J.build();for(var d=o(p.visStart),c=h(o(d),L),e=0;e<S;e++){var l=new Date(Math.max(d,a)),z=new Date(Math.min(c,b));if(l<z){var m;V?(m=s(z,d)*I+M+1,l=s(l,d)*I+M+1):(m=s(l,d),l=s(z,d));i(e,m,e,l-1).click(f)}h(d,7);h(c,7)}}function i(a,d,c,e){a=J.rect(a,d,c,e,b);return v(a,b)}function l(a){return{row:Math.floor(s(a,
  p.visStart)/7),col:r(a.getDay())}}function j(a){return h(o(p.visStart),7*a.row+a.col*I+M)}function r(a){return(a-Math.max(U,N)+L)%L*I+M}var p=this;p.renderYear=function(d,c,g,i){S=c;L=g;(V=n("isRTL"))?(I=-1,M=L-1):(I=1,M=0);U=n("firstDay");N=n("weekends")?0:1;E=n("theme")?"ui":"fc";n("columnFormat");if(d=!q){for(var g=E+"-widget-header",l=E+"-widget-content",z,m,j,r=o(p.start),ea=ca.dayNamesShortest,Da=ca.monthNames,c="<table class='fc-border-separate fc-year-main-table' style='width:100%'><tr >",
  k=0;12>k;k++){r.setFullYear(r.getFullYear(),k,1);r.setFullYear(r.getFullYear(),k,1-r.getDay());0==k%3&&0<k&&(c+="</tr><tr>");c+="<td class='fc-year-monthly-td ui-widget'>";c+="<table class='ui-widget' style='width:100%' cellspacing='0'><thead><tr><th colspan='7' class='fc-year-monthly-header "+g+"' style='height:18px'>"+Da[k]+"</th></tr><tr>";for(z=0;z<L;z++)c+="<th class='fc-year-month-weekly-head'>"+ea[z]+"</th>";c+="</tr></thead><tbody>";for(z=0;6>z;z++){c+="<tr class='ui-widget-content fc-week"+
  z+"'>";for(m=0;m<L;m++)j=r.getMonth()==k?F(r,"-yyyy-MM-dd"):"",c+="<td style='height:32px' class='fc- "+l+" fc-day"+j+"'><div>"+(i?"<div class='fc-day-number'/>":"")+"<div class='fc-day-content'></div></div></td>",h(r,1);c+="</tr>"}c+="</tbody></table>";c+="</td>"}q=a(c+"</tr></table>").appendTo(b);w=q.find("thead");u=w.find("th");T=q.find("table");G=q.find("table tr td");G.click(f);t=a("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(b)}else x();e(d)};p.setHeight=function(a){Z=
  a;a=Z-w.height();q.parent().height(a).css("overflow-y","auto")};p.setWidth=function(){};p.renderDayOverlay=g;p.defaultSelectionEnd=function(a){return o(a)};p.renderSelection=function(a,b){g(a,h(o(b),1),!0)};p.clearSelection=function(){C()};p.reportDayClick=function(a,b,d){var c=l(a);k("dayClick",A[c.row*L+c.col],a,b,d)};p.dragStart=function(a,b){y.start(function(a){C();a&&i(a.row,a.col,a.row,a.col)},b)};p.dragStop=function(a,b,d){var c=y.stop();C();c&&(c=j(c),k("drop",a,c,!0,b,d))};p.defaultEventEnd=
  function(a){return o(a.start)};p.getHoverListener=function(){return y};p.colContentLeft=function(a){return K.left(a)};p.colContentRight=function(a){return K.right(a)};p.dayOfWeekCol=r;p.dateCell=l;p.cellDate=j;p.cellIsAllDay=function(){return!0};p.allDayRow=function(a){return G.eq(a)};p.allDayBounds=function(){return{left:0,right:R}};p.getRowCnt=function(){return S};p.getColCnt=function(){return L};p.getColWidth=function(){return ba};p.getBodyRows=function(){return G};p.getDaySegmentContainer=function(){return t};
  Oa.call(p,b,d,c);Pa.call(p);Qa.call(p);ub.call(p);var n=p.opt,k=p.trigger,x=p.clearEvents,v=p.renderOverlay,C=p.clearOverlays,F=d.formatDate,q,w,u,G,T,A,t,R,Z,ba,S,L,J,y,K,V,I,M,U,N,E;Fa(b.addClass("fc-grid"));J=new Ra(function(b,d){var c,e,f;u.each(function(b,g){c=a(g);e=c.offset().left;b&&(f[1]=e);f=[e];d[b]=f});f[1]=e+c.outerWidth();G.each(function(d,g){if(d<S)c=a(g),e=c.offset().top,d&&(f[1]=e),f=[e],b[d]=f});f[1]=e+c.outerHeight()});y=new Sa(J);K=new Ta(function(a){return bodyCellTopInners.eq(a)})}
  function ub(){function b(d){var e=o(c.visStart),f=o(c.visEnd),g,h,i=[];g=a.map(d,O);h=[];var l,m=d.length,r,j,B,n,p;for(l=0;l<m;l++)r=d[l],j=r.start,B=g[l],B>e&&j<f&&(j<e?(j=o(e),n=!1):n=!0,B>f?(B=o(f),p=!1):p=!0,h.push({event:r,start:j,end:B,isStart:n,isEnd:p,msLength:B-j}));e=h.sort(X);d=[];g=e.length;for(f=0;f<g;f++){h=e[f];for(l=0;;){m=!1;if(d[l])for(r=0;r<d[l].length;r++)if(d[l][r].end>h.start&&d[l][r].start<h.end){m=!0;break}if(m)l++;else break}d[l]?d[l].push(h):d[l]=[h]}for(e=0;e<d.length;e++){f=
  d[e];for(g=0;g<f.length;g++)h=f[g],h.row=void 0,h.level=e,i.push(h)}return i}function d(a,b){var c=x(),g;b.draggable({zIndex:9,delay:50,opacity:e("dragOpacity"),revertDuration:e("dragRevertDuration"),start:function(d,i){f("eventDragStart",b,a,d,i);n(a,b);c.start(function(d,c,f,i){b.draggable("option","revert",!d||!f&&!i);C();d?(g=7*f+i*(e("isRTL")?-1:1),v(h(o(a.start),g),h(O(a),g))):g=0},d,"drag")},stop:function(d,e){c.stop();C();f("eventDragStop",b,a,d,e);g?k(this,a,g,0,a.allDay,d,e):(b.css("filter",
  ""),j(a,b))}})}var c=this;c.renderEvents=function(d){l(d);d=b(d);try{var c=q();a("div.fc-day-content",c).html("");c.filter("td.fc-year-have-event").removeClass("fc-year-have-event ui-state-default");for(var e,f=0;f<d.length;f++)for(var g=o(d[f].start);g.getTime()<d[f].end.getTime();){e=c.filter(".fc-day-"+F(d[f].start,"yyyy-MM-dd"));e.addClass("fc-year-have-event ui-state-default");var i=a("div.fc-day-content",e).html();""!=a.trim(i)?a("div.fc-day-content",e).html(parseInt(i)+1):a("div.fc-day-content",
  e).html("1");h(g,1)}}catch(z){alert("MyrenderDaySegs:"+z)}};c.compileDaySegs=b;c.clearEvents=function(){m();s().empty()};c.bindDaySeg=function(a,b,c){g(a)&&d(a,b);c.isEnd&&i(a)&&w(a,b,c);r(a,b)};Ua.call(c);var e=c.opt,f=c.trigger,g=c.isEventDraggable,i=c.isEventResizable,l=c.reportEvents,m=c.reportEventClear,r=c.eventElementHandlers,j=c.showEvents,n=c.hideEvents,k=c.eventDrop,s=c.getDaySegmentContainer,x=c.getHoverListener,v=c.renderDayOverlay,C=c.clearOverlays,q=c.getBodyRows,w=c.resizableDayEvent}
  function Va(b,d,c){function e(b){var d=b||1==y,c=k.start.getMonth(),f=m(new Date),g,h,i;d&&G.each(function(b,d){g=a(d);h=j(b);g.html(w(h,$));Na(g,h)});t.each(function(b,e){g=a(e);h=j(b);h.getMonth()==c?g.removeClass("fc-other-month"):g.addClass("fc-other-month");+h==+f?g.addClass(H+"-state-highlight fc-today"):g.removeClass(H+"-state-highlight fc-today");g.find("div.fc-day-number").text(h.getDate());d&&Na(g,h)});A.each(function(b,d){i=a(d);b<y?(i.show(),b==y-1?i.addClass("fc-last"):i.removeClass("fc-last")):
  i.hide()})}function f(a){if(!x("selectable")){var b=parseInt(this.className.match(/fc\-day(\d+)/)[1]),b=j(b);v("dayClick",this,b,!0,a)}}function g(a,b,d){d&&V.build();for(var d=o(k.visStart),c=h(o(d),K),e=0;e<y;e++){var l=new Date(Math.max(d,a)),z=new Date(Math.min(c,b));if(l<z){var m;U?(m=s(z,d)*N+E+1,l=s(l,d)*N+E+1):(m=s(l,d),l=s(z,d));i(e,m,e,l-1).click(f).mousedown(q)}h(d,7);h(c,7)}}function i(a,d,c,e){a=V.rect(a,d,c,e,b);return F(a,b)}function l(a){return{row:Math.floor(s(a,k.visStart)/7),col:n(a.getDay())}}
  function r(a){return h(o(k.visStart),7*a.row+a.col*N+E)}function j(a){return h(o(k.visStart),7*Math.floor(a/K)+a%K*N+E)}function n(a){return(a-Math.max(P,ia)+K)%K*N+E}var k=this;k.renderBasic=function(d,c,g,h){y=c;K=g;(U=x("isRTL"))?(N=-1,E=K-1):(N=1,E=0);P=x("firstDay");ia=x("weekends")?0:1;H=x("theme")?"ui":"fc";$=x("columnFormat");if(c=!T){var i=H+"-widget-header",l=H+"-widget-content",o,g="<table class='fc-border-separate' style='width:100%' cellspacing='0'><thead><tr>";for(o=0;o<K;o++)g+="<th class='fc- "+
  i+"'/>";g+="</tr></thead><tbody>";for(o=0;o<d;o++){g+="<tr class='fc-week"+o+"'>";for(i=0;i<K;i++)g+="<td class='fc- "+l+" fc-day"+(o*K+i)+"'><div>"+(h?"<div class='fc-day-number'/>":"")+"<div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";g+="</tr>"}d=a(g+"</tbody></table>").appendTo(b);u=d.find("thead");G=u.find("th");T=d.find("tbody");A=T.find("tr");t=T.find("td");R=t.filter(":first-child");Z=A.eq(0).find("div.fc-day-content div");Ga(u.add(u.find("tr")));Ga(A);
  A.eq(0).addClass("fc-first");t.click(f).mousedown(q);ba=a("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(b)}else C();e(c)};k.setHeight=function(b){L=b;var b=L-u.height(),d,c,e;"variable"==x("weekMode")?d=c=Math.floor(b/(1==y?2:6)):(d=Math.floor(b/y),c=b-d*(y-1));R.each(function(b,f){b<y&&(e=a(f),Ca(e.find("> div"),(b==y-1?c:d)-va(e)))})};k.setWidth=function(a){S=a;M.clear();J=Math.floor(S/K);za(G.slice(0,-1),J)};k.renderDayOverlay=g;k.defaultSelectionEnd=function(a){return o(a)};
  k.renderSelection=function(a,b){g(a,h(o(b),1),!0)};k.clearSelection=function(){ja()};k.reportDayClick=function(a,b,d){var c=l(a);v("dayClick",t[c.row*K+c.col],a,b,d)};k.dragStart=function(a,b){I.start(function(a){ja();a&&i(a.row,a.col,a.row,a.col)},b)};k.dragStop=function(a,b,d){var c=I.stop();ja();c&&(c=r(c),v("drop",a,c,!0,b,d))};k.defaultEventEnd=function(a){return o(a.start)};k.getHoverListener=function(){return I};k.colContentLeft=function(a){return M.left(a)};k.colContentRight=function(a){return M.right(a)};
  k.dayOfWeekCol=n;k.dateCell=l;k.cellDate=r;k.cellIsAllDay=function(){return!0};k.allDayRow=function(a){return A.eq(a)};k.allDayBounds=function(){return{left:0,right:S}};k.getRowCnt=function(){return y};k.getColCnt=function(){return K};k.getColWidth=function(){return J};k.getDaySegmentContainer=function(){return ba};Oa.call(k,b,d,c);Pa.call(k);Qa.call(k);vb.call(k);var x=k.opt,v=k.trigger,C=k.clearEvents,F=k.renderOverlay,ja=k.clearOverlays,q=k.daySelectionMousedown,w=d.formatDate,u,G,T,A,t,R,Z,ba,
  S,L,J,y,K,V,I,M,U,N,E,P,ia,H,$;Fa(b.addClass("fc-grid"));V=new Ra(function(b,d){var c,e,f;G.each(function(b,g){c=a(g);e=c.offset().left;b&&(f[1]=e);f=[e];d[b]=f});f[1]=e+c.outerWidth();A.each(function(d,g){if(d<y)c=a(g),e=c.offset().top,d&&(f[1]=e),f=[e],b[d]=f});f[1]=e+c.outerHeight()});I=new Sa(V);M=new Ta(function(a){return Z.eq(a)})}function vb(){function b(d){var e=q(),f=w(),g=o(c.visStart),f=h(o(g),f),i=a.map(d,O),l,m,k,r,j,n,B=[];for(l=0;l<e;l++){m=Y(xa(d,i,g,f));for(k=0;k<m.length;k++){r=
  m[k];for(j=0;j<r.length;j++)n=r[j],n.row=l,n.level=k,B.push(n)}h(g,7);h(f,7)}return B}function d(a,b){var c=x(),g;b.draggable({zIndex:9,delay:50,opacity:e("dragOpacity"),revertDuration:e("dragRevertDuration"),start:function(d,i){f("eventDragStart",b,a,d,i);j(a,b);c.start(function(d,c,f,i){b.draggable("option","revert",!d||!f&&!i);C();d?(g=7*f+i*(e("isRTL")?-1:1),v(h(o(a.start),g),h(O(a),g))):g=0},d,"drag")},stop:function(d,e){c.stop();C();f("eventDragStop",b,a,d,e);g?n(this,a,g,0,a.allDay,d,e):(b.css("filter",
  ""),r(a,b))}})}var c=this;c.renderEvents=function(a,d){l(a);u(b(a),d)};c.compileDaySegs=b;c.clearEvents=function(){m();s().empty()};c.bindDaySeg=function(a,b,c){g(a)&&d(a,b);c.isEnd&&i(a)&&G(a,b,c);k(a,b)};Ua.call(c);var e=c.opt,f=c.trigger,g=c.isEventDraggable,i=c.isEventResizable,l=c.reportEvents,m=c.reportEventClear,k=c.eventElementHandlers,r=c.showEvents,j=c.hideEvents,n=c.eventDrop,s=c.getDaySegmentContainer,x=c.getHoverListener,v=c.renderDayOverlay,C=c.clearOverlays,q=c.getRowCnt,w=c.getColCnt,
  u=c.renderDaySegs,G=c.resizableDayEvent}function jb(b,d,e){function f(){function a(){H.scrollTop(c)}var b=r(),d=o(b);d.setHours(w("firstHour"));var c=ka(b,d)+1;a();setTimeout(a,0)}function g(a){if(!w("selectable")){var b=Math.min(aa-1,Math.floor((a.pageX-L.offset().left-ma)/Ha)),d=x(b),c=this.parentNode.className.match(/fc-slot(\d+)/);c?(c=parseInt(c[1])*w("slotMinutes"),d.setHours(Math.floor(c/60)),d.setMinutes(c%60+na),u("dayClick",V[b],d,!1,a)):u("dayClick",V[b],d,!0,a)}}function i(a,b,d){d&&oa.build();
  var c=o(q.visStart);da?(d=s(b,c)*X+Y+1,a=s(a,c)*X+Y+1):(d=s(a,c),a=s(b,c));d=Math.max(0,d);a=Math.min(aa,a);d<a&&k(0,d,0,a-1).click(g).mousedown(Z)}function k(a,b,d,c){a=oa.rect(a,b,d,c,N);return T(a,N)}function j(a,b){for(var d=o(q.visStart),c=h(o(d),1),e=0;e<aa;e++){var f=new Date(Math.max(d,a)),i=new Date(Math.min(c,b));if(f<i){var l=e*X+Y,l=oa.rect(0,l,0,l,$),f=ka(d,f),i=ka(d,i);l.top=f;l.height=i-f;T(l,$).click(g).mousedown(O)}h(d,1);h(c,1)}}function n(a){var b=x(a.col),a=a.row;w("allDaySlot")&&
  a--;0<=a&&l(b,na+a*w("slotMinutes"));return b}function x(a){return h(o(q.visStart),a*X+Y)}function p(a){return w("allDaySlot")&&!a.row}function v(a){return(a-Math.max(ya,fa)+aa)%aa*X+Y}function ka(a,b){a=o(a,!0);if(b<l(o(a),na))return 0;if(b>=l(o(a),ca))return la.height();var d=w("slotMinutes"),e=60*b.getHours()+b.getMinutes()-na,f=Math.floor(e/d),g=W[f];if(g===c)g=W[f]=la.find("tr:eq("+f+") td div")[0].offsetTop;return Math.max(0,Math.round(g-1+Aa*(e%d/d)))}function F(b,d){var c=w("selectHelper");
  oa.build();if(c){var e=s(b,q.visStart)*X+Y;if(0<=e&&e<aa){var e=oa.rect(0,e,0,e,$),f=ka(b,b),h=ka(b,d);if(h>f){e.top=f;e.height=h-f;e.left+=2;e.width-=5;if(a.isFunction(c)){if(c=c(b,d))e.position="absolute",e.zIndex=8,ga=a(c).css(e).appendTo($)}else e.isStart=!0,e.isEnd=!0,ga=a(ba({title:"",start:b,end:d,className:["fc-select-helper"],editable:!1},e)),ga.css("opacity",w("dragOpacity"));ga&&(ga.click(g).mousedown(O),$.append(ga),za(ga,e.width,!0),ab(ga,e.height,!0))}}}else j(b,d)}function Za(){A();
  ga&&(ga.remove(),ga=null)}function O(b){if(1==b.which&&w("selectable")){R(b);var d;ta.start(function(a,b){Za();if(a&&a.col==b.col&&!p(a)){var c=n(b),e=n(a);d=[c,l(o(c),w("slotMinutes")),e,l(o(e),w("slotMinutes"))].sort(cb);F(d[0],d[3])}else d=null},b);a(document).one("mouseup",function(a){ta.stop();d&&(+d[0]==+d[1]&&ja(d[0],!1,a),t(d[0],d[3],!1,a))})}}function ja(a,b,d){u("dayClick",V[v(a.getDay())],a,b,d)}var q=this;q.renderAgenda=function(d){aa=d;Ba=w("theme")?"ui":"fc";fa=w("weekends")?0:1;ya=
  w("firstDay");(da=w("isRTL"))?(X=-1,Y=aa-1):(X=1,Y=0);na=C(w("minTime"));ca=C(w("maxTime"));ha=w("columnFormat");if(L)G();else{var d=Ba+"-widget-header",c=Ba+"-widget-content",e,f,h,i,k,j=0==w("slotMinutes")%15;e="<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'><thead><tr><th class='fc-agenda-axis "+d+"'>&nbsp;</th>";for(f=0;f<aa;f++)e+="<th class='fc- fc-col"+f+" "+d+"'/>";e+="<th class='fc-agenda-gutter "+d+"'>&nbsp;</th></tr></thead><tbody><tr><th class='fc-agenda-axis "+
  d+"'>&nbsp;</th>";for(f=0;f<aa;f++)e+="<td class='fc- fc-col"+f+" "+c+"'><div><div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";L=a(e+("<td class='fc-agenda-gutter "+c+"'>&nbsp;</td></tr></tbody></table>")).appendTo(b);J=L.find("thead");y=J.find("th").slice(1,-1);K=L.find("tbody");V=K.find("td").slice(0,-1);I=V.find("div.fc-day-content div");M=V.eq(0);U=M.find("> div");Ga(J.add(J.find("tr")));Ga(K.add(K.find("tr")));ra=J.find("th:first");sa=L.find(".fc-agenda-gutter");
  N=a("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(b);w("allDaySlot")?(E=a("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(N),e="<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='"+d+" fc-agenda-axis'>"+w("allDayText")+"</th><td><div class='fc-day-content'><div style='position:relative'/></div></td><th class='"+d+" fc-agenda-gutter'>&nbsp;</th></tr></table>",P=a(e).appendTo(N),ia=P.find("tr"),ia.find("td").click(g).mousedown(Z),
  ra=ra.add(P.find("th:first")),sa=sa.add(P.find("th.fc-agenda-gutter")),N.append("<div class='fc-agenda-divider "+d+"'><div class='fc-agenda-divider-inner'/></div>")):E=a([]);H=a("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(N);$=a("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(H);fb=a("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo($);e="<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>";
  h=r();i=l(o(h),ca);l(h,na);for(f=Wa=0;h<i;f++)k=h.getMinutes(),e+="<tr class='fc-slot"+f+" "+(!k?"":"fc-minor")+"'><th class='fc-agenda-axis "+d+"'>"+(!j||!k?S(h,w("axisFormat")):"&nbsp;")+"</th><td class='"+c+"'><div style='position:relative'>&nbsp;</div></td></tr>",l(h,w("slotMinutes")),Wa++;la=a(e+"</tbody></table>").appendTo($);gb=la.find("div:first");la.find("td").click(g).mousedown(O);ra=ra.add(la.find("th:first"))}h=m(new Date);for(d=0;d<aa;d++)f=x(d),c=y.eq(d),c.html(S(f,ha)),e=V.eq(d),+f==
  +h?e.addClass(Ba+"-state-highlight fc-today"):e.removeClass(Ba+"-state-highlight fc-today"),Na(c.add(e),f)};q.setWidth=function(b){hb=b;Ia.clear();ma=0;za(ra.width("").each(function(b,d){ma=Math.max(ma,a(d).outerWidth())}),ma);b=H[0].clientWidth;(Xa=H.width()-b)?(za(sa,Xa),sa.show().prev().removeClass("fc-last")):sa.hide().prev().addClass("fc-last");Ha=Math.floor((b-ma)/aa);za(y.slice(0,-1),Ha)};q.setHeight=function(a,b){a===c&&(a=ib);ib=a;W={};var d=K.position().top,e=H.position().top,g=Math.min(a-
  d,la.height()+e+1);U.height(g-va(M));N.css("top",d);H.height(g-e-1);Aa=gb.height()+1;b&&f()};q.beforeHide=function(){kb=H.scrollTop()};q.afterShow=function(){H.scrollTop(kb)};q.defaultEventEnd=function(a){var b=o(a.start);return a.allDay?b:l(b,w("defaultEventMinutes"))};q.timePosition=ka;q.dayOfWeekCol=v;q.dateCell=function(a){return{row:Math.floor(s(a,q.visStart)/7),col:v(a.getDay())}};q.cellDate=n;q.cellIsAllDay=p;q.allDayRow=function(){return ia};q.allDayBounds=function(){return{left:ma,right:hb-
  Xa}};q.getHoverListener=function(){return ta};q.colContentLeft=function(a){return Ia.left(a)};q.colContentRight=function(a){return Ia.right(a)};q.getDaySegmentContainer=function(){return E};q.getSlotSegmentContainer=function(){return fb};q.getMinMinute=function(){return na};q.getMaxMinute=function(){return ca};q.getBodyContent=function(){return $};q.getRowCnt=function(){return 1};q.getColCnt=function(){return aa};q.getColWidth=function(){return Ha};q.getSlotHeight=function(){return Aa};q.defaultSelectionEnd=
  function(a,b){return b?o(a):l(o(a),w("slotMinutes"))};q.renderDayOverlay=i;q.renderSelection=function(a,b,d){d?w("allDaySlot")&&i(a,h(o(b),1),!0):F(a,b)};q.clearSelection=Za;q.reportDayClick=ja;q.dragStart=function(a,b){ta.start(function(a){A();if(a)if(p(a))k(a.row,a.col,a.row,a.col);else{var a=n(a),b=l(o(a),w("defaultEventMinutes"));j(a,b)}},b)};q.dragStop=function(a,b,d){var c=ta.stop();A();c&&u("drop",a,n(c),p(c),b,d)};Oa.call(q,b,d,e);Pa.call(q);Qa.call(q);wb.call(q);var w=q.opt,u=q.trigger,G=
  q.clearEvents,T=q.renderOverlay,A=q.clearOverlays,t=q.reportSelection,R=q.unselect,Z=q.daySelectionMousedown,ba=q.slotSegHtml,S=d.formatDate,L,J,y,K,V,I,M,U,N,E,P,ia,H,$,fb,la,gb,ra,sa,ga,hb,ib,ma,Ha,Xa,Aa,kb,aa,Wa,oa,ta,Ia,W={},Ba,ya,fa,da,X,Y,na,ca,ha;Fa(b.addClass("fc-agenda"));oa=new Ra(function(b,d){var c,e,f;y.each(function(b,g){c=a(g);e=c.offset().left;b&&(f[1]=e);f=[e];d[b]=f});f[1]=e+c.outerWidth();if(w("allDaySlot"))c=ia,e=c.offset().top,b[0]=[e,e+c.outerHeight()];for(var g=$.offset().top,
  h=H.offset().top,i=h+H.outerHeight(),l=0;l<Wa;l++)b.push([Math.max(h,Math.min(i,g+Aa*l)),Math.max(h,Math.min(i,g+Aa*(l+1)))])});ta=new Sa(oa);Ia=new Ta(function(a){return I.eq(a)})}function wb(){function b(d){var d=Y(xa(d,a.map(d,O),k.visStart,k.visEnd)),c,e=d.length,f,g,h,i=[];for(c=0;c<e;c++){f=d[c];for(g=0;g<f.length;g++)h=f[g],h.row=0,h.level=c,i.push(h)}return i}function d(a){return a.end?o(a.end):l(o(a.start),j("defaultEventMinutes"))}function e(a,b){var d="<",c=a.url,f=eb(a,j),g=f?" style='"+
  f+"'":"",h=["fc-event","fc-event-skin","fc-event-vert"];n(a)&&h.push("fc-event-draggable");b.isStart&&h.push("fc-corner-top");b.isEnd&&h.push("fc-corner-bottom");h=h.concat(a.className);a.source&&(h=h.concat(a.source.className||[]));d=c?d+("a href='"+qa(a.url)+"'"):d+"div";d+=" class='"+h.join(" ")+"' style='position:absolute;z-index:8;top:"+b.top+"px;left:"+b.left+"px;"+f+"'><div class='fc-event-inner fc-event-skin'"+g+"><div class='fc-event-head fc-event-skin'"+g+"><div class='fc-event-time'>"+
  qa(H(a.start,a.end,j("timeFormat")))+"</div></div><div class='fc-event-content'><div class='fc-event-title'>"+qa(a.title)+"</div></div><div class='fc-event-bg'></div></div>";b.isEnd&&s(a)&&(d+="<div class='ui-resizable-handle ui-resizable-s'>=</div>");return d+("</"+(c?"a":"div")+">")}function f(a,b,d){var c=b.find("div.fc-event-time");n(a)&&i(a,b,c);d.isEnd&&s(a)&&m(a,b,c);F(a,b)}function g(a,b,d){function c(){i||(b.width(e).height("").draggable("option","grid",null),i=!0)}var e,f,i=!0,l,k=j("isRTL")?
  -1:1,m=u(),n=L(),z=J(),B=T();b.draggable({zIndex:9,opacity:j("dragOpacity","month"),revertDuration:j("dragRevertDuration"),start:function(g,B){r("eventDragStart",b,a,g,B);I(a,b);e=b.width();m.start(function(e,g,m,r){E();e?(f=!1,l=r*k,e.row?d?i&&(b.width(n-10),ab(b,z*Math.round((a.end?(a.end-a.start)/xb:j("defaultEventMinutes"))/j("slotMinutes"))),b.draggable("option","grid",[n,1]),i=!1):f=!0:(N(h(o(a.start),l),h(O(a),l)),c()),f=f||i&&!l):(c(),f=!0);b.draggable("option","revert",f)},g,"drag")},stop:function(d,
  e){m.stop();E();r("eventDragStop",b,a,d,e);if(f)c(),b.css("filter",""),V(a,b);else{var g=0;i||(g=Math.round((b.offset().top-y().offset().top)/z)*j("slotMinutes")+B-(60*a.start.getHours()+a.start.getMinutes()));M(this,a,l,g,i,d,e)}}})}function i(a,b,d){function c(b){var e=l(o(a.start),b),f;a.end&&(f=l(o(a.end),b));d.text(H(e,f,j("timeFormat")))}function e(){g&&(d.css("display",""),b.draggable("option","grid",[w,s]),g=!1)}var f,g=!1,k,m,n,z=j("isRTL")?-1:1,B=u(),p=S(),w=L(),s=J();b.draggable({zIndex:9,
  scroll:!1,grid:[w,s],axis:1==p?"y":!1,opacity:j("dragOpacity"),revertDuration:j("dragRevertDuration"),start:function(c,i){r("eventDragStart",b,a,c,i);I(a,b);f=b.position();m=n=0;B.start(function(c,f,i,l){b.draggable("option","revert",!c);E();c&&(k=l*z,j("allDaySlot")&&!c.row?(g||(g=!0,d.hide(),b.draggable("option","grid",null)),N(h(o(a.start),k),h(O(a),k))):e())},c,"drag")},drag:function(a,b){m=Math.round((b.position.top-f.top)/s)*j("slotMinutes");m!=n&&(g||c(m),n=m)},stop:function(d,h){var i=B.stop();
  E();r("eventDragStop",b,a,d,h);i&&(k||m||g)?M(this,a,k,g?0:m,g,d,h):(e(),b.css("filter",""),b.css(f),c(0),V(a,b))}})}function m(a,b,d){var c,e,f=J();b.resizable({handles:{s:"div.ui-resizable-s"},grid:f,start:function(d,f){c=e=0;I(a,b);b.css("z-index",9);r("eventResizeStart",this,a,d,f)},resize:function(g,h){c=Math.round((Math.max(f,b.height())-h.originalSize.height)/f);c!=e&&(d.text(H(a.start,!c&&!a.end?null:l(x(a),j("slotMinutes")*c),j("timeFormat"))),e=c)},stop:function(d,e){r("eventResizeStop",
  this,a,d,e);c?U(this,a,0,j("slotMinutes")*c,d,e):(b.css("z-index",8),V(a,b))}})}var k=this;k.renderEvents=function(g,i){v(g);var m,n=g.length,p=[],s=[];for(m=0;m<n;m++)g[m].allDay?p.push(g[m]):s.push(g[m]);j("allDaySlot")&&(Z(b(p),i),ja());var n=S(),p=T(),x=G(),u=l(o(k.visStart),p),q=a.map(s,d),E,D,I,Q,H,M;m=[];for(E=0;E<n;E++){I=D=Y(xa(s,q,u,l(o(u),x-p)));var N=M=H=Q=void 0,P=void 0,U=void 0;for(Q=I.length-1;0<Q;Q--){N=I[Q];for(H=0;H<N.length;H++){P=N[H];for(M=0;M<I[Q-1].length;M++)if(U=I[Q-1][M],
  P.end>U.start&&P.start<U.end)U.forward=Math.max(U.forward||0,(P.forward||0)+1)}}for(I=0;I<D.length;I++){Q=D[I];for(H=0;H<Q.length;H++)M=Q[H],M.col=E,M.level=I,m.push(M)}h(u,1,!0)}var s=m.length,pa,C,y;D="";x={};u={};E=w();n=S();(I=j("isRTL"))?(Q=-1,N=n-1):(Q=1,N=0);for(n=0;n<s;n++)p=m[n],q=p.event,H=A(p.start,p.start),M=A(p.start,p.end),pa=p.col,P=p.level,U=p.forward||0,C=t(pa*Q+N),y=R(pa*Q+N)-C,y=Math.min(y-6,0.95*y),pa=P?y/(P+U+1):U?2*(y/(U+1)-6):y,P=C+y/(P+U+1)*P*Q+(I?y-pa:0),p.top=H,p.left=P,
  p.outerWidth=pa,p.outerHeight=M-H,D+=e(q,p);E[0].innerHTML=D;I=E.children();for(n=0;n<s;n++)p=m[n],q=p.event,D=a(I[n]),Q=r("eventRender",q,q,D),!1===Q?D.remove():(Q&&!0!==Q&&(D.remove(),D=a(Q).css({position:"absolute",top:p.top,left:p.left}).appendTo(E)),p.element=D,q._id===i?f(q,D,p):D[0]._fci=n,K(q,D));ya(E,m,f);for(n=0;n<s;n++)if(p=m[n],D=p.element)if(E=x[q=p.key=db(D[0])],p.vsides=E===c?x[q]=va(D,!0):E,E=u[q],p.hsides=E===c?u[q]=Ka(D)+La(D)+Ma(D):E,q=D.find("div.fc-event-content"),q.length)p.contentTop=
  q[0].offsetTop;for(n=0;n<s;n++)if(p=m[n],D=p.element)D[0].style.width=Math.max(0,p.outerWidth-p.hsides)+"px",x=Math.max(0,p.outerHeight-p.vsides),D[0].style.height=x+"px",q=p.event,p.contentTop!==c&&10>x-p.contentTop&&(D.find("div.fc-event-time").text(ia(q.start,j("timeFormat"))+" - "+q.title),D.find("div.fc-event-title").remove()),r("eventAfterRender",q,q,D)};k.compileDaySegs=b;k.clearEvents=function(){C();q().empty();w().empty()};k.slotSegHtml=e;k.bindDaySeg=function(a,b,d){n(a)&&g(a,b,d.isStart);
  d.isEnd&&s(a)&&ba(a,b,d);F(a,b)};Ua.call(k);var j=k.opt,r=k.trigger,n=k.isEventDraggable,s=k.isEventResizable,x=k.eventEnd,v=k.reportEvents,C=k.reportEventClear,F=k.eventElementHandlers,ja=k.setHeight,q=k.getDaySegmentContainer,w=k.getSlotSegmentContainer,u=k.getHoverListener,G=k.getMaxMinute,T=k.getMinMinute,A=k.timePosition,t=k.colContentLeft,R=k.colContentRight,Z=k.renderDaySegs,ba=k.resizableDayEvent,S=k.getColCnt,L=k.getColWidth,J=k.getSlotHeight,y=k.getBodyContent,K=k.reportEventElement,V=k.showEvents,
  I=k.hideEvents,M=k.eventDrop,U=k.eventResize,N=k.renderDayOverlay,E=k.clearOverlays,P=k.calendar,ia=P.formatDate,H=P.formatDates}function Oa(a,b,d){function e(a,b){var c=q[a];return"object"==typeof c?Ja(c,b||d):c}function f(a,d){return b.trigger.apply(b,[a,d||j].concat(Array.prototype.slice.call(arguments,2),[j]))}function g(a){return wa(a.editable,(a.source||{}).editable,e("editable"))}function i(a){return a.end?o(a.end):r(a)}function k(a,b,d){var a=F[a._id],c,e=a.length;for(c=0;c<e;c++)if(!b||a[c][0]!=
  b[0])a[c][d]()}function m(a,b,d,e){for(var d=d||0,f,g=a.length,i=0;i<g;i++){f=a[i];if(e!==c)f.allDay=e;l(h(f.start,b,!0),d);if(f.end)f.end=l(h(f.end,b,!0),d);s(f,q)}}function n(a,b,d){for(var d=d||0,c,e=a.length,f=0;f<e;f++)c=a[f],c.end=l(h(i(c),b,!0),d),s(c,q)}var j=this;j.element=a;j.calendar=b;j.name=d;j.opt=e;j.trigger=f;j.isEventDraggable=function(a){return g(a)&&!e("disableDragging")};j.isEventResizable=function(a){return g(a)&&!e("disableResizing")};j.reportEvents=function(a){v={};var b,d=
  a.length,c;for(b=0;b<d;b++)c=a[b],v[c._id]?v[c._id].push(c):v[c._id]=[c]};j.eventEnd=i;j.reportEventElement=function(a,b){C.push(b);F[a._id]?F[a._id].push(b):F[a._id]=[b]};j.reportEventClear=function(){C=[];F={}};j.eventElementHandlers=function(a,b){b.click(function(d){if(!b.hasClass("ui-draggable-dragging")&&!b.hasClass("ui-resizable-resizing"))return f("eventClick",this,a,d)}).hover(function(b){f("eventMouseover",this,a,b)},function(b){f("eventMouseout",this,a,b)})};j.showEvents=function(a,b){k(a,
  b,"show")};j.hideEvents=function(a,b){k(a,b,"hide")};j.eventDrop=function(a,b,d,c,e,g,h){var i=b.allDay,l=b._id;m(v[l],d,c,e);f("eventDrop",a,b,d,c,e,function(){m(v[l],-d,-c,i);x(l)},g,h);x(l)};j.eventResize=function(a,b,d,c,e,g){var h=b._id;n(v[h],d,c);f("eventResize",a,b,d,c,function(){n(v[h],-d,-c);x(h)},e,g);x(h)};var r=j.defaultEventEnd,s=b.normalizeEvent,x=b.reportEventChange,v={},C=[],F={},q=b.options}function Ua(){function b(a){var d=m("isRTL"),c,e=a.length,f,g,h,i;c=O();var l=c.left,j=c.right,
  o,k,n,z,p,B="";for(c=0;c<e;c++)f=a[c],g=f.event,i=["fc-event","fc-event-skin","fc-event-hori"],r(g)&&i.push("fc-event-draggable"),d?(f.isStart&&i.push("fc-corner-right"),f.isEnd&&i.push("fc-corner-left"),o=R(f.end.getDay()-1),k=R(f.start.getDay()),n=f.isEnd?A(o):l,z=f.isStart?t(k):j):(f.isStart&&i.push("fc-corner-left"),f.isEnd&&i.push("fc-corner-right"),o=R(f.start.getDay()),k=R(f.end.getDay()-1),n=f.isStart?A(o):l,z=f.isEnd?t(k):j),i=i.concat(g.className),g.source&&(i=i.concat(g.source.className||
  [])),h=g.url,p=eb(g,m),B=h?B+("<a href='"+qa(h)+"'"):B+"<div",B+=" class='"+i.join(" ")+"' style='position:absolute;z-index:8;left:"+n+"px;"+p+"'><div class='fc-event-inner fc-event-skin'"+(p?" style='"+p+"'":"")+">",!g.allDay&&f.isStart&&(B+="<span class='fc-event-time'>"+qa(J(g.start,g.end,m("timeFormat")))+"</span>"),B+="<span class='fc-event-title'>"+qa(g.title)+"</span></div>",f.isEnd&&s(g)&&(B+="<div class='ui-resizable-handle ui-resizable-"+(d?"w":"e")+"'>&nbsp;&nbsp;&nbsp;</div>"),B+="</"+
  (h?"a":"div")+">",f.left=n,f.outerWidth=z-n,f.startCol=o,f.endCol=k+1;return B}function d(b,c){var e,f=b.length,g,h,i;for(e=0;e<f;e++)g=b[e],h=g.event,i=a(c[e]),h=n("eventRender",h,h,i),!1===h?i.remove():(h&&!0!==h&&(h=a(h).css({position:"absolute",left:g.left}),i.replaceWith(h),i=h),g.element=i)}function e(a){var b,d=a.length,f,g,h,i,l={};for(b=0;b<d;b++)if(f=a[b],g=f.element)h=f.key=db(g[0]),i=l[h],i===c&&(i=l[h]=Ka(g)+La(g)+Ma(g)),f.hsides=i}function f(a){var b,d=a.length,c,e;for(b=0;b<d;b++)if(c=
  a[b],e=c.element)e[0].style.width=Math.max(0,c.outerWidth-c.hsides)+"px"}function g(a){var b,d=a.length,e,f,h,i,l={};for(b=0;b<d;b++)if(e=a[b],f=e.element)h=e.key,i=l[h],i===c&&(i=l[h]=bb(f)),e.outerHeight=f[0].offsetHeight+i}function i(){var a,b=w(),d=[];for(a=0;a<b;a++)d[a]=G(a).find("td:first div.fc-day-content > div");return d}function l(a){var b,d=a.length,c=[];for(b=0;b<d;b++)c[b]=a[b][0].offsetTop;return c}function k(a,b){var d,c=a.length,e,f;for(d=0;d<c;d++)if(e=a[d],f=e.element)f[0].style.top=
  b[e.row]+(e.top||0)+"px",e=e.event,n("eventAfterRender",e,e,f)}var j=this;j.renderDaySegs=function(a,c){var h=S(),o=w(),j=u(),m=0,n,r,p,s=a.length,x,q;h[0].innerHTML=b(a);d(a,h.children());r=a.length;for(n=0;n<r;n++)p=a[n],(q=p.element)&&v(p.event,q);r=a.length;var t;for(n=0;n<r;n++)if(p=a[n],q=p.element)t=p.event,t._id===c?L(t,q,p):q[0]._fci=n;ya(h,a,L);e(a);f(a);g(a);h=i();for(n=0;n<o;n++){r=[];for(p=0;p<j;p++)r[p]=0;for(;m<s&&(x=a[m]).row==n;){p=r.slice(x.startCol,x.endCol);p=Math.max.apply(Math,
  p);x.top=p;p+=x.outerHeight;for(q=x.startCol;q<x.endCol;q++)r[q]=p;m++}h[n].height(Math.max.apply(Math,r))}k(a,l(h))};j.resizableDayEvent=function(c,r,s){var v=m("isRTL"),t=v?"w":"e",A=r.find("div.ui-resizable-"+t),G=!1;Fa(r);r.mousedown(function(a){a.preventDefault()}).click(function(a){G&&(a.preventDefault(),a.stopImmediatePropagation())});A.mousedown(function(m){if(1==m.which){G=!0;var A=j.getHoverListener(),nb=w(),J=u(),L=v?-1:1,ua=v?J-1:0,ka=r.css("top"),O,P,T=a.extend({},c),R=W(c.start);V();
  a("body").css("cursor",t+"-resize").one("mouseup",function(b){n("eventResizeStop",this,c,b);a("body").css("cursor","");A.stop();K();O&&q(this,c,O,0,b);setTimeout(function(){G=!1},0)});n("eventResizeStart",this,c,m);A.start(function(j,n){if(j){var m=Math.max(R.row,j.row),r=j.col;1==nb&&(m=0);m==R.row&&(r=v?Math.min(R.col,r):Math.max(R.col,r));O=7*m+r*L+ua-(7*n.row+n.col*L+ua);m=h(x(c),O,!0);if(O){T.end=m;var r=P,p=X([T]),q=s.row,u=a("<div/>"),w=S(),ea=p.length,A;u[0].innerHTML=b(p);u=u.children();
  w.append(u);d(p,u);e(p);f(p);g(p);k(p,l(i()));u=[];for(w=0;w<ea;w++)if(A=p[w].element)p[w].row===q&&A.css("top",ka),u.push(A[0]);P=a(u);P.find("*").css("cursor",t+"-resize");r&&r.remove();F(c)}else P&&(C(c),P.remove(),P=null);K();y(c.start,h(o(m),1))}},m)}})};var m=j.opt,n=j.trigger,r=j.isEventDraggable,s=j.isEventResizable,x=j.eventEnd,v=j.reportEventElement,C=j.showEvents,F=j.hideEvents,q=j.eventResize,w=j.getRowCnt,u=j.getColCnt,G=j.allDayRow,O=j.allDayBounds,A=j.colContentLeft,t=j.colContentRight,
  R=j.dayOfWeekCol,W=j.dateCell,X=j.compileDaySegs,S=j.getDaySegmentContainer,L=j.bindDaySeg,J=j.calendar.formatDates,y=j.renderDayOverlay,K=j.clearOverlays,V=j.clearSelection}function Qa(){function b(a){l&&(l=!1,i(),f("unselect",null,a))}function d(a,b,c,e){l=!0;f("select",null,a,b,c,e)}var c=this;c.select=function(a,c,e){b();c||(c=g(a,e));h(a,c,e);d(a,c,e)};c.unselect=b;c.reportSelection=d;c.daySelectionMousedown=function(f){var g=c.cellDate,l=c.cellIsAllDay,j=c.getHoverListener(),o=c.reportDayClick;
  if(1==f.which&&e("selectable")){b(f);var k;j.start(function(a,b){i();a&&l(a)?(k=[g(b),g(a)].sort(cb),h(k[0],k[1],!0)):k=null},f);a(document).one("mouseup",function(a){j.stop();k&&(+k[0]==+k[1]&&o(k[0],!0,a),d(k[0],k[1],!0,a))})}};var e=c.opt,f=c.trigger,g=c.defaultSelectionEnd,h=c.renderSelection,i=c.clearSelection,l=!1;e("selectable")&&e("unselectAuto")&&a(document).mousedown(function(d){var c=e("unselectCancel");(!c||!a(d.target).parents(c).length)&&b(d)})}function Pa(){this.renderOverlay=function(c,
  e){var f=d.shift();f||(f=a("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>"));f[0].parentNode!=e[0]&&f.appendTo(e);b.push(f.css(c).show());return f};this.clearOverlays=function(){for(var a;a=b.shift();)d.push(a.hide().unbind())};var b=[],d=[]}function Ra(a){var b,d;this.build=function(){b=[];d=[];a(b,d)};this.cell=function(a,c){var e=b.length,f=d.length,g,h=-1,i=-1;for(g=0;g<e;g++)if(c>=b[g][0]&&c<b[g][1]){h=g;break}for(g=0;g<f;g++)if(a>=d[g][0]&&a<d[g][1]){i=g;break}return 0<=
  h&&0<=i?{row:h,col:i}:null};this.rect=function(a,c,e,f,g){g=g.offset();return{top:b[a][0]-g.top,left:d[c][0]-g.left,width:d[f][1]-d[c][0],height:b[e][1]-b[a][0]}}}function Sa(b){function d(a){if(a.pageX===c)a.pageX=a.originalEvent.pageX,a.pageY=a.originalEvent.pageY;a=b.cell(a.pageX,a.pageY);if(!a!=!h||a&&(a.row!=h.row||a.col!=h.col))a?(g||(g=a),f(a,g,a.row-g.row,a.col-g.col)):f(a,g),h=a}var e,f,g,h;this.start=function(c,i,l){f=c;g=h=null;b.build();d(i);e=l||"mousemove";a(document).bind(e,d)};this.stop=
  function(){a(document).unbind(e,d);return h}}function Ta(a){var b=this,d={},e={},f={};b.left=function(b){return e[b]=e[b]===c?(d[b]=d[b]||a(b)).position().left:e[b]};b.right=function(e){return f[e]=f[e]===c?b.left(e)+(d[e]=d[e]||a(e)).width():f[e]};b.clear=function(){d={};e={};f={}}}var ca={defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,allDayDefault:!0,ignoreTimezone:!0,lazyFetching:!0,startParam:"start",endParam:"end",titleFormat:{year:"yyyy",
  month:"MMMM yyyy",week:"MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{year:"MMMM",month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:!1,firstDay:0,monthNames:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthNamesShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),dayNames:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),dayNamesShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),
  dayNamesShortest:"S,M,T,W,T,F,S".split(","),buttonText:{prev:"&nbsp;&#9668;&nbsp;",next:"&nbsp;&#9658;&nbsp;",prevYear:"&nbsp;&lt;&lt;&nbsp;",nextYear:"&nbsp;&gt;&gt;&nbsp;",today:"today",year:"year",month:"month",week:"week",day:"day"},theme:!1,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:!0,dropAccept:"*"},yb={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"&nbsp;&#9658;&nbsp;",next:"&nbsp;&#9668;&nbsp;",prevYear:"&nbsp;&gt;&gt;&nbsp;",nextYear:"&nbsp;&lt;&lt;&nbsp;"},
  buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},W=a.fullCalendar={version:"1.5.1"},da=W.views={};a.fn.fullCalendar=function(b){if("string"==typeof b){var e=Array.prototype.slice.call(arguments,1),f;this.each(function(){var d=a.data(this,"fullCalendar");d&&a.isFunction(d[b])&&(d=d[b].apply(d,e),f===c&&(f=d),"destroy"==b&&a.removeData(this,"fullCalendar"))});return f!==c?f:this}var g=b.eventSources||[];delete b.eventSources;b.events&&(g.push(b.events),delete b.events);b=a.extend(!0,
  {},ca,b.isRTL||b.isRTL===c&&ca.isRTL?yb:{},b);this.each(function(c,e){var f=a(e),h=new d(f,b,g);f.data("fullCalendar",h);h.render()});return this};W.sourceNormalizers=[];W.sourceFetchers=[];var ob={dataType:"json",cache:!1},pb=1;W.addDays=h;W.cloneDate=o;W.parseDate=k;W.parseISO8601=v;W.parseTime=C;W.formatDate=F;W.formatDates=fa;var sb="sun,mon,tue,wed,thu,fri,sat".split(","),$a=864E5,qb=36E5,xb=6E4,rb={s:function(a){return a.getSeconds()},ss:function(a){return ha(a.getSeconds())},m:function(a){return a.getMinutes()},
  mm:function(a){return ha(a.getMinutes())},h:function(a){return a.getHours()%12||12},hh:function(a){return ha(a.getHours()%12||12)},H:function(a){return a.getHours()},HH:function(a){return ha(a.getHours())},d:function(a){return a.getDate()},dd:function(a){return ha(a.getDate())},ddd:function(a,b){return b.dayNamesShort[a.getDay()]},e:function(a,b){return b.dayNamesShortest[a.getDay()]},dddd:function(a,b){return b.dayNames[a.getDay()]},M:function(a){return a.getMonth()+1},MM:function(a){return ha(a.getMonth()+
  1)},MMM:function(a,b){return b.monthNamesShort[a.getMonth()]},MMMM:function(a,b){return b.monthNames[a.getMonth()]},yy:function(a){return(a.getFullYear()+"").substring(2)},yyyy:function(a){return a.getFullYear()},t:function(a){return 12>a.getHours()?"a":"p"},tt:function(a){return 12>a.getHours()?"am":"pm"},T:function(a){return 12>a.getHours()?"A":"P"},TT:function(a){return 12>a.getHours()?"AM":"PM"},u:function(a){return F(a,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(a){a=a.getDate();return 10<a&&20>
  a?"th":["st","nd","rd"][a%10-1]||"th"}};W.applyAll=Ea;da.year=function(a,b){var d=this;d.render=function(a,b){if(b)d.curYear=g(a,b);var h=o(a,!0);h.setFullYear(h.getFullYear(),0,1);var i=o(a);i.setFullYear(i.getFullYear(),11,31);var l=o(h),j=o(i),k=c("weekends")?0:1;d.title=f(h,c("titleFormat"));d.start=h;d.end=i;d.visStart=l;d.visEnd=j;e("4x3",6,k?5:7,!0)};tb.call(d,a,b,"year");var c=d.opt,e=d.renderYear,f=b.formatDate};da.month=function(a,b){var d=this;d.render=function(a,b){b&&(i(a,b),a.setDate(1));
  var g=o(a,!0);g.setDate(1);var l=i(o(g),1),j=o(g),k=o(l),m=c("firstDay"),r=c("weekends")?0:1;r&&(n(j),n(k,-1,!0));h(j,-((j.getDay()-Math.max(m,r)+7)%7));h(k,(7-k.getDay()+Math.max(m,r))%7);m=Math.round((k-j)/(7*$a));"fixed"==c("weekMode")&&(h(k,7*(6-m)),m=6);d.title=f(g,c("titleFormat"));d.start=g;d.end=l;d.visStart=j;d.visEnd=k;e(6,m,r?5:7,!0)};Va.call(d,a,b,"month");var c=d.opt,e=d.renderBasic,f=b.formatDate};da.basicWeek=function(a,b){var d=this;d.render=function(a,b){b&&h(a,7*b);var g=h(o(a),
  -((a.getDay()-c("firstDay")+7)%7)),i=h(o(g),7),l=o(g),j=o(i),k=c("weekends");k||(n(l),n(j,-1,!0));d.title=f(l,h(o(j),-1),c("titleFormat"));d.start=g;d.end=i;d.visStart=l;d.visEnd=j;e(1,1,k?7:5,!1)};Va.call(d,a,b,"basicWeek");var c=d.opt,e=d.renderBasic,f=b.formatDates};da.basicDay=function(a,b){var d=this;d.render=function(a,b){b&&(h(a,b),c("weekends")||n(a,0>b?-1:1));d.title=f(a,c("titleFormat"));d.start=d.visStart=o(a,!0);d.end=d.visEnd=h(o(d.start),1);e(1,1,1,!1)};Va.call(d,a,b,"basicDay");var c=
  d.opt,e=d.renderBasic,f=b.formatDate};b({weekMode:"fixed"});da.agendaWeek=function(a,b){var d=this;d.render=function(a,b){b&&h(a,7*b);var g=h(o(a),-((a.getDay()-c("firstDay")+7)%7)),i=h(o(g),7),l=o(g),j=o(i),k=c("weekends");k||(n(l),n(j,-1,!0));d.title=f(l,h(o(j),-1),c("titleFormat"));d.start=g;d.end=i;d.visStart=l;d.visEnd=j;e(k?7:5)};jb.call(d,a,b,"agendaWeek");var c=d.opt,e=d.renderAgenda,f=b.formatDates};da.agendaDay=function(a,b){var d=this;d.render=function(a,b){b&&(h(a,b),c("weekends")||n(a,
  0>b?-1:1));var g=o(a,!0),i=h(o(g),1);d.title=f(a,c("titleFormat"));d.start=d.visStart=g;d.end=d.visEnd=i;e(1)};jb.call(d,a,b,"agendaDay");var c=d.opt,e=d.renderAgenda,f=b.formatDate};b({allDaySlot:!0,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:0.5},minTime:0,maxTime:24})})(jQuery);
  (function(a){function c(a,b,d){var c=b;10>b&&(c="0"+b);if(d.isoTime)return b=a,10>b&&(b="0"+a),b+":"+c;b=a%12;0==b&&(b=12);return b+":"+c+(d.meridiemUpperCase?12>a?"AM":"PM":12>a?"am":"pm")}function b(a){if((a=a=/(\d+)\s*[:\-\.,]\s*(\d+)\s*(am|pm)?/i.exec(a))&&3<=a.length){var b=Number(a[1]),d=Number(a[2]);12==b&&a[3]&&(b-=12);a[3]&&"pm"==a[3].toLowerCase()&&(b+=12);return{hour:b,minute:d}}return null}function d(a){return a&&60*a.hour+a.minute}function e(e,g){for(var i=d(g.minTime),h=d(g.maxTime),
  j=d(g.defaultTime),l=g.selection&&d(b(g.selection)),m=g.minutes,o=g.onehour,r=g.hours,l=l&&Math.floor((l-i)/g.timeInterval)*g.timeInterval+i,n,s=a("<ul></ul>"),x=i;x<=h;x+=g.timeInterval)(function(b){var d=c(Math.floor(b/60),b%60,g),e=d;if(g.showDuration)var f=b-i,e=60>f?e+(" ("+f+" "+m+")"):60==f?e+(" ("+o+")"):e+(" ("+Math.round(10*(f/60))/10+" "+r+")");e=a("<li></li>").append(a('<a href="javascript:void(0);">'+e+"</a>").click(function(){g&&g.selectTime&&g.selectTime(d);return!1}).mousemove(function(){a("li.selected",
  s).removeClass("selected")}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})).appendTo(s);!n&&b==j&&(n=e);l==b&&(e.addClass("selected").addClass("ui-state-highlight"),n=e)})(x);n&&setTimeout(function(){e[0].scrollTop=n[0].offsetTop-2*n.height()},0);e.empty().append(s)}a.fn.calendricalTime=function(d){d=d||{};d.timeInterval=d.timeInterval||30;d.padding=d.padding||4;return this.each(function(){var c=a(this),i,h=!1;c.bind("focus click",function(){if(!i){var j=
  c.position();i=a("<div></div>").addClass("calendricalTimePopup ui-widget ui-widget-content").mouseenter(function(){h=!0}).mouseleave(function(){h=!1}).mousedown(function(a){a.preventDefault()}).css({position:"absolute",left:j.left,top:j.top+c.height()+2*d.padding});c.after(i);j={selection:c.val(),selectTime:function(a){h=!1;c.val(a);i.remove();i=null},isoTime:d.isoTime||!1,meridiemUpperCase:d.meridiemUpperCase||!1,defaultTime:d.defaultTime||{hour:8,minute:0},minTime:d.minTime||{hour:0,minute:0},maxTime:d.maxTime||
  {hour:23,minute:59},timeInterval:d.timeInterval||30,minutes:d.minutes||"mins",onehour:d.onehour||"1 hr",hours:d.hours||"hrs"};if(d.startTime){var l=b(d.startTime.val());d.startDate&&d.endDate&&!areDatesEqual(parseDate(d.startDate.val()),parseDate(d.endDate.val()))&&(l=null);if(l)j.minTime=l,j.showDuration=!0,i.addClass("calendricalEndTimePopup")}e(i,j)}}).blur(function(){h?i&&c.focus():i&&(i.remove(),i=null)})})};a.fn.calendricalTimeRange=function(b){2<=this.length&&(a(this[0]).calendricalTime(b),
  a(this[1]).calendricalTime(a.extend({startTime:a(this[0])},b)));return this}})(jQuery);
  (function(a){function c(){this.regional=[];this.regional[""]={currentText:"Now",closeText:"Done",ampm:!1,timeFormat:"hh:mm tt",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",timezoneText:"Time Zone"};this._defaults={showButtonPanel:!0,timeOnly:!1,showHour:!0,showMinute:!0,showSecond:!1,showTimezone:!1,showTime:!0,stepHour:0.05,stepMinute:0.05,stepSecond:0.05,hour:0,minute:0,second:0,timezone:"+0000",hourMin:0,minuteMin:0,secondMin:0,hourMax:23,
  minuteMax:59,secondMax:59,minDateTime:null,maxDateTime:null,hourGrid:0,minuteGrid:0,secondGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,showTimepicker:!0,timezoneList:"-1100,-1000,-0900,-0800,-0700,-0600,-0500,-0400,-0300,-0200,-0100,+0000,+0100,+0200,+0300,+0400,+0500,+0600,+0700,+0800,+0900,+1000,+1100,+1200".split(",")};a.extend(this._defaults,this.regional[""])}a.extend(a.ui,{timepicker:{version:"0.9.4"}});a.extend(c.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,
  minute_slider:null,second_slider:null,timezone_select:null,hour:0,minute:0,second:0,timezone:"+0000",hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:"-1100,-1000,-0900,-0800,-0700,-0600,-0500,-0400,-0300,-0200,-0100,+0000,+0100,+0200,+0300,+0400,+0500,+0600,+0700,+0800,+0900,+1000,+1100,+1200".split(","),setDefaults:function(b){var d=this._defaults,
  b=b||{};a.extend(d,b);for(var c in b)if(null===b[c]||void 0===b[c])d[c]=b[c];return this},_newInst:function(b,d){var e=new c,f={},g;for(g in this._defaults){var i=b.attr("time:"+g);if(i)try{f[g]=eval(i)}catch(h){f[g]=i}}e._defaults=a.extend({},this._defaults,f,d,{beforeShow:function(b,c){a.isFunction(d.beforeShow)&&d.beforeShow(b,c,e)},onChangeMonthYear:function(c,f,g){e._updateDateTime(g);a.isFunction(d.onChangeMonthYear)&&d.onChangeMonthYear.call(b[0],c,f,g,e)},onClose:function(c,f){!0===e.timeDefined&&
  ""!=b.val()&&e._updateDateTime(f);a.isFunction(d.onClose)&&d.onClose.call(b[0],c,f,e)},timepicker:e});e.hour=e._defaults.hour;e.minute=e._defaults.minute;e.second=e._defaults.second;e.ampm="";e.$input=b;if(d.altField)e.$altInput=a(d.altField).css({cursor:"pointer"}).focus(function(){b.trigger("focus")});if(void 0!==e._defaults.minDate&&e._defaults.minDate instanceof Date)e._defaults.minDateTime=new Date(e._defaults.minDate.getTime());if(void 0!==e._defaults.minDateTime&&e._defaults.minDateTime instanceof
  Date)e._defaults.minDate=new Date(e._defaults.minDateTime.getTime());if(void 0!==e._defaults.maxDate&&e._defaults.maxDate instanceof Date)e._defaults.maxDateTime=new Date(e._defaults.maxDate.getTime());if(void 0!==e._defaults.maxDateTime&&e._defaults.maxDateTime instanceof Date)e._defaults.maxDate=new Date(e._defaults.maxDateTime.getTime());return e},_addTimePicker:function(a){this.timeDefined=this._parseTime(this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():
  this.$input.val());this._limitMinMaxDateTime(a,!1);this._injectTimePicker()},_parseTime:function(b,d){var c=this._defaults.timeFormat.toString().replace(/h{1,2}/ig,"(\\d?\\d)").replace(/m{1,2}/ig,"(\\d?\\d)").replace(/s{1,2}/ig,"(\\d?\\d)").replace(/t{1,2}/ig,"(am|pm|a|p)?").replace(/z{1}/ig,"((\\+|-)\\d\\d\\d\\d)?").replace(/\s/g,"\\s?")+"$",f=this._getFormatPositions();if(!this.inst)this.inst=a.datepicker._getInst(this.$input[0]);if(d||!this._defaults.timeOnly)c=".{"+a.datepicker._get(this.inst,
  "dateFormat").length+",}"+this._defaults.separator.replace(RegExp("[.*+?|()\\[\\]{}\\\\]","g"),"\\$&")+c;if(c=b.match(RegExp(c,"i"))){if(-1!==f.t)this.ampm=(void 0===c[f.t]||0===c[f.t].length?"":"A"==c[f.t].charAt(0).toUpperCase()?"AM":"PM").toUpperCase();if(-1!==f.h)this.hour="AM"==this.ampm&&"12"==c[f.h]?0:"PM"==this.ampm&&"12"!=c[f.h]?(parseFloat(c[f.h])+12).toFixed(0):Number(c[f.h]);if(-1!==f.m)this.minute=Number(c[f.m]);if(-1!==f.s)this.second=Number(c[f.s]);if(-1!==f.z)this.timezone=c[f.z];
  return!0}return!1},_getFormatPositions:function(){var a=this._defaults.timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|t{1,2}|z)/g),d={h:-1,m:-1,s:-1,t:-1,z:-1};if(a)for(var c=0;c<a.length;c++)-1==d[a[c].toString().charAt(0)]&&(d[a[c].toString().charAt(0)]=c+1);return d},_injectTimePicker:function(){var b=this.inst.dpDiv,d=this._defaults,c=this,f=(d.hourMax-d.hourMax%d.stepHour).toFixed(0),g=(d.minuteMax-d.minuteMax%d.stepMinute).toFixed(0),i=(d.secondMax-d.secondMax%d.stepSecond).toFixed(0),
  h=this.inst.id.toString().replace(/([^A-Za-z0-9_])/g,"");if(0===b.find("div#ui-timepicker-div-"+h).length&&d.showTimepicker){var j='<div class="ui-timepicker-div" id="ui-timepicker-div-'+h+'"><dl><dt class="ui_tpicker_time_label" id="ui_tpicker_time_label_'+h+'"'+(d.showTime?"":' style="display:none;"')+">"+d.timeText+'</dt><dd class="ui_tpicker_time" id="ui_tpicker_time_'+h+'"'+(d.showTime?"":' style="display:none;"')+'></dd><dt class="ui_tpicker_hour_label" id="ui_tpicker_hour_label_'+h+'"'+(d.showHour?
  "":' style="display:none;"')+">"+d.hourText+"</dt>",l=0,m=0,o=0,r;if(d.showHour&&0<d.hourGrid){for(var j=j+('<dd class="ui_tpicker_hour"><div id="ui_tpicker_hour_'+h+'"'+(d.showHour?"":' style="display:none;"')+'></div><div style="padding-left: 1px"><table><tr>'),n=d.hourMin;n<f;n+=d.hourGrid){l++;var s=d.ampm&&12<n?n-12:n;10>s&&(s="0"+s);d.ampm&&(s=0==n?"12a":12>n?s+"a":s+"p");j+="<td>"+s+"</td>"}j+="</tr></table></div></dd>"}else j+='<dd class="ui_tpicker_hour" id="ui_tpicker_hour_'+h+'"'+(d.showHour?
  "":' style="display:none;"')+"></dd>";j+='<dt class="ui_tpicker_minute_label" id="ui_tpicker_minute_label_'+h+'"'+(d.showMinute?"":' style="display:none;"')+">"+d.minuteText+"</dt>";if(d.showMinute&&0<d.minuteGrid){j+='<dd class="ui_tpicker_minute ui_tpicker_minute_'+d.minuteGrid+'"><div id="ui_tpicker_minute_'+h+'"'+(d.showMinute?"":' style="display:none;"')+'></div><div style="padding-left: 1px"><table><tr>';for(n=d.minuteMin;n<g;n+=d.minuteGrid)m++,j+="<td>"+(10>n?"0":"")+n+"</td>";j+="</tr></table></div></dd>"}else j+=
  '<dd class="ui_tpicker_minute" id="ui_tpicker_minute_'+h+'"'+(d.showMinute?"":' style="display:none;"')+"></dd>";j+='<dt class="ui_tpicker_second_label" id="ui_tpicker_second_label_'+h+'"'+(d.showSecond?"":' style="display:none;"')+">"+d.secondText+"</dt>";if(d.showSecond&&0<d.secondGrid){j+='<dd class="ui_tpicker_second ui_tpicker_second_'+d.secondGrid+'"><div id="ui_tpicker_second_'+h+'"'+(d.showSecond?"":' style="display:none;"')+'></div><div style="padding-left: 1px"><table><tr>';for(n=d.secondMin;n<
  i;n+=d.secondGrid)o++,j+="<td>"+(10>n?"0":"")+n+"</td>";j+="</tr></table></div></dd>"}else j+='<dd class="ui_tpicker_second" id="ui_tpicker_second_'+h+'"'+(d.showSecond?"":' style="display:none;"')+"></dd>";j+='<dt class="ui_tpicker_timezone_label" id="ui_tpicker_timezone_label_'+h+'"'+(d.showTimezone?"":' style="display:none;"')+">"+d.timezoneText+"</dt>";j+='<dd class="ui_tpicker_timezone" id="ui_tpicker_timezone_'+h+'"'+(d.showTimezone?"":' style="display:none;"')+"></dd>";$tp=a(j+"</dl></div>");
  !0===d.timeOnly&&($tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+d.timeOnlyTitle+"</div></div>"),b.find(".ui-datepicker-header, .ui-datepicker-calendar").hide());this.hour_slider=$tp.find("#ui_tpicker_hour_"+h).slider({orientation:"horizontal",value:this.hour,min:d.hourMin,max:f,step:d.stepHour,slide:function(a,b){c.hour_slider.slider("option","value",b.value);c._onTimeChange()}});this.minute_slider=$tp.find("#ui_tpicker_minute_"+h).slider({orientation:"horizontal",
  value:this.minute,min:d.minuteMin,max:g,step:d.stepMinute,slide:function(a,b){c.minute_slider.slider("option","value",b.value);c._onTimeChange()}});this.second_slider=$tp.find("#ui_tpicker_second_"+h).slider({orientation:"horizontal",value:this.second,min:d.secondMin,max:i,step:d.stepSecond,slide:function(a,b){c.second_slider.slider("option","value",b.value);c._onTimeChange()}});this.timezone_select=$tp.find("#ui_tpicker_timezone_"+h).append("<select></select>").find("select");a.fn.append.apply(this.timezone_select,
  a.map(d.timezoneList,function(b){return a("<option />").val("object"==typeof b?b.value:b).text("object"==typeof b?b.label:b)}));this.timezone_select.val("undefined"!=typeof this.timezone&&null!=this.timezone&&""!=this.timezone?this.timezone:d.timezone);this.timezone_select.change(function(){c._onTimeChange()});d.showHour&&0<d.hourGrid&&(r=100*l*d.hourGrid/(f-d.hourMin),$tp.find(".ui_tpicker_hour table").css({width:r+"%",marginLeft:r/(-2*l)+"%",borderCollapse:"collapse"}).find("td").each(function(){a(this).click(function(){var b=
  a(this).html();if(d.ampm)var f=b.substring(2).toLowerCase(),b=parseInt(b.substring(0,2)),b="a"==f?12==b?0:b:12==b?12:b+12;c.hour_slider.slider("option","value",b);c._onTimeChange();c._onSelectHandler()}).css({cursor:"pointer",width:100/l+"%",textAlign:"center",overflow:"hidden"})}));d.showMinute&&0<d.minuteGrid&&(r=100*m*d.minuteGrid/(g-d.minuteMin),$tp.find(".ui_tpicker_minute table").css({width:r+"%",marginLeft:r/(-2*m)+"%",borderCollapse:"collapse"}).find("td").each(function(){a(this).click(function(){c.minute_slider.slider("option",
  "value",a(this).html());c._onTimeChange();c._onSelectHandler()}).css({cursor:"pointer",width:100/m+"%",textAlign:"center",overflow:"hidden"})}));d.showSecond&&0<d.secondGrid&&$tp.find(".ui_tpicker_second table").css({width:r+"%",marginLeft:r/(-2*o)+"%",borderCollapse:"collapse"}).find("td").each(function(){a(this).click(function(){c.second_slider.slider("option","value",a(this).html());c._onTimeChange();c._onSelectHandler()}).css({cursor:"pointer",width:100/o+"%",textAlign:"center",overflow:"hidden"})});
  f=b.find(".ui-datepicker-buttonpane");f.length?f.before($tp):b.append($tp);this.$timeObj=$tp.find("#ui_tpicker_time_"+h);if(null!==this.inst)b=this.timeDefined,this._onTimeChange(),this.timeDefined=b;b=function(){c._onSelectHandler()};this.hour_slider.bind("slidestop",b);this.minute_slider.bind("slidestop",b);this.second_slider.bind("slidestop",b)}},_limitMinMaxDateTime:function(a,d){var c=this._defaults,f=new Date(a.selectedYear,a.selectedMonth,a.selectedDay);if(this._defaults.showTimepicker){if(null!==
  this._defaults.minDateTime&&f){var g=this._defaults.minDateTime,i=new Date(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0);if(null===this.hourMinOriginal||null===this.minuteMinOriginal||null===this.secondMinOriginal)this.hourMinOriginal=c.hourMin,this.minuteMinOriginal=c.minuteMin,this.secondMinOriginal=c.secondMin;if(a.settings.timeOnly||i.getTime()==f.getTime())if(this._defaults.hourMin=g.getHours(),this.hour<=this._defaults.hourMin)if(this.hour=this._defaults.hourMin,this._defaults.minuteMin=
  g.getMinutes(),this.minute<=this._defaults.minuteMin)this.minute=this._defaults.minuteMin,this._defaults.secondMin=g.getSeconds();else{if(this.second<this._defaults.secondMin)this.second=this._defaults.secondMin;this._defaults.secondMin=this.secondMinOriginal}else this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal;else this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal}if(null!==
  this._defaults.maxDateTime&&f){g=this._defaults.maxDateTime;i=new Date(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0);if(null===this.hourMaxOriginal||null===this.minuteMaxOriginal||null===this.secondMaxOriginal)this.hourMaxOriginal=c.hourMax,this.minuteMaxOriginal=c.minuteMax,this.secondMaxOriginal=c.secondMax;if(a.settings.timeOnly||i.getTime()==f.getTime())if(this._defaults.hourMax=g.getHours(),this.hour>=this._defaults.hourMax)if(this.hour=this._defaults.hourMax,this._defaults.minuteMax=g.getMinutes(),
  this.minute>=this._defaults.minuteMax)this.minute=this._defaults.minuteMax,this._defaults.secondMin=g.getSeconds();else{if(this.second>this._defaults.secondMax)this.second=this._defaults.secondMax;this._defaults.secondMax=this.secondMaxOriginal}else this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal;else this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal}void 0!==d&&
  !0===d&&(this.hour_slider.slider("option",{min:this._defaults.hourMin,max:this._defaults.hourMax}).slider("value",this.hour),this.minute_slider.slider("option",{min:this._defaults.minuteMin,max:this._defaults.minuteMax}).slider("value",this.minute),this.second_slider.slider("option",{min:this._defaults.secondMin,max:this._defaults.secondMax}).slider("value",this.second))}},_onTimeChange:function(){var a=this.hour_slider?this.hour_slider.slider("value"):!1,d=this.minute_slider?this.minute_slider.slider("value"):
  !1,c=this.second_slider?this.second_slider.slider("value"):!1,f=this.timezone_select?this.timezone_select.val():!1;!1!==a&&(a=parseInt(a,10));!1!==d&&(d=parseInt(d,10));!1!==c&&(c=parseInt(c,10));var g=12>a?"AM":"PM",i=a!=this.hour||d!=this.minute||c!=this.second||0<this.ampm.length&&this.ampm!=g||f!=this.timezone;if(i){if(!1!==a)this.hour=a;if(!1!==d)this.minute=d;if(!1!==c)this.second=c;if(!1!==f)this.timezone=f;this._limitMinMaxDateTime(this.inst,!0)}if(this._defaults.ampm)this.ampm=g;this._formatTime();
  this.$timeObj&&this.$timeObj.text(this.formattedTime);this.timeDefined=!0;i&&this._updateDateTime()},_onSelectHandler:function(){var a=this._defaults.onSelect,d=this.$input?this.$input[0]:null;a&&d&&a.apply(d,[this.formattedDateTime,this])},_formatTime:function(b,d,c){if(void 0==c)c=this._defaults.ampm;var b=b||{hour:this.hour,minute:this.minute,second:this.second,ampm:this.ampm,timezone:this.timezone},f=d||this._defaults.timeFormat.toString();if(c)var g="AM"==b.ampm?b.hour:b.hour%12,g=0===Number(g)?
  12:g,f=f.toString().replace(/hh/g,(10>g?"0":"")+g).replace(/h/g,g).replace(/mm/g,(10>b.minute?"0":"")+b.minute).replace(/m/g,b.minute).replace(/ss/g,(10>b.second?"0":"")+b.second).replace(/s/g,b.second).replace(/TT/g,b.ampm.toUpperCase()).replace(/tt/g,b.ampm.toLowerCase()).replace(/T/g,b.ampm.charAt(0).toUpperCase()).replace(/t/g,b.ampm.charAt(0).toLowerCase()).replace(/z/g,b.timezone);else f=f.toString().replace(/hh/g,(10>b.hour?"0":"")+b.hour).replace(/h/g,b.hour).replace(/mm/g,(10>b.minute?"0":
  "")+b.minute).replace(/m/g,b.minute).replace(/ss/g,(10>b.second?"0":"")+b.second).replace(/s/g,b.second).replace(/z/g,b.timezone),f=a.trim(f.replace(/t/gi,""));if(arguments.length)return f;this.formattedTime=f},_updateDateTime:function(b){b=this.inst||b;dt=new Date(b.selectedYear,b.selectedMonth,b.selectedDay);dateFmt=a.datepicker._get(b,"dateFormat");formatCfg=a.datepicker._getFormatConfig(b);timeAvailable=null!==dt&&this.timeDefined;var d=this.formattedDate=a.datepicker.formatDate(dateFmt,null===
  dt?new Date:dt,formatCfg);if(!(void 0!==b.lastVal&&0<b.lastVal.length&&0===this.$input.val().length)){if(!0===this._defaults.timeOnly)d=this.formattedTime;else if(!0!==this._defaults.timeOnly&&(this._defaults.alwaysSetTime||timeAvailable))d+=this._defaults.separator+this.formattedTime;this.formattedDateTime=d;this._defaults.showTimepicker?this.$altInput&&!0===this._defaults.altFieldTimeOnly?(this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate)):(this.$altInput&&this.$altInput.val(d),
  this.$input.val(d)):this.$input.val(this.formattedDate);this.$input.trigger("change")}}});a.fn.extend({timepicker:function(b){var b=b||{},d=arguments;"object"==typeof b&&(d[0]=a.extend(b,{timeOnly:!0}));return a(this).each(function(){a.fn.datetimepicker.apply(a(this),d)})},datetimepicker:function(b){var b=b||{},d=arguments;return"string"==typeof b?"getDate"==b?a.fn.datepicker.apply(a(this[0]),d):this.each(function(){var b=a(this);b.datepicker.apply(b,d)}):this.each(function(){var d=a(this);d.datepicker(a.timepicker._newInst(d,
  b)._defaults)})}});a.datepicker._base_selectDate=a.datepicker._selectDate;a.datepicker._selectDate=function(b,d){var c=this._getInst(a(b)[0]),f=this._get(c,"timepicker");f?(f._limitMinMaxDateTime(c,!0),c.inline=c.stay_open=!0,this._base_selectDate(b,d+f._defaults.separator+f.formattedTime),c.inline=c.stay_open=!1,this._notifyChange(c),this._updateDatepicker(c)):this._base_selectDate(b,d)};a.datepicker._base_updateDatepicker=a.datepicker._updateDatepicker;a.datepicker._updateDatepicker=function(a){if("boolean"!==
  typeof a.stay_open||!1===a.stay_open){this._base_updateDatepicker(a);var d=this._get(a,"timepicker");d&&d._addTimePicker(a)}};a.datepicker._base_doKeyPress=a.datepicker._doKeyPress;a.datepicker._doKeyPress=function(b){var d=a.datepicker._getInst(b.target),c=a.datepicker._get(d,"timepicker");if(c&&a.datepicker._get(d,"constrainInput")){var f=c._defaults.ampm,d=c._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,f?"APM":"").replace(/T/g,f?"AP":"").replace(/tt/g,f?"apm":"").replace(/t/g,
  f?"ap":"")+" "+c._defaults.separator+a.datepicker._possibleChars(a.datepicker._get(d,"dateFormat")),c=String.fromCharCode(void 0===b.charCode?b.keyCode:b.charCode);return b.ctrlKey||" ">c||!d||-1<d.indexOf(c)}return a.datepicker._base_doKeyPress(b)};a.datepicker._base_doKeyUp=a.datepicker._doKeyUp;a.datepicker._doKeyUp=function(b){var d=a.datepicker._getInst(b.target),c=a.datepicker._get(d,"timepicker");if(c&&c._defaults.timeOnly&&d.input.val()!=d.lastVal)try{a.datepicker._updateDatepicker(d)}catch(f){a.datepicker.log(f)}return a.datepicker._base_doKeyUp(b)};
  a.datepicker._base_gotoToday=a.datepicker._gotoToday;a.datepicker._gotoToday=function(b){this._base_gotoToday(b);this._setTime(this._getInst(a(b)[0]),new Date)};a.datepicker._disableTimepickerDatepicker=function(b){var d=this._getInst(b),c=this._get(d,"timepicker");a(b).datepicker("getDate");if(c)c._defaults.showTimepicker=!1,c._updateDateTime(d)};a.datepicker._enableTimepickerDatepicker=function(b){var d=this._getInst(b),c=this._get(d,"timepicker");a(b).datepicker("getDate");if(c)c._defaults.showTimepicker=
  !0,c._addTimePicker(d),c._updateDateTime(d)};a.datepicker._setTime=function(a,d){var c=this._get(a,"timepicker");if(c){var f=c._defaults,g=d?d.getHours():f.hour,i=d?d.getMinutes():f.minute,h=d?d.getSeconds():f.second;if(g<f.hourMin||g>f.hourMax||i<f.minuteMin||i>f.minuteMax||h<f.secondMin||h>f.secondMax)g=f.hourMin,i=f.minuteMin,h=f.secondMin;c.hour_slider?c.hour_slider.slider("value",g):c.hour=g;c.minute_slider?c.minute_slider.slider("value",i):c.minute=i;c.second_slider?c.second_slider.slider("value",
  h):c.second=h;c._onTimeChange();c._updateDateTime(a)}};a.datepicker._setTimeDatepicker=function(a,c,e){var a=this._getInst(a),f=this._get(a,"timepicker");f&&(this._setDateFromField(a),c&&("string"==typeof c?(f._parseTime(c,e),c=new Date,c.setHours(f.hour,f.minute,f.second)):c=new Date(c.getTime()),"Invalid Date"==c.toString()&&(c=void 0),this._setTime(a,c)))};a.datepicker._base_setDateDatepicker=a.datepicker._setDateDatepicker;a.datepicker._setDateDatepicker=function(a,c){var e=this._getInst(a),f=
  c instanceof Date?new Date(c.getTime()):c;this._updateDatepicker(e);this._base_setDateDatepicker.apply(this,arguments);this._setTimeDatepicker(a,f,!0)};a.datepicker._base_getDateDatepicker=a.datepicker._getDateDatepicker;a.datepicker._getDateDatepicker=function(b,c){var e=this._getInst(b),f=this._get(e,"timepicker");return f?(this._setDateFromField(e,c),(e=this._getDate(e))&&f._parseTime(a(b).val(),!0)&&e.setHours(f.hour,f.minute,f.second),e):this._base_getDateDatepicker(b,c)};a.timepicker=new c;
  a.timepicker.version="0.9.4"})(jQuery);
  (function(a){a(document.body).is("[role]")||a(document.body).attr("role","application");var c=0;a.widget("ui.tooltip",{options:{tooltipClass:"ui-widget-content",content:function(){return a(this).attr("title")},position:{my:"left center",at:"right center",offset:"15 0"}},_init:function(){var b=this;this.tooltip=a("<div></div>").attr("id","ui-tooltip-"+c++).attr("role","tooltip").attr("aria-hidden","true").addClass("ui-tooltip ui-widget ui-corner-all").addClass(this.options.tooltipClass).appendTo(document.body).hide();this.tooltipContent=
  a("<div></div>").addClass("ui-tooltip-content").appendTo(this.tooltip);this.opacity=this.tooltip.css("opacity");this.element.bind("focus.tooltip mouseenter.tooltip",function(a){b.open(a)}).bind("blur.tooltip mouseleave.tooltip",function(a){b.close(a)})},enable:function(){this.options.disabled=!1},disable:function(){this.options.disabled=!0},destroy:function(){this.tooltip.remove();a.Widget.prototype.destroy.apply(this,arguments)},widget:function(){return this.tooltip},open:function(a){var c=this.element;
  if(!(this.current&&this.current[0]==c[0])){var e=this;this.current=c;this.currentTitle=c.attr("title");var f=this.options.content.call(c[0],function(f){e.current==c&&e._show(a,c,f)});f&&e._show(a,c,f)}},_show:function(b,c,e){e&&(c.attr("title",""),this.options.disabled||(this.tooltipContent.html(e),this.tooltip.css({top:0,left:0}).show().position(a.extend(this.options.position,{of:c})).hide(),this.tooltip.attr("aria-hidden","false"),c.attr("aria-describedby",this.tooltip.attr("id")),this.tooltip.is(":animated")?
  this.tooltip.stop().show().fadeTo("normal",this.opacity):this.tooltip.is(":visible")?this.tooltip.fadeTo("normal",this.opacity):this.tooltip.fadeIn(),this._trigger("open",b)))},close:function(b){if(this.current&&(this.current.attr("title",this.currentTitle),!this.options.disabled))this.current.removeAttr("aria-describedby"),this.current=null,this.tooltip.attr("aria-hidden","true"),this.tooltip.is(":animated")?this.tooltip.stop().fadeTo("normal",0,function(){a(this).hide().css("opacity","")}):this.tooltip.stop().fadeOut(),
  this._trigger("close",b)}})})(jQuery);
  (function(a){a.jgrid=a.jgrid||{};a.extend(a.jgrid,{guid:1,uidPref:"jqg",randId:function(c){return(c?c:a.jgrid.uidPref)+a.jgrid.guid++}});a.extend(a.jgrid,{showModal:function(a){a.w.show()},closeModal:function(a){a.w.hide().attr("aria-hidden","true");a.o&&a.o.remove()},hideModal:function(c,b){b=a.extend({jqm:!0,gb:""},b||{});if(b.onClose){var d=b.onClose(c);if("boolean"==typeof d&&!d)return}if(a.fn.jqm&&!0===b.jqm)a(c).attr("aria-hidden","true").jqmHide();else{if(""!==b.gb)try{a(".jqgrid-overlay:first",
  b.gb).hide()}catch(e){}a(c).hide().attr("aria-hidden","true")}},findPos:function(a){var b=0,d=0;if(a.offsetParent){do b+=a.offsetLeft,d+=a.offsetTop;while(a=a.offsetParent)}return[b,d]},createModal:function(c,b,d,e,f,g,i){var h=document.createElement("div"),j,l=this,i=a.extend({},i||{});j="rtl"==a(d.gbox).attr("dir")?!0:!1;h.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";h.id=c.themodal;var m=document.createElement("div");m.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";
  m.id=c.modalhead;a(m).append("<span class='ui-jqdialog-title'>"+d.caption+"</span>");var o=a("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){o.addClass("ui-state-hover")},function(){o.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-closethick'></span>");a(m).append(o);j?(h.dir="rtl",a(".ui-jqdialog-title",m).css("float","right"),a(".ui-jqdialog-titlebar-close",m).css("left","0.3em")):(h.dir="ltr",a(".ui-jqdialog-title",m).css("float",
  "left"),a(".ui-jqdialog-titlebar-close",m).css("right","0.3em"));var r=document.createElement("div");a(r).addClass("ui-jqdialog-content ui-widget-content").attr("id",c.modalcontent);a(r).append(b);h.appendChild(r);a(h).prepend(m);!0===g?a("body").append(h):"string"==typeof g?a(g).append(h):a(h).insertBefore(e);a(h).css(i);if("undefined"===typeof d.jqModal)d.jqModal=!0;b={};if(a.fn.jqm&&!0===d.jqModal){if(0===d.left&&0===d.top&&d.overlay)i=[],i=this.findPos(f),d.left=i[0]+4,d.top=i[1]+4;b.top=d.top+
  "px";b.left=d.left}else if(0!==d.left||0!==d.top)b.left=d.left,b.top=d.top+"px";a("a.ui-jqdialog-titlebar-close",m).click(function(){var b=a("#"+c.themodal).data("onClose")||d.onClose,e=a("#"+c.themodal).data("gbox")||d.gbox;l.hideModal("#"+c.themodal,{gb:e,jqm:d.jqModal,onClose:b});return!1});if(0===d.width||!d.width)d.width=300;if(0===d.height||!d.height)d.height=200;if(!d.zIndex)e=a(e).parents("*[role=dialog]").filter(":first").css("z-index"),d.zIndex=e?parseInt(e,10)+1:950;e=0;if(j&&b.left&&!g)e=
  a(d.gbox).width()-(!isNaN(d.width)?parseInt(d.width,10):0)-8,b.left=parseInt(b.left,10)+parseInt(e,10);b.left&&(b.left+="px");a(h).css(a.extend({width:isNaN(d.width)?"auto":d.width+"px",height:isNaN(d.height)?"auto":d.height+"px",zIndex:d.zIndex,overflow:"hidden"},b)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":c.modalhead,"aria-hidden":"true"});if("undefined"==typeof d.drag)d.drag=!0;if("undefined"==typeof d.resize)d.resize=!0;if(d.drag)if(a(m).css("cursor","move"),a.fn.jqDrag)a(h).jqDrag(m);
  else try{a(h).draggable({handle:a("#"+m.id)})}catch(n){}if(d.resize)if(a.fn.jqResize)a(h).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'></div>"),a("#"+c.themodal).jqResize(".jqResize",c.scrollelm?"#"+c.scrollelm:!1);else try{a(h).resizable({handles:"se, sw",alsoResize:c.scrollelm?"#"+c.scrollelm:!1})}catch(s){}!0===d.closeOnEscape&&a(h).keydown(function(b){27==b.which&&(b=a("#"+c.themodal).data("onClose")||d.onClose,
  l.hideModal(this,{gb:d.gbox,jqm:d.jqModal,onClose:b}))})},viewModal:function(c,b){b=a.extend({toTop:!0,overlay:10,modal:!1,onShow:this.showModal,onHide:this.closeModal,gbox:"",jqm:!0,jqM:!0},b||{});if(a.fn.jqm&&!0===b.jqm)b.jqM?a(c).attr("aria-hidden","false").jqm(b).jqmShow():a(c).attr("aria-hidden","false").jqmShow();else{""!==b.gbox&&(a(".jqgrid-overlay:first",b.gbox).show(),a(c).data("gbox",b.gbox));a(c).show().attr("aria-hidden","false");try{a(":input:visible",c)[0].focus()}catch(d){}}},info_dialog:function(c,
  b,d,e){var f={width:290,height:"auto",dataheight:"auto",drag:!0,resize:!1,caption:"<b>"+c+"</b>",left:250,top:170,zIndex:1E3,jqModal:!0,modal:!1,closeOnEscape:!0,align:"center",buttonalign:"center",buttons:[]};a.extend(f,e||{});var g=f.jqModal,i=this;a.fn.jqm&&!g&&(g=!1);c="";if(0<f.buttons.length)for(e=0;e<f.buttons.length;e++){if("undefined"==typeof f.buttons[e].id)f.buttons[e].id="info_button_"+e;c+="<a href='javascript:void(0)' id='"+f.buttons[e].id+"' class='fm-button ui-state-default ui-corner-all'>"+
  f.buttons[e].text+"</a>"}e=isNaN(f.dataheight)?f.dataheight:f.dataheight+"px";b="<div id='info_id'>"+("<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+e+";"+("text-align:"+f.align+";")+"'>"+b+"</div>");b+=d?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+f.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'><a href='javascript:void(0)' id='closedialog' class='fm-button ui-state-default ui-corner-all'>"+
  d+"</a>"+c+"</div>":""!==c?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+f.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'>"+c+"</div>":"";b+="</div>";try{"false"==a("#info_dialog").attr("aria-hidden")&&this.hideModal("#info_dialog",{jqm:g}),a("#info_dialog").remove()}catch(h){}this.createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},b,f,"","",!0);c&&a.each(f.buttons,
  function(b){a("#"+this.id,"#info_id").bind("click",function(){f.buttons[b].onClick.call(a("#info_dialog"));return!1})});a("#closedialog","#info_id").click(function(){i.hideModal("#info_dialog",{jqm:g});return!1});a(".fm-button","#info_dialog").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a.isFunction(f.beforeOpen)&&f.beforeOpen();this.viewModal("#info_dialog",{onHide:function(a){a.w.hide().remove();a.o&&a.o.remove()},modal:f.modal,jqm:g});
  a.isFunction(f.afterOpen)&&f.afterOpen();try{a("#info_dialog").focus()}catch(j){}},createEl:function(c,b,d,e,f){function g(b,c){a.isFunction(c.dataInit)&&c.dataInit(b);c.dataEvents&&a.each(c.dataEvents,function(){void 0!==this.data?a(b).bind(this.type,this.data,this.fn):a(b).bind(this.type,this.fn)});return c}function i(b,c,d){var e="dataInit,dataEvents,dataUrl,buildSelect,sopt,searchhidden,defaultValue,attr".split(",");"undefined"!=typeof d&&a.isArray(d)&&(e=a.extend(e,d));a.each(c,function(c,d){-1===
  a.inArray(c,e)&&a(b).attr(c,d)});c.hasOwnProperty("id")||a(b).attr("id",a.jgrid.randId())}var h="";switch(c){case "textarea":h=document.createElement("textarea");if(e)b.cols||a(h).css({width:"98%"});else if(!b.cols)b.cols=20;if(!b.rows)b.rows=2;if("&nbsp;"==d||"&#160;"==d||1==d.length&&160==d.charCodeAt(0))d="";h.value=d;i(h,b);b=g(h,b);a(h).attr({role:"textbox",multiline:"true"});break;case "checkbox":h=document.createElement("input");h.type="checkbox";if(b.value){c=b.value.split(":");if(d===c[0])h.checked=
  !0,h.defaultChecked=!0;h.value=c[0];a(h).attr("offval",c[1])}else c=d.toLowerCase(),0>c.search(/(false|0|no|off|undefined)/i)&&""!==c?(h.checked=!0,h.defaultChecked=!0,h.value=d):h.value="on",a(h).attr("offval","off");i(h,b,["value"]);b=g(h,b);a(h).attr("role","checkbox");break;case "select":h=document.createElement("select");h.setAttribute("role","select");e=[];!0===b.multiple?(c=!0,h.multiple="multiple",a(h).attr("aria-multiselectable","true")):c=!1;if("undefined"!=typeof b.dataUrl)a.ajax(a.extend({url:b.dataUrl,
  type:"GET",dataType:"html",context:{elem:h,options:b,vl:d},success:function(b){var c=[],d=this.elem,e=this.vl,f=a.extend({},this.options),h=!0===f.multiple;"undefined"!=typeof f.buildSelect&&(b=f.buildSelect(b));if(b=a(b).html()){a(d).append(b);i(d,f);f=g(d,f);if("undefined"===typeof f.size)f.size=h?3:1;h?(c=e.split(","),c=a.map(c,function(b){return a.trim(b)})):c[0]=a.trim(e);setTimeout(function(){a("option",d).each(function(){a(this).attr("role","option");if(-1<a.inArray(a.trim(a(this).text()),
  c)||-1<a.inArray(a.trim(a(this).val()),c))this.selected="selected"})},0)}}},f||{}));else if(b.value){var j;if(c){if(e=d.split(","),e=a.map(e,function(b){return a.trim(b)}),"undefined"===typeof b.size)b.size=3}else b.size=1;if("function"===typeof b.value)b.value=b.value();var l,m;if("string"===typeof b.value){l=b.value.split(";");for(j=0;j<l.length;j++){m=l[j].split(":");2<m.length&&(m[1]=a.map(m,function(a,b){if(0<b)return a}).join(":"));f=document.createElement("option");f.setAttribute("role","option");
  f.value=m[0];f.innerHTML=m[1];if(!c&&(a.trim(m[0])==a.trim(d)||a.trim(m[1])==a.trim(d)))f.selected="selected";if(c&&(-1<a.inArray(a.trim(m[1]),e)||-1<a.inArray(a.trim(m[0]),e)))f.selected="selected";h.appendChild(f)}}else if("object"===typeof b.value)for(j in l=b.value,l)if(l.hasOwnProperty(j)){f=document.createElement("option");f.setAttribute("role","option");f.value=j;f.innerHTML=l[j];if(!c&&(a.trim(j)==a.trim(d)||a.trim(l[j])==a.trim(d)))f.selected="selected";if(c&&(-1<a.inArray(a.trim(l[j]),e)||
  -1<a.inArray(a.trim(j),e)))f.selected="selected";h.appendChild(f)}i(h,b,["value"]);b=g(h,b)}break;case "text":case "password":case "button":j="button"==c?"button":"textbox";h=document.createElement("input");h.type=c;h.value=d;i(h,b);b=g(h,b);if("button"!=c)if(e)b.size||a(h).css({width:"98%"});else if(!b.size)b.size=20;a(h).attr("role",j);break;case "image":case "file":h=document.createElement("input");h.type=c;i(h,b);b=g(h,b);break;case "custom":h=document.createElement("span");try{if(a.isFunction(b.custom_element))if(l=
  b.custom_element.call(this,d,b))l=a(l).addClass("customelement").attr({id:b.id,name:b.name}),a(h).empty().append(l);else throw"e2";else throw"e1";}catch(o){"e1"==o&&this.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose),"e2"==o?this.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.novalue,a.jgrid.edit.bClose):this.info_dialog(a.jgrid.errors.errcap,"string"===typeof o?o:o.message,a.jgrid.edit.bClose)}}return h},
  checkDate:function(a,b){var d={},e,a=a.toLowerCase();e=-1!=a.indexOf("/")?"/":-1!=a.indexOf("-")?"-":-1!=a.indexOf(".")?".":"/";a=a.split(e);b=b.split(e);if(3!=b.length)return!1;e=-1;for(var f,g=-1,i=-1,h=0;h<a.length;h++)f=isNaN(b[h])?0:parseInt(b[h],10),d[a[h]]=f,f=a[h],-1!=f.indexOf("y")&&(e=h),-1!=f.indexOf("m")&&(i=h),-1!=f.indexOf("d")&&(g=h);f="y"==a[e]||"yyyy"==a[e]?4:"yy"==a[e]?2:-1;var h=function(a){for(var b=1;b<=a;b++){this[b]=31;if(4==b||6==b||9==b||11==b)this[b]=30;2==b&&(this[b]=29)}return this}(12),
  j;if(-1===e)return!1;j=d[a[e]].toString();2==f&&1==j.length&&(f=1);if(j.length!=f||0===d[a[e]]&&"00"!=b[e]||-1===i)return!1;j=d[a[i]].toString();if(1>j.length||1>d[a[i]]||12<d[a[i]]||-1===g)return!1;j=d[a[g]].toString();return 1>j.length||1>d[a[g]]||31<d[a[g]]||2==d[a[i]]&&d[a[g]]>(0===d[a[e]]%4&&(0!==d[a[e]]%100||0===d[a[e]]%400)?29:28)||d[a[g]]>h[d[a[i]]]?!1:!0},isEmpty:function(a){return a.match(/^\s+$/)||""===a?!0:!1},checkTime:function(a){var b=/^(\d{1,2}):(\d{2})([ap]m)?$/;if(!this.isEmpty(a))if(a=
  a.match(b)){if(a[3]){if(1>a[1]||12<a[1])return!1}else if(23<a[1])return!1;if(59<a[2])return!1}else return!1;return!0},checkValues:function(c,b,d,e,f){var g,i;if("undefined"===typeof e)if("string"==typeof b)for(e=0,f=d.p.colModel.length;e<f;e++){if(d.p.colModel[e].name==b){g=d.p.colModel[e].editrules;b=e;try{i=d.p.colModel[e].formoptions.label}catch(h){}break}}else{if(0<=b)g=d.p.colModel[b].editrules}else g=e,i=void 0===f?"_":f;if(g){i||(i=d.p.colNames[b]);if(!0===g.required&&this.isEmpty(c))return[!1,
  i+": "+a.jgrid.edit.msg.required,""];e=!1===g.required?!1:!0;if(!0===g.number&&!(!1===e&&this.isEmpty(c))&&isNaN(c))return[!1,i+": "+a.jgrid.edit.msg.number,""];if("undefined"!=typeof g.minValue&&!isNaN(g.minValue)&&parseFloat(c)<parseFloat(g.minValue))return[!1,i+": "+a.jgrid.edit.msg.minValue+" "+g.minValue,""];if("undefined"!=typeof g.maxValue&&!isNaN(g.maxValue)&&parseFloat(c)>parseFloat(g.maxValue))return[!1,i+": "+a.jgrid.edit.msg.maxValue+" "+g.maxValue,""];if(!0===g.email&&!(!1===e&&this.isEmpty(c))&&
  (f=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
  !f.test(c)))return[!1,i+": "+a.jgrid.edit.msg.email,""];if(!0===g.integer&&!(!1===e&&this.isEmpty(c))&&(isNaN(c)||0!==c%1||-1!=c.indexOf(".")))return[!1,i+": "+a.jgrid.edit.msg.integer,""];if(!0===g.date&&!(!1===e&&this.isEmpty(c))&&(b=d.p.colModel[b].formatoptions&&d.p.colModel[b].formatoptions.newformat?d.p.colModel[b].formatoptions.newformat:d.p.colModel[b].datefmt||"Y-m-d",!this.checkDate(b,c)))return[!1,i+": "+a.jgrid.edit.msg.date+" - "+b,""];if(!0===g.time&&!(!1===e&&this.isEmpty(c))&&!this.checkTime(c))return[!1,
  i+": "+a.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(!0===g.url&&!(!1===e&&this.isEmpty(c))&&(f=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i,!f.test(c)))return[!1,i+": "+a.jgrid.edit.msg.url,""];if(!0===g.custom&&!(!1===e&&this.isEmpty(c)))return a.isFunction(g.custom_func)?(c=g.custom_func.call(d,c,i),a.isArray(c)?c:[!1,a.jgrid.edit.msg.customarray,""]):[!1,a.jgrid.edit.msg.customfcheck,""]}return[!0,"",""]}})})(jQuery);
  (function(a){a.fn.jqFilter=function(c){if("string"===typeof c){var b=a.fn.jqFilter[c];if(!b)throw"jqFilter - No such method: "+c;var d=a.makeArray(arguments).slice(1);return b.apply(this,d)}var e=a.extend(!0,{filter:null,columns:[],onChange:null,checkValues:null,error:!1,errmsg:"",errorcheck:!0,showQuery:!0,sopt:null,ops:[{name:"eq",description:"equal",operator:"="},{name:"ne",description:"not equal",operator:"<>"},{name:"lt",description:"less",operator:"<"},{name:"le",description:"less or equal",
  operator:"<="},{name:"gt",description:"greater",operator:">"},{name:"ge",description:"greater or equal",operator:">="},{name:"bw",description:"begins with",operator:"LIKE"},{name:"bn",description:"does not begin with",operator:"NOT LIKE"},{name:"in",description:"in",operator:"IN"},{name:"ni",description:"not in",operator:"NOT IN"},{name:"ew",description:"ends with",operator:"LIKE"},{name:"en",description:"does not end with",operator:"NOT LIKE"},{name:"cn",description:"contains",operator:"LIKE"},{name:"nc",
  description:"does not contain",operator:"NOT LIKE"},{name:"nu",description:"is null",operator:"IS NULL"},{name:"nn",description:"is not null",operator:"IS NOT NULL"}],numopts:"eq,ne,lt,le,gt,ge,nu,nn,in,ni".split(","),stropts:"eq,ne,bw,bn,ew,en,cn,nc,nu,nn,in,ni".split(","),_gridsopt:[],groupOps:["AND","OR"],groupButton:!0},c||{});return this.each(function(){if(!this.filter){this.p=e;if(null===this.p.filter||void 0===this.p.filter)this.p.filter={groupOp:this.p.groupOps[0],rules:[],groups:[]};var b,
  c=this.p.columns.length,d,h=/msie/i.test(navigator.userAgent)&&!window.opera;if(this.p._gridsopt.length)for(b=0;b<this.p._gridsopt.length;b++)this.p.ops[b].description=this.p._gridsopt[b];this.p.initFilter=a.extend(!0,{},this.p.filter);if(c){for(b=0;b<c;b++){d=this.p.columns[b];if(d.stype)d.inputtype=d.stype;else if(!d.inputtype)d.inputtype="text";if(d.sorttype)d.searchtype=d.sorttype;else if(!d.searchtype)d.searchtype="string";if(void 0===d.hidden)d.hidden=!1;if(!d.label)d.label=d.name;if(d.index)d.name=
  d.index;if(!d.hasOwnProperty("searchoptions"))d.searchoptions={};if(!d.hasOwnProperty("searchrules"))d.searchrules={}}this.p.showQuery&&a(this).append("<table class='queryresult ui-widget ui-widget-content' style='display:block;max-width:440px;border:0px none;'><tbody><tr><td class='query'></td></tr></tbody></table>");var j=function(b,d){var c=[!0,""];if(a.isFunction(d.searchrules))c=d.searchrules(b,d);else if(a.jgrid&&a.jgrid.checkValues)try{c=a.jgrid.checkValues(b,-1,null,d.searchrules,d.label)}catch(f){}if(c&&
  c.length&&!1===c[0])e.error=!c[0],e.errmsg=c[1]};this.onchange=function(){this.p.error=!1;this.p.errmsg="";return a.isFunction(this.p.onChange)?this.p.onChange.call(this,this.p):!1};this.reDraw=function(){a("table.group:first",this).remove();var b=this.createTableForGroup(e.filter,null);a(this).append(b)};this.createTableForGroup=function(b,c){var d=this,f,g=a("<table class='group ui-widget ui-widget-content' style='border:0px none;'><tbody></tbody></table>");null===c&&a(g).append("<tr class='error' style='display:none;'><th colspan='5' class='ui-state-error' align='left'></th></tr>");
  var h=a("<tr></tr>");a(g).append(h);var i=a("<th colspan='5' align='left'></th>");h.append(i);var j=a("<select class='opsel'></select>");i.append(j);var h="",v;for(f=0;f<e.groupOps.length;f++)v=b.groupOp===d.p.groupOps[f]?" selected='selected'":"",h+="<option value='"+d.p.groupOps[f]+"'"+v+">"+d.p.groupOps[f]+"</option>";j.append(h).bind("change",function(){b.groupOp=a(j).val();d.onchange()});h="<span></span>";this.p.groupButton&&(h=a("<input type='button' value='+ {}' title='Add subgroup' class='add-group'/>"),
  h.bind("click",function(){if(void 0===b.groups)b.groups=[];b.groups.push({groupOp:e.groupOps[0],rules:[],groups:[]});d.reDraw();d.onchange();return!1}));i.append(h);var h=a("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>"),C;h.bind("click",function(){if(void 0===b.rules)b.rules=[];for(f=0;f<d.p.columns.length;f++){var a="undefined"===typeof d.p.columns[f].search?!0:d.p.columns[f].search,c=!0===d.p.columns[f].hidden;if(!0===d.p.columns[f].searchoptions.searchhidden&&a||a&&
  !c){C=d.p.columns[f];break}}b.rules.push({field:C.name,op:(C.searchoptions.sopt?C.searchoptions.sopt:d.p.sopt?d.p.sopt:"string"===C.searchtype?d.p.stropts:d.p.numopts)[0],data:""});d.reDraw();return!1});i.append(h);null!==c&&(h=a("<input type='button' value='-' title='Delete group' class='delete-group'/>"),i.append(h),h.bind("click",function(){for(f=0;f<c.groups.length;f++)if(c.groups[f]===b){c.groups.splice(f,1);break}d.reDraw();d.onchange();return!1}));if(void 0!==b.groups)for(f=0;f<b.groups.length;f++)i=
  a("<tr></tr>"),g.append(i),h=a("<td class='first'></td>"),i.append(h),h=a("<td colspan='4'></td>"),h.append(this.createTableForGroup(b.groups[f],b)),i.append(h);if(void 0===b.groupOp)b.groupOp=d.p.groupOps[0];if(void 0!==b.rules)for(f=0;f<b.rules.length;f++)g.append(this.createTableRowForRule(b.rules[f],b));return g};this.createTableRowForRule=function(b,d){var c=this,f=a("<tr></tr>"),g,i,j,k,v="",C;f.append("<td class='first'></td>");var F=a("<td class='columns'></td>");f.append(F);var fa=a("<select></select>"),
  O,X=[];F.append(fa);fa.bind("change",function(){b.field=a(fa).val();j=a(this).parents("tr:first");for(g=0;g<c.p.columns.length;g++)if(c.p.columns[g].name===b.field){k=c.p.columns[g];break}if(k){k.searchoptions.id=a.jgrid.randId();if(h&&"text"===k.inputtype&&!k.searchoptions.size)k.searchoptions.size=10;var d=a.jgrid.createEl(k.inputtype,k.searchoptions,"",!0,c.p.ajaxSelectOptions,!0);a(d).addClass("input-elm");i=k.searchoptions.sopt?k.searchoptions.sopt:c.p.sopt?c.p.sopt:"string"===k.searchtype?c.p.stropts:
  c.p.numopts;var e="",f="";X=[];a.each(c.p.ops,function(){X.push(this.name)});for(g=0;g<i.length;g++)if(O=a.inArray(i[g],X),-1!==O){f="";if(0===g)b.op=c.p.ops[O].name,f=" selected='selected'";e+="<option value='"+c.p.ops[O].name+"'"+f+">"+c.p.ops[O].description+"</option>"}a(".selectopts",j).empty().append(e);a(".data",j).empty().append(d);a(".input-elm",j).bind("change",function(){b.data=a(this).val();c.onchange()});setTimeout(function(){b.data=a(d).val();c.onchange()},0)}});for(g=F=0;g<c.p.columns.length;g++){C=
  "undefined"===typeof c.p.columns[g].search?!0:c.p.columns[g].search;var xa=!0===c.p.columns[g].hidden;if(!0===c.p.columns[g].searchoptions.searchhidden&&C||C&&!xa)C="",b.field===c.p.columns[g].name&&(C=" selected='selected'",F=g),v+="<option value='"+c.p.columns[g].name+"'"+C+">"+c.p.columns[g].label+"</option>"}fa.append(v);v=a("<td class='operators'></td>");f.append(v);k=e.columns[F];k.searchoptions.id=a.jgrid.randId();if(h&&"text"===k.inputtype&&!k.searchoptions.size)k.searchoptions.size=10;var F=
  a.jgrid.createEl(k.inputtype,k.searchoptions,b.data,!0,c.p.ajaxSelectOptions,!0),Y=a("<select class='selectopts'></select>");v.append(Y);Y.bind("change",function(){b.op=a(Y).val();j=a(this).parents("tr:first");var d=a(".input-elm",j)[0];"nu"===b.op||"nn"===b.op?(b.data="",d.value="",d.setAttribute("readonly","true"),d.setAttribute("disabled","true")):(d.removeAttribute("readonly"),d.removeAttribute("disabled"));c.onchange()});i=k.searchoptions.sopt?k.searchoptions.sopt:c.p.sopt?c.p.sopt:"string"===
  k.searchtype?e.stropts:c.p.numopts;v="";a.each(c.p.ops,function(){X.push(this.name)});for(g=0;g<i.length;g++)O=a.inArray(i[g],X),-1!==O&&(C=b.op===c.p.ops[O].name?" selected='selected'":"",v+="<option value='"+c.p.ops[O].name+"'"+C+">"+c.p.ops[O].description+"</option>");Y.append(v);v=a("<td class='data'></td>");f.append(v);v.append(F);a(F).addClass("input-elm").bind("change",function(){b.data=a(this).val();c.onchange()});v=a("<td></td>");f.append(v);F=a("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>");
  v.append(F);F.bind("click",function(){for(g=0;g<d.rules.length;g++)if(d.rules[g]===b){d.rules.splice(g,1);break}c.reDraw();c.onchange();return!1});return f};this.getStringForGroup=function(a){var b="(",c;if(void 0!==a.groups)for(c=0;c<a.groups.length;c++){1<b.length&&(b+=" "+a.groupOp+" ");try{b+=this.getStringForGroup(a.groups[c])}catch(d){alert(d)}}if(void 0!==a.rules)try{for(c=0;c<a.rules.length;c++)1<b.length&&(b+=" "+a.groupOp+" "),b+=this.getStringForRule(a.rules[c])}catch(e){alert(e)}b+=")";
  return"()"===b?"":b};this.getStringForRule=function(b){var c="",d="",f,g;for(f=0;f<this.p.ops.length;f++)if(this.p.ops[f].name===b.op){c=this.p.ops[f].operator;d=this.p.ops[f].name;break}for(f=0;f<this.p.columns.length;f++)if(this.p.columns[f].name===b.field){g=this.p.columns[f];break}f=b.data;if("bw"===d||"bn"===d)f+="%";if("ew"===d||"en"===d)f="%"+f;if("cn"===d||"nc"===d)f="%"+f+"%";if("in"===d||"ni"===d)f=" ("+f+")";e.errorcheck&&j(b.data,g);return-1!==a.inArray(g.searchtype,["int","integer","float",
  "number","currency"])||"nn"===d||"nu"===d?b.field+" "+c+" "+f:b.field+" "+c+' "'+f+'"'};this.resetFilter=function(){this.p.filter=a.extend(!0,{},this.p.initFilter);this.reDraw();this.onchange()};this.hideError=function(){a("th.ui-state-error",this).html("");a("tr.error",this).hide()};this.showError=function(){a("th.ui-state-error",this).html(this.p.errmsg);a("tr.error",this).show()};this.toUserFriendlyString=function(){return this.getStringForGroup(e.filter)};this.toString=function(){function a(c){var d=
  "(",f;if(void 0!==c.groups)for(f=0;f<c.groups.length;f++)1<d.length&&(d="OR"===c.groupOp?d+" || ":d+" && "),d+=a(c.groups[f]);if(void 0!==c.rules)for(f=0;f<c.rules.length;f++){1<d.length&&(d="OR"===c.groupOp?d+" || ":d+" && ");var e=c.rules[f];if(b.p.errorcheck){for(var g=void 0,h=void 0,g=0;g<b.p.columns.length;g++)if(b.p.columns[g].name===e.field){h=b.p.columns[g];break}h&&j(e.data,h)}d+=e.op+"(item."+e.field+",'"+e.data+"')"}d+=")";return"()"===d?"":d}var b=this;return a(this.p.filter)};this.reDraw();
  if(this.p.showQuery)this.onchange();this.filter=!0}}})};a.extend(a.fn.jqFilter,{toSQLString:function(){var a="";this.each(function(){a=this.toUserFriendlyString()});return a},filterData:function(){var a;this.each(function(){a=this.p.filter});return a},getParameter:function(a){return void 0!==a&&this.p.hasOwnProperty(a)?this.p[a]:this.p},resetFilter:function(){return this.each(function(){this.resetFilter()})},addFilter:function(a){"string"===typeof a&&(a=jQuery.jgrid.parse(a));this.each(function(){this.p.filter=
  a;this.reDraw();this.onchange()})}})})(jQuery);
  var xmlJsonClass={xml2json:function(a,c){if(9===a.nodeType)a=a.documentElement;var b=this.toJson(this.toObj(this.removeWhite(a)),a.nodeName,"\t");return"{\n"+c+(c?b.replace(/\t/g,c):b.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,c){var b=function(a,d,c){var e="",j,l;if(a instanceof Array)if(0===a.length)e+=c+"<"+d+">__EMPTY_ARRAY_</"+d+">\n";else for(j=0,l=a.length;j<l;j+=1)var m=c+b(a[j],d,c+"\t")+"\n",e=e+m;else if("object"===typeof a){j=!1;e+=c+"<"+d;for(l in a)a.hasOwnProperty(l)&&("@"===
  l.charAt(0)?e+=" "+l.substr(1)+'="'+a[l].toString()+'"':j=!0);e+=j?">":"/>";if(j){for(l in a)a.hasOwnProperty(l)&&("#text"===l?e+=a[l]:"#cdata"===l?e+="<![CDATA["+a[l]+"]]\>":"@"!==l.charAt(0)&&(e+=b(a[l],l,c+"\t")));e+=("\n"===e.charAt(e.length-1)?c:"")+"</"+d+">"}}else e="function"===typeof a?e+(c+"<"+d+"><![CDATA["+a+"]]\></"+d+">"):'""'===a.toString()||0===a.toString().length?e+(c+"<"+d+">__EMPTY_STRING_</"+d+">"):e+(c+"<"+d+">"+a.toString()+"</"+d+">");return e},d="",e;for(e in a)a.hasOwnProperty(e)&&
  (d+=b(a[e],e,""));return c?d.replace(/\t/g,c):d.replace(/\t|\n/g,"")},toObj:function(a){var c={},b=/function/i;if(1===a.nodeType){if(a.attributes.length){var d;for(d=0;d<a.attributes.length;d+=1)c["@"+a.attributes[d].nodeName]=(a.attributes[d].nodeValue||"").toString()}if(a.firstChild){var e=d=0,f=!1,g;for(g=a.firstChild;g;g=g.nextSibling)1===g.nodeType?f=!0:3===g.nodeType&&g.nodeValue.match(/[^ \f\n\r\t\v]/)?d+=1:4===g.nodeType&&(e+=1);if(f)if(2>d&&2>e){this.removeWhite(a);for(g=a.firstChild;g;g=
  g.nextSibling)3===g.nodeType?c["#text"]=this.escape(g.nodeValue):4===g.nodeType?b.test(g.nodeValue)?c[g.nodeName]=[c[g.nodeName],g.nodeValue]:c["#cdata"]=this.escape(g.nodeValue):c[g.nodeName]?c[g.nodeName]instanceof Array?c[g.nodeName][c[g.nodeName].length]=this.toObj(g):c[g.nodeName]=[c[g.nodeName],this.toObj(g)]:c[g.nodeName]=this.toObj(g)}else a.attributes.length?c["#text"]=this.escape(this.innerXml(a)):c=this.escape(this.innerXml(a));else if(d)a.attributes.length?c["#text"]=this.escape(this.innerXml(a)):
  (c=this.escape(this.innerXml(a)),"__EMPTY_ARRAY_"===c?c="[]":"__EMPTY_STRING_"===c&&(c=""));else if(e)if(1<e)c=this.escape(this.innerXml(a));else for(g=a.firstChild;g;g=g.nextSibling)if(b.test(a.firstChild.nodeValue)){c=a.firstChild.nodeValue;break}else c["#cdata"]=this.escape(g.nodeValue)}!a.attributes.length&&!a.firstChild&&(c=null)}else 9===a.nodeType?c=this.toObj(a.documentElement):alert("unhandled node type: "+a.nodeType);return c},toJson:function(a,c,b,d){void 0===d&&(d=!0);var e=c?'"'+c+'"':
  "",f="\t",g="\n";d||(g=f="");if("[]"===a)e+=c?":[]":"[]";else if(a instanceof Array){var i,h,j=[];for(h=0,i=a.length;h<i;h+=1)j[h]=this.toJson(a[h],"",b+f,d);e+=(c?":[":"[")+(1<j.length?g+b+f+j.join(","+g+b+f)+g+b:j.join(""))+"]"}else if(null===a)e+=(c&&":")+"null";else if("object"===typeof a){i=[];for(h in a)a.hasOwnProperty(h)&&(i[i.length]=this.toJson(a[h],h,b+f,d));e+=(c?":{":"{")+(1<i.length?g+b+f+i.join(","+g+b+f)+g+b:i.join(""))+"}"}else e="string"===typeof a?e+((c&&":")+'"'+a.replace(/\\/g,
  "\\\\").replace(/\"/g,'\\"')+'"'):e+((c&&":")+'"'+a.toString()+'"');return e},innerXml:function(a){var c="";if("innerHTML"in a)c=a.innerHTML;else for(var b=function(a){var c="",f;if(1===a.nodeType){c+="<"+a.nodeName;for(f=0;f<a.attributes.length;f+=1)c+=" "+a.attributes[f].nodeName+'="'+(a.attributes[f].nodeValue||"").toString()+'"';if(a.firstChild){c+=">";for(f=a.firstChild;f;f=f.nextSibling)c+=b(f);c+="</"+a.nodeName+">"}else c+="/>"}else 3===a.nodeType?c+=a.nodeValue:4===a.nodeType&&(c+="<![CDATA["+
  a.nodeValue+"]]\>");return c},a=a.firstChild;a;a=a.nextSibling)c+=b(a);return c},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();var c;for(c=a.firstChild;c;)if(3===c.nodeType)if(c.nodeValue.match(/[^ \f\n\r\t\v]/))c=c.nextSibling;else{var b=c.nextSibling;a.removeChild(c);c=b}else 1===c.nodeType&&this.removeWhite(c),c=c.nextSibling;return a}};
  (function(a){a.jqschedule={calendarid:"#calendar",eventid:"#event",calendarurl:"",locales:{dateFormat:"dd/MM/yyyy",bSave:"Save",bAdd:"Add",bDelete:"Delete",bCancel:"Cancel",bChange:"Change",bClose:"Close",bSearch:"Find",editCaption:"Edit event",addCaption:"Add new event",userCaption:"Change Calendar",searchCaption:"Advanced search"},searchCols:[],searchOpers:[],gotoDayEventView:function(c){a("#b_search_cal").trigger("click");c=a.fullCalendar.parseDate(parseInt(c,10));a(a.jqschedule.calendarid).fullCalendar("gotoDate",
  c.getFullYear(),c.getMonth(),c.getDate());a(a.jqschedule.calendarid).fullCalendar("changeView","agendaDay")},eventEditDialog:function(c){var b=a(a.jqschedule.eventid);a("input,textarea,select",b).val("");c.allDay?a("#endtime, #starttime",b).hide():a("#endtime, #starttime",b).show();a("#all_day",b).attr("checked",c.allDay);a("#title",b).val(c.title);setTimeout(function(){a("#description",b).val(c.description)},100);a("#location",b).val(c.location);a("#categories",b).val(c.className);a("#access",b).val(c.access);
  a("#start",b).val(a.fullCalendar.formatDate(c.start,a.jqschedule.locales.dateFormat));a("#starttime",b).val(a.fullCalendar.formatDate(c.start,"HH:mm"));a("#end",b).val(a.fullCalendar.formatDate(c.end?c.end:c.start,a.jqschedule.locales.dateFormat));a("#endtime").val(a.fullCalendar.formatDate(c.end?c.end:c.start,"HH:mm"));a("#user_id",b).val(c.user_id);var d={},e=a("#start",b).datepicker("option","dateFormat"),f;d[a.jqschedule.locales.bSave]=function(){var d=a.datepicker.parseDate(e,a("#start",b).val()),
  i=a("#starttime",b).val(),i=i?i.split(":"):["0","0"];d.setHours(parseInt(i[0],10),parseInt(i[1],10));(i=a.datepicker.parseDate(e,a("#end",b).val()))||(i=a.datepicker.parseDate(e,a("#start",b).val()));var h=a("#endtime",b).val(),h=h?h.split(":"):["0","0"];i.setHours(parseInt(h[0],10),parseInt(h[1],10));0>i.getTime()-d.getTime()?alert("End time is little than start time"):(c.start=d,c._start=d,c.end=i,c._end=i,c.allDay=a("#all_day",b).attr("checked")?!0:!1,c.title=a("#title",b).val(),""==a.trim(c.title)?
  alert("Title is required"):(c.description=a("#description",b).val(),c.location=a("#location",b).val(),c.className=a("#categories",b).val(),c.access=a("#access",b).val(),c.user_id=a("#user_id",b).val(),f={},f.event_id=c.id,f.start=c.start.getTime()/1E3,f.end=c.end.getTime()/1E3,f.title=c.title,f.description=c.description,f.location=c.location,f.categories=a("#categories",b).val(),f.access=c.access,f.user_id=c.user_id,f.all_day=c.allDay?1:0,f.oper="editEvent",a.ajax({url:a.jqschedule.calendarurl,data:f,
  dataType:"json",type:"post",success:function(){a(a.jqschedule.calendarid).fullCalendar("updateEvent",c);b.dialog("close")}})))};d[a.jqschedule.locales.bDelete]=function(){f={};f.event_id=c.id;f.oper="removeEvent";a.ajax({url:a.jqschedule.calendarurl,data:f,dataType:"json",type:"post"});a(a.jqschedule.calendarid).fullCalendar("removeEvents",c.id);b.dialog("close")};d[a.jqschedule.locales.bCancel]=function(){b.dialog("close")};b.dialog({modal:!0,width:490,closeOnEscape:!1,position:{at:"center bottom",
  of:a.jqschedule.calendarid},title:a.jqschedule.locales.editCaption,close:function(){b.dialog("destroy");b.hide();b=null},buttons:d}).show();a(".ui-dialog").css("font-size","12px");return!1},eventViewDialog:function(c){var b=a(a.jqschedule.eventid);a("input,textarea,select",b).val("");c.allDay?a("#endtime, #starttime",b).hide():a("#endtime, #starttime",b).show();a("#all_day",b).attr("checked",c.allDay);a("#title",b).val(c.title);setTimeout(function(){a("#description",b).val(c.description)},100);a("#location",
  b).val(c.location);a("#categories",b).val(c.className);a("#access",b).val(c.access);a("#start",b).val(a.fullCalendar.formatDate(c.start,a.jqschedule.locales.dateFormat));a("#starttime",b).val(a.fullCalendar.formatDate(c.start,"HH:mm"));a("#end",b).val(a.fullCalendar.formatDate(c.end?c.end:c.start,a.jqschedule.locales.dateFormat));a("#endtime").val(a.fullCalendar.formatDate(c.end?c.end:c.start,"HH:mm"));a("#user_id",b).val(c.user_id);var d={};d[a.jqschedule.locales.bClose]=function(){b.dialog("close")};
  b.dialog({modal:!0,width:490,closeOnEscape:!1,position:{at:"center bottom",of:a.jqschedule.calendarid},title:a.jqschedule.locales.editCaption,close:function(){b.dialog("destroy");b.hide();b=null},buttons:d}).show();a(".ui-dialog").css("font-size","12px");return!1},eventAddDialog:function(c,b){var d=a(a.jqschedule.eventid);a("input,textarea,select",d).val("");b?a("#endtime, #starttime",d).hide():a("#endtime, #starttime",d).show();a("#all_day",d).attr("checked",b);setTimeout(function(){a("#description",
  d).val("")},100);a("#start",d).val(a.fullCalendar.formatDate(c,a.jqschedule.locales.dateFormat));a("#starttime",d).val(a.fullCalendar.formatDate(c,"HH:mm"));a("#end",d).val(a.fullCalendar.formatDate(c,a.jqschedule.locales.dateFormat));a("#endtime",d).val(a.fullCalendar.formatDate(c,"HH:mm"));var e=a("#switchuser").val();a.isArray(e)&&(e=e[0]);a("#user_id",d).val(e);var e={},f=a("#start",d).datepicker("option","dateFormat"),g,i;e[a.jqschedule.locales.bAdd]=function(){i={};var b=a.datepicker.parseDate(f,
  a("#start",d).val()),c=a("#starttime",d).val(),c=c?c.split(":"):["0","0"];b.setHours(parseInt(c[0],10),parseInt(c[1],10));(c=a.datepicker.parseDate(f,a("#end",d).val()))||(c=a.datepicker.parseDate(f,a("#start",d).val()));var e=a("#endtime").val(),e=e?e.split(":"):["0","0"];c.setHours(parseInt(e[0],10),parseInt(e[1],10));0>c.getTime()-b.getTime()?alert("End time is little than start time"):(i.start=b,i._start=b,i.end=c,i._end=c,i.allDay=a("#all_day",d).attr("checked")?!0:!1,i.title=a("#title",d).val(),
  ""==a.trim(i.title)?alert("Title is required"):(i.description=a("#description",d).val(),i.location=a("#location",d).val(),i.className=a("#categories",d).val(),i.access=a("#access",d).val(),i.user_id=a("#user_id",d).val(),g={},g.start=i.start.getTime()/1E3,g.end=i.end.getTime()/1E3,g.title=i.title,g.description=i.description,g.location=i.location,g.categories=a("#categories",d).val(),g.access=i.access,g.user_id=i.user_id,g.all_day=i.allDay?1:0,g.oper="newEvent",a.ajax({url:a.jqschedule.calendarurl,
  data:g,dataType:"json",type:"POST",success:function(b){if(b.event_id)i.id=b.event_id,i._id=b.event_id,a(a.jqschedule.calendarid).fullCalendar("renderEvent",i,!1),d.dialog("close")}})))};e[a.jqschedule.locales.bCancel]=function(){d.dialog("close")};d.dialog({modal:!0,width:490,position:{at:"center bottom",of:a.jqschedule.calendarid},closeOnEscape:!1,title:a.jqschedule.locales.addCaption,close:function(){d.dialog("destroy");d.hide();d=null},buttons:e}).show();a(".ui-dialog").css("font-size","12px")},
  eventLoading:function(c){if(c){var c=a(".calwrapper").width(),b=a(".calwrapper").height()+10;a("body").append('<div class="ui-widget-overlay" style="width:'+c+"px;height:"+b+'px;z-index: 1001;"></div>');a("#progresspar").show()}else a(".ui-widget-overlay").remove(),a("#progresspar").hide()},eventDrop:function(c,b,d,e){if(null==c.end)c.end=c.start;a.ajax({url:a.jqschedule.calendarurl,data:{oper:"moveEvent",event_id:c.id,start:c.start.getTime()/1E3,end:c.end.getTime()/1E3,all_day:e?1:0},dataType:"json",
  type:"post"})},eventResize:function(c){a.ajax({url:a.jqschedule.calendarurl,data:{oper:"resizeEvent",event_id:c.id,start:c.start.getTime()/1E3,end:c.end.getTime()/1E3},dataType:"json",type:"post"})},eventRender:function(a,b){try{a.description&&b.tooltip({position:{my:"left bottom",at:"center top",offset:"-30 -10",of:b},content:function(){return a.description}})}catch(d){}},changeCalendarUser:function(){var c=a("#caluser");c.dialog({modal:!0,width:400,title:a.jqschedule.locales.userCaption,close:function(){c.dialog("destroy");
  c.hide();c=null},buttons:[{text:a.jqschedule.locales.bChange,click:function(){var b=a("#switchuser",this).val();a.ajax({url:a.jqschedule.calendarurl,data:{_user_id:b,oper:"switchUser"},dataType:"json",type:"post",success:function(){a(a.jqschedule.calendarid).fullCalendar("refetchEvents");a("#common_search").val("");a(".fnd-results").html("");a("#search_table").empty();var b=a("#switchuser option:selected");if(1>=b.length)a("#cal_user").html("<li>"+b.text()+"</li>");else{var c="";a.each(b,function(){c+=
  "<li>"+a(this).text()+"</li>"});a("#cal_user").html(c)}}});c.dialog("close")}},{text:a.jqschedule.locales.bCancel,click:function(){c.dialog("close")}}]}).show();a(".ui-dialog, .ui-dialog-buttonpane").css("font-size","12px");return!1},printEvents:function(){if(a("#b_search_cal").hasClass("ui-state-active")){var c=a("#common_search").val(),b="simple";if(""==c){var b="complex",d=a("#search_cal");if(d){d=d.jqFilter("filterData");if(!d.rules.length)return!1;try{c=xmlJsonClass.toJson(d,"","",!1)}catch(e){try{c=
  JSON.stringify(d)}catch(f){}}}}window.location=a.jqschedule.calendarurl+"?oper=printEvents&stype="+b+"&search=true&svalue="+c}else b=jQuery(a.jqschedule.calendarid).fullCalendar("getView"),c=b.start.getTime()/1E3,b=b.end.getTime()/1E3,window.location=a.jqschedule.calendarurl+"?oper=printEvents&start="+c+"&end="+b;return!1},exportEvents:function(){if(a("#b_search_cal").hasClass("ui-state-active")){var c=a("#common_search").val(),b="simple";if(""==c){var b="complex",d=a("#search_cal");if(d){d=d.jqFilter("filterData");
  if(!d.rules.length)return!1;try{c=xmlJsonClass.toJson(d,"","",!1)}catch(e){try{c=JSON.stringify(d)}catch(f){}}}}window.location=a.jqschedule.calendarurl+"?oper=exportEvents&stype="+b+"&search=true&svalue="+c}else b=jQuery(a.jqschedule.calendarid).fullCalendar("getView"),c=b.start.getTime()/1E3,b=b.end.getTime()/1E3,window.location=a.jqschedule.calendarurl+"?oper=exportEvents&start="+c+"&end="+b;return!1},showSearch:function(){a("#common_search").val()&&(a("#common_search").val(""),a("#b_common_search").trigger("click"));
  a(this).addClass("ui-state-active");a(".fc-view-agendaWeek, .fc-view-agendaDay, .fc-view-basicDay, .fc-view-basickWeek, .fc-view-month, .fc-view-year").hide();a(".fc-view-search").show();a("#common_search").focus()},hideSearch:function(){a(this).removeClass("ui-state-active");var c=a(a.jqschedule.calendarid).fullCalendar("getView").name;a(".fc-view-search").hide();a(".fc-view-"+c).show()},_filSearchTable:function(c,b){a(b).empty();if(c&&c.length){a(".fnd-results").html(c.length);var d="";a.each(c,
  function(){var b=a.fullCalendar.parseDate(this.start),c=a.fullCalendar.parseDate(this.end),g=a.fullCalendar.formatDate(b,"HH:mm"),i=a.fullCalendar.formatDate(c,"HH:mm"),g=this.allDay?"all day":g+" - "+i,b=a.fullCalendar.formatDate(b,"ddd  dd MMM yyyy"),c=a.fullCalendar.formatDate(c,"ddd  dd MMM yyyy");b!=c&&(g+=" "+c);d+="<tr id='"+this.id+"'><th class='ui-event-cell ui-widget-content'><a href=\"javascript:jQuery.jqschedule.gotoDayEventView('"+this.start+"');\">"+b+"</a></th><td class='ui-event-time ui-widget-content'>"+
  g+"</td><td class='ui-event-title ui-widget-content'><a href=\"javascript:jQuery.jqschedule.editFromSearch('"+this.id+"');\" class='' style='border: 0px none;text-decoration:  underline;'>"+this.title+"</a></td>";d+="<td class='source' style='display:none;'>";d+=this.id+"~`"+this.title+"~`"+this.start+"~`"+this.end+"~`"+this.description+"~`"+this.location+"~`"+this.className+"~`"+this.access+"~`"+this.allDay+"~`"+this.user_id;d+="</td>";d+="</tr>"});a(b).append(d)}},doSimpleSearch:function(){var c=
  a("#common_search").val();c?a.ajax({url:a.jqschedule.calendarurl,data:{search:!0,stype:"simple",svalue:c,oper:"getEvent"},dataType:"json",type:"POST",success:function(b){a.jqschedule._filSearchTable(b,"#search_table")}}):(a(".fnd-results").html(""),a("#search_table").empty())},buildLocalSearch:function(){var c,b;a("label",a.jqschedule.eventid).each(function(d){c={};c.name=a(this).attr("for");c.label=a(this).html();"categories"==c.name||"access"==c.name?(c.inputtype="select",b={},a("#"+c.name+" option",
  a.jqschedule.eventid).each(function(){b[a(this).val()]=a(this).text()}),c.searchoptions={value:b}):"all_day"==c.name?(c.inputtype="select",b={1:"Yes","0":"No"},c.searchoptions={value:b}):"start"==c.name||"end"==c.name?(c.searchtype="date",c.searchoptions={size:20,sopt:["eq","gt","ge","lt","le"],dataInit:function(b){a(b).datetimepicker()}}):c.searchoptions={size:20};a.jqschedule.searchCols[d]=c})},advancedSearchDlg:function(){a("#search_cal").jqFilter({columns:a.jqschedule.searchCols,filter:{groupOp:"AND",
  rules:[{field:a.jqschedule.searchCols[0].name,op:"eq",data:""}]},_gridsopt:a.jqschedule.searchOpers});a("#search_cal").dialog({modal:!0,width:"auto",autoOpen:!1,title:a.jqschedule.locales.searchCaption,close:function(){},buttons:[{text:a.jqschedule.locales.bSearch,click:function(){var c=a("#search_cal"),b,d=c.jqFilter("filterData");if(d.rules.length){try{b=xmlJsonClass.toJson(d,"","",!1)}catch(e){try{b=JSON.stringify(d)}catch(f){}}b&&a.ajax({url:a.jqschedule.calendarurl,data:{search:!0,stype:"complex",
  svalue:b,oper:"getEvent"},dataType:"json",type:"POST",success:function(b){a.jqschedule._filSearchTable(b,"#search_table")}});c.dialog("close")}}},{text:a.jqschedule.locales.bClose,click:function(){a("#search_cal").dialog("close")}}]});a(".ui-dialog, .ui-dialog-buttonpane").css("font-size","12px")},editFromSearch:function(c){var b=a("tr#"+c+" td.source").html().split("~`"),d={};a.each("id,title,start,end,description,location,className,access,allDay,user_id".split(","),function(a){if("start"==this||
  "end"==this)b[a]=new Date(1E3*parseFloat(b[a]));"allDay"==this&&(b[a]="1"==b[a]?!0:!1);d[this]=b[a]});a.jqschedule.eventViewDialog(d)},openDaySearchDlg:function(c){var b=c.getTime()/1E3;c.setHours(23);c.setMinutes(23);var d=c.getTime()/1E3,e=a("#day_dialog");e.dialog({modal:!0,width:450,close:function(){e.dialog("destroy");e.hide();e=null},open:function(){a("#day_table").empty();a.ajax({url:a.jqschedule.calendarurl,data:{oper:"getEvent",start:b,end:d},dataType:"json",type:"POST",success:function(b){a.jqschedule._filSearchTable(b,
  "#day_table")}})},buttons:[{text:a.jqschedule.locales.bClose,click:function(){e.dialog("close")}}]}).show();a(".ui-dialog, .ui-dialog-buttonpane").css("font-size","12px")},eventsFunc:function(c,b,d){a.ajax({url:a.jqschedule.calendarurl,dataType:"json",type:"POST",data:{oper:"getEvent",start:c.getTime()/1E3,end:b.getTime()/1E3},success:function(a){d(a)}})},processScript:function(){a("#datepicker").datepicker({dateFormat:"yy-mm-dd",onSelect:function(c){c=c.split("-");a(a.jqschedule.calendarid).fullCalendar("gotoDate",
  parseInt(c[0],10),parseInt(c[1],10)-1,parseInt(c[2],10))}});a("#start, #end",a.jqschedule.eventid).datepicker();a("#all_day",a.jqschedule.eventid).click(function(){this.checked?a("#endtime, #starttime",a.jqschedule.eventid).val("00:00").hide():a("#endtime, #starttime",a.jqschedule.eventid).show()});a(".custbutton").height(a("table.fc-header").height());a("#b_user_change").click(jQuery.jqschedule.changeCalendarUser);a("#b_export_ical").click(jQuery.jqschedule.exportEvents);a("#b_print_cal").click(jQuery.jqschedule.printEvents);
  a(".fc-content",a.jqschedule.calendarid).append(a(".fc-view-search"));a("#b_search_cal").toggle(jQuery.jqschedule.showSearch,jQuery.jqschedule.hideSearch);a("#b_common_search").click(jQuery.jqschedule.doSimpleSearch);a("#b_adv_search").click(function(){a("#search_cal").dialog("open");return!1});a(".jq-button").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a.jqschedule.buildLocalSearch();a.jqschedule.advancedSearchDlg()}}})(jQuery);
  