var pmaWidgetInstance603df98dd9685ed272533c92 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=50bf37d490218eb3dc377e64d2bb68fc:2981e4237f2467b40a82b5326c984cf8a365ff34f98be4e13271ccf9bc0a700e40615c52a8807b123e5d0ba527d1f20d04a29db455a57dde8d1b67e2ed00759c0aabcf683a583101b419b74a2ef599c29a06dfe7c3b44dfa4220247d369dabe94ebdcef71aee5bbf6f00ba4badca8711efee20aea9fccfe4c3526d8d35d750ebfcf45bce9b50b3a30ad099f5a6464980abf696b313ea397bd8f748a9d27cf7edfce53ade4d1f47eae44c49018c90b06a3424db1217f2041902b03584b0896c22a1a41efda1a8858125cb87ff6f6d4d6f", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "25,90 €", product_shipping: "", product_availability: "Skladom", 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(){ pmaWidgetInstance603df98dd9685ed272533c92.initWidget("603df98dd9685ed272533c92"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }