// original content taken from Nic's JavaScript Page with permission
// lack of these three lines will result in copyright infringment
// made by: Nic's JavaScript Page - http://www.javascript-page.com

var currentdate = 0;
var core = 0;

function initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
  }
}

// List your images here
images = new initArray(
"slide1.jpg",
"slide2.jpg",
"slide3.jpg",
"slide4.jpg",
"slide5.jpg",
"slide6.jpg",
"slide7.jpg"
);

// Change the variable below to reflect the ID of the div that has your random background image
var imageid = "random";
var imagefolder = "images/";

// Don't change anything below this line
var currentdate = new Date();
var core = currentdate.getSeconds() % images.length;
var ranimage = images[core];

function swapimg(thisid, newimage){
  var thisimage = document.getElementById(thisid);
  thisimage.src = newimage;
}

window.onload = function(){
	swapimg(imageid,imagefolder+ranimage);	
}
