var pmaWidgetInstance6022ca97d9685ed272114fb8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e96825de965cea376633806d570bb0de:c1bc83e8c287acc61bfc970fdf33112680d7918694da547066741393decd657cbbd96ce9af21edf7362027baa421652e993eaf33af6587100e35f64597fbd4cbea3bae60cfaf04a057754c4d25ac555d99b2ecc6d1d1a968ec2d36ac76591f0610938692cbb9b537a39edd15fb1d439447c4bc809a21ee7e2d9fc7d4c95141c0595113ebf9513fe4adfc58c8af07369a32a414e2b0060e766d2f7b78b7226c977a0c896c0432052dbec545ebdff5cc72ee5d41c6dbf6315c4039f155609923469d94037304b156370823de41b781eaf3", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "291,50 €", 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(){ pmaWidgetInstance6022ca97d9685ed272114fb8.initWidget("6022ca97d9685ed272114fb8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }