var pmaWidgetInstance654cc9f942183289050a0c5e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d631b599eee5c2a6b46f8fa05fbd5818:5b740ca40de09d5225c98d6bea3a61d798879bb34fb9ea3a90e68ce8c30150638cb648960f6b8757498379b90445f671bee2b6551815cb1841b69e201faa2676aeba62cd5a86bf127b14a11d867a49cdf770e2dc6daf1c437337b5e0cdc1d1b32a88ab87cbe1afd8b642c20e09dc84d2a044a5f129f667b9a8eb6abd6ccd4c9d49529208333b55668e44daf404b30c0cae45515e0fa4e3949685685025d74a08617073ce291f630ce1b4b1308fab5e64b9a76ff417442def3d60383ba45ee92ee84a172786dcad1fa27ee3cda3f70fdf", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "12,66 €", product_shipping: "", 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(){ pmaWidgetInstance654cc9f942183289050a0c5e.initWidget("654cc9f942183289050a0c5e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }