var pmaWidgetInstance634fcaf9ac365ae374549395 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8faee995900c289b8d62f741cdfb6123:3964b7a0a4de4ca63a89a30c0145caf26793177715b254535ddb6b591d33dad92f277e76c59e62b32a87f8c8857c4a8b10254be436176ae10aa344a6fdb187f299cb0f3bbbe1663af036b60ea60cf69243efaf686b3aa53462399f79c1e3b21370b4685f1d68ab2ce5c8305def211465caf5696f11d0a5c1b680ead0dc6f3d0b7d83008617f3096863626ff2bafd5a73c001092bab5521e25091adc9ad14e1d142a4061b764491f77c40fdf0de3a3b0d9f40bc72ecbcdaa7bad66f4959c9bdbca868ee6855d0ddfb65a145ca31032ff3", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "272,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(){ pmaWidgetInstance634fcaf9ac365ae374549395.initWidget("634fcaf9ac365ae374549395"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }