var pmaWidgetInstance60119ad0d9685ed272c9f6fd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1329de9da05956064cfcf5e2f466c515:19526a59209a6e9198f487e4517997865aeda3d27198fdec1bcc8f46ab15f73b2bfe99a4415a4974d1e9008b4b104cec40d9b4c008503c35a0546e050a525b24674551cba96df102e87207e6cb44f44111880b93d83a4f13af3382b684905d5d5fbecb68fc43c882a9ea3f211f46a92a11b774e0f3dfee499daf81cb688d05ffce63b7a3b0327b1ff179fa65b9bbc7f84c31c297c9e5e0e460e5c73c64ab1ab752fb1cc19a5f5e37e3ad4828791b3ac9b9e1379cc048561205ae4611484e3e57", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "29,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(){ pmaWidgetInstance60119ad0d9685ed272c9f6fd.initWidget("60119ad0d9685ed272c9f6fd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }