ESSEX wicketkeeper James Foster hit a fine 86 to steer to his side to a first-innings lead of 36 over Glamorgan on day two of their County Championship match at Chelmsford.
The hosts looked set to face a deficit as they stumbled to 198 for eight before Foster's heroics forged a ninth-wicket stand of 63 and ultimately helped establish an encouraging total of 280.
Will Bragg's 93 had given Glamorgan a day one total of 244 and it looked likely to set the pace as the hosts stumbled in response, losing opener Jaik Mickleburgh lbw to the returning Graham Wagg for two in the fourth over.
Fellow opener Tom Westley went for 20 but sturdy resistance from Greg Smith and Jesse Ryder, who both made 42, and a 51 from Mark Pettini lifted Essex to 186 before the sixth wicket fell, Pettini caught by Wagg off the bowling off Dean Cosker.
The cheap losses of Matt Salisbury and Tom Craddock with just 12 more runs added to the Essex total swung the momentum back Glamorgan's way, but Foster stepped up with his excellent knock to lift his side to 261 for nine.
Foster's eventual departure, caught by Mark Wallace off Michael Hogan, looked set to hasten the end of the Essex innings, though last man Thomas Moore frustrated the visitors' attempts to wrap things up with a quickfire 17 off 13 balls.
Glamorgan opener Tom Lancefield survived two balls of the Glamorgan second innings to leave them on nought for nought as bad light ended play.
Monty Panesar, who was dropped from the Essex side for the Glamorgan game because of poor timekeeping, watches the game from the balcony