preloading images with javascript
<p>I'm making a site in which I'm using jquery to change background images on a page. There will be quite a few images substituted through the course of the site. </p>

<p>By declaring variables like this at the beginning of the script, will it preload the images and therefore allow for faster substitution of images?  Or, if I do it with too many images (like 50), will it slow things down? or do the variables use too much memory? </p>

<p>Are there any issues you see with this plan, or is there a better way?</p>

<pre><code>var img1 = "url('images/wackawacka.jpg') repeat";

var img2 = "url('images/wabbaawacka.jpg') repeat";

var img3  etc...
</code></pre>
