Hi maxslug,
Switching picture dynamically without triggering a page change is actually quite simple and doesn't involve ajax at all (this is rather what we used to call dhtml 10 years or so ago).
You just have to listen for thumbnail click. Your listener will then set the src attribute of your main image container adequately.
For example, suppose your dom structure is as follows:
`
<div class='thumb'>
<img src='mythumb' href='image.php' sref='customimageurl'/>
</div>
<img id='img-container'/>
`
Then you just need to add a click listener on #thumbs and assert that the node name of the target of the event is 'img'. Note that i've introduced here a sref attribute: granted it may not pass validators, but it is way easier that way. So using jquery we should have something like this (blind-code):
`
var imgContainer = $('img-container');
$('#thumbs').click(function(e) {
var t = e.target;
if ( t.nodeName == 'img' ) {
var imageUrl = t.attr('sref');
imgContainer.attr('src', imageUrl);
}
});
`
There you should be done. Of course you may also want to add some transition.
However with that you're only half-way. Indeed you may also want your image page to look like your album page (in case the visitor has disabled js).
For this you may want to simply include album.php in image.php (nothing more, nothing less), and in album, set the context accordingly (for instance lookup the correct album page, highlight the correct image, etc.).
That's the way i implemented it anyway. All the work is done in classes/GalleryController (request singleton) if you want to have a look at it.
regards