function validation (id)
{
    var sec_code;
    if (id != 'attorney_locator_main')
        sec_code = '#sec_code';
    else
        sec_code = '#sec_code_main';
    var errors = '';

    if (id == 'attorney_locator' && ($('#region_search').val() == '0' || $('#category_search').val() == '0')){
            errors += "Please select both Region and Category you are interested in\n"
        }

    else if (id == 'attorney_locator_main' && ($('#region_search_main').val() == '0' || $('#category_search_main').val() == '0')){
            errors += "Please select both Region and Category you are interested in\n"
        }

    $.get("/captcha/check_antibot.php?sec_code=" + $(sec_code).val(), function(data){

        if ('f' == data){
            errors += "Please enter valid Captcha\n";
        }

        if (id == 'contact_form' && ($('#state').val() == '' || $('#region').val() == '' || $('#group').val() == '' || $('#category').val() == '')){
            errors += "Please select all 'Type of Professional' fields\n";
        }

        if ('' != errors) {
            alert(errors);
            return false;
        } else {
            $('#'+id).submit();
        }
    });
    return false;
}
