var currentdate = 0
var core = 0

function StringArray (n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '

  }
}

image = new StringArray(8)
image[0] = 'images/01.gif'
image[1] = 'images/02.gif'
image[2] = 'images/03.gif'
image[3] = 'images/04.gif'
image[4] = 'images/05.gif'
image[5] = 'images/06.gif'
image[6] = 'images/07.gif'
image[7] = 'images/08.gif'

var ran = 60/image.length

function ranimage() {
  currentdate = new Date()
  core = currentdate.getSeconds()
  core = Math.floor(core/ran)
    return(image[core])
}

document.write("<img src='" +ranimage()+ "'>")