!function () { function GetProducts(top) { var productArray = [{"pid":69288123,"name":"Guess Kolczyki Ube28008","price":139.0000,"sprice":"139,00","url":"https://www.ceneo.pl/69288123;basket#pid=24529&crid=491215&cid=42164","imgurl":"//image.ceneostatic.pl/data/products/69288123/f-guess-kolczyki-ube28008.jpg","newpage":true,"format":"custom","rating":0.0,"drawchance":1,"urltype":0,"position":1},{"pid":86458680,"name":"KOLCZYKI DŁUGIE WISZĄCE KRYSZTAŁY ŚLUBNE SREBRNE","price":29.0000,"sprice":"29,00","url":"https://www.ceneo.pl/86458680;basket#pid=24529&crid=491215&cid=42164","imgurl":"//image.ceneostatic.pl/data/products/86458680/f-kolczyki-dlugie-wiszace-krysztaly-slubne-srebrne.jpg","newpage":true,"format":"custom","rating":4.92,"drawchance":1,"urltype":0,"position":2},{"pid":147046751,"name":"Diament Obrączka Półokrągła brzegi białe 585","price":2623.0000,"sprice":"2623,00","url":"https://www.ceneo.pl/147046751;basket#pid=24529&crid=491215&cid=42164","imgurl":"//image.ceneostatic.pl/data/products/147046751/f-diament-obraczka-polokragla-brzegi-biale-585.jpg","newpage":true,"format":"custom","rating":0.0,"drawchance":1,"urltype":0,"position":3},{"pid":151711798,"name":"Diament Złota obrączka z białymi prostokątnymi kamieniami rozmiar 15","price":1296.0000,"sprice":"1296,00","url":"https://www.ceneo.pl/151711798;basket#pid=24529&crid=491215&cid=42164","imgurl":"//image.ceneostatic.pl/data/products/151711798/f-diament-zlota-obraczka-z-bialymi-prostokatnymi-kamieniami-rozmiar-15.jpg","newpage":true,"format":"custom","rating":0.0,"drawchance":1,"urltype":0,"position":4}]; var sum = 4; var result = []; var i = 0, n = 0; for (var n = 0; n < top; n++) { var r = Math.floor(Math.random() * sum); var lsum = 0; for (i = 0; i < productArray.length; i++) { var prod = productArray[i]; lsum += prod.drawchance; if (r < lsum) { sum -= prod.drawchance; result.push(prod); productArray.splice(i, 1); break; } } } return result; } function htmlEncode(value){ var div = document.createElement('div'); var text = document.createTextNode(value); div.appendChild(text); return div.innerHTML; } var html = ''; var products = GetProducts(4); var rows = 4, columns = 1, r = 0, c = 0; html += '
'; for (r = 0; r < rows; r++) { html += '
'; for (c = 0; c < columns; c++) { var idx = (r * columns) + c; var product = products[idx]; if(product){ var rating = Math.round(product.rating * 20); html += '
'; html += '
' html += ''; html += '' + product.name + ''; html += ''; html += product.name + ''; if(product.urltype == 0){ html += ''; html += 'Od ' + product.sprice + ''; } html += '
'; if(product.urltype == 1){ html += ''; html += 'Sprawdź'; } } html += '
'; } html += '
'; } html += '
'; html += ''; html += '
'; html += '
'; try { var _logo = document.getElementById('ceneoaff-logo'); if (_logo != null) { _logo.parentNode.removeChild(_logo); } } catch (err) { } if($CeneoAP.options.ad_onAfterRender != null) $CeneoAP.options.ad_onAfterRender(); document.getElementById('ceneoaffcontainer491215').innerHTML = html; if(true === true){ var hrefs = document.getElementById('ceneoaffcontainer491215').querySelectorAll(".ceneoaff-items a"); for (i = 0; i < hrefs.length; i++) { var href = hrefs[i]; (function(href) { href.addEventListener('click', function(event){ var pid = href.closest('div.ceneoaff-item').getAttribute('data-pid'); var request = '//partnerzyapi.ceneo.pl/External/SaveProductClickFromRotator' + "?productId=" + pid + "&creationId=" + $CeneoAP.options.ad_creation + "&referrerUrl=" + encodeURIComponent(window.location); var img = new Image(); img.src = request; }, false); })(href); } var percentage = 0; var trackView = false; if(percentage === 100){ trackView = true; } else{ var rotatorRandomVal = Math.floor((Math.random() * 100) + 1); if(rotatorRandomVal < percentage){ trackView = true; } } if(trackView){ var stamp = parseInt(new Date().getTime()/86400, 10); var img = new Image(); var imgSrc = location.protocol + '//analytics.ceneo.pl/trackevent?category=contextual&culture=pl-PL&action=loaded&label=24529_9d7c6216cfcbd45d50f56e324a38c5c5|False|'1124,3170,3171',0' + '&_=' + (new Date).getTime(); img.src = imgSrc.replace(/&/g, '&'); } } }();