 function checkEmail(fld)
 {
  inputValue = fld.value;
  var ri = /^[\w\-\.]+@[\w\-\.]+\.[\w]{2,}$/;
  return (!ri.test(inputValue))
 }

 function CheckForm (theForm)
 {
  var errmsg = "The following error(s) occured while trying to process the form:\n";
  errmsg += "__________________________________________________\n\n";
  var badmail = " is not valid e-mail address.\n";
  var passed = true;
   if (theForm.fname.value.length == 0) 
   { 
    passed = false;
    errmsg += "You need to enter your First Name.\n";
   }
   if (theForm.lname.value.length == 0) 
   { 
    passed = false;
    errmsg += "You need to enter your Last Name.\n";
   }
   if (theForm.postcode.value.length == 0) 
   { 
    passed = false;
    errmsg += "You need to enter your Zip code.\n";
   }
   if (theForm.con_email.value.length == 0)
   { 
    passed = false;
    errmsg += "You need to enter your E-mail address.\n";
   }
   else
   {
	if (checkEmail(theForm.email))
	{
	 passed = false;
	 errmsg += theForm.con_email.value + badmail
	}
   }
		
   if (passed == false) {alert (errmsg) }
   return(passed); 
 }
