text: /*! bootstrap-calendar - v0.2.4 - 2015-04-13 - https://github.com/Serhioromano/bootstrap-calendar */
  "use strict";Date.prototype.getWeek=function(){var a=new Date(this.getFullYear(),0,1);return Math.ceil(((this.getTime()-a.getTime())/864e5+a.getDay()+1)/7)},Date.prototype.getMonthFormatted=function(){var a=this.getMonth()+1;return 10>a?"0"+a:a},Date.prototype.getDateFormatted=function(){var a=this.getDate();return 10>a?"0"+a:a},String.prototype.format||(String.prototype.format=function(){var a=arguments;return this.replace(/{(\d+)}/g,function(b,c){return"undefined"!=typeof a[c]?a[c]:b})}),String.prototype.formatNum||(String.prototype.formatNum=function(a){for(var b=""+this;b.length<a;)b="0"+b;return b}),function(a){function b(a,b){var c,d,e;e=a,c=a.indexOf("?")<0?"?":"&";for(d in b)e+=c+d+"="+encodeURIComponent(b[d]),c="&";return e}function c(b,c){var d=null!=b.options[c]?b.options[c]:null,e=null!=b.locale[c]?b.locale[c]:null;if("holidays"==c&&b.options.merge_holidays){var f={};return a.extend(!0,f,e?e:j.holidays),d&&a.extend(!0,f,d),f}return null!=d?d:null!=e?e:j[c]}function d(b,f){var g=[],i=c(b,"holidays");for(var j in i)g.push(j+":"+i[j]);if(g.push(f),g=g.join("|"),g in d.cache)return d.cache[g];var k=[];return a.each(i,function(b,c){var d=null,g=null,i=!1;if(a.each(b.split(">"),function(a,c){var j,k=null;if(j=/^(\d\d)-(\d\d)$/.exec(c))k=new Date(f,parseInt(j[2],10)-1,parseInt(j[1],10));else if(j=/^(\d\d)-(\d\d)-(\d\d\d\d)$/.exec(c))parseInt(j[3],10)==f&&(k=new Date(f,parseInt(j[2],10)-1,parseInt(j[1],10)));else if(j=/^easter(([+\-])(\d+))?$/.exec(c))k=h(f,j[1]?parseInt(j[1],10):0);else if(j=/^(\d\d)([+\-])([1-5])\*([0-6])$/.exec(c)){var l=parseInt(j[1],10)-1,m=j[2],n=parseInt(j[3]),o=parseInt(j[4]);switch(m){case"+":for(var p=new Date(f,l,-6);p.getDay()!=o;)p=new Date(p.getFullYear(),p.getMonth(),p.getDate()+1);k=new Date(p.getFullYear(),p.getMonth(),p.getDate()+7*n);break;case"-":for(var p=new Date(f,l+1,7);p.getDay()!=o;)p=new Date(p.getFullYear(),p.getMonth(),p.getDate()-1);k=new Date(p.getFullYear(),p.getMonth(),p.getDate()-7*n)}}if(!k)return e("Unknown holiday: "+b),i=!0,!1;switch(a){case 0:d=k;break;case 1:if(k.getTime()<=d.getTime())return e("Unknown holiday: "+b),i=!0,!1;g=k;break;default:return e("Unknown holiday: "+b),i=!0,!1}}),!i){var j=[];if(g)for(var l=new Date(d.getTime());l.getTime()<=g.getTime();l.setDate(l.getDate()+1))j.push(new Date(l.getTime()));else j.push(d);k.push({name:c,days:j})}}),d.cache[g]=k,d.cache[g]}function e(b){"object"==a.type(window.console)&&"function"==a.type(window.console.warn)&&window.console.warn("[Bootstrap-Calendar] "+b)}function f(b,c){return this.options=a.extend(!0,{position:{start:new Date,end:new Date}},i,b),this.setLanguage(this.options.language),this.context=c,c.css("width",this.options.width).addClass("cal-context"),this.view(),this}function g(b,c,d,e){b.stopPropagation();var c=a(c),f=c.closest(".cal-cell"),g=f.closest(".cal-before-eventlist"),h=f.data("cal-row");c.fadeOut("fast"),d.slideUp("fast",function(){var b=a(".events-list",f);d.html(e.options.templates["events-list"]({cal:e,events:e.getEventsBetween(parseInt(b.data("cal-start")),parseInt(b.data("cal-end")))})),g.after(d),e.activecell=a("[data-cal-date]",f).text(),a("#cal-slide-tick").addClass("tick"+h).show(),d.slideDown("fast",function(){a("body").one("click",function(){d.slideUp("fast"),e.activecell=0})})}),setTimeout(function(){a("a.event-item").mouseenter(function(){a('a[data-event-id="'+a(this).data("event-id")+'"]').closest(".cal-cell1").addClass("day-highlight dh-"+a(this).data("event-class"))}),a("a.event-item").mouseleave(function(){a("div.cal-cell1").removeClass("day-highlight dh-"+a(this).data("event-class"))}),e._update_modal()},400)}function h(a,b){var c=a%19,d=Math.floor(a/100),e=a%100,f=Math.floor(d/4),g=d%4,h=Math.floor((d+8)/25),i=Math.floor((d-h+1)/3),j=(19*c+d-f-i+15)%30,k=Math.floor(e/4),l=e%4,m=(32+2*g+2*k-j-l)%7,n=Math.floor((c+11*j+22*m)/451),o=j+m+7*n+114,p=Math.floor(o/31)-1,q=o%31+1;return new Date(a,p,q+(b?b:0),0,0,0)}var i={width:"100%",view:"month",day:"now",time_start:"06:00",time_end:"22:00",time_split:"30",events_source:"",tmpl_path:"tmpls/",tmpl_cache:!0,classes:{months:{inmonth:"cal-day-inmonth",outmonth:"cal-day-outmonth",saturday:"cal-day-weekend",sunday:"cal-day-weekend",holidays:"cal-day-holiday",today:"cal-day-today"},week:{workday:"cal-day-workday",saturday:"cal-day-weekend",sunday:"cal-day-weekend",holidays:"cal-day-holiday",today:"cal-day-today"}},modal:null,modal_type:"iframe",modal_title:null,views:{year:{slide_events:1,enable:1},month:{slide_events:1,enable:1},week:{enable:1},day:{enable:1}},merge_holidays:!1,onAfterEventsLoad:function(a){},onBeforeEventsLoad:function(a){a()},onAfterViewLoad:function(a){},onAfterModalShown:function(a){},onAfterModalHidden:function(a){},events:[],templates:{year:"",month:"",week:"",day:""},stop_cycling:!1},j={first_day:2,holidays:{"01-01":"New Year's Day","01+3*1":"Birthday of Dr. Martin Luther King, Jr.","02+3*1":"Washington's Birthday","05-1*1":"Memorial Day","04-07":"Independence Day","09+1*1":"Labor Day","10+2*1":"Columbus Day","11-11":"Veterans Day","11+4*4":"Thanksgiving Day","25-12":"Christmas"}},k={error_noview:"Calendar: View {0} not found",error_dateformat:'Calendar: Wrong date format {0}. Should be either "now" or "yyyy-mm-dd"',error_loadurl:"Calendar: Event URL is not set",error_where:'Calendar: Wrong navigation direction {0}. Can be only "next" or "prev" or "today"',error_timedevide:"Calendar: Time split parameter should divide 60 without decimals. Something like 10, 15, 30",no_events_in_day:"No events in this day.",title_year:"{0}",title_month:"{0} {1}",title_week:"week {0} of {1}",title_day:"{0} {1} {2}, {3}",week:"Week {0}",all_day:"All day",time:"Time",events:"Events",before_time:"Ends before timeline",after_time:"Starts after timeline",m0:"January",m1:"February",m2:"March",m3:"April",m4:"May",m5:"June",m6:"July",m7:"August",m8:"September",m9:"October",m10:"November",m11:"December",ms0:"Jan",ms1:"Feb",ms2:"Mar",ms3:"Apr",ms4:"May",ms5:"Jun",ms6:"Jul",ms7:"Aug",ms8:"Sep",ms9:"Oct",ms10:"Nov",ms11:"Dec",d0:"Sunday",d1:"Monday",d2:"Tuesday",d3:"Wednesday",d4:"Thursday",d5:"Friday",d6:"Saturday"},l="";try{"object"==a.type(window.jstz)&&"function"==a.type(jstz.determine)&&(l=jstz.determine().name(),"string"!==a.type(l)&&(l=""))}catch(m){}d.cache={},f.prototype.setOptions=function(b){a.extend(this.options,b),"language"in b&&this.setLanguage(b.language),"modal"in b&&this._update_modal()},f.prototype.setLanguage=function(b){window.calendar_languages&&b in window.calendar_languages?(this.locale=a.extend(!0,{},k,calendar_languages[b]),this.options.language=b):(this.locale=k,delete this.options.language)},f.prototype._render=function(){this.context.html(""),this._loadTemplate(this.options.view),this.stop_cycling=!1;var a={};a.cal=this,a.day=1,a.days_name=1==c(this,"first_day")?[this.locale.d1,this.locale.d2,this.locale.d3,this.locale.d4,this.locale.d5,this.locale.d6,this.locale.d0]:[this.locale.d0,this.locale.d1,this.locale.d2,this.locale.d3,this.locale.d4,this.locale.d5,this.locale.d6];var b=parseInt(this.options.position.start.getTime()),d=parseInt(this.options.position.end.getTime());switch(a.events=this.getEventsBetween(b,d),this.options.view){case"month":break;case"week":this._calculate_hour_minutes(a);break;case"day":this._calculate_hour_minutes(a)}a.start=new Date(this.options.position.start.getTime()),a.lang=this.locale,this.context.append(this.options.templates[this.options.view](a)),this._update()},f.prototype._calculate_hour_minutes=function(b){var c=this,d=parseInt(this.options.time_split),f=60/d,g=Math.min(f,1);(f>=1&&f%1!=0||1>f&&1440/d%1!=0)&&a.error(this.locale.error_timedevide);var h=this.options.time_start.split(":"),i=this.options.time_end.split(":");b.hours=(parseInt(i[0])-parseInt(h[0]))*g;var j=b.hours*f-parseInt(h[1])/d,k=6e4*d,l=new Date(this.options.position.start.getTime());l.setHours(h[0]),l.setMinutes(h[1]);var m=new Date(this.options.position.end.getTime());m.setHours(i[0]),m.setMinutes(i[1]),b.all_day=[],b.by_hour=[],b.after_time=[],b.before_time=[],a.each(b.events,function(a,d){var f=new Date(parseInt(d.start)),g=new Date(parseInt(d.end));if(d.start_hour=f.getHours().toString().formatNum(2)+":"+f.getMinutes().toString().formatNum(2),d.end_hour=g.getHours().toString().formatNum(2)+":"+g.getMinutes().toString().formatNum(2),d.start<l.getTime()&&(e(1),d.start_hour=f.getDate()+" "+c.locale["ms"+f.getMonth()]+" "+d.start_hour),d.end>m.getTime()&&(e(1),d.end_hour=g.getDate()+" "+c.locale["ms"+g.getMonth()]+" "+d.end_hour),d.start<l.getTime()&&d.end>m.getTime())return void b.all_day.push(d);if(d.end<l.getTime())return void b.before_time.push(d);if(d.start>m.getTime())return void b.after_time.push(d);var h=l.getTime()-d.start;d.top=h>=0?0:Math.abs(h)/k;var i=Math.abs(j-d.top),n=(d.end-d.start)/k;h>=0&&(n=(d.end-l.getTime())/k),d.lines=n,n>i&&(d.lines=i),b.by_hour.push(d)})},f.prototype._hour_min=function(a){var b=this.options.time_start.split(":"),c=parseInt(this.options.time_split),d=60/c;return 0==a?d-parseInt(b[1])/c:d},f.prototype._hour=function(a,b){var c=this.options.time_start.split(":"),d=parseInt(this.options.time_split),e=""+(parseInt(c[0])+a*Math.max(d/60,1)),f=""+(d*b+(0==a?parseInt(c[1]):0));return e.formatNum(2)+":"+f.formatNum(2)},f.prototype._week=function(b){this._loadTemplate("week-days");var d={},e=parseInt(this.options.position.start.getTime()),f=parseInt(this.options.position.end.getTime()),g=[],h=this,i=c(this,"first_day");return a.each(this.getEventsBetween(e,f),function(a,b){b.start_day=new Date(parseInt(b.start)).getDay(),1==i&&(b.start_day=(b.start_day+6)%7),b.days=b.end-b.start<=864e5?1:(b.end-b.start)/864e5,b.start<e&&(b.days=b.days-(e-b.start)/864e5,b.start_day=0),b.days=Math.ceil(b.days),b.start_day+b.days>7&&(b.days=7-b.start_day),g.push(b)}),d.events=g,d.cal=this,h.options.templates["week-days"](d)},f.prototype._month=function(a){this._loadTemplate("year-month");var b={cal:this},c=a+1;b.data_day=this.options.position.start.getFullYear()+"-"+(10>c?"0"+c:c)+"-01",b.month_name=this.locale["m"+a];var d=new Date(this.options.position.start.getFullYear(),a,1,0,0,0);return b.start=parseInt(d.getTime()),b.end=parseInt(new Date(this.options.position.start.getFullYear(),a+1,1,0,0,0).getTime()),b.events=this.getEventsBetween(b.start,b.end),this.options.templates["year-month"](b)},f.prototype._day=function(b,d){this._loadTemplate("month-day");var e={tooltip:"",cal:this},f=this.options.classes.months.outmonth,g=this.options.position.start.getDay();2==c(this,"first_day")?g++:g=0==g?7:g,d=d-g+1;var h=new Date(this.options.position.start.getFullYear(),this.options.position.start.getMonth(),d,0,0,0);d>0&&(f=this.options.classes.months.inmonth);var i=new Date(this.options.position.end.getTime()-1).getDate();if(d+1>i&&(this.stop_cycling=!0),d>i&&(d-=i,f=this.options.classes.months.outmonth),f=a.trim(f+" "+this._getDayClass("months",h)),0>=d){var j=new Date(this.options.position.start.getFullYear(),this.options.position.start.getMonth(),0).getDate();d=j-Math.abs(d),f+=" cal-month-first-row"}var k=this._getHoliday(h);return k!==!1&&(e.tooltip=k),e.data_day=h.getFullYear()+"-"+h.getMonthFormatted()+"-"+(10>d?"0"+d:d),e.cls=f,e.day=d,e.start=parseInt(h.getTime()),e.end=parseInt(e.start+864e5),e.events=this.getEventsBetween(e.start,e.end),this.options.templates["month-day"](e)},f.prototype._getHoliday=function(b){var c=!1;return a.each(d(this,b.getFullYear()),function(){var d=!1;return a.each(this.days,function(){return this.toDateString()==b.toDateString()?(d=!0,!1):void 0}),d?(c=this.name,!1):void 0}),c},f.prototype._getHolidayName=function(a){var b=this._getHoliday(a);return b===!1?"":b},f.prototype._getDayClass=function(a,b){var c=this,d=function(b,d){var e;e=c.options.classes&&a in c.options.classes&&b in c.options.classes[a]?c.options.classes[a][b]:"","string"==typeof e&&e.length&&d.push(e)},e=[];b.toDateString()==(new Date).toDateString()&&d("today",e);var f=this._getHoliday(b);switch(f!==!1&&d("holidays",e),b.getDay()){case 0:d("sunday",e);break;case 6:d("saturday",e)}return d(b.toDateString(),e),e.join(" ")},f.prototype.view=function(a){if(a){if(!this.options.views[a].enable)return;this.options.view=a}this._init_position(),this._loadEvents(),this._render(),this.options.onAfterViewLoad.call(this,this.options.view)},f.prototype.navigate=function(b,c){var d=a.extend({},this.options.position);if("next"==b)switch(this.options.view){case"year":d.start.setFullYear(this.options.position.start.getFullYear()+1);break;case"month":d.start.setMonth(this.options.position.start.getMonth()+1);break;case"week":d.start.setDate(this.options.position.start.getDate()+7);break;case"day":d.start.setDate(this.options.position.start.getDate()+1)}else if("prev"==b)switch(this.options.view){case"year":d.start.setFullYear(this.options.position.start.getFullYear()-1);break;case"month":d.start.setMonth(this.options.position.start.getMonth()-1);break;case"week":d.start.setDate(this.options.position.start.getDate()-7);break;case"day":d.start.setDate(this.options.position.start.getDate()-1)}else"today"==b?d.start.setTime((new Date).getTime()):a.error(this.locale.error_where.format(b));this.options.day=d.start.getFullYear()+"-"+d.start.getMonthFormatted()+"-"+d.start.getDateFormatted(),this.view(),_.isFunction(c)&&c()},f.prototype._init_position=function(){var b,d,e;if("now"==this.options.day){var f=new Date;b=f.getFullYear(),d=f.getMonth(),e=f.getDate()}else if(this.options.day.match(/^\d{4}-\d{2}-\d{2}$/g)){var g=this.options.day.split("-");b=parseInt(g[0],10),d=parseInt(g[1],10)-1,e=parseInt(g[2],10)}else a.error(this.locale.error_dateformat.format(this.options.day));switch(this.options.view){case"year":this.options.position.start.setTime(new Date(b,0,1).getTime()),this.options.position.end.setTime(new Date(b+1,0,1).getTime());break;case"month":this.options.position.start.setTime(new Date(b,d,1).getTime()),this.options.position.end.setTime(new Date(b,d+1,1).getTime());break;case"day":this.options.position.start.setTime(new Date(b,d,e).getTime()),this.options.position.end.setTime(new Date(b,d,e+1).getTime());break;case"week":var h,i=new Date(b,d,e);h=1==c(this,"first_day")?i.getDate()-(i.getDay()+6)%7:i.getDate()-i.getDay(),this.options.position.start.setTime(new Date(b,d,h).getTime()),this.options.position.end.setTime(new Date(b,d,h+7).getTime());break;default:a.error(this.locale.error_noview.format(this.options.view))}return this},f.prototype.getTitle=function(){var a=this.options.position.start;switch(this.options.view){case"year":return this.locale.title_year.format(a.getFullYear());case"month":return this.locale.title_month.format(this.locale["m"+a.getMonth()],a.getFullYear());case"week":return this.locale.title_week.format(a.getWeek(),a.getFullYear());case"day":return this.locale.title_day.format(this.locale["d"+a.getDay()],a.getDate(),this.locale["m"+a.getMonth()],a.getFullYear())}},f.prototype.isToday=function(){var a=(new Date).getTime();return a>this.options.position.start&&a<this.options.position.end},f.prototype.getStartDate=function(){return this.options.position.start},f.prototype.getEndDate=function(){return this.options.position.end},f.prototype._loadEvents=function(){var c=this,d=null;"events_source"in this.options&&""!==this.options.events_source?d=this.options.events_source:"events_url"in this.options&&(d=this.options.events_url,e("The events_url option is DEPRECATED and it will be REMOVED in near future. Please use events_source instead."));var f;switch(a.type(d)){case"function":f=function(){return d(c.options.position.start,c.options.position.end,l)};break;case"array":f=function(){return[].concat(d)};break;case"string":d.length&&(f=function(){var e=[],f={from:c.options.position.start.getTime(),to:c.options.position.end.getTime()};return l.length&&(f.browser_timezone=l),a.ajax({url:b(d,f),dataType:"json",type:"GET",async:!1}).done(function(b){b.success||a.error(b.error),b.result&&(e=b.result)}),e})}f||a.error(this.locale.error_loadurl),this.options.onBeforeEventsLoad.call(this,function(){c.options.events=f(),c.options.events.sort(function(a,b){var c;return c=a.start-b.start,0==c&&(c=a.end-b.end),c}),c.options.onAfterEventsLoad.call(c,c.options.events)})},f.prototype._templatePath=function(a){return"function"==typeof this.options.tmpl_path?this.options.tmpl_path(a):this.options.tmpl_path+a+".html"},f.prototype._loadTemplate=function(b){if(!this.options.templates[b]){var c=this;a.ajax({url:c._templatePath(b),dataType:"html",type:"GET",async:!1,cache:this.options.tmpl_cache}).done(function(a){c.options.templates[b]=_.template(a)})}},f.prototype._update=function(){var b=this;a('*[data-toggle="tooltip"]').tooltip({container:"body"}),a("*[data-cal-date]").click(function(){var c=a(this).data("cal-view");b.options.day=a(this).data("cal-date"),b.view(c)}),a(".cal-cell").dblclick(function(){var c=a("[data-cal-date]",this).data("cal-view");b.options.day=a("[data-cal-date]",this).data("cal-date"),b.view(c)}),this["_update_"+this.options.view](),this._update_modal()},f.prototype._update_modal=function(){var b=this;if(a("a[data-event-id]",this.context).unbind("click"),b.options.modal){var c=a(b.options.modal);if(c.length){var d=null;"iframe"==b.options.modal_type&&(d=a(document.createElement("iframe")).attr({width:"100%",frameborder:"0"})),a("a[data-event-id]",this.context).on("click",function(e){e.preventDefault(),e.stopPropagation();var f=a(this).attr("href"),g=a(this).data("event-id"),e=_.find(b.options.events,function(a){return a.id==g});"iframe"==b.options.modal_type&&(d.attr("src",f),a(".modal-body",c).html(d)),(!c.data("handled.bootstrap-calendar")||c.data("handled.bootstrap-calendar")&&c.data("handled.event-id")!=e.id)&&c.off("show.bs.modal").off("shown.bs.modal").off("hidden.bs.modal").on("show.bs.modal",function(){var d=a(this).find(".modal-body");switch(b.options.modal_type){case"iframe":var g=d.height()-parseInt(d.css("padding-top"),10)-parseInt(d.css("padding-bottom"),10);a(this).find("iframe").height(Math.max(g,50));break;case"ajax":a.ajax({url:f,dataType:"html",async:!1,success:function(a){d.html(a)}});break;case"template":b._loadTemplate("modal"),d.html(b.options.templates.modal({event:e,calendar:b}))}_.isFunction(b.options.modal_title)&&c.find("h3").html(b.options.modal_title(e))}).on("shown.bs.modal",function(){b.options.onAfterModalShown.call(b,b.options.events)}).on("hidden.bs.modal",function(){b.options.onAfterModalHidden.call(b,b.options.events)}).data("handled.bootstrap-calendar",!0).data("handled.event-id",e.id),c.modal("show")})}}},f.prototype._update_day=function(){a("#cal-day-panel").height(a("#cal-day-panel-hour").height())},f.prototype._update_week=function(){},f.prototype._update_year=function(){this._update_month_year()},f.prototype._update_month=function(){this._update_month_year();var b=this,c=a(document.createElement("div")).attr("id","cal-week-box"),d=this.options.position.start.getFullYear()+"-"+this.options.position.start.getMonthFormatted()+"-";b.context.find(".cal-month-box .cal-row-fluid").on("mouseenter",function(){var e=new Date(b.options.position.start),f=a(".cal-cell1:first-child .cal-month-day",this),g=f.hasClass("cal-month-first-row")?1:a("[data-cal-date]",f).text();e.setDate(parseInt(g)),g=10>g?"0"+g:g,c.html(b.locale.week.format(e.getWeek())),c.attr("data-cal-week",d+g).show().appendTo(f)}).on("mouseleave",function(){c.hide()}),c.click(function(){b.options.day=a(this).data("cal-week"),b.view("week")}),a("a.event").mouseenter(function(){a('a[data-event-id="'+a(this).data("event-id")+'"]').closest(".cal-cell1").addClass("day-highlight dh-"+a(this).data("event-class"))}),a("a.event").mouseleave(function(){a("div.cal-cell1").removeClass("day-highlight dh-"+a(this).data("event-class"))})},f.prototype._update_month_year=function(){if(this.options.views[this.options.view].slide_events){var b=this,c=a(document.createElement("div")).attr("id","cal-day-tick").html('<i class="icon-chevron-down glyphicon glyphicon-chevron-down"></i>');a(".cal-month-day, .cal-year-box .span3").on("mouseenter",function(){0!=a(".events-list",this).length&&a(this).children("[data-cal-date]").text()!=b.activecell&&c.show().appendTo(this)}).on("mouseleave",function(){c.hide()}).on("click",function(e){0!=a(".events-list",this).length&&a(this).children("[data-cal-date]").text()!=b.activecell&&g(e,c,d,b)});var d=a(document.createElement("div")).attr("id","cal-slide-box");d.hide().click(function(a){a.stopPropagation()}),this._loadTemplate("events-list"),c.click(function(c){g(c,a(this),d,b)})}},f.prototype.getEventsBetween=function(b,c){var d=[];return a.each(this.options.events,function(){if(null==this.start)return!0;var a=this.end||this.start;parseInt(this.start)<c&&parseInt(a)>=b&&d.push(this)}),d},a.fn.calendar=function(a){return new f(a,this)}}(jQuery);