Preload and fade-in function problem

Hi

I created 2 functions:

  • 1 for preloading my image
  • and another 1 after the image is loaded to fade that image in.

But i’m having trouble converting it to a function that is usable for more than 1 image. So I don’t have to retype the code every time.

Can some1 help me with it.