jQuery image rotator
<p>I'm trying to make this simple image rotator but, as usual, my code doesn't work. I want to swap between 2 images ("image1" and "image2")</p>

<pre><code>$x = 0;
function rotateImage(){
    if($x == 0){  //if function is being called for the first time
        $x = 1;
    }
    $(".window").html("&lt;img src=\"../images/image" + $x + ".png\" /&gt;");
    $x = $x + 1;
    if($x &gt; 2)  
        $x = 1;  //reset x to 1 if last image has been reached
}

rotateImage();  //first function call
setInterval("rotateImage()", 1000);  //call function every second
</code></pre>

<p>Image1 shows up but there is no swapping going on.</p>

<p>Thanks in advance,</p>

<p>Matt</p>
