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