var pmaWidgetInstance604b78aad9685ed272d36631 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b3666acc1581dd8e66bc99e34f6c86a2:cccd5320021c85f08c18b8d3fa1faec4b8a64bc98276328b357a2280d2113d7b839d7bea8a5f5e97f7672634dfb1caea2c7db6714d9eda5ffc6276d1ea90c1e857af9e1ca6380a587820effa1857005b8af113d068af7043e098ce520b129babaef79fbadb9acdf3b7d63c24b8a8a6ccd1141e5337176329d583f551867e1a4706e56d8a23027f41f07c770ca2b72536329ef4943cd985de8f0fa30c904b4d1db685bd932ded24b16d23402de3bb0cff560665f7b8ee036de03bd4f7e412335e6a2c85565c05f254bade051473e000e5", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "488,99 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance604b78aad9685ed272d36631.initWidget("604b78aad9685ed272d36631"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }