function check_form(f) { // f is the form (passed using the this keyword)
if(f.subject.value.length < 1){
alert("Bitte geben Sie einen Betreff an!");
f.subject.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.subject.style.background = "#FF0000";
}
// make sure the form is not submitted
return false;
}

if(f.message.value.length < 1){
alert("Bitte geben Sie eine Nachricht an!");
f.message.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.message.style.background = "#FF0000";
}
// make sure the form is not submitted
return false;
}

if(f.name.value.length < 1){
alert("Bitte geben Sie einen Namen an!");
f.name.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.name.style.background = "#FF0000";
}
// make sure the form is not submitted
return false;
}

// check the  email address
if(!check_email(f.email.value)){
alert("Bitte überprüfen Sie die E-Mail-Adresse!");
f.email.focus(); 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.email.style.background = "#FF0000";
}
// make sure the form is not submitted
return false;
}
}
