// Preload Images
function preloadImages() {
   // get the number of images 
   var arg=preloadImages.arguments;
   if (arg.length > 0) {
      if (document.images) {
         // declare new array into the document 
         if (!document.preLoad)
            document.preLoad=new Array();
         // preload the images
         var i;
         for (i=0; i<arg.length; i++) {
            document.preLoad[i]=new Image;
            document.preLoad[i].src=arg[i];
         }
      }
   }
}

// Swap an image when the cursor is over it
function swapImage(imageID, newImage) { 
   var workImg;
   // find the Image by ID
   if ( (workImg = document.getElementById(imageID)) != null ) {
      // save the old source for Restore function
      workImg.oSrc = workImg.src;
      // change the source of the image
      workImg.src = newImage;
   }
   return;
}

// Restore an image when the cursor is out
function restoreImage(imageID) { 
   var workImg;
   // find the Image by ID
   if ( (workImg = document.getElementById(imageID)) != null ) {
      // cwitch with the old source 
      workImg.src=workImg.oSrc;
   }
   return;
}
