var pmaWidgetInstance5fcf8c3ad9685ed272f131e2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=805ad6f524b2830a917daee7cc889883:14323c1a387b53ee2cad65067338d5803468ab19d4b83f825366f20b678f3fabadfc2c01d0d40d44db69935f5b1680dcd24e0bd617561f8d4d32946f1205a05cb65ad1852a91a8746ff860acb378c65d1a9713b4a65b0c7464586bbd0f316f6826bf935b625eaecea39eded1ec284e171e432004e37ef22cada749ddd13f30699a2ef033b22b91f2152e0c8a42f6d60077999800e64e4b692e98fd4d6f6bd79363ec3f81ff06f990147a08edcaf1985a5a97a9f93a7884416336128190e2c86e", shop_name: "boukal.sk", shop_logo: "https://y1.sk/t/s/130x50/5806.jpg", product_price: "365,91 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance5fcf8c3ad9685ed272f131e2.initWidget("5fcf8c3ad9685ed272f131e2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }