Stocks lose bulk of gains; Nasdaq flirts with third day of losses