var pmaWidgetInstance6038b684d9685ed272a6827b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=26716dd453191da4fe1fc76d3be1b809:bc034fe69d3074c48a24bfa59cb78d812c17fdffa1a2e43cd40c1d01324abed760e23ecc40a6f2f28ffb5dc1d936658a3f01246b5cc5152bb2bf31c492cd9344198c73d2d9bae684d563dad92adb1e26c474f6f7c538ca3f3d04a7ea0db12692f2927facc49c2b7a6762c58b77ec3f0e53abd6cf9e4145290692e759dc7b60e0dfd13540a86701f7bd39ad3bfce67a0960b8ebe6d4f70c4858e4d3d804336a52298d664de7f68dfba9f784d107fab28f4cf1eccab67b95924d5cfca738d881acb8c6cae02d4d6bf5c39ad72309190e82", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "99,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(){ pmaWidgetInstance6038b684d9685ed272a6827b.initWidget("6038b684d9685ed272a6827b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }