var pmaWidgetInstance5fc9f127d9685ed272597233 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=900d37c203d143081c61e31f4d71ade9:98a02ff39b82809507dc1cfe25737949e79330b9b773394914f2dfccf3184f6e2f8ea2a87e6e4b3b8713af43ab60a51a3b0875fc80b371c4f2b52fe90868a6e1eff07944a8703e987d0043e55c6cf37fe8704245ba1cbcfc3c25895ab71fb7de4f30549455e1251f3507eb3545aff2754e4fb1b63e30d77dd5de522873b40863b99500bebe47d93d9fc3418ed7892e4249be46c30c2befca9bd66d0a56e6b2c91764bd120125b7dc2934e2fc974d2d6f6cb4fbe89c063b22030c7bdba32e583b", shop_name: "pvmsystem.sk", shop_logo: "https://y1.sk/t/s/130x50/48427.jpg", product_price: "176,79 €", product_shipping: "4,50 €", 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(){ pmaWidgetInstance5fc9f127d9685ed272597233.initWidget("5fc9f127d9685ed272597233"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }