var pmaWidgetInstance60c308680067a2ef59991f9c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=481b4bef77fa9e322499b502f5246795:7ce64810761f4535b9cf079ab7fd08e9e28afcb1ef9630aa9524092eceff372460b0c02a23a9a227b9478d83a1e3c23490aff281f7d2f41d4d5e1683d8818e6e1316150fd2e02193af63ffed9c251093b9bf2b030f9102d7a4c25981770e637a178a1e67f00c57838575a7fc5050c288e7916bb8955e282a67066b83d224f31f4126a77e9358e2b544ab7a49983a911189a9010d381a01779e2605392f19117a321d9d3a82be7ac1f759f0a2065610b90317cd2cd9d503f3218a1c16c7282058404b9531fe5de9c2bf817e172e9ab6b4", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "379,99 €", product_shipping: "3,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(){ pmaWidgetInstance60c308680067a2ef59991f9c.initWidget("60c308680067a2ef59991f9c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }