var pmaWidgetInstance636131a3ac365ae374c14a8c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=77eb0073863f232ca30150d13cfe1fb6:8c8bf4f601f77cefcf3a3c3e9ec11c224fbd3577987ee97dd2cc23edd659633c5b41d6216e387fc995e5b75df8fe8352b8db414bb78410dabff656fa530cb6d9a3989d3e13e7613330c19fd73fb7b2b08d720d5b65629f2e48af88d75d3fda528d99ebd3061c2bd2c5c92fc3216bd7cc9d508c08f8090b2bd01acc44665869359d25bc36f383a655488f9697214c10e9b81db2a6991651def49a48399b150c120f0bccd59bb38042e2a48fe27968a895da28259cd065778e1fd1f3a86557ea80c82ad63ff8cb31e4a2fcf8d80bedbf6e", shop_name: "pneunaj.com", shop_logo: "https://y1.sk/t/s/130x50/52071.jpg", product_price: "168,38 €", product_shipping: "", 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(){ pmaWidgetInstance636131a3ac365ae374c14a8c.initWidget("636131a3ac365ae374c14a8c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }