Topic: Which image is selected?


Is there a way to determine which image is selected by the user?

Ideally, I would like to hook a javascript callback function that is triggered when the user clicks on an image to view it and use that function and the id of the selected photo to do some other action on the page such as display text below the tiltviewer object.
As an example, I need to know which image is selected so I can retrieve from the DB some comments about that image and display in the html below the title viewer. When the user selects another image from the tiltviewer, I can take that id and get the comments related to that particular photo.

Any help is appreciated.