var pmaWidgetInstance5fca6108d9685ed272e2e754 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7e093db008ed597de1d774a5ca3c09d6:aa2632408289d22d8798f88ab3f1d2f7ac422214e825f7dd6bacb53e603ef51e81f3e0377c9c48bee854ff8e4eabb4a8be0e187e418a6abc8a8eba819a1fe1ed14b1e3a0c4d7f76620e793bc8f1b2cfc3487caa1d72080ff063d4104e4473e1c4ea9a72804f367481655715467546b7d6f820c55c0f2e2113600408d0a61eba34935952a28bff4b541aebeaae2a56fec0ba7a29b951c29cf9dca4a8146ea7afed218fde5074b1216ebbe7b8601b3ad2182655b13b37ce49c0dbf5b39d5a403ba", shop_name: "pvmsystem.sk", shop_logo: "https://y1.sk/t/s/130x50/48427.jpg", product_price: "10,87 €", product_shipping: "3,60 €", 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(){ pmaWidgetInstance5fca6108d9685ed272e2e754.initWidget("5fca6108d9685ed272e2e754"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }