var pmaWidgetInstance63738dafac365ae3746c2974 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=98550ca10559eec2f6301bb66cdcf2cb:9fd9bf48344452b6984869578342514615ab61477fb3ddba5eb75f37e83f6e3a9201b691a7389f86dee18e57be1154c9588ca0703e34ec6e1ad735866f0bd6041c1d7aa62f5dc0b569c9fd4c1871fa455693537eaa1300b7fcee8e2363dfd5c3f66a4d135032f65ce7a3eae2acc2177ba4f7a303f133b76d1331ba667e6193381f53fcaded0d14ee2371656c50290c539decba1a6be5a0d1233c01abd2d0e7372a53f0caabbfe8fdd0042ea11b08849c15591300fcc779e92546cbb9f27b340876afcef78bf602c5f26573f8b5a75945", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "9,99 €", product_shipping: "2,40 €", 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(){ pmaWidgetInstance63738dafac365ae3746c2974.initWidget("63738dafac365ae3746c2974"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }