var pmaWidgetInstance602e7b2bd9685ed272385933 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=74a7f6ed10f0ce362c481dfbc357ee97:80dfbc47dc39a213d1888f943cf73282cf228bec2ffbfc19a1a9d11cb972dc42abd0b2449a3287b7b4aca9bb0f86530196d582a7e2475a33c2be00c9313fadc0b6d389cf2c171e79e18cf510a9dcbc5eac2a2e20ac8fc4ad0263f75de60511314acc8c12da9161240156cc48cc134aaf23506ab008fa4b56851db172ee0cbef9bbf7955b08dc575297f8e7ce1166669dc988ee255e213224592fb69206176a522b311f91e00be4a82a0be007357c88af073fd215dff8aad731c955cf34bd327a14b37e2ad73e69f331fff334e1437c2c", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "689,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(){ pmaWidgetInstance602e7b2bd9685ed272385933.initWidget("602e7b2bd9685ed272385933"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }