var db_history_date="2021.12.31.23.59.59";
var jl_csc_id=0;
var jl_tr_comp=1;
var jl_tr_person=2;
var jl_ad_street=3;
var jl_tr_hsno=4;
var jl_ad_country=5;
var jl_ad_zipcode=6;
var jl_ad_city=7;
var jl_tr_remark=8;
var jl_tr_commission_no=9;
var jl_hide_tr_remark=10;
var jl_tmp_add_srvs=11;
var jl_tmp_add_srvt=12;
var jl_tmp_add_mult=13;
var jl_tmp_add_mult_price=14;
var jl_tr_ware_from=15;
var jl_tr_ware_to=16;
var jl_csc_id_payer=17;
var jl_tr_mediationarea_id=18;

var GEO_EARTH_RADIUS=6371.0;
var FILLDATEFIELDSSTARTYEAR=2004;
function checkBrowser()
{
if(screen.width<1024||screen.height<768)
alert("Diese Anwendung benötigt eine Bildschirmauflösung von mindestens 1024 x 768 Pixeln.\n"+
"Bei einer kleineren Auflösung sind einige Bereiche auf dem Bildschirm möglicherweise nicht sichtbar.");
}
function mkPopupWin(content,widthPopupWin,heightPopupWin)
{
var leftPopupWin;
var topPopupWin;
var popupWin;
var params="";
if(widthPopupWin==0){
widthPopupWin=250;
}else{
params=",resizable=yes, scrollbars=yes";
}
if(heightPopupWin==0)heightPopupWin=10;
var leftPopupWin=(screen.width / 2)-(widthPopupWin / 2);
var topPopupWin=(screen.height / 2)-(heightPopupWin / 2)-50;
var popupWin;
checkDoneContents="";
if(typeof(parent.job_options)!='undefined')
{
parent.job_options.isCurrentlySubmitting=true;
checkDoneContents=
"  if (++checkDoneCnt == 300)\n"+
"  {\n"+
"    //alert(\"Der Server antwortet nicht. Bitte überprüfen Sie,\\n\" +\n"+
"    //      \"ob Sie noch mit dem Internet verbunden sind!\");\n"+
"    opener.parent.job_options.isCurrentlySubmitting = false;\n"+
"    //self.close();\n"+
"  }\n"+
"  else\n"+
"  {\n"+
"    if (typeof (opener.parent.job_options) != 'undefined')\n"+
"    {\n"+
"      if (!opener.parent.job_options.isCurrentlySubmitting)\n"+
"      {\n"+
"//        opener.parent.job_tour.location.reload();\n"+
"//        opener.parent.job_tour_list.location.reload();\n"+
"        self.setTimeout(\"self.close()\",100);\n"+
"      }\n"+
"      else\n"+
"      {\n"+
"        self.setTimeout(\"checkDone()\",100);\n"+
"      }\n"+
"    }\n"+
"    else\n"+
"    {\n"+
"      self.setTimeout(\"checkDone()\",100);\n"+
"    }\n"+
"  }\n";
}
popupWin=window.open("about:blank","",
"dependent=yes,width="+widthPopupWin+",height="+heightPopupWin+
",left="+leftPopupWin+",top="+topPopupWin+params);
popupWin.document.open();
popupWin.document.writeln(
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"+
"<html lang=\"de\">\n"+
"<head>\n"+
"<title>votian: Auftragserfassung - Daten&uuml;bertragung...<\/title>\n"+
"<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/phoenix.css.php\">\n"+
"<script type=\"text/javascript\">\n"+
"<!"+"--\n"+
"\n"+
"var checkDoneCnt = 0;\n"+
"\n"+
"function checkDone()\n"+
"{\n"+
checkDoneContents+
"}\n"+
"\n");
popupWin.document.writeln(content);
popupWin.document.close();
return popupWin;
}
function dateTimeFormat(val)
{
var strVal;
if(!isNaN(val))
{
val=parseInt(val,10);
strVal=val.toString(10);
if(val>=0&&val<=9)strVal="0"+strVal;
}
else
{
return val;
}
return strVal;
}
function getNumIndex(frameIdx,formIdx,elemIdx)
{
var numIdx=new Array(-1,-1,-1);
var parentDocument=parent.document;
if(frameIdx!=""){
if(isNaN(frameIdx))
{
for(var i=0;i<parent.frames.length;i++){
if(parent.frames[i].name==frameIdx)
{
numIdx[0]=i;
break;
}
}
}else{
numIdx[0]=frameIdx;
}
parentDocument=parent.frames[numIdx[0]].document;
}
if(formIdx=="")
return numIdx;
if(isNaN(formIdx))
{
for(var i=0;i<parentDocument.forms.length;i++){
if(parentDocument.forms[i].name==formIdx)
{
numIdx[1]=i;
break;
}
}
}else{
numIdx[1]=formIdx;
}
if(elemIdx=="")
return numIdx;
if(isNaN(elemIdx))
{
for(var i=0;i<parentDocument.forms[numIdx[1]].elements.length;i++){
if(parentDocument.forms[numIdx[1]].elements[i].name==elemIdx)
{
numIdx[2]=i;
break;
}
}
}else{
numIdx[2]=elemIdx;
}
return numIdx;
}
function getParent(frameIdx)
{
var theParent=parent;
if(frameIdx!=""){
if(isNaN(frameIdx)){
for(var i=0;i<parent.frames.length;i++){
if(parent.frames[i].name==frameIdx){
theParent=parent.frames[i];
break;
}
}
}else{
theParent=parent.frames[frameIdx];
}
}
return theParent;
}
function getParentDocument(frameIdx)
{
var parentDocument=parent.document;
if(frameIdx!=""){
if(isNaN(frameIdx)){
for(var i=0;i<parent.frames.length;i++){
if(parent.frames[i].name==frameIdx){
parentDocument=parent.frames[i].document;
break;
}
}
}else{
parentDocument=parent.frames[frameIdx].document;
}
}
return parentDocument;
}
function getElemByIndices(frameIdx,formIdx,elemIdx)
{
var parentDocument=getParentDocument(frameIdx);
if(isNaN(elemIdx))
return parentDocument.getElementsByName(elemIdx)[0];
else
return parentDocument.getElementsByName(formIdx)[0].elements[elemIdx];
}
function getOptionTextByVal(frameIdx,formIdx,elemIdx,val)
{
var theElem=getElemByIndices(frameIdx,formIdx,elemIdx);
for(i=0;i<theElem.length;i++)
{
if(theElem.options[i].value==val)
return theElem.options[i].text;
}
return("");
}
function optionTextExists(frameIdx,formIdx,elemIdx,textVal)
{
var theElem=getElemByIndices(frameIdx,formIdx,elemIdx);
for(i=0;i<theElem.length;i++)
{
if(theElem.options[i].text==textVal)
return(true);
}
return(false);
}
function getSelectedVal(frameIdx,formIdx,elemIdx)
{
var selVal="";
var i=0;
var found=0;
var theSelectedVal=getElemByIndices(frameIdx,formIdx,elemIdx);
if(theSelectedVal.type=="select-one"){
while(i<theSelectedVal.length&!found)
{
if(theSelectedVal.options[i].selected)
{
selVal=theSelectedVal.options[i].value;
found=1;
}
i+=1;
}
}else{
return theSelectedVal.value;
}
return selVal;
}
function getSelectedNumVal(frameIdx,formIdx,elemIdx)
{
var selVal=getSelectedVal(frameIdx,formIdx,elemIdx);
if(selVal!="")
selVal=parseInt(selVal,10);
else
selVal=0;
return selVal;
}
function isSelectField(frameIdx,formIdx,elemIdx)
{
var theElem=getElemByIndices(frameIdx,formIdx,elemIdx);
if(theElem.type!="select-one")
return false;
return true;
}
function delOptions(frameIdx,formIdx,elemIdx)
{
if(!isSelectField(frameIdx,formIdx,elemIdx))
return;
var theElem=getElemByIndices(frameIdx,formIdx,elemIdx);
while(theElem.length>0)
theElem.options[theElem.length-1]=null;
}
function addOption(frameIdx,formIdx,elemIdx,newVal,defaultSelected,selected)
{
if(!isSelectField(frameIdx,formIdx,elemIdx))
return;
var theElem=getElemByIndices(frameIdx,formIdx,elemIdx);
newOption=new Option(newVal,newVal,defaultSelected,selected);
theElem.options[theElem.length]=newOption;
}
function setSelectedOption(frameIdx,formIdx,elemIdx,val)
{
var theSelectedOption=getElemByIndices(frameIdx,formIdx,elemIdx);
if(theSelectedOption.type=="select-one"){
for(i=0;i<theSelectedOption.length;i++)
{
if(theSelectedOption.options[i].value==val)
theSelectedOption.options[i].selected=
true;
else
theSelectedOption.options[i].selected=
false;
}
}else{
theSelectedOption.value=val;
}
}
function setDateTimeFields(
frameIdx,formIdx,day,mon,year,hour,minute,dayIdx,monIdx,yearIdx,hourIdx,minuteIdx,rhythmIdx)
{
var daysOfWeek=new Array("Sonntag","Montag","Dienstag","Mittwoch",
"Donnerstag","Freitag","Sonnabend","Sonntag");
var selDate=new Date(year,mon-1,day);
var theParent=getParent(frameIdx);
if(!isSelectField(frameIdx,formIdx,dayIdx)&&day!=""&&mon!="")
{
day=dateTimeFormat(day);
mon=dateTimeFormat(mon);
if(hour!="")
hour=dateTimeFormat(hour);
if(minute!="")
minute=dateTimeFormat(minute);
}
if(isSelectField(frameIdx,formIdx,yearIdx))
mkNewDayOptions(frameIdx,formIdx,dayIdx,mon,year);
setSelectedOption(frameIdx,formIdx,dayIdx,day);
setSelectedOption(frameIdx,formIdx,monIdx,mon);
setSelectedOption(frameIdx,formIdx,yearIdx,year);
if(hourIdx!=""&&minuteIdx!="")
{
setSelectedOption(frameIdx,formIdx,hourIdx,hour);
setSelectedOption(frameIdx,formIdx,minuteIdx,minute);
}
if(rhythmIdx!="")
{
rhythmElem=getElemByIndices(frameIdx,formIdx,rhythmIdx);
dayOfWeekElem=getElemByIndices(frameIdx,formIdx,"dayOfWeek");
if(day.toString(10)!=""&&mon.toString(10)!=""&&year.toString(10)!=""
&&hour.toString(10)!=""&&minute.toString(10)!="")
{
dayOfWeekElem.value="("+daysOfWeek[selDate.getDay()]+")";
if(theParent.isPublicHoliday(year,mon,day)){
dayOfWeekElem.className="hideSmallRed";
}else{
dayOfWeekElem.className="hideSmall";
}
rhythmElem.disabled=false;
}
else
{
dayOfWeekElem.value="";
dayOfWeekElem.className="hideSmall";
setSelectedOption(frameIdx,formIdx,rhythmIdx,"");
rhythmElem.disabled=true;
}
}
}
function fillDateFieldsCheck(
init,frameIdx,formIdx,callerIdx,dayIdx1,monIdx1,yearIdx1,hourIdx1,minuteIdx1,rhythmIdx1,
dayIdx2,monIdx2,yearIdx2,hourIdx2,minuteIdx2,rhythmIdx2)
{
var selMon1=0;
var selYear1=0;
var selDay1=0;
var selHour1=0;
var selMinute1=0;
var selMon2=0;
var selYear2=0;
var selDay2=0;
var selHour2=0;
var selMinute2=0;
if(callerIdx==dayIdx1||callerIdx==monIdx1||callerIdx==yearIdx1||callerIdx==hourIdx1||callerIdx==minuteIdx1)
fillDateFields(init,frameIdx,formIdx,callerIdx,dayIdx1,monIdx1,yearIdx1,hourIdx1,minuteIdx1,rhythmIdx1);
if(callerIdx==dayIdx2||callerIdx==monIdx2||callerIdx==yearIdx2||callerIdx==hourIdx2||callerIdx==minuteIdx2)
fillDateFields(init,frameIdx,formIdx,callerIdx,dayIdx2,monIdx2,yearIdx2,hourIdx2,minuteIdx2,rhythmIdx2);
if(getSelectedVal(frameIdx,formIdx,callerIdx)!="")
{
var selDay1=getSelectedNumVal(frameIdx,formIdx,dayIdx1);
var selMon1=getSelectedNumVal(frameIdx,formIdx,monIdx1);
var selYear1=getSelectedNumVal(frameIdx,formIdx,yearIdx1);
if(hourIdx1!=""&&minuteIdx1!="")
{
selHour1=getSelectedNumVal(frameIdx,formIdx1,hourIdx1);
selMinute1=getSelectedNumVal(frameIdx,formIdx1,minuteIdx1);
}
var selDay2=getSelectedNumVal(frameIdx,formIdx,dayIdx2);
var selMon2=getSelectedNumVal(frameIdx,formIdx,monIdx2);
var selYear2=getSelectedNumVal(frameIdx,formIdx,yearIdx2);
if(hourIdx2!=""&&minuteIdx2!="")
{
selHour2=getSelectedNumVal(frameIdx,formIdx2,hourIdx2);
selMinute2=getSelectedNumVal(frameIdx,formIdx2,minuteIdx2);
}
var selDateCheck1=new Date(selYear1,selMon1-1,selDay1,selHour1,selMinute1,0);
var selDateCheck2=new Date(selYear2,selMon2-1,selDay2,selHour2,selMinute2,0);
if(selDateCheck1.getTime()>selDateCheck2.getTime()){
var selMonStr="";
var selYearStr="";
var selDayStr="";
var selHourStr="";
var selMinuteStr="";
selDayStr=getSelectedVal(frameIdx,formIdx,dayIdx1);
selMonStr=getSelectedVal(frameIdx,formIdx,monIdx1);
selYearStr=getSelectedVal(frameIdx,formIdx,yearIdx1);
if(hourIdx1!=""&&minuteIdx1!="")
{
selHourStr=getSelectedVal(frameIdx,formIdx,hourIdx1);
selMinuteStr=getSelectedVal(frameIdx,formIdx,minuteIdx1);
}else{
selHourStr="";
selMinuteStr="";
}
setDateTimeFields(frameIdx,formIdx,selDayStr,selMonStr,selYearStr,selHourStr,selMinuteStr,dayIdx2,monIdx2,yearIdx2,hourIdx2,minuteIdx2,rhythmIdx2);
return fillDateFieldsCheck(init,frameIdx,formIdx,callerIdx,dayIdx1,monIdx1,yearIdx1,hourIdx1,minuteIdx1,rhythmIdx1,
dayIdx2,monIdx2,yearIdx2,hourIdx2,minuteIdx2,rhythmIdx2);
}
var isDbhistory=false;
var quarterDate=new Date();
var quarterDayStr="";
var quarterMonStr="";
var quarterYearStr="";
var now=new Date();
var todayYear=now.getYear();
if(todayYear<999)todayYear+=1900;
var dateArr=db_history_date.split(".");
quarterDate=new Date(dateArr[0],dateArr[1]-1,dateArr[2],dateArr[3],dateArr[4],dateArr[5]);
quarterDayStr=dateArr[2];
quarterMonStr=dateArr[1];
quarterYearStr=dateArr[0];
if(!(
(selDateCheck1.getTime()>quarterDate.getTime()&&selDateCheck2.getTime()>quarterDate.getTime())||
(selDateCheck1.getTime()<quarterDate.getTime()&&selDateCheck2.getTime()<quarterDate.getTime())
)){
var isDbhistory=true;
alert("Der gewählte Zeitraum beinhaltet den Quartalswechsel zum "+quarterDayStr+"."+quarterMonStr+"."+quarterYearStr+
".\n Aufträge bis einschließlich diesem Datum liegen nur noch in der Archivdatenbank vor, daher wird das Enddatum auf den "
+quarterDayStr+"."+quarterMonStr+"."+quarterYearStr+" gesetzt!");
setDateTimeFields(frameIdx,formIdx,quarterDayStr,quarterMonStr,quarterYearStr,"","",dayIdx2,monIdx2,yearIdx2,hourIdx2,minuteIdx2,rhythmIdx2);
}else{
if(selDateCheck1.getTime()<quarterDate.getTime()&&selDateCheck2.getTime()<quarterDate.getTime())
var isDbhistory=true;
}
var dbhistoryElem=getElemByIndices(frameIdx,formIdx,"dbhistory");
if(typeof(dbhistoryElem)!='undefined')
{
if(isDbhistory)
dbhistoryElem.value="1";
else
dbhistoryElem.value="0";
}
}
}
function fillDateFields(
init,frameIdx,formIdx,callerIdx,dayIdx,monIdx,yearIdx,hourIdx,minuteIdx,rhythmIdx)
{
var daysPerMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var curDate=new Date();
var curYear=curDate.getYear();
if(curYear<999){
if(curYear>99){
curYear+=1900;
}else{
curYear+=2000;
}
}
var curDateMidnight=new Date(curYear,curDate.getMonth(),curDate.getDate(),0,0,0);
var mkNewDays=false;
var selMonStr="";
var selYearStr="";
var selDayStr="";
var selHourStr="";
var selMinuteStr="";
var selMon=0;
var selYear=0;
var selDay=0;
var selHour=0;
var selMinute=0;
if(!init)
{
if(getSelectedVal(frameIdx,formIdx,callerIdx)=="")
return setDateTimeFields(frameIdx,formIdx,"","","","","",dayIdx,monIdx,yearIdx,hourIdx,minuteIdx,rhythmIdx);
else
{
selDayStr=getSelectedVal(frameIdx,formIdx,dayIdx);
selMonStr=getSelectedVal(frameIdx,formIdx,monIdx);
selYearStr=getSelectedVal(frameIdx,formIdx,yearIdx);
selDay=getSelectedNumVal(frameIdx,formIdx,dayIdx);
selMon=getSelectedNumVal(frameIdx,formIdx,monIdx);
selYear=getSelectedNumVal(frameIdx,formIdx,yearIdx);
if(hourIdx!=""&&minuteIdx!="")
{
selHour=getSelectedNumVal(frameIdx,formIdx,hourIdx);
selMinute=getSelectedNumVal(frameIdx,formIdx,minuteIdx);
selHourStr=getSelectedVal(frameIdx,formIdx,hourIdx);
selMinuteStr=getSelectedVal(frameIdx,formIdx,minuteIdx);
}else{
selHour=0;
selMinute=0;
selHourStr="";
selMinuteStr="";
}
}
}
if(!isSelectField(frameIdx,formIdx,dayIdx))
{
if(!(selDayStr==""||selMonStr==""||selYearStr==""||selDay==0||selMon==0)){
if(selYear<100)
selYear+=2000;
if(selYear<1900)
selYear=1900;
var selDate=new Date(selYear,selMon-1,selDay,selHour,selMinute,0);
selDay=selDate.getDate();
selMon=selDate.getMonth()+1;
selYear=selDate.getFullYear();
selHour=selDate.getHours();
selMinute=selDate.getMinutes();
selDayStr=dateTimeFormat(selDate.getDate());
selMonStr=dateTimeFormat(selDate.getMonth()+1);
selYearStr=dateTimeFormat(selDate.getFullYear());
selHourStr=dateTimeFormat(selDate.getHours());
selMinuteStr=dateTimeFormat(selDate.getMinutes());
}
}
if(init)
{
mkNewDays=true;
addOption(frameIdx,formIdx,monIdx,"",true,true);
for(var i=0;i<12;i++)
addOption(frameIdx,formIdx,monIdx,dateTimeFormat(i+1),false,false);
addOption(frameIdx,formIdx,yearIdx,"",true,true);
var j=0;
while(FILLDATEFIELDSSTARTYEAR+j<=curYear+1)
addOption(frameIdx,formIdx,yearIdx,FILLDATEFIELDSSTARTYEAR+j++,false,false);
if(hourIdx!=""&&minuteIdx!="")
{
addOption(frameIdx,formIdx,hourIdx,"",true,true);
for(var i=0;i<24;i++)
addOption(frameIdx,formIdx,hourIdx,dateTimeFormat(i),false,false);
addOption(frameIdx,formIdx,minuteIdx,"",true,true);
for(var i=0;i<60;i+=5)
addOption(frameIdx,formIdx,minuteIdx,dateTimeFormat(i),false,false);
}
}
else{
    var parent_job_options_empModeLaterJob = 1;
    var parent_job_options_is_afterwards = true;
    var parent_job_options_was_afterwards = true;
    if (typeof (parent.job_options) != 'undefined') {
      parent_job_options_empModeLaterJob = parent.job_options.empModeLaterJob;
      parent_job_options_is_afterwards = parent.job_options.is_afterwards;
      parent_job_options_was_afterwards = parent.job_options.was_afterwards;
    }
if(typeof(parent.job_options)!='undefined'||formIdx=="jb_dispoinfo_form")
if (parent_job_options_empModeLaterJob != "1"||formIdx=="jb_dispoinfo_form")
{
if(callerIdx==monIdx||callerIdx==yearIdx)
mkNewDays=true;
if(selYearStr=="")
selYear=curYear;
if(selMonStr==""||selMon==0)
selMon=curDate.getMonth()+1;
if(selDayStr==""||selDay==0)
{
if(selYear==curYear&&selMon==curDate.getMonth()+1)
selDay=curDate.getDate();
else
selDay=1;
}
if(((hourIdx!=""&&minuteIdx!="")||dayIdx=="endetag")&&((!parent_job_options_is_afterwards&&!parent_job_options_was_afterwards)||formIdx=="jb_dispoinfo_form"))
{
selDate=new Date(selYear,selMon-1,selDay,0,0,0);
if(selDate.getTime()<curDateMidnight.getTime())
{
if(callerIdx==dayIdx)
if(++selMon>12)
{
selMon=1;
selYear=curYear+1;
}
if(callerIdx==monIdx)
selYear=curYear+1;
if(callerIdx==yearIdx)
{
selMon=curDate.getMonth()+1;
if(selDay<curDate.getDate())
if(++selMon>12)
{
selMon=1;
selYear=curYear+1;
}
}
}
}
if((hourIdx!=""&&minuteIdx!="")&&(callerIdx!=hourIdx&&callerIdx!=minuteIdx))
{
selDate=new Date(selYear,selMon-1,selDay,0,0,0);
if(selHour==""&&selHour.toString(10)!="0"||selDate.getTime()==
curDateMidnight.getTime())
{
if(selDate.getTime()==curDateMidnight.getTime()&&selHour<curDate.getHours())
selHour=curDate.getHours();
else if(selHour==""&&selHour.toString(10)!="0")
selHour=0;
}
else if(selHour==""&&selHour.toString(10)!="0")
selHour=0;
if((selMinute==""&&selMinute.toString(10)!="0")||
(selHour==curDate.getHours()&&selDate.getTime()==curDateMidnight.getTime()))
{
if(selHour==curDate.getHours()&&selDate.getTime()==
curDateMidnight.getTime()&&selMinute<=curDate.getMinutes())
{
selMinute=curDate.getMinutes()+1;
while(selMinute%5>0)selMinute++;
if(selMinute==60)
{
selMinute=0;
if(++selHour>23)
{
selHour-=24;
if(++selDay>daysPerMonth[selMon-1])
{
selDay=1;
if(++selMon>12)
{
selMon=1;
selYear=curYear+1;
}
}
}
}
}
else if(selMinute==""&&selMinute.toString(10)!="0")
selMinute=0;
}
else if(selMinute==""&&selMinute.toString(10)!="0")
selMinute=0;
selHourStr=dateTimeFormat(selHour);
selMinuteStr=dateTimeFormat(selMinute);
}
selDayStr=dateTimeFormat(selDay);
selMonStr=dateTimeFormat(selMon);
selYearStr=dateTimeFormat(selYear);
}
}
if(mkNewDays)
{
mkNewDayOptions(frameIdx,formIdx,dayIdx,selMon,selYear);
if(selDay>daysPerMonth[selMon-1])
selDay=daysPerMonth[selMon-1];
}
if(!init)
{
if(selDay==0)
selDayStr="";
if(selMon==0)
selMonStr="";
setDateTimeFields(frameIdx,formIdx,selDayStr,selMonStr,selYearStr,selHourStr,selMinuteStr,dayIdx,monIdx,yearIdx,hourIdx,minuteIdx,rhythmIdx);
if(typeof(parent.job_options)!='undefined'&&(callerIdx==dayIdx||callerIdx==monIdx||callerIdx==yearIdx)
&&!(selDayStr==""|selMonStr==""|selYearStr=="")){
if(typeof(parent.job_options.document.tourOptions.afterwards.checked)!='undefined')
{
var selDateCheck=new Date(selYear,selMon-1,selDay,selHour,selMinute,0);
if((parent.job_options.document.tourOptions.afterwards.checked||parent.job_options.was_afterwards)&&selDateCheck.getTime()>curDate.getTime()&&selDateCheck.getDate()!=curDate.getDate())
alert("Achtung: Der Zeitpunkt "+selDayStr+"."+selMonStr+"."+selYearStr+", "+selHourStr+":"+selMinuteStr+" liegt in der Zukunft!");
else{
if(!(parent.job_options.document.tourOptions.afterwards.checked||parent.job_options.was_afterwards)&&selDateCheck.getTime()<curDate.getTime()&&selDateCheck.getDate()!=curDate.getDate())
alert("Achtung: Der Zeitpunkt "+selDayStr+"."+selMonStr+"."+selYearStr+", "+selHourStr+":"+selMinuteStr+" liegt in der Vergangenheit!");
else{
var fourWeeksBefore=new Date();
var absNow=fourWeeksBefore.getTime();
var absThen=absNow-(31*24*60*60*1000);
fourWeeksBefore.setTime(absThen);
if(selDateCheck.getTime()<fourWeeksBefore.getTime())
{
alert("Achtung: Der Zeitpunkt "+selDayStr+"."+selMonStr+"."+selYearStr+", "+selHourStr+":"+selMinuteStr+" liegt mehr als vier Wochen in der Vergangenheit!")
}
var fourWeeksAhead=new Date();
var absThen=absNow+(31*24*60*60*1000);
fourWeeksAhead.setTime(absThen);
if(selDateCheck.getTime()>fourWeeksAhead.getTime())
{
alert("Achtung: Der Zeitpunkt "+selDayStr+"."+selMonStr+"."+selYearStr+", "+selHourStr+":"+selMinuteStr+" liegt mehr als vier Wochen in der Zukunft!")
}
}
}
}
}
}
}
function mkNewDayOptions(frameIdx,formIdx,dayIdx,selMon,selYear)
{
var daysPerMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
if(selMon==2)
{
if(selYear%4==0)
if(selYear<1582)
daysPerMonth[1]=29;
else if(!(selYear%100==0))
daysPerMonth[1]=29;
else if(selYear%400==0)
daysPerMonth[1]=29;
}
else if(selMon=="")
selMon=1;
delOptions(frameIdx,formIdx,dayIdx);
addOption(frameIdx,formIdx,dayIdx,"",true,true);
for(var i=0;i<daysPerMonth[selMon-1];i++)
addOption(frameIdx,formIdx,dayIdx,dateTimeFormat(i+1),false,false);
}
function isPublicHoliday(year,month,day)
{
for(i=0;i<ph.length;i++)
{
if(ph[i]==year+""+month+""+day)
{
return true;
}
}
return false;
}
