function CEL_OnGWConnectionStatusChanged(Source, EventID, newStatus, varargin)

global m_CEL;
global m_AccountID;

global m_CurFunc;
global m_LatencyTime;

try
    m_CurFunc = 'expression';
    m_LatencyTime = 15;
    
    % Informing about GW connection status changes.
    if (newStatus == 0)
        disp('GW Connection status is Up');
        % Reseting accounts and changing AccountSubscriptionLevel, to
        % reload accounts.
        m_AccountID = 0;
        m_CEL.AccountSubscriptionLevel = 'aslAccountUpdatesAndOrders';
        m_CurFunc = 'none';
        m_LatencyTime = 0;
    elseif (newStatus == 1)
        disp('GW Connection status is Delayed');
    else
        disp('GW Connection status is Down');
    end
    
catch
    CEL_ShutDown;
    disp('An error occurred in CEL_OnGWConnectionStatusChanged.m file.');
end