var pmaWidgetInstance64c0bf8942183289051f336c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c7e02231922f13a51c97cce728f80984:559396fc08770413a4b2be1bfde2186e41468e95438c066e49a89bb784f0aef3a971aebd4bd29d4ddc1a9661d0841c7476ec87897506bc6255f7f138050acd6d1fe3473435e9ace87434ee1f56df30b03f41b75bddd2ba8c1ca6a1afe1c47173adc3e4059eb16885daf4568227f7cc731289323f79b9362ad8842228d9613a544bf4deaf89a16b2f5b4f4d2f7db8d4a631d2d910fb26c0753f2aa1a0b900e063fda0bb6dddb8c2644fcd7eddbd54d580112d51ad3277fe067e9a3e24082e1ff44e2f85b2ed0f23300510bb8fa6ff6b1d", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "143,53 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance64c0bf8942183289051f336c.initWidget("64c0bf8942183289051f336c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }