var pmaWidgetInstance5fc9f409d9685ed2725d3b41 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=698dd72c925b013463c67e03f07c1c4b:cf44d2c77905df04585c3749dd948e2e34b02037333da54b0d7f50ff06bb61da726295ab87e6791b3a4cedcb2adac46fe209cb835f76e7a16208d8051fa77efd5e7c24903f8b2924f3cdaff874c43123e1572a61b886ad829374558f415cc86da25575e785858560984e554a267871ef7c8d33139ac252a812be825daebd9dccf31f78c268a3f33419b96a27ce5d440cb859d6026ed794648eb43d83328e58720dfbbc5024ee56267a20a58a7cc29559b4d595f8eb99e94a8cffe5d76f91fd17", shop_name: "Autovip.sk", shop_logo: "https://y1.sk/t/s/130x50/56575.jpg", product_price: "7,91 €", product_shipping: "2,50 €", 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(){ pmaWidgetInstance5fc9f409d9685ed2725d3b41.initWidget("5fc9f409d9685ed2725d3b41"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }