var pmaWidgetInstance6006b9ddd9685ed272c5fe73 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4db8585959f4b7fa7b60d99066b2afa5:64960d6199fb86f8c4c5ac12c661cd5f4a96c85a840384f08cc4f2e46a12c00cc88076ae445cc95f44ad6432e13ff8ccd1ba6a510fb09f0958ca6fe130cd402118e3de0227afe33d9e92738ee1028b49937ae072c6a2c3c8fabc524fba5f16ee34adde5023270a994baabbea162e408eae43e0507a4b7d259ce3dfd9aea512c5f612d157bae573d198df0f387448f7252b83c7760645b1402be744db6c9fc7c83729164faa764a951de1b8be25f222a80d571f4a369b26299261fec836a355fd", shop_name: "lekarenvkocke.sk", shop_logo: "https://y1.sk/t/s/130x50/57146.jpg", product_price: "10,51 €", product_shipping: "2,19 €", 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(){ pmaWidgetInstance6006b9ddd9685ed272c5fe73.initWidget("6006b9ddd9685ed272c5fe73"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }