function Slidefade(img, name, speed)
{
  this.img = img;
  this.items = new Array();
  
  this.name  = name;
  this.speed = speed;
  this.step  = 0;
  this.number_of_images = 0;
  
  this.reapply  = sf_Reapply;
  this.slide    = sf_Slideit;
  this.addimage = sf_AddImage;

  window.onerror = this.reapply;
}

function sf_Reapply()
{
  setTimeout(this.name + ".slide", 1000);

  return true;
}

function sf_AddImage(name)
{
  this.items[this.number_of_images] = new Image();
  this.items[this.number_of_images].src = name;

  this.number_of_images++;

  return true;
}

function sf_Slideit()
{
  if (!document.images)
    return;
  
  if (document.all)
    this.img.filters.blendTrans.apply();

  this.img.src = this.items[this.step].src;

  if (document.all)
    this.img.filters.blendTrans.play();

  this.step = (this.step + 1) % this.number_of_images;

  if (document.all)
    setTimeout(this.name + ".slide();", this.speed * 500 + 3000);
  else
    setTimeout(this.name + ".slide();", this.speed * 500);
  
  return true;
}