    
 function slideshow(elm, speed) {

  this.elm       = elm;
  this.container = null;
  this.speed     = speed;

  this.init = function() {

   width  = 0;
   height = 0;

   code               = this.elm.innerHTML.trim().replace(/\>(\s*)</g, '><');
   this.elm.innerHTML = code;
     
   for(i=0;i<this.elm.childNodes.length;i++) {
    width  += parseInt(this.elm.childNodes[i].offsetWidth);
    this.elm.childNodes[i].style.display = 'block';
    height  = (height < this.elm.childNodes[i].offsetHeight) ? parseInt(this.elm.childNodes[i].offsetHeight) : height;
   }

   elmwidth = this.elm.offsetWidth;

   this.elm.innerHTML      = '<div id="'+elm.id+'_container"></div>';
   this.elm.style.height   = height+'px';
   this.elm.style.width    = '100%';
   this.elm.style.position = 'relative';
   this.elm.style.overflow = 'hidden';

   this.container                = document.getElementById(elm.id+'_container');
   this.container.style.height   = height+'px';
   this.container.style.width    = (width * Math.ceil(elmwidth/width))+'px';
   this.container.style.position = 'relative';
   this.container.style.left     = 0;

   for(i=0;i < Math.ceil(elmwidth/width);i++) {
    this.container.innerHTML += code;
   }

   window.setInterval(elm.id+'.move();', 25);

  }

  this.move = function() {

   var offset = parseInt(this.container.style.left);
   var imgwdt = parseInt(this.container.firstChild.offsetWidth);

   if((offset*-1) >= imgwdt ) {
    offset += imgwdt;
    this.container.appendChild(this.container.firstChild);
   }

   this.container.style.left = (offset - speed)+'px';
  
  }

 }

 function slideshow_load() {
  var element  = document.getElementById('sshow');
  if(element == null) {
   return;
  }
  window.sshow = new slideshow(element, 2);
  window.sshow.init();
 } 

 window.load.push(slideshow_load);


