<SCRIPT LANGUAGE="JavaScript">
function loader()
{
preLoad = new Array();
for (i = 0; i < 5; i ++)
{
preLoad[i] = new Image();
}
preLoad[0].src = "first.gif";
preLoad[1].src = "second.gif";
preLoad[2].src = "third.gif";
preLoad[3].src = "fourth.gif";
preLoad[4].src = "fifth.gif";
}
</SCRIPT>
Call it by including ONLOAD="loader()" in the page's <BODY>
tag and it will load five graphics into the array preLoad ready for displaying.
The code can easily be extended to cope with pre-loading as many graphics as
you need.