var pmaWidgetInstance60350696d9685ed272566f19 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0dd36e8f9397694cdcf228e5ea0089d8:19b62d1480b696cc0525e5e81974f9e3d5b774bad5f65f5af28e63dfb12ff0c3fd6d25f453725094e39510a013d53d8f8b06358e2b7601c3a84a91c0fa8ce1e37a45059e24338ee953e14f07ab3edd0019f5c52321d455df0e6dde58f11e806f41c0ff8f5005059752c78f35e4eb11444a65360096502d091b9a6da33a07d9d6709627b97fe59a66d9c250692ca8e85524348e89333e2eca869f86bcf9a8466dd2214e7807b3c5ac60ee2aef463158e905c571d87ed1e9013fbb3e0ccf895f7a736a78205b3ac4d530e948bf1cb58893", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "704,00 €", 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(){ pmaWidgetInstance60350696d9685ed272566f19.initWidget("60350696d9685ed272566f19"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }