document.write("<SCRIPT LANGUAGE='JavaScript1.2' SRC='/scripts/check_form_base.js'></SCRIPT>");

function check_contact_form()  {
	var e = document.contact.email;
	var ec = document.contact.email_check;
	
// need to check last_name name address city state zip email
// first name
    if  (!hasValue(document.contact.f_name, "TEXT" ) || checkInteger(document.contact.f_name.value )) {
        if  (!onError(document.contact, document.contact.f_name, document.contact.f_name.value, "Please enter a valid first name."))
        {
         document.contact.f_name.focus();
         return false; 
        }
    }
	
// last name
    if  (!hasValue(document.contact.l_name, "TEXT" ) || checkInteger(document.contact.l_name.value )) {
        if  (!onError(document.contact, document.contact.l_name, document.contact.l_name.value, "Please enter a valid last name."))
        {
         document.contact.l_name.focus();
         return false; 
        }
    }

// email 
    if  (!hasValue(document.contact.email, "TEXT" ) || !checkEmail(document.contact.email, document.contact.email.value )) {
        if  (!onError(document.contact, document.contact.email, document.contact.email.value, "Please enter a valid email address."))
        {
           document.contact.email.focus();
           return false; 
        }
    }
	
// email_check 
    if  (!hasValue(document.contact.email_check, "TEXT" ) || !checkEmail(document.contact.email_check, document.contact.email_check.value)) {
        if  (!onError(document.contact, document.contact.email_check, document.contact.email_check.value, "Please re-enter a valid email address."))
        {
           document.contact.email_check.focus();
           return false; 
        }
    }
	
	if(e.value != ec.value){
		alert("You have entered two different email addresses");
		return false;
		document.contact.email.focus();
	}

// city 
    if  (!hasValue(document.contact.city, "TEXT" ) || checkInteger(document.contact.city.value )) {
        if  (!onError(document.contact, document.contact.city, document.contact.city.value, "Please enter a valid city."))
        {
           document.contact.city.focus();
           return false; 
        }
    }

// state 
    if  (!hasValue(document.contact.state, "SELECT" )) {
        if  (!onError(document.contact, document.contact.state, document.contact.state.value, "Please select a state."))
        {
           document.contact.state.focus();
           return false; 
        }
    }

// zip 
    if  (!hasValue(document.contact.zip, "TEXT" ) || !checkZip(document.contact.zip.value ) ) {
        if  (!onError(document.contact, document.contact.zip, document.contact.zip.value, "Please enter a valid zip."))
        {
           document.contact.zip.focus();
           return false; 
        }
    }

// inquiry 
    if  (!hasValue(document.contact.inquiry, "SELECT" )) {
        if  (!onError(document.contact, document.contact.inquiry, document.contact.inquiry.value, "Please select a Reason for inquiry."))
        {
           document.contact.inquiry.focus();
           return false; 
        }
    }

// comments
    if  (!hasValue(document.contact.comments, "TEXT" )) {
        if  (!onError(document.contact, document.contact.comments, document.contact.comments.value, "Please enter a comment."))
        {
           document.contact.comments.focus();
           return false; 
        }
    }	
} // end of function check_contact_form
