var pmaWidgetInstance5fd0cc8cd9685ed272ccc690 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bf87d98f6b03a7fea01825b07451e9f1:e864caf88120bcfb7a95cc176e9fe502c8508ce31850d0422e4133f0f089cbe36a52e4cf560dba72e14fec542e4cbc0c2ef2ba1bff39a4b445c877babad80797a875c8484fe907685a5b2ea57057c80eb8ed4792ddb7358d0a96c0edb500f129f08b1dbae1d78c4288a015d2ce5deb408421eee01dbfc0c2bf091e064f8dce1ecf82e1003bca8860247ff89d57f6fb39554754284f42e275b5f320f4b343315ec3d02e7813cc0b00d579f216a18ee6d9009fd2c1815430926b945c8cfaed50be", shop_name: "boukal.sk", shop_logo: "https://y1.sk/t/s/130x50/5806.jpg", product_price: "142,68 €", product_shipping: "", 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(){ pmaWidgetInstance5fd0cc8cd9685ed272ccc690.initWidget("5fd0cc8cd9685ed272ccc690"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }