I created a very simple photo gallery example for you to take a look at. Hopefully it will help you out. I used html, css and a wee little bit of jQuery.
To make that code work, you’d need to enclose the image src in quotes. Also, the reference to the dynamic large image has already been obtained via getElementById(“active”), so leave the references to ‘this’ out of it.
So in the first onclick assignment, use:
activeImg.src = "image1.jpg";
… and so on for the others.
Also, if you are going to apply styling to the gallery later on, you might want to remedy that doctype, which is missing its URI. A Transitional html doctype with a missing URI creates styling problems (quirks mode) for Internet Explorer. Make sure you code consistently also - those img tags are xhtml.
Also (sorry to be pedantic about non-javascript matters), if you are just starting out, it may pay to look at how galleries can be done without using tables for layout. Have a look at the following example:
And for this type of rollover gallery, you can also do it with CSS entirely if you like. Have a look at the many examples at www.cssplay.co.uk