function home_change_special_photo(int_index, str_action)
{
  var obj_prev  = document.getElementById('special_' + int_index + '_prev');
  var obj_next  = document.getElementById('special_' + int_index + '_next');
  var int_key   = arr_indexes[int_index];

  if(str_action == 'next')
  {
    obj_prev.style.visibility = 'visible';
    var int_key_new           = (int_key + 1);
  }
  else
  {
    obj_next.style.visibility = 'visible';
    var int_key_new           = (int_key - 1);
  }

  arr_indexes[int_index]  = int_key_new;

  if(int_index == 0)
  {
    if(str_action == 'next')
    {
      if((arr_photos[int_index].length - 1) == int_key_new)
      {
        obj_next.style.visibility = 'hidden';
      }
    }
    else
    {     
      if(int_key_new == 0)
      {
        obj_prev.style.visibility = 'hidden';
      }
    }

    var str_source_new      = arr_photos[int_index][int_key_new][0];
    var int_width_new       = arr_photos[int_index][int_key_new][1];
    var int_height_new      = arr_photos[int_index][int_key_new][2];

    var obj_photo           = document.getElementById('special_' + int_index + '_photo');
    obj_photo.src           = '/' + str_source_new;
    obj_photo.style.width   = int_width_new;
    obj_photo.style.height  = int_height_new;
  }
  else
  {
    if(str_action == 'next')
    {
      if((arr_photos[int_index].length - 3) == int_key_new)
      {
        obj_next.style.visibility = 'hidden';
      }
    }
    else
    {     
      if(int_key_new == 0)
      {
        obj_prev.style.visibility = 'hidden';
      }
    }

    for(int_p = 0; int_p < 3; int_p++)
    {
      var str_source_new      = arr_photos[int_index][(int_key_new + int_p)][0];
      var int_width_new       = arr_photos[int_index][(int_key_new + int_p)][1];
      var int_height_new      = arr_photos[int_index][(int_key_new + int_p)][2];

      var obj_photo           = document.getElementById('special_' + int_index + '_photo_' + int_p);
      obj_photo.src           = '/' + str_source_new;
      obj_photo.style.width   = int_width_new;
      obj_photo.style.height  = int_height_new;
    }
  }
}

function product_change_photo(str_action, int_index, int_pr_id)
{
  var obj_prev        = document.getElementById('detail_prev');
  var obj_next        = document.getElementById('detail_next');
  
  if(str_action == 'next')
  {
    obj_prev.style.visibility = 'visible';
    var int_photo_index_new   = (int_photo_index + 1);
  }
  else if(str_action == 'prev')
  {
    obj_next.style.visibility = 'visible';
    var int_photo_index_new   = (int_photo_index - 1);
  }
  else
  {
    obj_prev.style.visibility = 'visible';
    obj_next.style.visibility = 'visible';
    var int_photo_index_new   = int_index;
  }

  int_photo_index = int_photo_index_new;

  if(str_action == 'next' || str_action == 'index')
  {
    if((arr_photos.length - 1) == int_photo_index_new)
    {
      obj_next.style.visibility = 'hidden';
    }
  }
  
  if(str_action == 'prev' || str_action == 'index')
  {     
    if(int_photo_index_new == 0)
    {
      obj_prev.style.visibility = 'hidden';
    }
  }

  var str_source_new      = arr_photos[int_photo_index_new][0];
  var int_width_new       = arr_photos[int_photo_index_new][1];
  var int_height_new      = arr_photos[int_photo_index_new][2];
  var str_href_new        = arr_photos[int_photo_index_new][3];

  var obj_photo           = document.getElementById('detail_large_photo');
  obj_photo.src           = '/' + str_source_new;
  obj_photo.style.width   = int_width_new;
  obj_photo.style.height  = int_height_new;

  var obj_link            = document.getElementById('enlarge_link');
  obj_link.href           = 'javascript:enlarge_photo(\'' + str_href_new + '\', \'' + int_pr_id + '\');';
}


