function check_form(f) { // f is the form (passed using the this keyword)

if(f.name.value.length < 2){
alert("Please enter your name");
f.name.focus(); // put the prompt in the name field 
// if the browserbrowser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.name.style.background = "white";
}
// make sure the form is not submitted
return false;
}

// check the email address ( the exclamation means "not" )
if(!check_email(f.email.value)){
alert("Please enter a valid Email Address");
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 = "white";
}
// make sure the form is not submitted
return false;
}


if(f.phone.value.length < 5){
alert("Please provide phone number");
f.phone.focus(); 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.phone.style.background = "white";
}
// make sure the form is not submitted
return false;
}

}
