var pmaWidgetInstance6051c661d9685ed27299b77f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a34b1479361f0319dbbd95809efa35d5:fea13aa2701fec0e611db6df803a65dde665a25245aff16bb776173bfeeabaa34d1fa15e6158d0c2fed307fdcbd85a5aeca4d07787512cb04310b5ae7bdd876b65f8f51ef1369e23ccad37709efa7ad61a1293d28753bdcce3ad60746fc2b50b613f8a3750ae3bcd73aa0f7ead2cd946eba5c362ffbcbf9156d1545c3d4a63b39dec4b2a2098b216b475f217051a8b2f64d5e30c06fbf849da92b4e4918089398a40e298e68849037e96d5df05a20f46f4086742bf02217038a801d3b8df15b713f539ce161bd4417e7c91c357c39a0e", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "5,91 €", product_shipping: "", 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(){ pmaWidgetInstance6051c661d9685ed27299b77f.initWidget("6051c661d9685ed27299b77f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }