
/* This code will validate the form, to make sure data is entered. */

/* This compares the entered email addresses to make sure that they match */

function email() {
        if (document.forms[0].checkEmail.value == "") {
        	document.forms[0].confirm_email.focus();
        	return false;
        	}
        	else if (document.forms[0].email.value != document.forms[0].confirm_email.value) {
        	window.alert("Please check your email address.");
        	return false;
        	}
} 


function checkEmail() {
        if (document.forms[0].email.value == "") {
        window.alert("Please enter your email address.");
		document.forms[0].email.focus();
		return false;
        }
        else if (document.forms[0].email.value != document.forms[0].confirm_email.value) {
        window.alert("Please check your email address.");
        return false;
        }
} 


/* This function will check for a valid number in the text boxes where numerical entries are required. */

function checkForNumber(fieldValue) {
        var numberCheck = isNaN(fieldValue);                    /* tests for non-numerical values */
        if (numberCheck == true) {
                window.alert("Please only enter numbers.");       /* if another non-numerical symbol is entered, an alert appears. */
                return false;
        }
}
 
/* This code prompts the user to confirm that they want to reset the form. */

function confirmReset() {						
        var resetForm = window.confirm("Are you sure you want to reset the form?");
        if (resetForm == true)
                return true;
        return false;
}

