function InitializeRequest(e) { console.log('initing'); var t = window.location.protocol, n = "https://www.trustmarkthai.com/callbackData/initialize.php", o = e ? "POST" : "GET", r = navigator.userAgent; if (r.indexOf("MSIE") > 0) { var a = location.hostname + (location.port ? ":" + location.port : ""); "XDomainRequest" in window && null !== window.XDomainRequest && ((i = new XDomainRequest()), i.open("GET", n + "?t=" + e + "&u=" + a, !0), (i.onload = function () { try { document.getElementById("Certificate-banners").innerHTML = i.responseText.split('.json')[1]; } catch (e) { console.log(e.message); } }), i.send()); } else { var i = createXMLHTTPObject(); if (!i) return; i.open(o, n, !0), i.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), (i.onreadystatechange = function () { 4 == i.readyState && (200 == i.status || 304 == i.status) && 4 == i.readyState && 200 == i.status && (document.getElementById("Certificate-banners").innerHTML = i.responseText.split('.json')[1]); }), i.send("t=" + e); } } function open_popup(e) { window.open(e, "DBD_certificate", "width=700,height=720,scrollbars=no,location=no,resizable=no"); } function createXMLHTTPObject() { for ( var e = [ function () { return new XMLHttpRequest(); }, function () { return new ActiveXObject("Msxml2.XMLHTTP"); }, function () { return new ActiveXObject("Msxml3.XMLHTTP"); }, function () { return new ActiveXObject("Microsoft.XMLHTTP"); }, ], t = !1, n = 0; n < e.length; n++ ) { try { t = e[n](); } catch (o) { continue; } break; } return t; } var urlParams; (window.onpopstate = function () { var e, t = /\+/g, n = /([^?=]+)=?([^?]*)/g, o = function (e) { return decodeURIComponent(e.replace(t, " ")); }, r = document.getElementById("dbd-init").getAttribute("src").substring(1); // console.log(t); for (urlParams = {}; (e = n.exec(r)); ) "t" == e[1] && (urlParams[o(e[1])] = o(e[2])); })(), urlParams && InitializeRequest(urlParams.t);