AJAX_AMZWEB_PKG.ProductDataAugmentationRenderer = function(response, properties) {
  this._response = response;
  this._properties = properties;
};

AJAX_AMZWEB_PKG.ProductDataAugmentationRenderer.prototype.display = function() {
  if(this._response.Item) {
    var product = this._response.Item;

    var popupHeight = 500;
    if (product.largeImgHeight) {
      popupHeight = eval(product.largeImgHeight) + 105;
    }

    if (document.getElementById('no-image-container-LD') && product.mediumImgUrl) {
      CoremetricsAddToBasketTagHelper.init('add-to-basket-link', "listingDetails");
      if (product.largeImgUrl) {
        var html = '<a href="/servlet/FrameBase?content=%2Fservlet%2FListingDetails%3Fshowpic=1%26$isbnpicturelink%26showpicurl=' + product.largeImgUrl + '" id="amz-large-img-link" onclick="return openWindow(this.href, 0, 0, 0, 0, 1, 1, 440, ' + popupHeight + ', 100, 100);" title="' + this._properties.viewLargerImage + '"><img alt="' + this._properties.viewLargerImage + '" id="no-image" src="' + product.mediumImgUrl + '"/></a>';
        document.getElementById('no-image-container-LD').innerHTML = html;        
      } else {
        document.getElementById('no-image').src = product.mediumImgUrl;
      }
      
      if(document.getElementById('amz-image-stock-photo-text')) {
        document.getElementById('amz-image-stock-photo-text').style.display = "block";
      }
    }

    if (document.getElementById('no-image-container-plp') && product.mediumImgUrl) {
      CoremetricsAddToBasketTagHelper.init('add-to-basket-link', "PLP");
      if (product.largeImgUrl) {
        var html = '<a href="' + product.largeImgUrl + '" id="amz-large-img-link" onclick="return openWindow(this.href, 0, 0, 0, 0, 1, 1, 440, ' + popupHeight + ', 100, 100);" title="' + this._properties.viewLargerImage + '"><img alt="' + this._properties.viewLargerImage + '" id="no-image" src="' + product.mediumImgUrl + '"/></a>';
        document.getElementById('no-image-container-plp').innerHTML = html;
      } else {
        document.getElementById('no-image').src = product.mediumImgUrl;
      }
    }

    if (document.getElementById('amz-view-larger-image-link-ld') && product.largeImgUrl) {
      var href = '/servlet/FrameBase?content=%2Fservlet%2FListingDetails%3Fshowpic=1%26$isbnpicturelink%26showpicurl=' + product.largeImgUrl;
      document.getElementById('amz-view-larger-image-link-ld').href = href;
      document.getElementById('amz-view-larger-image-link-ld-container').style.display = "inline";
    }

    if (document.getElementById('amz-view-large-image-link-1') && product.mediumImgUrl) {
      document.getElementById('amz-view-large-image-link-1').href = product.largeImgUrl;
    }

    if (document.getElementById('amz-view-large-image-link-2') && product.largeImgUrl) {
      document.getElementById('amz-view-large-image-link-2').href = product.largeImgUrl;
      document.getElementById('amz-view-large-image-link-2').style.display = "inline";
    }

    if (document.getElementById('amz-large-image') && product.mediumImgUrl) {
      document.getElementById('amz-large-image').src = product.mediumImgUrl;
    }

    if (document.getElementById('book-title-amz') && product.title) {
      document.getElementById('book-title-amz').style.display = "block";
      document.getElementById('book-title').innerHTML = product.title;
    }

    if (document.getElementById('biblio-title-amz') && product.title) {
      document.getElementById('biblio-title-amz').style.display = "block";
      document.getElementById('biblio-title-amz').innerHTML = product.title;
    }

    if (document.getElementById('book-author-amz') && product.author) {
      document.getElementById('book-author-amz').style.display = "inline";
      document.getElementById('book-author-amz').innerHTML = product.author;
    }

    if (document.getElementById('biblio-publisher-amz') && product.publisher) {
      document.getElementById('biblio-publisher').style.display = "inline";
      document.getElementById('biblio-publisher-amz').innerHTML = product.publisher;
    }

    if (document.getElementById('biblio-pubdate-amz') && product.publicationDate) {
      document.getElementById('biblio-pubdate').style.display = "block";
      document.getElementById('biblio-pubdate-amz').innerHTML = product.publicationDate;
    }

    if (document.getElementById('biblio-binding-amz') && product.binding) {
      document.getElementById('biblio-binding').style.display = "block";
      document.getElementById('biblio-binding-amz').innerHTML = product.binding;
    }

    if (document.getElementById('biblio-edition-amz') && product.edition) {
      document.getElementById('biblio-edition-amz').style.display = "block";
      document.getElementById('biblio-edition').innerHTML = product.edition;
    }
  }
};