');
container.attr('id', container_id);
var checkbox = $('
');
checkbox.attr('id', value + '_et');
checkbox.val(value);
container.append(checkbox);
var label = $('
');
label.attr('for', value + '_et');
container.append(label);
$('#entry_type_block').append(container);
$(container).find('input').iCheck({
checkboxClass: 'icheckbox_square-grey',
});
} else {
$('#' + container_id).find('input').prop('checked', true);
}
});
// $("#search_submit").click(function() {
$("#search_form, #search_form2").submit(function (event) {
showLoading();
});
$('input[type=radio], input[type=checkbox]').on('ifChecked', function (event) {
$(event.target).parent().next().addClass('icheck_selected');
});
});
function resetForm(val) {
$('#extra_fields').hide();
$('#extra_link').show();
$('div[id^=cat_selected_]').remove();
$('#cat_cbx').hide();
$('.custom_field_block').remove();
$('.search_extra_item').remove();
if (val == 'file_in') { // files
$('#entry_type').empty();
$('#category_block').css('display', 'block');
$('#entry_type_block').css('display', 'none');
$('#category_block .dropdown_link').attr('data-url', 'https://help.sweb.ru/search_category/?type=file');
xajax_getExtraFields('file');
xajax_getCustomFields(2);
} else if (val == 'all_in') { // all
$('#extra_link').hide();
$('#category_block').css('display', 'none');
$('#entry_type_block').css('display', 'none');
} else if (val == 'news_in') { // news
$('#category_block').css('display', 'none');
$('#entry_type_block').css('display', 'none');
//xajax_getExtraFields('news');
xajax_getCustomFields(3);
} else if (val == 'article_in') { // article
$('#category_block .dropdown_link').attr('data-url', 'https://help.sweb.ru/search_category/?type=article');
//xajax_getExtraFields('article');
xajax_getCustomFields(1);
$('#category_block').css('display', 'block');
$('#entry_type_block').css('display', 'block');
$('#custom_field').css('display', 'block');
}
}
function setDisabledByCheckbox(pref) {
var ch = document.getElementById("is_" + pref);
for (var i = 0; i