var pmaWidgetInstance602d2971d9685ed2724815b2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d0065c848f156f41e71b78e1cbc1de29:4c4cbaa4c87bac5019c5d2b5e6e4ad4ae7dd32425bf4f1f14b8709198dea82fa0c3c3ca927218177c7d1a89fac7bd3327ac4e0013f579a4a8b907ce6fc3126fcf3cd8fb1a09816cdc4a72950e4b22c29440446205a5a6da2c6d3ec18715d2c2985e3253244dc3305b5b04d11f18215e78cb8ddf4b4fd720c6688aaa5e89e4192e2ec5d69d859fa2185d0d4c3f8de960a31da8f6ac4a7fe34112b856e27af497816abbc38d6bb51ab55f4bde23fab35f955e57580781a32d1dfbdcc3f55581b2fd9d5e5dea1317d369a87077a579d9c94", 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(){ pmaWidgetInstance602d2971d9685ed2724815b2.initWidget("602d2971d9685ed2724815b2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }