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