var pmaWidgetInstance5fcdedf1d9685ed27219cd50 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=60f0a9a7141cdd2fe5fc15300fba728f:17b88487ecd4711e14dee7ea83f7cd04614ce6d8c01dbc41f492dae9e1fc7d33ab766776c6b9c39e9d52f9e0f3acf7a019e7a0a01b4721a5b3a128d5b1576a41f19af8878c1cb09eebe268d920daec6a0dc01e468cfa0590d17aa48625d38fddafe8df738de7dfcc59dd8dd7cfaf60d5d0f3f4b2ddea2a2a3fa10bd58c37c0c377dd5b5f3906687021ef20413bb07c8dc9e24c2333a7cf85b9f6f926dbb318a15f0b108f56c50a2872b3e50bf9afe70972e904b1089edbd2cabd2da39e47676251853b363aa86cf63020c04f498ba05d", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "75,58 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance5fcdedf1d9685ed27219cd50.initWidget("5fcdedf1d9685ed27219cd50"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }