var pmaWidgetInstance603f65aad9685ed2723d4d74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d8b2b07721a0b6955dac1a94f8bcb600:27682b68a7b618d3984e22869732fae3bbc79d97428b1588c93ecca345cf360ae0e7f476763bc8ca24c96ca1050d07d074d7761bcc36a5b69ae0b4cae1e76e9befc24e209585e4145a385401c7532daa0ce065bffc3a1bc534ec60d2d9b93df8e29b7a1fec74cf3f859912bb26e825e3eeacb42352ab7d2bdcba53123bccd6de9e30ab060a2af12b5997a503b4d8c09b89fe2e840a4b24b4141d4933378d433630770d36ec82473f721651fc1ae3b3f85436b98f7f87444ee3bf5a3ed177ed8d", shop_name: "profizoo.sk", shop_logo: "https://y1.sk/t/s/130x50/54095.jpg", product_price: "34,98 €", product_shipping: "5,14 €", 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(){ pmaWidgetInstance603f65aad9685ed2723d4d74.initWidget("603f65aad9685ed2723d4d74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }