
function addSelectedRow(id)
{
    if (id) { selectedIds.length = 0; selectedIds.push(id); rowChecked(id, true); }
    if (selectedIds.length == 0) { alert(CommonResources.NoOneSelected); return false; }

    var result = new Array();
    result["selectedIds"] = selectedIds;
    result["selectedNames"] = selectedNames; 

    if (getURLParameter('msName') != null && getURLParameter('msName') != '') {
        result["msName"] = getURLParameter('msName');
    }    
    
    if (self.callback == null) {
        self.callback = opener.complexOrderDialogCallback;
    }

    self.callback(result);


    self.close();
    return false;
}

function complexOrderExecutorClearFilter() {
    if ($('#clearfilter').hasClass('disabled')) return false;

    var params = mergeTableDefaultLoadParams();

    if (getURLParameter('tb_serviceid') != null && getURLParameter('tb_serviceid') != '') {
        params["tb_serviceid"] = getURLParameter("tb_serviceid");;
    }

    params["reset"] = true;
    params["nolayout"] = true;

    //Уберем фильтр чтобы сбросить его состояние
    $('#filterholder').remove(); $('ul.filterlist li.selected').removeClass('selected');
    $('#columnsholder').remove();
    $('#showfilter img').attr('src', $('#showfilter img').attr('src').replace('_active', ''));
    $('#showcolumns img').attr('src', $('#showcolumns img').attr('src').replace('_active', ''));
    $('#search').val('');
    disableSaveAndClear();

    $(tableRootDiv).load(tableUrl(), params, function () { c2c(tableRootDiv); initTable(); });
    return false;
}