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