
// 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='/hoistsNEW/hoistsAndWinches/images/footerSquares/square1.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoistsNEW/hoistsAndWinches/images/footerSquares/square2.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoistsNEW/hoistsAndWinches/images/footerSquares/square3.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoistsNEW/hoistsAndWinches/images/footerSquares/square4.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoistsNEW/hoistsAndWinches/images/footerSquares/square5.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoistsNEW/hoistsAndWinches/images/footerSquares/square6.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoistsNEW/hoistsAndWinches/images/footerSquares/square7.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoistsNEW/hoistsAndWinches/images/footerSquares/square8.jpg' width=100 height=100>"
imageArray[num++] = "<img src='/hoistsNEW/hoistsAndWinches/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;
}


