$(document).ready(function(){
loadGallery(true, 'img.thumbnail');
/**
*
* @param setIDs Sets IDs when DOM is loaded. If using a PHP counter, set to false.
* @param setClickAttr Sets the attribute for the click handler.
*/
function loadGallery(setIDs, setClickAttr){
var current_image,
selector,
counter = 0;
function updateGallery(selector) {
var $sel = selector;
$('#image-gallery-image').attr('src', $sel.data('image'));
}
$(setClickAttr).on('click',function(){
updateGallery($(this));
});
}
});