function addSelectedSchedule(id)
{
    if (id) { selectedIds.length = 0; selectedIds.push(id); rowChecked(id, true); }
    if (selectedIds.length == 0) { alert(ServiceResources.NoServiceSelected); 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) {
        if (getURLParameter('cbmode') != null && getURLParameter('cbmode') != '') {
            eval('opener.' + getURLParameter('cbmode') + '.selectScheduleCallback(result)');
        } else {
            self.callback = opener.selectScheduleCallback;
            self.callback(result);
        }
    } else {
        self.callback(result);
    }

    self.close();
    return false;
}