1window.fdLocale={fullMonths:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbrs:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fullDays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],dayAbbrs:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],titles:["Previous month","Next month","Previous year","Next year","Today","Open Calendar","wk","Week [[%0%]] of [[%1%]]","Week","Select a date","Click & Drag to move","Display \u201c[[%0%]]\u201d first","Go to Today\u2019s date","Disabled date:"],firstDayOfWeek:6};var datePickerController=function datePickerController(){function parseUILanguage(){var e=document.getElementsByTagName("html")[0].getAttribute("lang")||document.getElementsByTagName("html")[0].getAttribute("xml:lang");return-1!=(e=e?e.toLowerCase():"en").search(/^([a-z]{2,3})-([a-z]{2})$/)?[e.match(/^([a-z]{2,3})-([a-z]{2})$/)[1],e]:[e]}function affectJSON(e){if("object"==typeof e)for(key in e)switch(value=e[key],key.toLowerCase()){case"lang":-1!=value.search(/^[a-z]{2,3}(-([a-z]{2}))?$/i)&&(languageInfo=[value.toLowerCase()],returnLocaleDate=!0);break;case"nodrag":nodrag=!!value;break;case"buttontabindex":buttonTabIndex=!!value;break;case"mousewheel":mouseWheel=!!value;break;case"cellformat":"string"==typeof value&&value.match(validFmtRegExp)&&parseCellFormat(value);break;case"titleformat":"string"==typeof value&&value.match(validFmtRegExp)&&(titleFormat=value);break;case"describedby":"string"==typeof value&&(describedBy=value);break;case"finalopacity":"number"==typeof value&&+value>20&&+value<=100&&(finalOpacity=parseInt(value,10));break;case"bespoketitles":for(var t in bespokeTitles={},value)bespokeTitles[t]=value[t]}}function parseCellFormat(e){if(isOpera)return formatParts=["placeholder"],void(cellFormat="j-sp-F-sp-Y");for(var t,a=e.split("-"),s=[],i=[],n=0;n<a.length;n++)"j"==(t=a[n])||"d"==t?(i.length&&(s.push(i.join("-")),i=[]),s.push("placeholder")):i.push(t);if(i.length&&s.push(i.join("-")),!s.length||s.length>3)return formatParts=["placeholder","sp-F-sp-Y"],void(cellFormat="j-sp-F-sp-Y");formatParts=s,cellFormat=e}function pad(e,t){return t=t||2,"0000".substr(0,t-Math.min(String(e).length,t))+e}function addEvent(e,t,a){try{e.attachEvent?(e["e"+t+a]=a,e[t+a]=function(){e["e"+t+a](window.event)},e.attachEvent("on"+t,e[t+a])):e.addEventListener(t,a,!0)}catch(e){}}function removeEvent(e,t,a){try{e.detachEvent?(e.detachEvent("on"+t,e[t+a]),e[t+a]=null):e.removeEventListener(t,a,!0)}catch(e){}}function stopEvent(e){return(e=e||document.parentWindow.event).stopPropagation&&(e.stopPropagation(),e.preventDefault()),!1}function parseJSON(e){if("string"!=typeof e||""==e)return{};try{if("object"==typeof JSON&&JSON.parse)return window.JSON.parse(e);if(/lang|buttontabindex|mousewheel|cellformat|titleformat|nodrag|describedby/.test(e.toLowerCase()))return Function(["var document,top,self,window,parent,Number,Date,Object,Function,","Array,String,Math,RegExp,Image,ActiveXObject;","return (",e.replace(/<\!--.+-->/gim,"").replace(/\bfunction\b/g,"function"),");"].join(""))()}catch(e){}if(debug)throw"Could not parse the JSON object";return{err:"Could not parse the JSON object"}}function setARIARole(e,t){e&&e.tagName&&e.setAttribute("role",t)}function setARIAProperty(e,t,a){e&&e.tagName&&e.setAttribute("aria-"+t,a)}function datePicker(e){for(var t in this.dateSet=null,this.timerSet=!1,this.visible=!1,this.fadeTimer=null,this.timer=null,this.yearInc=0,this.monthInc=0,this.dayInc=0,this.mx=0,this.my=0,this.x=0,this.y=0,this.created=!1,this.disabled=!1,this.opacity=0,this.opacityTo=99,this.inUpdate=!1,this.kbEventsAdded=!1,this.fullCreate=!1,this.selectedTD=null,this.cursorTD=null,this.cursorDate=e.cursorDate?e.cursorDate:"",this.date=e.cursorDate?new Date(+e.cursorDate.substr(0,4),+e.cursorDate.substr(4,2)-1,+e.cursorDate.substr(6,2)):new Date,this.defaults={},this.dynDisabledDates={},this.firstDayOfWeek=localeImport.firstDayOfWeek,this.interval=new Date,this.clickActivated=!1,this.noFocus=!0,this.kbEvent=!1,this.disabledDates=!1,this.enabledDates=!1,this.delayedUpdate=!1,this.bespokeTitles={},e)-1==t.search(/callbacks|formElements|formatMasks/)&&(this[t]=e[t]);for(var a,s=0;a=["callbacks","formElements","formatMasks"][s];s++)for(var t in this[a]={},e[a])this[a][t]=e[a][t];
1this.date.setHours(5),this.changeHandler=function(){i.setDateFromInput(),i.callback("dateset",i.createCbArgObj())},this.createCbArgObj=function(){return this.dateSet?{id:this.id,date:this.dateSet,dd:pad(this.date.getDate()),mm:pad(this.date.getMonth()+1),yyyy:this.date.getFullYear()}:{id:this.id,date:null,dd:null,mm:null,yyyy:null}},this.getScrollOffsets=function(){return"number"==typeof window.pageYOffset?[window.pageXOffset,window.pageYOffset]:document.body&&(document.body.scrollLeft||document.body.scrollTop)?[document.body.scrollLeft,document.body.scrollTop]:document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)?[document.documentElement.scrollLeft,document.documentElement.scrollTop]:[0,0]},this.reposition=function(){if(i.created&&!i.staticPos){i.div.style.visibility="hidden",i.div.style.left=i.div.style.top="0px",i.div.style.display="block";var e=i.div.offsetHeight,t=i.div.offsetWidth,a=document.getElementById("fd-but-"+i.id),s=i.truePosition(a),n=document.compatMode&&"BackCompat"!=document.compatMode?document.documentElement:document.body,r=i.getScrollOffsets(),o=r[1],d=r[0],l=parseInt(n.clientHeight+o)>parseInt(e+s[1]+a.offsetHeight+2),h=parseInt(s[1]-(e+a.offsetHeight+2))>parseInt(o);i.div.style.visibility="visible",i.div.style.left=Number(parseInt(n.clientWidth+d)<parseInt(t+s[0])?Math.abs(parseInt(n.clientWidth+d-t)):s[0])+"px",i.div.style.top=l||!h?Math.abs(parseInt(s[1]+a.offsetHeight+2))+"px":Math.abs(parseInt(s[1]-(e+2)))+"px"}},this.removeOldFocus=function(){var e=document.getElementById(i.id+"-date-picker-hover");if(e)try{e.setAttribute("tabIndex","-1"),e.tabIndex=-1,e.className=e.className.replace(/date-picker-hover/,""),e.id="",e.onblur=null,e.onfocus=null}catch(e){}},this.addAccessibleDate=function(){var e=document.getElementById(i.id+"-date-picker-hover");if(e&&!e.getElementsByTagName("span").length){var t,a=e.className.match(/cd-([\d]{4})([\d]{2})([\d]{2})/),s=-1!=e.className.search(/date-picker-unused|out-of-range|day-disabled|no-selection|not-selectable/),n=document.createElement("span");for(n.className="fd-screen-reader";e.firstChild;)e.removeChild(e.firstChild);s&&((t=n.cloneNode(!1)).appendChild(document.createTextNode(getTitleTranslation(13))),e.appendChild(t));for(var r,o=0;r=formatParts[o];o++)"placeholder"==r?e.appendChild(document.createTextNode(+a[3])):((t=n.cloneNode(!1)).appendChild(document.createTextNode(printFormattedDate(new Date(a[1],+a[2]-1,a[3]),r,!0))),e.appendChild(t))}},this.setNewFocus=function(){var e=document.getElementById(i.id+"-date-picker-hover");if(e)try{e.setAttribute("tabIndex","0"),e.tabIndex=0,e.className=e.className.replace(/date-picker-hover/,"")+" date-picker-hover",this.clickActivated||(e.onblur=i.onblur,e.onfocus=i.onfocus),isOpera||this.clickActivated||i.addAccessibleDate(),this.noFocus||this.clickActivated||setTimeout(function(){try{e.focus()}catch(e){}},0)}catch(e){}},this.setCursorDate=function(e){-1!=String(e).search(/^([0-9]{8})$/)&&(this.date=new Date(+e.substr(0,4),+e.substr(4,2)-1,+e.substr(6,2)),this.cursorDate=e,this.staticPos&&this.updateTable())},this.updateTable=function(){if(i&&!i.inUpdate&&i.created){if(i.inUpdate=!0,i.removeOldFocus(),i.timerSet&&!i.delayedUpdate)if(i.monthInc){var e=i.date.getDate(),t=new Date(i.date);t.setDate(2),t.setMonth(t.getMonth()+1*i.monthInc),t.setDate(Math.min(e,daysInMonth(t.getMonth(),t.getFullYear()))),i.date=new Date(t)}else i.date.setDate(Math.min(i.date.getDate()+i.dayInc,daysInMonth(i.date.getMonth()+i.monthInc,i.date.getFullYear()+i.yearInc))),i.date.setMonth(i.date.getMonth()+i.monthInc),i.date.setFullYear(i.date.getFullYear()+i.yearInc);i.outOfRange(),i.noToday||i.disableTodayButton(),i.showHideButtons(i.date);var a=i.date.getDate(),s=i.date.getMonth(),n=i.date.getFullYear(),r=String(n)+pad(s+1)+pad(a),o=new Date(n,s,1);
1o.setHours(5);var d,l,h,c,u,p,m,f=(o.getDay()+6)%7,g=(f-i.firstDayOfWeek+7)%7-1,v=daysInMonth(s,n),b=new Date,y=String(o.getFullYear())+pad(o.getMonth()+1),D=[4,4,4,4,4,4],k=new Date(n,s-1,1),w=new Date(n,s+1,1),T=daysInMonth(k.getMonth(),k.getFullYear()),E=String(w.getFullYear())+pad(w.getMonth()+1),C=String(k.getFullYear())+pad(k.getMonth()+1),N=(w.getDay()+6)%7,M=(k.getDay()+6)%7,I=(b=b.getFullYear()+pad(b.getMonth()+1)+pad(b.getDate()),document.createElement("span"));i.firstDateShown=!i.constrainSelection&&i.fillGrid&&0-g<1?String(C)+(T+(0-g)):y+"01",i.lastDateShown=!i.constrainSelection&&i.fillGrid?E+pad(41-g-v):y+String(v),i.currentYYYYMM=y,p=i.callback("redraw",{id:i.id,dd:pad(a),mm:pad(s+1),yyyy:n,firstDateDisplayed:i.firstDateShown,lastDateDisplayed:i.lastDateShown})||{},dts=i.getDates(n,s+1),i.checkSelectedDate(),m=null!=i.dateSet&&i.dateSet.getFullYear()+pad(i.dateSet.getMonth()+1)+pad(i.dateSet.getDate()),I.className="fd-screen-reader",null!=this.selectedTD&&(setARIAProperty(this.selectedTD,"selected",!1),this.selectedTD=null);for(var S=0;S<42;S++){for(row=Math.floor(S/7),h=i.tds[S],I.cloneNode(!1);h.firstChild;)h.removeChild(h.firstChild);if(S>g&&S<=g+v||i.fillGrid?(u=y,weekDay=f,d=S-g,l=[],selectable=!0,d<1?(d=T+d,u=C,weekDay=M,selectable=!i.constrainSelection,l.push("month-out")):d>v&&(d-=v,u=E,weekDay=N,selectable=!i.constrainSelection,l.push("month-out")),weekDay=(weekDay+d+6)%7,l.push("day-"+localeDefaults.dayAbbrs[weekDay].toLowerCase()),c=u+String(d<10?"0":"")+d,i.rangeLow&&+c<+i.rangeLow||i.rangeHigh&&+c>+i.rangeHigh?(h.className="out-of-range",h.title="",h.appendChild(document.createTextNode(d)),i.showWeeks&&(D[row]=Math.min(D[row],2))):(selectable?(h.title=titleFormat?printFormattedDate(new Date(+String(u).substr(0,4),+String(u).substr(4,2)-1,+d),titleFormat,!0):"",l.push("cd-"+c+" yyyymm-"+u+" mmdd-"+u.substr(4,2)+pad(d))):(h.title=titleFormat?getTitleTranslation(13)+" "+printFormattedDate(new Date(+String(u).substr(0,4),+String(u).substr(4,2)-1,+d),titleFormat,!0):"",l.push("yyyymm-"+u+" mmdd-"+u.substr(4,2)+pad(d)+" not-selectable")),c==b&&l.push("date-picker-today"),m==c&&(l.push("date-picker-selected-date"),setARIAProperty(h,"selected","true"),this.selectedTD=h),(i.disabledDays[weekDay]||0==dts[c])&&(l.push("day-disabled"),titleFormat&&selectable&&(h.title=getTitleTranslation(13)+" "+h.title)),c in p&&l.push(p[c]),i.highlightDays[weekDay]&&l.push("date-picker-highlight"),r==c&&(h.id=i.id+"-date-picker-hover"),h.appendChild(document.createTextNode(d)),h.className=l.join(" "),i.showWeeks&&(D[row]=Math.min("month-out"==l[0]?3:1,D[row])))):(h.className="date-picker-unused",h.appendChild(document.createTextNode(nbsp)),h.title=""),i.showWeeks&&S-7*row==6){for(;i.wkThs[row].firstChild;)i.wkThs[row].removeChild(i.wkThs[row].firstChild);i.wkThs[row].appendChild(document.createTextNode(4!=D[row]||i.fillGrid?getWeekNumber(n,s,S-g-6):nbsp)),i.wkThs[row].className="date-picker-week-header"+["",""," out-of-range"," month-out",""][D[row]]}}for(var _=i.titleBar.getElementsByTagName("span");_[0].firstChild;)_[0].removeChild(_[0].firstChild);for(;_[1].firstChild;)_[1].removeChild(_[1].firstChild);_[0].appendChild(document.createTextNode(getMonthTranslation(s,!1)+nbsp)),_[1].appendChild(document.createTextNode(n)),i.timerSet&&(i.timerInc=50+Math.round((i.timerInc-50)/1.8),i.timer=window.setTimeout(i.updateTable,i.timerInc)),i.inUpdate=i.delayedUpdate=!1,i.setNewFocus()}},this.destroy=function(){if(document.getElementById("fd-but-"+this.id)&&document.getElementById("fd-but-"+this.id).parentNode.removeChild(document.getElementById("fd-but-"+this.id)),this.created){if(removeEvent(this.table,"mousedown",i.onmousedown),removeEvent(this.table,"mouseover",i.onmouseover),removeEvent(this.table,"mouseout",i.onmouseout),removeEvent(document,"mousedown",i.onmousedown),removeEvent(document,"mouseup",i.clearTimer),window.addEventListener&&!window.devicePixelRatio)try{window.removeEventListener("DOMMouseScroll",this.onmousewheel,!1)}catch(e){}else removeEvent(document,"mousewheel",this.onmousewheel),removeEvent(window,"mousewheel",this.onmousewheel);i.removeOnFocusEvents(),clearTimeout(i.fadeTimer),clearTimeout(i.timer),this.div&&this.div.parentNode&&this.div.parentNode.removeChild(this.div),i=null}},this.resizeInlineDiv=function(){i.div.style.width=i.table.offsetWidth+"px",i.div.style.height=i.table.offsetHeight+"px"},this.create=function(){function e(e){var t=document.createElement("th");return e.thClassName&&(t.className=e.thClassName),e.colspan&&t.setAttribute("colspan",e.colspan),t}function t(t,a){for(var s,n=0;s=a[n];n++){var r=e(s);t.appendChild(r);var o=document.createElement("span");o.className=s.className,o.id=i.id+s.id,o.appendChild(document.createTextNode(s.text||i.nbsp)),o.title=s.title||"",r.appendChild(o)}}
1if(!document.getElementById("fd-"+this.id)){var a,s,n,r,o,d;this.noFocus=!0,this.div=document.createElement("div"),this.div.id="fd-"+this.id,this.div.className="datePicker",this.div.style.visibility="hidden",this.div.style.display="none",this.describedBy&&document.getElementById(this.describedBy)&&setARIAProperty(this.div,"describedby",this.describedBy),this.labelledBy&&setARIAProperty(this.div,"labelledby",this.labelledBy.id),this.table=document.createElement("table"),this.table.className="datePickerTable",this.table.onmouseover=this.onmouseover,this.table.onmouseout=this.onmouseout,this.table.onclick=this.onclick,this.staticPos&&(this.table.onmousedown=this.onmousedown),this.div.appendChild(this.table);var l=this.dragDisabled?"":" drag-enabled";if(this.staticPos){if(elem=document.getElementById(this.positioned?this.positioned:this.id),!elem){if(this.div=null,debug)throw this.positioned?"Could not locate a datePickers associated parent element with an id:"+this.positioned:"Could not locate a datePickers associated input with an id:"+this.id;return}if(this.div.className+=" static-datepicker",this.positioned?elem.appendChild(this.div):elem.parentNode.insertBefore(this.div,elem.nextSibling),this.hideInput)for(var h in this.formElements)elem=document.getElementById(h),elem&&(elem.className+=" fd-hidden-input");setTimeout(this.resizeInlineDiv,300)}else this.div.style.visibility="hidden",this.div.className+=l,document.getElementsByTagName("body")[0].appendChild(this.div),setARIAProperty(this.div,"hidden","true");setARIARole(this.div,"grid"),this.statusFormat&&(d=document.createElement("tfoot"),this.table.appendChild(d),(a=document.createElement("tr")).className="date-picker-tfoot",d.appendChild(a),this.statusBar=e({thClassName:"date-picker-statusbar"+l,colspan:this.showWeeks?8:7}),a.appendChild(this.statusBar),this.updateStatus()),r=document.createElement("thead"),this.table.appendChild(r),setARIARole(a=document.createElement("tr"),"presentation"),r.appendChild(a),this.titleBar=e({thClassName:"date-picker-title"+l,colspan:this.showWeeks?8:7}),a.appendChild(this.titleBar),a=null;var c=document.createElement("span");c.appendChild(document.createTextNode(nbsp)),c.className="month-display"+l,this.titleBar.appendChild(c),(c=document.createElement("span")).appendChild(document.createTextNode(nbsp)),c.className="year-display"+l,this.titleBar.appendChild(c),c=null,setARIARole(a=document.createElement("tr"),"presentation"),r.appendChild(a),t(a,[{className:"prev-but prev-year",id:"-prev-year-but",text:"\xab",title:getTitleTranslation(2)},{className:"prev-but prev-month",id:"-prev-month-but",text:"\u2039",title:getTitleTranslation(0)},{colspan:this.showWeeks?4:3,className:"today-but",id:"-today-but",text:getTitleTranslation(4)},{className:"next-but next-month",id:"-next-month-but",text:"\u203a",title:getTitleTranslation(1)},{className:"next-but next-year",id:"-next-year-but",text:"\xbb",title:getTitleTranslation(3)}]),o=document.createElement("tbody"),this.table.appendChild(o);for(var u,p=this.showWeeks?8:7,m=this.showWeeks?0:-1,f=0;f<7;f++){s=document.createElement("tr"),0!=f?(setARIARole(s,"row"),o.appendChild(s)):r.appendChild(s);for(var g=0;g<p;g++)0===f||this.showWeeks&&0===g?n=document.createElement("th"):(setARIAProperty(n=document.createElement("td"),"describedby",this.id+"-col-"+g+(this.showWeeks?" "+this.id+"-row-"+f:"")),setARIAProperty(n,"selected","false")),s.appendChild(n),this.showWeeks&&g>0&&f>0||!this.showWeeks&&f>0?setARIARole(n,"gridcell"):0===f&&g>m?(n.className="date-picker-day-header",n.scope="col",setARIARole(n,"columnheader"),n.id=this.id+"-col-"+g):(n.className="date-picker-week-header",n.scope="row",setARIARole(n,"rowheader"),n.id=this.id+"-row-"+f)}n=s=null,this.ths=this.table.getElementsByTagName("thead")[0].getElementsByTagName("tr")[2].getElementsByTagName("th");for(var v=0;v<p;v++)0==v&&this.showWeeks?(this.ths[v].appendChild(document.createTextNode(getTitleTranslation(6))),this.ths[v].title=getTitleTranslation(8)):v>(this.showWeeks?0:-1)&&((u=document.createElement("span")).className="fd-day-header",this.ths[v].appendChild(u));u=null,this.trs=this.table.getElementsByTagName("tbody")[0].getElementsByTagName("tr"),this.tds=this.table.getElementsByTagName("tbody")[0].getElementsByTagName("td"),this.butPrevYear=document.getElementById(this.id+"-prev-year-but"),this.butPrevMonth=document.getElementById(this.id+"-prev-month-but"),this.butToday=document.getElementById(this.id+"-today-but"),this.butNextYear=document.getElementById(this.id+"-next-year-but"),this.butNextMonth=document.getElementById(this.id+"-next-month-but"),this.noToday&&(this.butToday.style.display="none"),this.showWeeks&&(this.wkThs=this.table.getElementsByTagName("tbody")[0].getElementsByTagName("th"),this.div.className+=" weeks-displayed"),o=r=a=t=e=null,this.rangeLow&&this.rangeHigh&&this.rangeHigh-this.rangeLow<7&&this.equaliseDates(),this.updateTableHeaders(),this.created=!0,this.updateTable(),this.staticPos?(this.visible=!0,this.opacity=this.opacityTo=this.finalOpacity,this.div.style.visibility="visible",this.div.style.display="block",this.noFocus=!0,this.fade()):(this.reposition(),this.div.style.visibility="visible",this.fade(),this.noFocus=!0),this.callback("domcreate",{id:this.id})}},this.fade=function(){window.clearTimeout(i.fadeTimer),i.fadeTimer=null;var e=Math.round(i.opacity+(i.opacityTo-i.opacity)/4);i.setOpacity(e),Math.abs(i.opacityTo-e)>3&&!i.noFadeEffect?i.fadeTimer=window.setTimeout(i.fade,50):(i.setOpacity(i.opacityTo),0==i.opacityTo?(i.div.style.display="none",i.div.style.visibility="hidden",setARIAProperty(i.div,"hidden","true"),i.visible=!1):(setARIAProperty(i.div,"hidden","false"),i.visible=!0))},this.trackDrag=function(e){var t=((e=e||window.event).pageX?e.pageX:e.clientX?e.clientX:e.x)-i.mx,a=(e.pageY?e.pageY:e.clientY?e.clientY:e.Y)-i.my;i.div.style.left=Math.round(i.x+t)>
10?Math.round(i.x+t)+"px":"0px",i.div.style.top=Math.round(i.y+a)>0?Math.round(i.y+a)+"px":"0px"},this.stopDrag=function(){var e=document.getElementsByTagName("body")[0];e.className=e.className.replace(/fd-drag-active/g,""),removeEvent(document,"mousemove",i.trackDrag,!1),removeEvent(document,"mouseup",i.stopDrag,!1),i.div.style.zIndex=9999},this.onmousedown=function(e){var t=null!=(e=e||document.parentWindow.event).target?e.target:e.srcElement,a=t,s=!0,n=new RegExp("^fd-(but-)?"+i.id+"$");for(i.mouseDownElem=null;t;){if(t.id&&t.id.length&&-1!=t.id.search(n)){s=!1;break}try{t=t.parentNode}catch(e){break}}if(s)return hideAll(),!0;if(-1!=(i.div.className+a.className).search("fd-disabled"))return!0;if(-1!=a.id.search(new RegExp("^"+i.id+"(-prev-year-but|-prev-month-but|-next-month-but|-next-year-but)$"))){i.mouseDownElem=a,addEvent(document,"mouseup",i.clearTimer),addEvent(a,"mouseout",i.clearTimer);var r={"-prev-year-but":[0,-1,0],"-prev-month-but":[0,0,-1],"-next-year-but":[0,1,0],"-next-month-but":[0,0,1]},o=a.id.replace(i.id,""),d=Number(i.date.getFullYear()+pad(i.date.getMonth()+1));return i.timerInc=800,i.timerSet=!0,i.dayInc=r[o][0],i.yearInc=r[o][1],i.monthInc=r[o][2],i.accellerator=1,i.currentYYYYMM!=d&&(i.currentYYYYMM<d&&(-1==i.yearInc||-1==i.monthInc)||i.currentYYYYMM>d&&(1==i.yearInc||1==i.monthInc)?(i.delayedUpdate=!1,i.timerInc=1200):(i.delayedUpdate=!0,i.timerInc=800)),i.updateTable(),stopEvent(e)}if(-1!=t.className.search("drag-enabled")){i.mx=e.pageX?e.pageX:e.clientX?e.clientX:e.x,i.my=e.pageY?e.pageY:e.clientY?e.clientY:e.Y,i.x=parseInt(i.div.style.left),i.y=parseInt(i.div.style.top),addEvent(document,"mousemove",i.trackDrag,!1),addEvent(document,"mouseup",i.stopDrag,!1);var l=document.getElementsByTagName("body")[0];return l.className=l.className.replace(/fd-drag-active/g,"")+" fd-drag-active",i.div.style.zIndex=1e4,stopEvent(e)}return!0},this.onclick=function(e){if(i.opacity!=i.opacityTo||i.disabled)return stopEvent(e);for(var t=null!=(e=e||document.parentWindow.event).target?e.target:e.srcElement;t.parentNode;){if(t.tagName&&"td"==t.tagName.toLowerCase()){if(-1==t.className.search(/cd-([0-9]{8})/)||-1!=t.className.search(/date-picker-unused|out-of-range|day-disabled|no-selection|not-selectable/))return stopEvent(e);var a=t.className.match(/cd-([0-9]{8})/)[1];i.date=new Date(a.substr(0,4),a.substr(4,2)-1,a.substr(6,2)),i.dateSet=new Date(i.date),i.noFocus=!0,i.callback("dateset",{id:i.id,date:i.dateSet,dd:i.dateSet.getDate(),mm:i.dateSet.getMonth()+1,yyyy:i.dateSet.getFullYear()}),i.returnFormattedDate(),i.hide(),i.stopTimer();break}if(t.id&&t.id==i.id+"-today-but"){i.date=new Date,i.updateTable(),i.stopTimer();break}if(-1!=t.className.search(/date-picker-day-header/)){for(var s=i.showWeeks?-1:0,n=t;n.previousSibling;)(n=n.previousSibling).tagName&&"th"==n.tagName.toLowerCase()&&s++;i.firstDayOfWeek=(i.firstDayOfWeek+s)%7,i.updateTableHeaders();break}try{t=t.parentNode}catch(e){break}}return stopEvent(e)},this.show=function(e){if(!this.staticPos){var t,a;for(a in this.formElements)if(!(t=document.getElementById(this.id))||t&&t.disabled)return;this.noFocus=!0,this.created&&document.getElementById("fd-"+this.id)?(this.setDateFromInput(),this.reposition()):(this.created=!1,this.fullCreate=!1,this.create(),this.fullCreate=!0),this.noFocus=!e,this.noFocus?(this.clickActivated=!0,addEvent(document,"mousedown",this.onmousedown),mouseWheel&&(window.addEventListener&&!window.devicePixelRatio?window.addEventListener("DOMMouseScroll",this.onmousewheel,!1):(addEvent(document,"mousewheel",this.onmousewheel),addEvent(window,"mousewheel",this.onmousewheel)))):this.clickActivated=!1,this.opacityTo=this.finalOpacity,this.div.style.display="block",this.setNewFocus(),this.fade();var s=document.getElementById("fd-but-"+this.id);s&&(s.className=s.className.replace("dp-button-active","")+" dp-button-active")}},this.hide=function(){if(this.visible&&this.created&&document.getElementById("fd-"+this.id)&&(this.kbEvent=!1,i.div.className=i.div.className.replace("datepicker-focus",""),this.stopTimer(),this.removeOnFocusEvents(),this.clickActivated=!1,this.statusBar&&this.updateStatus(getTitleTranslation(9)),this.noFocus=!0,this.setNewFocus(),!this.staticPos)){var e=document.getElementById("fd-but-"+this.id
1);if(e&&(e.className=e.className.replace("dp-button-active","")),removeEvent(document,"mousedown",this.onmousedown),mouseWheel)if(window.addEventListener&&!window.devicePixelRatio)try{window.removeEventListener("DOMMouseScroll",this.onmousewheel,!1)}catch(e){}else removeEvent(document,"mousewheel",this.onmousewheel),removeEvent(window,"mousewheel",this.onmousewheel);this.opacityTo=0,this.fade()}},this.onblur=function(){i.hide()},this.onfocus=function(){i.noFocus=!1,i.div.className=i.div.className.replace("datepicker-focus","")+" datepicker-focus",i.addOnFocusEvents()},this.onmousewheel=function(e){var t=0;(e=e||document.parentWindow.event).wheelDelta?(t=e.wheelDelta/120,isOpera&&window.opera.version()<9.2&&(t=-t)):e.detail&&(t=-e.detail/3);var a=i.date.getDate(),s=new Date(i.date),n=t>0?1:-1;return s.setDate(2),s.setMonth(s.getMonth()+1*n),s.setDate(Math.min(a,daysInMonth(s.getMonth(),s.getFullYear()))),i.outOfRange(s)||(i.date=new Date(s),i.updateTable(),i.statusBar&&i.updateStatus(printFormattedDate(i.date,i.statusFormat,!0))),stopEvent(e)},this.onkeydown=function(e){if(i.stopTimer(),!i.visible)return!1;var t=(e=e||document.parentWindow.event).keyCode?e.keyCode:e.charCode;if(13==t)return(o=document.getElementById(i.id+"-date-picker-hover"))&&-1!=o.className.search(/cd-([0-9]{8})/)&&-1==o.className.search(/no-selection|out-of-range|day-disabled/)?(i.dateSet=new Date(i.date),i.callback("dateset",i.createCbArgObj()),i.returnFormattedDate(),i.hide(),stopEvent(e)):stopEvent(e);
1if(27==t)return!!i.staticPos||(i.hide(),stopEvent(e));if(32==t||0==t)return i.date=new Date,i.updateTable(),stopEvent(e);if(9==t)return!!i.staticPos||stopEvent(e);if(isMoz){if((new Date).getTime()-i.interval.getTime()<50)return stopEvent(e);i.interval=new Date}if(t>49&&t<56||t>97&&t<104)return t>96&&(t-=48),t-=49,i.firstDayOfWeek=(i.firstDayOfWeek+t)%7,i.updateTableHeaders(),stopEvent(e);if(t<33||t>40)return!0;var a=new Date(i.date);i.date.getFullYear(),pad(i.date.getMonth()+1);if(36==t)a.setDate(1);else if(35==t)a.setDate(daysInMonth(a.getMonth(),a.getFullYear()));else if(33==t||34==t){var s=34==t?1:-1;if(e.ctrlKey)a.setFullYear(a.getFullYear()+1*s);else{var n=i.date.getDate();a.setDate(2),a.setMonth(a.getMonth()+1*s),a.setDate(Math.min(n,daysInMonth(a.getMonth(),a.getFullYear())))}}else 37==t?a=new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate()-1):39==t||34==t?a=new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate()+1):38==t?a=new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate()-7):40==t&&(a=new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate()+7));if(i.outOfRange(a))return stopEvent(e);i.date=a,i.statusBar&&i.updateStatus(i.getBespokeTitle(i.date.getFullYear(),i.date.getMonth()+1,i.date.getDate())||printFormattedDate(i.date,i.statusFormat,!0));var r=String(i.date.getFullYear())+pad(i.date.getMonth()+1)+pad(i.date.getDate());if(e.ctrlKey||33==t||34==t||r<i.firstDateShown||r>i.lastDateShown)i.updateTable();else{i.noToday||i.disableTodayButton(),i.removeOldFocus();for(var o,d=0;o=i.tds[d];d++)if(-1!=o.className.search("cd-"+r)){i.showHideButtons(i.date),o.id=i.id+"-date-picker-hover",i.setNewFocus();break}}return stopEvent(e)},this.onmouseout=function(e){i.removeOldFocus();for(var t=(e=e||document.parentWindow.event).toElement||e.relatedTarget;t&&t!=this;)try{t=t.parentNode}catch(e){t=this}if(t==this)return!1;i.currentTR&&(i.currentTR.className="",i.currentTR=null),i.statusBar&&i.updateStatus(i.getBespokeTitle(i.date.getFullYear(),i.date.getMonth()+1,i.date.getDate())||printFormattedDate(i.date,i.statusFormat,!0))},this.onmouseover=function(e){for(var t=null!=(e=e||document.parentWindow.event).target?e.target:e.srcElement;1!=t.nodeType;)t=t.parentNode;if(t&&t.tagName){var a=getTitleTranslation(9);switch(t.tagName.toLowerCase()){case"td":if(-1!=t.className.search(/date-picker-unused|out-of-range/)&&(a=getTitleTranslation(9)),-1!=t.className.search(/cd-([0-9]{8})/)){i.stopTimer();var s=t.className.match(/cd-([0-9]{8})/)[1];i.removeOldFocus(),t.id=i.id+"-date-picker-hover",i.setNewFocus(),i.date=new Date(+s.substr(0,4),+s.substr(4,2)-1,+s.substr(6,2)),i.noToday||i.disableTodayButton(),a=i.getBespokeTitle(+s.substr(0,4),+s.substr(4,2),+s.substr(6,2))||printFormattedDate(i.date,i.statusFormat,!0)}break;case"th":if(!i.statusBar)break;if(-1!=t.className.search(/drag-enabled/))a=getTitleTranslation(10);else if(-1!=t.className.search(/date-picker-week-header/)){var n=t.firstChild?t.firstChild.nodeValue:"";a=-1!=n.search(/^(\d+)$/)?getTitleTranslation(7,[n,n<3&&11==i.date.getMonth()?getWeeksInYear(i.date.getFullYear())+1:getWeeksInYear(i.date.getFullYear())]):getTitleTranslation(9)}break;case"span":if(!i.statusBar)break;if(-1!=t.className.search(/drag-enabled/))a=getTitleTranslation(10);else if(-1!=t.className.search(/day-([0-6])/)){var r=t.className.match(/day-([0-6])/)[1];a=getTitleTranslation(11,[getDayTranslation(r,!1)])}else-1!=t.className.search(/prev-year/)?a=getTitleTranslation(2):-1!=t.className.search(/prev-month/)?a=getTitleTranslation(0):-1!=t.className.search(/next-year/)?a=getTitleTranslation(3):-1!=t.className.search(/next-month/)?a=getTitleTranslation(1):-1!=t.className.search(/today-but/)&&-1==t.className.search(/disabled/)&&(a=getTitleTranslation(12));break;default:a=""}for(;t.parentNode;)if(1==(t=t.parentNode).nodeType&&"tr"==t.tagName.toLowerCase()){if(i.currentTR){if(t==i.currentTR)break;i.currentTR.className=""}t.className="dp-row-highlight",i.currentTR=t;break}i.statusBar&&a&&i.updateStatus(a)}},this.clearTimer=function(){i.stopTimer(),i.timerInc=800,i.yearInc=0,i.monthInc=0,i.dayInc=0,removeEvent(document,"mouseup",i.clearTimer),null!=i.mou
1seDownElem&&removeEvent(i.mouseDownElem,"mouseout",i.clearTimer),i.mouseDownElem=null};var i=this;this.setDateFromInput(),this.staticPos?this.create():this.createButton(),function(){var e,t;for(e in i.formElements)(t=document.getElementById(e))&&t.tagName&&-1!=t.tagName.search(/select|input/i)&&addEvent(t,"change",i.changeHandler),t&&1!=t.disabled||i.disableDatePicker()}(),this.fullCreate=!0}var debug=!1,isOpera="[object Opera]"===Object.prototype.toString.call(window.opera),isMoz=/mozilla/.test(navigator.userAgent.toLowerCase())&&!/(compatible|webkit)/.test(navigator.userAgent.toLowerCase()),languageInfo=parseUILanguage(),datePickers={},uniqueId=0,weeksInYearCache={},localeImport=!1,nbsp=String.fromCharCode(160),describedBy="",nodrag=!0,buttonTabIndex=!0,returnLocaleDate=!1,mouseWheel=!0,cellFormat="d-sp-F-sp-Y",titleFormat="F-sp-d-cc-sp-Y",formatParts=isOpera?["placeholder"]:["placeholder","sp-F-sp-Y"],dividors=["dt","sl","ds","cc","sp"],dvParts="dt|sl|ds|cc|sp",dParts="d|j",mParts="m|n|M|F",yParts="Y|y",kbEvent=!1,bespokeTitles={},finalOpacity=100,validFmtRegExp=/^((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|y]))(-((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|y])))*$/,rangeRegExp=/^((\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01]))$/,wcDateRegExp=/^(((\d\d\d\d)|(\*\*\*\*))((0[1-9]|1[012])|(\*\*))(0[1-9]|[12][0-9]|3[01]))$/;!function(){var e=document.getElementsByTagName("script"),t=parseJSON(String(e[e.length-1].innerHTML).replace(/[\n\r\s\t]+/g," ").replace(/^\s+/,"").replace(/\s+$/,""));if("object"!=typeof t||"err"in t||affectJSON(t),"object"!=typeof fdLocale){for(var a,s=document.getElementsByTagName("head")[0]||document.documentElement,i=e[e.length-1].src.substr(0,e[e.length-1].src.lastIndexOf("/"))+"/lang/",n=0;n<languageInfo.length;n++)(a=document.createElement("script")).type="text/javascript",a.src=i+languageInfo[n]+".js",a.charSet="utf-8",s.appendChild(a);a=null}else returnLocaleDate=!0}(),datePicker.prototype.addButtonEvents=function(e){function t(e){e=e||window.event;var t=this.id.replace("fd-but-",""),a=isVisible(t),s=!1;if(!datePickers[t].kbEvent){if("keydown"==e.type){if(datePickers[t].kbEvent=!0,13!=(null!=e.keyCode?e.keyCode:e.charCode))return!0;if(a)return this.className=this.className.replace("dp-button-active",""),hideAll(),stopEvent(e);s=!0}else datePickers[t].kbEvent=!1;return this.className=this.className.replace("dp-button-active",""),a?hideAll():(this.className+=" dp-button-active",hideAll(t),showDatePicker(t,s)),stopEvent(e)}datePickers[t].kbEvent=!1}e.onkeydown=t,e.onclick=t,buttonTabIndex&&!1!==this.bespokeTabIndex?(e.setAttribute("tabIndex",this.bespokeTabIndex),e.tabIndex=this.bespokeTabIndex):(e.setAttribute("tabIndex","-1"),e.tabIndex=-1,e.onkeydown=null,removeEvent(e,"keydown",t))},datePicker.prototype.createButton=function(){if(!this.staticPos&&!document.getElementById("fd-but-"+this.id)){var e=document.getElementById(this.id),t=document.createElement("span"),a=document.createElement("a");a.href="#"+this.id,a.className="date-picker-control",a.title=getTitleTranslation(5),a.id="fd-but-"+this.id,t.appendChild(document.createTextNode(nbsp)),a.appendChild(t),(t=document.createElement("span")).className="fd-screen-reader",t.appendChild(document.createTextNode(a.title)),a.appendChild(t),setARIARole(a,"button"),setARIAProperty(a,"haspopup",!0),this.positioned&&document.getElementById(this.positioned)?document.getElementById(this.positioned).appendChild(a):e.parentNode.insertBefore(a,e.nextSibling),this.addButtonEvents(a),a=null,this.callback("dombuttoncreate",{id:this.id})}},datePicker.prototype.setBespokeTitles=function(e){this.bespokeTitles=e},datePicker.prototype.addBespokeTitles=function(e){for(var t in e)this.bespokeTitles[t]=e[t]},datePicker.prototype.getBespokeTitle=function(e,t,a){var s,i=e+String(pad(t))+pad(a) 2;for(s in this.bespokeTitles)if(s.replace(/^(\*\*\*\*)/,e).replace(/^(\d\d\d\d)(\*\*)/,"$1"+pad(t))==i)return this.bespokeTitles[s];for(s in bespokeTitles)if(s.replace(/^(\*\*\*\*)/,e).replace(/^(\d\d\d\d)(\*\*)/,"$1"+pad(t))==i)return bespokeTitles[s];return!1},datePicker.prototype.returnSelectedDate=function(){return this.dateSet},datePicker.prototype.setRangeLow=function(e){this.rangeLow=-1!=String(e).search(/^(\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/)&&e,this.inUpdate||this.setDateFromInput()},datePicker.prototype.setRangeHigh=function(e){this.rangeHigh=-1!=String(e).search(/^(\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/)&&e,this.inUpdate||this.setDateFromInput()},datePicker.prototype.setDisabledDays=function(e){if(!e.length||7!=e.length||-1==e.join("").search(/^([0|1]{7}
2)$/)){if(debug)throw"Invalid values located when attempting to call setDisabledDays";return!1}this.disabledDays=e,this.inUpdate||this.setDateFromInput()},datePicker.prototype.setDisabledDates=function(e){this.disabledDates={},this.addDisabledDates(e)},datePicker.prototype.setEnabledDates=function(e){this.enabledDates={},this.addEnabledDates(e)},datePicker.prototype.addDisabledDates=function(e){var t;for(t in this.enabledDates=!1,this.disabledDates=this.disabledDates||{},e)(-1!=String(t).search(wcDateRegExp)&&1==e[t]||-1!=String(t).search(rangeRegExp)&&-1!=String(e[t]).search(rangeRegExp))&&(this.disabledDates[t]=e[t]);this.inUpdate||this.setDateFromInput()},datePicker.prototype.addEnabledDates=function(e){var t;for(t in this.disabledDates=!1,this.enabledDates=this.enabledDates||{},e)(-1!=String(t).search(wcDateRegExp)&&1==e[t]||-1!=String(t).search(rangeRegExp)&&-1!=String(e[t]).search(rangeRegExp))&&(this.enabledDates[t]=e[t]);this.inUpdate||this.setDateFromInput()},datePicker.prototype.setSelectedDate=function(e){if(-1==String(e).search(wcDateRegExp))return!1;var t=e.match(rangeRegExp),a=new Date(+t[2],+t[3]-1,+t[4]);if(!a||isNaN(a)||!this.canDateBeSelected(a))return!1;this.dateSet=new Date(a),this.inUpdate||this.updateTable(),this.callback("dateset",this.createCbArgObj()),this.returnFormattedDate()},datePicker.prototype.checkSelectedDate=function(){this.dateSet&&!this.canDateBeSelected(this.dateSet)&&(this.dateSet=null),this.inUpdate||this.updateTable()},datePicker.prototype.addOnFocusEvents=function(){this.kbEventsAdded||this.noFocus||(addEvent(document,"keypress",this.onkeydown),addEvent(document,"mousedown",this.onmousedown),window.devicePixelRatio&&(removeEvent(document,"keypress",this.onkeydown),addEvent(document,"keydown",this.onkeydown)),this.noFocus=!1,this.kbEventsAdded=!0)},datePicker.prototype.removeOnFocusEvents=function(){this.kbEventsAdded&&(removeEvent(document,"keypress",this.onkeydown),removeEvent(document,"keydown",this.onkeydown),removeEvent(document,"mousedown",this.onmousedown),this.kbEventsAdded=!1)},datePicker.prototype.stopTimer=function(){this.timerSet=!1,window.clearTimeout(this.timer)},datePicker.prototype.setOpacity=function(e){this.div.style.opacity=e/100,this.div.style.filter="alpha(opacity="+e+")",this.opacity=e},datePicker.prototype.getDates=function(e,t){for(var a=daysInMonth(t-1,e),s={},i=this.getGenericDates(e,t,!1),n=this.getGenericDates(e,t,!0),r=e+pad(t),o=1;o<=a;o++)dt=r+""+pad(o),s[dt]=i?dt in i?0:1:n?dt in n?1:0:1;return s},datePicker.prototype.getGenericDates=function(e,t,a){var s=a?this.enabledDates:this.disabledDates;if(!s)return!1;t=pad(t);var i,n,r,o,d={},l=this.firstDateShown,h=this.lastDateShown;for(dt in h&&l||(l=this.firstDateShown=e+pad(t)+"01",h=this.lastDateShown=e+pad(t)+pad(daysInMonth(t,e))),s)if(i=dt.replace(/^(\*\*\*\*)/,e).replace(/^(\d\d\d\d)(\*\*)/,"$1"+t),1!=(n=s[dt])){if(+String(this.firstDateShown).substr(0,6)>=Number(i.substr(0,6))&&+String(this.lastDateShown).substr(0,6)<=Number(n.substr(0,6))){if(Number(i.substr(0,6))==Number(n.substr(0,6))){for(var c=i;c<=n;c++)d[c]=1;continue}r=Number(i.substr(0,6))==+String(this.firstDateShown).substr(0,6)?i:l,o=Number(n.substr(0,6))==+String(this.lastDateShown).substr(0,6)?n:h;for(c=+r;c<=+o;c++)d[c]=1}}else Number(i.substr(0,6))>=+String(this.firstDateShown).substr(0,6)&&Number(i.substr(0,6))<=+String(this.lastDateShown).substr(0,6)&&(d[i]=1);return d},datePicker.prototype.truePosition=function(e){var t=this.cumulativeOffset(e);if(isOpera)return t;var a=document.compatMode&&"BackCompat"!=document.compatMode?document.documentElement:document.body,s=document.all?a.scrollLeft:window.pageXOffset,i=document.all?a.scrollTop:window.pageYOffset,n=this.realOffset(e);return[t[0]-n[0]+s,t[1]-n[1]+i]},datePicker.prototype.realOffset=function(e){var t=0,a=0;do{t+=e.scrollTop||0,a+=e.scrollLeft||0,e=e.parentNode}while(e);return[a,t]},datePicker.prototype.cumulativeOffset=function(e){var t=0,a=0;do{t+=e.offsetTop||0,a+=e.offsetLeft||0,e=e.offsetParent}while(e);return[a,t]},datePicker.prototype.equaliseDates=function(){for(var e,t=!1,a=this.rangeLow;a<=this.rangeHigh;a++)if(e=String(a),!this.disabledDays[new Date(e.substr(0,4),e.substr(6,2),e.substr(4,2)).getDay()-1]){t=!0;break}t||(this.disabledDays=[0,0,0,0,0,0,0])},datePicker.prototype.outOfRange=function(e){if(!this.rangeLow&&!this.rangeHigh)return!1;var t=!1;e||(t=!0,e=this.date);var a=pad(e.getDate()),s=pad(e.getMonth()+1),i=e.getFullYear(),n=String(i)+String(s)+String(a);if(this.rangeLow&&+n<+this.rangeLow)return!t||(this.date=new Date(this.rangeLow.substr(0,4),this.rangeLow.substr(4,2)-1,this.rangeLow.substr(6,2),5,0,0),!1);if(this.rangeHigh&&+n>
2+this.rangeHigh){if(!t)return!0;this.date=new Date(this.rangeHigh.substr(0,4),this.rangeHigh.substr(4,2)-1,this.rangeHigh.substr(6,2),5,0,0)}return!1},datePicker.prototype.canDateBeSelected=function(e){if(!e)return!1;var t=pad(e.getDate()),a=pad(e.getMonth()+1),s=e.getFullYear(),i=String(s)+String(a)+String(t),n=this.getDates(s,a),r=0==e.getDay()?7:e.getDay();return!(this.rangeLow&&+i<+this.rangeLow||this.rangeHigh&&+i>+this.rangeHigh||0==n[i]||this.disabledDays[r-1])},datePicker.prototype.updateStatus=function(e){for(;this.statusBar.firstChild;)this.statusBar.removeChild(this.statusBar.firstChild);if(e&&-1!=this.statusFormat.search(/-S|S-/)&&-1!=e.search(/([0-9]{1,2})(st|nd|rd|th)/)){e=e.replace(/([0-9]{1,2})(st|nd|rd|th)/,"$1<sup>$2</sup>").split(/<sup>|<\/sup>/);for(var t,a=document.createDocumentFragment(),s=0;t=e[s];s++)if(/^(st|nd|rd|th)$/.test(t)){var i=document.createElement("sup");i.appendChild(document.createTextNode(t)),a.appendChild(i)}else a.appendChild(document.createTextNode(t));this.statusBar.appendChild(a)}else this.statusBar.appendChild(document.createTextNode(e||getTitleTranslation(9)))},datePicker.prototype.setDateFromInput=function(){this.dateSet;var e,t,a,s,i,n,r,o=!1;for(t in this.dateSet=null,this.formElements){if(!(a=document.getElementById(t)))return;if(r=String(a.value),s=this.formElements[t],e=!1,""!=r)for(var d,l=0;(d=this.formatMasks[t][l])&&!(e=parseDateString(r,d));l++);e&&(-1!=s.search(new RegExp("["+dParts+"]"))&&(i=e.getDate()),-1!=s.search(new RegExp("["+mParts+"]"))&&(o=e.getMonth()),-1!=s.search(new RegExp("["+yParts+"]"))&&(n=e.getFullYear()))}if(e=!1,i&&!1!==o&&n&&(+i>daysInMonth(+o,+n)?(i=daysInMonth(+o,+n),e=!1):e=new Date(+n,+o,+i)),!e||isNaN(e)){var h=new Date(n||(new Date).getFullYear(),!1!==o?o:(new Date).getMonth(),1);return this.date=this.cursorDate?new Date(+this.cursorDate.substr(0,4),+this.cursorDate.substr(4,2)-1,+this.cursorDate.substr(6,2)):new Date(h.getFullYear(),h.getMonth(),Math.min(+i||(new Date).getDate(),daysInMonth(h.getMonth(),h.getFullYear()))),this.date.setHours(5),this.outOfRange(),void this.updateTable()}e.setHours(5),this.date=new Date(e),this.outOfRange(),e.getTime()==this.date.getTime()&&this.canDateBeSelected(this.date)&&(this.dateSet=new Date(this.date)),this.fullCreate&&this.updateTable(),this.returnFormattedDate(!0)},datePicker.prototype.setSelectIndex=function(e,t){for(var a=e.options.length-1;a>=0;a--)if(e.options[a].value==t)return void(e.selectedIndex=a)},datePicker.prototype.returnFormattedDate=function(e){if(this.dateSet){pad(this.dateSet.getDate()),pad(this.dateSet.getMonth()+1),this.dateSet.getFullYear();var t,a,s,i,n=!1;for(t in e=!!e,this.formElements){if(!(a=document.getElementById(t)))return;n||(n=a),s=this.formElements[t],i=printFormattedDate(this.dateSet,s,returnLocaleDate),"input"==a.tagName.toLowerCase()?a.value=i:this.setSelectIndex(a,i)}this.staticPos&&(this.noFocus=!0,this.updateTable(),this.noFocus=!1),this.fullCreate&&n.type&&"hidden"!=n.type&&!e&&n.focus()}},datePicker.prototype.disableDatePicker=function(){if(!this.disabled){if(this.staticPos)this.removeOnFocusEvents(),this.removeOldFocus(),this.noFocus=!0,this.div.className=this.div.className.replace(/dp-disabled/,"")+" dp-disabled",this.table.onmouseover=this.table.onclick=this.table.onmouseout=this.table.onmousedown=null,removeEvent(document,"mousedown",this.onmousedown),removeEvent(document,"mouseup",this.clearTimer);else{this.visible&&this.hide();var e=document.getElementById("fd-but-"+this.id);e&&(e.className=e.className.replace(/dp-disabled/,"")+" dp-disabled",setARIAProperty(e,"disabled",!0),e.onkeydown=e.onclick=function(){return!1},e.setAttribute("tabIndex","-1"),e.tabIndex=-1)}clearTimeout(this.timer),this.disabled=!0}},datePicker.prototype.enableDatePicker=function(){if(this.disabled){if(this.staticPos)this.removeOldFocus(),this.noFocus=!0,this.updateTable(),this.div.className=this.div.className.replace(/dp-disabled/,""),this.disabled=!1,this.table.onmouseover=this.onmouseover,this.table.onmouseout=this.onmouseout,this.table.onclick=this.onclick,this.table.onmousedown=this.onmousedown;
2else{var e=document.getElementById("fd-but-"+this.id);e&&(e.className=e.className.replace(/dp-disabled/,""),setARIAProperty(e,"disabled",!1),this.addButtonEvents(e))}this.disabled=!1}},datePicker.prototype.disableTodayButton=function(){var e=new Date;this.butToday.className=this.butToday.className.replace("fd-disabled",""),(this.outOfRange(e)||this.date.getDate()==e.getDate()&&this.date.getMonth()==e.getMonth()&&this.date.getFullYear()==e.getFullYear())&&(this.butToday.className+=" fd-disabled")},datePicker.prototype.updateTableHeaders=function(){for(var e,t,a=this.showWeeks?8:7,s=this.showWeeks?1:0,i=s;i<a;i++){if(e=(this.firstDayOfWeek+(i-s))%7,this.ths[i].title=getDayTranslation(e,!1),i>s){for(t=this.ths[i].getElementsByTagName("span")[0];t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(getDayTranslation(e,!0))),t.title=this.ths[i].title,t.className=t.className.replace(/day-([0-6])/,"")+" day-"+e,t=null}else{for(;this.ths[i].firstChild;)this.ths[i].removeChild(this.ths[i].firstChild);this.ths[i].appendChild(document.createTextNode(getDayTranslation(e,!0)))}this.ths[i].className=this.ths[i].className.replace(/date-picker-highlight/g,""),this.highlightDays[e]&&(this.ths[i].className+=" date-picker-highlight")}this.created&&this.updateTable()},datePicker.prototype.callback=function(e,t){if(!e||!(e in this.callbacks))return!1;for(var a=!1,s=0;s<this.callbacks[e].length;s++)a=this.callbacks[e][s](t||this.id);return a},datePicker.prototype.showHideButtons=function(e){if(this.butPrevYear){var t=e.getMonth(),a=e.getFullYear();this.outOfRange(new Date(a-1,t,daysInMonth(+t,a-1)))?(-1==this.butPrevYear.className.search(/fd-disabled/)&&(this.butPrevYear.className+=" fd-disabled"),-1==this.yearInc&&this.stopTimer()):this.butPrevYear.className=this.butPrevYear.className.replace(/fd-disabled/g,""),this.outOfRange(new Date(a,+t-1,daysInMonth(+t-1,a)))?(-1==this.butPrevMonth.className.search(/fd-disabled/)&&(this.butPrevMonth.className+=" fd-disabled"),-1==this.monthInc&&this.stopTimer()):this.butPrevMonth.className=this.butPrevMonth.className.replace(/fd-disabled/g,""),this.outOfRange(new Date(a+1,+t,1))?(-1==this.butNextYear.className.search(/fd-disabled/)&&(this.butNextYear.className+=" fd-disabled"),1==this.yearInc&&this.stopTimer()):this.butNextYear.className=this.butNextYear.className.replace(/fd-disabled/g,""),this.outOfRange(new Date(a,+t+1,1))?(-1==this.butNextMonth.className.search(/fd-disabled/)&&(this.butNextMonth.className+=" fd-disabled"),1==this.monthInc&&this.stopTimer()):this.butNextMonth.className=this.butNextMonth.className.replace(/fd-disabled/g,"")}};var localeDefaults={fullMonths:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbrs:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fullDays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],dayAbbrs:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],titles:["Previous month","Next month","Previous year","Next year","Today","Show Calendar","wk","Week [[%0%]] of [[%1%]]","Week","Select a date","Click & Drag to move","Display \u201c[[%0%]]\u201d first","Go to Today\u2019s date","Disabled date :"],firstDayOfWeek:0,imported:!1},joinNodeLists=function(){if(!arguments.length)return[];for(var e=[],t=0;t<arguments.length;t++)for(var a,s=0;a=arguments[t][s];s++)e[e.length]=a;return e},cleanUp=function(e){var t,a;for(t in datePickers)for(a in datePickers[t].formElements)if(e||!document.getElementById(a)){datePickers[t].destroy(),datePickers[t]=null,delete datePickers[t];break}},hideAll=function(e){var t;for(t in datePickers)!datePickers[t].created||e&&e==datePickers[t].id||datePickers[t].hide()},hideDatePicker=function(e){if(e in datePickers){if(!datePickers[e].created||datePickers[e].staticPos)return;datePickers[e].hide()}},showDatePicker=function(e,t){return e in datePickers&&(datePickers[e].clickActivated=!t,datePickers[e].show(t),!0)},destroy=function(e){if(!(e=e||window.event).persisted){for(dp in datePickers)datePickers[dp].destroy(),datePickers[dp]=null,delete datePickers[dp];datePickers=null,removeEvent(window,"unload",datePickerController.destroy)}},destroySingleDatePicker=function(e){e&&e in datePickers&&(datePickers[e].destroy(),datePickers[e]=null,delete datePickers[e])},getTitleTranslation=function(e,t){if(t=t||[],localeImport.titles.length>e){var a=localeImport.titles[e];if(t&&t.length)for(var s=0;s<t.length;s++)a=a.replace("[[%"+s+"%]]",t[s]);return a.replace(/[[%(\d)%]]/g,"")}return""},getDayTranslation=function(e,t){var a=localeImport[t?"dayAbbrs":"fullDays"];return a.length&&a.length>e?a[e]:""},getMonthTranslation=function(e,t){var a=localeImport[t?"monthAbbrs":"fullMonths"];return a.length&&a.length>e?a[e]:""},daysInMonth=function(e,t){return e=(e+12)%12,0!=t%4||0==t%100&&0!=t%400||1!=e?[31,28,31,30,31,30,31,31,30,31,30,31][e]:29},getWeeksInYear=function(Y){if(Y in weeksInYearCache)return weeksInYearCache[Y];var X1,X2,NW;with(X1=new Date(Y,0,4))setDate(getDate()-(6+getDay())%7);with(X2=new Date(Y,11,28))setDate(getDate()+(7-getDay())%7);return weeksInYearCache[Y]=Math.round((X2-X1)/6048e5),weeksInYearCache[Y]},getWeekNumber=function(e,t,a){var s=(a=new Date(e,t,a,0,0,0)).getDay();a.setDate(a.getDate()-(s+6)%7+3);var i=a.valueOf();return a.setMonth(0),a.setDate(4),Math.round((i-a.valueOf())/6048e5)+1},printFormattedDate=function(e,t,a){if(!e||isNaN(e))return"";for(var s,i=t.split("-"),n=[],r=e.getDate(),o=e.getDay(),d=e.getMonth(),l=e.getFullYear(),h={sp:" ",dt:".",sl:"/",ds:"-",cc:",",d:pad(r),D:a?localeImport.dayAbbrs[0==o?6:o-1]:localeDefaults.dayAbbrs[0==o?6:o-1],l:a?localeImport.fullDays[0==o?6:o-1]:localeDefaults.fullDays[0==o?6:o-1],j:r,N:0==o?7:o,w:o,W:getWeekNumber(l,d,r),M:a?localeImport.monthAbbrs[d]:localeDefaults.monthAbbrs[d],F:a?localeImport.fullMonths[d]:localeDefaults.fullMonths[d],m:pad(d+1),n:d+1,t:daysInMonth(d,l),y:String(l).substr(2,2),Y:l,S:["th","st","nd","rd"][r%10>3?0:(r%100-r%10!=10)*r%10]},c=0;s=i[c];c++)n.push(s in h?h[s]:"");return n.join("")},parseDateString=function(e,t){var a=!1,s=!1,i=!1,n=new Date,r=t.replace(/-sp(-sp)+/g,"-sp").split("-");e=""+e;e:for(var o,d=0;o=r[d];d++){if(0==e.length)return!1;switch(o){case"sp":case"dt":case"sl":case"ds":case"cc":e=e.replace(/^(\s|\.|\/|,|-){1,}/,"");break;case"d":case"j":if(-1!=e.search(/^(3[01]|[12][0-9]|0?[1-9])/)){a=+e.match(/^(3[01]|[12][0-9]|0?[1-9])/)[0],e=e.substr(e.match(/^(3[01]|[12][0-9]|0?[1-9])/)[0].length);break}return"";case"D":case"l":l=localeDefaults.fullDays.concat(localeDefaults.dayAbbrs
2),localeImport.imported&&(l=l.concat(localeImport.fullDays).concat(localeImport.dayAbbrs));for(var h=0;h<l.length;h++)if(new RegExp("^"+l[h],"i").test(e)){e=e.substr(l[h].length);continue e}break;case"N":case"w":-1!=e.search("N"==o?/^([1-7])/:/^([0-6])/)&&(e=e.substr(1));break;case"S":-1!=e.search(/^(st|nd|rd|th)/i)&&(e=e.substr(2));break;case"W":-1!=e.search(/^([1-9]|[1234[0-9]|5[0-3])/)&&(e=e.substr(e.match(/^([1-9]|[1234[0-9]|5[0-3])/)[0].length));break;case"M":case"F":l=localeDefaults.fullMonths.concat(localeDefaults.monthAbbrs),localeImport.imported&&(l=l.concat(localeImport.fullMonths).concat(localeImport.monthAbbrs));for(h=0;h<l.length;h++)if(-1!=e.search(new RegExp("^"+l[h],"i"))){e=e.substr(l[h].length),s=(h+12)%12;continue e}return"";case"m":case"n":if(l=/^(1[012]|0?[1-9])/,-1!=e.search(l)){s=+e.match(l)[0]-1,e=e.substr(e.match(l)[0].length);break}return"";case"t":if(-1!=e.search(/2[89]|3[01]/)){e=e.substr(2);break}break;case"Y":if(-1!=e.search(/^(\d{4})/)){i=e.substr(0,4),e=e.substr(4);break}return"";case"y":if(-1!=e.search(/^(\d{4})/)){i=e.substr(0,4),e=e.substr(4);break}if(-1!=e.search(/^(0[0-9]|[1-9][0-9])/)){i=+(i=e.substr(0,2))<50?"20"+String(i):"19"+String(i),e=e.substr(2);break}return"";default:return""}}if(""!=e||!1===a&&!1===s&&!1===i)return!1;if(s=!1===s?11:s,i=!1===i?n.getFullYear():i,(a=!1===a?daysInMonth(+s,+i):a)>daysInMonth(+s,+i))return!1;var c=new Date(i,s,a);return!(!c||isNaN(c))&&c},findLabelForElement=function(e){var t;if(e.parentNode&&"label"==e.parentNode.tagName.toLowerCase())lebel=e.parentNode;else for(var a=document.getElementsByTagName("label"),s=0;s<a.length;s++)if(a[s].htmlFor&&a[s].htmlFor==e.id||a[s].getAttribute("for")==e.id){t=a[s];break}return t&&!t.id&&(t.id=e.id+"_label"),t},updateLanguage=function(){"object"==typeof window.fdLocale?localeImport={titles:fdLocale.titles,fullMonths:fdLocale.fullMonths,monthAbbrs:fdLocale.monthAbbrs,fullDays:fdLocale.fullDays,dayAbbrs:fdLocale.dayAbbrs,firstDayOfWeek:"firstDayOfWeek"in fdLocale?fdLocale.firstDayOfWeek:0,imported:!0}:localeImport||(localeImport=localeDefaults)},loadLanguage=function(){for(dp in updateLanguage(),datePickers)datePickers[dp].created&&datePickers[dp].updateTable()},checkElem=function(e){return!(!e||!e.tagName||("input"!=e.tagName.toLowerCase()||"text"!=e.type&&"hidden"!=e.type)&&"select"!=e.tagName.toLowerCase())},addDatePicker=function(e){if(updateLanguage(),e.formElements){e.id=e.id&&e.id in e.formElements?e.id:"",e.formatMasks={};var t,a,s,i,n,r,o,d=[dParts,mParts,yParts],l=[0,0,0];for(var h in e.formElements){if(elem=document.getElementById(h),!checkElem(elem)){if(debug)throw"The element with and id of '"+h+"' is of the wrong type or does not exist within the DOM";return!1}if(e.id||(e.id=h),!(E=e.formElements[h]).match(validFmtRegExp)){if(debug)throw"The element with and id of '"+h+"' has the following incorrect date format assigned to it: "+E;return!1}if(i=[E],e.dateFormats&&h in e.dateFormats&&e.dateFormats[h].length){n=[];for(var c,u=0;c=e.dateFormats[h][u];u++){if(!c.match(validFmtRegExp)){if(debug)throw"The element with and id of '"+h+"' has the following incorrect date format assigned to it within the dateFormats parameter: "+c;return!1}n.push(c)}i=i.concat(n)}t=[0,0,0];for(var p,m=0;p=d[m];m++)if(-1!=E.search(new RegExp("("+p+")"))&&(l[m]=t[m]=1,"input"==elem.tagName.toLowerCase())){a=E.match(new RegExp("("+p+")"))[0],s=String(a+"|"+p.replace(new RegExp("("+a+")"),"")).replace("||","|").split("|"),n=[];for(var f,g=0;f=i[g];g++)for(var v,b=0;v=s[b];b++)v!=a&&n.push(f.replace(new RegExp("("+p+")(-|$)","g"),v+"-").replace(/-$/,""));i=i.concat(n)}if(e.formatMasks[h]=i.concat(),"select"==elem.tagName.toLowerCase()){r=o=0;var y=elem.options;if(t[0]&&t[1]&&t[2]){var D,k=!1;"disabledDates"in e&&delete e.disabledDates,e.enabledDates={};for(m=0;m<y.length;m++)for(u=0;E=i[u];u++)if(dt=parseDateString(y[m].value,E),dt){D=dt.getFullYear()+""+pad(dt.getMonth()+1)+pad(dt.getDate()),k||(k=D),e.enabledDates[D]=1,(!r||Number(D)<r)&&(r=D),(!o||Number(D)>o)&&(o=D);break}!e.cursorDate&&k&&(e.cursorDate=k)}else if(t[1]&&t[2]){var w;for(m=0;m<y.length;m++)for(u=0;E=i[u];u++)if(dt=parseDateString(y[m].value,E),dt){w=dt.getFullYear()+""+pad(dt.getMonth()+1),(!r||Number(w)<r)&&(r=w),(!o||Number(w)>o)&&(o=w);break}r+="01",o+=""+daysInMonth(+o.substr(4,2)-1,+o.substr(0,4))}else if(t[2]){var T;for(m=0;m<y.length;m++){var E;for(u=0;E=i[u];u++)if(dt=parseDateString(y[m].value,E),dt){T=dt.getFullYear(),(!r||Number(T)<r)&&(r=T),(!o||Number(T)>o)&&(o=T);break}}r+="0101",o+="1231"}r&&(!e.rangeLow||+e.rangeLow<+r)&&(e.rangeLow=r),o&&(!e.rangeHigh||+e.rangeHigh>+r)&&(e.rangeHigh=o)}}
2if(!(l[0]&&l[1]&&l[2])){if(debug)throw"Could not find all of the required date parts for element: "+elem.id;return!1}var C={formElements:e.formElements,id:e.id,formatMasks:e.formatMasks,staticPos:!!e.staticPos,positioned:e.positioned&&document.getElementById(e.positioned)?e.positioned:"",rangeLow:e.rangeLow&&-1!=String(e.rangeLow).search(rangeRegExp)?e.rangeLow:"",rangeHigh:e.rangeHigh&&-1!=String(e.rangeHigh).search(rangeRegExp)?e.rangeHigh:"",statusFormat:e.statusFormat&&-1!=String(e.statusFormat).search(validFmtRegExp)?e.statusFormat:"",noFadeEffect:!!e.staticPos||!!e.noFadeEffect,dragDisabled:!(!nodrag&&!e.staticPos)||!!e.dragDisabled,bespokeTabIndex:e.bespokeTabindex&&"number"==typeof e.bespokeTabindex?parseInt(e.bespokeTabindex,10):0,bespokeTitles:e.bespokeTitles||{},finalOpacity:e.finalOpacity&&"number"==typeof e.finalOpacity&&e.finalOpacity>20&&e.finalOpacity<=100?parseInt(+e.finalOpacity,10):e.staticPos?100:finalOpacity,hideInput:!!e.hideInput,noToday:!!e.noTodayButton,showWeeks:!!e.showWeeks,fillGrid:!!e.fillGrid,constrainSelection:!("constrainSelection"in e)||!!e.constrainSelection,cursorDate:e.cursorDate&&-1!=String(e.cursorDate).search(rangeRegExp)?e.cursorDate:"",labelledBy:findLabelForElement(elem),describedBy:e.describedBy&&document.getElementById(e.describedBy)?e.describedBy:describedBy&&document.getElementById(describedBy)?describedBy:"",callbacks:e.callbackFunctions?e.callbackFunctions:{},highlightDays:e.highlightDays&&e.highlightDays.length&&7==e.highlightDays.length?e.highlightDays:[0,0,0,0,0,1,1],disabledDays:e.disabledDays&&e.disabledDays.length&&7==e.disabledDays.length?e.disabledDays:[0,0,0,0,0,0,0]};if(e.disabledDates)for(N in e.enabledDates&&delete e.enabledDates,C.disabledDates={},e.disabledDates)(-1!=String(N).search(wcDateRegExp)&&1==e.disabledDates[N]||-1!=String(N).search(rangeRegExp)&&-1!=String(e.disabledDates[N]).search(rangeRegExp))&&(C.disabledDates[N]=e.disabledDates[N]);else if(e.enabledDates){var N;for(N in C.enabledDates={},e.enabledDates)(-1!=String(N).search(wcDateRegExp)&&1==e.enabledDates[N]||-1!=String(N).search(rangeRegExp)&&-1!=String(e.enabledDates[N]).search(rangeRegExp))&&(C.enabledDates[N]=e.enabledDates[N])}datePickers[e.id]=new datePicker(C),datePickers[e.id].callback("create",datePickers[e.id].createCbArgObj())}else if(debug)throw"No form elements stipulated within initialisation parameters"},isVisible=function(e){return!(!e||!(e in datePickers))&&datePickers[e].visible};return addEvent(window,"unload",destroy),{addEvent:function(e,t,a){return addEvent(e,t,a)},removeEvent:function(e,t,a){return removeEvent(e,t,a)},stopEvent:function(e){return stopEvent(e)},show:function(e){return showDatePicker(e,!1)},hide:function(e){return hideDatePicker(e)},createDatePicker:function(e){addDatePicker(e)},destroyDatePicker:function(e){destroySingleDatePicker(e)},cleanUp:function(){cleanUp(!1)},destroyAll:function(){cleanUp(!0)},printFormattedDate:function(e,t,a){return printFormattedDate(e,t,a)},setDateFromInput:function(e){if(!e||!(e in datePickers))return!1;datePickers[e].setDateFromInput()},setRangeLow:function(e,t){if(!e||!(e in datePickers))return!1;datePickers[e].setRangeLow(t)},setRangeHigh:function(e,t){if(!e||!(e in datePickers))return!1;datePickers[e].setRangeHigh(t)},setBespokeTitles:function(e,t){if(!e||!(e in datePickers))return!1;datePickers[e].setBespokeTitles(t)},addBespokeTitles:function(e,t){if(!e||!(e in datePickers))return!1;datePickers[e].addBespokeTitles(t)},parseDateString:function(e,t){return parseDateString(e,t)},setGlobalVars:function(e){affectJSON(e)},setSelectedDate:function(e,t){if(!e||!(e in datePickers))return!1;datePickers[e].setSelectedDate(t)},dateValidForSelection:function(e,t){return!(!e||!(e in datePickers))&&datePickers[e].canDateBeSelected(t)},addDisabledDates:function(e,t){if(!e||!(e in datePickers))return!1;datePickers[e].addDisabledDates(t)},setDisabledDates:function(e,t){if(!e||!(e in datePickers))return!1;datePickers[e].setDisabledDates(t)},addEnabledDates:function(e,t){if(!e||!(e in datePickers))return!1;datePickers[e].addEnabledDates(t)},setEnabledDates:function(e,t){if(!e||!(e in datePickers))return!1;datePickers[e].setEnabledDates(t)},disable:function(e){if(!e||!(e in datePickers))return!1;datePickers[e].disableDatePicker()},enable:function(e){if(!e||!(e in datePickers))return!1;datePickers[e].enableDatePicker()},setCursorDate:function(e,t){if(!e||!(e in datePickers))return!1;datePickers[e].setCursorDate(t)},getSelectedDate:function(e){return!(!e||!(e in datePickers))&&datePickers[e].returnSelectedDate(
2)},loadLanguage:function(){loadLanguage()},setDebug:function(e){debug=!!e}}}();!function(e,t){function a(){return new Date(Date.UTC.apply(Date,arguments))}function s(){var e=new Date;return a(e.getFullYear(),e.getMonth(),e.getDate())}function i(e){return function(){return this[e].apply(this,arguments)}}function n(t,a){function s(e,t){return t.toLowerCase()}var i=e(t).data(),n={},r=new RegExp("^"+a.toLowerCase()+"([A-Z])");for(var o in a=new RegExp("^"+a.toLowerCase()),i)a.test(o)&&(n[o.replace(r,s)]=i[o]);return n}function r(t){var a={};if(f[t]||(t=t.split("-")[0],f[t])){var s=f[t];return e.each(m,function(e,t){t in s&&(a[t]=s[t])}),a}}var o,d=e(window),l=(o={get:function(e){return this.slice(e)[0]},contains:function(e){for(var t=e&&e.valueOf(),a=0,s=this.length;a<s;a++)if(this[a].valueOf()===t)return a;return-1},remove:function(e){this.splice(e,1)},replace:function(t){t&&(e.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t))},clear:function(){this.splice(0)},copy:function(){var e=new l;return e.replace(this),e}},function(){var t=[];return t.push.apply(t,arguments),e.extend(t,o),t}),h=function(t,a){this.dates=new l,this.viewDate=s(),this.focusDate=null,this._process_options(a),this.element=e(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=!!this.element.is(".date")&&this.element.find(".add-on, .input-group-addon, .btn"),this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.picker=e(g.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(e,t){return parseInt(t)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};h.prototype={constructor:h,_process_options:function(t){this._o=e.extend({},this._o,t);var a=this.o=e.extend({},this._o),s=a.language;switch(f[s]||(s=s.split("-")[0],f[s]||(s=p.language)),a.language=s,a.startView){case 2:case"decade":a.startView=2;break;case 1:case"year":a.startView=1;break;default:a.startView=0}switch(a.minViewMode){case 1:case"months":a.minViewMode=1;break;case 2:case"years":a.minViewMode=2;break;default:a.minViewMode=0}a.startView=Math.max(a.startView,a.minViewMode),!0!==a.multidate&&(a.multidate=Number(a.multidate)||!1,!1!==a.multidate?a.multidate=Math.max(0,a.multidate):a.multidate=1),a.multidateSeparator=String(a.multidateSeparator),a.weekStart%=7,a.weekEnd=(a.weekStart+6)%7;var i=g.parseFormat(a.format);a.startDate!==-1/0&&(a.startDate?a.startDate instanceof Date?a.startDate=this._local_to_utc(this._zero_time(a.startDate)):a.startDate=g.parseDate(a.startDate,i,a.language):a.startDate=-1/0),a.endDate!==1/0&&(a.endDate?a.endDate instanceof Date?a.endDate=this._local_to_utc(this._zero_time(a.endDate)):a.endDate=g.parseDate(a.endDate,i,a.language):a.endDate=1/0),a.daysOfWeekDisabled=a.daysOfWeekDisabled||[],e.isArray(a.daysOfWeekDisabled)||(a.daysOfWeekDisabled=a.daysOfWeekDisabled.split(/[,\s]*/)),a.daysOfWeekDisabled=e.map(a.daysOfWeekDisabled,function(e){return parseInt(e,10)});var n=String(a.orientation).toLowerCase().split(/\s+/g),r=a.orientation.toLowerCase();if(n=e.grep(n,function(e){return/^auto|left|right|top|bottom$/.test(e)}),a.orientation={x:"auto",y:"auto"},r&&"auto"!==r)if(1===n.length)switch(n[0]){case"top":case"bottom":a.orientation.y=n[0];break;case"left":case"right":a.orientation.x=n[0]}else r=e.grep(n,function(e){return/^left|right$/.test(e)}),a.orientation.x=r[0]||"auto",r=e.grep(n,function(e){return/^top|bottom$/.test(e)}),a.orientation.y=r[0]||"auto";else;},_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var a,s,i,n=0;n<e.length;n++)a=e[n][0],2===e[n].length?(s=t,i=e[n][1]):3===e[n].length&&(s=e[n][1],i=e[n][2]),a.on(i,s)},_unapplyEvents:function(e){for(var a,s,i,n=0;n<e.length;n++)a=e[n][0],2===e[n].length?(i=t,s=e[n][1]):3===e[n].length&&(i=e[n][1],s=e[n][2]),a.off(s,i)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){-1===e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){-1===e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,a){var s=a||this.dates.get(-1),i=this._utc_to_local(s);this.element.trigger({type:t,date:i,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){0===arguments.length?(e=this.dates.length-1,t=this.o.format):"string"==typeof e&&(t=e,e=this.dates.length-1),t=t||this.o.format;var a=this.dates.get(e);return g.formatDate(a,t,this.o.language)},this)})},show:function(){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){this.isInline||this.picker.is(":visible")&&(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(e){return e&&new Date(e.getTime()+6e4*e.getTimezoneOffset())},_local_to_utc:function(e){return e&&new Date(e.getTime()-6e4*e.getTimezoneOffset())},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){ 3return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){var t=e.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,t),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){var t=e.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,e.map(t,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:i("setDates"),setUTCDate:i("setUTCDates"),setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e).change():this.component&&this.element.find("input").val(e).change()},getFormattedDate:function(a){a===t&&(a=this.o.format);var s=this.o.language;return e.map(this.dates,function(e){return g.formatDate(e,a,s)}).join(this.o.multidateSeparator)},setStartDate:function(e){this._process_options({startDate:e}),this.update(),this.updateNavArrows()},setEndDate:function(e){this._process_options({endDate:e}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this._process_options({daysOfWeekDisabled:e}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var t=this.picker.outerWidth(),a=this.picker.outerHeight(),s=10,i=d.width(),n=d.height(),r=d.scrollTop(),o=parseInt(this.element.parents().filter(function(){return"auto"!==e(this).css("z-index")}).first().css("z-index"))+10,l=this.component?this.component.parent().offset():this.element.offset(),h=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),u=l.left,p=l.top;this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(u-=t-c)):(this.picker.addClass("datepicker-orient-left"),l.left<0?u-=l.left-s:l.left+t>i&&(u=i-t-s));var m,f,g=this.o.orientation.y;"auto"===g&&(m=-r+l.top-a,f=r+n-(l.top+h+a),g=Math.max(m,f)===f?"top":"bottom"),this.picker.addClass("datepicker-orient-"+g),"top"===g?p+=h:p-=a+parseInt(this.picker.css("padding-top")),this.picker.css({top:p,left:u,zIndex:o})}},_allow_update:!0,update:function(){if(this._allow_update){var t=this.dates.copy(),a=[],s=!1;arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),a.push(t)},this)),s=!0):(a=(a=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val())&&this.o.multidate?a.split(this.o.multidateSeparator):[a],delete this.element.data().date),a=e.map(a,e.proxy(function(e){return g.parseDate(e,this.o.format,this.o.language)},this)),a=e.grep(a,e.proxy(function(e){return e<this.o.startDate||e>this.o.endDate||!e},this),!0),this.dates.replace(a),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),s?this.setValue():a.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill()}},fillDow:function(){var e=this.o.weekStart,t="<tr>";if(this.o.calendarWeeks){var a='<th class="cw"> </th>';t+=a,this.picker.find(".datepicker-days thead tr:first-child").prepend(a)}for(;e<this.o.weekStart+7;)t+='<th class="dow">'+f[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".datepicker-days thead").append(t)},fillMonths:function(){for(var e="",t=0;t<12;)e+='<span class="month">'+f[this.o.language].monthsShort[t++]+"</span>";this.picker.find(".datepicker-months td").html(e)},setRange:function(t){t&&t.length?this.range=e.map(t,function(e){return e.valueOf()}):delete this.range,this.fill()},getClassNames:function(t){var a=[],s=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),n=new Date;return t.getUTCFullYear()<s||t.getUTCFullYear()===s&&t.getUTCMonth()<i?a.push("old"):(t.getUTCFullYear()>s||t.getUTCFullYear()===s&&t.getUTCMonth()>i)&&a.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&a.push("focused"),this.o.todayHighlight&&t.getUTCFullYear()===n.getFullYear()&&t.getUTCMonth()===n.getMonth()&&t.getUTCDate()===n.getDate()&&a.push("today"),-1!==this.dates.contains(t)&&a.push("active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||-1!==e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled))&&a.push("disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&a.push("range"),-1!==e.inArray(t.valueOf(),this.range)&&a.push("selected")),a},fill:function(){var s,i=new Date(this.viewDate),n=i.getUTCFullYear(),r=i.getUTCMonth(),o=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,d=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,h=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,c=f[this.o.language].today||f.en.today||"",u=f[this.o.language].clear||f.en.clear||"";this.picker.find(".datepicker-days thead th.datepicker-switch").text(f[this.o.language].months[r]+" "+n),this.picker.find("tfoot th.today").text(c).toggle(!1!==this.o.todayBtn),this.picker.find("tfoot th.clear").text(u).toggle(!1!==this.o.clearBtn),this.updateNavArrows(),this.fillMonths();var p=a(n,r-1,28),m=g.getDaysInMonth(p.getUTCFullYear(),p.getUTCMonth());p.setUTCDate(m),p.setUTCDate(m-(p.getUTCDay()-this.o.weekStart+7)%7);var v=new Date(p);v.setUTCDate(v.getUTCDate()+42),v=v.valueOf();for(var b,y=[];p.valueOf()<v;){if(p.getUTCDay()===this.o.weekStart&&(y.push("<tr>"),this.o.calendarWeeks)){var D=new Date(+p+(this.o.weekStart-p.getUTCDay()-7)%7*864e5),k=new Date(Number(D)+(11-D.getUTCDay())%7*864e5),w=new Date(Number(w=a(k.getUTCFullYear(),0,1))+(11-w.getUTCDay())%7*864e5),T=(k-w)/864e5/7+1;y.push('<td class="cw">'+T+"</td>")}if((b=this.getClassNames(p)).push("day"),this.o.beforeShowDay!==e.noop){var E=this.o.beforeShowDay(this._utc_to_local(p));E===t?E={}:"boolean"==typeof E?E={enabled:E}:"string"==typeof E&&(E={classes:E}),!1===E.enabled&&b.push("disabled"),E.classes&&(b=b.concat(E.classes.split(/\s+/))),E.tooltip&&(s=E.tooltip)}b=e.unique(b),y.push('<td class="'+b.join(" ")+'"'+(s?' title="'+s+'"':"")+">"+p.getUTCDate()+"</td>"),p.getUTCDay()===this.o.weekEnd&&y.push("</tr>"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(y.join(""));
3var C=this.picker.find(".datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("active");e.each(this.dates,function(e,t){t.getUTCFullYear()===n&&C.eq(t.getUTCMonth()).addClass("active")}),(n<o||n>l)&&C.addClass("disabled"),n===o&&C.slice(0,d).addClass("disabled"),n===l&&C.slice(h+1).addClass("disabled"),y="",n=10*parseInt(n/10,10);var N=this.picker.find(".datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;for(var M,I=e.map(this.dates,function(e){return e.getUTCFullYear()}),S=-1;S<11;S++)M=["year"],-1===S?M.push("old"):10===S&&M.push("new"),-1!==e.inArray(n,I)&&M.push("active"),(n<o||n>l)&&M.push("disabled"),y+='<span class="'+M.join(" ")+'">'+n+"</span>",n+=1;N.html(y)},updateNavArrows:function(){if(this._allow_update){var e=new Date(this.viewDate),t=e.getUTCFullYear(),a=e.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-1/0&&t<=this.o.startDate.getUTCFullYear()&&a<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&t>=this.o.endDate.getUTCFullYear()&&a>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-1/0&&t<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&t>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(t){t.preventDefault();var s,i,n,r=e(t.target).closest("span, td, th");if(1===r.length)switch(r[0].nodeName.toLowerCase()){case"th":switch(r[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var o=g.modes[this.viewMode].navStep*("prev"===r[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,o),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,o),1===this.viewMode&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":var d=new Date;d=a(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0),this.showMode(-2);var l="linked"===this.o.todayBtn?null:"view";this._setDate(d,l);break;case"clear":var h;this.isInput?h=this.element:this.component&&(h=this.element.find("input")),h&&h.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":r.is(".disabled")||(this.viewDate.setUTCDate(1),r.is(".month")?(n=1,i=r.parent().find("span").index(r),s=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(i),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(a(s,i,n))):(n=1,i=0,s=parseInt(r.text(),10)||0,this.viewDate.setUTCFullYear(s),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(a(s,i,n))),this.showMode(-1),this.fill());break;case"td":r.is(".day")&&!r.is(".disabled")&&(n=parseInt(r.text(),10)||1,s=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),r.is(".old")?0===i?(i=11,s-=1):i-=1:r.is(".new")&&(11===i?(i=0,s+=1):i+=1),this._setDate(a(s,i,n)))}this.picker.is(":visible")&&this._focused_from&&e(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(e){var t=this.dates.contains(e);if(e?-1!==t?this.dates.remove(t):this.dates.push(e):this.dates.clear(),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(e,t){var a;t&&"date"!==t||this._toggle_multidate(e&&new Date(e)),t&&"view"!==t||(this.viewDate=e&&new Date(e)),this.fill(),this.setValue(),this._trigger("changeDate"),this.isInput?a=this.element:this.component&&(a=this.element.find("input")),a&&a.change(),!this.o.autoclose||t&&"date"!==t||this.hide()},moveMonth:function(e,a){if(!e)return t;if(!a)return e;var s,i,n=new Date(e.valueOf()),r=n.getUTCDate(),o=n.getUTCMonth(),d=Math.abs(a);if(a=a>0?1:-1,1===d)i=-1===a?function(){return n.getUTCMonth()===o}:function(){return n.getUTCMonth()!==s},s=o+a,n.setUTCMonth(s),(s<0||s>11)&&(s=(s+12)%12);else{for(var l=0;l<d;l++)n=this.moveMonth(n,a);s=n.getUTCMonth(),n.setUTCDate(r),i=function(){return s!==n.getUTCMonth()}}for(;i();)n.setUTCDate(--r),n.setUTCMonth(s);return n},moveYear:function(e,t){return this.moveMonth(e,12*t)},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)"))27===e.ke
3yCode&&this.show();else{var t,a,i,n,r=!1,o=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;t=37===e.keyCode?-1:1,e.ctrlKey?(a=this.moveYear(this.dates.get(-1)||s(),t),i=this.moveYear(o,t),this._trigger("changeYear",this.viewDate)):e.shiftKey?(a=this.moveMonth(this.dates.get(-1)||s(),t),i=this.moveMonth(o,t),this._trigger("changeMonth",this.viewDate)):((a=new Date(this.dates.get(-1)||s())).setUTCDate(a.getUTCDate()+t),(i=new Date(o)).setUTCDate(o.getUTCDate()+t)),this.dateWithinRange(a)&&(this.focusDate=this.viewDate=i,this.setValue(),this.fill(),e.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;t=38===e.keyCode?-1:1,e.ctrlKey?(a=this.moveYear(this.dates.get(-1)||s(),t),i=this.moveYear(o,t),this._trigger("changeYear",this.viewDate)):e.shiftKey?(a=this.moveMonth(this.dates.get(-1)||s(),t),i=this.moveMonth(o,t),this._trigger("changeMonth",this.viewDate)):((a=new Date(this.dates.get(-1)||s())).setUTCDate(a.getUTCDate()+7*t),(i=new Date(o)).setUTCDate(o.getUTCDate()+7*t)),this.dateWithinRange(a)&&(this.focusDate=this.viewDate=i,this.setValue(),this.fill(),e.preventDefault());break;case 32:break;case 13:o=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(o),r=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.o.keyboardNavigation&&this.hide()}if(r)this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".datepicker-"+g.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var c=function(t,a){this.element=e(t),this.inputs=e.map(a.inputs,function(e){return e.jquery?e[0]:e}),delete a.inputs,e(this.inputs).datepicker(a).bind("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e(t).data("datepicker")}),this.updateDates()};c.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,a){a.setRange(t)})},dateUpdated:function(t){if(!this.updating){this.updating=!0;var a=e(t.target).data("datepicker").getUTCDate(),s=e.inArray(t.target,this.inputs),i=this.inputs.length;if(-1!==s){if(e.each(this.pickers,function(e,t){t.getUTCDate()||t.setUTCDate(a)}),a<this.dates[s])for(;s>=0&&a<this.dates[s];)this.pickers[s--].setUTCDate(a);else if(a>this.dates[s])for(;s<i&&a>this.dates[s];)this.pickers[s++].setUTCDate(a);this.updateDates(),delete this.updating}}},remove:function(){e.map(this.pickers,function(e){e.remove()}),delete this.element.data().datepicker}};var u=e.fn.datepicker;e.fn.datepicker=function(a){var s,i=Array.apply(null,arguments);return i.shift(),this.each(function(){var o=e(this),d=o.data("datepicker"),l="object"==typeof a&&a;if(!d){var u=n(this,"date"),m=r(e.extend({},p,u,l).language),f=e.extend({},p,m,u,l);if(o.is(".input-daterange")||f.inputs){var g={inputs:f.inputs||o.find("input").toArray()};o.data("datepicker",d=new c(this,e.extend(f,g)))}else o.data("datepicker",d=new h(this,f))}if("string"==typeof a&&"function"==typeof d[a]&&(s=d[a].apply(d,i))!==t)return!1}),s!==t?s:this};var p=e.fn.datepicker.defaults={autoclose:!1,beforeShowDay:e.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},m=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=h;var f=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
3ay","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},g={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},getDaysInMonth:function(e,t){return[31,g.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),a=e.match(this.validParts);if(!t||!t.length||!a||0===a.length)throw new Error("Invalid date format.");return{separators:t,parts:a}},parseDate:function(s,i,n){function r(){var e=this.slice(0,u[l].length);return e===u[l].slice(0,e.length)}if(!s)return t;if(s instanceof Date)return s;"string"==typeof i&&(i=g.parseFormat(i));var o,d,l,c=/([\-+]\d+)([dmwy])/,u=s.match(/([\-+]\d+)([dmwy])/g);if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(s)){for(s=new Date,l=0;l<u.length;l++)switch(o=c.exec(u[l]),d=parseInt(o[1]),o[2]){case"d":s.setUTCDate(s.getUTCDate()+d);break;case"m":s=h.prototype.moveMonth.call(h.prototype,s,d);break;case"w":s.setUTCDate(s.getUTCDate()+7*d);break;case"y":s=h.prototype.moveYear.call(h.prototype,s,d)}return a(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate(),0,0,0)}u=s&&s.match(this.nonpunctuation)||[],s=new Date;var p,m,v={},b=["yyyy","yy","M","MM","m","mm","d","dd"],y={yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){if(isNaN(e))return e;for(t-=1;t<0;)t+=12;for(t%=12,e.setUTCMonth(t);e.getUTCMonth()!==t;)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}};y.M=y.MM=y.mm=y.m,y.dd=y.d,s=a(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0);var D=i.parts.slice();if(u.length!==D.length&&(D=e(D).filter(function(t,a){return-1!==e.inArray(a,b)}).toArray()),u.length===D.length){var k,w,T;for(l=0,k=D.length;l<k;l++){if(p=parseInt(u[l],10),o=D[l],isNaN(p))switch(o){case"MM":m=e(f[n].months).filter(r),p=e.inArray(m[0],f[n].months)+1;break;case"M":m=e(f[n].monthsShort).filter(r),p=e.inArray(m[0],f[n].monthsShort)+1}v[o]=p}for(l=0;l<b.length;l++)(T=b[l])in v&&!isNaN(v[T])&&(w=new Date(s),y[T](w,v[T]),isNaN(w)||(s=w))}return s},formatDate:function(t,a,s){if(!t)return"";"string"==typeof a&&(a=g.parseFormat(a));var i={d:t.getUTCDate(),D:f[s].daysShort[t.getUTCDay()],DD:f[s].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:f[s].monthsShort[t.getUTCMonth()],MM:f[s].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m,t=[];for(var n=e.extend([],a.separators),r=0,o=a.parts.length;r<=o;r++)n.length&&t.push(n.shift()),t.push(i[a.parts[r]]);return t.join("")},headTemplate:'<thead><tr><th class="prev">«</th><th colspan="5" class="datepicker-switch"></th><th class="next">»</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};g.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+g.headTemplate+"<tbody></tbody>"+g.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+"</table></div></div>",e.fn.datepicker.DPGlobal=g,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=u,this},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var a=e(this);a.data("datepicker")||(t.preventDefault(),a.datepicker("show"))}),e(function(){e('[data-provide="datepicker-inline"]').datepicker()})}(window.jQuery),Unite.Event=function(){function e(){a(),i(),r(),o(),t(),d(),l()}function t(){$("#cancel_new_event").click(function(e){return confirm($(e.target).data("c
3onfirm"))&&Unite.loadUrlToIframe("/calendar"),!1}),$("#save_event").click(function(e){e.preventDefault(),$(this).prop("disabled",!0),$(this).parents("form").submit()}),$("#delete_event").click(function(e){e.preventDefault();var t=this,a=$(e.target).data("recurs")?HandlebarsTemplates["events/recurs_modal"]:HandlebarsTemplates["events/modal"],s=$(a());return s.on("hidden",function(){s.remove()}),s.on("shown",function(){$("#delete").click(function(){var e=$("#destroy_event_strategies").find(":checked").val()||"self",a=$(t).closest("form");s.modal("hide"),a.find("#delete_strategy").val(e),a.submit()})}),s.modal(),!1})}function a(){function e(){var e=_.isEmpty(startDateControl.val())?new Date:new Date(startDateControl.val());return parseDate(e)}function t(){var e=_.isEmpty(endDateControl.val())?new Date:new Date(endDateControl.val());return parseDate(e)}function a(){endDateControl.val(e().clone().add(durationInDays,"days").format("MMM DD YYYY"))}function i(){durationInDays=t().diff(e(),"days")}durationInDays=0,startDateControl=$("#event_start_date"),endDateControl=$("#event_end_date"),startDateId="event_start_date",endDateId="event_end_date",startDateScheduleId="event_schedule_attributes_start_date",endDateScheduleId="event_schedule_attributes_end_date",startDateScheduleControl=$("#event_schedule_attributes_start_date"),endDateScheduleControl=$("#event_schedule_attributes_end_date"),parseDate=function(e){return moment(e)}
3,s(startDateControl,a),s(endDateControl,i),s(startDateScheduleControl),s(endDateScheduleControl),i(),startDateControl.trigger("change"),startDateScheduleControl.trigger("change")}function s(e,t){e.dateField().change(function(){date=$(this).datetimeEntry("getDatetime"),this.id!==startDateId&&this.id!==startDateScheduleId||$("#"+(this.id===startDateId?endDateId:endDateScheduleId)).datetimeEntry("option","minDatetime",date).datepicker("setStartDate",date),"function"==typeof t&&t()}).blur(function(e){e.relatedTarget&&$(this).datepicker("hide")})}function i(){function e(){o=r(s.val()),t(),o&&(d=o.clone().add(1,"h").format("h:mm A"),i.val(d))}function t(){var e=moment(_.isEmpty(startDateControl.val())?new Date:new Date(startDateControl.val())),t=moment(_.isEmpty(endDateControl.val())?new Date:new Date(endDateControl.val())),a=e.isSame(t)?s.val():"";i.datetimeEntry("option","minTime",a)}var a="event_end_time",s=$("#"+"event_start_time"),i=$("#"+a),r=function(e){return moment("2014-01-01 "+e,"2014-01-01 h:mm A")},o=r(s.val()),d=r(i.val());n(s,e),n(i,function(){}),endDateControl.on("change",function(){t()}),t()}function n(e,t){e.timeField().change(t)}function r(){function e(){t.attr("checked")?$("input.event-time-field").attr("style","visibility: hidden"):$("input.event-time-field").attr("style","visibility: visible")}var t=$("#event_all_day");t.change(e),e()}function o(){$("#event_repeats").change(Unite.Event.changeRecurrence),$("#event_schedule_attributes_skip").change(Unite.Event.updateSkipLabel),$("#event_schedule_attributes_kind").change(Unite.Event.changeRecurrence),$("#event_schedule_attributes_ends").change(Unite.Event.changeEnds),Unite.Event.changeRecurrence(),Unite.Event.changeEnds()}function d(){$("#invite_people_toggle").click(Unite.Event.showInvitePeople),Unite.Event.showInvitePeople()}function l(){$(".select-all-people").click(h),$(".select-no-people").click(c),$(".revert-people").click(u)}function h(e){e.preventDefault(),p(!0)}function c(e){e.preventDefault(),p(!1)}function u(e){e.preventDefault(),Unite.Event.previousInviteesHtml&&$("#invite_people_container").html(Unite.Event.previousInviteesHtml)}function p(e){Unite.Event.previousInviteesHtml||(Unite.Event.previousInviteesHtml=$("#invite_people_container").html()),people=document.getElementsByName("invites[]");for(var t=0,a=people.length;t<a;t++)people[t].checked=e}return{init:e,changeRecurrence:function(){if($(".schedule-weekly").hide(),$(".schedule-monthly").hide(),$("#event_repeats").is(":checked")){$("#event_schedule_attributes_kind").show(),$("#event_schedule").show(),$("#event_schedule :input").prop("disabled",!1);var e=$("#event_schedule_attributes_kind option:selected").val();$(".schedule-start-and-end").show(),$('label[for="event_schedule_attributes_skip"]').show(),$(".schedule-"+e).show()}else $("#event_schedule_attributes_kind").hide(),$("#event_schedule").hide(),$("#event_schedule :input").prop("disabled",!0),$(".schedule-start-and-end").hide(),$('label[for="event_schedule_attributes_skip"]').hide();Unite.Event.updateSkipLabel(),Unite.Event.changeEnds()},showInvitePeople:function(){checked=$("#invite_people_toggle").prop("checked"),$("#invite_people_control").toggle(checked)},changeEnds:function(){$("#event_schedule_attributes_ends").is(":checked")?$("#event_schedule_attributes_end_date").prop("disabled",!1):$("#event_schedule_attributes_end_date").prop("disabled",!0)},updateSkipLabel:function(){var e="";switch($("#event_schedule_attributes_kind option:selected").val()){case"weekly":e="week on:";break;case"monthly":e="month on:";break;case"annually":e="year"}$("#skip_label").text(e)}}}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.