var pmaWidgetInstance650d363c42183289050d3405 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0cabb6057055d770b126bffe29b4b442:f96fa4afeeb1cc7f394da044f67d25f4f84c997b6364ebb44ee57cdebd5a6f1e849eec2ca42611d0ce7548b243cb863f7da48a73a1e58671f6e7f1329a53b39b7a56a40d29d4252c9010c882a4e8bb33a9e1450bb72ddca90897b872b82959855513a65de4825e66cbeb156bb5616686ee48ed121a3a42bfbbdb35563d3caf66660e9ab6741f8a30862cd8d8c9c5d6bc60c882b076149ed0369845dbbfdd1cad1987fef1633dc428a47c70bf26795e0c961b2b9c5e3f8f614490b0ab5e525b0ab94756bcaf6bce19f2e4e9d983daaa3a", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "18,70 €", product_shipping: "4,90 €", 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(){ pmaWidgetInstance650d363c42183289050d3405.initWidget("650d363c42183289050d3405"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }