var pmaWidgetInstance60c308680067a2ef59991f9c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1b567961bdb290997b23c17aaed0e3e8:f534e76804ed5c59ac85ffd63c9b53bd75b8697a6d32b7ad0e075f7e0e78ee4bb4a89522a8921e80457c94553426c4cd75f31b987389ac85c0e90e262836e4a5978c6b8c88f3157a9ccc2180f742c4d4d2effed7f2fff8dbfcda2cafa1a2c1c7089d8eb9210e7d1c4f2f9f5be44651a4b8957dfca5df2b9fe0eb75010b684935825370fa730e8a3441780efd64984df3503361decc83deea0c2dafac0229a47a8db70756ba9176ac70044d254f17874e63dcf6ce5b2e266ab4520a813e0473234c4ad49085da47f68af9b63bbe4e05a4", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "379,99 €", product_shipping: "3,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(){ pmaWidgetInstance60c308680067a2ef59991f9c.initWidget("60c308680067a2ef59991f9c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }