var pmaWidgetInstance603f6635d9685ed27240136c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=77b2befa648ce78ed6251ca4db29ce75:e0b063e099e96621db1234ce383abeb0340e86418655201d8b49498c83fe335b129eb7b0c1a7ddb27193c4ab927b4db2b57aceec37ea672d1f3a79aae57beb81e1c0b481af494fd7f66225c33c85c0a2165e0a94d99455762bbe00722f2457c842fd67fff00dc943cfdcca753b9202a58c1bb35939f040c8b50bec5cc705c75af2c13aab99a3ddd34c29a8d264013b7902c591865c5b57a5f7a61c089e872f654946444cd6e9c303ce371bc347c99d903fe5e54f311674f5aff8dce76bddb6bc", shop_name: "krmiva.sk", shop_logo: "https://y1.sk/t/s/130x50/10049.jpg", product_price: "79,10 €", 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(){ pmaWidgetInstance603f6635d9685ed27240136c.initWidget("603f6635d9685ed27240136c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }