!(function(f,a){Date.convertNumbers=function(j){var j=j.toString();if(Object.prototype.toString.call(JoomlaCalLocale.localLangNumbers)==="[object Array]"){for(var h=0;h<JoomlaCalLocale.localLangNumbers.length;h++){j=j.replace(new RegExp(h,"g"),JoomlaCalLocale.localLangNumbers[h])}}return j};Date.toEnglish=function(k){k=this.toString();var j=[0,1,2,3,4,5,6,7,8,9];for(var h=0;h<10;h++){k=k.replace(new RegExp(j[h],"g"),h)}return k};var b=function(j){if(!j){throw new Error("Calendar setup failed:\n No valid element found, Please check your code")}if(typeof Date.parseFieldDate!=="function"){throw new Error("Calendar setup failed:\n No valid date helper, Please check your code")}if(j._joomlaCalendar){throw new Error("JoomlaCalendar instance already exists for the element")}j._joomlaCalendar=this;this.writable=true;this.hidden=true;this.params={};this.element=j;this.inputField=j.getElementsByTagName("input")[0];this.button=j.getElementsByTagName("button")[0];if(!this.inputField){throw new Error("Calendar setup failed:\n No valid input found, Please check your code")}this.params={debug:false,clicked:false,element:{style:{display:"none"}},writable:true};var h=this,i=this.button,k={inputField:this.inputField,dateType:JoomlaCalLocale.dateType?JoomlaCalLocale.dateType:"gregorian",direction:(a.dir!==undefined)?a.dir:a.getElementsByTagName("html")[0].getAttribute("dir"),firstDayOfWeek:i.getAttribute("data-firstday")?parseInt(i.getAttribute("data-firstday")):0,dateFormat:"%Y-%m-%d %H:%M:%S",weekend:JoomlaCalLocale.weekend?JoomlaCalLocale.weekend:[0,6],minYear:JoomlaCalLocale.minYear?JoomlaCalLocale.minYear:1900,maxYear:JoomlaCalLocale.maxYear?JoomlaCalLocale.maxYear:2100,minYearTmp:i.getAttribute("data-min-year"),maxYearTmp:i.getAttribute("data-max-year"),weekendTmp:i.getAttribute("data-weekend"),time24:true,showsOthers:(parseInt(i.getAttribute("data-show-others"))===1)?true:false,showsTime:true,weekNumbers:(parseInt(i.getAttribute("data-week-numbers"))===1)?true:false,showsTodayBtn:true,compressedHeader:(parseInt(i.getAttribute("data-only-months-nav"))===1)?true:false};if(i.getAttribute("data-dayformat")){k.dateFormat=i.getAttribute("data-dayformat")?i.getAttribute("data-dayformat"):"%Y-%m-%d %H:%M:%S"}if(i.getAttribute("data-time-24")){k.time24=parseInt(i.getAttribute("data-time-24"))===24?true:false}if(i.getAttribute("data-show-time")){k.showsTime=parseInt(i.getAttribute("data-show-time"))===1?true:false}if(i.getAttribute("data-today-btn")){k.showsTodayBtn=parseInt(i.getAttribute("data-today-btn"))===1?true:false}for(var l in k){this.params[l]=k[l]}if(g(h.params.minYearTmp)){h.params.minYear=c(parseInt(h.params.minYearTmp),h.params.dateType)}if(g(h.params.maxYearTmp)){h.params.maxYear=c(parseInt(h.params.maxYearTmp),h.params.dateType)}if(h.params.weekendTmp!=="undefined"){h.params.weekend=h.params.weekendTmp.split(",").map(function(m){return parseInt(m,10)})}this._dayMouseDown=function(m){return h._handleDayMouseDown(m)};this._calKeyEvent=function(m){return h._handleCalKeyEvent(m)};this._documentClick=function(m){return h._handleDocumentClick(m)};this.checkInputs();if(this.inputField.getAttribute("readonly")){return}this._create();this._bindEvents()};b.prototype.checkInputs=function(){var h=Date.parseFieldDate(this.inputField.getAttribute("data-alt-value"),this.params.dateFormat,"gregorian");if(this.inputField.value!==""){this.date=h;this.inputField.value=h.print(this.params.dateFormat,this.params.dateType,true)}else{this.date=new Date()}};b.prototype.recreate=function(){var h=this.element,i=h.querySelector(".js-calendar");if(i){h._joomlaCalendar=null;i.parentNode.removeChild(i);new b(h)}};b.prototype.updateTime=function(p,h,k){var q=this,i=q.date;var l=q.date.getLocalDate(q.params.dateType),j=q.date.getLocalMonth(q.params.dateType),o=q.date.getLocalFullYear(q.params.dateType),n=this.inputField.parentNode.parentNode.querySelectorAll(".time-ampm")[0];if(!q.params.time24){if(/pm/i.test(n.value)&&p<12){p=parseInt(p)+12}else{if(/am/i.test(n.value)&&p==12){p=0}}}i.setHours(p);i.setMinutes(parseInt(h,10));i.setSeconds(i.getSeconds());i.setLocalFullYear(q.params.dateType,o);i.setLocalMonth(q.params.dateType,j);i.setLocalDate(q.params.dateType,l);q.dateClicked=false;this.callHandler()};b.prototype.setDate=function(h){if(!h.equalsTo(this.date)){this.date=h;this.processCalendar(this.params.firstDayOfWeek,h)}};b.prototype.moveCursorBy=function(i){var h=new Date(this.date);h.setDate(h.getDate()-i);this.setDate(h)};b.prototype.resetSelected=function(k){var h=k.options;var j=h.length;while(j--){var l=h[j];if(l.selected){l.selected=false}}};b.prototype.callHandler=function(){this.inputField.setAttribute("data-alt-value",this.date.print(this.params.dateFormat,"gregorian",false));if(this.inputField.getAttribute("data-alt-value")&&this.inputField.getAttribute("data-alt-value")!=="0000-00-00 00:00:00"){this.inputField.value=this.date.print(this.params.dateFormat,this.params.dateType,true);if(this.params.dateType!=="gregorian"){this.inputField.setAttribute("data-local-value",this.date.print(this.params.dateFormat,this.params.dateType,true))}}this.inputField.value=this.date.print(this.params.dateFormat,this.params.dateType,true);if(this.dateClicked&&typeof this.params.onUpdate==="function"){this.params.onUpdate(this)}this.inputField.dispatchEvent(new Event("change",{bubbles:true,cancelable:true}));if(this.dateClicked){this.close()}else{this.processCalendar()}};b.prototype.close=function(){this.hide()};b.prototype.show=function(){if(navigator.appName.indexOf("Internet Explorer")!==-1){var l=(navigator.appVersion.indexOf("MSIE 9")===-1&&navigator.appVersion.indexOf("MSIE 1")===-1);if(l){if(f.jQuery&&jQuery().chosen){var h=this.element.getElementsByTagName("select");for(var k=0;k<h.length;k++){jQuery(h[k]).chosen("destroy")}}}}this.checkInputs();this.inputField.focus();this.dropdownElement.style.display="block";this.hidden=false;a.addEventListener("keydown",this._calKeyEvent,true);a.addEventListener("keypress",this._calKeyEvent,true);a.addEventListener("mousedown",this._documentClick,true);var j=this.element.querySelector(".js-calendar");if(f.innerHeight<j.getBoundingClientRect().bottom+20){j.style.marginTop=-(j.getBoundingClientRect().height+this.inputField.getBoundingClientRect().height)+"px"}this.processCalendar()};b.prototype.hide=function(){a.removeEventListener("keydown",this._calKeyEvent,true);a.removeEventListener("keypress",this._calKeyEvent,true);a.removeEventListener("mousedown",this._documentClick,true);this.dropdownElement.style.display="none";this.hidden=true};b.prototype._handleDocumentClick=function(i){var h=i.target;if(h!==null&&!h.classList.contains("time")){for(;h!==null&&h!==this.element;h=h.parentNode){}}if(h===null){a.activeElement.blur();this.hide();return e(i)}};b.prototype._handleDayMouseDown=function(m){var h=this,l=m.currentTarget,o=m.target||m.srcElement;if(o&&o.hasAttribute("data-action")){return}if(l.nodeName!=="TD"){var n=l.getParent("TD");if(n.nodeName==="TD"){l=n}else{l=l.getParent("TD");if(l.classList.contains("js-calendar")){l=l.getElementsByTagName("table")[0]}}}else{if(!(o.classList.contains("js-btn"))&&!l.classList.contains("day")&&!l.classList.contains("title")){return}}if(!l||l.disabled){return false}if(typeof l.navtype==="undefined"||l.navtype!==300){if(l.navtype===50){l._current=l.innerHTML}if(o===l||o.parentNode===l){h.cellClick(l,m)}var k=null;if(typeof l.month!=="undefined"){k=l}if(typeof l.parentNode.month!=="undefined"){k=l.parentNode}var i=null;if(k){i=new Date(h.date);if(k.month!==i.getLocalMonth(h.params.dateType)){i.setLocalMonth(h.params.dateType,k.month);h.setDate(i);h.dateClicked=false;this.callHandler()}}else{var j=null;if(typeof l.year!=="undefined"){j=o}if(typeof l.parentNode.year!=="undefined"){j=o.parentNode}if(j){i=new Date(h.date);if(j.year!==i.getLocalFullYear(h.params.dateType)){i.setFullYear(h.params.dateType,j.year);h.setDate(i);h.dateClicked=false;this.callHandler()}}}}return e(m)};b.prototype.cellClick=function(i,q){var r=this,l=false,m=false,j=null;if(typeof i.navtype==="undefined"){if(r.currentDateEl){i.classList.add("selected");r.currentDateEl=i.caldate;l=(r.currentDateEl===i.caldate);if(!l){r.currentDateEl=i.caldate}}r.date.setLocalDateOnly("gregorian",i.caldate);var h=!(r.dateClicked=!i.otherMonth);if(r.currentDateEl){m=!i.disabled}if(h){this.processCalendar()}}else{j=new Date(r.date);r.dateClicked=false;var n=j.getOtherFullYear(r.params.dateType),k=j.getLocalMonth(r.params.dateType);switch(i.navtype){case 400:break;case -2:if(!r.params.compressedHeader){if(n>r.params.minYear){j.setOtherFullYear(r.params.dateType,n-1)}}break;case -1:var p=j.getLocalDate(r.params.dateType);if(k>0){var o=j.getLocalMonthDays(r.params.dateType,k-1);if(p>o){j.setLocalDate(r.params.dateType,o)}j.setLocalMonth(r.params.dateType,k-1)}else{if(n-->r.params.minYear){j.setOtherFullYear(r.params.dateType,n);var o=j.getLocalMonthDays(r.params.dateType,11);if(p>o){j.setLocalDate(r.params.dateType,o)}j.setLocalMonth(r.params.dateType,11)}}break;case 1:var p=j.getLocalDate(r.params.dateType);if(k<11){var o=j.getLocalMonthDays(r.params.dateType,k+1);if(p>o){j.setLocalDate(r.params.dateType,o)}j.setLocalMonth(r.params.dateType,k+1)}else{if(n<r.params.maxYear){j.setOtherFullYear(r.params.dateType,n+1);var o=j.getLocalMonthDays(r.params.dateType,0);if(p>o){j.setLocalDate(r.params.dateType,o)}j.setLocalMonth(r.params.dateType,0)}}break;case 2:if(!r.params.compressedHeader){if(n<r.params.maxYear){j.setOtherFullYear(r.params.dateType,n+1)}}break;case 0:break}if(!j.equalsTo(r.date)){this.setDate(j);m=true}else{if(i.navtype===0){m=l=true}}}if(m){if(r.params.showsTime){this.dateClicked=false}q&&this.callHandler()}i.classList.remove("hilite");if(l&&!r.params.showsTime){r.dateClicked=false;q&&this.close()}};b.prototype._handleCalKeyEvent=function(j){var i=this,h=j.keyCode;if(j.target===this.inputField&&(h===13||h===9)){this.close()}if(i.params.direction==="rtl"){if(h===37){h=39}else{if(h===39){h=37}}}if(h===32){if(j.shiftKey){j.preventDefault();this.cellClick(i._nav_now,j);i.close()}}if(h===27){this.close()}if(h===38){this.moveCursorBy(7)}if(h===40){this.moveCursorBy(-7)}if(h===37){this.moveCursorBy(1)}if(h===39){this.moveCursorBy(-1)}if(j.target===this.inputField&&!(h>48||h<57||h===186||h===189||h===190||h===32)){return e(j)}};b.prototype._create=function(){var u=this,q=this.element,C=d("table"),s=d("div");this.table=C;C.className="table";C.cellSpacing=0;C.cellPadding=0;C.style.marginBottom=0;this.dropdownElement=s;q.appendChild(s);if(this.params.direction){s.style.direction=this.params.direction}s.className="js-calendar";s.style.position="absolute";s.style.boxShadow="0px 0px 70px 0px rgba(0,0,0,0.67)";s.style.minWidth=this.inputField.width;s.style.padding="0";s.style.display="none";s.style.left="auto";s.style.top="auto";s.style.zIndex=1060;s.style.borderRadius="20px";this.wrapper=d("div");this.wrapper.className="calendar-container";s.appendChild(this.wrapper);this.wrapper.appendChild(C);var B=d("thead",C);B.className="calendar-header";var k=null,o=null,r=this,n=function(I,F,E,H,G,D,i){H=H?H:"td";G=G?G:{};k=d(H,o);if(F){D=D?'class="'+D+'"':"";k.colSpan=F}for(var j in G){k.style[j]=G[j]}for(var j in i){k.setAttribute(j,i[j])}if(E!==0&&Math.abs(E)<=2){k.className+=" nav"}if(F){k.addEventListener("mousedown",u._dayMouseDown,true)}k.calendar=r;k.navtype=E;if(E!==0&&Math.abs(E)<=2){k.innerHTML="<a "+D+" style='display:inline;padding:2px 6px;cursor:pointer;text-decoration:none;' unselectable='on'>"+I+"</a>"}else{k.innerHTML=F?"<div unselectable='on'"+D+">"+I+"</div>":I;if(!F&&D){k.className=D}}return k};if(this.params.compressedHeader===false){o=d("tr",B);o.className="calendar-head-row";this._nav_py=n("‹",1,-2,"",{"text-align":"center","font-size":"18px","line-height":"18px"},"js-btn btn-prev-year");this.title=n('<div style="text-align:center;font-size:18px"><span></span></div>',this.params.weekNumbers?6:5,300);this.title.className="title";this._nav_ny=n(" ›",1,2,"",{"text-align":"center","font-size":"18px","line-height":"18px"},"js-btn btn-next-year")}o=d("tr",B);o.className="calendar-head-row";this._nav_pm=n("‹",1,-1,"",{"text-align":"center","font-size":"2em","line-height":"1em"},"js-btn btn-prev-month");this._nav_month=n('<div style="text-align:center;font-size:1.2em"><span></span></div>',this.params.weekNumbers?6:5,888,"td",{textAlign:"center"});this._nav_month.className="title";this._nav_nm=n(" ›",1,1,"",{"text-align":"center","font-size":"2em","line-height":"1em"},"js-btn btn-next-month");o=d("tr",B);o.className=u.params.weekNumbers?"daynames wk":"daynames";if(this.params.weekNumbers){k=d("td",o);k.className="day-name wn";k.innerHTML=JoomlaCalLocale.wk}for(var z=7;z>0;--z){k=d("td",o);if(!z){k.calendar=u}}this.firstdayname=(this.params.weekNumbers)?o.firstChild.nextSibling:o.firstChild;var A=this.params.firstDayOfWeek,k=this.firstdayname,w=JoomlaCalLocale.weekend;for(var z=0;z<7;++z){var m=(z+A)%7;k.classList.add("day-name");this.params.weekNumbers?k.classList.add("day-name-week"):"";if(z){k.calendar=u;k.fdow=m}if(w.indexOf(w)!==-1){k.classList.add("weekend")}k.innerHTML=JoomlaCalLocale.shortDays[(z+A)%7];k=k.nextSibling}var h=d("tbody",C);this.tbody=h;for(z=6;z>0;--z){o=d("tr",h);if(this.params.weekNumbers){k=d("td",o)}for(var y=7;y>0;--y){k=d("td",o);k.calendar=this;k.addEventListener("mousedown",this._dayMouseDown,true)}}if(this.params.showsTime){o=d("tr",h);o.className="time";k=d("td",o);k.className="time time-title";k.colSpan=1;k.style.verticalAlign="middle";k.innerHTML=" ";var v=d("td",o);v.className="time hours-select";v.colSpan=2;var t=d("td",o);t.className="time minutes-select";t.colSpan=2;(function(){function G(S,O,H,V,U){var M=d("select",U),R;M.calendar=u;M.className=S;M.setAttribute("data-chosen",true);M.style.width="100%";M.navtype=50;M._range=[];for(var Q=H;Q<=V;++Q){var P,T="";if(Q===O){T=true}if(Q<10&&V>=10){R="0"+Q;P=Date.convertNumbers("0")+Date.convertNumbers(Q)}else{R=""+Q;P=""+Date.convertNumbers(Q)}M.options.add(new Option(P,R,T,T))}return M}var L=u.date.getHours(),i=u.date.getMinutes(),N=!u.params.time24,E=(u.date.getHours()>12);if(N&&E){L-=12}var J=G("time time-hours",L,N?1:0,N?12:23,v),F=G("time time-minutes",i,0,59,t),K=null;k=d("td",o);k.className="time ampm-select";k.colSpan=u.params.weekNumbers?1:2;if(N){var I=true,D=Date.parseFieldDate(u.inputField.getAttribute("data-alt-value"),u.params.dateFormat,"gregorian");E=(D.getHours()>=12);var j=d("select",k);j.className="time-ampm";j.style.width="100%";j.options.add(new Option(JoomlaCalLocale.PM,"pm",E?I:"",E?I:""));j.options.add(new Option(JoomlaCalLocale.AM,"am",E?"":I,E?"":I));K=j;K.addEventListener("change",function(H){u.updateTime(H.target.parentNode.parentNode.childNodes[1].childNodes[0].value,H.target.parentNode.parentNode.childNodes[2].childNodes[0].value,H.target.parentNode.parentNode.childNodes[3].childNodes[0].value)},false)}else{k.innerHTML=" ";k.colSpan=u.params.weekNumbers?3:2}J.addEventListener("change",function(H){u.updateTime(H.target.parentNode.parentNode.childNodes[1].childNodes[0].value,H.target.parentNode.parentNode.childNodes[2].childNodes[0].value,H.target.parentNode.parentNode.childNodes[3].childNodes[0].value)},false);F.addEventListener("change",function(H){u.updateTime(H.target.parentNode.parentNode.childNodes[1].childNodes[0].value,H.target.parentNode.parentNode.childNodes[2].childNodes[0].value,H.target.parentNode.parentNode.childNodes[3].childNodes[0].value)},false)})()}o=d("div",this.wrapper);o.className="buttons-wrapper btn-group";this._nav_clear=n(JoomlaCalLocale.clear,"",100,"button","","js-btn btn btn-clear",{type:"button","data-action":"clear"});var l=o.querySelector('[data-action="clear"]');l.addEventListener("click",function(D){D.preventDefault();var E=u.table.querySelectorAll("td");for(var j=0;j<E.length;j++){if(E[j].classList.contains("selected")){E[j].classList.remove("selected");break}}u.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00");u.inputField.setAttribute("value","");u.inputField.value="";u.inputField.dispatchEvent(new Event("change",{bubbles:true,cancelable:true}))});if(this.params.showsTodayBtn){this._nav_now=n(JoomlaCalLocale.today,"",0,"button","","js-btn btn btn-today",{type:"button","data-action":"today"});var p=this.wrapper.querySelector('[data-action="today"]');p.addEventListener("click",function(i){i.preventDefault();u.date.setLocalDateOnly("gregorian",new Date());u.dateClicked=true;u.callHandler();u.close()})}this._nav_exit=n(JoomlaCalLocale.exit,"",999,"button","","js-btn btn btn-exit",{type:"button","data-action":"exit"});var x=this.wrapper.querySelector('[data-action="exit"]');x.addEventListener("click",function(i){i.preventDefault();if(!u.dateClicked){if(u.inputField.value){if(u.params.dateType!=="gregorian"){u.inputField.setAttribute("data-local-value",u.inputField.value)}if(typeof u.dateClicked==="undefined"){u.inputField.setAttribute("data-alt-value",Date.parseFieldDate(u.inputField.value,u.params.dateFormat,u.params.dateType).print(u.params.dateFormat,"gregorian",false))}else{u.inputField.setAttribute("data-alt-value",u.date.print(u.params.dateFormat,"gregorian",false))}}else{u.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00")}u.date=Date.parseFieldDate(u.inputField.getAttribute("data-alt-value"),u.params.dateFormat,u.params.dateType)}u.close()});this.processCalendar()};b.prototype.processCalendar=function(){this.table.style.visibility="hidden";var y=this.params.firstDayOfWeek,M=this.date,K=new Date(),D=K.getLocalFullYear(this.params.dateType),O=K.getLocalMonth(this.params.dateType),k=K.getLocalDate(this.params.dateType),w=M.getOtherFullYear(this.params.dateType),L=M.getHours(),q=M.getMinutes(),o=M.getSeconds(),I=!this.params.time24;if(w<this.params.minYear){w=this.params.minYear;M.setOtherFullYear(this.params.dateType,w)}else{if(w>this.params.maxYear){w=this.params.maxYear;M.setOtherFullYear(this.params.dateType,w)}}this.params.firstDayOfWeek=y;this.date=new Date(M);var N=M.getLocalMonth(this.params.dateType);var P=M.getLocalDate(this.params.dateType);M.setLocalDate(this.params.dateType,1);var E=(M.getLocalDay(this.params.dateType)-this.params.firstDayOfWeek)%7;if(E<0){E+=7}M.setLocalDate(this.params.dateType,-E);M.setLocalDate(this.params.dateType,M.getLocalDate(this.params.dateType)+1);var p=this.tbody.firstChild,A=this.ar_days=new Array(),z=JoomlaCalLocale.weekend,C=parseInt(M.getLocalWeekDays(this.params.dateType));for(var H=0;H<C;++H,p=p.nextSibling){var h=p.firstChild;if(this.params.weekNumbers){h.className="day wn";h.innerHTML=M.getLocalWeekNumber(this.params.dateType);h=h.nextSibling}p.className=this.params.weekNumbers?"daysrow wk":"daysrow";var J=false,t,l=A[H]=[],n=C+1;for(var F=0;F<n;++F,h=h.nextSibling,M.setLocalDate(this.params.dateType,t+1)){h.className="day";h.style.textAlign="center";t=M.getLocalDate(this.params.dateType);var v=M.getLocalDay(this.params.dateType);h.pos=H<<4|F;l[F]=h;var x=(M.getLocalMonth(this.params.dateType)===N);if(!x){if(this.params.showsOthers){h.className+=" disabled othermonth ";h.otherMonth=true}else{h.className+=" emptycell";h.innerHTML=" ";h.disabled=true;continue}}else{h.otherMonth=false;J=true;h.style.cursor="pointer"}h.disabled=false;h.innerHTML=this.params.debug?t:Date.convertNumbers(t);if(!h.disabled){h.caldate=new Date(M);if(x&&t===P){h.className+=" selected";this.currentDateEl=h}if(M.getLocalFullYear(this.params.dateType)===D&&M.getLocalMonth(this.params.dateType)===O&&t===k){h.className+=" today"}if(z.indexOf(v)!==-1){h.className+=" weekend"}}}if(!(J||this.params.showsOthers)){p.style.display="none";p.className="emptyrow"}else{p.style.display=""}}if(this.params.showsTime){if(L>12&&I){L-=12}L=(L<10)?"0"+L:L;q=(q<10)?"0"+q:q;var s=this.table.querySelector(".time-hours"),r=this.table.querySelector(".time-minutes");this.resetSelected(s);if(!this.params.time24){s.value=(L=="00")?"12":L}else{s.value=L}this.resetSelected(r);r.value=q;if(!this.params.time24){var G=new Date(this.inputField.getAttribute("data-alt-value")),m=this.table.querySelector(".time-ampm"),u=G.getHours();if(u>12){this.resetSelected(m);m.value="pm"}}}if(!this.params.compressedHeader){this._nav_month.getElementsByTagName("span")[0].innerHTML=this.params.debug?N+" "+JoomlaCalLocale.months[N]:JoomlaCalLocale.months[N];this.title.getElementsByTagName("span")[0].innerHTML=this.params.debug?w+" "+Date.convertNumbers(w.toString()):Date.convertNumbers(w.toString())}else{var B=Date.convertNumbers(w.toString());this._nav_month.getElementsByTagName("span")[0].innerHTML=!this.params.monthBefore?JoomlaCalLocale.months[N]+" - "+B:B+" - "+JoomlaCalLocale.months[N]}this.table.style.visibility="visible"};b.prototype._bindEvents=function(){var h=this;this.inputField.addEventListener("blur",function(l){var i=b.getCalObject(this)._joomlaCalendar;if(i.dropdownElement.style.display==="block"){l.preventDefault();return}if(i){if(i.inputField.value){if(typeof i.params.dateClicked==="undefined"){i.inputField.setAttribute("data-local-value",i.inputField.value);if(i.params.dateType!=="gregorian"){var k,j=Date.parseFieldDate(i.inputField.value,i.params.dateFormat,i.params.dateType);k=Date.localCalToGregorian(j.getFullYear(),j.getMonth(),j.getDate());j.setFullYear(k[0]);j.setMonth(k[1]);j.setDate(k[2]);i.inputField.setAttribute("data-alt-value",j.print(i.params.dateFormat,"gregorian",false))}else{i.inputField.setAttribute("data-alt-value",Date.parseFieldDate(i.inputField.value,i.params.dateFormat,i.params.dateType).print(i.params.dateFormat,"gregorian",false))}}else{i.inputField.setAttribute("data-alt-value",i.date.print(i.params.dateFormat,"gregorian",false))}}else{i.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00")}i.date=Date.parseFieldDate(i.inputField.getAttribute("data-alt-value"),i.params.dateFormat,i.params.dateType)}h.close()},true);this.button.addEventListener("click",function(){h.show()},false)};var e=function(h){h||(h=f.event);h.preventDefault();h.stopPropagation();return false};var d=function(j,i){var h=null;h=a.createElement(j);if(typeof i!=="undefined"){i.appendChild(h)}return h};var g=function(h){return !isNaN(h)&&(function(i){return(i|0)===i})(parseFloat(h))};var c=function(h,j){var i=new Date();var k=i.getLocalFullYear(j);return k+h};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(i){var h=this.length>>>0,j=Number(arguments[1])||0;j=(j<0)?Math.ceil(j):Math.floor(j);if(j<0){j+=h}for(;j<h;j++){if(j in this&&this[j]===i){return j}}return -1}}b.getCalObject=function(h){if(!h){return false}while(h.parentNode){h=h.parentNode;if(h.classList.contains("field-calendar")){return h}}return false};b.prototype.setAltValue=function(){var h=this.inputField;if(h.getAttribute("disabled")){return}h.value=h.getAttribute("data-alt-value")?h.getAttribute("data-alt-value"):""};b.onSubmit=function(){Joomla=f.Joomla||{};if(!Joomla.calendarProcessed){Joomla.calendarProcessed=true;var l=a.querySelectorAll(".field-calendar");for(var k=0;k<l.length;k++){var j=l[k],h=j._joomlaCalendar;if(h){h.setAltValue()}}}};b.init=function(j,i){f.JoomlaCalLocale=f.JoomlaCalLocale?JoomlaCalLocale:{};JoomlaCalLocale.today=JoomlaCalLocale.today?JoomlaCalLocale.today:"today";JoomlaCalLocale.weekend=JoomlaCalLocale.weekend?JoomlaCalLocale.weekend:[0,6];JoomlaCalLocale.localLangNumbers=JoomlaCalLocale.localLangNumbers?JoomlaCalLocale.localLangNumbers:[0,1,2,3,4,5,6,7,8,9];JoomlaCalLocale.wk=JoomlaCalLocale.wk?JoomlaCalLocale.wk:"wk";JoomlaCalLocale.AM=JoomlaCalLocale.AM?JoomlaCalLocale.AM:"AM";JoomlaCalLocale.PM=JoomlaCalLocale.PM?JoomlaCalLocale.PM:"PM";JoomlaCalLocale.am=JoomlaCalLocale.am?JoomlaCalLocale.am:"am";JoomlaCalLocale.pm=JoomlaCalLocale.pm?JoomlaCalLocale.pm:"pm";JoomlaCalLocale.dateType=JoomlaCalLocale.dateType?JoomlaCalLocale.dateType:"gregorian";JoomlaCalLocale.time=JoomlaCalLocale.time?JoomlaCalLocale.time:"time";JoomlaCalLocale.days=JoomlaCalLocale.days?JoomlaCalLocale.days:'["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]';JoomlaCalLocale.shortDays=JoomlaCalLocale.shortDays?JoomlaCalLocale.shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"];JoomlaCalLocale.months=JoomlaCalLocale.months?JoomlaCalLocale.months:["January","February","March","April","May","June","July","August","September","October","November","December"];JoomlaCalLocale.shortMonths=JoomlaCalLocale.shortMonths?JoomlaCalLocale.shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];JoomlaCalLocale.minYear=JoomlaCalLocale.minYear?JoomlaCalLocale.minYear:1900;JoomlaCalLocale.maxYear=JoomlaCalLocale.maxYear?JoomlaCalLocale.maxYear:2100;JoomlaCalLocale.exit=JoomlaCalLocale.exit?JoomlaCalLocale.exit:"Cancel";JoomlaCalLocale.clear=JoomlaCalLocale.clear?JoomlaCalLocale.clear:"Clear";var h=j._joomlaCalendar;if(!h){new b(j)}else{h.recreate()}if(j&&j.getElementsByTagName("input")[0]&&j.getElementsByTagName("input")[0].form&&!j.getElementsByTagName("input")[0].disabled){j.getElementsByTagName("input")[0].form.addEventListener("submit",b.onSubmit)}};f.JoomlaCalendar=b;a.addEventListener("DOMContentLoaded",function(){var j,h;j=a.querySelectorAll(".field-calendar");for(h=0;h<j.length;h++){b.init(j[h])}f.jQuery&&jQuery(a).on("subform-row-add",function(i,k){j=k.querySelectorAll(".field-calendar");for(h=0;h<j.length;h++){b.init(j[h])}});f.Calendar={};Calendar.setup=function(m){if(m.inputField&&a.getElementById(m.inputField)){var i=a.getElementById(m.inputField),l=i.parentNode.querySelectorAll("button")[0];for(var k in m){if(m.hasOwnProperty(k)){switch(k){case"ifFormat":if(l){l.setAttribute("data-dayformat",m.ifFormat)}break;case"firstDay":if(l){l.setAttribute("data-firstday",parseInt(m.firstDay))}break;case"weekNumbers":if(l){l.setAttribute("data-week-numbers",(m.weekNumbers==="true"||m.weekNumbers===true)?"1":"0")}break;case"showOthers":if(l){l.setAttribute("data-show-others",(m.showOthers==="true"||m.showOthers===true)?"1":"0")}break;case"showsTime":if(l){l.setAttribute("data-show-time",(m.showsTime==="true"||m.showsTime===true)?"1":"0")}break;case"timeFormat":if(l){l.setAttribute("data-time-24",parseInt(m.timeFormat))}break;case"displayArea":case"inputField":case"button":case"eventName":case"daFormat":case"disableFunc":case"dateStatusFunc":case"dateTooltipFunc":case"dateText":case"align":case"range":case"flat":case"flatCallback":case"onSelect":case"onClose":case"onUpdate":case"date":case"electric":case"step":case"position":case"cache":case"multiple":break}}}b.init(i.parentNode.parentNode)}return null}})})(window,document);