var pmaWidgetInstance6022c749d9685ed2720efcf6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d4bec3054e1313c8235e466536a58190:b362e98454b801be1b3d4d34bafec6764e54e13c1deaa02d5e00b9bce50c9dfe1c9c45d5d569bf919f8d93b86b0bb39634d2e88f2bead952959e012c791e321079f356353a20a2ab01dcba9ccf51b0130dc784428ee886e81bd7f64ba8955f16df81febdc83385efa00d71f8f99ef7b9ba0b7570b1e4f5cae9c70380d6ffb07dd2c344f13392a925137d3eb8a8baa2446b06970bf0efba6e1dbd89107ea4a0cda538cd31d6ddf744ec36fa428460896047154198fcbae395bf8a2972087944812703abc0ce4fb977c8eaaa5ef7fc242f", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "157,95 €", 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(){ pmaWidgetInstance6022c749d9685ed2720efcf6.initWidget("6022c749d9685ed2720efcf6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }