function swap_photos(name_p, delay_p, count_p, index_p)
{
  if ((index_p >= 1) && (index_p <= count_p))
  {
    document.images[name_p].src = name_p + "_" + index_p + ".jpg";
  }
  index_p = (index_p < count_p) ? (index_p+1) : 1;
  f = "swap_photos('" + name_p + "'," + delay_p + "," + count_p + "," + index_p + ")";
  setTimeout(f, delay_p);
}

