function CEL_OnGWConnectionStatusChanged(Source, EventID, newStatus, varargin)

global m_CEL;
global m_AccountID;

try    
    % 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.set('AccountSubscriptionLevel', 'aslAccountUpdatesAndOrders');
    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