var NUM_CENTYEAR=30;var BUL_TIMECOMPONENT=false;var BUL_YEARSCROLL=true;var calendars=[];var RE_NUM=/^\-?\d+$/;function calendar1(_1){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(!_1){return cal_error("Error calling the calendar: no target control specified");}if(_1.value==null){return cal_error("Error calling the calendar: parameter specified is not valid tardet control");}this.target=_1;this.time_comp=BUL_TIMECOMPONENT;this.year_scroll=BUL_YEARSCROLL;this.id=calendars.length;calendars[this.id]=this;}function cal_popup1(_2){this.dt_current=this.prs_tsmp(_2?_2:this.target.value);if(!this.dt_current){return;}var _3=window.open("calendar.php?datetime="+this.dt_current.valueOf()+"&id="+this.id,"Calendar","width=200,height="+(this.time_comp?215:190)+",status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes");_3.opener=window;_3.focus();}function cal_gen_tsmp1(_4){return (this.gen_date(_4)+" "+this.gen_time(_4));}function cal_gen_date1(_5){return ((_5.getDate()<10?"0":"")+_5.getDate()+"/"+(_5.getMonth()<9?"0":"")+(_5.getMonth()+1)+"/"+_5.getFullYear());}function cal_gen_time1(_6){return ((_6.getHours()<10?"0":"")+_6.getHours()+":"+(_6.getMinutes()<10?"0":"")+(_6.getMinutes())+":"+(_6.getSeconds()<10?"0":"")+(_6.getSeconds()));}function cal_prs_tsmp1(_7){if(!_7){return (new Date());}if(RE_NUM.exec(_7)){return new Date(_7);}var _8=_7.split(" ");return this.prs_time(_8[1],this.prs_date(_8[0]));}function cal_prs_date1(_9){var _a=new Date();var gg,mm,aaaa;var _c=_a.getDate()+"/"+(_a.getMonth()+1)+"/"+_a.getFullYear();_9=(_9=="gg/mm/aaaa")?_c:_9;var _d=_9.split("/");if(_d.length!=3){return cal_error("Formato della data invalido: '"+_9+"'.\nIl formato accettato gg/mm/yyyy.");}if(!_d[0]){return cal_error("Invalid date format: '"+_9+"'.\nNo day of month value can be found.");}if(!RE_NUM.exec(_d[0])){return cal_error("Invalid day of month value: '"+_d[0]+"'.\nAllowed values are unsigned integers.");}if(!_d[1]){return cal_error("Invalid date format: '"+_9+"'.\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[2]){return cal_error("Invalid date format: '"+_9+"'.\nNo year value can be found.");}if(!RE_NUM.exec(_d[2])){return cal_error("Invalid year value: '"+_d[2]+"'.\nAllowed values are unsigned integers.");}var _e=new Date();_e.setDate(1);if(_d[1]<1||_d[1]>12){return cal_error("Invalid month value: '"+_d[1]+"'.\nAllowed range is 01-12.");}_e.setMonth(_d[1]-1);if(_d[2]<100){_d[2]=Number(_d[2])+(_d[2]<NUM_CENTYEAR?2000:1900);}_e.setFullYear(_d[2]);var _f=new Date(_d[2],_d[1],0);_e.setDate(_d[0]);if(_e.getMonth()!=(_d[1]-1)){return cal_error("Giorno del Mese non corretto: '"+_d[0]+"'.\nIntervallo corretto 01-"+_f.getDate()+".");}return (_e);}function cal_prs_time1(_10,_11){if(!_11){return null;}var _12=String(_10?_10:"").split(":");if(!_12[0]){_11.setHours(0);}else{if(RE_NUM.exec(_12[0])){if(_12[0]<24){_11.setHours(_12[0]);}else{return cal_error("Invalid hours value: '"+_12[0]+"'.\nAllowed range is 00-23.");}}else{return cal_error("Invalid hours value: '"+_12[0]+"'.\nAllowed values are unsigned integers.");}}if(!_12[1]){_11.setMinutes(0);}else{if(RE_NUM.exec(_12[1])){if(_12[1]<60){_11.setMinutes(_12[1]);}else{return cal_error("Invalid minutes value: '"+_12[1]+"'.\nAllowed range is 00-59.");}}else{return cal_error("Invalid minutes value: '"+_12[1]+"'.\nAllowed values are unsigned integers.");}}if(!_12[2]){_11.setSeconds(0);}else{if(RE_NUM.exec(_12[2])){if(_12[2]<60){_11.setSeconds(_12[2]);}else{return cal_error("Invalid seconds value: '"+_12[2]+"'.\nAllowed range is 00-59.");}}else{return cal_error("Invalid seconds value: '"+_12[2]+"'.\nAllowed values are unsigned integers.");}}_11.setMilliseconds(0);return _11;}function cal_error(_13){alert(_13);return null;}

