Not sure if this is the best method, but this is the one I used to preload the image.
<script type="text/javascript">
if (document.images)
{
imgPreload = new Image();
imgPreload.src = "../Images/ajax-loader.gif";
}
</script>
I suppose this is what you need:
developer.yahoo.com/.../imageloader