var currentIndex = 0;
var galleryImages = [];

function TapGalleryImageShow() {
    lightboxSlide('slide', 'slide_caption', this.contextPath, this.zoomPageUrl, this.slideImgUrl, this.captionHtml, 
                  this.imageAlt);
}

function TapGalleryImage(contextPath, slideImgUrl, zoomPageUrl, captionHtml, imageAlt) {
    this.contextPath = contextPath;
    this.slideImgUrl = slideImgUrl;
    this.zoomPageUrl = zoomPageUrl;
    this.captionHtml = captionHtml;
    this.imageAlt = imageAlt;
    this.show = TapGalleryImageShow;
}

function TapGalleryPrev() {
    currentIndex = (currentIndex-1) % galleryImages.length; galleryImages[currentIndex].show(); return false;
}

function TapGalleryNext() {
    currentIndex = (currentIndex+1) % galleryImages.length; galleryImages[currentIndex].show(); return false;
}

function TapGalleryJump(i) {
    currentIndex = i % galleryImages.length; galleryImages[currentIndex].show(); return false;
}
