JavaScript to change images
<p>I have set of images named as <code>img1, img2, img3, img4,......., imgx.</code> So, I want to code a JavaScript to display an image <code>img1</code> at <code>document.onload()</code> and on first click image to be changed to <code>img2</code> next on second click the image to be changed at <code>img3</code> and then same to the next image on every <code>NEXT</code> button click. In this manner I need even <code>PREVIOUS</code> button to go back to the previously viewed images.</p>

<p>How to implement this?</p>
