var pmaWidgetInstance5fd0cc8cd9685ed272ccc690 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3787eaa79216cd88243432117037bb4b:31a8208b5454aa84c4832e79beda3d1d28376aa1e3a1938b8d37cee25f1ab2285c8a9db816a9019bd17e1c6cf781f01b7c46c9716de0a1c1a643e7c2c2afb7e4e9b29122d50d0dedc3a4a3ae4fd4d24c1bdabdb6ed0cd5704dd76eb31fa8e7749c136aa93eabf4cb5ae61a28c0f71a1cf19a13421be3533ddba2f2bd711f2a4c0cf8a4877ceb1c68d58f6905e7cd8beb05e81c4243ef08c9e213cc349ded90a464ed68ee84825c215c549bc5f4a2072dfd41f2aed57d077f21c7643f290ea9d9", shop_name: "Šimek.eu", shop_logo: "https://y1.sk/t/s/130x50/58202.jpg", product_price: "139,32 €", product_shipping: "5,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(){ pmaWidgetInstance5fd0cc8cd9685ed272ccc690.initWidget("5fd0cc8cd9685ed272ccc690"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }