I have the following script which swaps the picture when clicked: img1=new Image() img1.src="avatars/avatar1preview.gif" img2=new Image() img2.src="avatars/avatar1.gif" and i initially used the script so that avatar1.gif wont load unless clicked on. But, when you open the page it still loads (takes a long time). How can i make it so that the image only loads when clicked on. Below is what goes around the picture: <a onClick="document.images['avatar1'].src=img2.src" onMouseup="document.images['avatar1'].src=img1.src">