// Функция срабатывает при листании ленты вперед.
function photo_gallery_next(name, count_visible, count)
{
  index = eval(name + '_index');
  if (index + count_visible >= count)
    return;
  var obj_last = get_object(name + '_' + index);
  obj_last.style.display = 'none';
  var obj_next = get_object(name + '_' + (index + count_visible));
  obj_next.style.display = 'inline';
  eval(name + '_index = ' + (index + 1));
}

// Функция срабатывает при листании ленты назад.
function photo_gallery_prev(name, count_visible)
{
  index = eval(name + '_index') - 1;
  if (index < 0)
    return;
  var obj_last = get_object(name + '_' + (index + count_visible));
  obj_last.style.display = 'none';
  var obj_next = get_object(name + '_' + index);
  obj_next.style.display = 'inline';
  eval(name + '_index = ' + index);
}