<script>
<!--

function check_form(f) { // f is the form (passed using the this keyword)
if(f.name.value.length < 1){
alert("You entered less than one character in the name field.");
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 = "yellow";
}
// make sure the form is not submitted
return false;
}

// check the first email address ( the exclamation means "not" )
if(!check_email(f.email.value)){
alert("Invalid email detected.");
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 = "yellow";
}
// make sure the form is not submitted
return false;
}

// check the second email address
if(!check_email(f.another_email.value)){
alert("Invalid email detected.");
f.another_email.focus(); 
if(document.all || document.getElementByID){
f.another_email.style.background = "yellow";
}
return false;
}
}

// -->
</script>
