var pmaWidgetInstance6357a05fac365ae37433516b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fc0abc8e402b077985a1bbeb211a0d54:b51c7da8f17a87da7aba571e799d3c8a5a2c75a1724ea93a05fc65277c3e1e5bdee03e8847ac0cf1f0a9cf74472189806843426b0d4f13bc4e79c0b599217a0a321b2495ed24652b8cf6d11ca9898fb0ef86d00a2cca8ed060019ecf26e786aa1c927aa4742e5362cbd78168badae6966c6007ac42b2b43026c39d0b74b2fc0e321d23b590d6ebac5b44145ed89f1adadc931450da526d196ebb73ccd2616dfde6b63da7338b4a9ba13f35cf0ffe37feb56bea5c8e4bf215d622ecf9906e559f2d70e8515f2276d6e577f9e8d52f9449", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "10,36 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance6357a05fac365ae37433516b.initWidget("6357a05fac365ae37433516b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }