var pmaWidgetInstance6038fe2fd9685ed2728c00ed = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0d7879b4ef3a3738a2b23a83d6b48841:a5fd26b6015b0b20572d309251877878bcad5b6d4ab63c99f128a5d97f56728336ec787eff421080001cf8852d4a6ef8de33d42519643c52e04c07e353a23007da6940fc45a9eb0f9f45ca8827940e6b65b1c1b57a5b520ad1dc77468a6595fc215d86d213859bc33608d22e5e39551f1bad19c1a9d08d1727f15b75ab742ffb6f56ad372a4e442554d859168b434011e36ea1d387f1a6d8918734f24ae7703e20206857b8bf4432acfa69bcb980de0cb4dd273a9ac581118815b6d927b8252bed2c40ae4a8879f5506ed22d83f12ab6", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "518,90 €", 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(){ pmaWidgetInstance6038fe2fd9685ed2728c00ed.initWidget("6038fe2fd9685ed2728c00ed"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }