var pmaWidgetInstance63fc7afc4218328905a87f46 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=053bde5834125bf513d64a6e90678191:79ca2bd133ffdc0ce4862b010e13ced800b6dff3acee9ac7447e096e1c2b8931e03fb4d87ae54bb393e677e2b90b4d3f90666a3a024173a7daf67dab581655f1001dbf7845aa51c4e8a6c859191a27420a9600bf355deb0cbbb4a739b700dad37315ebc035adebefc7b1b3eb71e33031218e8ea33ca576d9dbbef2ce8a796789fcd643102c54866ee5c695469c3a826d9dab676ccbe5b0e35afbe1d854560daf46eab1a152435c540ccd399960eb9e1d54d2eda485c08a60fb52fe6a694397ffb365cbf209bcdea156faea5c9c024991", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "1099 €", product_shipping: "8,99 €", 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(){ pmaWidgetInstance63fc7afc4218328905a87f46.initWidget("63fc7afc4218328905a87f46"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }