(function(){ var html = ''; function GetProducts(top) { var productArray = [{"pid":91303207,"name":"Max Rb398S Wiązarka Do Prętów Zbrojeniowych","price":6999.0000,"sprice":"6999,00","url":"https://www.ceneo.pl/91303207;basket#pid=19372&crid=437957&cid=33349","imgurl":"//image.ceneostatic.pl/data/products/91303207/f-max-rb398s-wiazarka-do-pretow-zbrojeniowych.jpg","newpage":true,"format":"336x280","rating":0.0,"drawchance":1,"urltype":0,"position":1},{"pid":143464388,"name":"Falon-Tech Giętarka Do Prętów Zbrojeniowy Drut Szalunkowy 8Mm","price":23.9000,"sprice":"23,90","url":"https://www.ceneo.pl/143464388#pid=19372&crid=437957&cid=33349","imgurl":"//image.ceneostatic.pl/data/products/143464388/f-falon-tech-gietarka-do-pretow-zbrojeniowy-drut-szalunkowy-8mm.jpg","newpage":true,"format":"336x280","rating":0.0,"drawchance":1,"urltype":0,"position":2},{"pid":76723819,"name":"Triax Nożyce elektryczne do prętów zbrojeniowych SX36","price":16449.0000,"sprice":"16449,00","url":"https://www.ceneo.pl/76723819;basket#pid=19372&crid=437957&cid=33349","imgurl":"//image.ceneostatic.pl/data/products/76723819/f-triax-nozyce-elektryczne-do-pretow-zbrojeniowych-sx36.jpg","newpage":true,"format":"336x280","rating":0.0,"drawchance":1,"urltype":0,"position":3}]; var sum = 3; 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 products = GetProducts(3); html += '
'; var first = true, i = 0; html += '
'; for (i = 0; i< products.length; i++) { html += '
'; first = false; html += ''; html += '' + products[i].name + ''; html += ''; html += ''; html += products[i].name; html += ''; if(products[i].urltype == 0){ html += ''; html += 'Od ' + products[i].sprice + ' zł'; html += ''; } if(products[i].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('ceneoaffcontainer437957').innerHTML = html; if (false === true) { var hrefs = document.getElementById('ceneoaffcontainer437957').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.parentElement.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,'&'); } } })();