var pmaWidgetInstance608a70b43975337b9e6f9d5c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=659d2166ac07f4ad5e881c7bacffcc79:f2c1960c07973827000f0d8af755f6955d3e4eaa20c8f7e5cc5face67af2d921cd63ab3de71cc805f3a763052f683a08f2b9fe969969f194c73ca71a3dd79bcc10b81ef1c9589463c7d8e50b47856f1b1f787bd665bc952ae637717da47d02b311e3546e1f93a785ad42b6e5ebeb91624488511afb96920f3a4cd01be874d058860fd0ed0cd11d00ca4f43b9305bb9156e4c49cc71a79faa68a3daea713e54a1bbe847be982c6848b8d5607017fb38b32cac22a8900cdaf082cb2994a5950711f7f0385f38a5215fe5dd789c76703038", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "400,50 €", 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(){ pmaWidgetInstance608a70b43975337b9e6f9d5c.initWidget("608a70b43975337b9e6f9d5c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }