// Script für Destination Pages zum generieren des Datums in der Suchmaske Abdatum Redatum - Andre Wengorz - 12.02.2008
var DatArray = new Array("So","Mo","Di","Mi","Do","Fr","Sa","??" );
var MonArray = new Array("01","02","03","04","05","06","07","08","09","10","11","12","??");

function DatumBox(n,s){
 tt='';
 for (i=n; i<=300;i++) tt+='<option value="'+DatumParm(i)+'"'+((i==s)? ' selected':'')+'>'+MakeDatum(i)+'</option>';
 document.write(tt)
}

function MakeDatum(days){
 time = new Date
 time.setTime( time.getTime()+days*86400000)
 dd= ((time.getDate() >9) ? "":"0")+time.getDate()
 return( dd+'.'+MonArray[time.getMonth()]+'.-'+DatArray[time.getDay()] )
}

function DatumParm(days){
 time = new Date
 time.setTime( time.getTime()+days*86400000)
 dd= ((time.getDate() >9) ? "":"0")+time.getDate()
 mm= ((1+time.getMonth() >9) ? "":"0")+(1+time.getMonth())
 return( dd+'.'+mm+'.'+(2000+(time.getYear()%100)) )
}