var NUM_CENTYEAR=30;var BUL_TIMECOMPONENT=false;var BUL_YEARSCROLL=true;var calendars=[];var lookups=[];var RE_NUM=/^\-?\d+$/;var webPath="";var NS4=(navigator.appName.indexOf("Netscape")>=0&&!document.getElementById)?true:false;var IE4=(document.all&&!document.getElementById)?true:false;var IE5=(document.getElementById&&document.all)?true:false;var NS6=(document.getElementById&&navigator.appName.indexOf("Netscape")>=0)?true:false;var mx,my;function moveobj(a){if(NS4||NS6){mx=a.screenX;my=a.screenY}else{if(IE5||IE4){mx=event.screenX;my=event.screenY}}}if(NS4){document.captureEvents(Event.MOUSEMOVE)}document.onmousemove=moveobj;function call_cal(b,c){var a=new calendar1(b);a.year_scroll=true;a.time_comp=true;a.popup(c)}function call_cal_notime(b,c){var a=new calendar1(b);a.year_scroll=true;a.time_comp=false;a.popup(c)}function calendar1(a){this.gen_date=cal_gen_date1;this.gen_time=cal_gen_time1;this.gen_tsmp=cal_gen_tsmp1;this.prs_date=cal_prs_date1;this.prs_time=cal_prs_time1;this.prs_tsmp=cal_prs_tsmp1;this.popup=cal_popup1;if(!a){return cal_error("Error calling the calendar: no target control specified")}if(a.value==null){return cal_error("Error calling the calendar: parameter specified is not valid tardet control")}this.target=a;this.time_comp=BUL_TIMECOMPONENT;this.year_scroll=BUL_YEARSCROLL;this.id=calendars.length;calendars[this.id]=this}function cal_popup1(b){this.dt_current=this.prs_tsmp(b?b:this.target.value);if(!this.dt_current){return}var a=window.open("/images/calendar.html?datetime="+this.dt_current.valueOf()+"&id="+this.id,"Calendar","width=250,height="+(this.time_comp?270:235)+",status=no,resizable=yes,top="+my+",left="+mx+",dependent=yes,alwaysRaised=yes");a.opener=window;a.focus()}function cal_gen_tsmp1(a){return(this.gen_date(a)+" "+this.gen_time(a))}function cal_gen_date1(a){return(a.getFullYear()+"-"+(a.getMonth()<9?"0":"")+(a.getMonth()+1)+"-"+(a.getDate()<10?"0":"")+a.getDate())}function cal_gen_time1(a){return((a.getHours()<10?"0":"")+a.getHours()+":"+(a.getMinutes()<10?"0":"")+(a.getMinutes())+":"+(a.getSeconds()<10?"0":"")+(a.getSeconds())+"."+(a.getMilliseconds()))}function cal_prs_tsmp1(b){if(!b){return(new Date())}if(RE_NUM.exec(b)){return new Date(b)}var a=b.split(" ");return this.prs_time(a[1],this.prs_date(a[0]))}function cal_prs_date1(c){var d=c.split("-");if(d.length!=3){return cal_error("Invalid date format: '"+c+"'.\nFormat accepted is dd-mm-yyyy.")}if(!d[2]){return cal_error("Invalid date format: '"+c+"'.\nNo day of month value can be found.")}if(!RE_NUM.exec(d[2])){return cal_error("Invalid day of month value: '"+d[2]+"'.\nAllowed values are unsigned integers.")}if(!d[1]){return cal_error("Invalid date format: '"+c+"'.\nNo month value can be found.")}if(!RE_NUM.exec(d[1])){return cal_error("Invalid month value: '"+d[1]+"'.\nAllowed values are unsigned integers.")}if(!d[0]){return cal_error("Invalid date format: '"+c+"'.\nNo year value can be found.")}if(!RE_NUM.exec(d[0])){return cal_error("Invalid year value: '"+d[0]+"'.\nAllowed values are unsigned integers.")}var b=new Date();b.setDate(1);if(d[1]<1||d[1]>12){return cal_error("Invalid month value: '"+d[1]+"'.\nAllowed range is 01-12.")}b.setMonth(d[1]-1);if(d[0]<100){d[2]=Number(d[0])+(d[0]<NUM_CENTYEAR?2000:1900)}b.setFullYear(d[0]);var a=new Date(d[0],d[1],0);b.setDate(d[2]);if(b.getMonth()!=(d[1]-1)){return cal_error("Invalid day of month value: '"+d[2]+"'.\nAllowed range is 01-"+a.getDate()+".")}return(b)}function cal_prs_time1(a,c){if(!c){return null}var b=String(a?a:"").split(":");if(!b[0]){c.setHours(0)}else{if(RE_NUM.exec(b[0])){if(b[0]<24){c.setHours(b[0])}else{return cal_error("Invalid hours value: '"+b[0]+"'.\nAllowed range is 00-23.")}}else{return cal_error("Invalid hours value: '"+b[0]+"'.\nAllowed values are unsigned integers.")}}if(!b[1]){c.setMinutes(0)}else{if(RE_NUM.exec(b[1])){if(b[1]<60){c.setMinutes(b[1])}else{return cal_error("Invalid minutes value: '"+b[1]+"'.\nAllowed range is 00-59.")}}else{return cal_error("Invalid minutes value: '"+b[1]+"'.\nAllowed values are unsigned integers.")}}var d=String(b[2]?b[2]:"").split(".");if(!d[0]){c.setSeconds(0)}else{if(RE_NUM.exec(d[0])){if(d[0]<60){c.setSeconds(d[0])}else{return cal_error("Invalid seconds value: '"+d[0]+"'.\nAllowed range is 00-59.")}}else{return cal_error("Invalid seconds value: '"+d[0]+"'.\nAllowed values are unsigned integers.")}}if(!d[1]){c.setMilliseconds(0)}else{if(RE_NUM.exec(d[1])){if(d[1]<1000){c.setMilliseconds(d[1])}else{return cal_error("Invalid milliseconds valus: '"+d[1]+"'.\nAllowed range is 00-999.")}}else{return cal_error("Invalid milliseconds value: '"+d[1]+"'.\nAllowed values are unsigned integers.")}}return c}function cal_error(a){alert(a);return null};