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