function checkmail() {

  if (document.ecobed.name.value == "") {
    alert("Please enter your name");
    document.ecobed.name.focus();
    return;
    }
  if (document.ecobed.address.value == "") {
    alert("Please enter your address");
    document.ecobed.address.focus();
    return;
    }
	if (email_isValid(document.ecobed.email.value) == false) {
    alert('Please enter a valid email address');
		form.email.focus();
		form.email.select();
		return false;
	}
  if (document.ecobed.enquiry.value == "") {
    alert("Please enter your enquiry");
    document.ecobed.enquiry.focus();
    return;
    }

document.ecobed.submit();
}

function email_isValid(eM) {
	// Rules for the email regular expression:
	// The start of the email must have at least one character 
	// before the @ sign
	// There may be either a . or a -, but not together before the @ sign
	// There must be an @ sign
	// At least once character must follow the @ sign
	// There may be either a . or a -, but not together in the address
	// The address must end with a . followed by at least 2 characters
	var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
	return re.test(eM);
}
