I recommend the blueimp Gallery plugin, you can download it and within the zip there will be some examples, it's okay simple, you link to css and js (jquery is necessary), then you have a basic script to load the plugin on the page and then just use the html structure that the site gives you the images ... It has a plugin documentation session ... Any questions, put here ...
I changed to jquery in a project of mine, I believe it can help you ... Replacing the id link by a link class in html structure ...
$(function(){
$('.link').each(function(){
$(this).click(function(event){
event = event || window.event;
var target = event.target || event.srcElement,
link = target.src ? target.parentNode : target,
options = {index: link, event: event},
links = this.getElementsByTagName('a');
blueimp.Gallery(links, options);
});
});
});