var pmaWidgetInstance6054bdeed9685ed2725cc72d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=47b56c00837583662b182efd50d7f8cb:cb9ee59950bc9d11e6a6f39f5c398a1870e7ddbd86f212a3ea9ef815f5486297c12808bc7d25ffdfa6e1d77db01aeec958bf1d19807d69963c5a1b0995973be6b5c7b769c6f0b907937ca30082fd066f86b935108eebfcebc2531b71b712ce61d397b06acf63ae611ae23517e2872421f9bda8c8db5b1dffa1a25de1acd88906c21403903e8dc7fdd20e2db45017e5d5860eac35cee757afdbb991aa3f937bd8e2d08b12e89077cd853befc6ab4f8f329ab744ada2dc66294945e8f7ff51e789", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "34,90 €", product_shipping: "", product_availability: "Skladom", initWidget: function(widgetId){ this.insertLinkToButton(widgetId); }, insertLinkToButton: function(widgetId){ const instance = this; const btns = this.findButtonWidgets(widgetId); for(var btn of btns){ instance.insertButtonVariables(btn); if(btn.tagName == "A"){ btn.href = this.exitLink; btn.target = "_blank"; btn.rel = "nofollow"; } else { btn.onclick = function(event){ event.stopPropagation(); window.open(instance.exitLink); } } } }, findButtonWidgets: function(widgetId){ var currentModalButtons = []; var modalButtons = document.getElementsByClassName(`pma-widget`); for(var modalButton of modalButtons){ if(modalButton.getAttribute('data-id') == widgetId){ currentModalButtons.push(modalButton); } } return currentModalButtons; }, insertButtonVariables: function(element){ element.innerHTML = element.innerHTML.replaceAll("{{shop_name}}",this.shop_name?this.shop_name:""); element.innerHTML = element.innerHTML.replaceAll("{{shop_logo}}",this.shop_logo?this.shop_logo:""); element.innerHTML = element.innerHTML.replaceAll("{{product_price}}",this.product_price?this.product_price:""); element.innerHTML = element.innerHTML.replaceAll("{{product_shipping}}",this.product_shipping?this.product_shipping:""); element.innerHTML = element.innerHTML.replaceAll("{{product_availability}}",this.product_availability?this.product_availability:""); } } docReady(function(){ pmaWidgetInstance6054bdeed9685ed2725cc72d.initWidget("6054bdeed9685ed2725cc72d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }