var pmaWidgetInstance6385f2c3ac365ae374cb1072 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0b9bf6869ccde6afcede6f7c8f69df9c:3546bc78e1cbe18ecd2bd7785e9e28cb1fb4f181dac7698686a7acf76d273e634264db14ded798574b745750ba596f1580a52f6f30a2ce68678fbb9266ca85db859427a352874bb9361771d53893a7f28c8f1c63406c74c7f07e64ba29e947cb79a17b0900b861a5c15b28779fe7ca6e39f2c4078d39fda8238f9acad83610b5e461d658ddfd9221f75b25f8abbaa0e7d34ba032b602cac75306fc6a953ea8d04215ac82080335c315c451dc47df231732aad1965d2a2f17b4f2f9484ab0f4bb9e1cf7b548772cd5f18067497f90d58d", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "145,00 €", product_shipping: "3,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(){ pmaWidgetInstance6385f2c3ac365ae374cb1072.initWidget("6385f2c3ac365ae374cb1072"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }