var pmaWidgetInstance60cc16bd0067a2ef59d7e821 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a39adc1b5e9c55ba2e796c7a5e44934f:352c89054257e605cdc9e760e80c9ef62045220a4e97f284c6d82a10baa5b5d367c8dcc91818654ab1f59d5a19ac3e26b43190d609e98011154b11440fa5baad3b2e3c15278fa4e428ab16528722ad16c168a6ff643a313f0b617d31f7ac2c1716fb419e754446e77d34e60e9733e3117b40186aeeae3a0b4e40834faac6511c22a49d342c9d733a47beef43a996a7d7b6f4fad90594f5c3014d8652643b02ce9dca3718d3a5a83d9a533c184b41314cf48c0c3759e6645b574553d4f700025bddf27358ba88b6f14bf73a399910b4a6", shop_name: "biet.sk", shop_logo: "https://y1.sk/t/s/130x50/48619.jpg", product_price: "339,00 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance60cc16bd0067a2ef59d7e821.initWidget("60cc16bd0067a2ef59d7e821"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }