var pmaWidgetInstance63982ed8ac365ae374570e2d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=83e097e809e96ac2171b49d6d05267aa:cdd69d34d562252cc3edce6504c18c7185b8746ad9f994652c9bc4a9cf06b31e1b38433c55767ef3fd5ef821526021b9e7bfbe6258c3baf65a199e8221e99f7ebd65d25becd58346ee475167fbc38558d7ec0346b39b23d9363dd231cce78a574e72c003481c40e8fb2e8af5c881935bebeeba5efa001e9ee06951ce75c39e94c015dea229d59237abea95b14234faf9dcd1f4886a187e77bd8f19cac85db836377a9b6359cbe555c6fdc281a8c04319243c073ff1fc2acce354443852f23e1511551732f3c0156606724a6fae42260f", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "399,00 €", 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(){ pmaWidgetInstance63982ed8ac365ae374570e2d.initWidget("63982ed8ac365ae374570e2d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }