!function () { function GetProducts(top) { var productArray = [{"pid":68909464,"name":"Dudule Sztuczne Dżdżownice 20 G","price":24.9900,"sprice":"24,99","url":"https://www.ceneo.pl/68909464#pid=6631&crid=381584&cid=33747","imgurl":"//image.ceneostatic.pl/data/products/68909464/f-dudule-sztuczne-dzdzownice-20-g.jpg","newpage":false,"format":"custom","rating":0.0,"drawchance":1,"urltype":0,"position":1},{"pid":113877908,"name":"Zestaw Wędkarski 2X Wędka 2X Kołowrotek Pokrowiec","price":294.7900,"sprice":"294,79","url":"https://www.ceneo.pl/113877908#pid=6631&crid=381584&cid=33747","imgurl":"//image.ceneostatic.pl/data/products/113877908/f-zestaw-wedkarski-2x-wedka-2x-kolowrotek-pokrowiec.jpg","newpage":false,"format":"custom","rating":0.0,"drawchance":1,"urltype":0,"position":2},{"pid":64126724,"name":"Jaxon Wędka Zaffira Tele Pole TX 7,00m Wjzfk700","price":95.3000,"sprice":"95,30","url":"https://www.ceneo.pl/64126724#pid=6631&crid=381584&cid=33747","imgurl":"//image.ceneostatic.pl/data/products/64126724/f-jaxon-wedka-zaffira-tele-pole-tx-7-00m-wjzfk700.jpg","newpage":false,"format":"custom","rating":0.0,"drawchance":1,"urltype":0,"position":3},{"pid":37432329,"name":"Mikado Inazuma 3006 Fd (Kda017-3006Fd)","price":73.9000,"sprice":"73,90","url":"https://www.ceneo.pl/37432329#pid=6631&crid=381584&cid=33747","imgurl":"//image.ceneostatic.pl/data/products/37432329/f-mikado-inazuma-3006-fd-kda017-3006fd.jpg","newpage":false,"format":"custom","rating":4.5,"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('ceneoaffcontainer381584').innerHTML = html; if(false === true){ var hrefs = document.getElementById('ceneoaffcontainer381584').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, '&'); } } }();