hey, im having some trouble. Basically i want a thumbnail to open, when clicked, as the enlarged image in a new window thats resized for it.

Can anyone help me with a code please? ive tried ones that link to pages with the image on but its not practical with so many thumb nails.