var pmaWidgetInstance60b9f4430067a2ef59cee16c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c519433a71c2789f471de1b4093a385e:4ff72497c044fd2e24ad706eb5e68d172a023d7a42d194dbaa559e074cb93630ac15da729f843bf66184da694bb5a9e7c910901e775e3c1db06a6f3c137a94abeebc05b7b19f9f609787e55bf851f8e7919fef62ba99f0d290432e79a6c970d7e0aaf95e10fbb7c0ebaadfaea08b4ff7d9f0daaf1e551566ca3c593f0997a689ad02de1d244e8fbe10eee07246f51bac7a774a188ed79159fb8e23d9e9fb8d2b145d6f665287f40c25d5ba835cafe1afc5617b5b8bf2c5ef901967b4a7a8d838", shop_name: "MobilPC.sk", shop_logo: "https://y1.sk/t/s/130x50/46049.jpg", product_price: "479,50 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance60b9f4430067a2ef59cee16c.initWidget("60b9f4430067a2ef59cee16c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }