var pmaWidgetInstance611528010067a2ef598a4b40 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5137cdfaf77e2152b2eefce74614c4db:98ed6dcc54cbf02ff7f631eb0bd27f394b43868b6ee754a96cc9e144e3845f2c8ca34a3b49d8f65459701a29a1e361ddd09fecd2d944b2dec505a838632565b98a9d9b2cae6dff5b560be5b1fbb5e37aceaf4b8b33508391666c366ba7c185d0b8cd926654579c2b92863a1ed094de1af6c8f8ae2600314bfe7a0c37490b0f6e4ac52c1e7b6b287ff14605ac637531971e831a5c02934d7f0a57de2b3e59f8bb1c02572f2aabfaa51bed9e91be13a429a9449a2093e0a6921e87c00e43465148788fa88382e8313d0ced01f21ef2e9ae", 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(){ pmaWidgetInstance611528010067a2ef598a4b40.initWidget("611528010067a2ef598a4b40"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }