/* ASTx 1.3 | (C) Copyright AhnLab, Inc. | $Revision: 24253 $ */ var $ASTX2_CONST={ERROR_SUCCESS:0,ERROR_FAILED:101,ERROR_NOINIT:102,ERROR_NOTINST:103,ERROR_NOTSUPPORTED:104,ERROR_NOCONNECT:105,ERROR_NCK:106,ERROR_ERR:107,ERROR_NSP:108,ERROR_PARAM:109,ERROR_EXCESS:110,ERROR_NEEDUPDATE:111,OPTION_NONE2E:1,OPTION_AUTOFOCUS:2,OPTION_AUTOSETTEXT:4,OPTION_E2EFORM:8,OPTION_E2EFORM_NOENC:16,OPTION_E2EFORM_ALLTRIP:32,OPTION_E2EFORM_ONLY:64,OPTION_E2EFORM_TAGSET:128,OPTION_NONE2E_ALG:256,OPTION_NOSPTDUMMY:512,OPTION_FIXEDTYPE:1024,PROTECT_AK:1,PROTECT_FW:2,PROTECT_PB:4, PROTECT_PCS:8,SERVICE_AK:1,DEBUG_NOALIVE:1,LOCAL_INIT_HTTP:1,INTERVAL_ALIVE:5E3,E2ETYPE_EXCLUDE:-1,E2ETYPE_NONE:0,E2ETYPE_CERT1:1,E2ETYPE_CERT2:2,E2ETYPE_SDK:11,E2ETYPE_PLAIN1:21,E2ETYPE_PLAIN2:22,PAGEID:"",BROWSER_TYPE:"",BROWSER_VER:"",E2EFORM_TAIL:!0,E2EFORM_INIT:"_e2e_forminit",E2EFORM_TAG1:"_e2e_1__",E2EFORM_TAG2:"_e2e_2__",E2EFORM_TAG1_PWD:"_e2e_1_pwd__",E2EFORM_TAG2_PWD:"_e2e_2_pwd__",getErrno:function(a){return"NCK"==a?this.ERROR_NCK:"ERR"==a?this.ERROR_ERR:"NSP"==a?this.ERROR_NSP:this.ERROR_FAILED}, _get_browser_version:function(a){var b=0;if(0<=a.indexOf("Edge/")&&(b=parseInt(a.split("Edge/")[1]),0=b)return null;var c=a.getAttribute("e2e_type");if(null==c||0>=c)return null;var d=a.getAttribute("e2e_inputtype");if(null==d||0>=d)d="";var e={};e.e2e_inputid=b;e.e2e_type=c;e.e2e_inputtype=d;e.name=$_astxu.getnc(a.name);e.form=a.form?$_astxu.getnc(a.form.name): "";return e}function f(a){var b=e(a);if(null==b)return null;b.type=$_astxu.getnc(a.type);b.maxlength=$_astxu.getnc(a.getAttribute("maxlength"));b.txtmsk=$_astxu.getnc(a.getAttribute("e2e_txtmsk"));return b}function g(a,b){a.getAttribute("e2e_type")!=$ASTX2_CONST.E2ETYPE_PLAIN1&&(a.readOnly=b)}function h(a,b,c,d,e){1==l&&n(a,b,c,d,e)}function n(b,q,d,e,f){var g={};g.pageid=$ASTX2_CONST.PAGEID;if(null!=q)for(var h in q)q.hasOwnProperty(h)&&(g[h]=q[h]);a.send_e2e_cmd(b,g,d,e,f)}function m(a,b){var c= "";return c=0==$ASTX2_CONST.E2EFORM_TAIL?b+a:a+b}function s(a,b){var c="";return c="password"==a.type?b==$ASTX2_CONST.E2ETYPE_CERT2?m(a.name,$ASTX2_CONST.E2EFORM_TAG2_PWD):m(a.name,$ASTX2_CONST.E2EFORM_TAG1_PWD):b==$ASTX2_CONST.E2ETYPE_CERT2?m(a.name,$ASTX2_CONST.E2EFORM_TAG2):m(a.name,$ASTX2_CONST.E2EFORM_TAG1)}function C(){if(0!=D)for(var a=document.getElementsByTagName("form"),b=0;b=e)d=!0}else if(k&$ASTX2_CONST.OPTION_E2EFORM_ONLY){if(null==c)e=!1;else for(var e=!1,f=c.getElementsByTagName("input"),g=0;g$_astxu.getint(a.stsvr)?$ASTX2_COMM.errorAbort($ASTX2_CONST.ERROR_NEEDUPDATE):W());if(k&$ASTX2_CONST.OPTION_AUTOSETTEXT)for(var d in t)a= t[d],null!=a&&(0>=$_astxu.getnc(a.value).length||y(a))}else l=2},function(){l=2})}function L(a){if(0==$_astxu.hasFocused())return!1;if(0==l)return!0;if(1==l){if(!1===a)return;try{var b=document.activeElement;b&&x(b,!1)}catch(c){}return!0}l=0;k&$ASTX2_CONST.OPTION_NONE2E?(a=0,k&$ASTX2_CONST.OPTION_NONE2E_ALG&&(a=$ASTX2.mOptionStrings.none2e_alg),H({ver:1,svr:"_none2e",valg:a})):$_astxu.sendAjax({url:$ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_INIT),onSuccess:function(a){var b=$_astxu.getnc(a?a.result:""); $_astxu.isACK(b)?H(a):l=-1},onFailure:function(a,b){l=-1}});return!0}function p(a){if(null!=a&&(a.getAttribute("e2e_type")!=$ASTX2_CONST.E2ETYPE_PLAIN1||0!=w)){try{if(a!=document.activeElement)return}catch(b){}"number"==typeof a.selectionStart?a.selectionStart=a.selectionEnd=a.value.length:"undefined"!=typeof a.createTextRange&&(a=a.createTextRange(),a.collapse(!1),a.select())}}function x(a,b){u=!1;if(k&$ASTX2_CONST.OPTION_FIXEDTYPE&&a){var c=a.getAttribute("e2e_inputid");null!=c&&0=c)if(c=a.getAttribute("e2e"),"true"==c||"on"==c)c=$ASTX2_CONST.E2ETYPE_CERT1,a.setAttribute("e2e_type",c);else{c=$ASTX2_CONST.E2ETYPE_NONE;try{if("function"===typeof $ASTX2_CUST.isE2EObject&& 1==$ASTX2_CUST.isE2EObject(a)&&(c=$ASTX2_CONST.E2ETYPE_CERT1,a.setAttribute("e2e_type",c)),"function"===typeof $ASTX2_CUST.getE2Etype){var d=$ASTX2_CUST.getE2Etype(a);d&&(c=d,a.setAttribute("e2e_type",c))}}catch(e){}if(c==$ASTX2_CONST.E2ETYPE_NONE)return}b=++$;a.setAttribute("e2e_inputid",b);d=!0;k&$ASTX2_CONST.OPTION_AUTOSETTEXT&&0=l){var c=this;window.setTimeout(function(){c.checkService(a)},300)}else 1==l&&0==K?b.result=$ASTX2_CONST.ERROR_FAILED:2==l&&(b.result=$ASTX2_CONST.ERROR_FAILED),a(b)};this.getE2EelmsForm=function(a,b,c,d){for(var f=document.getElementsByTagName("input"),g=0;gf?g.send_e2e_cmd(a,b,c,d,e,f+1):e&&e()}})}},_send_alive:function(){var a={pageid:$ASTX2_CONST.PAGEID,focus:$_astxu.hasFocused()?1:0};$_astxu.sendJsonp({url:$ASTX2_COMM.mLocalServerURL+"/alive",data:a})},send_alive_run:function(){if(!($ASTX2_COMM.getDegugFlags()&$ASTX2_CONST.DEBUG_NOALIVE)){var a=this;setInterval(function(){a._send_alive()},$ASTX2_CONST.INTERVAL_ALIVE)}}, _hello_local_server:function(a,b,c,d,e){var f=this;if(d>=c.length)f.setLastError($ASTX2_CONST.ERROR_NOTINST),b();else{var g=c[d++],h="https://"+(1==$_astxu.isMacOS()?"lx.astxsvc.com":"127.0.0.1")+":"+g+"/ASTX2",g="",n=document.getElementsByTagName("script");if(n)for(var m=0;m=c.length)f.setLastError($ASTX2_CONST.ERROR_NOTINST),b();else{var g=c[d++],h=$_astxu.getHostPath()+$_astxu.getnc(window.location.pathname),g= "http://127.0.0.1:"+g+"/ASTX2/hello?rnd="+$_astxu.rnd()+"&url="+h,h=new Image;h.style.display="none";h.onload=function(){a()};h.onerror=function(){f._hello_local_server_http(a,b,c,d,e)};h.src=g}},init_http:function(a,b,c){function d(){a()}this.setLastError($ASTX2_CONST.ERROR_SUCCESS);var e=[55910,55910,55911,55912],f=this;null==c&&(c=750);setTimeout(function(){f._hello_local_server_http(d,b,e,0,c)},200)},_check_local_server_chk_stamp:function(a,b,c,d){var e=this;$_astxu.sendAjax({url:$ASTX2_CUST.getURL($ASTX2_CUST.URL_CHK_STAMP), data:d,onSuccess:function(c){c=$_astxu.getnc(c?c.result:"");$_astxu.isACK(c)?a():(e.setLastError($ASTX2_CONST.ERROR_NCK),b())},onFailure:function(a,c){b()}})},_check_local_server:function(a,b,c,d){var e=this;null==d&&(d=1);3=d)this.setLastError($ASTX2_CONST.ERROR_EXCESS),c();else{var f=this;this.getE2EData(a,function(a){b(a)},function(){f.getLastError()==$ASTX2_CONST.ERROR_NOINIT? window.setTimeout(function(){f.getE2EDataRetry(a,b,c,d-1,e)},e):c()})}},getE2EDataIDs:function(a,b,c){this.setLastError($ASTX2_CONST.ERROR_SUCCESS);if(0==this._e2e_enable())c();else{null==a&&(that.setLastError($ASTX2_CONST.ERROR_PARAM),c());var d=[],e=[],f=[],g=[];this.mE2EInst.getE2EelmsID(a,d,e,1);this.mE2EInst.getE2EelmsID(a,f,g,2);a={ids1:d.join(","),names1:e.join(","),ids2:f.join(","),names2:g.join(",")};this._e2edata(a,b,c)}},setE2EData:function(a,b,c,d){null==c&&(c=!0);null==d&&(d="");var e= $_astxu.getnc(b.e2e_data1);0=c||(0==g?e[a]=f:d=c,++d>=c&&b(e,g))})},setE2EText:function(a,b){this.mE2EInst.setE2EText(a,b)},clearE2EText:function(a, b){this.mE2EInst.clearE2EText(a,b)},clearE2EForm:function(a){for(var b=document.getElementsByTagName("input"),c=0;c=d)this.setLastError($ASTX2_CONST.ERROR_EXCESS),c();else{var f=this;this.getPCLOGData(a,function(a){b(a)},function(){f.getLastError()==$ASTX2_CONST.ERROR_NOINIT?window.setTimeout(function(){f.getPCLOGDataRetry(a,b,c,d-1,e)},e):c()})}},setPCLOGData:function(a,b){var c=$_astxu.getnc(b.pclog_data);0