function checkCatRequestFields(country) {
    missinginfo = '';
    if (country == 'United States') {
        if (document.form.state.value == '') {
            missinginfo +='\n State';
        }
        if (!document.form.zip.value.match(/\d{4,}/)) {
            //matches if the string has at least four number characters in a row
            missinginfo +='\n Postal Code';
        }
    } else if (country == 'Canada') {
        if  (document.form.province.value == '') {
            missinginfo +='\n Province';
        }
        if (!document.form.zip.value.match(/^\s*([a-z]|[A-Z])\d([a-z]|[A-Z])(\s*|-)\d([a-z]|[A-Z])\d\s*$/)) {
            //matches: beginning of the string, any number of spaces, letter, number, letter, a space or a dash, number, letter, number, any number of spaces, end of string.
            missinginfo +='\n Postal Code';
        }
    }
    if (document.form.address1.value  == '') {
        missinginfo +='\n Address 1';
    }
    if (document.form.city.value      == '') {
        missinginfo +='\n City';
    }
    
    if (document.form.offers.checked == true && document.form.email.value == '') {
        missinginfo += '\n You checked that you want special offers but you did not provide an email address.';
    }
    
    if (document.form.email.value != '' && !(document.form.email.value.match(/^[A-Za-z0-9._%+-]+@[a-zA-Z0-9.-]+\.[A-Za-z]{2,4}$/))) {
        // tests for valid email address.   Not perfect.  http://www.regular-expressions.info/email.html
        // only tests if they fill in an email address.
        missinginfo += '\n Invalid Email address\n';
    }

    if (missinginfo != ''){
        missinginfo ='\n' + 'These fields were left blank or are invalid:\n' + missinginfo + '\n' + '\nPlease re-enter and submit again!';
        alert(missinginfo);
        return false;
    } else {
        return true;
    }
}
