/* AJAX */
function getXMLHttp(){
  var xmlHttp
  try {
    //Firefox, Opera 8.0+, Safari
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)  {
    //Internet Explorer
    try{      
		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e){
      try{
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e){
        alert("Your browser does not support AJAX!")
        return false;
      }
    }
  }
  return xmlHttp;
}
function MakeRequest(parameters){
  var xmlHttp = getXMLHttp();
 
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      HandleResponse(xmlHttp.responseText);
    }
  }

  xmlHttp.open("POST", "sendForm.php", true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", parameters.length);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send(parameters);
}
function MakeRequest2(parameters){
  var xmlHttp = getXMLHttp();
 
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      HandleResponse(xmlHttp.responseText);
    }
  }

  xmlHttp.open("POST", "sendForm2.php", true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", parameters.length);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send(parameters);
}

function imprint(){
  var xmlHttp = getXMLHttp();
 
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      HandleResponse3(xmlHttp.responseText);
    }
  }

  xmlHttp.open("POST", "impressum.php", true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send();
}

function bform(parameters){
  var xmlHttp = getXMLHttp();
 
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      HandleResponse2(xmlHttp.responseText);
    }
  }

  xmlHttp.open("POST", "sendForm2.php", true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", parameters.length);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send(parameters);
}

function HandleResponse(response)
{
  document.getElementById('ResponseDiv').innerHTML = '<div class="reply">'+response+'</div>';
}
function HandleResponse2(response)
{
  document.getElementById('ResponseDiv2').innerHTML = '<div class="reply">'+response+'</div>';
}
function HandleResponse3(response)
{
  document.getElementById('fnsList').innerHTML = response;
}

function toggleCheck(){
 var current = document.getElementById('Kursinfo').value;
 if(current == 'ja'){
	document.getElementById('Kursinfo').value = 'nein';	 
 }
 else{
	document.getElementById('Kursinfo').value = 'ja';	 
 }
}function toggleCheck2(){
 var current = document.getElementById('okagbs').value;
 if(current == 'ja'){
	document.getElementById('okagbs').value = 'nein';	 
 }
 else{
	document.getElementById('okagbs').value = 'ja';	 
 }
}

