var pmaWidgetInstance610542fe0067a2ef59da9d5e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=10cb827adecf3c6aed02a359b0990be7:eebd33924e087a297fefcc2b7796eeb5c129704fd17bc2f771939a378b6b4b45a8c2cfaf962c175aaaed120fb6ca35bf6ea0648a33d9a539599117eaf775ce02f61d9a30fc96169c2cc9f00ed5fb1e4ec421c8dc403bafc109565ae429a5e07f48a43de3e9c9a8300fa5c4cc3900010933a3c68026a64bb06ee135e2fb0ef841cb1c9dd463cf0f6d81bb91954033479122390920a89aaa956132470591477e44a4fce7ecaf9a69748da4b86ef7b828107dd861e1cf9bdb6dd96e0a27be664cc8", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "606,35 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance610542fe0067a2ef59da9d5e.initWidget("610542fe0067a2ef59da9d5e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }