var pmaWidgetInstance635797daac365ae374eb6d59 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9346d75f3ef352eb7eb8b73d9b49fbd9:c31d85c6253a2ed4049a4464b3a55cd005b891d4ad163330b1e62294db370fc10c78ea5096f7a31172d8740d90757fb9f5e4bdfad5123d80cc2299e9bf4a3b7f4a3515213dfe9cf9f58bddfee7b105c4ae9d9dbfe8a5e573a7080d69af0fea95281974bab62ce2514af842227546d9c15a76b53c200815299e927582c23a94de94320605a6d7cf9fe53a19c162ec14958f11737d6b39efa106776f6ad74b83c99ccd64bb4c3ffc8dd90a657bc61746bd2b44674cded7562a4f05b51f79ed5d1309826431bed085dbc1aeca427391ef1a", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "13,75 €", 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(){ pmaWidgetInstance635797daac365ae374eb6d59.initWidget("635797daac365ae374eb6d59"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }