function preload()
{
//list of images is in separate file



num_of_imgs = preloadimages.length;

var myimages=new Array(num_of_imgs);



imageCount=0;

imageNotCount=0;


for (i=0;i<num_of_imgs;i++)

{
myimages[i]=new Image();

myimages[i].onload = imageLoaded;
myimages[i].onerror = imageNotLoaded;
myimages[i].onabort = imageStopLoad;
myimages[i].src = preloadimages[i];
}



}

function imageLoaded()
{
imageCount++;
}

function imageNotLoaded()
{
imageNotCount--;
//alert("image preload missed!");
return true
}

function imageStopLoad()
{
imageNotCount--;
alert("image preload aborted!");
}