var theImages = new Array()

// If images are changed or added, change only this part
theImages[0] = '/images/random_image/home-dad-mom-girl.jpg'
theImages[1] = '/images/random_image/home-senior-bike.jpg'
theImages[2] = '/images/random_image/home-mariachis.jpg'
theImages[3] = '/images/random_image/home-mom-baby.jpg'
theImages[4] = '/images/random_image/home-mom-boy-girl.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}

var whichImage = Math.round(Math.random()*(p-1));
var thisImage =  theImages[whichImage]

$('#main').css({
  'background': 'url(' + thisImage + ')'
  });



