if (typeof wScriptAlreadyLoaded === "undefined") { var wScriptAlreadyLoaded = true; // Array of popin translations var i8nMessages = []; i8nMessages['en_US'] = []; i8nMessages['fr_FR'] = []; i8nMessages['de_DE'] = []; i8nMessages['es_ES'] = []; i8nMessages['en_US']['iframe-error'] = 'Your browser does not support the IFrame element'; i8nMessages['en_US']['close-popin'] = 'Close'; i8nMessages['fr_FR']['iframe-error'] = 'Votre navigateur ne supporte pas l\'élément iframe'; i8nMessages['fr_FR']['close-popin'] = 'Fermer'; i8nMessages['de_DE']['iframe-error'] = 'Ihr navigator verträgt kein Element iframe'; i8nMessages['de_DE']['close-popin'] = 'Schließen'; i8nMessages['es_ES']['iframe-error'] = 'Su navegante no soporta el elemento iframe'; i8nMessages['es_ES']['close-popin'] = 'Cerrarse'; window.onload = function() { // Display popin when click event occure on widget button Array.prototype.forEach.call(document.getElementsByClassName("mj-w-btn"), function(btnNode) { btnNode.style.cursor = "pointer"; btnNode.addEventListener("click", function(event) { mjOpenPopin(event, this); }); }); mjOpenPopin = function(event, element) { event.preventDefault(); //event.stopPropagation(); //var token = str.substring(btnNode.id.lastIndexOf("-") + 1, btnNode.id.length - btnNode.id.lastIndexOf("-")); var token = element.getAttribute("data-token"); //Register parameters var widgetPopinData = document.querySelector(".mj-w-data[data-token='" + token + "']"); if (widgetPopinData) { var apiKey = widgetPopinData.getAttribute("data-apikey"); var wId = widgetPopinData.getAttribute("data-w-id"); var locale = widgetPopinData.getAttribute("data-lang"); var base = widgetPopinData.getAttribute("data-base"); var width = widgetPopinData.getAttribute("data-width"); var height = widgetPopinData.getAttribute("data-height"); var statics = widgetPopinData.getAttribute("data-statics"); // Call to Mailjet CSS file var cssFile = document.createElement("link"); cssFile.setAttribute("rel", "stylesheet"); cssFile.setAttribute("type", "text/css"); if (statics) { base += "/" + statics; } cssFile.setAttribute("href", base + "/css/w-popin-less.css"); document.getElementsByTagName("head")[0].appendChild(cssFile); var htmlCode = "