function validateFormOnSubmit(theForm) {
	var reason = "";

	reason += validateEmpty(theForm.name);
	reason += validateEmpty(theForm.message);
	reason += validateEmpty(theForm.recaptcha_response_field);

	if (reason != "") {
		alert("Einige Felder sind nicht korrekt:\n\n" + reason);
		return false;
	}

	return true;
}

function validateEmpty(fld) {
	var error = "";
 
    if (fld.value.length == 0) {
    	fld.style.background = '#ddd'; 
        error = "Bitte alle Pflichtfelder ausfüllen.\n"
    } else {
        fld.style.background = '#fff';
    }

    return error;  
}
