var pmaWidgetInstance60c308680067a2ef59991f9c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d1a70f2d348d33ee75f0f2817f4d0e5a:5fad475b52062f61a488ad138541a4b6d61fcc265ea8c31aaa982e7bd8275b180d0527e3f7204e51f4e619697a5f526eec0464c93d91a5c276cfbafdc09f6966901658d4e9dbe7966afb41120fd8f32a84f5ecea882184ad8cc5b5051d2e8e995e5e6736d1aa536899d6ab17440125c8c08411442501f3c8ae360b4b5f102d36c6978c32751276bb5ac582fb97fd6ab695fe8137a7dbe51c5975f7802b80d7e783892780cf63ad0af4c27a54f7f5fea60337ba636e655fe28d67d8a515a33c67f3950ade593802514032f12646a91d8a", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "379,99 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance60c308680067a2ef59991f9c.initWidget("60c308680067a2ef59991f9c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }