This feature is only available to subscribers of the ProZ.com Business, Business Plus or Business Enterprise packages.
Just a few more questions to create your job posting...
Review your job before posting
You currently have listed as a working field. This search is only returning service providers with listed as a specialty field. If you would like to appear in the results of this search please add as a specialty field in your profile settings .
You currently do not have your native language variant set. This search is only returning service providers with a native language variant of Portuguese Brazilian . You can set your native language variant in your profile settings .
Public alpha
This search is currently in a "public alpha" stage of development. Feedback and requests are appreciated. Please note that some features will be exclusively available to members upon official release.
Find specialists who know the terminology specific to your project.
Deep content matches search a service provider's profile and work history to look for keyword matches - KudoZ, glossaries, project histories, WIWOs, taglines, about me, Nakōdo documents and more.
Try it by adding keyword terms to your query .
[\\s\\S]*?',
'gi');
function removeTags(html) {
var oldHtml;
do {
oldHtml = html;
html = html.replace(tagOrComment, '');
} while (html !== oldHtml);
return html.replace(/
' + ("0"+(d.getMonth()+1)).slice(-2) + "/" + ("0" + d.getDate()).slice(-2) + "/" + d.getFullYear() + ' ' + json.last_entry.note_text + '
');
$('.delete_corp_note').click(function() {
var note_id = $(this).attr('id').split("_").slice(-1)[0];
deleteNote(note_id, notee_id);
});
if (parseInt(json.count.count) === 1) {
$('#contact_icon_area_' + notee_id).append('
');
}
$('[data-toggle="tooltip"]').tooltip();
saveContactData('note', notee_id);
// console.log(json);
},
error: function(json) {
// console.log(json);
},
});
}
function deleteNote(note_id, notee_id) {
$.ajax({
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers_notes.php",
data: {
action: 'delete',
note_id: note_id,
notee_id: notee_id
},
success: function(json) {
$('#note_' + note_id).remove();
if (parseInt(json.count.count) === 0) {
if ($('#note_list_' + notee_id + ' li').length == 0) {
$('#note_list_' + notee_id).append('
You do not have any notes for this service provider. ');
}
$('#note_icon_for_' + notee_id).remove();
}
},
error: function(json) {
// console.log(json);
},
});
}
RegExp.quote = function(str) {
return str.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
};
function getListNames() {
$.ajax({
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers_get_list_names.php",
success: function(json) {
$('.filter_names').empty();
$.each(json, function( index, value ) {
$('.filter_names').append('
' + value + ' ');
});
},
error: function(json) {
// console.log(json);
},
});
}
function updateBatchListSingle(eid, checked) {
var entity_was_contacted_in_the_last_12_hours = false;
var entity_ids_that_the_sender_sent_an_email_on_last_12_hours = false;
$('input[id^=service_provider_check_]').each(function() {
if (this.checked) {
var eid = $(this).attr('id').split("_").slice(-1)[0];
// Check if the eid was contacted previously by the same sender in the last 12 hours
if ($.inArray(eid, entity_ids_that_the_sender_sent_an_email_on_last_12_hours) !== -1) {
entity_was_contacted_in_the_last_12_hours = true;
}
}
});
$.ajax({
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers_batch_list.php",
data: {
eid_s: parseInt(eid),
checked: checked,
search_id: parseInt()
},
success: function(json) {
var max = parseInt(25);
$('#batch_list_eid_v_count').empty();
$('#batch_list_eid_v_count').append(json);
$('#total_batch_emails').empty();
$('#total_batch_emails').append(json);
if ((parseInt($('#batch_list_eid_v_count').text()) + 1 > max) && checked) {
alert('This service provider could not be added to your list of selected service providers as you are over the limit. Please first remove a provider or clear your list.');
}
if (entity_was_contacted_in_the_last_12_hours) {
$('#eid_already_contacted_warning').css('display', 'inherit');
} else {
$('#eid_already_contacted_warning').css('display', 'none');
}
// console.log(json);
},
error: function(json) {
// console.log(json);
},
});
}
function updateBatchListMultiple(eid_array) {
// This function retrieves a list of entity IDs that the sender has sent an email to in the last 12 hours
var entity_ids_that_the_sender_sent_an_email_on_last_12_hours = [];
// Initialize a flag to indicate whether the entity was contacted in the last 12 hours
var entity_was_contacted_in_the_last_12_hours = false;
// Loop through the key-value pairs in the 'eid_array' object
for(const [key, value] of Object.entries(eid_array)){
// Check if the 'key' (entity ID) is present in the list of IDs with recent emails
if ($.inArray(key, entity_ids_that_the_sender_sent_an_email_on_last_12_hours) !== -1) {
// If found, set the flag to true
var entity_was_contacted_in_the_last_12_hours = true;
}
}
// Make an AJAX request to retrieve service provider data
$.ajax({
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers_batch_list.php",
data: {
eid_array: eid_array,
search_id: parseInt()
},
success: function(json) {
// Clear and update elements with the retrieved data
$('#batch_list_eid_v_count').empty();
$('#batch_list_eid_v_count').append(json);
$('#total_batch_emails').empty();
$('#total_batch_emails').append(json);
// Show or hide a warning based on whether the entity was contacted in the last 12 hours
if (entity_was_contacted_in_the_last_12_hours) {
$('#eid_already_contacted_warning').css('display', 'inherit');
} else {
$('#eid_already_contacted_warning').css('display', 'none');
}
// Uncomment the following lines to log the JSON response for debugging purposes
// console.log(json);
},
error: function(json) {
// Handle any errors that occur during the AJAX request
// Uncomment the following line to log the JSON response for debugging purposes
// console.log(json);
},
});
}
function clearBatchList() {
$.ajax({
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers_batch_list.php",
data: {
clear: true
},
success: function(json) {
$('#batch_list_eid_v_count').empty();
$('#batch_list_eid_v_count').append(json);
$('#total_batch_emails').empty();
$('#total_batch_emails').append(json);
// console.log(json);
},
error: function(json) {
// console.log(json);
},
});
}
function addToFilteredProvidersBulk() {
var eids = [];
$('input[id^=service_provider_check_]').each(function() {
if (this.checked) {
var eid = $(this).attr('id').split("_").slice(-1)[0];
eids.push(eid);
}
});
$.ajax({
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers_add_to_filtered_providers.php",
data: {
multiple: true,
},
success: function(json) {
$('#search_form').submit();
// console.log(json);
},
error: function(json) {
// console.log(json);
},
});
}
function addToFilteredProviders(eid) {
$.ajax({
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers_add_to_filtered_providers.php",
data: {
eid_s: parseInt(eid),
},
success: function(json) {
$('#search_form').submit();
// console.log(json);
},
error: function(json) {
// console.log(json);
},
});
}
function reindexEntity() {
$.ajax({
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers_reindex.php",
success: function(json) {
$('#search_form').submit();
// console.log(json);
},
error: function(json) {
// console.log(json);
},
});
}
function optOutEntity() {
$.ajax({
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers_opt_out.php",
success: function(json) {
$('#search_form').submit();
// console.log(json);
},
error: function(json) {
// console.log(json);
},
});
}
function saveContactData(method, eid) {
$.ajax({
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers_save_contact_data.php",
data: {
method: method,
eid: eid,
search_id: parseInt(),
},
success: function(json) {
// console.log(json);
},
error: function(json) {
// console.log(json);
},
});
}
function findPosition() {
var positionPanel = $('#your_current_position');
if (!positionPanel.length) return;
function showPositionState(state) {
positionPanel.find('[data-find-position-state]').prop('hidden', true);
positionPanel.find('[data-find-position-state="' + state + '"]').prop('hidden', false);
}
var searchOptions;
try {
searchOptions = JSON.parse(positionPanel.attr('data-find-position-options'));
} catch (error) {
return;
}
if (!searchOptions) return;
showPositionState('loading');
$.ajax({
type: 'POST',
dataType: 'json',
url: '/ajax/ajax_find_service_providers_your_position.php',
data: {search_options: searchOptions},
timeout: 12000,
success: function (json) {
if (json && json.position === null && json.result_set === null) {
showPositionState('unranked');
return;
}
var pageSize = Number(positionPanel.attr('data-find-position-page-size'));
if (!json || !Number.isInteger(json.position) || json.position < 1 || json.position > 1000 ||
(json.result_set !== 'member' && json.result_set !== 'non_member') || !Number.isInteger(pageSize) || pageSize < 1) {
showPositionState('unavailable');
return;
}
var isMemberResult = json.result_set === 'member';
positionPanel.find('[data-find-position-rank]').text(numberWithCommas(json.position));
positionPanel.find('[data-find-position-results]').text(isMemberResult ? 'member results' : 'non-member results');
positionPanel.find('[data-find-position-page]').text(Math.ceil(json.position / pageSize));
positionPanel.find('[data-find-position-first]').prop('hidden', json.position !== 1);
positionPanel.find('[data-find-position-membership]').prop('hidden', json.position === 1 || isMemberResult);
if (json.position === 1) $('#suggestions_header').remove();
showPositionState('ranked');
},
error: function () {
showPositionState('unavailable');
}
});
}
var global_result_count = 0;
function showFindCountLoading(target) {
target.append(document.getElementById('find-count-loading').content.cloneNode(true));
}
var findFilterRequest;
function findServiceProviders(options) {
if (options === undefined) {
options = {};
}
if (options['eids']) {
var show_inner_hits = 'y';
} else {
var show_inner_hits = 'n';
}
if ("".length > 0) {
exact_match = true;
} else {
exact_match = false;
}
if (options['wizard'] || options['native_language']) {
if ($('#service_type').val() == 2) {
var source_language = $('#source_language_wizard_interpreting').val();
var target_language = $('#target_language_wizard_interpreting').val();
} else if ($('#service_type').val() == 10 || $('#service_type').val() == 11 || $('#service_type').val() == 12 || $('#service_type').val() == 13 || $('#service_type').val() == 23) {
var monolingual_language = $('#monolingual_language_wizard_1').val();
var monolingual_language_2 = $('#monolingual_language_wizard_2').val();
var monolingual_language_3 = $('#monolingual_language_wizard_3').val();
var country = $('#country_of_residence_wizard').val();
} else {
var monolingual_language = $('#monolingual_language_wizard').val();
var source_language = $('#source_language_wizard').val();
var target_language = $('#target_language_wizard').val();
var field = $('#field_wizard').val();
var subtitling = $('#subtitling_wizard').val();
var copywriting = $('#copywriting_wizard').val();
}
} else {
var monolingual_language = $('#monolingual_language').val();
var monolingual_language_2 = $('#monolingual_language_2').val();
var monolingual_language_3 = $('#monolingual_language_3').val();
var source_language = $('#source_language').val();
var target_language = $('#target_language').val();
var field = $('#specialty_field_select').val();
var subtitling = $('#subtitling_service_select').val();
var copywriting = $('#copywriting_type_select').val();
var country = $('#country_of_residence').val();
}
var bidirectional = $('#bd_checkbox').is(":checked") ? 'y' : 'n';
if (options['direction'] === 'two-way') {
var source_language = $('#source_language_wizard_interpreting').val();
var target_language = $('#target_language_wizard_interpreting').val();
var bidirectional = 'y';
} else if (options['direction'] === 'one-way-b') {
var source_language = $('#target_language_wizard_interpreting').val();
var target_language = $('#source_language_wizard_interpreting').val();
var bidirectional = 'n';
} else if (options['direction'] === 'one-way-a') {
var source_language = $('#source_language_wizard_interpreting').val();
var target_language = $('#target_language_wizard_interpreting').val();
var bidirectional = 'n';
}
var useWizardNativeControls = options['wizard'] || options['native_language'] || $('#wizard_main_container').is(':visible');
var nativeLanguageControl = useWizardNativeControls ? '#wizard-native_language' : '#native_language';
if ($('#nit_checkbox:checked').length > 0) {
var native_language = $('#target_language').val();
var native_in_target = true;
} else {
var native_language = $(nativeLanguageControl).val();
var native_in_target = false;
}
if (options['native_language'] === 'source') {
var native_language = $('#source_language_wizard').val();
var native_in_target = false;
} else if (options['native_language'] === 'target') {
var native_language = $('#target_language_wizard').val();
var native_in_target = true;
} else if (options['native_language'] === 'none') {
var native_language = null;
var native_in_target = false;
}
var imode = $('#interpreting_mode_select').val();
var imodal = $('#interpreting_modality_select').val();
if (options['interpreting_type'] === 'onsite' || options['interpreting_type'] === 'video' || options['interpreting_type'] === 'telephone') {
if ($("input[name='int_dir_wz']:checked").val() === 'two_way') {
var source_language = $('#source_language_wizard_interpreting').val();
var target_language = $('#target_language_wizard_interpreting').val();
var bidirectional = 'y';
} else if ($("input[name='int_dir_wz']:checked").val() === 'one-way-b') {
var source_language = $('#target_language_wizard_interpreting').val();
var target_language = $('#source_language_wizard_interpreting').val();
var bidirectional = 'n';
} else {
var source_language = $('#source_language_wizard_interpreting').val();
var target_language = $('#target_language_wizard_interpreting').val();
var bidirectional = 'n';
}
var imodal = options['interpreting_type'];
if (options['interpreting_type'] === 'video' || options['interpreting_type'] === 'telephone') {
var imode = 'consecutive';
}
} else if (options['interpreting_type'] === 'not_specified') {
if ($("input[name='int_dir_wz']:checked").val() === 'two_way') {
var source_language = $('#source_language_wizard_interpreting').val();
var target_language = $('#target_language_wizard_interpreting').val();
var bidirectional = 'y';
} else if ($("input[name='int_dir_wz']:checked").val() === 'one-way-b') {
var source_language = $('#target_language_wizard_interpreting').val();
var target_language = $('#source_language_wizard_interpreting').val();
var bidirectional = 'n';
} else {
var source_language = $('#source_language_wizard_interpreting').val();
var target_language = $('#target_language_wizard_interpreting').val();
var bidirectional = 'n';
}
}
var isFilterCount = $.isEmptyObject(options);
if (isFilterCount && findFilterRequest) findFilterRequest.abort();
var request = $.ajax({
timeout: isFilterCount ? 15000 : 0,
type: "POST",
dataType: "json",
url: "/ajax/ajax_find_service_providers.php",
data: {
// Query
q: $('#search_query').val(),
// Service
st: $('#service_type').val(),
// Languages
ml: monolingual_language,
ml2: monolingual_language_2,
ml3: monolingual_language_3,
sl: source_language,
tl: target_language,
nit: native_in_target,
tlvar: $('#target_language_variant').val(),
nl: native_language,
nlvar: $(nativeLanguageControl + '_variant').val(),
nlv: $(useWizardNativeControls ? '#nlv_checkbox' : '#nlv_checkbox_search').is(':checked') ? 'y' : 'n',
lpe: $('#lpe_select').val(),
// Budget
rt_min: $('#rtmin_input').val(),
rt_max: $('#rtmax_input').val(),
rt_unit: $('#rt_unit').val(),
rt_curr: $('#rt_curr').val(),
pm: $('#pm_select').val(),
// Expertise
ct: copywriting,
ss: subtitling,
hn: $('#hermes_input').is(":checked") ? 'y' : 'n',
imode: imode,
imodal: imodal,
gls: $('#game_localization_service_select').val(),
glg: $('#game_localization_genre_select').val(),
glp: $('#game_localization_platform_select').val(),
f: field,
ee: $('#ee_select').val(),
mpt: $('#medical_professional_types_select').val(),
ps: $('#pharmaceutical_stages_select').val(),
pc: $('#pharmaceutical_companies_select').val(),
ltex: $('#literary_type_experience_select').val(),
lti: $('#literary_type_interest_select').val(),
pmtms: $('#project_manager_tms_select').val(),
cat: $('#cat_select').val(),
ye: $('#ye_input').val(),
crd: $('#crd_select').val(),
// Client feedback
pos_ent: $('#pos_ent_input').val(),
avg_rat: $('#input-wwa').val(),
// Location
c: country,
lat: $('#lat').val(),
lon: $('#lon').val(),
dist_l: $('#dist_l_input').val(),
dist_u: $('#dist_u_input').val(),
cc: $('#country_of_citizenship').val(),
ccv: $('#ccv_checkbox').is(":checked") ? 'y' : 'n',
// Additional filters
a: $('#avail_select').val(),
rp: $('#reg_proz').val(),
lv: $('#lv_select').val(),
vi: $('#vi_input').is(":checked") ? 'y' : 'n',
volunteer: $('#volunteer_input').is(":checked") ? 'y' : 'n',
swt: $('#swt_input').is(":checked") ? 'y' : 'n',
sw: $('#sw_select').val(),
swc: $('#swc_select').val(),
sdl: $('#sdl_input').is(":checked") ? 'y' : 'n',
ai_pref: $('#ai_preference').is(":checked") ? 'y' : 'n',
sdlt: $('#sdl_trainer_input').is(":checked") ? 'y' : 'n',
g: $('#gender_select').val(),
la_cert: $('#language_assessment_cert_select').val(),
cpn: $('#cpn_input').is(":checked") ? 'y' : 'n',
spro: $('#sp_input').is(":checked") ? 'y' : 'n',
never_hired: $('#never_hired_input').is(":checked") ? 'y' : 'n',
pool: $('#pool_input').is(":checked") ? 'y' : 'n',
// Weights
s_w: $('#s_w_input').val(),
lw_w: $('#l_w_input').val(),
e_w: $('#e_w_input').val(),
k_w: $('#k_w_input').val(),
b_w: $('#b_w_input').val(),
v_w: $('#v_w_input').val(),
cpd_w: $('#cpd_w_input').val(),
oi_w: $('#oi_w_input').val(),
yoe_w: $('#yoe_w_input').val(),
yap_w: $('#yap_w_input').val(),
pr_w: $('#pr_w_input').val(),
r_w: $('#r_w_input').val(),
ll_w: $('#ll_w_input').val(),
cpn_w: $('#cpn_w_input').val(),
is_w: $('#is_w_input').val(),
ts_w: $('#ts_w_input').val(),
sn_w: $('#sn_w_input').val(),
sec_w: $('#sec_w_input').val(),
kw_w: $('#kw_w_input').val(),
cv_w: $('#cv_w_input').val(),
t_w: $('#t_w_input').val(),
am_w: $('#am_w_input').val(),
ww_w: $('#ww_w_input').val(),
ca_w: $('#ca_w_input').val(),
fp_w: $('#fp_w_input').val(),
fbcr_w: $('#fbcr_w_input').val(),
fbcg_w: $('#fbcg_w_input').val(),
pg_w: $('#pg_w_input').val(),
team_w: $('#team_w_input').val(),
sw_w: $('#sw_w_input').val(),
st_w: $('#st_w_input').val(),
n_w: $('#n_w_input').val(),
ph_w: $('#ph_w_input').val(),
ka_w: $('#ka_w_input').val(),
wiwo_w: $('#wiwo_w_input').val(),
bidirectional: bidirectional,
new: $('#new_providers_input').is(":checked") ? 'y' : 'n',
show_inner_hits: show_inner_hits,
eids: options['eids'],
filtered_eids: null,
exact_match: exact_match,
},
success: function(json) {
if (options['eids']) {
var loop_counter = 0;
$.each(json, function(eid, result) {
loop_counter += 1;
var html_list = '';
var count_of_deep_matches = 0;
if (result.inner_hits) {
$.each(result.inner_hits, function(index, value) {
if (value.hits.total > 0) {
$.each(value.hits.hits, function(i, v) {
html_list += '
';
if (v._nested.field === 'conferences_attended') {
html_list += '
Conference attended
';
html_list += '
' + JSON.parse(v._source.name) + ' (' + moment(new Date(v._source.date_start)).fromNow() + ' - ' + splitAtUnderscore(v._source.type) + ' conference)
';
count_of_deep_matches += 1;
} else if (v._nested.field === 'kudoz_answers') {
try {
$.each(v._source, function(k, val) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 20);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
KudoZ answer
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
});
} catch(e) {
$.each(v._source, function(k, val) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 20);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
KudoZ answer
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
});
}
} else if (v._nested.field === 'software_tools') {
// TODO
} else if (v._nested.field === 'resumes') {
// TODO
} else if (v._nested.field === 'forum_posts') {
try {
$.each(v._source, function(k, val) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Forum post
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
});
} catch(e) {
$.each(v._source, function(k, val) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Forum post
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
});
}
} else if (v._nested.field === 'about_me') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
About me
';
if (v._source.lang_name) {
html_list += '
' + v._source.lang_name + ': ...' + surrounding_text + '...
';
} else {
html_list += '
...' + surrounding_text + '...
';
}
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
About me
';
html_list += '
' + v._source.lang_name + ': ...' + + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'conference_presentations') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Conference presentation
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Conference presentation
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'lwa_entries_received') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
LWA entry received
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
LWA entry received
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'nakodo_documents') {
if (/\s/.test(v._source.term)) {
html_list += '
Nakōdo document
';
html_list += '
' + v._source.source_language_name + ' ' + v._source.target_language_name + '
';
count_of_deep_matches += 1;
}
} else if (v._nested.field === 'wiwo_terms') {
html_list += '
WIWO terms
';
html_list += '
' + JSON.parse(v._source.term) + '
';
count_of_deep_matches += 1;
} else if (v._nested.field === 'wiwos') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(v._source.message))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
WIWO
';
html_list += '
...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(v._source.message)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
WIWO
';
html_list += '
...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'project_history') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Project history
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Project history
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'teams') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Team
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Team
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'glossaries') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Glossary
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Glossary
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'wwa_entries_given') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
WWA entry given
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
WWA entry given
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'wwa_entries_received') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
WWA entry received
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
WWA entry received
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'lwa_entries_given') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
LWA entry given
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
LWA entry given
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'wikiwords') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Wikiwords
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Wikiwords
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'taglines') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
shopping jadi line Tagline
';
html_list += '
' + v._source.lang_name + ': ...' + surrounding_text + '...
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
shopping jadi line Tagline
';
html_list += '
' + v._source.lang_name + ': ...' + + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'training_participations') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Training participation
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Training participation
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else if (v._nested.field === 'sample_translations') {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Sample translation
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
Sample translation
';
html_list += '
' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '...
';
}
}
}
}
}
});
} else {
$.each(v._source, function(k, val) {
try {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(JSON.parse(val))), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '
' + v._nested.field + '
';
html_list += '' + splitAtUnderscore(capitalizeFirstLetter(k)) + ': ...' + surrounding_text + '....
';
}
}
}
}
} catch(e) {
if (val !== null) {
if (val.toString().toLowerCase().indexOf("") >= 0) {
if (k !== 'id') {
surrounding_text = surroundingText(stripLineBreaks(removeTags(val)), "", 10);
if (surrounding_text.length > 0) {
count_of_deep_matches += 1;
html_list += '' + v._nested.field + '
';
});
}
});
if (count_of_deep_matches > 0) {
if (count_of_deep_matches === 1) {
var matches = 'match';
} else {
var matches = 'matches';
}
$('#check_' + eid).empty();
$('#check_' + eid).append('
');
$('#inner_hits_' + eid).append('
Deep content matches are currently disabled - Upgrade to Professional membership or Business membership to enable this feature to see all the matches of your search query in this service provider\'s profile. Deep content matches help to find specialists who know the terminology specific to your project by searching a service provider\'s KudoZ, glossaries, project histories, WIWOs, taglines, about me, Nakōdo documents and more.
');
$('[data-toggle="tooltip"]').tooltip();
} else {
$('#check_' + eid).empty();
$('#check_' + eid).append('
');
$('[data-toggle="tooltip"]').tooltip();
$('.no-deep-icon').click(function() {
$('#deepContentMatches').modal();
});
}
} else {
$('#check_' + eid).empty();
$('#check_' + eid).append('
');
$('[data-toggle="tooltip"]').tooltip();
$('.no-deep-icon').click(function() {
$('#deepContentMatches').modal();
});
}
});
} else {
if (json === null) {
$('#quick-results').empty();
$('#quick-results').append('Please select a search parameter.');
$('.quick-results-wizard').empty();
$('.quick-results-wizard').append('Please select a search parameter.');
$('.quick-results-wizard').addClass('highlight-border');
} else {
global_result_count = json.total_members;
$('#quick-search-results').show();
$('#quick-results').empty();
$('#quick-results').removeClass('highlight-border');
$('.quick-results-wizard').empty();
$('.quick-results-wizard').removeClass('highlight-border');
if (json.total_results === 1) {
var results = 'profile';
} else {
var results = 'profiles';
}
if (json.total_members === 1) {
var members = 'member';
} else {
var members = 'members';
}
if (json.total_results > 100000) {
var result_count = 'over 100,000';
} else {
var result_count = numberWithCommas(json.total_results);
}
if (options['interpreting_type'] === 'onsite') {
$('#in-person-quick-results').empty();
if (json.total_members > 0 && json.total_results > json.total_members) {
$('#in-person-quick-results').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('#in-person-quick-results').append('
' + numberWithCommas(json.total_members) + ' ' + members);
} else {
$('#in-person-quick-results').append('
' + result_count + ' ' + results);
}
}
if (options['interpreting_type'] === 'video') {
$('#video-quick-results').empty();
if (json.total_members > 0 && json.total_results > json.total_members) {
$('#video-quick-results').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('#video-quick-results').append('
' + numberWithCommas(json.total_members) + ' ' + members);
} else {
$('#video-quick-results').append('
' + result_count + ' ' + results);
}
}
if (options['interpreting_type'] === 'telephone') {
$('#telephone-quick-results').empty();
if (json.total_members > 0 && json.total_results > json.total_members) {
$('#telephone-quick-results').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('#telephone-quick-results').append('
' + numberWithCommas(json.total_members) + ' ' + members);
} else {
$('#telephone-quick-results').append('
' + result_count + ' ' + results);
}
}
if (options['interpreting_type'] === 'not_specified') {
$('#not-specified-quick-results').empty();
if (json.total_members > 0 && json.total_results > json.total_members) {
$('#not-specified-quick-results').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('#not-specified-quick-results').append('
' + numberWithCommas(json.total_members) + ' ' + members);
} else {
$('#not-specified-quick-results').append('
' + result_count + ' ' + results);
}
}
if (options['direction'] === 'two-way') {
$('#quick-results-two-way').empty();
if (json.total_members > 0 && json.total_results > json.total_members) {
$('#quick-results-two-way').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('#quick-results-two-way').append('
' + numberWithCommas(json.total_members) + ' ' + members);
} else {
$('#quick-results-two-way').append('
' + result_count + ' ' + results);
}
} else if (options['direction'] === 'one-way-a') {
$('#quick-results-one-way-a').empty();
if (json.total_members > 0 && json.total_results > json.total_members) {
$('#quick-results-one-way-a').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('#quick-results-one-way-a').append('
' + numberWithCommas(json.total_members) + ' ' + members);
} else {
$('#quick-results-one-way-a').append('
' + result_count + ' ' + results);
}
} else if (options['direction'] === 'one-way-b') {
$('#quick-results-one-way-b').empty();
if (json.total_members > 0 && json.total_results > json.total_members) {
$('#quick-results-one-way-b').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('#quick-results-one-way-b').append('
' + numberWithCommas(json.total_members) + ' ' + members);
} else {
$('#quick-results-one-way-b').append('
' + result_count + ' ' + results);
}
} else if (options['native_language'] == 'source') {
var language_pair = $('#source_language_wizard').val() + '_' + $('#target_language_wizard').val();
if (language_pair === json.language_pair) {
$('#native_in_source_results').empty();
if (json.total_members > 0 && json.total_results > json.total_members) {
$('#native_in_source_results').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('#native_in_source_results').append('
' + numberWithCommas(json.total_members) + ' ' + members);
} else {
$('#native_in_source_results').append('
' + result_count + ' ' + results);
}
}
} else if (options['native_language'] == 'target') {
var language_pair = $('#source_language_wizard').val() + '_' + $('#target_language_wizard').val();
if (language_pair === json.language_pair) {
$('#native_in_target_results').empty();
if (json.total_members > 0 && json.total_results > json.total_members) {
$('#native_in_target_results').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('#native_in_target_results').append('
' + numberWithCommas(json.total_members) + ' ' + members);
} else {
$('#native_in_target_results').append('
' + result_count + ' ' + results);
}
}
} else if (options['native_language'] == 'none') {
var language_pair = $('#source_language_wizard').val() + '_' + $('#target_language_wizard').val();
if (language_pair === json.language_pair) {
$('#no_native_requirement_results').empty();
if (json.total_members > 0 && json.total_results > json.total_members) {
$('#no_native_requirement_results').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('#no_native_requirement_results').append('
' + numberWithCommas(json.total_members) + ' ' + members);
} else {
$('#no_native_requirement_results').append('
' + result_count + ' ' + results);
}
}
} else {
if (json.total_members > 0 && json.total_results > json.total_members) {
$('.quick-results-wizard').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)');
$('#quick-results').append('
' + numberWithCommas(json.total_members) + ' ' + members + ' (' + result_count + ' total profiles)
' + json.time / 1000 + ' seconds ');
} else if (json.total_members > 0 && json.total_results === json.total_members) {
$('.quick-results-wizard').append('
' + numberWithCommas(json.total_members) + ' ' + members);
$('#quick-results').append('
' + numberWithCommas(json.total_members) + ' ' + members + '
' + json.time / 1000 + ' seconds ');
} else {
$('.quick-results-wizard').append('
' + result_count + ' ' + results);
$('#quick-results').append('
' + result_count + ' ' + results + '
' + json.time / 1000 + ' seconds ');
}
$('.quick-results-wizard').addClass('highlight-border');
if (json.total_results > 0) {
$('#help-menu').show();
}
}
}
}
},
error: function(json, status) {
if (isFilterCount) {
if (status === 'abort') return;
$('#quick-results').empty().append(document.getElementById('find-count-error').content.cloneNode(true));
}
console.log(json);
}
});
if (isFilterCount) findFilterRequest = request;
}
function resetWizardState() {
$('#wizard_main_container').show();
$('#main_service_choice_container').hide();
$('#other_service_choice_container').hide();
$('#wizard_interpreting_language_container').hide();
$('#interpreter_choice_container').hide();
$('#wizard_language_container').hide();
$('#wizard_subtitling_field_container').hide();
$('#wizard_copywriting_container').hide();
$('#wizard_field_container').hide();
$('#wizard_additional_container').hide();
$('#voiceover_gender_container').hide();
$('#wizard_languages_container').hide();
$('#wizard_location_container').hide();
$('#wizard_native_language_selection').hide();
$('#native_in_source_results').empty();
$('#native_in_target_results').empty();
$('#no_native_requirement_results').empty();
$('#find_service_providers_main_container').addClass('find-service-providers-intro');
$('#find_service_providers_main_container').removeClass('find-service-providers-search');
$('#find_service_providers_container').hide();
$('#find_page_title').appendTo('.pz-find-title');
$('.voiceover_gender_breadcrumb').hide();
$('.quick-results-wizard').empty();
$('.quick-results-wizard').removeClass('highlight-border');
}
function resetWizardFormFields() {
$('#subtitling_wizard').val('').trigger('change', [true]);
$('#copywriting_wizard').val('').trigger('change', [true]);
$('#monolingual_language_wizard_1').val('').trigger('change', [true]);
$('#monolingual_language_wizard_2').val('').trigger('change', [true]);
$('#monolingual_language_wizard_3').val('').trigger('change', [true]);
$('#field_wizard').val('').trigger('change', [true]);
$('#field_wizard_other').val('');
$('#source_language_wizard_label_interpreting').val('').trigger('change', [true]);
$('#target_language_wizard_interpreting').val('').trigger('change', [true]);
$('input[name=int_dir_wz]:checked').val('');
$('#wizard-native_language').val('');
$('#wizard-native_language_variant').empty();
$('#wizard-native_language_variant_container').hide();
$('#lpe_select').val('');
$('input[name=nl_wz]:checked').val('target');
$('#monolingual_language_wizard').val('').trigger('change', [true]);
$('#source_language_wizard').val('').trigger('change', [true]);
$('#target_language_wizard').val('').trigger('change', [true]);
$('#country_of_residence_wizard').val('').trigger('change', [true]);
$('#remove_monolingual_language_3').hide();
$('#remove_monolingual_language_2').hide();
$('.quick-results-wizard').empty();
$('.quick-results-wizard').removeClass('highlight-border');
}
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function setNativeLanguageVariants(selected_language_code, selected_native_language_variant, language) {
language = language || $('#native_language');
var control = '#' + language.attr('id');
var variant = $(control + '_variant');
var container = $(control + '_variant_container');
$.ajax({
url: '/ajax/ajax_nlv_get_variants.php?language_code=' + selected_language_code
}).done(function (variants) {
if (language.val() !== selected_language_code) return;
if (variants) {
variant.empty();
var variantsHTML = "
Any ----------- ";
for (var variant_code in variants) {
if (selected_language_code === 'chi' && ($('#service_type').val() === '2' || $('#service_type').val() === '6')) {
// For spoken services, only show Mandarin and Cantonese as variants
if (variant_code === 'mandarin' || variant_code === 'cantchi') {
if (selected_native_language_variant == variant_code) {
variantsHTML += "
" + variants[variant_code] + " ";
} else {
variantsHTML += "
" + variants[variant_code] + " ";
}
}
} else if (selected_language_code === 'chi' && ($('#service_type').val() === '1' || $('#service_type').val() === '7' || $('#service_type').val() === '3' || $('#service_type').val() === '20' || $('#service_type').val() === '22' || $('#service_type').val() === '14' || $('#service_type').val() === '19' || $('#service_type').val() === '15' || $('#service_type').val() === '21' || $('#service_type').val() === '9')) {
// For written services, only show Simplified and Traditional as variants
if (variant_code === 'simpchi' || variant_code === 'tradchi') {
if (selected_native_language_variant == variant_code) {
variantsHTML += "
" + variants[variant_code] + " ";
} else {
variantsHTML += "
" + variants[variant_code] + " ";
}
}
} else if (selected_language_code === 'eng') {
if (variant_code !== 'ukeng') {
if (selected_native_language_variant == variant_code) {
variantsHTML += "
" + variants[variant_code] + " ";
} else {
variantsHTML += "
" + variants[variant_code] + " ";
}
}
} else {
if (selected_native_language_variant == variant_code) {
variantsHTML += "
" + variants[variant_code] + " ";
} else {
variantsHTML += "
" + variants[variant_code] + " ";
}
}
}
variant.append(variantsHTML);
container.show();
} else {
container.hide();
}
});
}
function setTargetLanguageVariants(selected_language_code, selected_target_language_variant) {
// TODO Remove only for debug
console.log("Fetching variants")
console.log(selected_language_code)
console.log(selected_target_language_variant)
$.ajax({
url: '/ajax/ajax_nlv_get_variants.php?language_code=' + selected_language_code
}).done(function (variants) {
if (variants) {
$("#target_language_variant").empty();
$("#target_language_variant_find_main").empty();
var variantsHTML = "
Any ----------- ";
for (var variant_code in variants) {
if (selected_language_code === 'chi' && ($('#service_type').val() === '2' || $('#service_type').val() === '6')) {
// For spoken services, only show Mandarin and Cantonese as variants
if (variant_code === 'mandarin' || variant_code === 'cantchi') {
if (selected_target_language_variant == variant_code) {
variantsHTML += "
" + variants[variant_code] + " ";
} else {
variantsHTML += "
" + variants[variant_code] + " ";
}
}
} else if (selected_language_code === 'chi' && ($('#service_type').val() === '1' || $('#service_type').val() === '7' || $('#service_type').val() === '3' || $('#service_type').val() === '20' || $('#service_type').val() === '22' || $('#service_type').val() === '14' || $('#service_type').val() === '19' || $('#service_type').val() === '15' || $('#service_type').val() === '21' || $('#service_type').val() === '9')) {
// For written services, only show Simplified and Traditional as variants
if (variant_code === 'simpchi' || variant_code === 'tradchi') {
if (selected_target_language_variant == variant_code) {
variantsHTML += "
" + variants[variant_code] + " ";
} else {
variantsHTML += "
" + variants[variant_code] + " ";
}
}
} else if (selected_language_code === 'eng') {
if (variant_code !== 'ukeng') {
if (selected_target_language_variant == variant_code) {
variantsHTML += "
" + variants[variant_code] + " ";
} else {
variantsHTML += "
" + variants[variant_code] + " ";
}
}
} else {
if (selected_target_language_variant == variant_code) {
variantsHTML += "
" + variants[variant_code] + " ";
} else {
variantsHTML += "
" + variants[variant_code] + " ";
}
}
}
$("#target_language_variant").append(variantsHTML);
$("#target_language_variant_find_main").append(variantsHTML);
$("#target_language_variant_container").show();
$("#target_language_variant_container_find_main").show();
} else {
$("#target_language_variant_container").hide();
$("#target_language_variant_container_find_main").hide();
}
});
}