!function(){var r,n,i,e={},c=(window.onload,400),l="AcceptUIContainer",s="AcceptUIBackground";function t(){var t=document.getElementsByClassName("AcceptUI")[0];("ontouchstart"in window||navigator.msMaxTouchPoints)&&p(t,"touchend",a),p(t,"click",a),p(window,"message",g),function(t,e){e.billingAddressOptions=t.getAttribute("data-billingAddressOptions"),e.paymentOptions=t.getAttribute("data-paymentOptions"),e.apiLoginID=t.getAttribute("data-apiLoginID"),e.clientKey=t.getAttribute("data-clientKey"),e.acceptUIFormBtnTxt=t.getAttribute("data-acceptUIFormBtnTxt"),e.acceptUIFormHeaderTxt=t.getAttribute("data-acceptUIFormHeaderTxt"),e.parentUrl=window.location.href,i=t.getAttribute("data-responseHandler")}(t,e),d(),function(){var t=document.createElement("style");t.type="text/css",t.innerHTML="#AcceptUIContainer {visibility: hidden;opacity: 0; z-index: -1;}#AcceptUIBackground {visibility: hidden;opacity: 0;z-index: -1; }#AcceptUIContainer.show {visibility: visible; z-index: 200;opacity: 1; top: 50%;}#AcceptUIBackground.show { opacity: .7;visibility: visible;z-index: 999998;}",document.getElementsByTagName("head")[0].appendChild(t)}()}function a(t){return function(){var t=w(l);t.className=t.className="show",overlay=v(s),overlay.className="show"}(),t.stopPropagation(),t.preventDefault(),window.scrollTo(0,0),!1}function p(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)}function m(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function u(){var t=w(l),e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=m();I()?(t.style.top="0",t.style.marginLeft="-10px",t.style.width="100%",t.style.height="100%"):(e<=550?(t.style.left="0",t.style.width=e+"px",t.style.marginLeft="0"):(t.style.left="50%",t.style.width="550px",t.style.marginLeft="-275px"),n<=c?(t.style.top="0",t.style.height=n+"px",t.style.marginTop="0"):(t.style.top="50%",t.style.height=c+"px",t.style.marginTop=c/2*-1+"px"))}function o(){return"https://jstest.authorize.net"}function y(t){var e=document.getElementById(s);e?(e.style.display="block",e.style.height=function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}()+"px"):((e=document.createElement("div")).innerHTML='
',e=e.firstChild,document.addEventListener&&(e.style.zIndex="999998"),document.body.insertBefore(e,t))}function d(t){var e=w(l),n=e.firstChild,i=b(),a=v(s),o={verifyOrigin:"AcceptUI",type:"SYNC",pktData:window.location.origin},d=~navigator.userAgent.indexOf("Android")&&navigator.userAgent.match(/Chrome\/[.0-9]* Mobile/);I()?(c=m(),e.style.borderRadius="0px"):e.style.borderRadius="6px",e.style.visibility="",e.style.position="absolute",e.style.boxShadow="rgba(0, 0, 0, 0.40) 5px 5px 16px",e.style.zIndex="999999",e.style.display="block",d||(e.style.overflow="hidden"),n.src=i+"#"+encodeURIComponent(JSON.stringify(o)),n.style.height="100%",n.style.width="100%",n.style.scrolling="no",n.style.seamless="seamless",n.style.overflowY="hidden",n.style.overflowX="hidden",document.body.appendChild(a),document.getElementById(l)||document.body.appendChild(e),r=function(n,i,a){var o;return function(){var t=this,e=arguments;o?clearTimeout(o):a&&n.apply(t,e),o=setTimeout(function(){a||n.apply(t,e),o=null},i||100)}}(u,30),p(window,"resize",r),u(),y(document.getElementById(l)),document.getElementById(s),window.scrollTo(0,0)}function h(){var t,e;n?(n.close(),n=null):((t=v(s)).parentElement===document.body&&document.body.removeChild(t),(e=w(l)).parentElement===document.body&&document.body.removeChild(e),r&&function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1),t.detachEvent&&t.detachEvent("on"+e,n)}(window,"resize",r))}function g(t){if("https://jstest.authorize.net"===t.origin&&t.data&&"object"==typeof t.data&&t.data.verifyOrigin&&"AcceptMain"===t.data.verifyOrigin)switch(t.data.type){case"ACK":clearInterval(void 0),function(t,e){var n={verifyOrigin:"AcceptUI",type:e,pktData:t};w(l).firstChild.contentWindow.postMessage(n,o())}(e,"INIT");break;case"FIT_WINDOW":t.data.pktData&&t.data.pktData.height&&(iframe=w(l),iframe.style.height=t.data.pktData.height+"px",iframe.firstChild.style.height=t.data.pktData.height+"px",c=t.data.pktData.height);break;case"RESPONSE":A(t.data.pktData),h(),d();break;case"CLOSE_IFRAME":h(),d()}}var f,v=function(t){var e=document.getElementById(t),n={position:"fixed",top:"0",left:"0",background:"#000",opacity:"0.6",filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)",minWidth:"100%",minHeight:"100%",zIndex:"999998"};if(!e)for(var i in(e=document.createElement("div")).id=t,n)e.style[i]=n[i];return e},w=function(t){var e,n=document.getElementById(t);if(n&&"IFRAME"===n.tagName?(n.id=t+"_inner",(e=document.createElement("div")).id=t,e.appendChild(n)):e=n,!e){var i=document.createElement("iframe");i.frameBorder=0,(e=document.createElement("div")).name="Accept UI Merchant Window.",e.id=t,e.appendChild(i)}return e},b=function(t){return"https://jstest.authorize.net/v3/acceptMain/acceptMain.html"},I=((f=function(){return f.any}).Android=!!navigator.userAgent.match(/Android/i),f.BlackBerry=!!navigator.userAgent.match(/BlackBerry/i),f.iOS=!!navigator.userAgent.match(/iPhone|iPad|iPod/i),f.Opera=!!navigator.userAgent.match(/Opera Mini/i),f.Windows=!!navigator.userAgent.match(/IEMobile/i),f.any=f.Android||f.BlackBerry||f.iOS||f.Opera||f.Windows,f),A=function(t){"function"==typeof i?i.call(null,t):window[i](t)};"complete"===document.readyState?t():document.onreadystatechange=function(){"complete"==document.readyState&&t()}}(window.AcceptUI=window.AcceptUI||{});