var bannerIndex = 0;
var imageCount = bannerImg.length;
var timerID;

function rotateImage() {
  bannerIndex++;
  if (bannerIndex == imageCount) {
    bannerIndex = 0;
  }
  
  var updateImage = document.getElementById('rotateImg');
  if (updateImage != null) {
    updateImage.src = bannerImg[bannerIndex];
    updateImage.alt = bannerHint[bannerIndex];
    updateImage.title = bannerHint[bannerIndex];
    var updateLink = document.getElementById('rotateLink');
    updateLink.href = bannerLink[bannerIndex];
    resumeRotation();
  }
}

function resumeRotation() {
  timerID = setTimeout("rotateImage()", 6000);	
}

function stopRotation() {
  clearTimeout(timerID);	
}

window.onload = rotateImage;


