Rotate images, if last image then hide
<p>I have 3 images that I want to rotate when a button is clicked.</p>

<p>image1, image2, image3.</p>

<p>If the image is at image1, then when clicked it should show image2 (and so on, in order of image1, .., image3).</p>

<p>When I am at image3, it should then hide the image, i.e. don't display it.</p>

<p>I need some help with the javascript function to do this, I already have the code for the button click event.</p>

<p>I am passing the toggle() function the jquery object <code>$('myImageID')</code>;</p>

<pre><code>$(document).ready(
    function() 
    {

        $('#button1').click( function() { toggleSector( $('#sector1') ) }  ;            

    } 
);

function toggleSector(o)
    {     
         // help!
    }

&lt;div id="sector1"&gt;&lt;/div&gt;
&lt;input type="button" id="button1" value="Sector 1" /&gt;
</code></pre>

<p><b>Update</b></p>

<p>I have to somehow find the name of the current background image set to the 
<code>&lt;div&gt;</code> where my image is.</p>

<p>Is there a background property to get the image name currently being displayed?</p>
