var loadingImage = new Image(41, 10);

function initLoadingImage(url)
{
  loadingImage.src = url;
}

function resetThumbs()
{
  images = document.getElementsByTagName('img');
  for (imageIndex = 0; imageIndex < images.length; imageIndex++)
  {
    if (images[imageIndex].className == 'thumbactive')
    {
      images[imageIndex].className = 'thumb';
    }
  }
}

function showScreenshot(link, targetName)
{
  thumb = link.childNodes[0];
  if (thumb.nodeName.toLowerCase() == 'img')
  {
    if (thumb.className != 'thumbactive')
    {
      target = document.getElementById(targetName);
      if (target != null)
      {
        target.src      = loadingImage.src;

        resetThumbs();
        thumb.className = 'thumbactive';
        target.src      = link.href;

        return false;
      }
    }
    else
    {
      return false;
    }
  }

  return true;
}