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