var pmaWidgetInstance5fc8d5fad9685ed272f2f2f6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=77fc806dbd5486874fc7b5ebac3ab096:f704b214a5dd38a08f2bafd239e8160b3e6f4b74befef9863c1f7b95aeaa27323bfcce20a57cd30f42f35ed6813303c8aee8e1f0a28757ad0b7823c70727f16f633a96459291e97341a3be3f59f3db7a349478c1bd9df3ea342af109200b5ee028c788a2b0ee970be6232a755c9f4ab794894d7f18a54d1e49401210b43bc3f4c4244f537c3c340807305f04c420c40dc72ddb1edd7286bcc095114da77027b8844aa238504ca779b55181e3cd239ed7ef5d9483374d1833797e8cc5eb956ba4", shop_name: "pvmsystem.sk", shop_logo: "https://y1.sk/t/s/130x50/48427.jpg", product_price: "1206 €", product_shipping: "14,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(){ pmaWidgetInstance5fc8d5fad9685ed272f2f2f6.initWidget("5fc8d5fad9685ed272f2f2f6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }