// -- Form Validation Javascript
function verifyInfo()
{
    // -- Create new array
    var arr_rec = new Array();

    // -- Fill array
    var arr_rec = document.getElementById("req_fields").value.split(",");

    // -- Loop through array to look for empty fields
    for (i=0;i<arr_rec.length;i++)
    {
        // -- If the trimmed length of any field is less than one character
        if (trim(document.getElementById(arr_rec[i]).value).length < 1)
        {
            // -- Show error message
            alert(document.getElementById(arr_rec[i]).name + " cannot be left blank.");

            // -- Shift focus to element
            document.getElementById(arr_rec[i]).focus();

            // -- exit function
            return;
        }
	// date, first, last, parents, class, address, city, state, zip, phone, email, applied, admitted, major, satact, gpa //

        if ((arr_rec[i] == "email") && !(validateEmail(document.getElementById(arr_rec[i]).value)))
        {
            alert("Your email address is not valid!\nPlease use a valid email address.");
            return;
        }

        if ((arr_rec[i] == "phone") && !(validatePhone(document.getElementById(arr_rec[i]).value)))
        {
            alert("Your Home Phone number is not valid!\nPlease use a valid phone number.");
            return;
        }

        if ((arr_rec[i] == "zip") && !(validateUSZip(document.getElementById(arr_rec[i]).value)))
        {
            alert("Your Zip Code is not valid!\nPlease use a valid Zip Code.");
            return;
        }

    }
	// -- Create link to form object if no errors
	var formObj = document.getElementById("Interest_Form");

	// -- Submit form
	formObj.submit();
}
