var pmaWidgetInstance6090ffef0067a2ef599355d9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=428f0e0e444ae5293c8d845d16cfc1a0:75943aab6d7dc0a94b93d750f32c3b273208adad90d37c279493772cf2d62a936a41758e5822ab0e0cfc44a139a29105b3510cedfa26f5a78d49d95378e1008769e1e37f292e6a74699e9c3733164b9d019f0eb1d992fe039090185694342a6719e0e0a1dded9fd3608759ce6cf55019202f717491916a6ecb2f90ee4ff52b62352a2a4efb9f11cb5c7403be8dd386b0dff421d629d1b755071a93f355fa0b0f7cfecdccb8a664aac5da175ecebe8fa945896fc6cf4372b86e6b5a2a995dc0e324b4f5426ce573edcd5b9b9f0d73c473", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "339,90 €", product_shipping: "", 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(){ pmaWidgetInstance6090ffef0067a2ef599355d9.initWidget("6090ffef0067a2ef599355d9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }