function RImage()
{
    this.image_list = new Array();
    this.current_index = 0;

    // -------------------
    // Preload the image files for the rotating images.
    // -------------------
    this.PreloadImages = function(image)
    {
       this.image_list = image.split(",");
       image_srclist = new Array(this.image_list.length);

       for (i = 0; i < this.image_list.length; i++)
       {
          this.image_list[i].replace(/\//,"");
          image_srclist[i] = new Image();
          image_srclist[i].src = this.image_list[i];
       }
        this.current_index = Math.ceil(Math.random() * this.image_list.length);
    }

    // -------------------
    // Add the specified images to the list of images.
    // The leading '/' is removed from every image name.
    // PARAM:  images: a comma delimited string of filenames
    // -------------------
    this.AddImages = function(images)
    {
       this.image_list = images.split(",");
       //image_srclist = new Array(image_list.length);

       for (i = 0; i < this.image_list.length; i++)
       {
          this.image_list[i].replace(/\//,"");
       }
       this.current_index = Math.ceil(Math.random() * this.image_list.length);
    }

    // --------------------
    // Rotate through the list of images and display
    // the new image every 5 seconds.
    // --------------------
    this.RotateImage = function(imageID)
    {
        if(this.image_list.length > 1)
        {
            this.current_index = (++this.current_index % this.image_list.length);
            document.getElementById(imageID).src = this.image_list[this.current_index];
        }
       
       return;
    }

    // --------------------
    // Rotate through the list of images and display
    // the new image every 5 seconds.
    // --------------------
    this.FirstImage = function(imageID)
    {
        this.current_index = (++this.current_index % this.image_list.length);
        document.getElementById(imageID).src = this.image_list[this.current_index];
        return;
    }
}

    function MM_preloadImages() 
    { //v3.0
        var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
