    var scrolling_images =
    {
      container_node : null,
      container_width : 0,
      images : [],

      spacing : 3,
      hop : 2,

      interval_speed : null,
      interval : null,

      initialize : function(container, width)
      {
        this.container_node = container;
        this.container_width = width;
        this.container_node.style.overflow = "hidden";
      },

      start : function(interval_speed)
      {
        this.stop();

        this.positionImages();
        this.interval_speed = interval_speed;

        this.interval = setInterval(
          "scrolling_images.scroll()",
          this.interval_speed
        );
      },

      resume : function()
      {
        this.interval = setInterval(
          "scrolling_images.scroll()",
          this.interval_speed
        );
      },

      stop : function()
      {
        if (this.interval) {
          clearInterval(this.interval);
          this.interval = null;
        }
      },

      scroll : function()
      {
        var len = this.images.length, x, newX, endX, i;
        for (i = 0; i < len; i++) {
          x = parseInt(this.images[i].style.left);
          newX = x - this.hop;

          if (newX + this.images[i].offsetWidth < 0) {
            //endX = parseInt(this.images[len - 1].style.left) + this.images[len - 1].offsetWidth + this.spacing;
            endX = parseInt(this.images[len - 1].style.left) + this.images[len - 1].offsetWidth + (this.spacing - 2); // Juster off by 2

            if (endX < this.container_width)
              endX = this.container_width;

            this.images[i].style.left = endX;
          }
          else
            this.images[i].style.left = newX;
        }
        this.sortImages();
      },

      sortImages : function()
      {
        var sort_func = function(x, y) {
          x = parseInt(x.style.left);
          y = parseInt(y.style.left);
          if (x < y) return -1;
          else if (x === y) return 0;
          else return 1;
        };
        this.images.sort(sort_func);
      },

      positionImages : function()
      {
        var len = this.images.length, i;
        for (i = 0; i < len; i++) {
          if (i > 0) {
            this.images[i].style.left = parseInt(this.images[i - 1].style.left) + this.images[i - 1].offsetWidth + this.spacing;
          }
          else
            this.images[i].style.left = 0;
        }
        this.sortImages();
      },

      addImage : function(image_src, href, className)
      {
        if (!this.imageExists(image_src)) {
          var indice = this.images.length;

          var anchor = document.createElement("A");
          anchor.href = href;
          anchor.target = "_blank";
          anchor.className = className;

          var img = document.createElement("IMG");
          img.name = "slide_img_"+ indice;
          img.src = image_src;
          img.onload = function()
          {
            var len = scrolling_images.images.length, i;
            for (i = 0; i < len; i++) {
              if (i > 0) {
                scrolling_images.images[i].style.left = parseInt(scrolling_images.images[i - 1].style.left) + scrolling_images.images[i - 1].offsetWidth + scrolling_images.spacing;
              }
            }
            scrolling_images.sortImages();
          }

          anchor.appendChild(img);

          this.images[indice] = anchor;
          this.container_node.appendChild(this.images[indice]);
        }
      },

      removeImage : function(image_src)
      {
        var temp = [], len = this.images.length, i;

        this.stop();

        for (i = 0; i < len; i++) {
          if (this.images[i].src != image_src)
            temp[temp.length] = this.images[i];
          else
            this.images[i].removeNode();
        }

        this.images = temp;
        this.start();
      },

      imageExists : function(image_src)
      {
        var len = this.images.length, i;
        for (i = 0; i < len; i++)
          if (this.images[i].src == image_src)
            return(true);

        return(false);
      }
    };
