var pmaWidgetInstance64d4dc3e4218328905694782 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6355a5135c22068350098b4df3c188ad:0897a5b89868899b9aa05c20bf15ae8a553f42c37101099406cec1896176ef717ad9ccbae9f3f0c005b6fb88d53131fc333c4fc28f9de1b315673470e5f0a2511998c97d65dd0dc51edab98dbf4e6eee90f2f4ce5e7a3aa6bf7e2b4d2cf9d81be414b2f4c62ed22faeafebcf3cb76bbc847c5a3f5be858c84f3d116e1cf536a23e5ea4307699a90d0242a0caf76fe5847150608a8ba3cbbfe4f5061ab7576098e8e355957b6f0f90fb1d1e1ad168698f8dce0c5cc0f1c8e60cc38f1a721438fb0ddf449a40702dbd36c5aade80a6a83e", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "470,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(){ pmaWidgetInstance64d4dc3e4218328905694782.initWidget("64d4dc3e4218328905694782"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }