I need a javascript that can do Show Hide Image function similar to Show Hide Layers

There are five buttons (gif) in a row. Initially all buttons are in its OFF state. Clicking on button 1 (off state) will show its ON state (different gif). Clicking on button 2 will show its ON state and also will bring button 1 to its OFF state.

Pls post me a link or a script.

THANKZ in advance