var pmaWidgetInstance602fac51d9685ed272e68ce3 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b49f9502a1682864809af6450013e355:6d846d5549bdab9224adbe28b588af941c0bf4a296651cd74f6e47abc273882589f0e5f0413977158ed78d643cc620e9b9aed90a8ebc10208cceaf53f029f7b519a6379362e8a4d54e883049467be56fe3710ab0de4b33860d92e8b12a26d2ff59cd6e102b22d5f4a6b1f08e2597ee830d9fcb18667406935612f81c3a3e370bee2e4d37cc5f31b80808b80d38ebd41a8feb3e307d65c318bcaf155636c09e6aa5949595f165d39498a93967641fded5d9135df264812fdc07c49a39e9ac7267fb6b0b3d882c8dc633c9d964aa917683", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "704,00 €", 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(){ pmaWidgetInstance602fac51d9685ed272e68ce3.initWidget("602fac51d9685ed272e68ce3"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }