/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.5.2
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2019 MH Sub I, LLC dba vBulletin. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["january","february","march","april","may","june","july","august","september","october","november","december","january_short","february_short","march_short","april_short","may_short","june_short","july_short","august_short","september_short","october_short","november_short","december_short","sunday","monday","tuesday","wednesday","thursday","friday","saturday","sunday_short","monday_short","tuesday_short","wednesday_short","thursday_short","friday_short","saturday_short","today","calendar_plus_n_more",]);window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=$.merge(window.vBulletin.options.precache,[]);(function(E,D,B){var G;function C(){if(typeof G!="undefined"){return }else{G={};var H={monthNames:["january","february","march","april","may","june","july","august","september","october","november","december",],monthNamesShort:["january_short","february_short","march_short","april_short","may_short","june_short","july_short","august_short","september_short","october_short","november_short","december_short",],dayNames:["sunday","monday","tuesday","wednesday","thursday","friday","saturday",],dayNamesShort:["sunday_short","monday_short","tuesday_short","wednesday_short","thursday_short","friday_short","saturday_short",],};for(optionName in H){G[optionName]=[];H[optionName].forEach(function(J,I){G[optionName].push(vBulletin.phrase.get(J))})}G.buttonText={today:vBulletin.phrase.get("today"),};G.eventLimitText=function(I){return vBulletin.phrase.get("calendar_plus_n_more",parseInt(I,10))}}}function A(S){if(S.data("vb-calendar-initialized")=="1"){return }var R=S.find(".js-calendar-loading-placeholder"),W=S.data("widget-instance-id"),Q=parseInt(S.data("goto-month"),10)||0,U=parseInt(S.data("user-timezone-offset"),10)||0,T=parseInt(S.data("user-timezone-offset-ignore-dst"),10)||0,H,I=vBulletin.isRtl(),J=null;function L(Z){var X=[],Y=Z.find(".js-calendar__events-event");if(Y.length){E.each(Y,function(b,e){var d=E(e),g=d.data("ignoredst")?T:U,f=d.data("eventstartdate")&&(d.data("eventstartdate")+g)||0,c=d.data("eventenddate")&&(d.data("eventenddate")+g)||0,a={id:d.data("id"),title:d.data("title"),start:moment.unix(f),url:d.data("url"),};if(c){a.end=moment.unix(c)}else{a.allDay=true}X.push(a)})}return X}function N(e,X,b,d){var a=[],Y={from:e.unix()||0,to:X.unix()||0,},c=S.data("search-json"),Z=S.data("results-per-page");vBulletin.AJAX({call:"/ajax/render/widget_calendar__events",data:{searchJSON:c,events_during:Y,resultsPerPage:Z,},success:function(f){var h=E(f),g=h.hasClass("js-calendar__events")&&h||h.find(".js-calendar__events");a=L(g);d(a)},complete:function(){}})}function K(Y,X){if(typeof H=="undefined"){H=E('<img src="images/loader-box-blue.gif" /> ').appendTo(S.find(".fc-center"))}if(Y){H.show()}else{H.hide()}}function V(X,Y){R.addClass("h-hide")}function P(Y){var X=(Y.outerWidth()<=500)?"auto":"";if(J!==X){Y.fullCalendar("option","contentHeight",X);Y.fullCalendar("option","height",X);J=X;return true}return false}function M(){var X=P(S);if(X){S.fullCalendar("render")}}S.fullCalendar({events:N,loading:K,eventLimit:true,viewRender:V,windowResize:M,isRTL:I,timezone:"UTC",buttonText:G.buttonText,monthNames:G.monthNames,monthNamesShort:G.monthNamesShort,dayNames:G.dayNames,dayNamesShort:G.dayNamesShort,eventLimitText:G.eventLimitText,firstDay:(parseInt(pageData.user_startofweek,10)||1)-1,});P(S);if(Q&&Q>=1&&Q<=12){var O=moment().month(Q-1).date(1);S.fullCalendar("gotoDate",O)}S.addClass("js-parent-tab-render-listener");S.on("parent-tab-render",function(X){S.fullCalendar("render")});S.on("mouseenter","a.fc-event:not(.fc-start.fc-end)",function(X){var Y=E(this).attr("href"),Z=S.find("a.fc-event:not(.fc-start.fc-end)[href='"+Y+"']");if(Z){Z.addClass("fc-event--simulate-hover");E(this).one("mouseleave",function(){Z.removeClass("fc-event--simulate-hover")})}});S.attr("vb-calendar-initialized","1")}function F(){C();E(function(){var H=E(".js-widget-calendar");if(!H.length){return }E.each(H,function(I,J){A(E(J))})})}F()})(jQuery,window,window.document);