function ReadAllOffers($prj_id)
{
    global $session;
    session_start();
    $objResponse = new xajaxResponse();
    $offers = new projects_offers();
    $prj_id = intval($prj_id);
    $user_id = get_uid(false);
    if (is_emp()) {
        $offlist = $offers->OffersEmpNewMessages($prj_id);
        if (!empty($offlist)) {
            projects_offers_dialogue::markAllReadEmp($prj_id, $user_id);
            $script = '';
            for ($i = 0; $i < count($offlist); ++$i) {
                $script .= 'if($chk($("po_comments_' . $offlist[$i]['id'] . '"))) { ' . "\$('po_comments_{$offlist[$i]['id']}').removeClass('po_comments_new_hide');" . "\$('po_comments_{$offlist[$i]['id']}').addClass('po_comments'); }";
                $objResponse->assign("new_msgs_{$offlist[$i]['id']}", 'innerHTML', '');
            }
            $objResponse->script($script);
            $objResponse->assign('op_count_offers_new_msgs', 'innerHTML', '');
            $objResponse->assign('op_count_executor_new_msgs', 'innerHTML', '');
            $objResponse->assign('op_count_candidate_new_msgs', 'innerHTML', '');
            $objResponse->assign('op_count_refuse_new_msgs', 'innerHTML', '');
            $objResponse->assign('prj_chk_all', 'innerHTML', '');
            // Обновляем количество новых сообщений в заголовке.
            $cnt_emp_new_messages = projects_offers_dialogue::CountMessagesForEmp($_SESSION['uid'], true);
            if ($cnt_emp_new_messages > 0) {
                $last_emp_new_messages_pid = projects_offers_dialogue::FindLastMessageProjectForEmp($_SESSION['uid']);
            } else {
                $last_emp_new_messages_pid = false;
            }
            $ndm_html = '';
            $sScript = "\$\$('.b-userbar__prjic').addClass('b-userbar__prjic_hide');\$\$('.b-userbar__icprj').removeClass('b-userbar__icprj_hide');";
            if ($last_emp_new_messages_pid) {
                $ndm_html = '(<a class="b-userbar__toplink" href="/projects/?pid=' . $last_emp_new_messages_pid . '" title="Есть новые сообщения">' . $cnt_emp_new_messages . '</a>)';
                $sScript = "\$\$('.b-userbar__prjic').removeClass('b-userbar__prjic_hide');\$\$('.b-userbar__icprj').addClass('b-userbar__icprj_hide');";
            }
            $objResponse->assign('new_dialogue_messages', 'innerHTML', $ndm_html);
            $objResponse->script($sScript);
        }
        return $objResponse;
    }
}