var pmaWidgetInstance6065be17d9685ed272a5f3a1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bdf26056ebc1282673dc6cf5027a1345:d8946212d81a80cdb29217952eeb77e79bc822c413d7e8f5de0be323392d72a81c9e689d11e2855fe8b4d089286032b9ceaa3c3076c8c5fc9a3f544e3b8e2048fa86d788d93690cb0a284ec8480143873e4cfc647eba3d5a3c8d9d4c8ee59c42601f487ca1c0f702a60b136c2a05d4c40c5e65f75f6ec62a9448d86748da5c015577b8d33f1a61d2196db7d6a832b29e8b5e887ece0f0d5240a19b04fc89f4c1a8e75083ce45f2832f2119d5fdb29ac5f02927dd6e5ca054607835bc200b08a4", 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(){ pmaWidgetInstance6065be17d9685ed272a5f3a1.initWidget("6065be17d9685ed272a5f3a1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }