I've got a bathroom fan that I no longer need, which has a simple electronic circuit in it to keep the fan running for a variable length of time after the light is switched off.
The circuit seems to be just a potential divider, a full wave rectifier, a smoothing capacitor, and a simple timer...