Those images won't work by changing only image URL source because they are not loaded onto the page. JavaScript is not Ajax that sends request to the server to return the image. You need to load all images and hide those you don't want to be displayed. Then use Javascript to set/change the style in order to display what you want. You can look at http://www.daniweb.com/forums/thread272711.html as an example. There are many ways to do it too.