
function confirmEmail(emailField) {
	var x = emailField.value;
	var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(x)) {
		emailField.value = '';
		emailField.focus();
		return false;
	}
	return true; 
}

// Radio Button Validation
// copyright Stephen Chapman, 15th Nov 2004,14th Sep 2005
// you may copy this function but please keep the copyright notice with it
function valButton(btn) {
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1) return btn[cnt].value;
    else return null;
}

function validateForm() {
	if (document.theform.Name.value == '') {
		alert('Please enter your name');
		document.theform.Name.focus();
		return false;
	}
	if (document.theform.Email.value == '') {
		alert('Please enter your email address');
		document.theform.Email.focus();
		return false;
	}
	if (document.theform.Telephone.value == '') {
		alert('Please enter your telephone number');
		document.theform.Telephone.focus();
		return false;
	}		
	
	return true;
}
