// Email Validation. Written by PerlScriptsJavaScripts.com
 function check_email(e) {
  ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM"; 
  for(i=0; i < e.length ;i++){
   if(ok.indexOf(e.charAt(i))<0){ 
   return (false);
   }	
  } 

 if (document.images) {
 re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
 re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
 if (!e.match(re) && e.match(re_two)) {
  return (-1);		
 } 
 }
}

  
function check_form(f) { // f is the form (passed using the this keyword)
 if(f.PNAME.value.length < 1){
 alert("You must enter your name.");
 f.PNAME.focus(); // put the prompt in the name field 
 // make sure the form is not submitted
 return false;
 }
 
 if(!check_email(f.EMAIL.value)){
 alert("Invalid email detected.");
 f.EMAIL.focus(); 
 return false;
}


if(f.ACTION.value == 'SAVE') {
  var CONFIRM;
  CONFIRM = confirm ('The information I have submitted here is complete and correct to the best of my knowledge.  I am aware that the college may choose to post this information on the College Web site and may choose to use it in future newsletters as well.');
  if(CONFIRM == 0) {
  return false;
  }
 }
}