/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.4.2
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2018 vBulletin Solutions Inc. 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(P){if(P.data("vb-calendar-initialized")=="1"){return }var O=P.find(".js-calendar-loading-placeholder"),S=P.data("widget-instance-id"),N=parseInt(P.data("goto-month"),10)||0,Q=parseInt(P.data("user-timezone-offset"),10)||0,K=function(V){var T=[],U=V.find(".js-calendar__events-event");if(U.length){E.each(U,function(X,a){var Z=E(a),b=Z.data("eventstartdate")&&(Z.data("eventstartdate")+Q)||0,Y=Z.data("eventenddate")&&(Z.data("eventenddate")+Q)||0,W={id:Z.data("id"),title:Z.data("title"),start:moment.unix(b),url:Z.data("url"),};if(Y){W.end=moment.unix(Y)}else{W.allDay=true}T.push(W)})}return T},L=function(a,T,X,Z){var W=[],U={from:a.unix()||0,to:T.unix()||0,},Y=P.data("search-json"),V=P.data("results-per-page");vBulletin.AJAX({call:"/ajax/render/widget_calendar__events",data:{searchJSON:Y,events_during:U,resultsPerPage:V,},success:function(b){var d=E(b),c=d.hasClass("js-calendar__events")&&d||d.find(".js-calendar__events");W=K(c);Z(W)},complete:function(){}})},I,J=function(U,T){if(typeof I=="undefined"){I=E('<img src="images/loader-box-blue.gif" /> ').appendTo(P.find(".fc-center"))}if(U){I.show()}else{I.hide()}},R=function(T,U){O.addClass("h-hide")},H=vBulletin.isRtl();P.fullCalendar({events:L,loading:J,eventLimit:true,viewRender:R,isRTL:H,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,});if(N&&N>=1&&N<=12){var M=moment().month(N-1).date(1);P.fullCalendar("gotoDate",M)}P.addClass("js-parent-tab-render-listener");P.on("parent-tab-render",function(T){P.fullCalendar("render")});P.on("mouseenter","a.fc-event:not(.fc-start.fc-end)",function(T){var U=E(this).attr("href"),V=P.find("a.fc-event:not(.fc-start.fc-end)[href='"+U+"']");if(V){V.addClass("fc-event--simulate-hover");E(this).one("mouseleave",function(){V.removeClass("fc-event--simulate-hover")})}});P.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);