Image change onclick Javascript, can I add a timer to change as well?
<p>Edit: is there anyway to have the interval only kick in if the user has not clicked? example: I set a interval of 20 seconds, but if the user had clicked the first image at 15 seconds, the next image only shows up for the remaining 5 seconds. I need a timer -or- a click but not both. Thanks! </p>

<p>So I have the javascript below that currently works onclick. Can it be modified to also add a timer? So if they don't click on the first image, I can set a timer to go to image 2.. then to image 3.. and so on. Thx for your efforts!</p>

<pre><code>&lt;img alt="" src="image1.gif" style="height: XXXpx; width: XXXpx" id="imgClickAndChange" onclick="changeImage()"  /&gt;

&lt;script language="javascript"&gt;
    function changeImage() {

        if (document.getElementById("imgClickAndChange").src == "image1.gif") 
        {
            document.getElementById("imgClickAndChange").src = "image2.gif";
        }
        else 
        {
            document.getElementById("imgClickAndChange").src = "image3.gif";
        }
    }
&lt;/script&gt;
</code></pre>
