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