function CheckEmailField(theField,alertMsg) {
    if (theField.value == "" ) {
        alert(alertMsg)
        theField.focus();
        return 0;
    }

    if (theField.value.indexOf ('@',0) == -1 ||
        theField.value.indexOf ('.',0) == -1) {
        alert("An Email field requires a \"@\" and a \".\" to be used. \n Please re-enter the Email Address.")
        theField.select();
        theField.focus();
        return 0;
    }
    return 1;
}

function CheckPhoneField(theField,alertMsg) {
    if (theField.value == "" ) {
        alert(alertMsg)
        theField.focus();
        return 0;
    }
	    return 1;
}

function CheckForm(theForm) {
	if (!CheckPhoneField(theForm.firstname,"Please enter your first name.")) {
        return false;
    }
	
    if (!CheckEmailField(theForm.emailfield,"Please enter your email address.")) {

        return false;
    }

    return true;

}
