// JavaScript Document

function ResetCheck()
{
pruef=window.confirm("Sind Sie sicher, dass Sie die Eingaben verwerfen wollen?");
return pruef;
}

function resetStyle(){
	//alert("Wird geprüft");
	document.getElementById('error').style.visibility = "hidden";
	document.Formular.name.style.backgroundColor = "";
	document.Formular.mail.style.backgroundColor = "";
	document.Formular.thema.style.backgroundColor = "";
	document.Formular.nachricht.style.backgroundColor = "";	
	document.Formular.datenschutz.style.backgroundColor = "";
}

function chkFormular()
{
	resetStyle();   
// -------------- NAME
  if(document.Formular.name.value == "")
  {
   document.getElementById('error').style.visibility = "visible";
   document.Formular.name.style.backgroundColor = "#FFE6E6";
   document.Formular.name.focus();
   return false;
  }

// -------------- E-Mail
 if(document.Formular.mail.value == "")
  {
   document.getElementById("error").style.visibility = "visible";
   document.Formular.mail.style.backgroundColor = "#FFE6E6";
   document.Formular.mail.focus();
   return false;
  }
  
  if(document.Formular.mail.value.indexOf('@') == -1)
  {
   document.Formular.mail.style.backgroundColor = "#FFE6E6";
   document.Formular.mail.focus();
   return false;
  }

  // -------------- Thema: Grund für die Anfrage
  if(document.Formular.thema.value == "")
  {
   document.getElementById('error').style.visibility = "visible";
   document.Formular.thema.style.backgroundColor = "#FFE6E6";
   document.Formular.thema.focus();
   return false;
  }
  
  // -------------- Nachricht
  if(document.Formular.nachricht.value == "")
  {
   document.getElementById('error').style.visibility = "visible";
   document.Formular.nachricht.style.backgroundColor = "#FFE6E6";
   document.Formular.nachricht.focus();
   return false;
  }
  
  if(!document.Formular.datenschutz.checked)
  {
   document.getElementById('error').style.visibility = "visible";
   document.Formular.datenschutz.style.backgroundColor = "#FFE6E6";
   document.Formular.datenschutz.focus();
   return false;
  }
}
  function hide(obj){
  	document.getElementById(obj).style.visibility = "hidden";
  }
  function show(obj){
  	document.getElementById(obj).style.visibility = "visible";
  }