var pmaWidgetInstance60c783970067a2ef59243357 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8ddee6250653112267bbdd1058522bbe:3c53724a41b3f79b9e108292349c66fbc6e6fd66d4b7517544b55fade20ab277bd5d3f645c125ce0a981830fa4e5588b50877577148d1ffdd7bb4a8a68eadb42cccd5eaea932606b31d1a47bbe0476c9ddaf357e3a325092cb07693bd88039b6a260ff3cd97e314fda6353bf91e2358f08f4d9c5d0a5332cf0f5b7f2425d3dd051bae289eee6b1b0b100cc67623c928f4d862593244785c07054dd13cfa04df345dbb8b4a541865883b0d804f719ef38b34a388d1692f180c17401fc4d01c9533e9829fb8fb7d3534737b501adba1201", 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(){ pmaWidgetInstance60c783970067a2ef59243357.initWidget("60c783970067a2ef59243357"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }