function valid_date(new_date, new_month) {
	if (((document.getElementById(new_date).value>29) && (document.getElementById(new_month).value=="feb")) || ((document.getElementById(new_date).value==31) && ((document.getElementById(new_month).value=="sep")||(document.getElementById(new_month).value=="apr")||(document.getElementById(new_month).value=="jun")||(document.getElementById(new_month).value=="nov")))) document.getElementById(new_date).value=0;
}
function isNumeric(val) {
	var ValidChars = "0123456789.-()";
	for (i=0; i<val.length; i++) if (ValidChars.indexOf(val.charAt(i)) == -1) return false;
	return true;
}
function IsValidEmail(val) {
	var iLen = val.length;
	if 	(iLen < 6 || val.indexOf('@') < 1 || (val.charAt(iLen - 3) != '.' && val.charAt(iLen - 4) != '.' && val.charAt(iLen - 5) != '.')) return false;
	return true;
}
function fnValidate(f) {
	if (f.name.value.length == 0) {
		alert('Please enter your name to continue.');
		f.name.focus();
		return false;
	}
	if (!IsValidEmail(f.email.value)) {
		alert('Please enter a valid email address to continue.');
		f.email.focus();
		return false;
	}
	if (f.phone.value.length < 10 || !isNumeric(f.phone.value)) {
		alert('Please enter your phone number to continue.');
		f.phone.focus();
		return false;
	}
	return true;
}