Oh just a note: Make sure you use relays rated for 240v with enough amps for your purposes.
If you use little hobby 12v relays, the whole thing will probably explode in a shower of sparks.
;D ;D ;D I did that a couple of months ago while pulling apart my old digi camera, if the shock wasn't enough I nearly did it twice as the capacitor on those charge unbelievably fast.
Well the one I was ripping apart was broken.
I deliberately tried it out one last time to double check that it was in fact dead before opening it up so the capacitor was freshly charged.
Turns out that the bulb was probably dead but the rest of it was working very well.