// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header

var good;
function check_email_address(the_mail_address,fld_name) {

// Note: The next expression must be all on one line...
//       allow no spaces, linefeeds, or carriage returns!
var goodEmail = the_mail_address.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.cz)|(\.pl)|(\.fr)|(\.de)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);

if (goodEmail){
   good = true
} else {
   //alert('Please enter a valid e-mail address.')
   this.document.forms[0].elements[fld_name].focus()
   this.document.forms[0].elements[fld_name].select()
   good = false
   }
   
return good;   
}

function sendOff(){
   nmcheck = document.TheForm.nm.value    
   if (nmcheck.length <1) {
      alert('Please enter your name.')
      return
   }         
   good = false
   checkEmailAddress(document.TheForm.em)
   if ((document.TheForm.em.value ==
        document.TheForm.emx.value)&&(good)){
      // This is where you put your action
      // if name and email addresses are good.
      // We show an alert box, here; but you can
      // use a window.location= 'http://address'
      // to call a subsequent html page, 
      // or a Perl script, etc.
      alert("Name and email address fields verified good.")
   }     
   if ((document.TheForm.em.value !=
          document.TheForm.emx.value)&&(good)){
          alert('Both e-mail address entries must match.')
   }
}
