




/*
     FILE ARCHIVED ON 22:13:57 Sep 3, 2005 AND RETRIEVED FROM THE
     INTERNET ARCHIVE ON 14:04:22 Jun 20, 2011.
     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.

     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
     SECTION 108(a)(3)).
*/

function SlideShow(image_id, caption_id)
{
   this.image_id = image_id;
   this.caption_id = caption_id;
   this.slide_list = [];
   
   this.current_slide = 0;
}

SlideShow.prototype.addSlide = function(image_src, caption)
{
   image_object = new Image();
   image_object.src = image_src;

   var nextPos = this.slide_list.length;
   this.slide_list[nextPos] = [image_object, caption];
}

SlideShow.prototype.nextSlide = function()
{
   if (++this.current_slide >= this.slide_list.length)
     this.current_slide = 0;
}

SlideShow.prototype.previousSlide = function()
{
   if (--this.current_slide < 0)
     this.current_slide = this.slide_list.length - 1;
}

SlideShow.prototype.showImage = function()
{
   image_object = this.slide_list[this.current_slide][0];

   if (image_object && document.images)
     {
        if (document.images[this.image_id])
          document.images[this.image_id].src = image_object.src;
     }
}

SlideShow.prototype.showCaption = function()
{
   caption = this.slide_list[this.current_slide][1];

   if (caption)
     {
        if (document.all)
          {
             if (document.all[this.caption_id])
               document.all[this.caption_id].innerHTML = caption;
          }
        else if (document.getElementById)
          {
             captionElement = document.getElementById(this.caption_id)
             if (captionElement)
               captionElement.innerHTML = caption;
          }
     }
}

SlideShow.prototype.next = function()
{
   this.nextSlide();
   this.showImage();
   this.showCaption();
}

SlideShow.prototype.previous = function()
{
   this.previousSlide();
   this.showImage();
   this.showCaption();
}


