var pmaWidgetInstance6357982bac365ae374ed0184 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=82211396f9a095cd7958cdcc941dadbf:db3cf88a1bffa5ece82ff6fe9d973b5ff5f776b9bd179a05f20188add1efed3cab309870ff2b0994c47722e6a159fe03d8f2d118c591463ca4d5d136d2abf93e0b2b1d7e135da7e43b4d7ad086fb3bf66586bcea834e58a5ff5cf3dacd771612de3f6eb96f8fa5023e01edd8db0192eeb554bca37022f30908a8ab7176bcd312141186bae9b61e52efe9075f73a961db0cdc8464c26082b473c8a0d8271eccd175115e9e67bdab9d3c55b22c8298f4c10a19a15c85a4465281d16f1e4c30b1e2c5ef4afac814ac3c1ad01b209f68764b", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "4,50 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance6357982bac365ae374ed0184.initWidget("6357982bac365ae374ed0184"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }