var pmaWidgetInstance63e2201d4218328905dee820 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=cbcbfe702511bd6a642438c9291b3c0b:0702ea60735e88e942de230ec646fea73765d7672e71b1b9f58ec4755bdec19f7a6a3d14835ca3e82e51ff07ee38c1893e47d08a74e7b773e8a12142cb08ec53c80db475f4be61dc705e9109c9905ee7e3413ec75a70c52d2d1c259ac3ba58c37c313c9969db4be2483c0cbe75abb7e0f745119cc004c50085c2423bd744bd591b51ee77cd71f6822c5fcb6a3dad74fb10465bc4f3d7304604e1d600c71b70dfe61f5e05027f1b52ccb66c078897fe60fca0e33ba80cecfcf5398ca22d2948d7ccfa1c34309641f4e18c17f95a7e2f30", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "275,90 €", product_shipping: "", 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(){ pmaWidgetInstance63e2201d4218328905dee820.initWidget("63e2201d4218328905dee820"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }