/* FullCalendar v1.4.7 http://arshaw.com/fullcalendar/ Use fullcalendar.css for basic styling. For event drag & drop, required jQuery UI draggable. For event resizing, requires jQuery UI resizable. Copyright (c) 2009 Adam Shaw Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html Date: Mon Jul 5 16:07:40 2010 -0700 */ (function(o,K){function Ia(a,b){a._id=a._id||(a.id===K?"_fc"+Eb++:a.id+"");if(a.date){if(!a.start)a.start=a.date;delete a.date}a._start=q(a.start=ib(a.start));a.end=ib(a.end);if(a.end&&a.end<=a.start)a.end=null;a._end=a.end?q(a.end):null;if(a.allDay===K)a.allDay=b.allDayDefault;if(a.className){if(typeof a.className=="string")a.className=a.className.split(/\s+/)}else a.className=[]}function Wa(a,b,f,c){function g(m,e,j,r){N=m;L=e;ca=b.theme?"ui":"fc";O=b.weekends?0:1;ua=b.firstDay;if(ra=b.isRTL){ka= -1;R=L-1}else{ka=1;R=0}var s=A.start.getMonth(),I=Ga(new Date),E,B=q(A.visStart);if(U){t();e=U.find("tr").length;if(Ne){m="";for(e=e;e";for(E=0;E"+(r?"
":"")+"
 
";C(B,1);O&&da(B)}m+=""}U.append(m)}fa(U.find("td.fc-new").removeClass("fc-new")); B=q(A.visStart);U.find("td").each(function(){var W=o(this);if(N>1)B.getMonth()==s?W.removeClass("fc-other-month"):W.addClass("fc-other-month");+B==+I?W.removeClass("fc-not-today").addClass("fc-today").addClass(ca+"-state-highlight"):W.addClass("fc-not-today").removeClass("fc-today").removeClass(ca+"-state-highlight");W.find("div.fc-day-number").text(B.getDate());C(B,1);O&&da(B)});if(N==1){B=q(A.visStart);x.find("th").each(function(){o(this).text(oa(B,j,b));this.className=this.className.replace(/^fc-\w+(?= )/, "fc-"+za[B.getDay()]);C(B,1);O&&da(B)});B=q(A.visStart);U.find("td").each(function(){this.className=this.className.replace(/^fc-\w+(?= )/,"fc-"+za[B.getDay()]);C(B,1);O&&da(B)})}}else{var J=o("").appendTo(a);m="";for(e=0;e"+oa(B,j,b)+"";C(B,1);O&&da(B)}x=o(m+"").appendTo(J);m="";B=q(A.visStart);for(e=0;e";for(E=0;E"+(r?"
"+B.getDate()+"
":"")+"
 
";C(B,1);O&&da(B)}m+=""}U=o(m+"
").appendTo(J);fa(U.find("td"));P=o("
").appendTo(a)}}function n(m){Fa= m;m=U.find("tr td:first-child");var e=Fa-x.height(),j;if(b.weekMode=="variable")j=e=Math.floor(e/(N==1?2:6));else{j=Math.floor(e/N);e=e-j*(N-1)}if(Xa===K){var r=U.find("tr:first").find("td:first");r.height(j);Xa=j!=r.height()}if(Xa){m.slice(0,-1).height(j);m.slice(-1).height(e)}else{Sa(m.slice(0,-1),j);Sa(m.slice(-1),e)}}function k(m){va=m;la.clear();Ja(x.find("th").slice(0,-1),Aa=Math.floor(va/L))}function y(m){A.reportEvents(wa=m);M(H(m))}function w(m){t();M(H(wa),m)}function t(){A._clearEvents(); P.empty()}function H(m){var e=q(A.visStart),j=C(q(e),L),r=o.map(m,Pa),s,I,E,B,J,W,Ba=[];for(s=0;s"+(!Q.allDay&&D.isStart?""+Ka(Ha(Q.start,Q.end,f.option("timeFormat"),M))+"":"")+""+Ka(Q.title)+""+((Q.editable||Q.editable===K&&M.editable)&&!M.disableResizing&& o.fn.resizable?"
":"")+"
";D.left=ma;D.outerWidth=pa-ma}w[0].innerHTML=ga;g=w.children();for(G=0;G div").height(ca+t)}for(X=0;X
";for(l=0;l"+oa(h,i,b)+"";C(h,Y);La&&da(h,Y)}F+="";if(b.allDaySlot)F+="";F+="
  
"+b.allDayText+"
 
 
";A=o(F).appendTo(a);w(A.find("td"));W=o("
").appendTo(A);h=xb();var T=ba(q(h),Ua);ba(h,Da);F="";for(l=0;h"; ba(h,b.slotMinutes);e++}F+="
"+(!z||!u?oa(h,b.axisFormat):" ")+"
 
";aa=o("
").append(Z=o("
").append($=o(F))).appendTo(a);t(aa.find("td"));Ba=o("
").appendTo(Z);h=q(d);F="
";for(l=0;l
 
";C(h,Y);La&&da(h,Y)}F+="
";ia=o(F).appendTo(a)}}function n(){var d=xb(),i=q(d);i.setHours(b.firstHour);var h=O(d,i)+1;d=function(){aa.scrollTop(h)};d();setTimeout(d,0)}function k(d,i){E=d;$a={};aa.height(d-A.height());s=aa.find("tr:first div").height()+1;ia.css({top:A.find("tr").height(),height:d});i&&n()}function y(d){I=d;Qa.clear(); aa.width(d);$.width("");d=A.find("tr:first th");var i=ia.find("td"),h=aa[0].clientWidth;$.width(h);j=0;Ja(A.find("tr:lt(2) th:first").add(aa.find("tr:first th")).width("").each(function(){j=Math.max(j,o(this).outerWidth())}),j);r=Math.floor((h-j)/m);Ja(i.slice(0,-1),r);Ja(d.slice(1,-2),r);Ja(d.slice(-2,-1),h-j-r*(m-1));ia.css({left:j,width:h-j})}function w(d){d.click(H).mousedown(Fb)}function t(d){d.click(H).mousedown(ra)}function H(d){if(!v.option("selectable")){var i=Math.min(m-1,Math.floor((d.pageX- ia.offset().left)/r));i=C(q(v.visStart),i*Y+ta);var h=this.className.match(/fc-slot(\d+)/);if(h){h=parseInt(h[1])*b.slotMinutes;var p=Math.floor(h/60);i.setHours(p);i.setMinutes(h%60+Da);v.trigger("dayClick",this,i,false,d)}else v.trigger("dayClick",this,i,true,d)}}function M(d,i){v.reportEvents(J=d);var h,p=d.length,l=[],u=[];for(h=0;h"+Ka(Ha(d.start,d.end,v.option("timeFormat")))+""+Ka(d.title)+""+((d.editable||d.editable===K&&b.editable)&&!b.disableResizing&&o.fn.resizable?"
=
":"")+"
"}function pa(d,i,h){v.eventElementHandlers(d,i);if(d.editable||d.editable=== K&&b.editable){X(d,i,h.isStart);h.isEnd&&v.resizableDayEvent(d,i,r)}}function ga(d,i,h){v.eventElementHandlers(d,i);if(d.editable||d.editable===K&&b.editable){var p=i.find("span.fc-event-time");ca(d,i,p);h.isEnd&&ua(d,i,p)}}function X(d,i,h){if(!b.disableDragging&&i.draggable){var p,l=true,u;i.draggable({zIndex:9,opacity:v.option("dragOpacity","month"),revertDuration:b.dragRevertDuration,start:function(F,T){v.trigger("eventDragStart",i,d,F,T);v.hideEvents(d,i);p=i.width();Ea.start(function(S,V,ea, ja){i.draggable("option","revert",!S||!ea&&!ja);x();if(S){u=ja*Y;if(S.row){if(h&&l){Sa(i.width(r-10),s*Math.round((d.end?(d.end-d.start)/Hb:b.defaultEventMinutes)/b.slotMinutes));i.draggable("option","grid",[r,1]);l=false}}else{N(C(q(d.start),u),C(Pa(d),u));z()}}},F,"drag")},stop:function(F,T){var S=Ea.stop();x();v.trigger("eventDragStop",i,d,F,T);if(S&&(!l||u)){i.find("a").removeAttr("href");S=0;l||(S=Math.round((i.offset().top-Z.offset().top)/s)*b.slotMinutes+Da-(d.start.getHours()*60+d.start.getMinutes())); v.eventDrop(this,d,u,S,l,F,T)}else{z();o.browser.msie&&i.css("filter","");v.showEvents(d,i)}}});function z(){if(!l){i.width(p).height("").draggable("option","grid",null);l=true}}}}function ca(d,i,h){if(!b.disableDragging&&i.draggable){var p,l=false,u,z,F;i.draggable({zIndex:9,scroll:false,grid:[r,s],axis:m==1?"y":false,opacity:v.option("dragOpacity"),revertDuration:b.dragRevertDuration,start:function(V,ea){v.trigger("eventDragStart",i,d,V,ea);v.hideEvents(d,i);o.browser.msie&&i.find("span.fc-event-bg").hide(); p=i.position();z=F=0;Ea.start(function(ja,xa,ab,Ma){i.draggable("option","revert",!ja);x();if(ja){u=Ma*Y;if(b.allDaySlot&&!ja.row){if(!l){l=true;h.hide();i.draggable("option","grid",null)}N(C(q(d.start),u),C(Pa(d),u))}else S()}},V,"drag")},drag:function(V,ea){z=Math.round((ea.position.top-p.top)/s)*b.slotMinutes;if(z!=F){l||T(z);F=z}},stop:function(V,ea){var ja=Ea.stop();x();v.trigger("eventDragStop",i,d,V,ea);if(ja&&(u||z||l))v.eventDrop(this,d,u,l?0:z,l,V,ea);else{S();i.css(p);T(0);o.browser.msie&& i.css("filter","").find("span.fc-event-bg").css("display","");v.showEvents(d,i)}}});function T(V){var ea=ba(q(d.start),V),ja;if(d.end)ja=ba(q(d.end),V);h.text(Ha(ea,ja,v.option("timeFormat")))}function S(){if(l){h.css("display","");i.draggable("option","grid",[r,s]);l=false}}}}function ua(d,i,h){if(!b.disableResizing&&i.resizable){var p,l;i.resizable({handles:{s:"div.ui-resizable-s"},grid:s,start:function(u,z){p=l=0;v.hideEvents(d,i);o.browser.msie&&o.browser.version=="6.0"&&i.css("overflow","hidden"); i.css("z-index",9);v.trigger("eventResizeStart",this,d,u,z)},resize:function(u,z){p=Math.round((Math.max(s,i.height())-z.originalSize.height)/s);if(p!=l){h.text(Ha(d.start,!p&&!d.end?null:ba(v.eventEnd(d),b.slotMinutes*p),v.option("timeFormat")));l=p}},stop:function(u,z){v.trigger("eventResizeStop",this,d,u,z);if(p)v.eventResize(this,d,0,b.slotMinutes*p,u,z);else{i.css("z-index",8);v.showEvents(d,i)}}})}}function O(d,i){d=q(d,true);if(i=ba(q(d),Ua))return Z.height();d=b.slotMinutes; i=i.getHours()*60+i.getMinutes()-Da;var h=Math.floor(i/d),p=$a[h];if(p===K)p=$a[h]=aa.find("tr:eq("+h+") td div")[0].offsetTop;return Math.max(0,Math.round(p-1+s*(i%d/d)))}function ra(d){if(v.option("selectable")){R(d);var i=this,h;Ea.start(function(p,l){Fa();if(p&&p.col==l.col&&!la(p)){l=P(l);p=P(p);h=[l,ba(q(l),b.slotMinutes),p,ba(q(p),b.slotMinutes)].sort(zb);va(h[0],h[3])}else h=null},d);o(document).one("mouseup",function(p){Ea.stop();if(h){+h[0]==+h[1]&&v.trigger("dayClick",i,h[0],false,p);ka(h[0], h[3],false,p)}})}}function ka(d,i,h,p){cb=true;v.trigger("select",v,d,i,h,p)}function R(d){if(cb){Fa();cb=false;v.trigger("unselect",v,d)}}function va(d,i){var h=v.option("selectHelper");if(h){var p=Ca(d,v.visStart)*Y+ta;if(p>=0&&pl){p.top=l;p.height=u-l;p.left+=2;p.width-=5;if(o.isFunction(h)){if(d=h(d,i)){p.position="absolute";p.zIndex=8;qa=o(d).css(p).appendTo(Z)}}else{qa=o(ma({title:"",start:d,end:i,className:[],editable:false},p,"fc-event fc-event-vert fc-corner-top fc-corner-bottom ")); o.browser.msie&&qa.find("span.fc-event-bg").hide();qa.css("opacity",v.option("dragOpacity"))}if(qa){t(qa);Z.append(qa);Ja(qa,p.width,true);Sa(qa,p.height,true)}}}}else Aa(d,i)}function Fa(){x();if(qa){qa.remove();qa=null}}function N(d,i){var h;if(Ta){h=Ca(i,v.visStart)*Y+ta+1;d=Ca(d,v.visStart)*Y+ta+1}else{h=Ca(d,v.visStart);d=Ca(i,v.visStart)}h=Math.max(0,h);d=Math.min(m,d);h=0&&ba(i,Da+d*b.slotMinutes);return i}function la(d){return b.allDaySlot&& !d.row}var A,aa,Z,$,ia,m,e=0,j,r,s,I,E,B,J=[],W,Ba,na,vb,La,Ta,Y,ta,Da,Ua,Qa=new kb(function(d){return ia.find("td:eq("+d+") div div")}),$a={},v=o.extend(this,lb,f,{renderAgenda:g,renderEvents:M,rerenderEvents:sa,clearEvents:G,setHeight:k,setWidth:y,beforeHide:function(){B=aa.scrollTop()},afterShow:function(){aa.scrollTop(B)},defaultEventEnd:function(d){var i=q(d.start);if(d.allDay)return i;return ba(i,b.defaultEventMinutes)}});v.name=c;v.init(a,b);mb(a.addClass("fc-agenda"));var Ra=new nb(function(d, i){function h(V){return Math.max(F,Math.min(T,V))}var p,l,u;ia.find("td").each(function(V,ea){p=o(ea);l=p.offset().left;if(V)u[1]=l;u=[l];i[V]=u});u[1]=l+p.outerWidth();if(b.allDaySlot){p=A.find("td");l=p.offset().top;d[0]=[l,l+p.outerHeight()]}for(var z=Z.offset().top,F=aa.offset().top,T=F+aa.outerHeight(),S=0;S0;b--){g=a[b];for(f=0;fb.start&&a.start=f[w][0]&&n=c[w][0]&&g=0&&H>=0?{row:t,col:H}:null};b.rect=function(g,n,k,y,w){w=w.offset();return{top:f[g][0]-w.top,left:c[n][0]-w.left,width:c[y][1]-c[n][0],height:f[k][1]-f[g][0]}}} function ob(a){function b(y){y=a.cell(y.pageX,y.pageY);if(!y!=!k||y&&(y.row!=k.row||y.col!=k.col)){if(y){n||(n=y);g(y,n,y.row-n.row,y.col-n.col)}else g(y,n);k=y}}var f=this,c,g,n,k;f.start=function(y,w,t){g=y;n=k=null;a.build();b(w);c=t||"mousemove";o(document).bind(c,b)};f.stop=function(){o(document).unbind(c,b);return k}}function Na(a){return(a<10?"0":"")+a}function hb(a,b){if(a[b]!==K)return a[b];b=b.split(/(?=[A-Z])/);for(var f=b.length-1,c;f>=0;f--){c=a[b[f].toLowerCase()];if(c!==K)return c}return a[""]} function Ka(a){return a.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function kb(a){function b(k){return c[k]=c[k]||a(k)}var f=this,c={},g={},n={};f.left=function(k){return g[k]=g[k]===K?b(k).position().left:g[k]};f.right=function(k){return n[k]=n[k]===K?f.left(k)+b(k).width():n[k]};f.clear=function(){c={};g={};n={}}}function sb(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig, "")}function zb(a,b){return a-b}function Pa(a){return a.end?Lb(a.end,a.allDay):C(q(a.start),1)}function Lb(a,b){a=q(a);return b||a.getHours()||a.getMinutes()?C(a,1):Ga(a)}function mb(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})}var ya=o.fullCalendar={},Oa=ya.views={},Va={defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:true,allDayDefault:true,lazyFetching:true,startParam:"start",endParam:"end", titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '—'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:false,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:" ◄ ",next:" ► ",prevYear:" << ",nextYear:" >> ",today:"today",month:"month",week:"week",day:"day"},theme:false,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:true,dropAccept:"*"},Mb={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:" ► ",next:" ◄ ",prevYear:" >> ", nextYear:" << "},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},Db=ya.setDefaults=function(a){o.extend(true,Va,a)};o.fn.fullCalendar=function(a){if(typeof a=="string"){var b=Array.prototype.slice.call(arguments,1),f;this.each(function(){var n=o.data(this,"fullCalendar");if(n)if(n=n[a]){n=n.apply(this,b);if(f===K)f=n}});if(f!==K)return f;return this}var c=a.eventSources||[];delete a.eventSources;if(a.events){c.push(a.events);delete a.events}c.unshift([]);a=o.extend(true, {},Va,a.isRTL||a.isRTL===K&&Va.isRTL?Mb:{},a);var g=a.theme?"ui":"fc";this.each(function(){function n(e){if(e!=Aa){N++;t();var j=x,r;if(j){if(j.eventsChanged){M();j.eventDirty=j.eventsChanged=false}j.beforeHide&&j.beforeHide();gb(R,R.height());j.element.hide()}else gb(R,1);R.css("overflow","hidden");if(U[e])(x=U[e]).element.show();else x=U[e]=ya.views[e](r=wa=o("
").appendTo(R),a,e);if($){$.find("div.fc-button-"+Aa).removeClass(g+"-state-active"); $.find("div.fc-button-"+e).addClass(g+"-state-active")}Aa=e;k();R.css("overflow","");j&&gb(R,1);!r&&x.afterShow&&x.afterShow();N--}}function k(e){if(y()){N++;t();va===K&&ga();if(!x.start||e||L=x.end){x.render(L,e||0);X(true);!la||!a.lazyFetching||x.visStartA?Q():x.renderEvents(P)}else if(x.sizeDirty||x.eventsDirty||!a.lazyFetching){x.clearEvents();x.sizeDirty&&X();a.lazyFetching?x.renderEvents(P):Q()}ka=ra.outerWidth();x.sizeDirty=false;x.eventsDirty=false;if($){$.find("h2.fc-header-title").html(x.title); e=new Date;e>=x.start&&e");o.each(e.split(" "),function(r){r>0&&j.append("");var s;o.each(this.split(","),function(I, E){if(E=="title"){j.append("

 

");s&&s.addClass(g+"-corner-right");s=null}else{var B;if(Z[E])B=Z[E];else if(Oa[E])B=function(){J.removeClass(g+"-state-hover");n(E)};if(B){s&&s.addClass(g+"-no-right");var J;I=a.theme?hb(a.buttonIcons,E):null;var W=hb(a.buttonText,E);if(I)J=o("
");else if(W)J=o(""); if(J){J.click(function(){J.hasClass(g+"-state-disabled")||B()}).mousedown(function(){J.not("."+g+"-state-active").not("."+g+"-state-disabled").addClass(g+"-state-down")}).mouseup(function(){J.removeClass(g+"-state-down")}).hover(function(){J.not("."+g+"-state-active").not("."+g+"-state-disabled").addClass(g+"-state-hover")},function(){J.removeClass(g+"-state-hover").removeClass(g+"-state-down")}).appendTo(o("").appendTo(j));s?s.addClass(g+"-no-right"):J.addClass(g+"-corner-left");s=J}}}});s&& s.addClass(g+"-corner-right")});return o("").append(j)}}function ga(){va=a.contentHeight?a.contentHeight:a.height?a.height-($?$.height():0)-bb(R[0]):Math.round(R.width()/Math.max(a.aspectRatio,0.5))}function X(e){N++;x.setHeight(va,e);if(wa){wa.css("position","relative");wa=null}x.setWidth(R.width(),e);N--}function ca(){if(!N)if(x.start){var e=++Fa;setTimeout(function(){if(e==Fa&&!N&&y())if(ka!=(ka=ra.outerWidth())){N++;sa();x.trigger("windowResize",O);N--}},200)}else ua()}function ua(){setTimeout(function(){!x.start&& w()&&k()},0)}var O=this,ra=o(O).addClass("fc"),ka,R=o("
").prependTo(O),va,Fa=0,N=0,L=new Date,Aa,x,U={},wa;a.isRTL&&ra.addClass("fc-rtl");a.theme&&ra.addClass("ui-widget");Cb(L,a.year,a.month,a.date);var P=[],la,A,aa=0,Z={render:function(){ga();G();M();k()},changeView:n,getView:function(){return x},getDate:function(){return L},option:function(e,j){if(j===K)return a[e];if(e=="height"||e=="contentHeight"||e=="aspectRatio"){a[e]= j;sa()}},destroy:function(){o(window).unbind("resize",ca);$&&$.remove();R.remove();o.removeData(O,"fullCalendar")},prev:function(){k(-1)},next:function(){k(1)},prevYear:function(){db(L,-1);k()},nextYear:function(){db(L,1);k()},today:function(){L=new Date;k()},gotoDate:function(e,j,r){if(typeof e=="object")L=q(e);else Cb(L,e,j,r);k()},incrementDate:function(e,j,r){e!==K&&db(L,e);j!==K&&eb(L,j);r!==K&&C(L,r);k()},updateEvent:function(e){var j,r=P.length,s,I=e.start-e._start,E=e.end?e.end-(e._end||x.defaultEventEnd(e)): 0;for(j=0;j").append(o("
").append(o("
").append(pa(ia.left))).append(o("").append(pa(ia.center))).append(o("").append(pa(ia.right)))).prependTo(ra);o(window).resize(ca);if(a.droppable){var m;o(document).bind("dragstart",function(e,j){var r=e.target,s=o(r);if(!s.parents(".fc").length){var I=a.dropAccept; if(o.isFunction(I)?I.call(r,s):s.is(I)){m=r;x.dragStart(m,e,j)}}}).bind("dragstop",function(e,j){if(m){x.dragStop(m,e,j);m=null}})}n(a.defaultView);w()||ua()});return this};var Eb=0;Db({weekMode:"fixed"});Oa.month=function(a,b,f){return new Wa(a,b,{render:function(c,g){if(g){eb(c,g);c.setDate(1)}c=this.start=q(c,true);c.setDate(1);this.end=eb(q(c),1);var n=this.visStart=q(c);g=this.visEnd=q(this.end);var k=b.weekends?0:1;if(k){da(n);da(g,-1,true)}C(n,-((n.getDay()-Math.max(b.firstDay,k)+7)%7));C(g, (7-g.getDay()+Math.max(b.firstDay,k))%7);n=Math.round((g-n)/(Bb*7));if(b.weekMode=="fixed"){C(g,(6-n)*7);n=6}this.title=oa(c,this.option("titleFormat"),b);this.renderGrid(n,b.weekends?7:5,this.option("columnFormat"),true)}},f)};Oa.basicWeek=function(a,b,f){return new Wa(a,b,{render:function(c,g){g&&C(c,g*7);c=this.visStart=q(this.start=C(q(c),-((c.getDay()-b.firstDay+7)%7)));g=this.visEnd=q(this.end=C(q(c),7));if(!b.weekends){da(c);da(g,-1,true)}this.title=Ha(c,C(q(g),-1),this.option("titleFormat"), b);this.renderGrid(1,b.weekends?7:5,this.option("columnFormat"),false)}},f)};Oa.basicDay=function(a,b,f){return new Wa(a,b,{render:function(c,g){if(g){C(c,g);b.weekends||da(c,g<0?-1:1)}this.title=oa(c,this.option("titleFormat"),b);this.start=this.visStart=q(c,true);this.end=this.visEnd=C(q(this.start),1);this.renderGrid(1,1,this.option("columnFormat"),false)}},f)};var Xa;Db({allDaySlot:true,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});Oa.agendaWeek=function(a,b,f){return new ub(a,b,{render:function(c,g){g&&C(c,g*7);c=this.visStart=q(this.start=C(q(c),-((c.getDay()-b.firstDay+7)%7)));g=this.visEnd=q(this.end=C(q(c),7));if(!b.weekends){da(c);da(g,-1,true)}this.title=Ha(c,C(q(g),-1),this.option("titleFormat"),b);this.renderAgenda(b.weekends?7:5,this.option("columnFormat"))}},f)};Oa.agendaDay=function(a,b,f){return new ub(a,b,{render:function(c,g){if(g){C(c,g);b.weekends||da(c,g<0?-1: 1)}this.title=oa(c,this.option("titleFormat"),b);this.start=this.visStart=q(c,true);this.end=this.visEnd=C(q(this.start),1);this.renderAgenda(1,this.option("columnFormat"))}},f)};var lb={init:function(a,b){this.element=a;this.options=b;this.eventsByID={};this.eventElements=[];this.eventElementsByID={};this.usedOverlays=[];this.unusedOverlays=[]},trigger:function(a,b){if(this.options[a])return this.options[a].apply(b||this,Array.prototype.slice.call(arguments,2).concat([this]))},eventEnd:function(a){return a.end? q(a.end):this.defaultEventEnd(a)},reportEvents:function(a){var b,f=a.length,c,g=this.eventsByID={};for(b=0;b")); f[0].parentNode!=b[0]&&f.appendTo(b);this.usedOverlays.push(f.css(a).show());return f},clearOverlays:function(){for(var a;a=this.usedOverlays.shift();)this.unusedOverlays.push(a.hide().unbind())},resizableDayEvent:function(a,b,f){var c=this;if(!c.options.disableResizing&&b.resizable)b.resizable({handles:c.options.isRTL?{w:"div.ui-resizable-w"}:{e:"div.ui-resizable-e"},grid:f,minWidth:f/2,containment:c.element.parent().parent(),start:function(g,n){b.css("z-index",9);c.hideEvents(a,b);c.trigger("eventResizeStart", this,a,g,n)},stop:function(g,n){c.trigger("eventResizeStop",this,a,g,n);var k=Math.round((b.width()-n.originalSize.width)/f);if(k)c.eventResize(this,a,k,0,g,n);else{b.css("z-index",8);c.showEvents(a,b)}}})},eventElementHandlers:function(a,b){var f=this;b.click(function(c){if(!b.hasClass("ui-draggable-dragging")&&!b.hasClass("ui-resizable-resizing"))return f.trigger("eventClick",this,a,c)}).hover(function(c){f.trigger("eventMouseover",this,a,c)},function(c){f.trigger("eventMouseout",this,a,c)})},option:function(a, b){a=this.options[a];if(typeof a=="object")return hb(a,b||this.name);return a},sliceSegs:function(a,b,f,c){var g=[],n,k=a.length,y,w,t,H,M;for(n=0;nf&&wc){t=q(c);M=false}else{t=t;M=true}g.push({event:y,start:w,end:t,isStart:H,isEnd:M,msLength:t-w})}}return g.sort(Ib)}},Bb=864E5,Jb=36E5,Hb=6E4;ya.addDays=C;ya.cloneDate=q;var ib=ya.parseDate=function(a){if(typeof a=="object")return a;if(typeof a=="number")return new Date(a* 1E3);if(typeof a=="string"){if(a.match(/^\d+$/))return new Date(parseInt(a)*1E3);return Nb(a,true)||(a?new Date(a):null)}return null},Nb=ya.parseISO8601=function(a,b){a=a.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?$/);if(!a)return null;var f=new Date(a[1],0,1),c=new Date(a[1],0,1,9,0),g=0;if(a[3]){f.setMonth(a[3]-1);c.setMonth(a[3]-1)}if(a[5]){f.setDate(a[5]);c.setDate(a[5])}fb(f,c);a[7]&&f.setHours(a[7]); a[8]&&f.setMinutes(a[8]);a[10]&&f.setSeconds(a[10]);a[12]&&f.setMilliseconds(Number("0."+a[12])*1E3);fb(f,c);if(!b){if(a[14]){g=Number(a[16])*60+Number(a[17]);g*=a[15]=="-"?1:-1}g-=f.getTimezoneOffset()}return new Date(+f+g*60*1E3)},wb=ya.parseTime=function(a){if(typeof a=="number")return a*60;if(typeof a=="object")return a.getHours()*60+a.getMinutes();if(a=a.match(/(\d+)(?::(\d+))?\s*(\w+)?/)){var b=parseInt(a[1]);if(a[3]){b%=12;if(a[3].toLowerCase().charAt(0)=="p")b+=12}return b*60+(a[2]?parseInt(a[2]): 0)}},oa=ya.formatDate=function(a,b,f){return Ha(a,null,b,f)},Ha=ya.formatDates=function(a,b,f,c){c=c||Va;var g=a,n=b,k,y=f.length,w,t,H,M="";for(k=0;kk;t--)if(H=Ob[f.substring(k,t)]){if(g)M+=H(g,c);k=t-1;break}if(t==k)if(g)M+=w}}return M},Ob={s:function(a){return a.getSeconds()},ss:function(a){return Na(a.getSeconds())},m:function(a){return a.getMinutes()},mm:function(a){return Na(a.getMinutes())},h:function(a){return a.getHours()%12||12},hh:function(a){return Na(a.getHours()%12||12)},H:function(a){return a.getHours()},HH:function(a){return Na(a.getHours())},d:function(a){return a.getDate()}, dd:function(a){return Na(a.getDate())},ddd:function(a,b){return b.dayNamesShort[a.getDay()]},dddd:function(a,b){return b.dayNames[a.getDay()]},M:function(a){return a.getMonth()+1},MM:function(a){return Na(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 a.getHours()<12?"a":"p"},tt:function(a){return a.getHours()< 12?"am":"pm"},T:function(a){return a.getHours()<12?"A":"P"},TT:function(a){return a.getHours()<12?"AM":"PM"},u:function(a){return oa(a,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(a){a=a.getDate();if(a>10&&a<20)return"th";return["st","nd","rd"][a%10-1]||"th"}},za=["sun","mon","tue","wed","thu","fri","sat"]})(jQuery);