var pmaWidgetInstance603f7e01d9685ed272e4eb52 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=905758bf0d36c97f7833787580e9b60f:09fc96f93f1170fb87fb6aef26e012d6360b61f2adb3a565ff991465f2a8ad3f8315ac125a42a390e968a92c45aa711a2fba02d859d55d72a2a32acfab144ff6b402867c466ecf66b5b0d217c97d78411d2d16df7b3e822752cf77d8131b3fef556225570c2ef5bfecbbd4a57aed269096d02e627e507133ff9802d0dbb48cc4e730b0fac2a13035fd0a78606855f043a688d2422f52c65096b60dd3bac1531d01ac334a9571931ad40a23b0ba3a8415ec33f855fec437ab6bcb2580a483ea96", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "215,90 €", product_shipping: "2,00 €", product_availability: "Skladom", 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(){ pmaWidgetInstance603f7e01d9685ed272e4eb52.initWidget("603f7e01d9685ed272e4eb52"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }