/* ASTx 1.3 | (C) Copyright AhnLab, Inc. | $Revision: 15897 $ */ 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_E2EFORM:4,OPTION_E2EFORM_NOENC:8,OPTION_E2EFORM_ALLTRIP:16,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==k&&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 v(){if(0!=w)for(var a=document.getElementsByTagName("form"),b=0;b$_astxu.getint(a.stsvr)?$ASTX2_COMM.errorAbort($ASTX2_CONST.ERROR_NEEDUPDATE):Q())}else k=2},function(){k=2})}function F(a){if(0==$_astxu.hasFocused())return!1;if(0==k)return!0;if(1==k){if(!1===a)return;try{var b=document.activeElement;b&&t(b,!1)}catch(c){}return!0}k= 0;l&$ASTX2_CONST.OPTION_NONE2E?z({ver:1,svr:"_none2e",valg:0}):$_astxu.sendAjax({url:$ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_INIT),onSuccess:function(a){var b=$_astxu.getnc(a?a.result:"");$_astxu.isACK(b)?z(a):k=-1},onFailure:function(a,b){k=-1}});return!0}function p(a){if(null!=a&&(a.getAttribute("e2e_type")!=$ASTX2_CONST.E2ETYPE_PLAIN1||"EG"==$ASTX2_CONST.BROWSER_TYPE)){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 t(a,b){r=!1;var c=f(a);null!=c&&(!0===b&&F(!1),h("e2e_focus",c,null,function(b){g(a,!1);window.setTimeout(function(){p(a)},1)},function(){}))}function G(a){a=b(a);null!=a&&t(a,!0)}function H(a){a=b(a);if(null!=a){var c=e(a);null!=c&&(g(a,!0),h("e2e_blur",c))}}function I(a){var c=b(a);null!=c&&window.setTimeout(function(){p(c)},1)}function J(a){var b=f(a);null!=b&&(a=$_astxu.getnc(a.value),b.text=a,h("e2e_settext", b,null,function(a){},function(){}))}function K(){"function"===typeof event.preventDefault&&event.preventDefault();"function"===typeof event.stopPropagation&&event.stopPropagation()}function R(a,b,c){h("e2e_gettext",b,null,function(b){var c=$_astxu.getnc(b?b.result:"");$_astxu.isACK(c)&&(b=$_astxu.getnc(b.text),a.value=b)},function(){})}function S(a,b){l&$ASTX2_CONST.OPTION_E2EFORM_NOENC&&(b.noenc=1);h("e2e_formget",b,null,function(c){var d=$_astxu.getnc(c?c.result:"");if(0==$_astxu.isACK(d))$_astxu.msg("[e2e_formget] "+ b.name+",result="+d);else if(d=a.form,null!=d){var e;e="password"==a.type?b.e2e_type==$ASTX2_CONST.E2ETYPE_CERT2?m(b.name,$ASTX2_CONST.E2EFORM_TAG2_PWD):m(b.name,$ASTX2_CONST.E2EFORM_TAG1_PWD):b.e2e_type==$ASTX2_CONST.E2ETYPE_CERT2?m(b.name,$ASTX2_CONST.E2EFORM_TAG2):m(b.name,$ASTX2_CONST.E2EFORM_TAG1);var f=!1;l&$ASTX2_CONST.OPTION_E2EFORM_ALLTRIP&&(f=!0);if(d=$_astxu.getCreatedFormValue(d,e,f))d.value=$_astxu.getnc(c.e2e_data)}},function(){})}function L(a){var c=b(a);if(null!=c){var e=f(c);if(null!= e){var g=$_astxu.getKeyCode(a);17==g&&(r=!0);if(1==r)return 86==g&&(c.value="",h("e2e_clear",e)),K(),!1;if(1==(16==g||17==g||18==g?!0:!1))return!0;var s=!0;1!=C||"text"!=c.type&&e.e2e_type!=$ASTX2_CONST.E2ETYPE_PLAIN1||0!=D||(R(c,e,a),0==(8==g||9==g||13==g||20==g?!0:!1)&&(K(),s=!1));l&$ASTX2_CONST.OPTION_E2EFORM&&(e.e2e_type!=$ASTX2_CONST.E2ETYPE_CERT1&&e.e2e_type!=$ASTX2_CONST.E2ETYPE_CERT2||S(c,e));return 1==s&&"function"===typeof $ASTX2_CUST.onHandlerKeyDown&&0==$ASTX2_CUST.onHandlerKeyDown(c, a)?!1:s}}}function M(a){var c=b(a);null!=c&&(17==$_astxu.getKeyCode(a)&&(r=!1),1==B&&J(c),window.setTimeout(function(){p(c)},1))}function N(a){if("IE"==$ASTX2_CONST.BROWSER_TYPE||"EG"==$ASTX2_CONST.BROWSER_TYPE){var c=b(a);null!=c&&""!=c.value&&setTimeout(function(){if(""==c.value){var a=e(c);null!=a&&h("e2e_clear",a)}},1)}}function O(a){var c=b(a);null!=c&&("number"==typeof c.selectionStart?(c.selectionStart=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=++V;a.setAttribute("e2e_inputid",b);a.value="";a.setAttribute("autocomplete","off");g(a,!0);$_astxu.addEvent(a,"focus",G);$_astxu.addEvent(a,"blur",H);$_astxu.addEvent(a,"click",I);$_astxu.addEvent(a,"keyup",M);$_astxu.addEvent(a, "keydown",L);$_astxu.addEvent(a,"select",O);$_astxu.addEvent(a,"mouseup",N);l&$ASTX2_CONST.OPTION_E2EFORM&&(c==$ASTX2_CONST.E2ETYPE_CERT1||c==$ASTX2_CONST.E2ETYPE_CERT2)&&(d=a.form,null!=d&&(a="password"==a.type?c==$ASTX2_CONST.E2ETYPE_CERT2?m($_astxu.getnc(a.name),$ASTX2_CONST.E2EFORM_TAG2_PWD):m($_astxu.getnc(a.name),$ASTX2_CONST.E2EFORM_TAG1_PWD):c==$ASTX2_CONST.E2ETYPE_CERT2?m($_astxu.getnc(a.name),$ASTX2_CONST.E2EFORM_TAG2):m($_astxu.getnc(a.name),$ASTX2_CONST.E2EFORM_TAG1),c=!1,l&$ASTX2_CONST.OPTION_E2EFORM_ALLTRIP&& (c=!0),$_astxu.getCreatedFormValue(d,a,c)))}}};this.subObject=function(a){var b=e(a);if(null!=b){$_astxu.removeEvent(a,"focus",G);$_astxu.removeEvent(a,"blur",H);$_astxu.removeEvent(a,"click",I);$_astxu.removeEvent(a,"keyup",M);$_astxu.removeEvent(a,"keydown",L);$_astxu.removeEvent(a,"select",O);$_astxu.removeEvent(a,"mouseup",N);try{a==document.activeElement&&h("e2e_blur",b)}catch(c){}a.value="";a.setAttribute("e2e_inputid",-1);a.setAttribute("e2e_type",-1);g(a,!1)}};this.getE2EHash=function(a,b){var c= e(a);null==c?b(null,$ASTX2_CONST.ERROR_PARAM):h("e2e_gethash",c,null,function(a){var c=$_astxu.getnc(a?a.result:"");$_astxu.isACK(c)?b($_astxu.getnc(a.hash),$ASTX2_CONST.ERROR_SUCCESS):b(null,$ASTX2_CONST.ERROR_NCK)},function(){b(null,$ASTX2_CONST.ERROR_FAILED)})};this.getE2EText=function(a,b){var c=e(a);null==c?b(null,$ASTX2_CONST.ERROR_PARAM):c.e2e_type!=$ASTX2_CONST.E2ETYPE_PLAIN2?b(null,$ASTX2_CONST.ERROR_PARAM):h("e2e_gettext",c,null,function(a){var c=$_astxu.getnc(a?a.result:"");$_astxu.isACK(c)? b($_astxu.getnc(a.text),$ASTX2_CONST.ERROR_SUCCESS):b(null,$ASTX2_CONST.ERROR_NCK)},function(){b(null,$ASTX2_CONST.ERROR_FAILED)})};this.setE2EText=function(a){J(a)};this.clearE2EText=function(a){var b=e(a);null!=b&&(a.value="",h("e2e_clear",b))};this.dettach=function(){h("e2e_uninit");u=!1};this.isAttached=function(){return u};this.isStarted=function(){return 1==k?!0:!1};this.checkService=function(a){var b={};b.service=$ASTX2_CONST.SERVICE_AK;b.result=$ASTX2_CONST.ERROR_SUCCESS;if(0>=k){var c=this; window.setTimeout(function(){c.checkService(a)},300)}else 1==k&&0==E?b.result=$ASTX2_CONST.ERROR_FAILED:2==k&&(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";$_astxu.sendJsonp({url:h+"/hello",timeout:e,onSuccess:function(c){c=$_astxu.getnc(c?c.result:"");$_astxu.isACK(c)?($ASTX2_COMM.mLocalServerURL=h,a()):(f.setLastError($ASTX2_CONST.ERROR_NOTINST),b())},onFailure:function(){f._hello_local_server(a,b,c,d,e)}})}},setOption:function(a){null!=a&&(!0===a.autofocus&&(this.mOption|=$ASTX2_CONST.OPTION_AUTOFOCUS),!0===a.e2eform&&(this.mOption|=$ASTX2_CONST.OPTION_E2EFORM),!1===a.e2eform_enc&& (this.mOption|=$ASTX2_CONST.OPTION_E2EFORM_NOENC),!0===a.e2eform_alltrip&&(this.mOption|=$ASTX2_CONST.OPTION_E2EFORM_ALLTRIP))},_get_custom_value:function(){"undefined"!==typeof $ASTX2_CUST.mUseJQuery&&($ASTX2.mUseJQuery=$ASTX2_CUST.mUseJQuery);"undefined"!==typeof $ASTX2_CUST.E2EFORM_TAIL&&($ASTX2_CONST.E2EFORM_TAIL=$ASTX2_CUST.E2EFORM_TAIL);"undefined"!==typeof $ASTX2_CUST.E2EFORM_INIT&&($ASTX2_CONST.E2EFORM_INIT=$ASTX2_CUST.E2EFORM_INIT);"undefined"!==typeof $ASTX2_CUST.E2EFORM_TAG1&&($ASTX2_CONST.E2EFORM_TAG1= $ASTX2_CUST.E2EFORM_TAG1);"undefined"!==typeof $ASTX2_CUST.E2EFORM_TAG2&&($ASTX2_CONST.E2EFORM_TAG2=$ASTX2_CUST.E2EFORM_TAG2);"undefined"!==typeof $ASTX2_CUST.E2EFORM_TAG1_PWD&&($ASTX2_CONST.E2EFORM_TAG1_PWD=$ASTX2_CUST.E2EFORM_TAG1_PWD);"undefined"!==typeof $ASTX2_CUST.E2EFORM_TAG2_PWD&&($ASTX2_CONST.E2EFORM_TAG2_PWD=$ASTX2_CUST.E2EFORM_TAG2_PWD)},init:function(a,b,c){function d(){a();if(1==$_astxu.isMacLinuxOS()){e.send_alive_run();try{$ASTX2_ML.init()}catch(b){}}}this.setLastError($ASTX2_CONST.ERROR_SUCCESS); if(1==$ASTX2_COMM.isEnable())a();else if($ASTX2_COMM.getLocalFlags("init_http")==$ASTX2_CONST.LOCAL_INIT_HTTP)this.init_http(a,b,c);else{this._get_custom_value();1==$ASTX2.mUseJQuery&&"undefined"===typeof jQuery&&($ASTX2.mUseJQuery=!1);var e=this;this.mE2EInst=$ASTX2_E2E.getInstance(this);this.mE2EInst.setOption(this.mOption);var f=[55920,55920,55920,55921,55922];null==c&&(c=750);setTimeout(function(){e._hello_local_server(d,b,f,0,c)},200)}},_hello_local_server_http: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=$_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=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