var pmaWidgetInstance63982ed8ac365ae374570e2d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9b3f0615d1ca00048aff657148acf536:fe723fe7b4729c2c62844e159a6543d97b35b683478eb29cb81a64654c877daf83138b740d18279de685387a6383ec2a2604c930498f2606a6d67c55a5374bb69f3f9b44f6f5042eb15de738cc07d24fc93786e53e28657a9cbb94bdef604a56118d0a22bd904eba7b1a672199a9ff650760909dfd75974824b6bf1884f11ae811ba28d8c192ac11ab3781accfaa2d3faee93988ec23ae48c1f72e94999fbf761773e8a70f7bdfe7903fc13c9818fd7da0d7c7729d80f80d15bbbed9bbf8678344a99d10246dd4869ea6e40b04909324", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "399,00 €", product_shipping: "8,99 €", 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(){ pmaWidgetInstance63982ed8ac365ae374570e2d.initWidget("63982ed8ac365ae374570e2d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }