var pmaWidgetInstance60531509d9685ed2722531b7 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=950d93fdfd588c413518a8ab9c93f5a7:bb5d041362082089e0a3ec4dc401b1d2ca6784b8a3557f4569d4e4439b3f73c1db89b6d9951fe50a429ee6169a6bbc4536696dcd9dcdd0ec5415010e39c99a25cbdfd54c11e20d540b30e97f81f50b17cf89dc93bcb4d94f6755f96a6437a507769a01a451d6a701ab46fa4d83e85ce31ecd22e8d9af7bad034b895310dd730d0a0d7ae9bd205feb275f84fd0a0d42c778d03a8cb1bbc3b6beb5b5ecbc0d439fbf031e5c3d1a060e5654c80de762a33750edea995a9f00acc321bde158978cf243d4c9f1133393366b65199521f17f3c", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "415,69 €", 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(){ pmaWidgetInstance60531509d9685ed2722531b7.initWidget("60531509d9685ed2722531b7"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }