var pmaWidgetInstance64d4d8df421832890560437f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3f495cc447660be438ce0f4062a96b88:a9084677d747ce3a8bd2e932ac26ab33ed801e9b9fa40e2a2d01c5e2842ad2f0b7a1aa6dbf3784b5652b7c8726174ffc95041f1556e5679ee7f6f1f23e476274a8b2d13921d51fb9f09bc49d74e3eb365c68e9436c5651f305440a76c2d5e8dd9e67df2504065cf579ce0264836ee748fdeccaaefc88f534386b16b7a2d14b27afd3f4801ad6f651f4b167ee42fcb04d30931dcc84fa7960b738348d0252716c3c7304c9111fa948433aac6b184992abb443c2fa7823a0ae301541c1afbc9658ba5aeeeafa8fe72cd279b2240a6620cb", shop_name: "pomocnik.sk", shop_logo: "https://y1.sk/t/s/130x50/42713.jpg", product_price: "64,00 €", product_shipping: "4,90 €", 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(){ pmaWidgetInstance64d4d8df421832890560437f.initWidget("64d4d8df421832890560437f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }