This is the basic setup of what I'm going to do. Have a wire plugged into the mains that is then connected to a ON/OFF flip switch then goes on to the rest of my project. Want I want to do is to add an internal DC circuit supplied by a 9V battery that when detects that the switch is closed i.e. their is mains power going through the wire, a green LED will light and when there is no power, there's a red LED.
What should I do to achieve this? (I was thinking of using some sort of transistor) A circuit diagram would be great as well.