var a,TWeekDay=["wdSunday","wdMonday","wdTuesday","wdWednesday","wdThursday","wdFriday","wdSaturday"],wdSunday=0,wdMonday=1,wdTuesday=2,wdWednesday=3,wdThursday=4,wdFriday=5,wdSaturday=6,CalendarWeekRule={FirstDay:0,FirstFullWeek:1,FirstFourDayWeek:2};DateTimeFormat=function(b,c,e,h,l,i,o,r){this.dateSeparator=b;this.longDatePattern=c;this.shortDatePattern=e;this.timeSeparator=h;this.longTimePattern=l;this.shortTimePattern=i;this.firstDay=o;this.firstWeekRule=r||2};
DateTimeFormat.prototype.getDateDisplayPattern=function(){var b=this.shortDatePattern;b=b.split("'");for(var c=1;c<b.length;c++)b[c]="";b=b.join("");return b=b.replace(new RegExp("[^dmy"+regExp.escape(this.dateSeparator)+"]","gi"),"").trim()};DateTimeFormat.prototype.getTimeDisplayPattern=function(){var b=this.shortTimePattern;b=b.split("'");for(var c=1;c<b.length;c++)b[c]="";b=b.join("");return b=b.replace(new RegExp("[^hnst"+regExp.escape(this.timeSeparator)+"]","gi"),"").trim()};a=Date.prototype;
a.addDays=function(b){var c=new Date(this);c.setDate(this.getDate()+b);return c};a.addHours=function(b){var c=new Date(this);c.setHours(this.getHours()+b);return c};a.addMinutes=function(b){var c=new Date(this);c.setMinutes(this.getMinutes()+b);return c};a.addMonths=function(b){var c=new Date(this);c.setMonths(this.getMonths()+b);return c};a.addSeconds=function(b){var c=new Date(this);c.setSeconds(this.getSeconds()+b);return c};
a.addYears=function(b){var c=new Date(this);c.setFullYear(this.getFullYear()+b);return c};a.age=function(){var b=new Date,c=b.getFullYear()-this.getFullYear();if(b.getMonth()<this.getMonth()||b.getMonth()==this.getMonth()&&b.getDate()<this.getDate())c--;return c};a.daysInMonth=function(){switch(this.getMonth()+1){case 4:case 6:case 9:case 11:return 30;case 2:return this.isLeapYear()?29:28;default:return 31}};
a.formatString=function(b){var c=String(b);if(b==null||b==""||typeof b=="undefined")c=Date.formatInfo.shortDatePattern+" "+Date.formatInfo.shortTimePattern;else if(b=="s")c="yyyy-mm-ddTHH:nn:ss";else if(b=="d")c=Date.formatInfo.shortDatePattern;else if(b=="D")c=Date.formatInfo.longDatePattern;else if(b=="t")c=Date.formatInfo.shortTimePattern;else if(b=="T")c=Date.formatInfo.longTimePattern;else if(b=="f?")c=this.getHours()==0&&this.getMinutes()==0?Date.formatInfo.longDatePattern:Date.formatInfo.longDatePattern+
" "+Date.formatInfo.shortTimePattern;else if(b=="f")c=Date.formatInfo.longDatePattern+" "+Date.formatInfo.shortTimePattern;else if(b=="F?")c=this.getHours()==0&&this.getMinutes()==0&&this.getSeconds()==0?Date.formatInfo.longDatePattern:Date.formatInfo.longDatePattern+" "+Date.formatInfo.longTimePattern;else if(b=="F")c=Date.formatInfo.longDatePattern+" "+Date.formatInfo.longTimePattern;else if(b=="g?")c=this.getHours()==0&&this.getMinutes()==0?Date.formatInfo.shortDatePattern:Date.formatInfo.shortDatePattern+
" "+Date.formatInfo.shortTimePattern;else if(b=="g")c=Date.formatInfo.shortDatePattern+" "+Date.formatInfo.shortTimePattern;else if(b=="G?")c=this.getHours()==0&&this.getMinutes()==0&&this.getSeconds()==0?Date.formatInfo.shortDatePattern:Date.formatInfo.shortDatePattern+" "+Date.formatInfo.longTimePattern;else if(b=="G")c=Date.formatInfo.shortDatePattern+" "+Date.formatInfo.longTimePattern;c=c.replace(/\%/g,"");c=c.replace(/\//g,Date.formatInfo.dateSeparator);c=c.replace(/-/g,Date.formatInfo.dateSeparator);
c=c.replace(/:/g,Date.formatInfo.timeSeparator);c=c.replace(/yyyy/gi,this.getFullYear());if(c.toLowerCase().indexOf("yyy")>-1)throw new Error('Illegal yearformat "yyy".');c=c.replace(/yy/gi,(new String(this.getFullYear())).substr(2));c=c.replace(/^mm$/gi,fillOut(this.getMonth()+1));c=c.replace(/^mm([^m])/gi,fillOut(this.getMonth()+1)+"$1");c=c.replace(/([^m])mm$/gi,"$1"+fillOut(this.getMonth()+1));c=c.replace(/([^m])mm([^m])/gi,"$1"+fillOut(this.getMonth()+1)+"$2");c=c.replace(/^m$/gi,this.getMonth()+
1);c=c.replace(/^m([^m])/gi,this.getMonth()+1+"$1");c=c.replace(/([^m])m$/gi,"$1"+(this.getMonth()+1));c=c.replace(/([^m])m([^m])/gi,"$1"+(this.getMonth()+1)+"$2");c=c.replace(/^dd$/gi,fillOut(this.getDate()));c=c.replace(/^dd([^d])/gi,fillOut(this.getDate())+"$1");c=c.replace(/([^d])dd$/gi,"$1"+fillOut(this.getDate()));c=c.replace(/([^d])dd([^d])/gi,"$1"+fillOut(this.getDate())+"$2");c=c.replace(/^d$/gi,this.getDate());c=c.replace(/^d([^d])/gi,this.getDate()+"$1");c=c.replace(/([^d])d$/gi,"$1"+this.getDate());
c=c.replace(/([^d])d([^d])/gi,"$1"+this.getDate()+"$2");if(this.getHours()>12){c=c.replace(/hh/g,fillOut(this.getHours()-12));c=c.replace(/h/g,this.getHours()-12)}else if(this.getHours()==0){c=c.replace(/hh/g,"12");c=c.replace(/h/g,"12")}else{c=c.replace(/hh/g,fillOut(this.getHours()));c=c.replace(/h/g,this.getHours())}c=c.replace(/HH/g,fillOut(this.getHours()));c=c.replace(/H/g,this.getHours());c=c.replace(/nn/gi,fillOut(this.getMinutes()));c=c.replace(/n/gi,this.getMinutes());c=c.replace(/ss/gi,
fillOut(this.getSeconds()));c=c.replace(/s/gi,this.getSeconds());if(this.getHours()<12){c=c.replace(/tt/g,"AM");c=c.replace(/t/g,"A")}else{c=c.replace(/tt/g,"PM");c=c.replace(/t/g,"P")}c=c.replace(/mmmm/gi,months[this.getMonth()]);c=c.replace(/mmm/gi,months[this.getMonth()].substr(0,3));c=c.replace(/dddd/gi,days[this.getDay()]);c=c.replace(/ddd/gi,days[this.getDay()].substr(0,2));if(b=="s"){if(this.dateSeparator!="-")c=c.replace(new RegExp(regExp.escape(Date.formatInfo.dateSeparator),"gi"),"-");if(this.timeSeparator!=
":")c=c.replace(new RegExp(regExp.escape(Date.formatInfo.timeSeparator),"gi"),":")}return c};
a.getWeek=function(){if(Date.formatInfo.firstWeekRule==CalendarWeekRule.FirstDay){var b=this.getFullYear(),c=(new Date(b,0,1)).getDay();if(c==0)c=6;else c--;var e=(Date.UTC(b,this.getMonth(),this.getDate(),0,0,0)-Date.UTC(b,0,1,0,0,0))/864E5+1;if(c<4)c=Math.floor((e+c-1)/7)+1;else{c=Math.floor((e+c-1)/7);if(c==0){c=(new Date(--b,0,1)).getDay();if(c==0)c=6;else c--;c=c<4?53:52}}}else{b=this.getFullYear();e=this.getMonth()+1;c=this.getDate()+Date.formatInfo.firstDay-1;var h=Math.floor((14-e)/12);b=
b+4800-h;e=e+12*h-3;h=Math.floor(b/4)-Math.floor(b/100)+Math.floor(b/400);c=c+Math.floor((153*e+2)/5)+365*b+h-32045;c=(c+31741-c%7)%146097%36524%1461;b=Math.floor(c/1460);c=Math.floor(((c-b)%365+b)/7)+1}return c};a.integrateDate=function(b){var c=new Date(this);c.setFullYear(b.getFullYear());c.setMonth(b.getMonth());c.setDate(b.getDate());return c};
a.integrateTime=function(b){var c=new Date(this);c.setHours(b.getHours());c.setMinutes(b.getMinutes());c.setSeconds(b.getSeconds());c.setMilliseconds(b.getMilliseconds());return c};a.isLeapYear=function(){var b=this.getFullYear();return b%4==0&&(b%100||b%1E3==0)?true:false};a.isSame=function(b){return this.isSameDate(b)&&this.isSameTime(b)};a.isSameDate=function(b){return this.getDate()==b.getDate()&&this.getMonth()==b.getMonth()&&this.getFullYear()==b.getFullYear()};
a.isSameMonth=function(b){return this.getFullYear()==b.getFullYear()&&this.getMonth()==b.getMonth()};a.isSameTime=function(b){return this.getSeconds()==b.getSeconds()&&this.getMinutes()==b.getMinutes()&&this.getHours()==b.getHours()};a.isSameWeek=function(b){return this.getFullYear()==b.getFullYear()&&this.weekNo()==b.weekNo()};a.isSameYear=function(b){return this.getFullYear()==b.getFullYear()};
a.jsDate=function(){return"new Date("+this.getFullYear()+", "+this.getMonth()+", "+this.getDate()+", "+this.getHours()+", "+this.getMinutes()+", "+this.getSeconds()+", "+this.getMilliseconds()+")"};a.nextDay=function(b){b||(b=1);var c=new Date(this);if(c.getDate()+b<=c.daysInMonth())c.setDate(c.getDate()+b);else if(c.getMonth()<11){c.setDate(c.getDate()+b-c.daysInMonth());c.setMonth(c.getMonth()+1)}else{c.setDate(c.getDate()+b-c.daysInMonth());c.setYear(c.getFullYear()+1);c.setMonth(0)}return c};
a.nextMonth=function(){var b=new Date(this);if(b.getMonth()<11)for(b.setMonth(b.getMonth()+1);b.getMonth()>this.getMonth()+1;)b=b.priorDay();else{b.setMonth(0);b.setYear(b.getFullYear()+1)}return b};a.nextWeek=function(){return this.nextDay(7)};a.nextYear=function(b){b||(b=1);var c=new Date(this);c.setYear(c.getFullYear()+b);return c};
a.priorDay=function(b){b||(b=1);var c=new Date(this);if(c.getDate()-b>=1)c.setDate(c.getDate()-b);else{if(c.getMonth()>0)c.setMonth(c.getMonth()-1);else{c.setYear(c.getFullYear()-1);c.setMonth(11)}c.setDate(c.daysInMonth()-b+c.getDate())}return c};a.priorWeek=function(){return this.priorDay(7)};a.priorMonth=function(){var b=new Date(this);if(b.getMonth()>0)for(b.setMonth(b.getMonth()-1);b.getMonth()==this.getMonth();)b=b.priorDay();else{b.setMonth(11);b.setYear(b.getFullYear()-1)}return b};
a.priorYear=function(b){b||(b=1);var c=new Date(this);c.setYear(c.getFullYear()-b);return c};a.round=function(){var b=new Date(this);b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0);return b};a.weekNo=function(){return this.getWeek()};Date.isDate=function(b){return isDate(b)};Date.isDateTime=function(b){return isDateTime(b)};Date.isTime=function(b){return isTime(b)};
TDay=function(b,c,e,h){this.owner=b;this.date=new Date(c);this.disabled=e?true:false;this.className=typeof h!="undefined"?String(h):null};var AllowTime={yes:true,no:false,dontShow:"don't show"};
TDateInput=function(b,c,e,h,l,i){var o=l,r=e,k=null,n=i?new Date(i):null,j=[],g=false,p=[],A=null,x=c,z=TDateInput.instances.length,w=null,s=new Date(9999,11,31,23,59,59),u=new Date(1753,0,1),v=n?n:new Date;this.allowTime=h;this.blockedMessage=blockedMessage[Languages.current];this.Class="TDateInput";this.doHide=true;this.maxDateMessage=maxDateMessage[Languages.current];this.minDateMessage=minDateMessage[Languages.current];this.onshow=this.onchange=null;this.settingDate=false;this.timer=0;if(typeof b==
"undefined"||String(b).length==0)throw new Error('Illegal call to constructor. "name" cannot be empty.');if(typeof h=="undefined")this.allowTime=false;if(typeof c=="undefined")throw new Error('Illegal call to constructor. "element" cannot be empty.');if(typeof e=="undefined")throw new Error('Illegal call to constructor. "button" cannot be empty.');if(o){if(!o.contains)throw new Error('Illegal call to constructor. "block" should be an array of Date.');}else o=[];for(c=0;c<o.length;c++)if(typeof o[c].age!=
"function")throw new Error('Illegal call to constructor. "block" contains elements which are not of type Date.');else o[c]=o[c].round();TDateInput.instances.add(this);this.div=document.createElement("DIV");this.div.id="div"+b.upperFirst();this.div.style.display="none";this.div.style.background="white";this.div.style.border="1px solid black";this.div.style.color="black";this.div.style.display="block";this.div.style.padding="0px";this.div.style.position="absolute";this.div.onmouseover=new Function("event",
"TDateInput.instances["+z+"].stopHide( this );");this.div.onmouseout=new Function("event","TDateInput.instances["+z+"].hide( this );");if(isIE){this.frame=document.createElement("IFRAME");this.frame.id="frm"+b.upperFirst();this.frame.src="misc/default/empty.htm";this.frame.style.visiblity="hidden";this.frame.style.position="absolute";this.frame.style.border="0px solid";this.frame.onmouseover=new Function("event","TDateInput.instances["+z+"].stopHide( this );");this.frame.onmouseout=new Function("event",
"TDateInput.instances["+z+"].hide( this );")}bodyLoaded||addEvent(window,"load","TDateInput.instances["+z+"].init( event );");this.blocked=function(f){return o.contains(f)};this.pButton=function(f){if(typeof f=="undefined")return r;else r=Html.get(f)};this.pClearDays=function(f,q){A=new Date(f);w=new Date(q);j=[]};this.pClearFilled=function(){p=[]};this.pDataUrl=function(f){if(typeof f=="undefined")return k;else k=typeof f.Class!="undefined"&&f.Class=="Url"?f:new Url(f);typeof x=="string"&&this.getData()};
this.pDate=function(f,q,d){if(typeof f=="undefined")return n;if(!this.settingDate){this.settingDate=true;if(f!=null){if(typeof f.isLeapYear=="undefined")throw new Error('Illegal assignment to date. Value is not a date object and not null ("'+valueString(f)+'").');if(this.allowTime==false)f=f.round();if(f>=s)throw new Error(this.maxDateMessage.replace("[MAXDATE]",s.formatString("d")));if(f<u)throw new Error(this.minDateMessage.replace("[MINDATE]",u.formatString("d")));if(this.blocked(f.round()))throw new Error(this.blockedMessage.replace("[DATE]",
f.round().formatString("d")));}if(!isSame(n,f)){n=f;if(n==null||n.formatString("yyyymmdd")=="19000101"){this.pElement().value="";this.write()}else{this.pShowDate(n);this.pFillElement(n)}typeof d=="boolean"&&d&&this.pHide();if(this.onchange){q=typeof q=="undefined"?createEvent("change"):createEvent(q);q.srcElement=x;this.onchange(q)}}this.settingDate=false}};this.pDispose=function(){if(!g){g=true;r=r.DateInput=null;this.frame=this.div=x=x.DateInput=null}};this.pElement=function(f){if(typeof f=="undefined")return x;
else x=Html.get(f)};this.pFilled=function(){return p};this.pFillElement=function(f){if(f==null)this.pElement().value="";else{var q=f.formatString("HHnnss")!="000000";if(this.allowTime==true&&q)this.pElement().value=f.formatString("g");else this.pElement().value=f.formatString("d")}};this.getData=function(f,q){if(q==null)q=v;if(typeof f!="undefined"&&f!=null)if(f.getMonth()==q.getMonth()&&f.getFullYear()==q.getFullYear())return;if(k!=null){f=k.add("date",q.formatString("d")).request("GET",null,true);
this.pClearFilled();o=[];if(f!=null)if(f.firstChild!=null&&f.firstChild.childNodes!=null)for(q=0;q<f.firstChild.childNodes.length;q++){var d=f.firstChild.childNodes[q],t=parseBool(d.getAttribute("disabled")),m=d.getAttribute("class");d=parseXmlDate(d.firstChild.nodeValue);if(Date.isDate(d))if(t){o.contains(d)||o.add(d);if(isSame(n,d)){n=null;if(x)x.value=""}m&&this.addFilled(d,m)}else this.addFilled(d,m)}}};this.pGetDay=function(f){f=j[f];return typeof f!="undefined"?f:null};this.pGetDays=function(){return j};
this.pGetFirst=function(){return A};this.pGetLast=function(){return w};this.pGetRef=function(){return"TDateInput.instances["+z+"]"};this.pHide=function(){this.div.style.display="none";this.frame&&this.frame.parentNode==document.body&&document.body.removeChild(this.frame)};this.pMaxDate=function(f){if(typeof f=="undefined")return s;else if(f>new Date(9999,11,31))throw new Error("Illegal assignment to maxDate. Max. value is 31-12-9999");else if(f<new Date(1753,0,1))throw new Error("Illegal assignment to maxDate. Min. value is 1-1-1753");
else if(f<=u)throw new Error("Illegal assignment to maxDate. Date smaller than minDate");else{s=f.round();n&&n>=s&&this.pDate(s.priorDay());v&&v>=s?this.pShowDate(s.priorDay()):this.write()}};this.pMinDate=function(f){if(typeof f=="undefined")return u;else if(f>new Date(9999,11,31))throw new Error("Illegal assignment to minDate. Max. value is 31-12-9999");else if(f<new Date(1753,0,1))throw new Error("Illegal assignment to minDate. Min. value is 1-1-1753");else if(f>=s)throw new Error("Illegal assignment to minDate. Date greater than maxDate");
else{u=f.round();n&&n<u&&this.pDate(u);v&&v<u?this.pShowDate(u):this.write()}};this.pName=function(){return b};this.pShowDate=function(f){var q=v;if(typeof f=="undefined")return v;else v=f>=s?s.priorDay():f<u?u:f.round();if(!isSame(q,v)){this.getData(q,v);this.write();this.onshow&&this.onshow(this)}};this.td=function(f){var q=false,d="";j[f]=new TDay(this,f);if(f<u||f>=s||this.blocked(f)){q=true;d+=' disabled="true"';j[f].disabled=true}else d+=' onclick="'+this.pGetRef()+".setDate("+f.jsDate()+', event, true );"';
d+=f.getMonth()!=v.getMonth()?' class="calDayOM':' class="calDay';if(f.isSameDate(new Date))d+=" calToday";if(n&&f.isSameDate(n))d+=" calSelected";if(typeof p[f]=="boolean"&&p[f]==true){d+=" calFilled";j[f].className="calFilled"}else if(typeof p[f]=="string"&&p[f]!=""){d+=" "+p[f];j[f].className=p[f]}if(q)d+=" calDisabled";d+='"';if(q)d+=' style="cursor:default;"';else{d+=" onmouseover=\"this.oldclass = this.className; this.className += ' calSelected';\"";d+=' onmouseout="this.className = this.oldclass;"'}return d};
bodyLoaded&&this.init()};a=TDateInput.prototype;a.addFilled=function(b,c){Date.isDate(b)||(b=new Date(b));if(typeof b.age=="function"){c=typeof c=="undefined"||c==null?true:String(c);this.pFilled()[b.round()]=c;this.pFilled()[this.pFilled().length]=b}else throw new Error('Illegal call to TDateInput.addFilled(). Parameter "date" is no date.');};a.button=function(){return this.pButton()};a.clearFilled=function(){this.pClearFilled()};a.days=function(){return this.pGetDays()};a.dispose=function(){this.pDispose()};
a.dataUrl=function(b){return this.pDataUrl(b)};a.date=function(b){return this.pDate(b)};a.dayNo=function(b){return b.getDay()<Date.formatInfo.firstDay?7-Date.formatInfo.firstDay+b.getDay():b.getDay()-Date.formatInfo.firstDay};a.element=function(){return this.pElement()};a.filled=function(){return this.pFilled()};a.getDay=function(b){return this.pGetDay(b)};a.hide=function(b,c){if(this.doHide){if(typeof c=="undefined")c=50;this.timer=setTimeout(this.pGetRef()+".pHide();",c)}};
a.init=function(){this.pElement(this.pElement());this.pElement().DateInput=this;this.pElement().value!=""&&this.setDate(this.pElement());if(this.pElement().onchange){this.onchange=new Function("event",filterEvent(this.pElement().onchange).replace("this","this.pElement()"));this.pElement().onchange=null}addEvent(this.pElement(),"change",this.pGetRef()+".setDate( this, event );");if(isIE)this.pElement().style.behavior="";this.pButton(this.pButton());this.pButton().DateInput=this;addEvent(this.pButton(),
"mouseout",this.pGetRef()+".hide( this, 500 );");addEvent(this.pButton(),"mouseover",this.pGetRef()+".stopHide( this );");addEvent(this.pButton(),"click",this.pGetRef()+".show( this )");if(this.pButton().hideFocus)this.pButton().hideFocus=true;this.write()};a.maxDate=function(b){return this.pMaxDate(b)};a.minDate=function(b){return this.pMinDate(b)};a.month=function(){for(var b=this.pGetFirst(),c=this.pGetLast(),e=c.nextDay(),h=[],l=b;l<e;l=l.nextDay())h[l]=this.getDay(l);return{first:b,last:c,days:h}};
a.name=function(){return this.pName()};a.nextMonth=function(){try{this.pShowDate(this.pShowDate().nextMonth());return true}catch(b){this.settingDate=false;if(b.description)alert(b.description);else b.message?alert(b.message):alert(b);return false}};a.priorMonth=function(){try{this.pShowDate(this.pShowDate().priorMonth());return true}catch(b){this.settingDate=false;if(b.description)alert(b.description);else b.message?alert(b.message):alert(b);return false}};a.showDate=function(b){return this.pShowDate(b)};
a.setDate=function(b,c,e){if(b==this.pElement()){b=String(this.pElement().value).length>0?this.allowTime!=false?isDateTime(this.pElement().value):isDate(this.pElement().value):null;if(b==false){b=getIllegalDateMessage();alert(b);if(isIE)this.pElement().select();else{this.pFillElement(this.date());this.pElement.focus()}return typeof c!="undefined"?cancelEvent(c):false}}else if(b!=null&&typeof b.age!="function")b=this.allowTime!=false?isDateTime(b):isDate(b);var h=this.pDate();if(this.allowTime!=false&&
b!=null&&b.formatString("HHnnss")=="000000"&&h!=null&&h.formatString("HHnnss")!="000000")b=b.integrateTime(h);try{this.pDate(b,c,e);return true}catch(l){this.settingDate=false;if(l.description)alert(l.description);else l.message?alert(l.message):alert(l);if(isIE){this.pElement().select();if(typeof c!="undefined")c.returnValue=false}else{if(this.date())this.pFillElement(this.date());else this.pElement().value="";this.pElement().focus()}return false}};
a.setMonth=function(b){try{var c=new Date(this.pShowDate());c.setMonth(b.value);this.pShowDate(c);return true}catch(e){if(e.description)alert(e.description);else e.message?alert(e.message):alert(e);return false}};a.setYear=function(b){try{var c=new Date(this.pShowDate());c.setYear(b.value);this.pShowDate(c);return true}catch(e){if(e.description)alert(e.description);else e.message?alert(e.message):alert(e);return false}};
a.show=function(){this.div.parentNode!=document.body&&document.body.appendChild(this.div);isIE&&document.body.appendChild(this.frame);this.div.style.display=="none"&&this.date()&&this.pShowDate(this.date());var b=getLeft(this.pButton())+this.pButton().offsetWidth,c=getTop(this.pButton())+this.pButton().offsetHeight,e=getLeft(this.pElement()),h=getTop(this.pElement())+this.pElement().offsetHeight;this.x=e;this.y=Math.max(c,h);this.div.style.left=this.x+"px";this.div.style.top=this.y+"px";this.div.style.zIndex=
9999;this.div.style.display="";this.div.style.left=b-this.div.offsetWidth+"px";if(typeof this.frame!="undefined"){this.frame.style.zIndex=9998;this.frame.style.left=this.div.offsetLeft+"px";this.frame.style.top=this.div.offsetTop+"px";this.frame.style.width=this.div.offsetWidth+"px";this.frame.style.height=this.div.offsetHeight+"px";this.frame.style.visibility="visible"}};a.startHiding=function(){this.doHide=true};a.stopHiding=function(){this.doHide=false};
a.stopHide=function(){clearTimeout(this.timer);this.timer=0};
a.write=function(){this.name();var b=new Date(this.pShowDate()),c=new Date(this.pMinDate()),e=new Date(this.pMaxDate()),h=b.getFullYear(),l=b.getMonth(),i=new Date(h,l,1),o=i.nextMonth(),r=this.dayNo(i),k=new Date(b),n=b.nextMonth(),j="";this.pClearDays(i,o.priorDay());k.setDate(1);k=k.priorDay();k=k<c?' disabled="true"':"";n.setDate(1);n=n>e?' disabled="true"':"";j='<table border="0" cellspacing="0" cellpadding="3" style="float:left;">\r\n\t<col/><col/><col/><col/><col/><col/><col/><col/>\r\n\t<tr style="font-size:90%;" onmouseover="'+this.pGetRef()+
'.stopHide( this );">\r\n\t\t<td colspan="5" align="center" style="padding:0px 0px; border-bottom:1px solid black;">\r\n\t\t\t<select onchange="'+this.pGetRef()+".setMonth( this ); "+this.pGetRef()+'.startHiding();" onmousedown="'+this.pGetRef()+".stopHide( this ); "+this.pGetRef()+'.stopHiding();" onmouseleave="'+this.pGetRef()+'.startHiding();" style="width:100%">\r\n';var g=0,p=11;if(g<c.getMonth()&&h==c.getFullYear())g=c.getMonth();if(p>e.getMonth()&&h==e.getFullYear())p=e.getMonth();for(g=g;g<
p+1;g++)j+='\t\t\t\t<option value="'+g+'"'+(g==l?' selected="selected"':"")+">"+months[g]+"</option>\r\n";j+='\t\t\t</select>\r\n\t\t</td>\r\n\t\t<td colspan="3" align="center" style="padding:0px 0px; border-bottom:1px solid black;">\r\n\t\t\t<select onchange="'+this.pGetRef()+".setYear( this ); "+this.pGetRef()+'.startHiding();" onmousedown="'+this.pGetRef()+".stopHide( this ); "+this.pGetRef()+'.stopHiding();" onmouseleave="'+this.pGetRef()+'.startHiding();" style="width:100%">\r\n';g=b.getFullYear()-
75;p=b.getFullYear()+75;if(g<c.getFullYear())g=c.getFullYear();if(p>e.getFullYear())p=e.getFullYear();for(g=g;g<p+1;g++)j+='\t\t\t\t<option value="'+g+'"'+(g==h?' selected="selected"':"")+">"+g+"</option>\r\n";j+='\t\t\t</select>\r\n\t\t</td>\r\n\t</tr>\r\n\t<tr id="trButtons" style="font-size:90%;" onmouseover="'+this.pGetRef()+'.stopHide( this );">\r\n\t\t<td style="padding:0px 0px;"><button type="button"'+k+' onclick="'+this.pGetRef()+'.priorMonth();" onmouseover="'+this.pGetRef()+'.stopHide( this );" style="width:100%; margin:0px;">&lt;</button></td>\t\t<td colspan="6" align="center">'+
b.formatString("MMMM yyyy")+'</td>\r\n\t\t<td style="padding:0px 0px;"><button type="button"'+n+' onclick="'+this.pGetRef()+'.nextMonth();"  onmouseover="'+this.pGetRef()+'.stopHide( this );" style="width:100%; margin:0px;">&gt;</button></td>\r\n\t</tr>\r\n\t<tr height="20" style="font-size:90%;">\r\n\t\t<td><img src="img/default/pixTrans.gif" height="1" width="20" /></td>\r\n';for(g=Date.formatInfo.firstDay;g<7;g++)j+='\t\t<td class="calDayHeader"><img src="img/default/pixTrans.gif" height="1" width="20" /><br/>'+
days[g].substr(0,2)+"</td>\r\n";for(g=0;g<Date.formatInfo.firstDay;g++)j+='\t\t<td class="calDayHeader"><img src="img/default/pixTrans.gif" height="1" width="20" /><br/>'+days[g].substr(0,2)+"</td>\r\n";j+='\t</tr>\r\n\t<tr style="font-size:90%;">\r\n\t\t<td class="calWeekNo" style="cursor:default;">'+i.priorDay(r).weekNo()+"</td>\r\n";for(g=r;g>0;g--){k=i.priorDay(g);j+="\t\t<td"+this.td(k)+">"+k.formatString("%d")+"</td>\r\n"}for(;i<o;){j+="\t\t<td"+this.td(i)+">"+i.formatString("%d")+"</td>\r\n";
i=i.nextDay();r=this.dayNo(i);if(i<o&&r==0)j+='\t</tr>\r\n\t<tr style="font-size:90%;">\r\n\t\t<td class="calWeekNo" style="cursor:default;">'+i.weekNo()+"</td>"}if(r)for(g=0;g<20&&r<7;i=i.nextDay(),g++){j+="<td"+this.td(i)+">"+i.formatString("%d")+"</td>";r++}j+="\t</tr>\r\n</table>";this.div.innerHTML=j;if(this.frame){this.frame.style.left=this.div.offsetLeft+"px";this.frame.style.top=this.div.offsetTop+"px";this.frame.style.width=this.div.offsetWidth+"px";this.frame.style.height=this.div.offsetHeight+
"px"}};TDateInput.instances=[];TDateInput.dispose=function(){for(var b=0;b<TDateInput.instances.length;b++){TDateInput.instances[b].dispose();TDateInput.instances[b]=null}TDateInput.instances=[]};addEvent(window,"unload","TDateInput.dispose();");var Period={Day:1,Week:7,Month:31};
TCalendar=function(b,c,e,h,l,i){var o=h,r=null,k=l?new Date(l):null,n=[],j=false,g=false,p=[],A=null,x=TCalendar.instances.length,z=null,w=new Date(9999,11,31,23,59,59),s=new Date(1753,0,1),u=c,v=Period.Day,f=k?k:new Date,q=typeof i=="boolean"?i:true;this.allowTime=e;this.blockedMessage=blockedMessage[Languages.current];this.Class="TCalendar";this.maxDateMessage=maxDateMessage[Languages.current];this.minDateMessage=minDateMessage[Languages.current];this.onshow=this.onchange=null;this.timer=0;if(typeof b==
"undefined"||String(b).length==0)throw new Error('Illegal call to constructor. "name" cannot be empty.');if(typeof e=="undefined")e=false;if(typeof c=="undefined")throw new Error('Illegal call to constructor. "parent" cannot be empty.');if(o){if(!o.contains)throw new Error('Illegal call to constructor. "block" should be an array of Date.');}else o=[];for(c=0;c<o.length;c++)if(typeof o[c].age!="function")throw new Error('Illegal call to constructor. "block" contains elements which are not of type Date.');
else o[c]=o[c].round();TCalendar.instances.add(this);this.div=document.createElement("DIV");this.div.id="div"+b.upperFirst();this.div.style.border="0px solid";this.div.style.color="black";this.div.style.display="block";this.div.style.padding="0px";bodyLoaded||addEvent(window,"load","TCalendar.instances["+x+"].init();");this.blocked=function(d){return o.contains(d)};this.pClearDays=function(d,t){A=new Date(d);z=new Date(t);n=[]};this.pClearFilled=function(){p=[]};this.pDataUrl=function(d){if(typeof d==
"undefined")return r;else r=typeof d.Class!="undefined"&&d.Class=="Url"?d:new Url(d);typeof u=="string"&&this.getData()};this.pDate=function(d,t,m){if(typeof d=="undefined")return k;else if(d!=null){if(typeof d.age!="function")throw new Error('Illegal assignment to date. Value is not a date object and not null ("'+valueString(d)+'").');this.allowTime||(d=d.round());if(d>=w)throw new Error(this.maxDateMessage.replace("[MAXDATE]",w.formatString("d")));if(d<s)throw new Error(this.maxDateMessage.replace("[MINDATE]",
s.formatString("d")));if(this.blocked(d.round()))throw new Error(this.blockedMessage.replace("[DATE]",d.round().formatString("d")));}if(!isSame(k,d)){k=d;k==null||j?this.write():this.pShowDate(k);if(this.onchange)if(typeof t!="undefined"){d=createEvent(t);if(typeof m!="undefined"){m.calendar=this;d.srcElement=m}else d.srcElement=this;this.onchange(this,d)}else this.onchange(this)}};this.pDirect=function(d){if(typeof d=="undefined")return j;else j=d?true:false};this.pDispose=function(){if(!g){g=true;
this.div=u=u.Calendar=null}};this.pFilled=function(){return p};this.getData=function(d,t){if(t==null)t=f;if(typeof d!="undefined"&&d!=null)if(d.getMonth()==t.getMonth()&&d.getFullYear()==t.getFullYear())return;if(r!=null){d=r.add("date",t.formatString("d")).request("GET",null,true);this.pClearFilled();o=[];if(d!=null)if(d.firstChild!=null&&d.firstChild.childNodes!=null)for(t=0;t<d.firstChild.childNodes.length;t++){var m=d.firstChild.childNodes[t],y=parseBool(m.getAttribute("disabled")),B=m.getAttribute("class");
m=parseXmlDate(m.firstChild.nodeValue);if(Date.isDate(m))if(y){o.contains(m)||o.add(m);isSame(k,m)&&this.pDate(null);B&&this.addFilled(m,B)}else this.addFilled(m,B)}}};this.pGetDay=function(d){d=n[d];return typeof d!="undefined"?d:null};this.pGetDays=function(){return n};this.pGetFirst=function(){return A};this.pGetFirst=function(){return A};this.pGetLast=function(){return z};this.pGetRef=function(){return"TCalendar.instances["+x+"]"};this.pMaxDate=function(d){if(typeof d=="undefined")return w;else if(d>
new Date(9999,11,31))throw new Error("Illegal assignment to maxDate. Max. value is 31-12-9999");else if(d<new Date(1753,0,1))throw new Error("Illegal assignment to maxDate. Min. value is 1-1-1753");else if(d<=s)throw new Error("Illegal assignment to maxDate. Date smaller than minDate");else{w=d.round();k&&k>=w&&this.pDate(w.priorDay());f&&f>=w?this.pShowDate(w.priorDay()):this.write()}};this.pMinDate=function(d){if(typeof d=="undefined")return s;else if(d>new Date(9999,11,31))throw new Error("Illegal assignment to minDate. Max. value is 31-12-9999");
else if(d<new Date(1753,0,1))throw new Error("Illegal assignment to minDate. Min. value is 1-1-1753");else if(d>=w)throw new Error("Illegal assignment to minDate. Date greater than maxDate");else{s=d.round();k&&k<s&&this.pDate(s);f&&f<s?this.pShowDate(s):this.write()}};this.pName=function(){return b};this.pParent=function(d){if(typeof d=="undefined")return u;else u=Html.get(d)};this.pPeriod=function(d){if(typeof d=="undefined")return v;switch(d){case Period.Week:d=Period.Week;break;case Period.Month:d=
Period.Month;break;default:d=Period.Day}if(v!=d){v=d;(d=j?f:k)?this.pShowDate(d):this.write()}};this.pShowDate=function(d,t,m){var y=f;if(typeof d=="undefined")return f;else f=d>=w?w.priorDay():d<s?s:d.round();if(!isSame(y,f)){this.getData(y,f);j?this.pDate(f,t,m):this.write();this.onshow&&this.onshow(this)}};this.pShowSelects=function(d){if(typeof d=="undefined")return q;else{q=d;if(d=Html.get("trSelects"))d.style.display=q?"block":"none"}};this.td=function(d){var t=false,m="";n[d]=new TDay(this,
d);if(d<s||d>=w||this.blocked(d)){t=true;m+=' disabled="true"';n[d].disabled=true}else m+=' onclick="'+this.pGetRef()+".setDate("+d.jsDate()+', event );"';m+=d.getMonth()!=f.getMonth()?' class="calDayOM':' class="calDay';if(d.isSameDate(new Date))m+=" calToday";var y=j?k==null?f:k:k;if(y){Log.write("FPeriod",v);switch(v){case Period.Day:if(k&&d.isSameDate(k))m+=" calSelected";break;case Period.Week:if(d.isSameWeek(y))m+=" calSelected";break;case Period.Month:Log.write("sel",y);Log.write("date",d);
Log.write("date.isSameMonth( sel )",d.isSameMonth(y));if(d.isSameMonth(y))m+=" calSelected";break}}if(typeof p[d]=="boolean"&&p[d]==true){m+=" calFilled";n[d].className="calFilled"}else if(typeof p[d]=="string"&&p[d]!=""){m+=" "+p[d];n[d].className=p[d]}if(t)m+=" calDisabled";m+='"';if(t)m+=' style="cursor:default;"';else{m+=" onmouseover=\"this.oldclass = this.className; this.className += ' calSelected';\"";m+=' onmouseout="this.className = this.oldclass;"'}return m};bodyLoaded&&this.init()};a=TCalendar.prototype;
a.addFilled=function(b,c){if(typeof b.age!="function")b=new Date(b);if(typeof b.age=="function"){c=typeof c=="undefined"||c==null?true:String(c);this.pFilled()[b.round()]=c;this.pFilled()[this.pFilled().length]=b}else throw new Error('Illegal call to TCalendar.addFilled(). Parameter "date" is no date.');};a.clearFilled=function(){this.pClearFilled()};a.days=function(){return this.pGetDays()};a.dispose=function(){this.pDispose()};a.dataUrl=function(b){return this.pDataUrl(b)};a.date=function(b){return this.pDate(b)};
a.dayNo=function(b){return b.getDay()<Date.formatInfo.firstDay?7-Date.formatInfo.firstDay+b.getDay():b.getDay()-Date.formatInfo.firstDay};a.direct=function(b){return this.pDirect(b)};a.filled=function(){return this.pFilled()};a.getDay=function(b){return this.pGetDay(b)};a.hideSelects=function(){this.pShowSelects(false)};a.init=function(){this.pParent(this.pParent());this.write();this.parent().appendChild(this.div);this.div.style.width=this.div.firstChild.offsetWidth+"px"};a.maxDate=function(b){return this.pMaxDate(b)};
a.minDate=function(b){return this.pMinDate(b)};a.month=function(){for(var b=this.pGetFirst(),c=this.pGetLast(),e=c.nextDay(),h=[],l=b;l<e;l=l.nextDay())h[l]=this.getDay(l);return{first:b,last:c,days:h}};a.name=function(){return this.pName()};a.nextMonth=function(b,c){try{this.pShowDate(this.pShowDate().nextMonth(),c,b);return true}catch(e){if(e.description)alert(e.description);else e.message?alert(e.message):alert(e);return false}};
a.priorMonth=function(b,c){try{this.pShowDate(this.pShowDate().priorMonth(),c,b);return true}catch(e){if(e.description)alert(e.description);else e.message?alert(e.message):alert(e);return false}};a.parent=function(){return this.pParent()};a.period=function(b){return this.pPeriod(b)};a.showDate=function(b){return this.pShowDate(b)};a.showSelects=function(){this.pShowSelects(true)};
a.setDate=function(b,c){if(b!=null&&typeof b.isLeapYear=="undefined")b=this.allowTime?isDateTime(b):isDate(b);if(this.allowTime)if(b.formatString("HHnnss")=="000000"&&this.pDate()!=null&&this.pDate().formatString("HHnnss")!="000000")b=b.integrateTime(this.pDate());try{this.pDate(b,c);return true}catch(e){if(e.description)alert(e.description);else e.message?alert(e.message):alert(e);return false}};
a.setMonth=function(b){try{var c=new Date(this.pShowDate());c.setMonth(b.value);this.pShowDate(c);return true}catch(e){if(e.description)alert(e.description);else e.message?alert(e.message):alert(e);return false}};a.setYear=function(b){try{var c=new Date(this.pShowDate());c.setYear(b.value);this.pShowDate(c);return true}catch(e){if(e.description)alert(e.description);else e.message?alert(e.message):alert(e);return false}};
a.write=function(){this.name();var b=new Date(this.pShowDate()),c=new Date(this.pMinDate()),e=new Date(this.pMaxDate()),h=b.getFullYear(),l=b.getMonth(),i=new Date(h,l,1),o=i.nextMonth(),r=this.dayNo(i),k=new Date(b),n=b.nextMonth(),j="";this.pClearDays(i,o.priorDay());k.setDate(1);k=k.priorDay();k=k<c?' disabled="true"':"";n.setDate(1);n=n>e?' disabled="true"':"";j='<table border="0" cellspacing="0" cellpadding="3" style="float:left;">\r\n\t<col/><col/><col/><col/><col/><col/><col/><col/>\r\n\t<tr id="trSelects" style="font-size:90%;'+
(this.pShowSelects()?"":" display:none;")+'">\r\n\t\t<td colspan="5" align="center" style="padding:0px 0px;">\r\n\t\t\t<select onchange="'+this.pGetRef()+'.setMonth( this );" style="width:100%">\r\n';var g=0,p=11;if(g<c.getMonth()&&h==c.getFullYear())g=c.getMonth();if(p>e.getMonth()&&h==e.getFullYear())p=e.getMonth();for(g=g;g<p+1;g++)j+='\t\t\t\t<option value="'+g+'"'+(g==l?' selected="selected"':"")+">"+months[g]+"</option>\r\n";j+='\t\t\t</select>\r\n\t\t</td>\r\n\t\t<td colspan="3" align="center" style="padding:0px 0px;">\r\n\t\t\t<select onchange="'+
this.pGetRef()+'.setYear( this );" style="width:100%">\r\n';g=b.getFullYear()-75;p=b.getFullYear()+75;if(g<c.getFullYear())g=c.getFullYear();if(p>e.getFullYear())p=e.getFullYear();for(g=g;g<p+1;g++)j+='\t\t\t\t<option value="'+g+'"'+(g==h?' selected="selected"':"")+">"+g+"</option>\r\n";j+='\t\t\t</select>\r\n\t\t</td>\r\n\t</tr>\r\n\t<tr id="trButtons" style="font-size:90%;">\r\n\t\t<td style="padding:0px 0px;"><button type="button"'+k+' onclick="'+this.pGetRef()+'.priorMonth( this, event );" style="width:100%; margin:0px;">&lt;</button></td>\t\t<td colspan="6" align="center">'+
b.formatString("MMMM yyyy")+'</td>\r\n\t\t<td style="padding:0px 0px;"><button type="button"'+n+' onclick="'+this.pGetRef()+'.nextMonth( this, event );" style="width:100%; margin:0px;">&gt;</button></td>\r\n\t</tr>\r\n\t<tr height="20" style="font-size:90%;">\r\n\t\t<td><img src="img/default/pixTrans.gif" height="1" class="calWeekNo" /></td>\r\n';for(g=Date.formatInfo.firstDay;g<7;g++)j+='\t\t<td class="calDayHeader"><img src="img/default/pixTrans.gif" height="1" class="calDayHeader" /><br/>'+days[g].substr(0,
2)+"</td>\r\n";for(g=0;g<Date.formatInfo.firstDay;g++)j+='\t\t<td class="calDayHeader"><img src="img/default/pixTrans.gif" height="1" class="calDayHeader" /><br/>'+days[g].substr(0,2)+"</td>\r\n";j+='\t</tr>\r\n\t<tr style="font-size:90%;">\r\n\t\t<td class="calWeekNo" style="cursor:default;">'+i.priorDay(r).weekNo()+"</td>\r\n";for(g=r;g>0;g--){k=i.priorDay(g);j+="\t\t<td"+this.td(k)+">"+k.formatString("%d")+"</td>\r\n"}for(;i<o;){j+="\t\t<td"+this.td(i)+">"+i.formatString("%d")+"</td>\r\n";i=i.nextDay();
r=this.dayNo(i);if(i<o&&r==0)j+='\t</tr>\r\n\t<tr style="font-size:90%;">\r\n\t\t<td class="calWeekNo" style="cursor:default;">'+i.weekNo()+"</td>"}if(r)for(g=0;g<20&&r<7;i=i.nextDay(),g++){j+="<td"+this.td(i)+">"+i.formatString("%d")+"</td>";r++}j+="\t</tr>\r\n</table>";this.div.innerHTML=j};TCalendar.instances=[];TCalendar.dispose=function(){for(var b=0;b<TCalendar.instances.length;b++){TCalendar.instances[b].dispose();TCalendar.instances[b]=null}TCalendar.instances=[]};
addEvent(window,"unload","TCalendar.dispose();");
function isDate(b){if(b==null)return true;if(typeof b.age=="function")return b;if((new String(b)).length==0)return true;var c=new Date,e=(new String(b)).split(Date.formatInfo.dateSeparator.trim());if(e.length<2||e.length>3)return false;for(b=0;b<e.length;b++){for(;e[b].startsWith("0");)e[b]=e[b].substr(1);if(e[b]=="")e[b]="0"}b=e.length>0?parseInt(e[0]):null;var h=e.length>1?parseInt(e[1]):null;c=e.length>2?parseInt(e[2]):c.getYear();if(isNaN(b)||b==null)return false;if(isNaN(h)||h==null)return false;
if(isNaN(c))return false;if(b!=Number(e[0]))return false;if(h!=Number(e[1]))return false;if(e.length>2&&c!=Number(e[2]))return false;e=Date.formatInfo.shortDatePattern;if(e.search("y")<e.search("m")&&e.search("m")<e.search("d")){e=c;c=b;b=e}else if(e.search("m")<e.search("d")){e=h;h=b;b=e}if(b<1||h<1||h>12)return false;if(c<50)c+=2E3;else if(c<100)c+=1900;if(c<1753||c>9999)return false;switch(h){case 2:if(c%4==0&&(c%100!=0||c%1E3==0)){if(b>29)return false}else if(b>28)return false;break;case 1:case 3:case 5:case 7:case 8:case 10:case 12:if(b>
31)return false;break;case 4:case 6:case 9:case 11:if(b>30)return false;break;default:return false}return new Date(c,h-1,b,0,0,0)}
function isTime(b){if(b==null)return true;if(typeof b.age=="function")return b;if((new String(b)).length==0)return true;try{var c=(new String(b)).split(new RegExp("["+Date.formatInfo.timeSeparator+" ]","gi"));if(c.length<2||c.length>3)return false;for(b=0;b<c.length;b++){for(;c[b].startsWith("0");)c[b]=c[b].substr(1);if(c[b]=="")c[b]="0"}var e=c.length>0?Number(c[0]):null,h=c.length>1?Number(c[1]):null,l=c.length>2?Number(c[2]):0,i=c.length>3?c[3]:null;if(isNaN(e)||e==null)return false;if(isNaN(h)||
h==null)return false;if(isNaN(l))if(/(AM|PM)/.test(c[2])){i=c[2].toUpperCase();l=0}else return false;if(i=="PM"&&e<12)e+=12;if(e<0||e>23)return false;if(h<0||h>59)return false;if(l<0||l>59)return false;return new Date(1900,0,1,e,h,l)}catch(o){return false}}
function isDateTime(b){if(b==null)return true;if(typeof b.age=="function")return b;if((new String(b)).length==0)return true;var c=new Date;b=b.split(/\s+/gi);if(b.length>1){for(c=2;c<b.length;c++)b[1]+=" "+b[c];c=isDate(b[0]);var e=isTime(b[1]);if(c!=false&&e!=false){c.setHours(e.getHours());c.setMinutes(e.getMinutes());c.setSeconds(e.getSeconds());return c}else{b=b.join(" ");e=isTime(b);return e!=false?e:false}}else return b[0].indexOf(Date.formatInfo.dateSeparator)>-1?isDate(b[0]):b[0].indexOf(Date.formatInfo.timeSeparator)>
-1?isTime(b[0]):false}function getIllegalDateMessage(){var b="'"+Date.formatInfo.getDateDisplayPattern()+"'",c=getMessage(19);return c?c.text.replace("D-M-JJJJ",b):"De ingevoerde datum is niet correct. Er wordt een datum met het volgende formaat verwacht: "+b+"."};

