var currentdate = 0
var core = 0

function StringArray (n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '

  }
}

image = new StringArray(7)
image[0] = '../courses/images/checklist.jpg'
image[1] = '../courses/images/fire_training.jpg'
image[2] = '../courses/images/first_aid.jpg'
image[3] = '../courses/images/hs_operational.jpg'
image[4] = '../courses/images/manual_handling.jpg'
image[5] = '../courses/images/risk_assessment.jpg'
image[6] = '../courses/images/stress.jpg'

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()+ "'>")