var pmaWidgetInstance64afa49842183289053737cc = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a95bbd0792e414e6afe19d53a0f29ce9:9d4ead6e4a57485bbbbca673151e8a6f39d315d90ce6a4810194eb17fe15bbfd13b88aa9a11217dfa0b14a10e6a2c59abdaed82bfdc8727c41ca1af40ac1a1c2fd4118039a9f4a6715354464e26f99ddc988d539ce4fee66eba92ff266349307c44f215bfbf518d8bb4018ebdabd0f218049619875029133d7ee4f444d0fd3938b6496bc84515d51501bc0baff23ad7bae35e348519a10236c8f2fc35634af02d40c062c01d80f01e82cf089a8c2e5da0385c2b0b64f4d4cc748fdbb3dcf4a9b7833807a033b1f7a2434c603f534ec1b", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "840,00 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance64afa49842183289053737cc.initWidget("64afa49842183289053737cc"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }