var pmaWidgetInstance6357cbc6ac365ae3746d10b0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6f453ccfd384c252105392de74558ccc:85c84cddbdeb97713e51ca5164c96be29e0c8011f5f80a7d2573c5f48c559d8139339f4dd03f8afe0f3ce1baa73cc59015b4c80b496d1940bf951298260569586f04e6c46697aed3383a9a97e73541e1c95ec5756594e97b7abf723fa73ce431d3814ee228868fc7353a3a89321019defa638bf58ad27c3cf540079da3525641922449b21517c6ed51d2b01ab1b84dcd901976c23f8c7eca69fdbb94597f9dc997840ebc833cc8e5fa6247d755df0c499e9ba78dbed7d9b582ee5344e7b9a5aca9b16878e3cd148dc9a09def58b4702c", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "8,18 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance6357cbc6ac365ae3746d10b0.initWidget("6357cbc6ac365ae3746d10b0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }