var pmaWidgetInstance60c301e40067a2ef59866cdc = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f75e6721d1f8677511071fe26ac5aaa5:2f0f9a47b873eb1b84e04884d0f92b3f8de1482c9126f1817d417ede3235a57a0fe85576676eaade9fa6ec05c01742c1fac1860faaf1d39a2aecff35c72738bf67558512408375673f29c25124e701d399938608da2de54ac6f1e4ed6a0cbacc85a1d5ebfe71073ef38d345177a67f00ec9c2de535afe8f75888144f4cfa9587ef50f21f22fc8236340a28aa3be5774bcca6af035c95d9df1f5267a31c325eb7d1543eb3697875af25c316380512b365430ad2bcb0a6d8a9f21bd570516ad69066438d98c5901ae31ddd3072010bd247", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "704,00 €", 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(){ pmaWidgetInstance60c301e40067a2ef59866cdc.initWidget("60c301e40067a2ef59866cdc"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }