!function () { function GetProducts(top) { var productArray = [{"pid":152219660,"name":"Telewizor OLED LG OLED55C31LA 55 cali 4K UHD","price":4718.0000,"sprice":"4718,00","url":"https://www.ceneo.pl/152219660;basket#pid=7147&crid=41628&cid=8805","imgurl":"//image.ceneostatic.pl/data/products/152219660/f-telewizor-oled-lg-oled55c31la-55-cali-4k-uhd.jpg","newpage":true,"format":"custom","rating":4.88,"drawchance":1,"urltype":0,"position":1},{"pid":104109736,"name":"JBL Charge 5 Czarny","price":619.0000,"sprice":"619,00","url":"https://www.ceneo.pl/104109736;basket#pid=7147&crid=41628&cid=8805","imgurl":"//image.ceneostatic.pl/data/products/104109736/f-jbl-charge-5-czarny.jpg","newpage":true,"format":"custom","rating":4.33,"drawchance":1,"urltype":0,"position":2},{"pid":147578933,"name":"Samsung Galaxy S23 5G SM-S911 8/128GB Czarny","price":2398.0000,"sprice":"2398,00","url":"https://www.ceneo.pl/147578933;basket#pid=7147&crid=41628&cid=8805","imgurl":"//image.ceneostatic.pl/data/products/147578933/f-samsung-galaxy-s23-5g-sm-s911-8-128gb-czarny.jpg","newpage":true,"format":"custom","rating":4.86,"drawchance":1,"urltype":0,"position":3},{"pid":158226865,"name":"Samsung Galaxy M34 5G SM-M346 6/128GB Granatowy","price":878.0000,"sprice":"878,00","url":"https://www.ceneo.pl/158226865;basket#pid=7147&crid=41628&cid=8805","imgurl":"//image.ceneostatic.pl/data/products/158226865/f-samsung-galaxy-m34-5g-sm-m346-6-128gb-granatowy.jpg","newpage":true,"format":"custom","rating":4.83,"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 = 2, columns = 2, 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 += '
'; html += 'Kup'; 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('ceneoaffcontainer41628').innerHTML = html; if(false === true){ var hrefs = document.getElementById('ceneoaffcontainer41628').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 = '' + "?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 + '' + '&_=' + (new Date).getTime(); img.src = imgSrc.replace(/&/g, '&'); } } }();