var pmaWidgetInstance634fcd76ac365ae374642480 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0e2d2c4e28eb1d2913fa9f6c9d5e4787:8dbcbe8a653b46b62ca6625ae8d11ff6092e1f24a4430c3dd49313ba145041f0d67de761174797d13c76ea2e067365507d04215985aa30ba001e12df652b785cd11f3b782eedf11e2c0cadf51504f81d1456a6c4e9a66c0d13cc4d4e10011ae19698f8f46d2be42ab1168a378d5abd7d89a7546c3e92b9f04ea5104a64efa473a60f883ebaa53237c1c7cef420d7b0ce36628c87647ace6c8eb753a2a9646ecbb3f293745c56fa3e4940b567c660cf9f5971174741eb59c484733beeab94653d", shop_name: "boukal.sk", shop_logo: "https://y1.sk/t/s/130x50/5806.jpg", product_price: "569,22 €", product_shipping: "", 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(){ pmaWidgetInstance634fcd76ac365ae374642480.initWidget("634fcd76ac365ae374642480"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }