function emptyvalidation(entered) {
    with (entered) {
        if (value == null || value == "")
            return false;
        else
            return true;
    }
}

function selectvalidation(entered, alertbox) {
    with (entered) {
        if (selectedIndex == 0) {
            if (alertbox != "") {
                alert(alertbox);
            }
            return false;
        }
        else {
            return true;
        }
    }
}

function validateForm(theForm) {

    var strMsg = "";
    with (theForm) {
        // Position?
        if (emptyvalidation(theForm.position) == false)
            strMsg += " - Position not filled\n";

        if (emptyvalidation(theForm.location) == false)
            strMsg += " - Location not filled\n";

        if (emptyvalidation(theForm.firstName) == false)
            strMsg += " - First Name not filled\n";

        if (emptyvalidation(theForm.lastName) == false)
            strMsg += " - Last Name not filled\n";

        if (emptyvalidation(theForm.streetAddress) == false)
            strMsg += " - Address not filled\n";

        if (emptyvalidation(theForm.city) == false)
            strMsg += " - City not filled\n";

        if (emptyvalidation(theForm.state) == false)
            strMsg += " - State not filled\n";

        if (emptyvalidation(theForm.zipcode) == false)
            strMsg += " - Zip Code not filled\n";

        if (emptyvalidation(theForm.phone) == false)
            strMsg += " - phone not filled\n";

				if (emptyvalidation(theForm.desiredpay) == false)
            strMsg += " - desired pay not filled\n";

				if (emptyvalidation(theForm.desiredhours) == false)
            strMsg += " - desired hour per week not filled\n";

				if (emptyvalidation(theForm.desiredstartdate) == false)
            strMsg += " - desired start date not filled\n";

        // High School
        if ((theForm.highschool[0].checked == false) &&
			(theForm.highschool[1].checked == false)) {
            strMsg += " - Education - High School\n";
        }

			// Legal
			if ((theForm.convicted[0].checked == false) &&
			(theForm.convicted[1].checked == false)) {
            strMsg += " - Legal - Convictions\n";
        }
    }
    if (strMsg != "") {
        alert("Please complete the following:\n\n" + strMsg);
        return false;
    }
    else
        return true;

}
