var pmaWidgetInstance650d29074218328905c7904a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ab62adc6721e65fb522d694824b69957:f8cd37dd592c223250bfc359f0ade6ca9190a3efb3cf033715b9b2a586f9c5c88ad8f66fcbbe637088fc39f1601d02193430c3a94a99deeb366402d95c7f424f5f5c69df3ae62e861ab5e7d96e73377d4a5f76169635d229fa1c19ca6c92acfc245a1bafe94f21963250a8ad944386af83691106b929a7b87a5fec9762db0271c1c9452dc2d7f43b1adcfc1ea43591877f46d9610d361fbc1bc7686ce1e08ccdecc1655fae3ff24cbc1b38b3869160b597a4ac5e50abf5f28633a96753482c2ba704cec42dbe1b86af10e44ea20c5f00", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "14,50 €", product_shipping: "4,90 €", 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(){ pmaWidgetInstance650d29074218328905c7904a.initWidget("650d29074218328905c7904a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }