diff --git a/js/datepicker.js b/js/datepicker.js index 0fd744a..939605d 100644 --- a/js/datepicker.js +++ b/js/datepicker.js @@ -1464,6 +1464,13 @@ var datePickerController = (function datePickerController() { o.updateTable(); + var pagingMetadata = { + unit: (o.yearInc) ? 'year' : 'month', + mm: parseInt(o.date.getMonth()) + 1, + yyyy: o.date.getFullYear() + }; + o.callback('paging', pagingMetadata); + return stopEvent(e); } else if(el.className.search("drag-enabled") != -1) { diff --git a/js/datepicker.min.js b/js/datepicker.min.js index f8253e7..aa8ac46 100644 --- a/js/datepicker.min.js +++ b/js/datepicker.min.js @@ -1,2 +1,3 @@ -/*! DatePicker v6.3.5 MIT/GPL2 @freqdec */ -;var datePickerController=(function datePickerController(){var debug=false,isOpera=Object.prototype.toString.call(window.opera)==="[object Opera]",describedBy="",languageInfo=parseUILanguage(),nbsp=String.fromCharCode(160),datePickers={},weeksInYearCache={},bespokeTitles={},uniqueId=0,finalOpacity=100,cssAnimations=null,transitionEnd="",buttonTabIndex=true,mouseWheel=true,deriveLocale=true,localeImport=false,nodrag=false,langFileFolder=false,returnLocaleDate=false,kbEvent=false,dateParseFallback=true,cellFormat="%d %F %Y",titleFormat="%F %d, %Y",statusFormat="",formatParts=isOpera?["%j"]:["%j"," %F %Y"],dPartsRegExp=/%([d|j])/,mPartsRegExp=/%([M|F|m|n])/,yPartsRegExp=/%[y|Y]/,noSelectionRegExp=/date-picker-unused|out-of-range|day-disabled|not-selectable/,formatTestRegExp=/%([d|j|M|F|m|n|Y|y])/,formatSplitRegExp=/%([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]))$/,wsCharClass="\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029",oldIE=(function(){var undef,v=3,div=document.createElement("div"),all=div.getElementsByTagName("i");while(div.innerHTML="",all[0]){}return v>4?v:undef}());(function(){var scriptFiles=document.getElementsByTagName("script"),json=parseJSON(String(scriptFiles[scriptFiles.length-1].innerHTML).replace(/[\n\r\s\t]+/g," ").replace(/^\s+/,"").replace(/\s+$/,""));if(typeof json==="object"&&!("err" in json)){affectJSON(json)}if(deriveLocale&&typeof(fdLocale)!="object"){var head=document.getElementsByTagName("head")[0]||document.documentElement,loc=langFileFolder?langFileFolder:scriptFiles[scriptFiles.length-1].src.substr(0,scriptFiles[scriptFiles.length-1].src.lastIndexOf("/"))+"/lang/",script,i;for(i=0;ilastLastIndex){output.push(str.slice(lastLastIndex,match.index));if(!cbSplit._compliantExecNpcg&&match.length>1){match[0].replace(separator2,function(){for(var i=1;i1&&match.index=limit){break}}if(separator.lastIndex===match.index){separator.lastIndex++}}if(lastLastIndex===str.length){if(lastLength||!separator.test("")){output.push("")}}else{output.push(str.slice(lastLastIndex))}return output.length>limit?output.slice(0,limit):output};cbSplit._compliantExecNpcg=/()??/.exec("")[1]===undefined;cbSplit._nativeSplit=String.prototype.split;function affectJSON(json){if(!(typeof json==="object")){return}var key,switchObj={debug:function(value){debug=!!value;return true},lang:function(value){if(typeof value==="string"&&value.search(/^[a-z]{2,3}(-([a-z]{2}))?$/i)!=-1){languageInfo=[value.toLowerCase()];returnLocaleDate=true;deriveLocale=true}return true},nodrag:function(value){nodrag=!!value;return true},buttontabindex:function(value){buttonTabIndex=!!value;return true},derivelocale:function(value){deriveLocale=!!value;return true},mousewheel:function(value){mouseWheel=!!value;return true},cellformat:function(value){if(typeof value==="string"){parseCellFormat(value)}return true},titleformat:function(value){if(typeof value==="string"){titleFormat=value}return true},statusformat:function(value){if(typeof value==="string"){statusFormat=value}return true},describedby:function(value){if(typeof value==="string"){describedBy=value}return true},finalopacity:function(value){if(typeof value==="number"&&(+value>20&&+value<=100)){finalOpacity=parseInt(value,10)}return true},bespoketitles:function(value){if(typeof value==="object"){bespokeTitles={};for(var dt in value){if(value.hasOwnProperty(dt)&&String(dt).match(wcDateRegExp)!=-1){bespokeTitles[dt]=String(value[dt])}}}return true},dateparsefallback:function(value){dateParseFallback=!!value;return true},languagefilelocation:function(value){langFileFolder=value;return true},_default:function(){if(debug){throw"Unknown key located within JSON data: "+key}return true}};for(key in json){if(!json.hasOwnProperty(key)){continue}(switchObj.hasOwnProperty(String(key).toLowerCase())&&switchObj[String(key).toLowerCase()]||switchObj._default)(json[key])}}function parseJSON(str){if(!(typeof str==="string")||str==""){return{}}try{if(typeof JSON==="object"&&JSON.parse){return window.JSON.parse(str)}else{if(/debug|lang|nodrag|buttontabindex|derivelocale|mousewheel|cellformat|titleformat|statusformat|describedby|finalopacity|bespoketitles|dateparsefallback/.test(str.toLowerCase())){var f=Function(["var document,top,self,window,parent,Number,Date,Object,Function,","Array,String,Math,RegExp,Image,ActiveXObject;","return (",str.replace(/<\!--.+-->/gim,"").replace(/\bfunction\b/g,"function-"),");"].join(""));return f()}}}catch(e){}if(debug){throw"Could not parse the JSON object"}return{err:1}}function parseCellFormat(value){if(isOpera){formatParts=["%j"];cellFormat="%j %F %Y";return}if(value.match(/%([d|j])/)==-1){return}formatParts=cbSplit(value,/%([d|j])/);cellFormat=value}function pad(value,length){length=Math.min(4,length||2);return"0000".substr(0,length-Math.min(String(value).length,length))+value}function addEvent(obj,type,fn){if(obj.addEventListener){obj.addEventListener(type,fn,true)}else{if(obj.attachEvent){obj.attachEvent("on"+type,fn)}}}function removeEvent(obj,type,fn){try{if(obj.removeEventListener){obj.removeEventListener(type,fn,true)}else{if(obj.detachEvent){obj.detachEvent("on"+type,fn)}}}catch(err){}}function stopEvent(e){e=e||document.parentWindow.event;if(e.stopPropagation){e.stopPropagation();e.preventDefault()}if(oldIE){e.cancelBubble=true;e.returnValue=false}return false}function setARIARole(element,role){if(element&&element.tagName){element.setAttribute("role",role)}}function setARIAProperty(element,property,value){if(element&&element.tagName){element.setAttribute("aria-"+property,value)}}function setTabIndex(e,i){e.setAttribute(oldIE?"tabIndex":"tabindex",i);e.tabIndex=i}function dateToYYYYMMDD(dt){return dt instanceof Date&&!isNaN(dt)?dt.getFullYear()+pad(dt.getMonth()+1)+""+pad(dt.getDate()):dt}function datePicker(options){this.dateSet=null;this.timerSet=false;this.visible=false;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=false;this.disabled=false;this.opacity=0;this.opacityTo=100;this.finalOpacity=100;this.inUpdate=false;this.kbEventsAdded=false;this.fullCreate=false;this.selectedTD=null;this.cursorTD=null;this.cursorDate=options.cursorDate?options.cursorDate:"",this.date=options.cursorDate?new Date(+options.cursorDate.substr(0,4),+options.cursorDate.substr(4,2)-1,+options.cursorDate.substr(6,2),5,0,0):new Date();this.defaults={};this.dynDisabledDates={};this.dateList=[];this.bespokeClass=options.bespokeClass;this.firstDayOfWeek=localeImport.firstDayOfWeek;this.interval=new Date();this.clickActivated=false;this.showCursor=false;this.noFocus=true;this.kbEvent=false;this.delayedUpdate=false;this.bespokeTitles={};this.bespokeTabIndex=options.bespokeTabIndex;for(var thing in options){if(!options.hasOwnProperty(thing)||String(thing).search(/^(callbacks|formElements|enabledDates|disabledDates)$/)!=-1){continue}this[thing]=options[thing]}if(oldIE){this.iePopUp=null}for(var i=0,prop;prop=["callbacks","formElements"][i];i++){this[prop]={};if(prop in options){for(thing in options[prop]){if(options[prop].hasOwnProperty(thing)){this[prop][thing]=options[prop][thing]}}}}this.date.setHours(5);this.changeHandler=function(){if(o.disabled){return}o.setDateFromInput();o.callback("dateset",o.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(){if(typeof(window.pageYOffset)=="number"){return[window.pageXOffset,window.pageYOffset]}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){return[document.body.scrollLeft,document.body.scrollTop]}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){return[document.documentElement.scrollLeft,document.documentElement.scrollTop]}}}return[0,0]};this.getDateExceptions=function(y,m){m=pad(m);var obj={},lower=o.firstDateShown,upper=o.lastDateShown,rLength=o.dateList.length,rNumber,workingDt,workingY,workingM,dtLower,dtUpper,i,dt,dt1,dt2,rngLower,rngUpper,cDate;if(!upper||!lower){lower=o.firstDateShown=y+pad(m)+"01";upper=o.lastDateShown=y+pad(m)+pad(daysInMonth(m,y))}dtLower=Number(lower.substr(0,6));dtUpper=Number(upper.substr(0,6));workingDt=String(dtLower);while(+workingDt<=dtUpper){workingY=workingDt.substr(0,4);workingM=workingDt.substr(4,2);for(rNumber=0;rNumber=+o.firstDateShown&&+dt1<=+o.lastDateShown){obj[dt1]=o.dateList[rNumber].type}continue}if(dt1<=dt2&&workingDt>=dt1.substr(0,6)&&workingDt<=dt2.substr(0,6)){rngLower=Math.max(dt1,Math.max(String(workingDt)+"01",this.firstDateShown));rngUpper=Math.min(dt2,Math.min(String(workingDt)+"31",this.lastDateShown));for(i=rngLower;i<=rngUpper;i++){obj[i]=o.dateList[rNumber].type}}}workingDt=new Date(workingY,+workingM,2);workingDt=workingDt.getFullYear()+""+pad(workingDt.getMonth()+1)}return obj};this.reposition=function(){if(!o.created||o.staticPos){return}o.div.style.visibility="hidden";o.div.style.left=o.div.style.top="0px";o.div.style.display="block";var osh=o.div.offsetHeight,osw=o.div.offsetWidth,elem=document.getElementById("fd-but-"+o.id),pos=o.truePosition(elem),trueBody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body,sOffsets=o.getScrollOffsets(),scrollTop=sOffsets[1],scrollLeft=sOffsets[0],tSpace=parseInt(pos[1]-2)-parseInt(scrollTop),bSpace=parseInt(trueBody.clientHeight+scrollTop)-parseInt(pos[1]+elem.offsetHeight+2);o.div.style.visibility="visible";o.div.style.left=Number(parseInt(trueBody.clientWidth+scrollLeft)tSpace)?Math.abs(parseInt(pos[1]+elem.offsetHeight+2))+"px":Math.abs(parseInt(pos[1]-(osh+2)))+"px";if(oldIE===6){o.iePopUp.style.top=o.div.style.top;o.iePopUp.style.left=o.div.style.left;o.iePopUp.style.width=osw+"px";o.iePopUp.style.height=(osh-2)+"px"}};this.removeCursorHighlight=function(){var td=document.getElementById(o.id+"-date-picker-hover");if(td){removeClass(td,"date-picker-hover")}};this.addCursorHighlight=function(){var td=document.getElementById(o.id+"-date-picker-hover");if(td){addClass(td,"date-picker-hover")}};this.removeOldFocus=function(){var td=document.getElementById(o.id+"-date-picker-hover");if(td){try{setTabIndex(td,-1);removeClass(td,"date-picker-hover");td.id="";td.onblur=null;td.onfocus=null}catch(err){}}};this.setNewFocus=function(){var td=document.getElementById(o.id+"-date-picker-hover");if(td){try{setTabIndex(td,0);if(this.showCursor){addClass(td,"date-picker-hover")}if(!this.clickActivated){td.onblur=o.onblur;td.onfocus=o.onfocus}if(!isOpera&&!this.clickActivated){o.addAccessibleDate()}if(!this.noFocus&&!this.clickActivated){setTimeout(function(){try{td.focus()}catch(err){}},0)}}catch(err){}}};this.addAccessibleDate=function(){var td=document.getElementById(o.id+"-date-picker-hover");if(td&&!(td.getElementsByTagName("span").length)){var ymd=td.className.match(/cd-([\d]{4})([\d]{2})([\d]{2})/),noS=td.className.search(noSelectionRegExp)!=-1,spn=document.createElement("span"),spnC;spn.className="fd-screen-reader";removeChildNodes(td);if(noS){spnC=spn.cloneNode(false);spnC.appendChild(document.createTextNode(getTitleTranslation(13)));td.appendChild(spnC)}for(var pt=0,part;part=formatParts[pt];pt++){if(part=="%j"||part=="%d"){td.appendChild(document.createTextNode(printFormattedDate(new Date(ymd[1],+ymd[2]-1,ymd[3],5,0,0),part,true)))}else{spnC=spn.cloneNode(false);spnC.appendChild(document.createTextNode(printFormattedDate(new Date(ymd[1],+ymd[2]-1,ymd[3],5,0,0),part,true)));td.appendChild(spnC)}}}};this.setCursorDate=function(yyyymmdd){if(String(yyyymmdd).search(/^([0-9]{8})$/)!=-1){this.date=new Date(+yyyymmdd.substr(0,4),+yyyymmdd.substr(4,2)-1,+yyyymmdd.substr(6,2),5,0,0);this.cursorDate=yyyymmdd;if(this.staticPos){this.updateTable()}}};this.updateTable=function(noCallback){if(!o||o.inUpdate||!o.created){return}o.inUpdate=true;o.removeOldFocus();o.div.dir=localeImport.rtl?"rtl":"ltr";if(o.timerSet&&!o.delayedUpdate){if(o.monthInc){var n=o.date.getDate(),d=new Date(o.date);d.setDate(2);d.setMonth(d.getMonth()+o.monthInc*1);d.setDate(Math.min(n,daysInMonth(d.getMonth(),d.getFullYear())));o.date=new Date(d)}else{o.date.setDate(Math.min(o.date.getDate()+o.dayInc,daysInMonth(o.date.getMonth()+o.monthInc,o.date.getFullYear()+o.yearInc)));o.date.setMonth(o.date.getMonth()+o.monthInc);o.date.setFullYear(o.date.getFullYear()+o.yearInc)}}o.outOfRange();if(!o.noToday){o.disableTodayButton()}o.showHideButtons(o.date);var cd=o.date.getDate(),cm=o.date.getMonth(),cy=o.date.getFullYear(),cursorDate=(String(cy)+pad(cm+1)+pad(cd)),tmpDate=new Date(cy,cm,1,5,0,0);tmpDate.setHours(5);var dt,dts,cName,row,td,i,currentDate,cellAdded,col,currentStub,abbr,bespokeRenderClass,spnC,dateSetD,selectable,weekDay,weekDayC=(tmpDate.getDay()+6)%7,firstColIndex=(((weekDayC-o.firstDayOfWeek)+7)%7)-1,dpm=daysInMonth(cm,cy),today=new Date(),today=today.getFullYear()+pad(today.getMonth()+1)+pad(today.getDate()),stub=String(tmpDate.getFullYear())+pad(tmpDate.getMonth()+1),cellAdded=[4,4,4,4,4,4],lm=new Date(cy,cm-1,1,5,0,0),nm=new Date(cy,cm+1,1,5,0,0),daySub=daysInMonth(lm.getMonth(),lm.getFullYear()),stubN=String(nm.getFullYear())+pad(nm.getMonth()+1),stubP=String(lm.getFullYear())+pad(lm.getMonth()+1),weekDayN=(nm.getDay()+6)%7,weekDayP=(lm.getDay()+6)%7,spn=document.createElement("span");spn.className="fd-screen-reader";o.firstDateShown=!o.constrainSelection&&o.fillGrid&&(0-firstColIndex<1)?String(stubP)+(daySub+(0-firstColIndex)):stub+"01";o.lastDateShown=!o.constrainSelection&&o.fillGrid?stubN+pad(41-firstColIndex-dpm):stub+String(dpm);o.currentYYYYMM=stub;bespokeRenderClass=o.callback("redraw",{id:o.id,dd:pad(cd),mm:pad(cm+1),yyyy:cy,firstDateDisplayed:o.firstDateShown,lastDateDisplayed:o.lastDateShown})||{};dts=o.getDateExceptions(cy,cm+1);o.checkSelectedDate();dateSetD=(o.dateSet!=null)?o.dateSet.getFullYear()+pad(o.dateSet.getMonth()+1)+pad(o.dateSet.getDate()):false;if(this.selectedTD!=null){setARIAProperty(this.selectedTD,"selected",false);this.selectedTD=null}for(var curr=0;curr<42;curr++){row=Math.floor(curr/7);td=o.tds[curr];spnC=spn.cloneNode(false);removeChildNodes(td);if((curr>firstColIndex&&curr<=(firstColIndex+dpm))||o.fillGrid){currentStub=stub;weekDay=weekDayC;dt=curr-firstColIndex;cName=[];selectable=true;if(dt<1){dt=daySub+dt;currentStub=stubP;weekDay=weekDayP;selectable=!o.constrainSelection;cName.push("month-out")}else{if(dt>dpm){dt-=dpm;currentStub=stubN;weekDay=weekDayN;selectable=!o.constrainSelection;cName.push("month-out")}}weekDay=(weekDay+dt+6)%7;cName.push("day-"+weekDay+" cell-"+curr);currentDate=currentStub+String(dt<10?"0":"")+dt;if(o.rangeLow&&+currentDate<+o.rangeLow||o.rangeHigh&&+currentDate>+o.rangeHigh){td.className="out-of-range";td.title="";td.appendChild(document.createTextNode(dt));if(o.showWeeks){cellAdded[row]=Math.min(cellAdded[row],2)}}else{if(selectable){td.title=titleFormat?printFormattedDate(new Date(+String(currentStub).substr(0,4),+String(currentStub).substr(4,2)-1,+dt,5,0,0),titleFormat,true):"";cName.push("cd-"+currentDate+" yyyymmdd-"+currentDate+" yyyymm-"+currentStub+" mmdd-"+currentStub.substr(4,2)+pad(dt))}else{td.title=titleFormat?getTitleTranslation(13)+" "+printFormattedDate(new Date(+String(currentStub).substr(0,4),+String(currentStub).substr(4,2)-1,+dt,5,0,0),titleFormat,true):"";cName.push("yyyymmdd-"+currentDate+" yyyymm-"+currentStub+" mmdd-"+currentStub.substr(4,2)+pad(dt)+" not-selectable")}if(currentDate==today){cName.push("date-picker-today")}if(dateSetD==currentDate){cName.push("date-picker-selected-date");setARIAProperty(td,"selected","true");this.selectedTD=td}if(((currentDate in dts)&&dts[currentDate]==1)||(o.disabledDays[weekDay]&&!((currentDate in dts)&&dts[currentDate]==0))){cName.push("day-disabled");if(titleFormat&&selectable){td.title=getTitleTranslation(13)+" "+td.title}}if(currentDate in bespokeRenderClass){cName.push(bespokeRenderClass[currentDate])}if(o.highlightDays[weekDay]){cName.push("date-picker-highlight")}if(cursorDate==currentDate){td.id=o.id+"-date-picker-hover"}td.appendChild(document.createTextNode(dt));td.className=cName.join(" ");if(o.showWeeks){cellAdded[row]=Math.min(cName[0]=="month-out"?3:1,cellAdded[row])}}}else{td.className="date-picker-unused";td.appendChild(document.createTextNode(nbsp));td.title=""}if(o.showWeeks&&curr-(row*7)==6){removeChildNodes(o.wkThs[row]);o.wkThs[row].appendChild(document.createTextNode(cellAdded[row]==4&&!o.fillGrid?nbsp:getWeekNumber(cy,cm,curr-firstColIndex-6)));o.wkThs[row].className="date-picker-week-header"+(["",""," out-of-range"," month-out",""][cellAdded[row]])}}var span=o.titleBar.getElementsByTagName("span");removeChildNodes(span[0]);removeChildNodes(span[1]);span[0].appendChild(document.createTextNode(getMonthTranslation(cm,false)+nbsp));span[1].appendChild(document.createTextNode(cy));if(o.timerSet){o.timerInc=50+Math.round(((o.timerInc-50)/1.8));o.timer=window.setTimeout(o.updateTable,o.timerInc)}o.inUpdate=o.delayedUpdate=false;o.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))}if(!this.created){return}removeEvent(this.table,"mousedown",o.onmousedown);removeEvent(this.table,"mouseover",o.onmouseover);removeEvent(this.table,"mouseout",o.onmouseout);removeEvent(document,"mousedown",o.onmousedown);removeEvent(document,"mouseup",o.clearTimer);if(window.addEventListener&&!window.devicePixelRatio){try{window.removeEventListener("DOMMouseScroll",this.onmousewheel,false)}catch(err){}}else{removeEvent(document,"mousewheel",this.onmousewheel);removeEvent(window,"mousewheel",this.onmousewheel)}o.removeOnFocusEvents();clearTimeout(o.fadeTimer);clearTimeout(o.timer);if(oldIE===6&&!o.staticPos){try{o.iePopUp.parentNode.removeChild(o.iePopUp);o.iePopUp=null}catch(err){}}if(this.div&&this.div.parentNode){this.div.parentNode.removeChild(this.div)}o=null};this.resizeInlineDiv=function(){o.div.style.width=o.table.offsetWidth+"px";o.div.style.height=o.table.offsetHeight+"px"};this.reset=function(){var elemID,elem;for(elemID in o.formElements){elem=document.getElementById(elemID);if(elem){if(elem.tagName.toLowerCase()=="select"){elem.selectedIndex=o.formElements[elemID.defaultVal]}else{elem.value=o.formElements[elemID.defaultVal]}}}o.changeHandler()};this.create=function(){if(document.getElementById("fd-"+this.id)){return}var tr,row,col,tableHead,tableBody,tableFoot;this.noFocus=true;function createTH(details){var th=document.createElement("th");if(details.thClassName){th.className=details.thClassName}if(details.colspan){th.setAttribute(oldIE?"colSpan":"colspan",details.colspan)}th.unselectable="on";return th}function createThAndButton(tr,obj){for(var i=0,details;details=obj[i];i++){var th=createTH(details);tr.appendChild(th);var but=document.createElement("span");but.className=details.className;but.id=o.id+details.id;but.appendChild(document.createTextNode(details.text||o.nbsp));but.title=details.title||"";but.unselectable="on";th.appendChild(but)}}this.div=document.createElement("div");this.div.id="fd-"+this.id;this.div.className="date-picker"+(cssAnimations?" fd-dp-fade ":"")+this.bespokeClass;this.div.style.visibility="hidden";this.div.style.display="none";if(this.describedBy&&document.getElementById(this.describedBy)){setARIAProperty(this.div,"describedby",this.describedBy)}if(this.labelledBy){setARIAProperty(this.div,"labelledby",this.labelledBy.id)}this.idiv=document.createElement("div");this.table=document.createElement("table");this.table.className="date-picker-table";this.table.onmouseover=this.onmouseover;this.table.onmouseout=this.onmouseout;this.table.onclick=this.onclick;if(this.finalOpacity<100){this.idiv.style.opacity=Math.min(Math.max(parseInt(this.finalOpacity,10)/100,0.2),1)}if(this.staticPos){this.table.onmousedown=this.onmousedown}this.div.appendChild(this.idiv);this.idiv.appendChild(this.table);var dragEnabledCN=!this.dragDisabled?" drag-enabled":"";if(!this.staticPos){this.div.style.visibility="hidden";this.div.className+=dragEnabledCN;document.getElementsByTagName("body")[0].appendChild(this.div);if(oldIE===6){this.iePopUp=document.createElement("iframe");this.iePopUp.src="javascript:'';";this.iePopUp.setAttribute("className","iehack");this.iePopUp.setAttribute("tabIndex",-1);setARIARole(this.iePopUp,"presentation");setARIAProperty(this.iePopUp,"hidden","true");this.iePopUp.scrolling="no";this.iePopUp.frameBorder="0";this.iePopUp.name=this.iePopUp.id=this.id+"-iePopUpHack";document.body.appendChild(this.iePopUp)}setARIAProperty(this.div,"hidden","true")}else{var elem=document.getElementById(this.positioned?this.positioned:this.id);if(!elem){this.div=null;if(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}this.div.className+=" static-datepicker";if(this.positioned){elem.appendChild(this.div)}else{elem.parentNode.insertBefore(this.div,elem.nextSibling)}if(this.hideInput){for(var elemID in this.formElements){elem=document.getElementById(elemID);if(elem){elem.className+=" fd-hidden-input"}}}setTimeout(this.resizeInlineDiv,300)}setARIARole(this.div,"application");setARIARole(this.table,"grid");if(this.statusFormat){tableFoot=document.createElement("tfoot");this.table.appendChild(tableFoot);tr=document.createElement("tr");tr.className="date-picker-tfoot";tableFoot.appendChild(tr);this.statusBar=createTH({thClassName:"date-picker-statusbar"+dragEnabledCN,colspan:this.showWeeks?8:7});tr.appendChild(this.statusBar);this.updateStatus()}tableHead=document.createElement("thead");tableHead.className="date-picker-thead";this.table.appendChild(tableHead);tr=document.createElement("tr");setARIARole(tr,"presentation");tableHead.appendChild(tr);this.titleBar=createTH({thClassName:"date-picker-title"+dragEnabledCN,colspan:this.showWeeks?8:7});tr.appendChild(this.titleBar);tr=null;var span=document.createElement("span");span.appendChild(document.createTextNode(nbsp));span.className="month-display"+dragEnabledCN;this.titleBar.appendChild(span);span=document.createElement("span");span.appendChild(document.createTextNode(nbsp));span.className="year-display"+dragEnabledCN;this.titleBar.appendChild(span);span=null;tr=document.createElement("tr");setARIARole(tr,"presentation");tableHead.appendChild(tr);createThAndButton(tr,[{className:"prev-but prev-year",id:"-prev-year-but",text:"\u00AB",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:"\u00BB",title:getTitleTranslation(3)}]);tableBody=document.createElement("tbody");this.table.appendChild(tableBody);var colspanTotal=this.showWeeks?8:7,colOffset=this.showWeeks?0:-1,but,abbr,formElemId,formElem;for(var rows=0;rows<7;rows++){row=document.createElement("tr");if(rows!=0){setARIARole(row,"row");tableBody.appendChild(row)}else{tableHead.appendChild(row)}for(var cols=0;cols0&&rows>0)||(!this.showWeeks&&rows>0)){setARIARole(col,"gridcell")}else{if(rows===0&&cols>colOffset){col.className="date-picker-day-header";col.scope="col";setARIARole(col,"columnheader");col.id=this.id+"-col-"+cols}else{col.className="date-picker-week-header";col.scope="row";setARIARole(col,"rowheader");col.id=this.id+"-row-"+rows}}}}col=row=null;this.ths=this.table.getElementsByTagName("thead")[0].getElementsByTagName("tr")[2].getElementsByTagName("th");for(var y=0;y(this.showWeeks?0:-1)){but=document.createElement("span");but.className="fd-day-header";if(oldIE){but.unselectable="on"}this.ths[y].appendChild(but)}}but=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");if(this.noToday){this.butToday.style.display="none"}if(this.showWeeks){this.wkThs=this.table.getElementsByTagName("tbody")[0].getElementsByTagName("th");this.div.className+=" weeks-displayed"}tableBody=tableHead=tr=createThAndButton=createTH=null;this.updateTableHeaders();this.created=true;this.updateTable();if(this.staticPos){this.visible=true;this.opacity=100;this.div.style.visibility="visible";this.div.style.display="block";this.noFocus=true;this.fade()}else{this.reposition();this.div.style.visibility="visible";this.fade();this.noFocus=true}this.callback("domcreate",{id:this.id})};this.transEnd=function(){o.div.style.display="none";o.div.style.visibility="hidden";setARIAProperty(o.div,"hidden","true")};this.fade=function(){window.clearTimeout(o.fadeTimer);o.fadeTimer=null;if(cssAnimations){o.opacity=o.opacityTo;if(o.opacityTo==0){o.visible=false;addEvent(o.div,transitionEnd,o.transEnd);addClass(o.div,"fd-dp-fade")}else{removeEvent(o.div,transitionEnd,o.transEnd);o.visible=true;o.div.style.display="block";o.div.style.visibility="visible";setARIAProperty(o.div,"hidden","false");removeClass(o.div,"fd-dp-fade")}return}var diff=Math.round(o.opacity+((o.opacityTo-o.opacity)/4));o.setOpacity(diff);if(Math.abs(o.opacityTo-diff)>3&&!o.noFadeEffect){o.fadeTimer=window.setTimeout(o.fade,50)}else{o.setOpacity(o.opacityTo);if(o.opacityTo==0){o.div.style.display="none";o.div.style.visibility="hidden";setARIAProperty(o.div,"hidden","true");o.visible=false}else{setARIAProperty(o.div,"hidden","false");o.visible=true}}};this.trackDrag=function(e){e=e||window.event;var diffx=(e.pageX?e.pageX:e.clientX?e.clientX:e.x)-o.mx;var diffy=(e.pageY?e.pageY:e.clientY?e.clientY:e.Y)-o.my;o.div.style.left=Math.round(o.x+diffx)>0?Math.round(o.x+diffx)+"px":"0px";o.div.style.top=Math.round(o.y+diffy)>0?Math.round(o.y+diffy)+"px":"0px";if(oldIE===6&&!o.staticPos){o.iePopUp.style.top=o.div.style.top;o.iePopUp.style.left=o.div.style.left}};this.stopDrag=function(e){var b=document.getElementsByTagName("body")[0];removeClass(b,"fd-drag-active");removeEvent(document,"mousemove",o.trackDrag,false);removeEvent(document,"mouseup",o.stopDrag,false);o.div.style.zIndex=9999};this.onmousedown=function(e){e=e||document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement,origEl=el,hideDP=true,reg=new RegExp("^fd-(but-)?"+o.id+"$");o.mouseDownElem=null;while(el){if(el.id&&el.id.length&&el.id.search(reg)!=-1){hideDP=false;break}try{el=el.parentNode}catch(err){break}}if(hideDP){hideAll();return true}if((o.div.className+origEl.className).search("fd-disabled")!=-1){return true}if(origEl.id.search(new RegExp("^"+o.id+"(-prev-year-but|-prev-month-but|-next-month-but|-next-year-but)$"))!=-1){o.mouseDownElem=origEl;addEvent(document,"mouseup",o.clearTimer);addEvent(origEl,"mouseout",o.clearTimer);var incs={"-prev-year-but":[0,-1,0],"-prev-month-but":[0,0,-1],"-next-year-but":[0,1,0],"-next-month-but":[0,0,1]},check=origEl.id.replace(o.id,""),dateYYYYMM=Number(o.date.getFullYear()+pad(o.date.getMonth()+1));o.timerInc=800;o.timerSet=true;o.dayInc=incs[check][0];o.yearInc=incs[check][1];o.monthInc=incs[check][2];o.accellerator=1;if(!(o.currentYYYYMM==dateYYYYMM)){if((o.currentYYYYMMdateYYYYMM&&(o.yearInc==1||o.monthInc==1))){o.delayedUpdate=false;o.timerInc=1200}else{o.delayedUpdate=true}}o.updateTable();return stopEvent(e)}else{if(el.className.search("drag-enabled")!=-1){o.mx=e.pageX?e.pageX:e.clientX?e.clientX:e.x;o.my=e.pageY?e.pageY:e.clientY?e.clientY:e.Y;o.x=parseInt(o.div.style.left,10);o.y=parseInt(o.div.style.top,10);addEvent(document,"mousemove",o.trackDrag,false);addEvent(document,"mouseup",o.stopDrag,false);addClass(document.getElementsByTagName("body")[0],"fd-drag-active");o.div.style.zIndex=10000;return stopEvent(e)}}return true};this.onclick=function(e){if((!cssAnimations&&o.opacity!=o.opacityTo)||o.disabled){return stopEvent(e)}e=e||document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement;while(el.parentNode){if(el.tagName&&el.tagName.toLowerCase()=="td"){if(el.className.search(/cd-([0-9]{8})/)==-1||el.className.search(noSelectionRegExp)!=-1){return stopEvent(e)}var cellDate=el.className.match(/cd-([0-9]{8})/)[1];o.date=new Date(cellDate.substr(0,4),cellDate.substr(4,2)-1,cellDate.substr(6,2),5,0,0);o.dateSet=new Date(o.date);o.noFocus=true;o.callback("dateset",{id:o.id,date:o.dateSet,dd:o.dateSet.getDate(),mm:o.dateSet.getMonth()+1,yyyy:o.dateSet.getFullYear()});o.returnFormattedDate();o.hide();o.stopTimer();break}else{if(el.id&&el.id==o.id+"-today-but"){o.date=new Date();o.updateTable();o.stopTimer();break}else{if(el.className.search(/date-picker-day-header/)!=-1){var cnt=o.showWeeks?-1:0,elem=el;while(elem.previousSibling){elem=elem.previousSibling;if(elem.tagName&&elem.tagName.toLowerCase()=="th"){cnt++}}o.firstDayOfWeek=(o.firstDayOfWeek+cnt)%7;o.updateTableHeaders();break}}}try{el=el.parentNode}catch(err){break}}return stopEvent(e)};this.show=function(autoFocus){if(this.staticPos){return}var elem,elemID;for(elemID in this.formElements){elem=document.getElementById(this.id);if(!elem||(elem&&elem.disabled)){return}}this.noFocus=true;if(!this.created||!document.getElementById("fd-"+this.id)){this.created=false;this.fullCreate=false;this.create();this.fullCreate=true}else{this.setDateFromInput();this.reposition()}this.noFocus=!!!autoFocus;if(this.noFocus){this.clickActivated=true;this.showCursor=false;addEvent(document,"mousedown",this.onmousedown);if(mouseWheel){if(window.addEventListener&&!window.devicePixelRatio){window.addEventListener("DOMMouseScroll",this.onmousewheel,false)}else{addEvent(document,"mousewheel",this.onmousewheel);addEvent(window,"mousewheel",this.onmousewheel)}}}else{this.clickActivated=false;this.showCursor=true}this.opacityTo=100;this.div.style.display="block";if(oldIE===6){this.iePopUp.style.width=this.div.offsetWidth+"px";this.iePopUp.style.height=this.div.offsetHeight+"px";this.iePopUp.style.display="block"}this.setNewFocus();this.fade();var butt=document.getElementById("fd-but-"+this.id);if(butt){addClass(butt,"date-picker-button-active")}};this.hide=function(){if(!this.visible||!this.created||!document.getElementById("fd-"+this.id)){return}this.kbEvent=false;removeClass(o.div,"date-picker-focus");this.stopTimer();this.removeOnFocusEvents();this.clickActivated=false;this.noFocus=true;this.showCursor=false;this.setNewFocus();if(this.staticPos){return}if(this.statusBar){this.updateStatus(getTitleTranslation(9))}var butt=document.getElementById("fd-but-"+this.id);if(butt){removeClass(butt,"date-picker-button-active")}removeEvent(document,"mousedown",this.onmousedown);if(mouseWheel){if(window.addEventListener&&!window.devicePixelRatio){try{window.removeEventListener("DOMMouseScroll",this.onmousewheel,false)}catch(err){}}else{removeEvent(document,"mousewheel",this.onmousewheel);removeEvent(window,"mousewheel",this.onmousewheel)}}if(oldIE===6){this.iePopUp.style.display="none"}this.opacityTo=0;this.fade()};this.onblur=function(e){o.removeCursorHighlight();o.hide()};this.onfocus=function(e){o.noFocus=false;addClass(o.div,"date-picker-focus");if(o.statusBar){o.updateStatus(printFormattedDate(o.date,o.statusFormat,true))}o.showCursor=true;o.addCursorHighlight();o.addOnFocusEvents()};this.onmousewheel=function(e){e=e||document.parentWindow.event;var delta=0;if(e.wheelDelta){delta=e.wheelDelta/120;if(isOpera&&window.opera.version()<9.2){delta=-delta}}else{if(e.detail){delta=-e.detail/3}}var n=o.date.getDate(),d=new Date(o.date),inc=delta>0?1:-1;d.setDate(2);d.setMonth(d.getMonth()+inc*1);d.setDate(Math.min(n,daysInMonth(d.getMonth(),d.getFullYear())));if(o.outOfRange(d)){return stopEvent(e)}o.date=new Date(d);o.updateTable();if(o.statusBar){o.updateStatus(printFormattedDate(o.date,o.statusFormat,true))}return stopEvent(e)};this.onkeydown=function(e){o.stopTimer();if(!o.visible){return false}e=e||document.parentWindow.event;var kc=e.keyCode?e.keyCode:e.charCode;if(kc==13){var td=document.getElementById(o.id+"-date-picker-hover");if(!td||td.className.search(/cd-([0-9]{8})/)==-1||td.className.search(/out-of-range|day-disabled/)!=-1){return stopEvent(e)}o.dateSet=new Date(o.date);o.callback("dateset",o.createCbArgObj());o.returnFormattedDate();o.hide();return stopEvent(e)}else{if(kc==27){if(!o.staticPos){o.hide();var butt=document.getElementById("fd-but-"+o.id);if(butt){setTimeout(function(){try{butt.focus()}catch(err){}},0)}return stopEvent(e)}return true}else{if(kc==32||kc==0){o.date=new Date();o.updateTable();return stopEvent(e)}else{if(kc==9){if(!o.staticPos){return stopEvent(e)}return true}}}}if(oldIE){if(new Date().getTime()-o.interval.getTime()<50){return stopEvent(e)}o.interval=new Date()}if((kc>49&&kc<56)||(kc>97&&kc<104)){if(kc>96){kc-=(96-48)}kc-=49;o.firstDayOfWeek=(o.firstDayOfWeek+kc)%7;o.updateTableHeaders();return stopEvent(e)}if(kc<33||kc>40){return true}var d=new Date(o.date),cursorYYYYMM=o.date.getFullYear()+pad(o.date.getMonth()+1),tmp;if(kc==36){d.setDate(1)}else{if(kc==35){d.setDate(daysInMonth(d.getMonth(),d.getFullYear()))}else{if(kc==33||kc==34){var inc=(kc==34)?1:-1;if(e.ctrlKey){d.setFullYear(d.getFullYear()+inc*1)}else{var n=o.date.getDate();d.setDate(2);d.setMonth(d.getMonth()+inc*1);d.setDate(Math.min(n,daysInMonth(d.getMonth(),d.getFullYear())))}}else{if(kc==37){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()-1,5,0,0)}else{if(kc==39||kc==34){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()+1,5,0,0)}else{if(kc==38){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()-7,5,0,0)}else{if(kc==40){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()+7,5,0,0)}}}}}}}if(o.outOfRange(d)){return stopEvent(e)}o.date=d;if(o.statusBar){o.updateStatus(o.getBespokeTitle(o.date.getFullYear(),o.date.getMonth()+1,o.date.getDate())||printFormattedDate(o.date,o.statusFormat,true))}var t=String(o.date.getFullYear())+pad(o.date.getMonth()+1)+pad(o.date.getDate());if(e.ctrlKey||(kc==33||kc==34)||to.lastDateShown){o.updateTable();if(oldIE){o.interval=new Date()}}else{if(!o.noToday){o.disableTodayButton()}o.removeOldFocus();o.showHideButtons(o.date);for(var i=0,td;td=o.tds[i];i++){if(td.className.search("cd-"+t)==-1){continue}td.id=o.id+"-date-picker-hover";o.setNewFocus();break}}return stopEvent(e)};this.onmouseout=function(e){e=e||document.parentWindow.event;var p=e.toElement||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode}catch(e){p=this}}if(p==this){return false}if(o.clickActivated||(o.staticPos&&!o.kbEventsAdded)){o.showCursor=false;o.removeCursorHighlight()}if(o.currentTR){o.currentTR.className="";o.currentTR=null}if(o.statusBar){o.updateStatus(o.dateSet?o.getBespokeTitle(o.dateSet.getFullYear(),o.dateSet.getMonth()+1,o.dateSet.getDate())||printFormattedDate(o.dateSet,o.statusFormat,true):getTitleTranslation(9))}};this.onmouseover=function(e){e=e||document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement;while(el.nodeType!=1){el=el.parentNode}if(!el||!el.tagName){return}o.noFocus=true;var statusText=getTitleTranslation(9);if(o.clickActivated||(o.staticPos&&!o.kbEventsAdded)){o.showCursor=false}switch(el.tagName.toLowerCase()){case"td":if(el.className.search(/date-picker-unused|out-of-range/)!=-1){statusText=getTitleTranslation(9)}if(el.className.search(/cd-([0-9]{8})/)!=-1){o.showCursor=true;o.stopTimer();var cellDate=el.className.match(/cd-([0-9]{8})/)[1];o.removeOldFocus();el.id=o.id+"-date-picker-hover";o.setNewFocus();o.date=new Date(+cellDate.substr(0,4),+cellDate.substr(4,2)-1,+cellDate.substr(6,2),5,0,0);if(!o.noToday){o.disableTodayButton()}statusText=o.getBespokeTitle(+cellDate.substr(0,4),+cellDate.substr(4,2),+cellDate.substr(6,2))||printFormattedDate(o.date,o.statusFormat,true)}break;case"th":if(!o.statusBar){break}if(el.className.search(/drag-enabled/)!=-1){statusText=getTitleTranslation(10)}else{if(el.className.search(/date-picker-week-header/)!=-1){var txt=el.firstChild?el.firstChild.nodeValue:"";statusText=txt.search(/^(\d+)$/)!=-1?getTitleTranslation(7,[txt,txt<3&&o.date.getMonth()==11?getWeeksInYear(o.date.getFullYear())+1:getWeeksInYear(o.date.getFullYear())]):getTitleTranslation(9)}}break;case"span":if(!o.statusBar){break}if(el.className.search(/day-([0-6])/)!=-1){var day=el.className.match(/day-([0-6])/)[1];statusText=getTitleTranslation(11,[getDayTranslation(day,false)])}else{if(el.className.search(/(drag-enabled|today-but|prev-(year|month)|next-(year|month))/)!=-1&&el.className.search(/disabled/)==-1){statusText=getTitleTranslation({"drag-enabled":10,"prev-year":2,"prev-month":0,"next-year":3,"next-month":1,"today-but":12}[el.className.match(/(drag-enabled|today-but|prev-(year|month)|next-(year|month))/)[0]])}}break;default:statusText=""}while(el.parentNode){el=el.parentNode;if(el.nodeType==1&&el.tagName.toLowerCase()=="tr"){if(o.currentTR){if(el==o.currentTR){break}o.currentTR.className=""}el.className="dp-row-highlight";o.currentTR=el;break}}if(o.statusBar&&statusText){o.updateStatus(statusText)}if(!o.showCursor){o.removeCursorHighlight()}};this.clearTimer=function(){o.stopTimer();o.timerInc=800;o.yearInc=0;o.monthInc=0;o.dayInc=0;removeEvent(document,"mouseup",o.clearTimer);if(o.mouseDownElem!=null){removeEvent(o.mouseDownElem,"mouseout",o.clearTimer)}o.mouseDownElem=null};var o=this;this.setDateFromInput();if(this.staticPos){this.create()}else{this.createButton()}(function(){var elemID,elem,elemCnt=0;for(elemID in o.formElements){elem=document.getElementById(elemID);if(elem&&elem.tagName&&elem.tagName.search(/select|input/i)!=-1){addEvent(elem,"change",o.changeHandler);if(elemCnt==0&&elem.form){addEvent(elem.form,"reset",o.reset)}elemCnt++}if(!elem||elem.disabled==true){o.disableDatePicker()}}})();this.fullCreate=true}datePicker.prototype.addButtonEvents=function(but){function buttonEvent(e){e=e||window.event;var inpId=this.id.replace("fd-but-",""),dpVisible=isVisible(inpId),autoFocus=false,kbEvent=datePickers[inpId].kbEvent;if(kbEvent){datePickers[inpId].kbEvent=false;return}if(e.type=="keydown"){var kc=e.keyCode!=null?e.keyCode:e.charCode;if(kc!=13){return true}datePickers[inpId].kbEvent=true;if(dpVisible){removeClass(this,"date-picker-button-active");hideAll();return stopEvent(e)}autoFocus=true}else{datePickers[inpId].kbEvent=false}if(!dpVisible){addClass(this,"date-picker-button-active");hideAll(inpId);showDatePicker(inpId,autoFocus)}else{removeClass(this,"date-picker-button-active");hideAll()}return stopEvent(e)}but.onclick=buttonEvent;but.onkeydown=buttonEvent;if(!buttonTabIndex){setTabIndex(but,-1)}else{setTabIndex(but,this.bespokeTabIndex)}};datePicker.prototype.createButton=function(){if(this.staticPos||document.getElementById("fd-but-"+this.id)){return}var inp=document.getElementById(this.id),span=document.createElement("span"),but=document.createElement("a");but.href="#"+this.id;but.className="date-picker-control";but.title=getTitleTranslation(5);but.id="fd-but-"+this.id;span.appendChild(document.createTextNode(nbsp));but.appendChild(span);span=document.createElement("span");span.className="fd-screen-reader";span.appendChild(document.createTextNode(but.title));but.appendChild(span);setARIARole(but,"button");setARIAProperty(but,"haspopup",true);if(this.positioned&&document.getElementById(this.positioned)){document.getElementById(this.positioned).appendChild(but)}else{inp.parentNode.insertBefore(but,inp.nextSibling)}this.addButtonEvents(but);but=null;this.callback("dombuttoncreate",{id:this.id})};datePicker.prototype.setBespokeTitles=function(titles){this.bespokeTitles={};this.addBespokeTitles(titles)};datePicker.prototype.addBespokeTitles=function(titles){for(var dt in titles){if(titles.hasOwnProperty(dt)){this.bespokeTitles[dt]=titles[dt]}}};datePicker.prototype.getBespokeTitle=function(y,m,d){var dt,dtFull,yyyymmdd=y+String(pad(m))+pad(d);for(dt in this.bespokeTitles){if(this.bespokeTitles.hasOwnProperty(dt)){dtFull=String(dt).replace(/^(\*\*\*\*)/,y).replace(/^(\d\d\d\d)(\*\*)/,"$1"+pad(m));if(dtFull==yyyymmdd){return this.bespokeTitles[dt]}}}for(dt in bespokeTitles){if(bespokeTitles.hasOwnProperty(dt)){dtFull=String(dt).replace(/^(\*\*\*\*)/,y).replace(/^(\d\d\d\d)(\*\*)/,"$1"+pad(m));if(dtFull==yyyymmdd){return bespokeTitles[dt]}}}return false};datePicker.prototype.returnSelectedDate=function(){return this.dateSet};datePicker.prototype.setRangeLow=function(range){if(String(range).search(rangeRegExp)==-1){if(debug){throw"Invalid value passed to setRangeLow method: "+range}return false}this.rangeLow=range;if(!this.inUpdate){this.setDateFromInput()}};datePicker.prototype.setRangeHigh=function(range){if(String(range).search(rangeRegExp)==-1){if(debug){throw"Invalid value passed to setRangeHigh method: "+range}return false}this.rangeHigh=range;if(!this.inUpdate){this.setDateFromInput()}};datePicker.prototype.setDisabledDays=function(dayArray){if(!dayArray.length||dayArray.join("").search(/^([0|1]{7})$/)==-1){if(debug){throw"Invalid values located when attempting to call setDisabledDays"}return false}this.disabledDays=dayArray;if(!this.inUpdate){this.setDateFromInput()}};datePicker.prototype.setDisabledDates=function(dateObj){this.filterDateList(dateObj,true)};datePicker.prototype.setEnabledDates=function(dateObj){this.filterDateList(dateObj,false)};datePicker.prototype.addDisabledDates=function(dateObj){this.addDatesToList(dateObj,true)};datePicker.prototype.addEnabledDates=function(dateObj){this.addDatesToList(dateObj,false)};datePicker.prototype.filterDateList=function(dateObj,type){var tmpDates=[];for(var i=0;iNumber(String(dateObj[startD]).replace(/^\*\*\*\*/,2010).replace(/^(\d\d\d\d)(\*\*)/,"$122"))){continue}this.dateList.push({type:!!(areDisabled),rLow:startD,rHigh:dateObj[startD]})}}if(!this.inUpdate){this.setDateFromInput()}};datePicker.prototype.setSelectedDate=function(yyyymmdd){if(String(yyyymmdd).search(wcDateRegExp)==-1){return false}var match=yyyymmdd.match(rangeRegExp),dt=new Date(+match[2],+match[3]-1,+match[4],5,0,0);if(!dt||isNaN(dt)||!this.canDateBeSelected(dt)){return false}this.dateSet=new Date(dt);if(!this.inUpdate){this.updateTable()}this.callback("dateset",this.createCbArgObj());this.returnFormattedDate()};datePicker.prototype.checkSelectedDate=function(){if(this.dateSet&&!this.canDateBeSelected(this.dateSet)){this.dateSet=null}if(!this.inUpdate){this.updateTable()}};datePicker.prototype.addOnFocusEvents=function(){if(this.kbEventsAdded||this.noFocus){return}addEvent(document,"keypress",this.onkeydown);addEvent(document,"mousedown",this.onmousedown);if(oldIE){removeEvent(document,"keypress",this.onkeydown);addEvent(document,"keydown",this.onkeydown)}if(window.devicePixelRatio){removeEvent(document,"keypress",this.onkeydown);addEvent(document,"keydown",this.onkeydown)}this.noFocus=false;this.kbEventsAdded=true};datePicker.prototype.removeOnFocusEvents=function(){if(!this.kbEventsAdded){return}removeEvent(document,"keypress",this.onkeydown);removeEvent(document,"keydown",this.onkeydown);removeEvent(document,"mousedown",this.onmousedown);this.kbEventsAdded=false};datePicker.prototype.stopTimer=function(){this.timerSet=false;window.clearTimeout(this.timer)};datePicker.prototype.setOpacity=function(op){this.div.style.opacity=op/100;this.div.style.filter="alpha(opacity="+op+")";this.opacity=op};datePicker.prototype.truePosition=function(element){var pos=this.cumulativeOffset(element);if(isOpera){return pos}var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body,dsocleft=document.all?iebody.scrollLeft:window.pageXOffset,dsoctop=document.all?iebody.scrollTop:window.pageYOffset,posReal=this.realOffset(element);return[pos[0]-posReal[0]+dsocleft,pos[1]-posReal[1]+dsoctop]};datePicker.prototype.realOffset=function(element){var t=0,l=0;do{t+=element.scrollTop||0;l+=element.scrollLeft||0;element=element.parentNode}while(element);return[l,t]};datePicker.prototype.cumulativeOffset=function(element){var t=0,l=0;do{t+=element.offsetTop||0;l+=element.offsetLeft||0;element=element.offsetParent}while(element);return[l,t]};datePicker.prototype.outOfRange=function(tmpDate){if(!this.rangeLow&&!this.rangeHigh){return false}var level=false;if(!tmpDate){level=true;tmpDate=this.date}var d=pad(tmpDate.getDate()),m=pad(tmpDate.getMonth()+1),y=tmpDate.getFullYear(),dt=String(y)+String(m)+String(d);if(this.rangeLow&&+dt<+this.rangeLow){if(!level){return true}this.date=new Date(this.rangeLow.substr(0,4),this.rangeLow.substr(4,2)-1,this.rangeLow.substr(6,2),5,0,0);return false}if(this.rangeHigh&&+dt>+this.rangeHigh){if(!level){return true}this.date=new Date(this.rangeHigh.substr(0,4),this.rangeHigh.substr(4,2)-1,this.rangeHigh.substr(6,2),5,0,0)}return false};datePicker.prototype.canDateBeSelected=function(tmpDate){if(!tmpDate||isNaN(tmpDate)){return false}var d=pad(tmpDate.getDate()),m=pad(tmpDate.getMonth()+1),y=tmpDate.getFullYear(),dt=y+""+m+""+d,dd=this.getDateExceptions(y,m),wd=tmpDate.getDay()==0?7:tmpDate.getDay();if((this.rangeLow&&+dt<+this.rangeLow)||(this.rangeHigh&&+dt>+this.rangeHigh)||((dt in dd)&&dd[dt]==1)||(this.disabledDays[wd-1]&&(!(dt in dd)||((dt in dd)&&dd[dt]==1)))){return false}return true};datePicker.prototype.updateStatus=function(msg){removeChildNodes(this.statusBar);if(msg&&this.statusFormat.search(/%S/)!=-1&&msg.search(/([0-9]{1,2})(st|nd|rd|th)/)!=-1){msg=cbSplit(msg.replace(/([0-9]{1,2})(st|nd|rd|th)/,"$1$2"),/|<\/sup>/);var dc=document.createDocumentFragment();for(var i=0,nd;nd=msg[i];i++){if(/^(st|nd|rd|th)$/.test(nd)){var sup=document.createElement("sup");sup.appendChild(document.createTextNode(nd));dc.appendChild(sup)}else{dc.appendChild(document.createTextNode(nd))}}this.statusBar.appendChild(dc)}else{this.statusBar.appendChild(document.createTextNode(msg?msg:getTitleTranslation(9)))}};datePicker.prototype.setDateFromInput=function(){var origDateSet=this.dateSet,m=false,but=this.staticPos?false:document.getElementById("fd-but-"+this.id),e=localeImport.imported?[].concat(localeDefaults.fullMonths).concat(localeDefaults.monthAbbrs):[],l=localeImport.imported?[].concat(localeImport.fullMonths).concat(localeImport.monthAbbrs):[],eosRegExp=/(3[01]|[12][0-9]|0?[1-9])(st|nd|rd|th)/i,elemCnt=0,dt=false,allFormats,i,elemID,elem,elemFmt,d,y,elemVal,dp,mp,yp;this.dateSet=null;for(elemID in this.formElements){elem=document.getElementById(elemID);if(!elem){return false}elemCnt++;elemVal=String(elem.value);if(!elemVal){continue}elemFmt=this.formElements[elemID];allFormats=[elemFmt];dt=false;dp=elemFmt.search(dPartsRegExp)!=-1;mp=elemFmt.search(mPartsRegExp)!=-1;yp=elemFmt.search(yPartsRegExp)!=-1;if(!(dp&&mp&&yp)){if(yp&&!(mp||dp)){allFormats=allFormats.concat(["%Y","%y"])}else{if(mp&&!(yp||dp)){allFormats=allFormats.concat(["%M","%F","%m","%n"])}else{if(dp&&!(yp||mp)){allFormats=allFormats.concat(["%d%","%j"])}}}}for(i=0;idaysInMonth(+m-1,+y)){d=daysInMonth(+m-1,+y);dt=false}else{dt=new Date(+y,+m-1,+d,5,0,0)}}if(but){removeClass(but,"date-picker-dateval")}if(!dt||isNaN(dt)){var newDate=new Date(y||new Date().getFullYear(),!(m===false)?m-1:new Date().getMonth(),1,5,0,0);this.date=this.cursorDate?new Date(+this.cursorDate.substr(0,4),+this.cursorDate.substr(4,2)-1,+this.cursorDate.substr(6,2),5,0,0):new Date(newDate.getFullYear(),newDate.getMonth(),Math.min(+d||new Date().getDate(),daysInMonth(newDate.getMonth(),newDate.getFullYear())),5,0,0);this.outOfRange();if(this.fullCreate){this.updateTable()}return}dt.setHours(5);this.date=new Date(dt);this.outOfRange();if(dt.getTime()==this.date.getTime()&&this.canDateBeSelected(this.date)){this.dateSet=new Date(this.date);if(but){addClass(but,"date-picker-dateval")}this.returnFormattedDate(true)}if(this.fullCreate){this.updateTable()}};datePicker.prototype.setSelectIndex=function(elem,indx){for(var opt=elem.options.length-1;opt>=0;opt--){if(elem.options[opt].value==indx){elem.selectedIndex=opt;return}}};datePicker.prototype.returnFormattedDate=function(noFocus){var but=this.staticPos?false:document.getElementById("fd-but-"+this.id);if(!this.dateSet){if(but){removeClass(but,"date-picker-dateval")}return}var d=pad(this.dateSet.getDate()),m=pad(this.dateSet.getMonth()+1),y=this.dateSet.getFullYear(),el=false,elemID,elem,elemFmt,fmtDate;noFocus=!!noFocus;for(elemID in this.formElements){elem=document.getElementById(elemID);if(!elem){return}if(!el){el=elem}elemFmt=this.formElements[elemID];fmtDate=printFormattedDate(this.dateSet,elemFmt,returnLocaleDate);if(elem.tagName.toLowerCase()=="input"){elem.value=fmtDate}else{this.setSelectIndex(elem,fmtDate)}}if(this.staticPos){this.noFocus=true;this.updateTable();this.noFocus=false}else{if(but){addClass(but,"date-picker-dateval")}}if(this.fullCreate){if(el.type&&el.type!="hidden"&&!noFocus){try{el.focus()}catch(err){}}}if(!noFocus){this.callback("datereturned",this.createCbArgObj())}};datePicker.prototype.disableDatePicker=function(){if(this.disabled){return}if(this.staticPos){this.removeOnFocusEvents();this.removeOldFocus();this.noFocus=true;addClass(this.div,"date-picker-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{if(this.visible){this.hide()}var but=document.getElementById("fd-but-"+this.id);if(but){addClass(but,"date-picker-control-disabled");setARIAProperty(but,"disabled",true);but.onkeydown=but.onclick=function(){return false};setTabIndex(but,-1);but.title=""}}clearTimeout(this.timer);this.disabled=true};datePicker.prototype.enableDatePicker=function(){if(!this.disabled){return}if(this.staticPos){this.removeOldFocus();if(this.dateSet!=null){this.date=this.dateSet}this.noFocus=true;this.updateTable();removeClass(this.div,"date-picker-disabled");this.disabled=false;this.table.onmouseover=this.onmouseover;this.table.onmouseout=this.onmouseout;this.table.onclick=this.onclick;this.table.onmousedown=this.onmousedown}else{var but=document.getElementById("fd-but-"+this.id);if(but){removeClass(but,"date-picker-control-disabled");setARIAProperty(but,"disabled",false);this.addButtonEvents(but);but.title=getTitleTranslation(5)}}this.disabled=false};datePicker.prototype.disableTodayButton=function(){var today=new Date();removeClass(this.butToday,"fd-disabled");if(this.outOfRange(today)||(this.date.getDate()==today.getDate()&&this.date.getMonth()==today.getMonth()&&this.date.getFullYear()==today.getFullYear())){addClass(this.butToday,"fd-disabled")}};datePicker.prototype.updateTableHeaders=function(){var colspanTotal=this.showWeeks?8:7,colOffset=this.showWeeks?1:0,d,but;for(var col=colOffset;colcolOffset){but=this.ths[col].getElementsByTagName("span")[0];removeChildNodes(but);but.appendChild(document.createTextNode(getDayTranslation(d,true)));but.title=this.ths[col].title;but=null}else{removeChildNodes(this.ths[col]);this.ths[col].appendChild(document.createTextNode(getDayTranslation(d,true)))}removeClass(this.ths[col],"date-picker-highlight");if(this.highlightDays[d]){addClass(this.ths[col],"date-picker-highlight")}}if(this.created){this.updateTable()}};datePicker.prototype.callback=function(type,args){if(!type||!(type in this.callbacks)){return false}var ret=false,func;for(func=0;funcnum){var txt=localeImport.titles[num];if(replacements&&replacements.length){for(var i=0;iday?titles[day]:""};var getMonthTranslation=function(month,abbreviation){var titles=localeImport[abbreviation?"monthAbbrs":"fullMonths"];return titles.length&&titles.length>month?titles[month]:""};var daysInMonth=function(nMonth,nYear){nMonth=(nMonth+12)%12;return(((0==(nYear%4))&&((0!=(nYear%100))||(0==(nYear%400))))&&nMonth==1)?29:[31,28,31,30,31,30,31,31,30,31,30,31][nMonth]};var getWeeksInYear=function(Y){if(Y in weeksInYearCache){return weeksInYearCache[Y]}var X1=new Date(Y,0,4),X2=new Date(Y,11,28);X1.setDate(X1.getDate()-(6+X1.getDay())%7);X2.setDate(X2.getDate()+(7-X2.getDay())%7);weeksInYearCache[Y]=Math.round((X2-X1)/604800000);return weeksInYearCache[Y]};var getWeekNumber=function(y,m,d){var d=new Date(y,m,d,0,0,0),DoW=d.getDay(),ms;d.setDate(d.getDate()-(DoW+6)%7+3);ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*86400000))+1};var printFormattedDate=function(date,fmt,useImportedLocale){if(!date||isNaN(date)){return fmt}var d=date.getDate(),D=date.getDay(),m=date.getMonth(),y=date.getFullYear(),locale=useImportedLocale?localeImport:localeDefaults,fmtParts=String(fmt).split(formatSplitRegExp),fmtParts=cbSplit(fmt,formatSplitRegExp),fmtNewParts=[],flags={d:pad(d),D:locale.dayAbbrs[D==0?6:D-1],l:locale.fullDays[D==0?6:D-1],j:d,N:D==0?7:D,w:D,W:getWeekNumber(y,m,d),M:locale.monthAbbrs[m],F:locale.fullMonths[m],m:pad(m+1),n:m+1,t:daysInMonth(m,y),y:String(y).substr(2,2),Y:y,S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10]},len=fmtParts.length,currFlag,f;for(f=0;fdaysInMonth(+m-1,+y)){return false}return{d:dp?+d:false,m:mp?+m:false,y:yp?+y:false}};var findLabelForElement=function(element){var label;if(element.parentNode&&element.parentNode.tagName.toLowerCase()=="label"){label=element.parentNode}else{var labelList=document.getElementsByTagName("label");for(var lbl=0;lbl+myMax){myMax=dtPartStr}}}if(!options.cursorDate&&cursorDate){options.cursorDate=cursorDate}options.disabledDates[myMin]=myMax}else{if(fmt.m&&fmt.y){for(i=0;i+myMax){myMax=dtPartStr}}}myMin+="01";myMax+=""+daysInMonth(+myMax.substr(4,2)-1,+myMax.substr(0,4))}else{if(fmt.y){for(i=0;i+myMax){myMax=dt.y}}}myMin+="0101";myMax+="1231"}}}}}if(!(partsFound.d==1&&partsFound.m==1&&partsFound.y==1)){if(debug){throw"Could not find all of the required date parts within the date format for element: "+elem.id}return false}options.rangeLow=dateToYYYYMMDD(options.rangeLow||false);options.rangeHigh=dateToYYYYMMDD(options.rangeHigh||false);options.cursorDate=dateToYYYYMMDD(options.cursorDate||false);if(myMin&&(!options.rangeLow||(+options.rangeLow<+myMin))){options.rangeLow=myMin}if(myMax&&(!options.rangeHigh||(+options.rangeHigh>+myMax))){options.rangeHigh=myMax}opts={formElements:options.formElements,id:options.id,staticPos:!!(options.staticPos||options.nopopup),positioned:options.positioned&&document.getElementById(options.positioned)?options.positioned:"",rangeLow:options.rangeLow&&String(options.rangeLow).search(rangeRegExp)!=-1?options.rangeLow:"",rangeHigh:options.rangeHigh&&String(options.rangeHigh).search(rangeRegExp)!=-1?options.rangeHigh:"",statusFormat:options.statusFormat||statusFormat,noFadeEffect:!!(options.staticPos)?true:!!(options.noFadeEffect),dragDisabled:nodrag||!!(options.staticPos)?true:!!(options.dragDisabled),bespokeTabIndex:options.bespokeTabindex&&typeof options.bespokeTabindex=="number"?parseInt(options.bespokeTabindex,10):0,bespokeTitles:options.bespokeTitles||(bespokeTitles||{}),finalOpacity:options.finalOpacity&&typeof options.finalOpacity=="number"&&(options.finalOpacity>20&&options.finalOpacity<=100)?parseInt(+options.finalOpacity,10):(!!(options.staticPos)?100:finalOpacity),hideInput:!!(options.hideInput),noToday:!!(options.noTodayButton),showWeeks:!!(options.showWeeks),fillGrid:!!(options.fillGrid),constrainSelection:"constrainSelection" in options?!!(options.constrainSelection):true,cursorDate:options.cursorDate&&String(options.cursorDate).search(rangeRegExp)!=-1?options.cursorDate:"",labelledBy:findLabelForElement(elem),describedBy:(options.describedBy&&document.getElementById(options.describedBy))?options.describedBy:describedBy&&document.getElementById(describedBy)?describedBy:"",callbacks:options.callbackFunctions?options.callbackFunctions:{},highlightDays:options.highlightDays&&options.highlightDays.length&&options.highlightDays.length==7?options.highlightDays:[0,0,0,0,0,1,1],disabledDays:options.disabledDays&&options.disabledDays.length&&options.disabledDays.length==7?options.disabledDays:[0,0,0,0,0,0,0],bespokeClass:options.bespokeClass?" "+options.bespokeClass:""};datePickers[options.id]=new datePicker(opts);if("disabledDates" in options&&!(options.disabledDates===false)){datePickers[options.id].setDisabledDates(options.disabledDates)}if("enabledDates" in options&&!(options.enabledDates===false)){datePickers[options.id].setEnabledDates(options.enabledDates)}datePickers[options.id].callback("create",datePickers[options.id].createCbArgObj())};var isVisible=function(id){return(!id||!(id in datePickers))?false:datePickers[id].visible};var updateStatic=function(){var dp;for(dp in datePickers){if(datePickers.hasOwnProperty(dp)){datePickers[dp].changeHandler()}}};var testCSSAnimationSupport=function(){var domPrefixes="Webkit Moz ms O".split(" "),elm=document.createElement("div"),transitions={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",MSTransition:"msTransitionEnd",OTransition:"oTransitionEnd",transition:"transitionEnd"},t;for(t in transitions){if(elm.style[t]!==undefined){transitionEnd=transitions[t];break}}if(!transitionEnd){return false}if(elm.style.animationName){return true}for(var i=0;i20&&100>=+a&&(k=parseInt(a,10)),!0},bespoketitles:function(a){if("object"==typeof a){i={};for(var b in a)a.hasOwnProperty(b)&&-1!=String(b).match(H)&&(i[b]=String(a[b]))}return!0},dateparsefallback:function(a){return v=!!a,!0},languagefilelocation:function(a){return s=a,!0},_default:function(){if(b)throw"Unknown key located within JSON data: "+c;return!0}};for(c in a)a.hasOwnProperty(c)&&(f.hasOwnProperty(String(c).toLowerCase())&&f[String(c).toLowerCase()]||f._default)(a[c])}}function Q(a){if("string"!=typeof a||""==a)return{};try{if("object"==typeof JSON&&JSON.parse)return window.JSON.parse(a);if(/debug|lang|nodrag|buttontabindex|derivelocale|mousewheel|cellformat|titleformat|statusformat|describedby|finalopacity|bespoketitles|dateparsefallback/.test(a.toLowerCase())){var c=Function(["var document,top,self,window,parent,Number,Date,Object,Function,","Array,String,Math,RegExp,Image,ActiveXObject;","return (",a.replace(/<\!--.+-->/gim,"").replace(/\bfunction\b/g,"function-"),");"].join(""));return c()}}catch(d){}if(b)throw"Could not parse the JSON object";return{err:1}}function R(a){return c?(z=["%j"],w="%j %F %Y",void 0):(-1!=a.match(/%([d|j])/)&&(z=O(a,/%([d|j])/),w=a),void 0)}function S(a,b){return b=Math.min(4,b||2),"0000".substr(0,b-Math.min(String(a).length,b))+a}function T(a,b,c){a.addEventListener?a.addEventListener(b,c,!0):a.attachEvent&&a.attachEvent("on"+b,c)}function U(a,b,c){try{a.removeEventListener?a.removeEventListener(b,c,!0):a.detachEvent&&a.detachEvent("on"+b,c)}catch(d){}}function V(a){return a=a||document.parentWindow.event,a.stopPropagation&&(a.stopPropagation(),a.preventDefault()),J&&(a.cancelBubble=!0,a.returnValue=!1),!1}function W(a,b){a&&a.tagName&&a.setAttribute("role",b)}function X(a,b,c){a&&a.tagName&&a.setAttribute("aria-"+b,c)}function Y(a,b){a.setAttribute(J?"tabIndex":"tabindex",b),a.tabIndex=b}function Z(a){return a instanceof Date&&!isNaN(a)?a.getFullYear()+S(a.getMonth()+1)+""+S(a.getDate()):a}function $(a){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=100,this.finalOpacity=100,this.inUpdate=!1,this.kbEventsAdded=!1,this.fullCreate=!1,this.selectedTD=null,this.cursorTD=null,this.cursorDate=a.cursorDate?a.cursorDate:"",this.date=a.cursorDate?new Date(+a.cursorDate.substr(0,4),+a.cursorDate.substr(4,2)-1,+a.cursorDate.substr(6,2),5,0,0):new Date,this.defaults={},this.dynDisabledDates={},this.dateList=[],this.bespokeClass=a.bespokeClass,this.firstDayOfWeek=q.firstDayOfWeek,this.interval=new Date,this.clickActivated=!1,this.showCursor=!1,this.noFocus=!0,this.kbEvent=!1,this.delayedUpdate=!1,this.bespokeTitles={},this.bespokeTabIndex=a.bespokeTabIndex;for(var d in a)a.hasOwnProperty(d)&&-1==String(d).search(/^(callbacks|formElements|enabledDates|disabledDates)$/)&&(this[d]=a[d]);J&&(this.iePopUp=null);for(var g,e=0;g=["callbacks","formElements"][e];e++)if(this[g]={},g in a)for(d in a[g])a[g].hasOwnProperty(d)&&(this[g][d]=a[g][d]);this.date.setHours(5),this.changeHandler=function(){h.disabled||(h.setDateFromInput(),h.callback("dateset",h.createCbArgObj()))},this.createCbArgObj=function(){return this.dateSet?{id:this.id,date:this.dateSet,dd:S(this.date.getDate()),mm:S(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.getDateExceptions=function(a,b){b=S(b);var g,i,j,k,l,m,n,p,q,r,s,c={},d=h.firstDateShown,e=h.lastDateShown,f=h.dateList.length;for(e&&d||(d=h.firstDateShown=a+S(b)+"01",e=h.lastDateShown=a+S(b)+S(kb(b,a))),l=Number(d.substr(0,6)),m=Number(e.substr(0,6)),i=String(l);m>=+i;){for(j=i.substr(0,4),k=i.substr(4,2),g=0;f>g;g++)if(p=String(h.dateList[g].rLow).replace(/^(\*\*\*\*)/,j).replace(/^(\d\d\d\d)(\*\*)/,"$1"+k),q=String(h.dateList[g].rHigh).replace(/^(\*\*\*\*)/,j).replace(/^(\d\d\d\d)(\*\*)/,"$1"+k),1!=q){if(q>=p&&i>=p.substr(0,6)&&i<=q.substr(0,6))for(r=Math.max(p,Math.max(String(i)+"01",this.firstDateShown)),s=Math.min(q,Math.min(String(i)+"31",this.lastDateShown)),n=r;s>=n;n++)c[n]=h.dateList[g].type}else+p>=+h.firstDateShown&&+p<=+h.lastDateShown&&(c[p]=h.dateList[g].type);i=new Date(j,+k,2),i=i.getFullYear()+""+S(i.getMonth()+1)}return c},this.reposition=function(){if(h.created&&!h.staticPos){h.div.style.visibility="hidden",h.div.style.left=h.div.style.top="0px",h.div.style.display="block";var a=h.div.offsetHeight,b=h.div.offsetWidth,c=document.getElementById("fd-but-"+h.id),d=h.truePosition(c),e=document.compatMode&&"BackCompat"!=document.compatMode?document.documentElement:document.body,f=h.getScrollOffsets(),g=f[1],i=f[0],j=parseInt(d[1]-2)-parseInt(g),k=parseInt(e.clientHeight+g)-parseInt(d[1]+c.offsetHeight+2);h.div.style.visibility="visible",h.div.style.left=Number(parseInt(e.clientWidth+i)j?Math.abs(parseInt(d[1]+c.offsetHeight+2))+"px":Math.abs(parseInt(d[1]-(a+2)))+"px",6===J&&(h.iePopUp.style.top=h.div.style.top,h.iePopUp.style.left=h.div.style.left,h.iePopUp.style.width=b+"px",h.iePopUp.style.height=a-2+"px")}},this.removeCursorHighlight=function(){var a=document.getElementById(h.id+"-date-picker-hover");a&&M(a,"date-picker-hover")},this.addCursorHighlight=function(){var a=document.getElementById(h.id+"-date-picker-hover");a&&L(a,"date-picker-hover")},this.removeOldFocus=function(){var a=document.getElementById(h.id+"-date-picker-hover");if(a)try{Y(a,-1),M(a,"date-picker-hover"),a.id="",a.onblur=null,a.onfocus=null}catch(b){}},this.setNewFocus=function(){var a=document.getElementById(h.id+"-date-picker-hover");if(a)try{Y(a,0),this.showCursor&&L(a,"date-picker-hover"),this.clickActivated||(a.onblur=h.onblur,a.onfocus=h.onfocus),c||this.clickActivated||h.addAccessibleDate(),this.noFocus||this.clickActivated||setTimeout(function(){try{a.focus()}catch(b){}},0)}catch(b){}},this.addAccessibleDate=function(){var a=document.getElementById(h.id+"-date-picker-hover");if(a&&!a.getElementsByTagName("span").length){var e,b=a.className.match(/cd-([\d]{4})([\d]{2})([\d]{2})/),c=-1!=a.className.search(D),d=document.createElement("span");d.className="fd-screen-reader",K(a),c&&(e=d.cloneNode(!1),e.appendChild(document.createTextNode(hb(13))),a.appendChild(e));for(var g,f=0;g=z[f];f++)"%j"==g||"%d"==g?a.appendChild(document.createTextNode(nb(new Date(b[1],+b[2]-1,b[3],5,0,0),g,!0))):(e=d.cloneNode(!1),e.appendChild(document.createTextNode(nb(new Date(b[1],+b[2]-1,b[3],5,0,0),g,!0))),a.appendChild(e))}},this.setCursorDate=function(a){-1!=String(a).search(/^([0-9]{8})$/)&&(this.date=new Date(+a.substr(0,4),+a.substr(4,2)-1,+a.substr(6,2),5,0,0),this.cursorDate=a,this.staticPos&&this.updateTable())},this.updateTable=function(){if(h&&!h.inUpdate&&h.created){if(h.inUpdate=!0,h.removeOldFocus(),h.div.dir=q.rtl?"rtl":"ltr",h.timerSet&&!h.delayedUpdate)if(h.monthInc){var b=h.date.getDate(),c=new Date(h.date);c.setDate(2),c.setMonth(c.getMonth()+1*h.monthInc),c.setDate(Math.min(b,kb(c.getMonth(),c.getFullYear()))),h.date=new Date(c)}else h.date.setDate(Math.min(h.date.getDate()+h.dayInc,kb(h.date.getMonth()+h.monthInc,h.date.getFullYear()+h.yearInc))),h.date.setMonth(h.date.getMonth()+h.monthInc),h.date.setFullYear(h.date.getFullYear()+h.yearInc);h.outOfRange(),h.noToday||h.disableTodayButton(),h.showHideButtons(h.date);var d=h.date.getDate(),e=h.date.getMonth(),g=h.date.getFullYear(),i=String(g)+S(e+1)+S(d),j=new Date(g,e,1,5,0,0);j.setHours(5);var k,l,m,n,o,r,s,u,w,y,z,A,B,C=(j.getDay()+6)%7,D=(C-h.firstDayOfWeek+7)%7-1,E=kb(e,g),F=new Date,F=F.getFullYear()+S(F.getMonth()+1)+S(F.getDate()),G=String(j.getFullYear())+S(j.getMonth()+1),s=[4,4,4,4,4,4],H=new Date(g,e-1,1,5,0,0),I=new Date(g,e+1,1,5,0,0),J=kb(H.getMonth(),H.getFullYear()),L=String(I.getFullYear())+S(I.getMonth()+1),M=String(H.getFullYear())+S(H.getMonth()+1),N=(I.getDay()+6)%7,O=(H.getDay()+6)%7,P=document.createElement("span");P.className="fd-screen-reader",h.firstDateShown=!h.constrainSelection&&h.fillGrid&&1>0-D?String(M)+(J+(0-D)):G+"01",h.lastDateShown=!h.constrainSelection&&h.fillGrid?L+S(41-D-E):G+String(E),h.currentYYYYMM=G,w=h.callback("redraw",{id:h.id,dd:S(d),mm:S(e+1),yyyy:g,firstDateDisplayed:h.firstDateShown,lastDateDisplayed:h.lastDateShown})||{},l=h.getDateExceptions(g,e+1),h.checkSelectedDate(),z=null!=h.dateSet?h.dateSet.getFullYear()+S(h.dateSet.getMonth()+1)+S(h.dateSet.getDate()):!1,null!=this.selectedTD&&(X(this.selectedTD,"selected",!1),this.selectedTD=null);for(var Q=0;42>Q;Q++)n=Math.floor(Q/7),o=h.tds[Q],y=P.cloneNode(!1),K(o),Q>D&&D+E>=Q||h.fillGrid?(u=G,B=C,k=Q-D,m=[],A=!0,1>k?(k=J+k,u=M,B=O,A=!h.constrainSelection,m.push("month-out")):k>E&&(k-=E,u=L,B=N,A=!h.constrainSelection,m.push("month-out")),B=(B+k+6)%7,m.push("day-"+B+" cell-"+Q),r=u+String(10>k?"0":"")+k,h.rangeLow&&+r<+h.rangeLow||h.rangeHigh&&+r>+h.rangeHigh?(o.className="out-of-range",o.title="",o.appendChild(document.createTextNode(k)),h.showWeeks&&(s[n]=Math.min(s[n],2))):(A?(o.title=x?nb(new Date(+String(u).substr(0,4),+String(u).substr(4,2)-1,+k,5,0,0),x,!0):"",m.push("cd-"+r+" yyyymmdd-"+r+" yyyymm-"+u+" mmdd-"+u.substr(4,2)+S(k))):(o.title=x?hb(13)+" "+nb(new Date(+String(u).substr(0,4),+String(u).substr(4,2)-1,+k,5,0,0),x,!0):"",m.push("yyyymmdd-"+r+" yyyymm-"+u+" mmdd-"+u.substr(4,2)+S(k)+" not-selectable")),r==F&&m.push("date-picker-today"),z==r&&(m.push("date-picker-selected-date"),X(o,"selected","true"),this.selectedTD=o),(r in l&&1==l[r]||h.disabledDays[B]&&!(r in l&&0==l[r]))&&(m.push("day-disabled"),x&&A&&(o.title=hb(13)+" "+o.title)),r in w&&m.push(w[r]),h.highlightDays[B]&&m.push("date-picker-highlight"),i==r&&(o.id=h.id+"-date-picker-hover"),o.appendChild(document.createTextNode(k)),o.className=m.join(" "),h.showWeeks&&(s[n]=Math.min("month-out"==m[0]?3:1,s[n])))):(o.className="date-picker-unused",o.appendChild(document.createTextNode(f)),o.title=""),h.showWeeks&&6==Q-7*n&&(K(h.wkThs[n]),h.wkThs[n].appendChild(document.createTextNode(4!=s[n]||h.fillGrid?mb(g,e,Q-D-6):f)),h.wkThs[n].className="date-picker-week-header"+["",""," out-of-range"," month-out",""][s[n]]);var R=h.titleBar.getElementsByTagName("span");K(R[0]),K(R[1]),R[0].appendChild(document.createTextNode(jb(e,!1)+f)),R[1].appendChild(document.createTextNode(g)),h.timerSet&&(h.timerInc=50+Math.round((h.timerInc-50)/1.8),h.timer=window.setTimeout(h.updateTable,h.timerInc)),h.inUpdate=h.delayedUpdate=!1,h.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(U(this.table,"mousedown",h.onmousedown),U(this.table,"mouseover",h.onmouseover),U(this.table,"mouseout",h.onmouseout),U(document,"mousedown",h.onmousedown),U(document,"mouseup",h.clearTimer),window.addEventListener&&!window.devicePixelRatio)try{window.removeEventListener("DOMMouseScroll",this.onmousewheel,!1)}catch(a){}else U(document,"mousewheel",this.onmousewheel),U(window,"mousewheel",this.onmousewheel);if(h.removeOnFocusEvents(),clearTimeout(h.fadeTimer),clearTimeout(h.timer),6===J&&!h.staticPos)try{h.iePopUp.parentNode.removeChild(h.iePopUp),h.iePopUp=null}catch(a){}this.div&&this.div.parentNode&&this.div.parentNode.removeChild(this.div),h=null}},this.resizeInlineDiv=function(){h.div.style.width=h.table.offsetWidth+"px",h.div.style.height=h.table.offsetHeight+"px"},this.reset=function(){var a,b;for(a in h.formElements)b=document.getElementById(a),b&&("select"==b.tagName.toLowerCase()?b.selectedIndex=h.formElements[a.defaultVal]:b.value=h.formElements[a.defaultVal]);h.changeHandler()},this.create=function(){function j(a){var b=document.createElement("th");return a.thClassName&&(b.className=a.thClassName),a.colspan&&b.setAttribute(J?"colSpan":"colspan",a.colspan),b.unselectable="on",b}function k(a,b){for(var d,c=0;d=b[c];c++){var e=j(d);a.appendChild(e);var f=document.createElement("span");f.className=d.className,f.id=h.id+d.id,f.appendChild(document.createTextNode(d.text||h.nbsp)),f.title=d.title||"",f.unselectable="on",e.appendChild(f)}}if(!document.getElementById("fd-"+this.id)){var a,c,d,e,g,i;this.noFocus=!0,this.div=document.createElement("div"),this.div.id="fd-"+this.id,this.div.className="date-picker"+(l?" fd-dp-fade ":"")+this.bespokeClass,this.div.style.visibility="hidden",this.div.style.display="none",this.describedBy&&document.getElementById(this.describedBy)&&X(this.div,"describedby",this.describedBy),this.labelledBy&&X(this.div,"labelledby",this.labelledBy.id),this.idiv=document.createElement("div"),this.table=document.createElement("table"),this.table.className="date-picker-table",this.table.onmouseover=this.onmouseover,this.table.onmouseout=this.onmouseout,this.table.onclick=this.onclick,this.finalOpacity<100&&(this.idiv.style.opacity=Math.min(Math.max(parseInt(this.finalOpacity,10)/100,.2),1)),this.staticPos&&(this.table.onmousedown=this.onmousedown),this.div.appendChild(this.idiv),this.idiv.appendChild(this.table);var m=this.dragDisabled?"":" drag-enabled";if(this.staticPos){var n=document.getElementById(this.positioned?this.positioned:this.id);if(!n){if(this.div=null,b)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?n.appendChild(this.div):n.parentNode.insertBefore(this.div,n.nextSibling),this.hideInput)for(var o in this.formElements)n=document.getElementById(o),n&&(n.className+=" fd-hidden-input");setTimeout(this.resizeInlineDiv,300)}else this.div.style.visibility="hidden",this.div.className+=m,document.getElementsByTagName("body")[0].appendChild(this.div),6===J&&(this.iePopUp=document.createElement("iframe"),this.iePopUp.src="javascript:'';",this.iePopUp.setAttribute("className","iehack"),this.iePopUp.setAttribute("tabIndex",-1),W(this.iePopUp,"presentation"),X(this.iePopUp,"hidden","true"),this.iePopUp.scrolling="no",this.iePopUp.frameBorder="0",this.iePopUp.name=this.iePopUp.id=this.id+"-iePopUpHack",document.body.appendChild(this.iePopUp)),X(this.div,"hidden","true");W(this.div,"application"),this.statusFormat&&(i=document.createElement("tfoot"),this.table.appendChild(i),a=document.createElement("tr"),a.className="date-picker-tfoot",i.appendChild(a),this.statusBar=j({thClassName:"date-picker-statusbar"+m,colspan:this.showWeeks?8:7}),a.appendChild(this.statusBar),this.updateStatus()),e=document.createElement("thead"),e.className="date-picker-thead",this.table.appendChild(e),a=document.createElement("tr"),W(a,"presentation"),e.appendChild(a),this.titleBar=j({thClassName:"date-picker-title"+m,colspan:this.showWeeks?8:7}),a.appendChild(this.titleBar),a=null;var p=document.createElement("span");p.appendChild(document.createTextNode(f)),p.className="month-display"+m,this.titleBar.appendChild(p),p=document.createElement("span"),p.appendChild(document.createTextNode(f)),p.className="year-display"+m,this.titleBar.appendChild(p),p=null,a=document.createElement("tr"),W(a,"presentation"),e.appendChild(a),k(a,[{className:"prev-but prev-year",id:"-prev-year-but",text:"\xab",title:hb(2)},{className:"prev-but prev-month",id:"-prev-month-but",text:"\u2039",title:hb(0)},{colspan:this.showWeeks?4:3,className:"today-but",id:"-today-but",text:hb(4)},{className:"next-but next-month",id:"-next-month-but",text:"\u203a",title:hb(1)},{className:"next-but next-year",id:"-next-year-but",text:"\xbb",title:hb(3)}]),g=document.createElement("tbody"),this.table.appendChild(g);for(var s,q=this.showWeeks?8:7,r=this.showWeeks?0:-1,w=0;7>w;w++){c=document.createElement("tr"),0!=w?(W(c,"row"),g.appendChild(c)):e.appendChild(c);for(var x=0;q>x;x++)0===w||this.showWeeks&&0===x?d=document.createElement("th"):(d=document.createElement("td"),X(d,"describedby",this.id+"-col-"+x+(this.showWeeks?" "+this.id+"-row-"+w:"")),X(d,"selected","false")),J&&(d.unselectable="on"),c.appendChild(d),this.showWeeks&&x>0&&w>0||!this.showWeeks&&w>0||(0===w&&x>r?(d.className="date-picker-day-header",d.scope="col",d.id=this.id+"-col-"+x):(d.className="date-picker-week-header",d.scope="row",d.id=this.id+"-row-"+w))}d=c=null,this.ths=this.table.getElementsByTagName("thead")[0].getElementsByTagName("tr")[2].getElementsByTagName("th");for(var y=0;q>y;y++)0==y&&this.showWeeks?(this.ths[y].appendChild(document.createTextNode(hb(6))),this.ths[y].title=hb(8)):y>(this.showWeeks?0:-1)&&(s=document.createElement("span"),s.className="fd-day-header",J&&(s.unselectable="on"),this.ths[y].appendChild(s));s=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"),g=e=a=k=j=null,this.updateTableHeaders(),this.created=!0,this.updateTable(),this.staticPos?(this.visible=!0,this.opacity=100,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.transEnd=function(){h.div.style.display="none",h.div.style.visibility="hidden",X(h.div,"hidden","true")},this.fade=function(){if(window.clearTimeout(h.fadeTimer),h.fadeTimer=null,l)return h.opacity=h.opacityTo,0==h.opacityTo?(h.visible=!1,T(h.div,m,h.transEnd),L(h.div,"fd-dp-fade")):(U(h.div,m,h.transEnd),h.visible=!0,h.div.style.display="block",h.div.style.visibility="visible",X(h.div,"hidden","false"),M(h.div,"fd-dp-fade")),void 0;var a=Math.round(h.opacity+(h.opacityTo-h.opacity)/4);h.setOpacity(a),Math.abs(h.opacityTo-a)>3&&!h.noFadeEffect?h.fadeTimer=window.setTimeout(h.fade,50):(h.setOpacity(h.opacityTo),0==h.opacityTo?(h.div.style.display="none",h.div.style.visibility="hidden",X(h.div,"hidden","true"),h.visible=!1):(X(h.div,"hidden","false"),h.visible=!0))},this.trackDrag=function(a){a=a||window.event;var b=(a.pageX?a.pageX:a.clientX?a.clientX:a.x)-h.mx,c=(a.pageY?a.pageY:a.clientY?a.clientY:a.Y)-h.my;h.div.style.left=Math.round(h.x+b)>0?Math.round(h.x+b)+"px":"0px",h.div.style.top=Math.round(h.y+c)>0?Math.round(h.y+c)+"px":"0px",6!==J||h.staticPos||(h.iePopUp.style.top=h.div.style.top,h.iePopUp.style.left=h.div.style.left)},this.stopDrag=function(){var b=document.getElementsByTagName("body")[0];M(b,"fd-drag-active"),U(document,"mousemove",h.trackDrag,!1),U(document,"mouseup",h.stopDrag,!1),h.div.style.zIndex=9999},this.onmousedown=function(a){a=a||document.parentWindow.event;var b=null!=a.target?a.target:a.srcElement,c=b,d=!0,e=new RegExp("^fd-(but-)?"+h.id+"$");for(h.mouseDownElem=null;b;){if(b.id&&b.id.length&&-1!=b.id.search(e)){d=!1;break}try{b=b.parentNode}catch(f){break}}if(d)return cb(),!0;if(-1!=(h.div.className+c.className).search("fd-disabled"))return!0;if(-1!=c.id.search(new RegExp("^"+h.id+"(-prev-year-but|-prev-month-but|-next-month-but|-next-year-but)$"))){h.mouseDownElem=c,T(document,"mouseup",h.clearTimer),T(c,"mouseout",h.clearTimer);var g={"-prev-year-but":[0,-1,0],"-prev-month-but":[0,0,-1],"-next-year-but":[0,1,0],"-next-month-but":[0,0,1]},i=c.id.replace(h.id,""),j=Number(h.date.getFullYear()+S(h.date.getMonth()+1));h.timerInc=800,h.timerSet=!0,h.dayInc=g[i][0],h.yearInc=g[i][1],h.monthInc=g[i][2],h.accellerator=1,h.currentYYYYMM!=j&&(h.currentYYYYMMj&&(1==h.yearInc||1==h.monthInc)?(h.delayedUpdate=!1,h.timerInc=1200):h.delayedUpdate=!0),h.updateTable();var k={unit:h.yearInc?"year":"month",mm:parseInt(h.date.getMonth())+1,yyyy:h.date.getFullYear()};return h.callback("paging",k),V(a)}return-1!=b.className.search("drag-enabled")?(h.mx=a.pageX?a.pageX:a.clientX?a.clientX:a.x,h.my=a.pageY?a.pageY:a.clientY?a.clientY:a.Y,h.x=parseInt(h.div.style.left,10),h.y=parseInt(h.div.style.top,10),T(document,"mousemove",h.trackDrag,!1),T(document,"mouseup",h.stopDrag,!1),L(document.getElementsByTagName("body")[0],"fd-drag-active"),h.div.style.zIndex=1e4,V(a)):!0},this.onclick=function(a){if(!l&&h.opacity!=h.opacityTo||h.disabled)return V(a);a=a||document.parentWindow.event;for(var b=null!=a.target?a.target:a.srcElement;b.parentNode;){if(b.tagName&&"td"==b.tagName.toLowerCase()){if(-1==b.className.search(/cd-([0-9]{8})/)||-1!=b.className.search(D))return V(a);var c=b.className.match(/cd-([0-9]{8})/)[1];h.date=new Date(c.substr(0,4),c.substr(4,2)-1,c.substr(6,2),5,0,0),h.dateSet=new Date(h.date),h.noFocus=!0,h.callback("dateset",{id:h.id,date:h.dateSet,dd:h.dateSet.getDate(),mm:h.dateSet.getMonth()+1,yyyy:h.dateSet.getFullYear()}),h.returnFormattedDate(),h.hide(),h.stopTimer();break}if(b.id&&b.id==h.id+"-today-but"){h.date=new Date,h.updateTable(),h.stopTimer();break}if(-1!=b.className.search(/date-picker-day-header/)){for(var d=h.showWeeks?-1:0,e=b;e.previousSibling;)e=e.previousSibling,e.tagName&&"th"==e.tagName.toLowerCase()&&d++;h.firstDayOfWeek=(h.firstDayOfWeek+d)%7,h.updateTableHeaders();break}try{b=b.parentNode}catch(f){break}}return V(a)},this.show=function(a){if(!this.staticPos){var b,c;for(c in this.formElements)if(b=document.getElementById(this.id),!b||b&&b.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=!a,this.noFocus?(this.clickActivated=!0,this.showCursor=!1,T(document,"mousedown",this.onmousedown),o&&(window.addEventListener&&!window.devicePixelRatio?window.addEventListener("DOMMouseScroll",this.onmousewheel,!1):(T(document,"mousewheel",this.onmousewheel),T(window,"mousewheel",this.onmousewheel)))):(this.clickActivated=!1,this.showCursor=!0),this.opacityTo=100,this.div.style.display="block",6===J&&(this.iePopUp.style.width=this.div.offsetWidth+"px",this.iePopUp.style.height=this.div.offsetHeight+"px",this.iePopUp.style.display="block"),this.setNewFocus(),this.fade();var d=document.getElementById("fd-but-"+this.id);d&&L(d,"date-picker-button-active")}},this.hide=function(){if(this.visible&&this.created&&document.getElementById("fd-"+this.id)&&(this.kbEvent=!1,M(h.div,"date-picker-focus"),this.stopTimer(),this.removeOnFocusEvents(),this.clickActivated=!1,this.noFocus=!0,this.showCursor=!1,this.setNewFocus(),!this.staticPos)){this.statusBar&&this.updateStatus(hb(9));var a=document.getElementById("fd-but-"+this.id);if(a&&M(a,"date-picker-button-active"),U(document,"mousedown",this.onmousedown),o)if(window.addEventListener&&!window.devicePixelRatio)try{window.removeEventListener("DOMMouseScroll",this.onmousewheel,!1)}catch(b){}else U(document,"mousewheel",this.onmousewheel),U(window,"mousewheel",this.onmousewheel);6===J&&(this.iePopUp.style.display="none"),this.opacityTo=0,this.fade()}},this.onblur=function(){h.removeCursorHighlight(),h.hide()},this.onfocus=function(){h.noFocus=!1,L(h.div,"date-picker-focus"),h.statusBar&&h.updateStatus(nb(h.date,h.statusFormat,!0)),h.showCursor=!0,h.addCursorHighlight(),h.addOnFocusEvents()},this.onmousewheel=function(a){a=a||document.parentWindow.event;var b=0;a.wheelDelta?(b=a.wheelDelta/120,c&&window.opera.version()<9.2&&(b=-b)):a.detail&&(b=-a.detail/3);var d=h.date.getDate(),e=new Date(h.date),f=b>0?1:-1;return e.setDate(2),e.setMonth(e.getMonth()+1*f),e.setDate(Math.min(d,kb(e.getMonth(),e.getFullYear()))),h.outOfRange(e)?V(a):(h.date=new Date(e),h.updateTable(),h.statusBar&&h.updateStatus(nb(h.date,h.statusFormat,!0)),V(a))},this.onkeydown=function(a){if(h.stopTimer(),!h.visible)return!1;a=a||document.parentWindow.event;var b=a.keyCode?a.keyCode:a.charCode;if(13==b){var c=document.getElementById(h.id+"-date-picker-hover");return c&&-1!=c.className.search(/cd-([0-9]{8})/)&&-1==c.className.search(/out-of-range|day-disabled/)?(h.dateSet=new Date(h.date),h.callback("dateset",h.createCbArgObj()),h.returnFormattedDate(),h.hide(),V(a)):V(a)}if(27==b){if(!h.staticPos){h.hide();var d=document.getElementById("fd-but-"+h.id);return d&&setTimeout(function(){try{d.focus()}catch(a){}},0),V(a)}return!0}if(32==b||0==b)return h.date=new Date,h.updateTable(),V(a);if(9==b)return h.staticPos?!0:V(a);if(J){if((new Date).getTime()-h.interval.getTime()<50)return V(a);h.interval=new Date}if(b>49&&56>b||b>97&&104>b)return b>96&&(b-=48),b-=49,h.firstDayOfWeek=(h.firstDayOfWeek+b)%7,h.updateTableHeaders(),V(a);if(33>b||b>40)return!0;var e=new Date(h.date);if(h.date.getFullYear()+S(h.date.getMonth()+1),36==b)e.setDate(1);else if(35==b)e.setDate(kb(e.getMonth(),e.getFullYear()));else if(33==b||34==b){var i=34==b?1:-1;if(a.ctrlKey)e.setFullYear(e.getFullYear()+1*i);else{var j=h.date.getDate();e.setDate(2),e.setMonth(e.getMonth()+1*i),e.setDate(Math.min(j,kb(e.getMonth(),e.getFullYear())))}}else 37==b?e=new Date(h.date.getFullYear(),h.date.getMonth(),h.date.getDate()-1,5,0,0):39==b||34==b?e=new Date(h.date.getFullYear(),h.date.getMonth(),h.date.getDate()+1,5,0,0):38==b?e=new Date(h.date.getFullYear(),h.date.getMonth(),h.date.getDate()-7,5,0,0):40==b&&(e=new Date(h.date.getFullYear(),h.date.getMonth(),h.date.getDate()+7,5,0,0));if(h.outOfRange(e))return V(a);h.date=e,h.statusBar&&h.updateStatus(h.getBespokeTitle(h.date.getFullYear(),h.date.getMonth()+1,h.date.getDate())||nb(h.date,h.statusFormat,!0));var k=String(h.date.getFullYear())+S(h.date.getMonth()+1)+S(h.date.getDate());if(a.ctrlKey||33==b||34==b||kh.lastDateShown)h.updateTable(),J&&(h.interval=new Date);else{h.noToday||h.disableTodayButton(),h.removeOldFocus(),h.showHideButtons(h.date);for(var c,l=0;c=h.tds[l];l++)if(-1!=c.className.search("cd-"+k)){c.id=h.id+"-date-picker-hover",h.setNewFocus();break}}return V(a)},this.onmouseout=function(a){a=a||document.parentWindow.event;for(var b=a.toElement||a.relatedTarget;b&&b!=this;)try{b=b.parentNode}catch(a){b=this}return b==this?!1:((h.clickActivated||h.staticPos&&!h.kbEventsAdded)&&(h.showCursor=!1,h.removeCursorHighlight()),h.currentTR&&(h.currentTR.className="",h.currentTR=null),h.statusBar&&h.updateStatus(h.dateSet?h.getBespokeTitle(h.dateSet.getFullYear(),h.dateSet.getMonth()+1,h.dateSet.getDate())||nb(h.dateSet,h.statusFormat,!0):hb(9)),void 0)},this.onmouseover=function(a){a=a||document.parentWindow.event;for(var b=null!=a.target?a.target:a.srcElement;1!=b.nodeType;)b=b.parentNode;if(b&&b.tagName){h.noFocus=!0;var c=hb(9);switch((h.clickActivated||h.staticPos&&!h.kbEventsAdded)&&(h.showCursor=!1),b.tagName.toLowerCase()){case"td":if(-1!=b.className.search(/date-picker-unused|out-of-range/)&&(c=hb(9)),-1!=b.className.search(/cd-([0-9]{8})/)){h.showCursor=!0,h.stopTimer();var d=b.className.match(/cd-([0-9]{8})/)[1];h.removeOldFocus(),b.id=h.id+"-date-picker-hover",h.setNewFocus(),h.date=new Date(+d.substr(0,4),+d.substr(4,2)-1,+d.substr(6,2),5,0,0),h.noToday||h.disableTodayButton(),c=h.getBespokeTitle(+d.substr(0,4),+d.substr(4,2),+d.substr(6,2))||nb(h.date,h.statusFormat,!0)}break;case"th":if(!h.statusBar)break;if(-1!=b.className.search(/drag-enabled/))c=hb(10);else if(-1!=b.className.search(/date-picker-week-header/)){var e=b.firstChild?b.firstChild.nodeValue:"";c=-1!=e.search(/^(\d+)$/)?hb(7,[e,3>e&&11==h.date.getMonth()?lb(h.date.getFullYear())+1:lb(h.date.getFullYear())]):hb(9)}break;case"span":if(!h.statusBar)break;if(-1!=b.className.search(/day-([0-6])/)){var f=b.className.match(/day-([0-6])/)[1];c=hb(11,[ib(f,!1)])}else-1!=b.className.search(/(drag-enabled|today-but|prev-(year|month)|next-(year|month))/)&&-1==b.className.search(/disabled/)&&(c=hb({"drag-enabled":10,"prev-year":2,"prev-month":0,"next-year":3,"next-month":1,"today-but":12}[b.className.match(/(drag-enabled|today-but|prev-(year|month)|next-(year|month))/)[0]]));break;default:c=""}for(;b.parentNode;)if(b=b.parentNode,1==b.nodeType&&"tr"==b.tagName.toLowerCase()){if(h.currentTR){if(b==h.currentTR)break;h.currentTR.className=""}b.className="dp-row-highlight",h.currentTR=b;break}h.statusBar&&c&&h.updateStatus(c),h.showCursor||h.removeCursorHighlight()}},this.clearTimer=function(){h.stopTimer(),h.timerInc=800,h.yearInc=0,h.monthInc=0,h.dayInc=0,U(document,"mouseup",h.clearTimer),null!=h.mouseDownElem&&U(h.mouseDownElem,"mouseout",h.clearTimer),h.mouseDownElem=null};var h=this;this.setDateFromInput(),this.staticPos?this.create():this.createButton(),function(){var a,b,c=0;for(a in h.formElements)b=document.getElementById(a),b&&b.tagName&&-1!=b.tagName.search(/select|input/i)&&(T(b,"change",h.changeHandler),0==c&&b.form&&T(b.form,"reset",h.reset),c++),b&&1!=b.disabled||h.disableDatePicker()}(),this.fullCreate=!0}var b=!1,c="[object Opera]"===Object.prototype.toString.call(window.opera),d="",e=N(),f=String.fromCharCode(160),g={},h={},i={},k=100,l=null,m="",n=!0,o=!0,p=!0,q=!1,r=!1,s=!1,t=!1,v=!0,w="%d %F %Y",x="%F %d, %Y",y="",z=c?["%j"]:["%j"," %F %Y"],A=/%([d|j])/,B=/%([M|F|m|n])/,C=/%[y|Y]/,D=/date-picker-unused|out-of-range|day-disabled|not-selectable/,E=/%([d|j|M|F|m|n|Y|y])/,F=/%([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|y])/,G=/^((\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01]))$/,H=/^(((\d\d\d\d)|(\*\*\*\*))((0[1-9]|1[012])|(\*\*))(0[1-9]|[12][0-9]|3[01]))$/,I=" \n \f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",J=function(){for(var a,b=3,c=document.createElement("div"),d=c.getElementsByTagName("i");c.innerHTML="",d[0];);return b>4?b:a}();!function(){var a=document.getElementsByTagName("script"),b=Q(String(a[a.length-1].innerHTML).replace(/[\n\r\s\t]+/g," ").replace(/^\s+/,"").replace(/\s+$/,""));if("object"!=typeof b||"err"in b||P(b),p&&"object"!=typeof fdLocale){var f,g,c=document.getElementsByTagName("head")[0]||document.documentElement,d=s?s:a[a.length-1].src.substr(0,a[a.length-1].src.lastIndexOf("/"))+"/lang/"; +for(g=0;gJ){var h=document.getElementsByTagName("base");h.length&&h[0].childNodes.length?h[0].appendChild(f):c.appendChild(f),h=null}else c.appendChild(f);f=null}else t=!0}();var O=function(a,b,c){if("[object RegExp]"!==Object.prototype.toString.call(b))return O._nativeSplit.call(a,b,c);var g,h,i,j,d=[],e=0,f="",b=RegExp(b.source,"g");if(a+="",O._compliantExecNpcg||(g=RegExp("^"+b.source+"$(?!\\s)",f)),void 0===c||0>+c)c=1/0;else if(c=Math.floor(+c),!c)return[];for(;(h=b.exec(a))&&(i=h.index+h[0].length,!(i>e&&(d.push(a.slice(e,h.index)),!O._compliantExecNpcg&&h.length>1&&h[0].replace(g,function(){for(var a=1;a1&&h.index=c)));)b.lastIndex===h.index&&b.lastIndex++;return e===a.length?(j||!b.test(""))&&d.push(""):d.push(a.slice(e)),d.length>c?d.slice(0,c):d};O._compliantExecNpcg=void 0===/()??/.exec("")[1],O._nativeSplit=String.prototype.split,$.prototype.addButtonEvents=function(a){function b(a){a=a||window.event;var b=this.id.replace("fd-but-",""),c=ub(b),d=!1,e=g[b].kbEvent;if(e)return g[b].kbEvent=!1,void 0;if("keydown"==a.type){var f=null!=a.keyCode?a.keyCode:a.charCode;if(13!=f)return!0;if(g[b].kbEvent=!0,c)return M(this,"date-picker-button-active"),cb(),V(a);d=!0}else g[b].kbEvent=!1;return c?(M(this,"date-picker-button-active"),cb()):(L(this,"date-picker-button-active"),cb(b),eb(b,d)),V(a)}a.onclick=b,a.onkeydown=b,n?Y(a,this.bespokeTabIndex):Y(a,-1)},$.prototype.createButton=function(){if(!this.staticPos&&!document.getElementById("fd-but-"+this.id)){var a=document.getElementById(this.id),b=document.createElement("span"),c=document.createElement("a");c.href="#"+this.id,c.className="date-picker-control",c.title=hb(5),c.id="fd-but-"+this.id,b.appendChild(document.createTextNode(f)),c.appendChild(b),b=document.createElement("span"),b.className="fd-screen-reader",b.appendChild(document.createTextNode(c.title)),c.appendChild(b),W(c,"button"),X(c,"haspopup",!0),this.positioned&&document.getElementById(this.positioned)?document.getElementById(this.positioned).appendChild(c):a.parentNode.insertBefore(c,a.nextSibling),this.addButtonEvents(c),c=null,this.callback("dombuttoncreate",{id:this.id})}},$.prototype.setBespokeTitles=function(a){this.bespokeTitles={},this.addBespokeTitles(a)},$.prototype.addBespokeTitles=function(a){for(var b in a)a.hasOwnProperty(b)&&(this.bespokeTitles[b]=a[b])},$.prototype.getBespokeTitle=function(a,b,c){var d,e,f=a+String(S(b))+S(c);for(d in this.bespokeTitles)if(this.bespokeTitles.hasOwnProperty(d)&&(e=String(d).replace(/^(\*\*\*\*)/,a).replace(/^(\d\d\d\d)(\*\*)/,"$1"+S(b)),e==f))return this.bespokeTitles[d];for(d in i)if(i.hasOwnProperty(d)&&(e=String(d).replace(/^(\*\*\*\*)/,a).replace(/^(\d\d\d\d)(\*\*)/,"$1"+S(b)),e==f))return i[d];return!1},$.prototype.returnSelectedDate=function(){return this.dateSet},$.prototype.setRangeLow=function(a){if(-1==String(a).search(G)){if(b)throw"Invalid value passed to setRangeLow method: "+a;return!1}this.rangeLow=a,this.inUpdate||this.setDateFromInput()},$.prototype.setRangeHigh=function(a){if(-1==String(a).search(G)){if(b)throw"Invalid value passed to setRangeHigh method: "+a;return!1}this.rangeHigh=a,this.inUpdate||this.setDateFromInput()},$.prototype.setDisabledDays=function(a){if(!a.length||-1==a.join("").search(/^([0|1]{7})$/)){if(b)throw"Invalid values located when attempting to call setDisabledDays";return!1}this.disabledDays=a,this.inUpdate||this.setDateFromInput()},$.prototype.setDisabledDates=function(a){this.filterDateList(a,!0)},$.prototype.setEnabledDates=function(a){this.filterDateList(a,!1)},$.prototype.addDisabledDates=function(a){this.addDatesToList(a,!0)},$.prototype.addEnabledDates=function(a){this.addDatesToList(a,!1)},$.prototype.filterDateList=function(a,b){for(var c=[],d=0;dNumber(String(a[c]).replace(/^\*\*\*\*/,2010).replace(/^(\d\d\d\d)(\*\*)/,"$122")))continue;this.dateList.push({type:!!b,rLow:c,rHigh:a[c]})}this.inUpdate||this.setDateFromInput()},$.prototype.setSelectedDate=function(a){if(-1==String(a).search(H))return!1;var b=a.match(G),c=new Date(+b[2],+b[3]-1,+b[4],5,0,0);return c&&!isNaN(c)&&this.canDateBeSelected(c)?(this.dateSet=new Date(c),this.inUpdate||this.updateTable(),this.callback("dateset",this.createCbArgObj()),this.returnFormattedDate(),void 0):!1},$.prototype.checkSelectedDate=function(){this.dateSet&&!this.canDateBeSelected(this.dateSet)&&(this.dateSet=null),this.inUpdate||this.updateTable()},$.prototype.addOnFocusEvents=function(){this.kbEventsAdded||this.noFocus||(T(document,"keypress",this.onkeydown),T(document,"mousedown",this.onmousedown),J&&(U(document,"keypress",this.onkeydown),T(document,"keydown",this.onkeydown)),window.devicePixelRatio&&(U(document,"keypress",this.onkeydown),T(document,"keydown",this.onkeydown)),this.noFocus=!1,this.kbEventsAdded=!0)},$.prototype.removeOnFocusEvents=function(){this.kbEventsAdded&&(U(document,"keypress",this.onkeydown),U(document,"keydown",this.onkeydown),U(document,"mousedown",this.onmousedown),this.kbEventsAdded=!1)},$.prototype.stopTimer=function(){this.timerSet=!1,window.clearTimeout(this.timer)},$.prototype.setOpacity=function(a){this.div.style.opacity=a/100,this.div.style.filter="alpha(opacity="+a+")",this.opacity=a},$.prototype.truePosition=function(a){var b=this.cumulativeOffset(a);if(c)return b;var d=document.compatMode&&"BackCompat"!=document.compatMode?document.documentElement:document.body,e=document.all?d.scrollLeft:window.pageXOffset,f=document.all?d.scrollTop:window.pageYOffset,g=this.realOffset(a);return[b[0]-g[0]+e,b[1]-g[1]+f]},$.prototype.realOffset=function(a){var b=0,c=0;do b+=a.scrollTop||0,c+=a.scrollLeft||0,a=a.parentNode;while(a);return[c,b]},$.prototype.cumulativeOffset=function(a){var b=0,c=0;do b+=a.offsetTop||0,c+=a.offsetLeft||0,a=a.offsetParent;while(a);return[c,b]},$.prototype.outOfRange=function(a){if(!this.rangeLow&&!this.rangeHigh)return!1;var b=!1;a||(b=!0,a=this.date);var c=S(a.getDate()),d=S(a.getMonth()+1),e=a.getFullYear(),f=String(e)+String(d)+String(c);if(this.rangeLow&&+f<+this.rangeLow)return b?(this.date=new Date(this.rangeLow.substr(0,4),this.rangeLow.substr(4,2)-1,this.rangeLow.substr(6,2),5,0,0),!1):!0;if(this.rangeHigh&&+f>+this.rangeHigh){if(!b)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},$.prototype.canDateBeSelected=function(a){if(!a||isNaN(a))return!1;var b=S(a.getDate()),c=S(a.getMonth()+1),d=a.getFullYear(),e=d+""+c+b,f=this.getDateExceptions(d,c),g=0==a.getDay()?7:a.getDay();return this.rangeLow&&+e<+this.rangeLow||this.rangeHigh&&+e>+this.rangeHigh||e in f&&1==f[e]||this.disabledDays[g-1]&&(!(e in f)||e in f&&1==f[e])?!1:!0},$.prototype.updateStatus=function(a){if(K(this.statusBar),a&&-1!=this.statusFormat.search(/%S/)&&-1!=a.search(/([0-9]{1,2})(st|nd|rd|th)/)){a=O(a.replace(/([0-9]{1,2})(st|nd|rd|th)/,"$1$2"),/|<\/sup>/);for(var d,b=document.createDocumentFragment(),c=0;d=a[c];c++)if(/^(st|nd|rd|th)$/.test(d)){var e=document.createElement("sup");e.appendChild(document.createTextNode(d)),b.appendChild(e)}else b.appendChild(document.createTextNode(d));this.statusBar.appendChild(b)}else this.statusBar.appendChild(document.createTextNode(a?a:hb(9)))},$.prototype.setDateFromInput=function(){var i,j,k,l,m,n,o,p,r,s,t,b=(this.dateSet,!1),c=this.staticPos?!1:document.getElementById("fd-but-"+this.id),d=q.imported?[].concat(_.fullMonths).concat(_.monthAbbrs):[],e=q.imported?[].concat(q.fullMonths).concat(q.monthAbbrs):[],f=/(3[01]|[12][0-9]|0?[1-9])(st|nd|rd|th)/i,g=0,h=!1;this.dateSet=null;for(k in this.formElements){if(l=document.getElementById(k),!l)return!1;if(g++,p=String(l.value))for(m=this.formElements[k],i=[m],h=!1,r=-1!=m.search(A),s=-1!=m.search(B),t=-1!=m.search(C),r&&s&&t||(!t||s||r?!s||t||r?!r||t||s||(i=i.concat(["%d%","%j"])):i=i.concat(["%M","%F","%m","%n"]):i=i.concat(["%Y","%y"])),j=0;jkb(+b-1,+o)?(n=kb(+b-1,+o),h=!1):h=new Date(+o,+b-1,+n,5,0,0)),c&&M(c,"date-picker-dateval"),!h||isNaN(h)){var u=new Date(o||(new Date).getFullYear(),b!==!1?b-1:(new Date).getMonth(),1,5,0,0);return this.date=this.cursorDate?new Date(+this.cursorDate.substr(0,4),+this.cursorDate.substr(4,2)-1,+this.cursorDate.substr(6,2),5,0,0):new Date(u.getFullYear(),u.getMonth(),Math.min(+n||(new Date).getDate(),kb(u.getMonth(),u.getFullYear())),5,0,0),this.outOfRange(),this.fullCreate&&this.updateTable(),void 0}h.setHours(5),this.date=new Date(h),this.outOfRange(),h.getTime()==this.date.getTime()&&this.canDateBeSelected(this.date)&&(this.dateSet=new Date(this.date),c&&L(c,"date-picker-dateval"),this.returnFormattedDate(!0)),this.fullCreate&&this.updateTable()},$.prototype.setSelectIndex=function(a,b){for(var c=a.options.length-1;c>=0;c--)if(a.options[c].value==b)return a.selectedIndex=c,void 0},$.prototype.returnFormattedDate=function(a){var b=this.staticPos?!1:document.getElementById("fd-but-"+this.id);if(!this.dateSet)return b&&M(b,"date-picker-dateval"),void 0;var g,h,i,j,f=(S(this.dateSet.getDate()),S(this.dateSet.getMonth()+1),this.dateSet.getFullYear(),!1);a=!!a;for(g in this.formElements){if(h=document.getElementById(g),!h)return;f||(f=h),i=this.formElements[g],j=nb(this.dateSet,i,t),"input"==h.tagName.toLowerCase()?h.value=j:this.setSelectIndex(h,j)}if(this.staticPos?(this.noFocus=!0,this.updateTable(),this.noFocus=!1):b&&L(b,"date-picker-dateval"),this.fullCreate&&f.type&&"hidden"!=f.type&&!a)try{f.focus()}catch(k){}a||this.callback("datereturned",this.createCbArgObj())},$.prototype.disableDatePicker=function(){if(!this.disabled){if(this.staticPos)this.removeOnFocusEvents(),this.removeOldFocus(),this.noFocus=!0,L(this.div,"date-picker-disabled"),this.table.onmouseover=this.table.onclick=this.table.onmouseout=this.table.onmousedown=null,U(document,"mousedown",this.onmousedown),U(document,"mouseup",this.clearTimer);else{this.visible&&this.hide();var a=document.getElementById("fd-but-"+this.id);a&&(L(a,"date-picker-control-disabled"),X(a,"disabled",!0),a.onkeydown=a.onclick=function(){return!1},Y(a,-1),a.title="")}clearTimeout(this.timer),this.disabled=!0}},$.prototype.enableDatePicker=function(){if(this.disabled){if(this.staticPos)this.removeOldFocus(),null!=this.dateSet&&(this.date=this.dateSet),this.noFocus=!0,this.updateTable(),M(this.div,"date-picker-disabled"),this.disabled=!1,this.table.onmouseover=this.onmouseover,this.table.onmouseout=this.onmouseout,this.table.onclick=this.onclick,this.table.onmousedown=this.onmousedown;else{var a=document.getElementById("fd-but-"+this.id);a&&(M(a,"date-picker-control-disabled"),X(a,"disabled",!1),this.addButtonEvents(a),a.title=hb(5))}this.disabled=!1}},$.prototype.disableTodayButton=function(){var a=new Date;M(this.butToday,"fd-disabled"),(this.outOfRange(a)||this.date.getDate()==a.getDate()&&this.date.getMonth()==a.getMonth()&&this.date.getFullYear()==a.getFullYear())&&L(this.butToday,"fd-disabled")},$.prototype.updateTableHeaders=function(){for(var c,d,a=this.showWeeks?8:7,b=this.showWeeks?1:0,e=b;a>e;e++)c=(this.firstDayOfWeek+(e-b))%7,this.ths[e].title=ib(c,!1),e>b?(d=this.ths[e].getElementsByTagName("span")[0],K(d),d.appendChild(document.createTextNode(ib(c,!0))),d.title=this.ths[e].title,d=null):(K(this.ths[e]),this.ths[e].appendChild(document.createTextNode(ib(c,!0)))),M(this.ths[e],"date-picker-highlight"),this.highlightDays[c]&&L(this.ths[e],"date-picker-highlight");this.created&&this.updateTable()},$.prototype.callback=function(a,b){if(!(a&&a in this.callbacks))return!1;var d,c=!1;for(d=0;da){var c=q.titles[a];if(b&&b.length)for(var d=0;da?c[a]:""},jb=function(a,b){var c=q[b?"monthAbbrs":"fullMonths"];return c.length&&c.length>a?c[a]:""},kb=function(a,b){return a=(a+12)%12,0!=b%4||0==b%100&&0!=b%400||1!=a?[31,28,31,30,31,30,31,31,30,31,30,31][a]:29},lb=function(a){if(a in h)return h[a];var b=new Date(a,0,4),c=new Date(a,11,28);return b.setDate(b.getDate()-(6+b.getDay())%7),c.setDate(c.getDate()+(7-c.getDay())%7),h[a]=Math.round((c-b)/6048e5),h[a]},mb=function(a,b,c){var e,c=new Date(a,b,c,0,0,0),d=c.getDay();return c.setDate(c.getDate()-(d+6)%7+3),e=c.valueOf(),c.setMonth(0),c.setDate(4),Math.round((e-c.valueOf())/6048e5)+1},nb=function(a,b,c){if(!a||isNaN(a))return b;var m,n,d=a.getDate(),e=a.getDay(),f=a.getMonth(),g=a.getFullYear(),h=c?q:_,i=String(b).split(F),i=O(b,F),j=[],k={d:S(d),D:h.dayAbbrs[0==e?6:e-1],l:h.fullDays[0==e?6:e-1],j:d,N:0==e?7:e,w:e,W:mb(g,f,d),M:h.monthAbbrs[f],F:h.fullMonths[f],m:S(f+1),n:f+1,t:kb(f,g),y:String(g).substr(2,2),Y:g,S:["th","st","nd","rd"][d%10>3?0:(10!=d%100-d%10)*d%10]},l=i.length;for(n=0;l>n;n++)m=i[n],j.push(m in k?k[m]:m);return j.join("")},ob=function(a,b){var l,m,n,c=!1,d=!1,e=!1,f=-1!=b.search(A)?1:0,g=-1!=b.search(B)?1:0,h=-1!=b.search(C)?1:0,j=(new Date,O(b,F)),a=""+a,k=j.length;a:for(l=0;k>l;l++)if(m=j[l],""!==m){if(0==a.length)break;switch(m){case"/":case".":case" ":case"-":case",":case":":a=a.substr(1);break;case"d":if(-1!=a.search(/^(3[01]|[12][0-9]|0[1-9])/)){c=a.substr(0,2),a=a.substr(2);break}return!1;case"j":if(-1!=a.search(/^(3[01]|[12][0-9]|[1-9])/)){c=+a.match(/^(3[01]|[12][0-9]|[1-9])/)[0],a=a.substr(a.match(/^(3[01]|[12][0-9]|[1-9])/)[0].length);break}return!1;case"D":case"l":n=_.fullDays.concat(_.dayAbbrs),q.imported&&(n=n.concat(q.fullDays).concat(q.dayAbbrs));for(var o=0;o+e?"20"+String(e):"19"+String(e),a=a.substr(2);break}return!1;default:a=a.substr(m.length)}}return f&&c===!1||g&&d===!1||h&&e===!1?!1:f&&g&&h&&+c>kb(+d-1,+e)?!1:{d:f?+c:!1,m:g?+d:!1,y:h?+e:!1}},pb=function(a){var b;if(a.parentNode&&"label"==a.parentNode.tagName.toLowerCase())b=a.parentNode;else for(var c=document.getElementsByTagName("label"),d=0;d+n)&&(f=n),(!h||+n>+h)&&(h=n));!a.cursorDate&&e&&(a.cursorDate=e),a.disabledDates[f]=h}else if(j.m&&j.y){for(s=0;s+n)&&(f=n),(!h||+n>+h)&&(h=n));f+="01",h+=""+kb(+h.substr(4,2)-1,+h.substr(0,4))}else if(j.y){for(s=0;s+h)&&(h=q.y));f+="0101",h+="1231"}}}if(1!=c.d||1!=c.m||1!=c.y){if(b)throw"Could not find all of the required date parts within the date format for element: "+p.id;return!1}a.rangeLow=Z(a.rangeLow||!1),a.rangeHigh=Z(a.rangeHigh||!1),a.cursorDate=Z(a.cursorDate||!1),f&&(!a.rangeLow||+a.rangeLow<+f)&&(a.rangeLow=f),h&&(!a.rangeHigh||+a.rangeHigh>+h)&&(a.rangeHigh=h),m={formElements:a.formElements,id:a.id,staticPos:!(!a.staticPos&&!a.nopopup),positioned:a.positioned&&document.getElementById(a.positioned)?a.positioned:"",rangeLow:a.rangeLow&&-1!=String(a.rangeLow).search(G)?a.rangeLow:"",rangeHigh:a.rangeHigh&&-1!=String(a.rangeHigh).search(G)?a.rangeHigh:"",statusFormat:a.statusFormat||y,noFadeEffect:a.staticPos?!0:!!a.noFadeEffect,dragDisabled:r||a.staticPos?!0:!!a.dragDisabled,bespokeTabIndex:a.bespokeTabindex&&"number"==typeof a.bespokeTabindex?parseInt(a.bespokeTabindex,10):0,bespokeTitles:a.bespokeTitles||i||{},finalOpacity:a.finalOpacity&&"number"==typeof a.finalOpacity&&a.finalOpacity>20&&a.finalOpacity<=100?parseInt(+a.finalOpacity,10):a.staticPos?100:k,hideInput:!!a.hideInput,noToday:!!a.noTodayButton,showWeeks:!!a.showWeeks,fillGrid:!!a.fillGrid,constrainSelection:"constrainSelection"in a?!!a.constrainSelection:!0,cursorDate:a.cursorDate&&-1!=String(a.cursorDate).search(G)?a.cursorDate:"",labelledBy:pb(p),describedBy:a.describedBy&&document.getElementById(a.describedBy)?a.describedBy:d&&document.getElementById(d)?d:"",callbacks:a.callbackFunctions?a.callbackFunctions:{},highlightDays:a.highlightDays&&a.highlightDays.length&&7==a.highlightDays.length?a.highlightDays:[0,0,0,0,0,1,1],disabledDays:a.disabledDays&&a.disabledDays.length&&7==a.disabledDays.length?a.disabledDays:[0,0,0,0,0,0,0],bespokeClass:a.bespokeClass?" "+a.bespokeClass:""},g[a.id]=new $(m),"disabledDates"in a&&a.disabledDates!==!1&&g[a.id].setDisabledDates(a.disabledDates),"enabledDates"in a&&a.enabledDates!==!1&&g[a.id].setEnabledDates(a.enabledDates),g[a.id].callback("create",g[a.id].createCbArgObj())}else if(b)throw"No form elements stipulated within initialisation parameters"},ub=function(a){return a&&a in g?g[a].visible:!1},vb=function(){var a;for(a in g)g.hasOwnProperty(a)&&g[a].changeHandler()},wb=function(){var d,a="Webkit Moz ms O".split(" "),b=document.createElement("div"),c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",MSTransition:"msTransitionEnd",OTransition:"oTransitionEnd",transition:"transitionEnd"};for(d in c)if(void 0!==b.style[d]){m=c[d];break}if(!m)return!1;if(b.style.animationName)return!0;for(var e=0;e