
// RANDOM IMAGE
// Creates an array of images and provides function to return one randomly
// To add more images, simply add them into imageArray

var imageArray = new Array();
num = 0;
imageArray[num++] = "<img src='/hoists/s4/images/footerSquares/square1.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoists/s4/images/footerSquares/square2.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoists/s4/images/footerSquares/square3.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoists/s4/images/footerSquares/square4.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoists/s4/images/footerSquares/square5.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoists/s4/images/footerSquares/square6.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoists/s4/images/footerSquares/square7.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoists/s4/images/footerSquares/square8.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoists/s4/images/footerSquares/square9.jpg' width=100 height=100>"

function getImage() {
  imageNum = Math.floor(Math.random() * imageArray.length);
  returnValue = imageArray[imageNum];
  
  tempStartArray = imageArray.slice(0,imageNum);
  tempEndArray = imageArray.slice(imageNum+1);
  imageArray = tempStartArray.concat(tempEndArray);
  
  return returnValue;
}



var imageArray2 = new Array();
num = 0;
imageArray2[num++] = "<img src='/hoists/s4/images/footerSquares/square1.jpg' width=160 height=160>"
imageArray2[num++] = "<img src='/hoists/s4/images/footerSquares/square2.jpg' width=160 height=160>"
imageArray2[num++] = "<img src='/hoists/s4/images/footerSquares/square3.jpg' width=160 height=160>"
imageArray2[num++] = "<img src='/hoists/s4/images/footerSquares/square4.jpg' width=160 height=160>"
imageArray2[num++] = "<img src='/hoists/s4/images/footerSquares/square5.jpg' width=160 height=160>"
imageArray2[num++] = "<img src='/hoists/s4/images/footerSquares/square6.jpg' width=160 height=160>"
imageArray2[num++] = "<img src='/hoists/s4/images/footerSquares/square7.jpg' width=160 height=160>"
imageArray2[num++] = "<img src='/hoists/s4/images/footerSquares/square8.jpg' width=160 height=160>"
imageArray2[num++] = "<img src='/hoists/s4/images/footerSquares/square9.jpg' width=160 height=160>"

function getImage2() {
  imageNum = Math.floor(Math.random() * imageArray2.length);
  returnValue = imageArray2[imageNum];
  
  tempStartArray = imageArray2.slice(0,imageNum);
  tempEndArray = imageArray2.slice(imageNum+1);
  imageArray2 = tempStartArray.concat(tempEndArray);
  
  return returnValue;
}