// random image code
//
// randpics: array of random photos
//
var randpics = new Array(
      'img/home/photo01.jpg',
      'img/home/photo02.jpg',
      'img/home/photo03.jpg',
      'img/home/photo04.jpg',
      'img/home/photo05.jpg',
      'img/home/photo06.jpg',
      'img/home/photo07.jpg',
      'img/home/photo08.jpg',
      'img/home/photo09.jpg'
    );
// pick random pictures out of array
var arraylength = randpics.length;                       // set usable array length

var nrandpic = Math.floor(Math.random()*arraylength);    // pick one at random
var image1src = randpics[nrandpic];                      // save first picture
randpics[nrandpic] = randpics[arraylength-1];            // move last element down in array
arraylength--;                                           // and reduce usable array length

var nrandpic = Math.floor(Math.random()*arraylength);    // pick second one at random
var image2src = randpics[nrandpic];                      // save second picture
randpics[nrandpic] = randpics[arraylength-1];            // move last element down in array
arraylength--;                                           // and reduce usable array length

var nrandpic = Math.floor(Math.random()*arraylength);    // pick third one at random
var image3src = randpics[nrandpic];                      // save third picture

// and that's it until we need to write the HTML

// this function writes the table cell containing the random photos
function write_random_photos() {
  document.write("<img src='"+image1src+"' width='90' height='104' alt='' /><br />");
  document.write("<img src='"+image2src+"' width='90' height='104' alt='' /><br />");
  document.write("<img src='"+image3src+"' width='90' height='104' alt='' />");
}
