function getModificationsCatalog(group_id, select_id, imp_id)
{
    var select = $('#'+select_id).get(0);
    select.options.length = 0;
    select.options[0]     = new Option((lang == 'ru' ? 'Загрузка' : 'Loading')+'...', '');
    select.selectedIndex  = 0;
    $.jNice.SelectUpdate('#'+select_id);

    if (imp_id != '')
    {
        var select = $('#'+imp_id).get(0);
        select.options.length = 0;
        select.options[0]     = new Option((lang == 'ru' ? 'Загрузка' : 'Loading')+'...', '');
        select.selectedIndex  = 0;
        $.jNice.SelectUpdate('#'+imp_id);
    }

    $.post(updateUrl, {'action' : 'mod_catalog', 'group_id' : group_id, 'select_id' : select_id, 'lang' : lang, 'imp_id' : imp_id}, function (data)
    {
        var select = $('#'+data.select_id).get(0);
        select.options.length = 0;
        for (var i = 0; i < data.modifications.length; i++)
        {
            select.options[select.options.length] = new Option(data.modifications[i].modification, data.modifications[i].modification);
        }
        select.selectedIndex = 0;
        $.jNice.SelectUpdate('#'+data.select_id);
        if (data.imp_id != '')
        {
            if (select.options.length == 0)
            {
                var select1 = $('#'+data.imp_id).get(0);
                select1.options.length = 0;
                select1.options[0]     = new Option('', '');
                select1.selectedIndex  = 0;
                $.jNice.SelectUpdate('#'+data.imp_id);
            }
            else
            {
                getImplementation(select.options[0].value, data.imp_id);
            }
        }
    }, 'json'); 
}

function getImplementation(modification, imp_id)
{
    var select = $('#'+imp_id).get(0);
    select.options.length = 0;
    select.options[0]     = new Option((lang == 'ru' ? 'Загрузка' : 'Loading')+'...', '');
    select.selectedIndex  = 0;
    $.jNice.SelectUpdate('#'+imp_id);
    $.post(updateUrl, {'action' : 'imp_catalog', 'mod' : modification, 'lang' : lang, 'imp_id' : imp_id}, function (data)
    {
        var select = $('#'+data.imp_id).get(0);
        select.options.length = 0;
        for (var i = 0; i < data.implementations.length; i++)
        {
            select.options[select.options.length] = new Option(data.implementations[i].implementation, data.implementations[i].engine_id);
        }
        select.selectedIndex = 0;
        $.jNice.SelectUpdate('#'+data.imp_id);
    }, 'json');

}