var pmaWidgetInstance60119ad0d9685ed272c9f6fd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=73c2e63daa609a64bb9fa4afb0177b03:3a555f91be5cf13f36de795bd0dffbb3eba177ce6caca1aea4e3f84de88f77b843f1074786573bc180f7282b04eb0e0ff757a7b6b262d462befc29f3c5a476d2696fff1862e0449142458f9e19c76f1e4833d377fbaefa629ff34d0a837c7b39fca5da7edf8489c81c15f696ab3cb028463980bc93c03e8caedd953f0aeb24192a2a4bbce702871e4166bed0ae88f366a47ee6f8e6fba6359845a7d2917ea5a0e8aab4efbfb1ddbb9580006ea97c0681315d1a6c6d8f6ac0ae56babfb03cb9b0", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "25,90 €", 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(){ pmaWidgetInstance60119ad0d9685ed272c9f6fd.initWidget("60119ad0d9685ed272c9f6fd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }