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.
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