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,t,k,n){this.dateSeparator=b;this.longDatePattern=c;this.shortDatePattern=d;this.timeSeparator=h;this.longTimePattern=t;this.shortTimePattern=k;this.firstDay=n};
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)};var dateInputs=[];
TDateInput=function(b,c,d,h,t,k){var n=t,s=d,l=null,p=k?new Date(k):null,j=[],f=c,m=dateInputs.length,q=new Date(9999,11,31,23,59,59),u=new Date(1753,0,1),r=p?p: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.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(n){if(!n.contains)throw new Error('Illegal call to constructor. "block" should be an array of Date.');}else n=[];for(c=0;c<n.length;c++)if(typeof n[c].age!="function")throw new Error('Illegal call to constructor. "block" contains elements which are not of type Date.');
else n[c]=n[c].round();dateInputs[dateInputs.length]=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","dateInputs["+m+"].stopHide( this );");this.div.onmouseout=new Function("event","dateInputs["+m+"].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","dateInputs["+m+"].stopHide( this );");this.frame.onmouseout=new Function("event","dateInputs["+m+"].hide( this );")}bodyLoaded||addEvent(window,"load","dateInputs["+m+"].init( event );");this.blocked=function(g){return n.contains(g)};
this.pButton=function(g){if(typeof g=="undefined")return s;else s=document.getElementById(g)};this.pClearFilled=function(){j=[]};this.pDataUrl=function(g){if(typeof g=="undefined")return l;else l=typeof g.Class!="undefined"&&g.Class=="Url"?g:new Url(g);typeof f=="string"&&this.getData()};this.pDate=function(g,e,i){if(typeof g=="undefined")return p;if(!this.settingDate){this.settingDate=true;if(g!=null){if(typeof g.isLeapYear=="undefined")throw new Error('Illegal assignment to date. Value is not a date object and not null ("'+
valueString(g)+'").');this.allowTime||(g=g.round());if(g>=q)throw new Error(this.maxDateMessage.replace("[MAXDATE]",q.formatString("d")));if(g<u)throw new Error(this.minDateMessage.replace("[MINDATE]",u.formatString("d")));if(this.blocked(g.round()))throw new Error(this.blockedMessage.replace("[DATE]",g.round().formatString("d")));}if(!isSame(p,g)){p=g;if(p==null){this.pElement().value="";this.write()}else{this.pShowDate(p);this.pFillElement(p)}typeof i=="boolean"&&i&&this.pHide();if(this.onchange){e=
typeof e=="undefined"?createEvent("change"):createEvent(e);e.srcElement=f;this.onchange(e)}}this.settingDate=false}};this.pElement=function(g){if(typeof g=="undefined")return f;else f=document.getElementById(g)};this.pFilled=function(){return j};this.pFillElement=function(g){if(g==null)this.pElement().value="";else if(g.getHours()>0||g.getMinutes()>0||g.getSeconds()>0)this.pElement().value=g.formatString("g");else this.pElement().value=g.formatString("d")};this.getData=function(g,e){if(e==null)e=
r;if(typeof g!="undefined"&&g!=null)if(g.getMonth()==e.getMonth()&&g.getFullYear()==e.getFullYear())return;if(l!=null){g=l.add("date",e.formatString("d")).request("GET",null,true);this.pClearFilled();n=[];if(g!=null)if(g.firstChild!=null&&g.firstChild.childNodes!=null)for(e=0;e<g.firstChild.childNodes.length;e++){var i=g.firstChild.childNodes[e],o=parseBool(i.getAttribute("disabled")),v=i.getAttribute("class");i=parseXmlDate(i.firstChild.nodeValue);if(Date.isDate(i))if(o){n.contains(i)||n.add(i);
if(isSame(p,i)){p=null;if(f)f.value=""}v&&this.addFilled(i,v)}else this.addFilled(i,v)}}};this.pGetRef=function(){return"dateInputs["+m+"]"};this.pHide=function(){this.div.style.display="none";this.frame&&this.frame.parentNode==document.body&&document.body.removeChild(this.frame)};this.pMaxDate=function(g){if(typeof g=="undefined")return q;else if(g>new Date(9999,11,31))throw new Error("Illegal assignment to maxDate. Max. value is 31-12-9999");else if(g<new Date(1753,0,1))throw new Error("Illegal assignment to maxDate. Min. value is 1-1-1753");
else if(g<=u)throw new Error("Illegal assignment to maxDate. Date smaller than minDate");else{q=g.round();p&&p>=q&&this.pDate(q.priorDay());r&&r>=q?this.pShowDate(q.priorDay()):this.write()}};this.pMinDate=function(g){if(typeof g=="undefined")return u;else if(g>new Date(9999,11,31))throw new Error("Illegal assignment to minDate. Max. value is 31-12-9999");else if(g<new Date(1753,0,1))throw new Error("Illegal assignment to minDate. Min. value is 1-1-1753");else if(g>=q)throw new Error("Illegal assignment to minDate. Date greater than maxDate");
else{u=g.round();p&&p<u&&this.pDate(u);r&&r<u?this.pShowDate(u):this.write()}};this.pName=function(){return b};this.pShowDate=function(g){var e=r;if(typeof g=="undefined")return r;else r=g>=q?q.priorDay():g<u?u:g.round();if(!isSame(e,r)){this.getData(e,r);this.write()}};this.td=function(g){var e=false,i="";if(g<u||g>=q||this.blocked(g)){e=true;i+=' disabled="true"'}else i+=' onclick="'+this.pGetRef()+".setDate("+g.jsDate()+', event, true );"';i+=g.getMonth()!=r.getMonth()?' class="calDayOM':' class="calDay';
if(g.isSameDate(new Date))i+=" calToday";if(p&&g.isSameDate(p))i+=" calSelected";if(typeof j[g]=="boolean"&&j[g]==true)i+=" calFilled";else if(typeof j[g]=="string"&&j[g]!="")i+=" "+j[g];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.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.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.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(),t=b.getMonth(),k=new Date(h,t,1),n=k.nextMonth(),s=this.dayNo(k),l=new Date(b),p=b.nextMonth(),j="";l.setDate(1);l=l.priorDay();l=l<c?' disabled="true"':"";p.setDate(1);p=p>d?' 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%;">\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 f=0,m=11;if(f<c.getMonth()&&h==c.getFullYear())f=c.getMonth();if(m>d.getMonth()&&h==d.getFullYear())m=d.getMonth();for(f=f;f<m+1;f++)j+='\t\t\t\t<option value="'+f+'"'+(f==t?' selected="selected"':"")+">"+months[f]+"</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';f=b.getFullYear()-75;m=b.getFullYear()+75;if(f<c.getFullYear())f=c.getFullYear();if(m>d.getFullYear())m=d.getFullYear();for(f=f;f<m+1;f++)j+='\t\t\t\t<option value="'+f+'"'+(f==h?' selected="selected"':"")+">"+f+"</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"'+
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"'+p+' 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(f=Date.formatInfo.firstDay;f<7;f++)j+='\t\t<td class="calDayHeader"><img src="img/default/pixTrans.gif" height="1" width="20" /><br/>'+days[f].substr(0,2)+"</td>\r\n";for(f=0;f<Date.formatInfo.firstDay;f++)j+='\t\t<td class="calDayHeader"><img src="img/default/pixTrans.gif" height="1" width="20" /><br/>'+days[f].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;">'+k.priorDay(s).weekNo()+"</td>\r\n";for(f=s;f>0;f--){l=k.priorDay(f);
j+="\t\t<td"+this.td(l)+">"+l.formatString("%d")+"</td>\r\n"}for(;k<n;){j+="\t\t<td"+this.td(k)+">"+k.formatString("%d")+"</td>\r\n";k=k.nextDay();s=this.dayNo(k);if(k<n&&s==0)j+='\t</tr>\r\n\t<tr style="font-size:90%;">\r\n\t\t<td class="calWeekNo" style="cursor:default;">'+k.weekNo()+"</td>"}if(s)for(f=0;f<20&&s<7;k=k.nextDay(),f++){j+="<td"+this.td(k)+">"+k.formatString("%d")+"</td>";s++}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"}};var calendars=[];
TCalendar=function(b,c,d,h,t,k){var n=h,s=null,l=t?new Date(t):null,p=false,j=[],f=calendars.length,m=new Date(9999,11,31,23,59,59),q=new Date(1753,0,1),u=c,r=l?l:new Date,g=typeof k=="boolean"?k:true;this.allowTime=d;this.blockedMessage=blockedMessage[Languages.current];this.Class="TCalendar";this.maxDateMessage=maxDateMessage[Languages.current];this.minDateMessage=minDateMessage[Languages.current];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(n){if(!n.contains)throw new Error('Illegal call to constructor. "block" should be an array of Date.');}else n=[];for(c=0;c<n.length;c++)if(typeof n[c].age!="function")throw new Error('Illegal call to constructor. "block" contains elements which are not of type Date.');else n[c]=n[c].round();calendars[calendars.length]=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","calendars["+f+"].init();");this.blocked=function(e){return n.contains(e)};this.pClearFilled=function(){j=[]};this.pDataUrl=function(e){if(typeof e=="undefined")return s;else s=typeof e.Class!="undefined"&&e.Class=="Url"?e:new Url(e);typeof u=="string"&&this.getData()};this.pDate=function(e,i,o){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>=m)throw new Error(this.maxDateMessage.replace("[MAXDATE]",m.formatString("d")));if(e<q)throw new Error(this.maxDateMessage.replace("[MINDATE]",q.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||p?this.write():
this.pShowDate(l);if(this.onchange)if(typeof i!="undefined"){e=createEvent(i);if(typeof o!="undefined"){o.calendar=this;e.srcElement=o}else e.srcElement=this;this.onchange(this,e)}else this.onchange(this)}};this.pDirect=function(e){if(typeof e=="undefined")return p;else p=e?true:false};this.pFilled=function(){return j};this.getData=function(e,i){if(i==null)i=r;if(typeof e!="undefined"&&e!=null)if(e.getMonth()==i.getMonth()&&e.getFullYear()==i.getFullYear())return;if(s!=null){e=s.add("date",i.formatString("d")).request("GET",
null,true);this.pClearFilled();n=[];if(e!=null)if(e.firstChild!=null&&e.firstChild.childNodes!=null)for(i=0;i<e.firstChild.childNodes.length;i++){var o=e.firstChild.childNodes[i],v=parseBool(o.getAttribute("disabled")),w=o.getAttribute("class");o=parseXmlDate(o.firstChild.nodeValue);if(Date.isDate(o))if(v){n.contains(o)||n.add(o);isSame(l,o)&&this.pDate(null);w&&this.addFilled(o,w)}else this.addFilled(o,w)}}};this.pGetRef=function(){return"calendars["+f+"]"};this.pMaxDate=function(e){if(typeof e==
"undefined")return m;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<=q)throw new Error("Illegal assignment to maxDate. Date smaller than minDate");else{m=e.round();l&&l>=m&&this.pDate(m.priorDay());r&&r>=m?this.pShowDate(m.priorDay()):this.write()}};this.pMinDate=function(e){if(typeof e=="undefined")return q;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>=m)throw new Error("Illegal assignment to minDate. Date greater than maxDate");else{q=e.round();l&&l<q&&this.pDate(q);r&&r<q?this.pShowDate(q):this.write()}};this.pName=function(){return b};this.pParent=function(e){if(typeof e=="undefined")return u;else u=typeof e=="string"?document.getElementById(e):e};this.pShowDate=
function(e,i,o){var v=r;if(typeof e=="undefined")return r;else r=e>=m?m.priorDay():e<q?q:e.round();if(!isSame(v,r)){this.getData(v,r);p?this.pDate(r,i,o):this.write()}};this.pShowSelects=function(e){if(typeof e=="undefined")return g;else{g=e;if(e=document.getElementById("trSelects"))e.style.display=g?"block":"none"}};this.td=function(e){var i=false,o="";if(e<q||e>=m||this.blocked(e)){i=true;o+=' disabled="true"'}else o+=' onclick="'+this.pGetRef()+".setDate("+e.jsDate()+', event );"';o+=e.getMonth()!=
r.getMonth()?' class="calDayOM':' class="calDay';if(e.isSameDate(new Date))o+=" calToday";if(l&&e.isSameDate(l))o+=" calSelected";if(typeof j[e]=="boolean"&&j[e]==true)o+=" calFilled";else if(typeof j[e]=="string"&&j[e]!="")o+=" "+j[e];if(i)o+=" calDisabled";o+='"';if(i)o+=' style="cursor:default;"';else{o+=" onmouseover=\"this.oldclass = this.className; this.className += ' calSelected';\"";o+=' onmouseout="this.className = this.oldclass;"'}return o};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.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.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.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(typeof b.isLeapYear=="undefined"&&b!=null)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(),t=b.getMonth(),k=new Date(h,t,1),n=k.nextMonth(),s=this.dayNo(k),l=new Date(b),p=b.nextMonth(),j="";l.setDate(1);l=l.priorDay();l=l<c?' disabled="true"':"";p.setDate(1);p=p>d?' 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 f=0,m=11;if(f<c.getMonth()&&h==c.getFullYear())f=c.getMonth();if(m>d.getMonth()&&h==d.getFullYear())m=d.getMonth();for(f=f;f<m+1;f++)j+='\t\t\t\t<option value="'+f+'"'+(f==t?' selected="selected"':"")+">"+months[f]+"</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';f=b.getFullYear()-75;m=b.getFullYear()+75;if(f<c.getFullYear())f=c.getFullYear();if(m>d.getFullYear())m=d.getFullYear();for(f=f;f<m+1;f++)j+='\t\t\t\t<option value="'+f+'"'+(f==h?' selected="selected"':"")+">"+f+"</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"'+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"'+p+' 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(f=Date.formatInfo.firstDay;f<7;f++)j+='\t\t<td class="calDayHeader"><img src="img/default/pixTrans.gif" height="1" class="calDayHeader" /><br/>'+days[f].substr(0,
2)+"</td>\r\n";for(f=0;f<Date.formatInfo.firstDay;f++)j+='\t\t<td class="calDayHeader"><img src="img/default/pixTrans.gif" height="1" class="calDayHeader" /><br/>'+days[f].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;">'+k.priorDay(s).weekNo()+"</td>\r\n";for(f=s;f>0;f--){l=k.priorDay(f);j+="\t\t<td"+this.td(l)+">"+l.formatString("%d")+"</td>\r\n"}for(;k<n;){j+="\t\t<td"+this.td(k)+">"+k.formatString("%d")+"</td>\r\n";k=k.nextDay();
s=this.dayNo(k);if(k<n&&s==0)j+='\t</tr>\r\n\t<tr style="font-size:90%;">\r\n\t\t<td class="calWeekNo" style="cursor:default;">'+k.weekNo()+"</td>"}if(s)for(f=0;f<20&&s<7;k=k.nextDay(),f++){j+="<td"+this.td(k)+">"+k.formatString("%d")+"</td>";s++}j+="\t</tr>\r\n</table>";this.div.innerHTML=j};
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,t=c.length>2?Number(c[2]):0,k=c.length>3?c[3]:null;if(isNaN(d)||d==null)return false;if(isNaN(h)||h==null)return false;
if(isNaN(t))if(/(AM|PM)/.test(c[2])){k=c[2].toUpperCase();t=0}else return false;if(k=="PM"&&d<12)d+=12;if(d<0||d>23)return false;if(h<0||h>59)return false;if(t<0||t>59)return false;return new Date(1900,0,1,d,h,t)}catch(n){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+"."};
