﻿
function checkForm(){
  if (document.contactForm.Absender.value == ""){
    alert("Bitte Ihren Namen eingeben!");
    return false;
  }
  if (document.contactForm.Nachricht.value == ""){
    alert("Bitte Ihre Mitteilung eingeben!");
    return false;
  }
  return true;
}
function submitForm(){
	if(document.contactForm.onsubmit()){
		if(checkForm())
			document.contactForm.submit();
	}
}
function resetForm(){
	if(document.contactForm.onsubmit())
		document.contactForm.reset();
}
function setButton(){
	document.getElementById("sendButton").innerHTML = "<a href=\"index.php?page=contact\" onclick=\"submitForm(); return false;\">Senden</a>";
	document.getElementById("resetButton").innerHTML = "<a href=\"index.php?page=contact\" onclick=\"resetForm(); return false;\">Zur&uuml;cksetzen</a>";
}
window.onload = function(){
	setButton()
}


