var pmaWidgetInstance6034ecfed9685ed2721ffd33 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e0ac63a2996aedea4ad3457599d29c26:af95cefd701efd3fcecb82130a34a12e755debc19639427068596ff20a1b9b464706f2f6313037ce2709d954ec966086ecbcbd66d9524431391d23cf22b0d7a08b37c90fefc7402bea7214c5ec9afcaa760b0bafad57cb57c33cb026115856a330f755dfb6e9ca4f8e0a85aa756fe121f045a493e1730c40584d6a1f1c9d5a6e07a9254829e271b16870aac75f5fbf9d0cc87458a860de7af277b2336cdbcdc9ad0854d6ba2a36731c2380cd8354d41eddf459f056a2a35a301d020b578e6158ceaaa748cdbeeab14b6223fc6f78a698", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "449,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(){ pmaWidgetInstance6034ecfed9685ed2721ffd33.initWidget("6034ecfed9685ed2721ffd33"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }