
var lapin_html = "";
var count = parseInt(lapin_content.length / 5) * 5;
var indexs = new Array();

for (var i = 0; i < count; i++) {
    var ind = parseInt(Math.random() * lapin_content.length);
    var item = lapin_content[ind];
    if (item.url == location.href) {
        lapin_content.splice(ind, 1);
        ind = parseInt(Math.random() * lapin_content.length);
        item = lapin_content[ind];
    }
    lapin_html += "<li>";
    lapin_html += "<a href='" + item.url + "?f=left' target='_blank'>";
    lapin_html += "<img src='" + item.image + "' alt='" + item.title + "' />";
    lapin_html += "<span>" + item.title + "</span>";
    lapin_html + "</a>";
    lapin_html += "</li>";
    lapin_content.splice(ind, 1);
    //alert(ind + " " + lapin_content.length);
}

//$.each(data, function (i, item) {
//    var name = item["name"];
//    item["name"].remove();
//});

//for (var i = 0; i < lapin_content.length; i++) {
//    var item = lapin_content[i];
//    lapin_html += "<li>";
//    lapin_html += "<a href='" + item.url + "' target='_blank'>";
//    lapin_html += "<img src='" + item.image + "' alt='" + item.title + "' />";
//    lapin_html += "<span>" + item.title + "</span>";
//    lapin_html + "</a>";
//    lapin_html += "</li>";
//}

$(".related_buy ul").html(lapin_html);
$(".related_buy ul").hover(function () {
    $(".slick-prev").show();
    $(".slick-next").show();
}, function () {
    $(".slick-prev").hide();
    $(".slick-next").hide();
});

$('.multiple-items').slick({
    infinite: true,
    autoplay:true,
    slidesToShow: 5,
    slidesToScroll:5
});
