$(document).ready(function() {
// Stuff to do as soon as the DOM is ready;
var nbImages = $('.imgProduit').length;
$('.imgProduit').each(function(event) {
// Act on the event
if (nbImages >= 5) {
nbImages = 5;
};
var tailleImage = parseInt(960 / (nbImages) - 21); // bordures et autres
var lienParent = $(this).parent();
var divLienParent = $(lienParent).parent();
var boutonAcheter = $('span[class="cssbutton"]', divLienParent).first();
// var titre = $('a[href="' + lienParent.attr('href') + '"]').first(); // ancienne version
var titre = $('.tit', divLienParent).first();
var itmClasses = $(divLienParent).parent().attr("class");
$('#grilleImages').html($('#grilleImages').html() +
//'
' +
'' +
'' +
'
' +
'
' +
'
' +
'
' + titre.text() + ' ' + boutonAcheter.parent().html() +
'
' +
'
' +
'');
});
$('.liProduit').each(function(event) {
$(this).hover(function() {
$('.detailsProduit', this).fadeIn(400);
}, function() {
$('.detailsProduit', this).fadeOut(400);
});
});
var ama_complete = 'tag=proweb07-21';
/* itm kwx */
$(document).ready(function() {
$(".itm").css( "cursor", "pointer" );
$(".itm").click(function() {
var cl = $(this).attr('class');
var re = cl.replace(/itm item/g, '');
var ur = "http://www.ama"+"zon.fr/"+"dp/"+re+"?"+ama_complete;
window.open(ur, '_blank');
var ht = $(this).html();
if (ht.indexOf("portfolio") >= 0) {
_paq.push(['trackGoal', 1]);
} else {
_paq.push(['trackGoal', 3]);
}
});
$(".kwx").css( "cursor", "pointer" );
$(".kwx").click(function() {
var c = $(this).attr('class');
var r = c.replace(/readmore kwx kw/, '');
r = r.replace(/_/g, ' ');
var u = "http://www.ama"+"zon.fr/gp/search?keywords="+encodeURIComponent(r)+"&"+ama_complete;
window.open(u, '_blank');
_paq.push(['trackGoal', 2]);
});
});
});