These genes turn on IN water? How does it know there will be no water at the end of the gestations period? How does it know it's babies need to crawl out of the water and survive without water when the eggs are laid IN water? How does the animal know that it is a drought or wet season at the time of egg laying if the eggs are laid in water? Is it intelligent design or the animal is psychic and knows that at the end of the gestation period there will or won't be water, and its babies need to be aquatic or reptillian?
You are asking the wrong people. It's the ID crowd that needs to explain how you anticipate need. Darwinian evolution doesn't anticipate need. Those individuals that are best adapted to current conditions leave more offspring. It's a bell curve thing, not an either/or.
If you want details, you'll need to provide me with some. I'm searching for a sub-Saharan amphibian that alternates between something like a newt and eft state, but not having any luck. Was this a frog? A toad? A salamander? You don't remember the name at all?