Here is the code for jquery Image preloader, easy way to preload images which are needed later.
$.preloadImages = function() {
for (var i = 0; i < arguments.length; i++) {
<code>$("<img />").attr("src", arguments[i]);</code>
}
}
$.preloadImages("hoverimage1.jpg","hoverimage2.jpg");
When all images are in the same folder simply use-
$("").attr("src", "images/nav/".arguments[i]);