var pmaWidgetInstance603e01c6d9685ed2728035a0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f72b86475feef7d0be7afff1aa6c7d21:bd86bd8ab9ec15eb15aeeefd8f1ef677e5636c8ed9c6dc062a0a8da9338cb6ede0f965ce5dd1034119e59bfea48f09a97c1d8851dc190ad7a6d49b51a8d791b1cb34165a4b01793a8aeb6af9da2156790b7f7c82a8a86544c4357b0addb1e7768f44dc6adf79b3e3d18c42b436f53766f7c8315d77a8433b81804bba774860615a3ff58269f6ef7e4aadd7eb738cf5cecfc8757b1435c33f9b220365c4b165240f4290e23a51af4ba594cd2ddb62b10076ac0d0e8bfdbd6b73f2ddcfc62a6793", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "11,81 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance603e01c6d9685ed2728035a0.initWidget("603e01c6d9685ed2728035a0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }