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 (!CheckPhoneField(theForm.lastname,"Please enter your last name.")) {
        return false;
    }

    if (!CheckPhoneField(theForm.company,"Please enter your company name.")) {
        return false;
    }
	
    if (!CheckPhoneField(theForm.phone,"Please enter your contact phone number.")) {
        return false;
    }

    if (!CheckEmailField(theForm.emailfield,"Please enter your email address.")) {
        return false;
    }

    if (!CheckPhoneField(theForm.taxid,"Please enter your tax ID.")) {
        return false;
    }

    return true;
}



