function addToBasket(productId, list) {
  $('btnAdd' + (list ? '-' + productId : '')).style.display = 'none';
  $('btnAddGray' + (list ? '-' + productId : '')).style.display = '';
  new Ajax.Request('/ajax/addToBasket.html',
  {
    method: 'post',
    parameters: {product: productId},
    onSuccess: function(transport){
      var response = transport.responseText || "Упс. Что-то не так...";
      $('divRightBasket').innerHTML = response;
		  $('btnAddGray' + (list ? '-' + productId : '')).style.display = 'none';
		  $('btnAdd' + (list ? '-' + productId : '')).style.display = '';
    }
  });
}

var cachedImages = new Array();
    
function preloadImages() {
  for(var i = 0; i < imgs.length; i++) {
    cachedImages[i] = new Image();
    cachedImages[i].src = imgs[i];
  }
}

function showPhoto(url, w, h) {
  w += 30;
  h += 50;
  var wnd = window.open(url, null, 'width='+w+', height='+h+', toolbar=0');
  wnd.resizeTo(w, h);
  wnd.focus();
  return false;
}