var pmaWidgetInstance604100a5d9685ed27263b352 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a19bfb4786ee747924f863c77b55bf0b:31dc67b350a56cd2a9e48ccb7b01c793cc6dc3d3c157765072636b2d880e689e6f75c5c7a5c1804fbb3a44476dece354a2f33931ff59debfdbbbd17be092337393903745c7c2462c30d54eee0bd2322be9b17ca4b1dbdbf219bc11c9ae6ec325d32df9b51ed9620d3298c8e1cb1472cdae5d55f404d96aeac4840a638b9b4956f64141eeabdaf365787819844dc23731e0a039e710f6bca3cd52aeff9c41311b1fa86abf039e60b5010435081e77aa04433b5c7c413334354ac815dd24ecc91204a8c865d200b542350da5b678841c8e", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "474,99 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance604100a5d9685ed27263b352.initWidget("604100a5d9685ed27263b352"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }