function benutzerHinzufuegen(terminID){

sendRequestBenutzerNeu(terminID);

}

function getXMLHttpRequest() {
	var httpReq = null;

	if (window.XMLHttpRequest){
		httpReq= new XMLHttpRequest();
	}
	else if (window.ActiveXObject){
		try{
			httpReq=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(ex){
			try{
				httpReq= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(ex)
			{
			}
		}
	}
	return httpReq;
}

function sendRequestBenutzerNeu(terminID){
	
	req = getXMLHttpRequest();
	if (req){
		req.onreadystatechange = reloadPage;
		req.open("get", "termin_db.php?terminID="+terminID, true);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencode");
		req.send(null);
	}
}

function reloadPage(){

	if(req.readyState==4)
		window.location.reload();

}


//Man soll auch mehrere Datumsangaben machen können, bspw. für Spieltage


var anzahlTermine=1; 


function neuerTermin(nummer){

	
	
	if(nummer==anzahlTermine){
		
		anzahlTermine++;
		var container=document.getElementById("terminliste");
		
		
		
		var neuerText=document.createElement("input");
		neuerText.name="datum"+anzahlTermine;
		neuerText.type="text";
		neuerText.className="zusatzTermin";
		neuerText.onclick=new Function("neuerTermin("+anzahlTermine+");");
		
		
		container.appendChild(document.createTextNode("Datum: "));
		container.appendChild(neuerText);
		container.appendChild(document.createElement("br"));
		
				
		
		
	}




}


