Help writing dynamic gallery involving php


I am a near n00b at programming in php, only read a single book, but i thrown myself into a rather intimidating project nonetheless. I have this site for a danish organization, Balkanfestudvalget, and I’m stuck at the gallery:

I have php load up the thumbnails, and a javascript called that shows a modalbox/lightbox/blackbox, that should reveal the chosen image. That is what i need help with. I can’t figure out to dynamically change the image path in the little bit of javascript to reflect the chosen thumbnail.

Heres the page as it looks now:

And heres the php file, galleri.php:

Hope it’s not to messy.

The javascript part is at the bottom of the page.

Any help is appreciated, and, please, don’t critic the rest of the code to much. It’s a first try, and I’m very proud of the outcome :smiley: