// 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(
"banner1.jpg",
"banner2.jpg",
"banner3.jpg",
"banner4.jpg"
);
images2 = new initArray(
"L-2000_example1.jpg",
"L-2000_example2.jpg",
"L-2000_example1.jpg",
"L-2000_example2.jpg"
);
images3 = new initArray(
"poly-mat_example1.jpg",
"poly-mat_example2.jpg",
"poly-mat_example3.jpg",
"poly-mat_example4.jpg"
);
images4 = new initArray(
"poly-ss_example1.jpg",
"poly-ss_example2.jpg",
"poly-ss_example3.jpg",
"poly-ss_example4.jpg"
);

// Change the variable below to reflect the ID of the div that has your random background image
var imageid = "random";
var image2id = "ls-2000";
var image3id = "poly-mat";
var image4id = "poly-ss";
var imagefolder = "images/";

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

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