var pmaWidgetInstance602fb465d9685ed272fc0e45 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1f29c61bbcd021a7d24ddb3cf6c07cc0:dce1bac3447393ed13cfa9f97e871b14997677160780ba9d4993d9f8284ddab110ae8ba34f4e6a8d7ceb077a83a462363a6fcc499149c2faae404797c25c4acde043f93bc459afbb6ec83ddf6021574c44dadceaedc22f77a3723bb282ec7717e90733e13b8a2fd7026aa7c7bd919a0db60c6a7be9fb9ef39b0cbefe76ac58e693f6aeea0d16fbd3b941f37f1d1712dcab95d4a1fbe08a2118723709d7361489239cd8e98af07a5e452727494ffef8850f4b31985bcc7bff09f77e9bc6d0875db24943c6cbb5e6d45466e255a257cb33", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "75,58 €", product_shipping: "1,99 €", product_availability: "", 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(){ pmaWidgetInstance602fb465d9685ed272fc0e45.initWidget("602fb465d9685ed272fc0e45"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }