function ValidateEmailCaptureForm(){
	if (AreFormFieldsEmpty()){
		if (isValidEmailAddress()){
		  return true;
		}
	}
	return false;
	}

function AreFormFieldsEmpty() {

	strName = document.forms[0].f_name.value
	strEmail = document.forms[0].f_email.value
	strPhone = document.forms[0].f_phone.value

    //Name field
	if (strName == "" || strName == null || strName.charAt(0) == ' ')
    {
    alert("\"Name\" is a mandatory field.\n\nPlease amend and retry.");
	document.forms[0].f_name.focus();
    return false;
    }
	
	//Email field
    if (strEmail == "" || strEmail == null || strEmail.charAt(0) == ' ')
    {
    alert("\"Email\" is a mandatory field.\n\nPlease amend and retry.")
	document.forms[0].f_email.focus();
    return false;
    }

  	//Phone field
    if (strPhone == "" || strPhone == null || strPhone.charAt(0) == ' ')
    {
    alert("\"Phone\" is a mandatory field.\n\nPlease amend and retry.")
	document.forms[0].f_phone.focus();
    return false;
    }
	
    return true;
}


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

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