var pmaWidgetInstance60ab69fd0067a2ef591a843c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4e1b46e8fe385988e1d248f5ce9e436c:35f78338a8b890b4b390930a63774a8f101371e9b11bc4cc4781ee273848880636a9349203f14967fe7150a57460c5422974ac714e275f701350b88e079560e9443c24f07867d77b9e334e4d65df41f0f02ea0767885127290912ad447b5cfb39ad034d03a94cde29bbbb844d9fab50ef9296bb775f977b64d76bb7833d6afccd17fe3eeaba6b79ba68de8259405102eb5432538f97cdbc66b99f886b8642e17e30e0366773b42b804ad9c3d3b005aa12bb5523ede94bbaa84730763bbabbe9c1480fcdc06a738eecae92bb663be8aff", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "718,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(){ pmaWidgetInstance60ab69fd0067a2ef591a843c.initWidget("60ab69fd0067a2ef591a843c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }