var a,TWeekDay=["wdSunday","wdMonday","wdTuesday","wdWednesday","wdThursday","wdFriday","wdSaturday"],wdSunday=0,wdMonday=1,wdTuesday=2,wdWednesday=3,wdThursday=4,wdFriday=5,wdSaturday=6;DateTimeFormat=function(b,c,d,h,q,j,m){this.dateSeparator=b;this.longDatePattern=c;this.shortDatePattern=d;this.timeSeparator=h;this.longTimePattern=q;this.shortTimePattern=j;this.firstDay=m};
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.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.isSameDate=function(b){return this.getDate()==b.getDate()&&this.getMonth()==b.getMonth()&&this.getFullYear()==b.getFullYear()};a.isSameTime=function(b){return this.getSeconds()==b.getSeconds()&&this.getMinutes()==b.getMinutes()&&this.getHours()==b.getHours()};a.isSame=function(b){return this.isSameDate(b)&&this.isSameTime(b)};
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(){var b=this.getFullYear(),c=this.getMonth()+1,d=this.getDate()+Date.formatInfo.firstDay,h=Math.floor((14-c)/12);b=b+4800-h;c=c+12*h-3;h=Math.floor(b/4)-Math.floor(b/100)+Math.floor(b/400);d=d+Math.floor((153*c+2)/5)+365*b+h-32045;d=(d+31741-d%7)%146097%36524%1461;b=Math.floor(d/1460);return Math.floor(((d-b)%365+b)/7)+1};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,d,h){this.owner=b;this.date=new Date(c);this.disabled=d?true:false;this.className=typeof h!="undefined"?String(h):null};
TDateInput=function(b,c,d,h,q,j){var m=q,r=d,l=null,n=j?new Date(j):null,k=[],g=false,o=[],z=null,w=c,x=TDateInput.instances.length,v=null,s=new Date(9999,11,31,23,59,59),u=new Date(1753,0,1),t=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")h=false;if(typeof c=="undefined")throw new Error('Illegal call to constructor. "element" cannot be empty.');if(typeof d=="undefined")throw new Error('Illegal call to constructor. "button" cannot be empty.');if(m){if(!m.contains)throw new Error('Illegal call to constructor. "block" should be an array of Date.');}else m=[];for(c=0;c<m.length;c++)if(typeof m[c].age!="function")throw new Error('Illegal call to constructor. "block" contains elements which are not of type Date.');
else m[c]=m[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["+x+"].stopHide( this );");this.div.onmouseout=new Function("event","TDateInput.instances["+
x+"].hide( this );");if(isIE){this.frame=document.createElement("IFRAME");this.frame.id="frm"+b.upperFirst();this.frame.src="misc/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["+x+"].stopHide( this );");this.frame.onmouseout=new Function("event","TDateInput.instances["+x+"].hide( this );")}bodyLoaded||addEvent(window,"load","TDateInput.instances["+x+"].init( event );");
this.blocked=function(f){return m.contains(f)};this.pButton=function(f){if(typeof f=="undefined")return r;else r=Html.get(f)};this.pClearDays=function(f,e){z=new Date(f);v=new Date(e);k=[]};this.pClearFilled=function(){o=[]};this.pDataUrl=function(f){if(typeof f=="undefined")return l;else l=typeof f.Class!="undefined"&&f.Class=="Url"?f:new Url(f);typeof w=="string"&&this.getData()};this.pDate=function(f,e,i){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)+'").');this.allowTime||(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){this.pElement().value="";this.write()}else{this.pShowDate(n);
this.pFillElement(n)}typeof i=="boolean"&&i&&this.pHide();if(this.onchange){e=typeof e=="undefined"?createEvent("change"):createEvent(e);e.srcElement=w;this.onchange(e)}}this.settingDate=false}};this.pDispose=function(){if(!g){g=true;r=r.DateInput=null;this.frame=this.div=w=w.DateInput=null}};this.pElement=function(f){if(typeof f=="undefined")return w;else w=Html.get(f)};this.pFilled=function(){return o};this.pFillElement=function(f){if(f==null)this.pElement().value="";else if(f.getHours()>0||f.getMinutes()>
0||f.getSeconds()>0)this.pElement().value=f.formatString("g");else this.pElement().value=f.formatString("d")};this.getData=function(f,e){if(e==null)e=t;if(typeof f!="undefined"&&f!=null)if(f.getMonth()==e.getMonth()&&f.getFullYear()==e.getFullYear())return;if(l!=null){f=l.add("date",e.formatString("d")).request("GET",null,true);this.pClearFilled();m=[];if(f!=null)if(f.firstChild!=null&&f.firstChild.childNodes!=null)for(e=0;e<f.firstChild.childNodes.length;e++){var i=f.firstChild.childNodes[e],p=parseBool(i.getAttribute("disabled")),
y=i.getAttribute("class");i=parseXmlDate(i.firstChild.nodeValue);if(Date.isDate(i))if(p){m.contains(i)||m.add(i);if(isSame(n,i)){n=null;if(w)w.value=""}y&&this.addFilled(i,y)}else this.addFilled(i,y)}}};this.pGetDay=function(f){f=k[f];return typeof f!="undefined"?f:null};this.pGetDays=function(){return k};this.pGetFirst=function(){return z};this.pGetLast=function(){return v};this.pGetRef=function(){return"TDateInput.instances["+x+"]"};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());t&&t>=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);t&&t<u?this.pShowDate(u):this.write()}};this.pName=function(){return b};this.pShowDate=function(f){var e=
t;if(typeof f=="undefined")return t;else t=f>=s?s.priorDay():f<u?u:f.round();if(!isSame(e,t)){this.getData(e,t);this.write();this.onshow&&this.onshow(this)}};this.td=function(f){var e=false,i="";k[f]=new TDay(this,f);if(f<u||f>=s||this.blocked(f)){e=true;i+=' disabled="true"';k[f].disabled=true}else i+=' onclick="'+this.pGetRef()+".setDate("+f.jsDate()+', event, true );"';i+=f.getMonth()!=t.getMonth()?' class="calDayOM':' class="calDay';if(f.isSameDate(new Date))i+=" calToday";if(n&&f.isSameDate(n))i+=
" calSelected";if(typeof o[f]=="boolean"&&o[f]==true){i+=" calFilled";k[f].className="calFilled"}else if(typeof o[f]=="string"&&o[f]!=""){i+=" "+o[f];k[f].className=o[f]}if(e)i+=" calDisabled";i+='"';if(e)i+=' style="cursor:default;"';else{i+=" onmouseover=\"this.oldclass = this.className; this.className += ' calSelected';\"";i+=' onmouseout="this.className = this.oldclass;"'}return i};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(),d=c.nextDay(),h=[],q=b;q<d;q=q.nextDay())h[q]=this.getDay(q);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,d){if(b==this.pElement()){b=String(this.pElement().value).length>0?this.allowTime?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?isDateTime(b):isDate(b);if(this.allowTime&&b!=null)if(b.formatString("HHnnss")==
"000000"&&this.pDate()!=null&&this.pDate().formatString("HHnnss")!="000000")b=b.integrateTime(this.pDate());try{this.pDate(b,c,d);return true}catch(h){this.settingDate=false;if(h.description)alert(h.description);else h.message?alert(h.message):alert(h);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(d){if(d.description)alert(d.description);else d.message?alert(d.message):alert(d);return false}};a.setYear=function(b){try{var c=new Date(this.pShowDate());c.setYear(b.value);this.pShowDate(c);return true}catch(d){if(d.description)alert(d.description);else d.message?alert(d.message):alert(d);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,d=getLeft(this.pElement()),h=getTop(this.pElement())+this.pElement().offsetHeight;this.x=d;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()),d=new Date(this.pMaxDate()),h=b.getFullYear(),q=b.getMonth(),j=new Date(h,q,1),m=j.nextMonth(),r=this.dayNo(j),l=new Date(b),n=b.nextMonth(),k="";this.pClearDays(j,m.priorDay());l.setDate(1);l=l.priorDay();l=l<c?' disabled="true"':"";n.setDate(1);n=n>d?' disabled="true"':"";k='<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,o=11;if(g<c.getMonth()&&h==c.getFullYear())g=c.getMonth();if(o>d.getMonth()&&h==d.getFullYear())o=d.getMonth();for(g=g;g<
o+1;g++)k+='\t\t\t\t<option value="'+g+'"'+(g==q?' selected="selected"':"")+">"+months[g]+"</option>\r\n";k+='\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;o=b.getFullYear()+75;if(g<c.getFullYear())g=c.getFullYear();if(o>d.getFullYear())o=d.getFullYear();for(g=g;g<o+1;g++)k+='\t\t\t\t<option value="'+g+'"'+(g==h?' selected="selected"':"")+">"+g+"</option>\r\n";k+='\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"'+l+' 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++)k+='\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++)k+='\t\t<td class="calDayHeader"><img src="img/default/pixTrans.gif" height="1" width="20" /><br/>'+days[g].substr(0,2)+"</td>\r\n";k+='\t</tr>\r\n\t<tr style="font-size:90%;">\r\n\t\t<td class="calWeekNo" style="cursor:default;">'+j.priorDay(r).weekNo()+"</td>\r\n";for(g=r;g>0;g--){l=j.priorDay(g);k+="\t\t<td"+this.td(l)+">"+l.formatString("%d")+"</td>\r\n"}for(;j<m;){k+="\t\t<td"+this.td(j)+">"+j.formatString("%d")+"</td>\r\n";
j=j.nextDay();r=this.dayNo(j);if(j<m&&r==0)k+='\t</tr>\r\n\t<tr style="font-size:90%;">\r\n\t\t<td class="calWeekNo" style="cursor:default;">'+j.weekNo()+"</td>"}if(r)for(g=0;g<20&&r<7;j=j.nextDay(),g++){k+="<td"+this.td(j)+">"+j.formatString("%d")+"</td>";r++}k+="\t</tr>\r\n</table>";this.div.innerHTML=k;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();");
TCalendar=function(b,c,d,h,q,j){var m=h,r=null,l=q?new Date(q):null,n=[],k=false,g=false,o=[],z=null,w=TCalendar.instances.length,x=null,v=new Date(9999,11,31,23,59,59),s=new Date(1753,0,1),u=c,t=l?l:new Date,f=typeof j=="boolean"?j:true;this.allowTime=d;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 d=="undefined")d=false;if(typeof c=="undefined")throw new Error('Illegal call to constructor. "parent" cannot be empty.');if(m){if(!m.contains)throw new Error('Illegal call to constructor. "block" should be an array of Date.');}else m=[];for(c=0;c<m.length;c++)if(typeof m[c].age!="function")throw new Error('Illegal call to constructor. "block" contains elements which are not of type Date.');else m[c]=
m[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["+w+"].init();");this.blocked=function(e){return m.contains(e)};this.pClearDays=function(e,i){z=new Date(e);x=new Date(i);n=[]};this.pClearFilled=function(){o=[]};this.pDataUrl=function(e){if(typeof e=="undefined")return r;
else r=typeof e.Class!="undefined"&&e.Class=="Url"?e:new Url(e);typeof u=="string"&&this.getData()};this.pDate=function(e,i,p){if(typeof e=="undefined")return l;else if(e!=null){if(typeof e.age!="function")throw new Error('Illegal assignment to date. Value is not a date object and not null ("'+valueString(e)+'").');this.allowTime||(e=e.round());if(e>=v)throw new Error(this.maxDateMessage.replace("[MAXDATE]",v.formatString("d")));if(e<s)throw new Error(this.maxDateMessage.replace("[MINDATE]",s.formatString("d")));
if(this.blocked(e.round()))throw new Error(this.blockedMessage.replace("[DATE]",e.round().formatString("d")));}if(!isSame(l,e)){l=e;l==null||k?this.write():this.pShowDate(l);if(this.onchange)if(typeof i!="undefined"){e=createEvent(i);if(typeof p!="undefined"){p.calendar=this;e.srcElement=p}else e.srcElement=this;this.onchange(this,e)}else this.onchange(this)}};this.pDirect=function(e){if(typeof e=="undefined")return k;else k=e?true:false};this.pDispose=function(){if(!g){g=true;this.div=u=u.Calendar=
null}};this.pFilled=function(){return o};this.getData=function(e,i){if(i==null)i=t;if(typeof e!="undefined"&&e!=null)if(e.getMonth()==i.getMonth()&&e.getFullYear()==i.getFullYear())return;if(r!=null){e=r.add("date",i.formatString("d")).request("GET",null,true);this.pClearFilled();m=[];if(e!=null)if(e.firstChild!=null&&e.firstChild.childNodes!=null)for(i=0;i<e.firstChild.childNodes.length;i++){var p=e.firstChild.childNodes[i],y=parseBool(p.getAttribute("disabled")),A=p.getAttribute("class");p=parseXmlDate(p.firstChild.nodeValue);
if(Date.isDate(p))if(y){m.contains(p)||m.add(p);isSame(l,p)&&this.pDate(null);A&&this.addFilled(p,A)}else this.addFilled(p,A)}}};this.pGetDay=function(e){e=n[e];return typeof e!="undefined"?e:null};this.pGetDays=function(){return n};this.pGetFirst=function(){return z};this.pGetFirst=function(){return z};this.pGetLast=function(){return x};this.pGetRef=function(){return"TCalendar.instances["+w+"]"};this.pMaxDate=function(e){if(typeof e=="undefined")return v;else if(e>new Date(9999,11,31))throw new Error("Illegal assignment to maxDate. Max. value is 31-12-9999");
else if(e<new Date(1753,0,1))throw new Error("Illegal assignment to maxDate. Min. value is 1-1-1753");else if(e<=s)throw new Error("Illegal assignment to maxDate. Date smaller than minDate");else{v=e.round();l&&l>=v&&this.pDate(v.priorDay());t&&t>=v?this.pShowDate(v.priorDay()):this.write()}};this.pMinDate=function(e){if(typeof e=="undefined")return s;else if(e>new Date(9999,11,31))throw new Error("Illegal assignment to minDate. Max. value is 31-12-9999");else if(e<new Date(1753,0,1))throw new Error("Illegal assignment to minDate. Min. value is 1-1-1753");
else if(e>=v)throw new Error("Illegal assignment to minDate. Date greater than maxDate");else{s=e.round();l&&l<s&&this.pDate(s);t&&t<s?this.pShowDate(s):this.write()}};this.pName=function(){return b};this.pParent=function(e){if(typeof e=="undefined")return u;else u=Html.get(e)};this.pShowDate=function(e,i,p){var y=t;if(typeof e=="undefined")return t;else t=e>=v?v.priorDay():e<s?s:e.round();if(!isSame(y,t)){this.getData(y,t);k?this.pDate(t,i,p):this.write();this.onshow&&this.onshow(this)}};this.pShowSelects=
function(e){if(typeof e=="undefined")return f;else{f=e;if(e=Html.get("trSelects"))e.style.display=f?"block":"none"}};this.td=function(e){var i=false,p="";n[e]=new TDay(this,e);if(e<s||e>=v||this.blocked(e)){i=true;p+=' disabled="true"';n[e].disabled=true}else p+=' onclick="'+this.pGetRef()+".setDate("+e.jsDate()+', event );"';p+=e.getMonth()!=t.getMonth()?' class="calDayOM':' class="calDay';if(e.isSameDate(new Date))p+=" calToday";if(l&&e.isSameDate(l))p+=" calSelected";if(typeof o[e]=="boolean"&&
o[e]==true){p+=" calFilled";n[e].className="calFilled"}else if(typeof o[e]=="string"&&o[e]!=""){p+=" "+o[e];n[e].className=o[e]}if(i)p+=" calDisabled";p+='"';if(i)p+=' style="cursor:default;"';else{p+=" onmouseover=\"this.oldclass = this.className; this.className += ' calSelected';\"";p+=' onmouseout="this.className = this.oldclass;"'}return p};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(),d=c.nextDay(),h=[],q=b;q<d;q=q.nextDay())h[q]=this.getDay(q);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(d){if(d.description)alert(d.description);else d.message?alert(d.message):alert(d);return false}};
a.priorMonth=function(b,c){try{this.pShowDate(this.pShowDate().priorMonth(),c,b);return true}catch(d){if(d.description)alert(d.description);else d.message?alert(d.message):alert(d);return false}};a.parent=function(){return this.pParent()};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(d){if(d.description)alert(d.description);else d.message?alert(d.message):alert(d);return false}};
a.setMonth=function(b){try{var c=new Date(this.pShowDate());c.setMonth(b.value);this.pShowDate(c);return true}catch(d){if(d.description)alert(d.description);else d.message?alert(d.message):alert(d);return false}};a.setYear=function(b){try{var c=new Date(this.pShowDate());c.setYear(b.value);this.pShowDate(c);return true}catch(d){if(d.description)alert(d.description);else d.message?alert(d.message):alert(d);return false}};
a.write=function(){this.name();var b=new Date(this.pShowDate()),c=new Date(this.pMinDate()),d=new Date(this.pMaxDate()),h=b.getFullYear(),q=b.getMonth(),j=new Date(h,q,1),m=j.nextMonth(),r=this.dayNo(j),l=new Date(b),n=b.nextMonth(),k="";this.pClearDays(j,m.priorDay());l.setDate(1);l=l.priorDay();l=l<c?' disabled="true"':"";n.setDate(1);n=n>d?' disabled="true"':"";k='<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,o=11;if(g<c.getMonth()&&h==c.getFullYear())g=c.getMonth();if(o>d.getMonth()&&h==d.getFullYear())o=d.getMonth();for(g=g;g<o+1;g++)k+='\t\t\t\t<option value="'+g+'"'+(g==q?' selected="selected"':"")+">"+months[g]+"</option>\r\n";k+='\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;o=b.getFullYear()+75;if(g<c.getFullYear())g=c.getFullYear();if(o>d.getFullYear())o=d.getFullYear();for(g=g;g<o+1;g++)k+='\t\t\t\t<option value="'+g+'"'+(g==h?' selected="selected"':"")+">"+g+"</option>\r\n";k+='\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"'+l+' 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++)k+='\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++)k+='\t\t<td class="calDayHeader"><img src="img/default/pixTrans.gif" height="1" class="calDayHeader" /><br/>'+days[g].substr(0,2)+"</td>\r\n";k+='\t</tr>\r\n\t<tr style="font-size:90%;">\r\n\t\t<td class="calWeekNo" style="cursor:default;">'+j.priorDay(r).weekNo()+"</td>\r\n";for(g=r;g>0;g--){l=j.priorDay(g);k+="\t\t<td"+this.td(l)+">"+l.formatString("%d")+"</td>\r\n"}for(;j<m;){k+="\t\t<td"+this.td(j)+">"+j.formatString("%d")+"</td>\r\n";j=j.nextDay();
r=this.dayNo(j);if(j<m&&r==0)k+='\t</tr>\r\n\t<tr style="font-size:90%;">\r\n\t\t<td class="calWeekNo" style="cursor:default;">'+j.weekNo()+"</td>"}if(r)for(g=0;g<20&&r<7;j=j.nextDay(),g++){k+="<td"+this.td(j)+">"+j.formatString("%d")+"</td>";r++}k+="\t</tr>\r\n</table>";this.div.innerHTML=k};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(typeof b.age=="function")return b;if((new String(b)).length==0)return true;var c=new Date,d=(new String(b)).split(Date.formatInfo.dateSeparator.trim());if(d.length<2||d.length>3)return false;for(b=0;b<d.length;b++){for(;d[b].startsWith("0");)d[b]=d[b].substr(1);if(d[b]=="")d[b]="0"}b=d.length>0?parseInt(d[0]):null;var h=d.length>1?parseInt(d[1]):null;c=d.length>2?parseInt(d[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(d[0]))return false;if(h!=Number(d[1]))return false;if(d.length>2&&c!=Number(d[2]))return false;d=Date.formatInfo.shortDatePattern;if(d.search("y")<d.search("m")&&d.search("m")<d.search("d")){d=c;c=b;b=d}else if(d.search("m")<d.search("d")){d=h;h=b;b=d}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(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 d=c.length>0?Number(c[0]):null,h=c.length>1?Number(c[1]):null,q=c.length>2?Number(c[2]):0,j=c.length>3?c[3]:null;if(isNaN(d)||d==null)return false;if(isNaN(h)||h==null)return false;
if(isNaN(q))if(/(AM|PM)/.test(c[2])){j=c[2].toUpperCase();q=0}else return false;if(j=="PM"&&d<12)d+=12;if(d<0||d>23)return false;if(h<0||h>59)return false;if(q<0||q>59)return false;return new Date(1900,0,1,d,h,q)}catch(m){return false}}
function isDateTime(b){if(typeof b.age=="function")return b;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 d=isTime(b[1]);if(c!=false&&d!=false){c.setHours(d.getHours());c.setMinutes(d.getMinutes());c.setSeconds(d.getSeconds());return c}else{b=b.join(" ");d=isTime(b);return d!=false?d: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+"."};
