Circuit to swap to battery power

Thanks Mike - looks a little more complicated than I hoped. Would there be any harm in connecting a 12v lead acid to my circuit permanently via a diode? I'm using a regulated 12v psu and the battery is on permanent trickle charge (obviously not if the power is cut and battery backup is required)