var pmaWidgetInstance659bc15cae16db34661c7895 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=28ebab60cb180f7c1c039b75e5c04207:4eb68fa3a9a4d849d7d45dcb01bbaa9cbf685dd4e57430400ecdfa2f35d33610759c465cf3a0eb306083585f7c098f9c0a2a2f2249c98fa775fc4c03e0a3f53491b8f22ef771070112b62d252ec27d950faed333f8c4999872fe5136118cbe35adbe66175792973133ec94b2e54e3065ee8718995c5fa7951eca2ba134140c7695377b20a95cbe5da53d320cfba18d7c7eecc7024c89f6e37f2ba48f8d7d408c865a244cfac675e9ebcd5a18dcb55d14f3a00538f2eb9c50b6088721d4d335cb2a972f2393410962aace5461742dcac0", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "348,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(){ pmaWidgetInstance659bc15cae16db34661c7895.initWidget("659bc15cae16db34661c7895"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }