var pmaWidgetInstance602e74b6d9685ed272191e71 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f8aa479eaab1fb5220250e3c0c53e11d:699b4d42af6e0025d002f54c88dfc8e925812471d52311ac06bfdb48a872331cfb1df1c42f81117103f0a70ceb15d4dd662c0f13d61b842e90cb51a344942c31f2a84d7b181619300e595b24093b113c2da263bfbff246b7fa701e8dd9896f5023061eeea4b2795d56811317ddac0284c264ce3ec3d932bc4308ae49fc904c6782d02a97026a5473d7968f630fdd28a4d027d0bf8ee0d2a3192508a96e328307a86d7fdb90c65dc372e11d70952dba42600d614b729f8b0335bf5676b3bab66f", shop_name: "muziker.sk", shop_logo: "https://y1.sk/t/s/130x50/47997.jpg", product_price: "449,00 €", product_shipping: "0,00 €", product_availability: "Skladom", 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(){ pmaWidgetInstance602e74b6d9685ed272191e71.initWidget("602e74b6d9685ed272191e71"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }