// rotatePics.js

 var timeDelayPic = 3000;
 var pic_index    = 1;
 var pic_num;
 var pic_str;

// pic_26 is the shack picture, skip it

 function rotatePicStart()
  {
  setTimeout( "rotate_pics()", timeDelayPic ); 
  }

 function rotate_pics()
  {
  if( document.img_left )
   {
   // select a random image pic_01.jpg - pic_64.jpg
   pic_num = Math.round((64*Math.random())+0.501);
   if( pic_num == 64 ) { pic_num = 64; }
   pic_str = "images/home/rotates/pic_" + pic_num + ".jpg";

   // rotate the next picture
   if(      pic_index == 1 ) { document.img_left.src=pic_str; }
   else if( pic_index == 2 ) { document.img_center.src=pic_str; }
   else if( pic_index == 3 ) { document.img_right.src=pic_str; }
   pic_index++;
   if( pic_index == 4 ) { pic_index = 1; }

   // call rotate_pics() again after a delay
   setTimeout( "rotate_pics()", timeDelayPic ); 
   }
  }

