function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}

var mySlideList1 = ['banner/extremekids.gif', 'banner/spyshop.gif'];
var mySlideAlt = ['Extreme Kids', 'Spy Shop'];
var mySlideLocation = ['http://www.bgsvetionik.com/index.php?firmaID=63021', 'http://www.bgsvetionik.com/index.php?firmaID=63030'];
var mySlideShow1 = new SlideShow(mySlideList1, 'slide1', 4000, "mySlideShow1");
function SlideShow(slideList, image, speed, name)          
{
  this.slideList = slideList;
  this.image = image;
  this.speed = speed;
  this.name = name;
  this.current = 0;
  this.timer = 0;
}
SlideShow.prototype.play = SlideShow_play;  
function SlideShow_play()       
{
  with(this)
  {
    if(current++ == slideList.length-1) current = 0;
    switchImage(image, slideList[current]);
	document.getElementById("slide1").href = mySlideLocation[current];
	document.slide1.alt = mySlideAlt[current];
    clearTimeout(timer);
    timer = setTimeout(name+'.play()', speed);
  }
}
