function CEL_OnAccountChanged(Source, EventID, Change, Account, Position, varargin)

global m_CEL;
global m_AccountID;

global m_LatencyTime;

try
    % Informing about accounts reload and taking GWAccountID of the first
    % account in Accounts collection.
    if (Change == 0 && m_AccountID == 0)
        curAccount = m_CEL.Accounts.ItemByIndex(0);
        if ~isempty(curAccount)
            m_AccountID = curAccount.get('GWAccountID');
            disp ' ';
            disp(['All accounts were reloaded. The account "', curAccount.GWAccountName, '" was selected.']);
        end
    end

    m_LatencyTime = 15;
catch
    CEL_ShutDown;
    disp('An error occurred in CEL_OnAccountChanged.m file.');
end