var zaehler=0;
var durch=false;
function zweiframes(){
	parent.inhalt.location.href="termineingabe.php4";
	parent.kontrolle.location.href="uebersicht.php4";
	}
function terminreset(){
	parent.inhalt.location.href="termineingabe.php4?edit=NULL";
	}

	
function terminpruefen(){
anf= document.termin.beginn.value;
end= document.termin.ende.value;

while(!durch){
	if(document.termin.titel.value==""){
		alert("Sie haben keine Bezeichnung fuer diesen Termin vergeben!");
		document.termin.titel.focus();
		durch=false;
		break;
		}
	else{
		zaehler++;
		}
	if(document.termin.beginn.value==""){
		alert("Sie haben keinen Anfangstermin angegeben!");
		document.termin.beginn.focus();
		durch=false;
		break;
		}
	else{
		zaehler++;
		}
	if(anf.indexOf(".")< 0 || anf.indexOf(".")>2 || anf.lastIndexOf(".")!=5){
		alert("Ihr Anfangsdatum hat nicht das richtige Format!\n (tt.mm.jjjj)");
		document.termin.beginn.focus();
		durch=false;
		break;
		}
	else{
		zaehler++;
		}
	if(document.termin.ende.value==""){
		document.termin.ende.value= document.termin.beginn.value;
		}
	if(zaehler== 3){
		durch= true;
		}
	}
	return durch;

}
function lkchange(){
lkeintr= document.termin.kreis.length;
bundesland= document.termin.bula.options[document.termin.bula.selectedIndex].text;
for(x=0; x<lkeintr; x++){
	if(document.termin.kreis.options[x].text== bundesland){
		document.termin.kreis.selectedIndex= x+1;
		}
	}
}
function monatsfilter(ui){
	monat= parent.inhalt.document.filter.mon.options[document.filter.mon.selectedIndex].value;
	parent.kontrolle.location.href="uebersicht.php4?mon="+monat+"&userid="+ui;
	}
function zweiframes(uid){
	parent.inhalt.location.href="start.php4?userid="+uid;
	parent.kontrolle.location.href="uebersicht.php4?userid="+uid;
	
	}
	
function filtersetzen(){
	monat= document.suche.mon.options[document.suche.mon.selectedIndex].value;
	jahr=document.suche.year.options[document.suche.year.selectedIndex].value;
	lv=document.suche.lave.options[document.suche.lave.selectedIndex].value;
	kr=document.suche.kreis.options[document.suche.kreis.selectedIndex].value;
	ka=document.suche.kat.options[document.suche.kat.selectedIndex].value;
	di=document.suche.disz.options[document.suche.disz.selectedIndex].value;
	ver="'"+document.suche.verein.value+"'";
	uid=document.suche.userid.value;
	parent.kontrolle.location.href="finden.php4?mon="+monat+"&jhr="+jahr+"&lave="+lv+"&kreis="+kr+"&kat="+ka+"&disz="+di+"&veranst="+ver+"&userid="+uid;
	}

