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