var pmaWidgetInstance5fcbe9ded9685ed272ed4337 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=20d25609aa4c4feacd19fb5eee74a6eb:c0501f524c46bda8f007ca521f9cdf8db0c3d597bfa38c17ca042aac707f0c6628fc5851c0f8472082edee594ccba8daf1ca050b827003fbd5b88fd309bba4ecb0e1bb7847072e2136ba5f0ad703e6d4168aa2d1ee0cd99a0c457411899cd3b4317f09a94bf59dc825311e5b50d0d0c43dbe17a89ace0131960bfa804f269c4497dc351eff4063aa3745c78ef8446e12c45f602c962d90aed1511c59f9aad8c8e621272226f728bfcaada4ec15ce39e5c5dc75fc2b8515e05f98ff0101507cff", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "34,47 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance5fcbe9ded9685ed272ed4337.initWidget("5fcbe9ded9685ed272ed4337"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }