var pmaWidgetInstance605acf96d9685ed272628abe = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2be055a9deeea4917088255f8bb919d8:ac876996731e309657f9d62ce5c9b39ad7d521cb4b26851be4774179eb77ddb0fabe718b98bb2af15318226043eb7879a5c4d2822a435e002fec3f1ea11d64e1673177d5391609e98a02ac52196cebec80f12365dcc1f6a1ffaee7a61f4286311600142979cd9eb06c6be0f64fce142b0f7602c99779670ec3d07fb7cd783116eea2f6353039c6bf3c9277e016f1415d8f1c711edb4934840748055b7c6cf4e29b366f471b2c3bc11a1110cff560f12f029f6a3d941c6838404f05bf494db1bbc924700e9fe0cbf136ef0af903a8c2a0", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "143,80 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance605acf96d9685ed272628abe.initWidget("605acf96d9685ed272628abe"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }