var pmaWidgetInstance654ccbe44218328905143978 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bc4618b359b0d5cb161ec1e3af208f78:dd5300826f66c6f108f4825c2c01ef90af6b5aeb259511dbdd107f6afe43d79a7f1120f8fec5df1c880b4435b33edc5daa26789a4d996b812dabe642ef4f02f11e25255444dfefaa24886e67ee9935c6d4bd9322d094f2e975da34d810c614b895352620c628bea64bc5742f14c1f151725e02353d283eb40efdf54b6a240d413f181b6633c0dd161142ce360050bde3a7b2a6513e1c1c1f68e2931cef972725b46869ff41af2b7bc6cb437e1da4bd737e4626ab6f8535ac688a4289fcfff829745aff7e2edfa8dc8389daf4ceaea9c3", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "7,47 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance654ccbe44218328905143978.initWidget("654ccbe44218328905143978"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }