var pmaWidgetInstance6357a859ac365ae374895a4f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2310acd63f5549ad81df1b28f9871634:8d33205c396bc853bd7c40c8992bd1e3eeca77b07f6026468cd138d530bbb1a369f3bbdc15d1ab8f92615f5d3488e141595609ac01559620e5009452208e90dd3f93a495d947ef9b2aad4d975d26e3b50f0174ccac1dd3f9d8f783ba2e0b80cb9a906f9015c66a143a453a8a81885af53099357a20216580bc575593cb0e507ab5eee0c199673137697f1e16e0d2766bdd5da2e5bfdfcbc3a46b578a489ab4a695c9f8743e99a91ca3d79ff57d478e1a636a651ec467b257d5a1cfdb902b2770f5c5a66f619d7980740b4ceca5940af4", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "9,00 €", product_shipping: "", 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(){ pmaWidgetInstance6357a859ac365ae374895a4f.initWidget("6357a859ac365ae374895a4f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }