function lastMinute(u, t, w, h){
	window.open(u, t, "width=" + w + " , height=" + h + " , top=0, left=0, dependent=yes, scrollbars=yes, resizable=yes");
}

function Search(){
	document.SUCH.submit();
}
Von=0;
Bis=11;

function TCHECK(VonBis){
	with (document.SUCH){
		Von1 = document.SUCH.VON.selectedIndex
		Bis = Math.max(Math.min( document.SUCH.BIS.selectedIndex + Von1-Von ,document.SUCH.BIS.length-1),0);
		document.SUCH.BIS.selectedIndex = Bis;
		Von=Von1
		window.status="Von: "+Von
	}	
}

function SELECT_VON(){
	document.write("<select name='VON' size=1 onChange=TCHECK(0)>")
	for (var i=2; i<=100;i++){
		document.write('<option value='+i+'>'+GetDatum(i)+'')
	}
	document.write("</select>")
}

function SELECT_BIS(){
	document.write("<select name='BIS' size=1 >")
//document.write('<option value=-14>max. 14 Tage später')
	for (var i=5; i<=120;i++){
		if (i==16)
			document.write('<option selected ');
		else
			document.write('<option ');
		document.write('value='+i+'>'+GetDatum(i)+'')
	}
	document.write('</select>')
}

function GetDatum(offset){ 
	DatArray = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","??" )
	var time = new Date()
	time.setTime( time.getTime()+offset*86400000);

	tag     = time.getDate();
	monat   = time.getMonth()+1;
	jahr    = time.getYear() % 100;
	if (tag   < 10)
		tag   = "0"+tag;
	if (monat < 10)
		monat = "0"+monat;
	if (jahr  < 10)
		jahr  = "0"+jahr;
	return tag+'.'+monat+'.'+jahr+' - '+DatArray[time.getDay()]
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true)
		with (navigator) {
			if ((appName=='Netscape')&&(parseInt(appVersion)==4)) {
				document.MM_pgW=innerWidth;
				document.MM_pgH=innerHeight;
				onresize=MM_reloadPage;
			}
		}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
		location.reload();
}

MM_reloadPage(true);
