Background Image Rotator
<p>I need some suggestions and ideas to improve a background image rotator.</p>

<p>The script as of now is very basic but I'm looking to change 2 thing.</p>

<ol>
<li>I want the images to fade into each other.</li>
<li>I need to be able to preload the images so it doesn't have the delay when loading them when they first display.</li>
</ol>

<p>Thoughts?</p>

<pre><code>&lt;script type="text/javascript"&gt;
    var images = ['bg1.png', 'bg2.png', 'bg3.png'];
    var curImage = 0;
    function switchImage()
    {
        curImage = (curImage + 1) % images.length
        document.body.style.backgroundImage = 'url(images/' + images[curImage] + ')'
    }
    window.setInterval(switchImage, 5000);
&lt;/script&gt;
</code></pre>

<p>Example: <a href="http://www.nickersonweb.com/demo/PMS/index.html" rel="nofollow">http://www.nickersonweb.com/demo/PMS/index.html</a></p>
