﻿var activeIndex = 0;

$(document).ready(function() {
    setInterval('nextGraphic();', timing);
});

function nextGraphic() {
    activeIndex++;

    if (activeIndex >= graphic.length)
        activeIndex = 0;

    updateGraphic();
}

function updateGraphic() {
    $(graphicsTemplateImage).attr("src", graphic[activeIndex]);
    
    if (imageLinkArray[activeIndex] != "") {
        slideShowLink.attr("href", imageLinkArray[activeIndex]);
    }
    else {
        slideShowLink.removeAttr("href");
    }
}

