var pmaWidgetInstance6006dc8ed9685ed272ba833e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8f89ebbd53d4013c1c3a3f19d759bbb2:149b2d4444d87a890320f08e26f96bbc9d8b7efb961cb3b01316c331f754aa10853f970962b5c4f55bbbee2378503ef518bb9082fa33c52634cd81f0bb4fd7011ec27bb996c7fc938dfd42c12099931b52f113af93c05361e779592a4bc78a37271f02e4fa1ca09f09eceaa0051351287dc41ea06286d6894d98068f972abe82b6a6a2b00728f3861c33674db1dea1995e62d64e0b345e0f612a557fff5f5fc52566a79df9a96fe9125ffd8b1d540521244f4e85d90c33f41e2ac8235d9279ea", shop_name: "GymBeam", shop_logo: "https://y1.sk/t/s/130x50/46829.jpg", product_price: "6,95 €", product_shipping: "", 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(){ pmaWidgetInstance6006dc8ed9685ed272ba833e.initWidget("6006dc8ed9685ed272ba833e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }