It's good to use the "code" tags when posting code. But if the arduino runs just fine when the circuit isn't connected, then the problem isn't in the code. How well does it work with only the "Right" relay + transistor&resistor connected, or only the "Left" relay + transistor&resistor? That's what I'm suggesting; you start with the circuit completely disconnected, and then add back portions of the circuit until you start getting reset error again. then you know what the problem is.