var pmaWidgetInstance616693db069a975de5914e45 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2ec823f7fc7777bb13b3d8d583e2adf8:48f396dac323a987f120546ddc2010127a6ca07e5c0d3b51cf064aa9f485ba1c0f3daa9c5c20c237a02d0c81a6732465dfe47ec6ad3859910c715777f06f4697c00cfdbe4a3cf68b994435f2f8b1c5d9bd5ab4f9cab8ff20e78ab7494e616a44d5fe26d717305bf7ddbeb79e0406026279644bc15560d5d28ca413c49857add7edd091af6d07918dec7003c356bf9233d440db7aca3981f03307b71d95927333a7dbffc27a98be5db7f1a8c2136ee6240fa946fae7a6a4c32ed3df2c652be54d927288e9dc24a9a9fb6611031b6a6ebb", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "313,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(){ pmaWidgetInstance616693db069a975de5914e45.initWidget("616693db069a975de5914e45"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }