I'm trying to add java script to my website so it loads my background image. I followed a tutorial from here, http://thecodecentral.com/2008/02/21...t-image-loader and so I copy and pasted this code into note pad:

var loader = new ImageLoader('http://www.website.com/htdocs/image.jpg');

loader.loadEvent = function(url, image){
//actions to perform when the image is loaded
//alert(url + ' is loaded');
//hide loading indicator if applicable


and saved the file as imageloader.js. I didn't put the actual website or image in this post because I don't want it to get referenced when searching my website in google. When I open the page, there is no loader, the image takes a couple seconds to load when you first go to my page like usual. Am I doing something wrong? did I call the file a wrong name? should I reference imageloader.js in the html code of the webpage? Thanks for your time!