var pmaWidgetInstance610a935a0067a2ef599a6bb0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3fe2850eac9b6800f11f4cbfdedaa62e:029797d56256262ef349631f5240b69e40df6453924a271d926eded3133143d79dbb18cd37db05d9f625a44beddad742784817ea2ffb6e768c6844c203ead110fb07afae1d833667ebe919639a76edc9bf6c34935ced15404a9f87b57ac76cb6e906a536a8f139d7f9b89f19e6d06e92d7d3674e3bafcac23fae50a405d0595da0f585d545402137f9803d65fa91dc0bbbc89af86cf681479f547577d1e5913b1830220daceb05cf41b107fc8fd0f64974a3027c314dbdd3ca4a55923caf69ffffb5ec900668faaa6d9f5562ab671842", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "730,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(){ pmaWidgetInstance610a935a0067a2ef599a6bb0.initWidget("610a935a0067a2ef599a6bb0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }