 function checkForm(){
  var myForm = document.frmValidate;
  var why = "";
    why += isValidEmail(myForm.email.value);
 	why += isValidPhone(myForm.phone.value);
 	if (why != "") {
       alert(why);
       return false;
    }
	return true;
 	} 
 	
 function  isValidPhone(strng){
	 var stripped = strng.replace(/[\(\)\.\-\ ]/g, '');
	 var error;
	//strip out acceptable non-numeric characters
	if (isNaN(parseInt(stripped))) {
  	 error = "The phone number contains illegal characters.";
  	 return error;
	}
	 if (!(stripped.length == 10)) {
		error = "The phone number is the wrong length. Make sure you included an area code.\n";
		return error;
    }
    return "";
    
 }
 
 function isValidEmail(email){
    var RegExp = /^((([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+(\.([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.))*([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/
    if(!(RegExp.test(email))){
        var error = "Please enter a valid Email\n";
        return error;
       }
       return "";
}

