var reqFields = 'contactFirstName';

/* validation for contact page. 
 *  
 *  "Only first name and email or phone are required – please indicate and provide
 *   error message for missing data in those fields"
 */
$(document).ready( function() {
    /* We have our own script */
    /*$('#contactForm').submit( function(e) {
        if ($('#contactFirstName').val() == "") {
            $('#contactFirstName').addClass('err');
            alert('First Name and either e-mail or phone are required.');
            return false;
        }
        else if ($('#contactEmail').val() == "" && ($('#contactPhone').val() == "")) {
            $('#contactEmail').addClass('err');
            $('#contactPhone').addClass('err');
            alert('Either e-mail or phone are required.');
            return false;
        }
        else if ($('#contactEmail').val() != "" && !$('#contactEmail').val().match(/^([-a-zA-Z0-9_.]+)@(([-a-zA-Z0-9_]+[.])+[a-zA-Z]+)$/)) {
            $('#contactEmail').addClass('err');
            alert('Sorry, "' + $('#contactEmail').val() + '" is not a proper email address.');
            return false;
        }
        return true;
    }); */


    /* mouseover state for a button. */
    $('div.btnSubmit > input').hover(function() { $(this).attr('src', ' img/btn.submit1.hov.gif') },
                                     function() { $(this).attr('src', ' img/btn.submit1.gif') });

    /* Doubtful these are ever used... the inputs have been renamed to conform with our scripts*/
    $('#contactMenu > li.office > a').bind('click', function(e) {
            $('#contactForm, #contactThanks').hide();
            $('#contactOfficeInfo').show();
            $(this).parent().siblings().find('a').removeClass('sel');
            $(this).addClass('sel').blur();
            return false;
    });
    $('#contactMenu > li.form > a').bind('click', function(e) {
            if ($('body').attr('id') == 'page_contact') {
                $('#contactOfficeInfo').hide();
                $('#contactForm').show();
                $(this).parent().siblings().find('a').removeClass('sel');
                $(this).addClass('sel').blur();
                return false;
            }
    });
});

