function isEmpty(strfield1) {
    //name field

    if (strfield1.value == "" || strfield1.value == null || !isNaN(strfield1.value) || strfield1.value.charAt(0) == ' ')
    {
	    alert("\"Your Name\" is a mandatory field.\nPlease amend and retry.");
		strfield1.focus();
	    return false;
    }

    return true;
}

//function to check valid email address
function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;

   // search email text for regular exp matches
    if (strEmail.value.search(validRegExp) == -1) 
   {
      alert('A valid e-mail address is required.\nPlease amend and retry');
	strEmail.focus();
      return false;
    } 
    return true; 
}

//function that performs all functions, defined in the onsubmit event handler
function check(form) {
	  if (isEmpty(form.sender)){
		if (isValidEmail(form.sender_subject)){
		  form.submit();
		}
	  }


	return false;
}
