function isEmailAddr (s){ 
	var rv = false
	if ((s == null) || (s.length == 0)) 
       	rv = false;
 	 else {
		var reEmail =/([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		//reEmail = /.+\@.+\..+$/
		
		rv = reEmail.test(s)
    }
	if(rv){
		return rv
	}else{
		return false
	}
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}

function validation(theForm){
	if (theForm.name.value == ""){
    	alert("Please enter your name.");
    	theForm.name.focus();
    	return (false);
  	}
  	/*if (theForm.phone.value == ""){
    	alert("Please enter your phone number");
    	theForm.phone.focus();
    	return (false);
 	}*/
    if (!isEmailAddr(theForm.email_from.value)){
    	alert("Please enter a complete email address in the form: yourname@yourdomain.com");
    	theForm.email_from.focus();
    	return (false);
 	}
	return true
}
