      /***********************************************************/
      /* JavaScript which changes specified images in a document */
      /* randomly from a predefined list - makes a good          */
      /* desktop background using your own pictures.             */
      /* RELEASED TO THE PUBLIC DOMAIN 4/00 BY:                  */
      /* Stuart (stuart@who.net)                                 */
      /* Inspired by Abby.                                       */
      /* Please let me know where you use this!                  */
      /***********************************************************/	

   /* define all rotating images to be used in document and preload */

   one=new Image;
   one.src= webroot + "images/home_01.jpg";

   two=new Image;
   two.src= webroot + "images/home_02.jpg";

   three=new Image;
   three.src= webroot + "images/home_03.jpg";

   four=new Image;
   four.src= webroot + "images/home_04.jpg"  ;        

   five=new Image;
   five.src= webroot + "images/home_05.jpg";

   six=new Image;
   six.src= webroot + "images/home_06.jpg";          

   seven=new Image;
   seven.src= webroot + "images/home_07.jpg";          

   eight=new Image;
   eight.src= webroot + "images/home_08.jpg";

                                

   /* define an array for each rotating image containing the    */
   /* images to be used in that location and the location lable */

   target1=new Array();
      target1[0]=one.src;    /* list images first for the LABEL below */
      target1[1]=two.src;
      target1[2]=three.src;
      target1[3]=four.src;
      target1[4]=five.src;
      target1[5]=six.src;
      target1[6]=seven.src;
      target1[7]=eight.src;
      target1[8]="rotating"; /* name LABEL from document */


   /* this is an array for listing all the rotating image arrays */
   /* defined above, don't forget to update if you change the    */
   /* number of rotating images in the document                  */

   targets=new Array();
      targets[0]=target1;  /* list target arrays name here */
 
   /* this array list the number of images defined for each      */
   /* rotating image array, don't forget to update if you change */
   /* the number of rotating images in the document              */

   targetsLEN=new Array();
      targetsLEN[0]=(target1.length-2);  /* number of images in array for each target */
  /* minus two, because numbering starts from  */
                                         /* 0 and the last location is the label name */
  

   var pause           = 5000 ;  /* pause between image changes looks a little */
                                /* more random, because it sometimes loads    */
                                /* the same image in the same location        */

   var numberOfTargets = (targets.length-1);
   var targetINDEX     = Math.round(Math.random() * numberOfTargets);
   var imageINDEX      = Math.round(Math.random() * targetsLEN[targetINDEX]);
   var target          = targets[targetINDEX];
   var place           = target[targetsLEN[targetINDEX]+1];
   var pic             = target[imageINDEX];

   function display()
      {
         targetINDEX = Math.round(Math.random() * numberOfTargets);
         imageINDEX  = Math.round(Math.random() * targetsLEN[targetINDEX]);
         target      = targets[targetINDEX];
         place       = target[targetsLEN[targetINDEX]+1];
         pic         = target[imageINDEX];
         window.document.images[place].src=pic;

       }


   function startDisplay() 
      {
         window.setInterval('display()', pause);
      }            
