var __certselect=function(a){var W=function(e){function x(){if(!a.certsList)return null;var c=a.certsList,b=c.list.length,f=[],d=[],h=e.args.dn,g=null;null!=a.ESVS.Policy&&(-1!=a.ESVS.Policy.indexOf("|")?g=a.ESVS.Policy.split("|"):(g=[],g[0]=a.ESVS.Policy));var k=null;null!=a.ESVS.Organization&&(-1!=a.ESVS.Organization.indexOf("|")?k=a.ESVS.Organization.split("|"):(k=[],k[0]=a.ESVS.Organization));for(var m=0;mc||0>b||!f)return-1;var g=0,k=0;v=b;a.certsList&&(a.certsList=null);l=!0;if(a.CONST.__PF_M_LS.device===c&&2&a.ESVS.Mode){a.PFSH||h(-1);try{a.PFSH.SelectStorage(1)}catch(D){h(-1)}try{a.PFSH.LoadAllCerts(document.domain)}catch(D){301E5===D.code&&(a.PFSH.InstallCACerts(document.domain),a.PFSH.LoadAllCerts(document.domain))}b=null;try{b=a.PFSH.GetUserCerts(document.domain),a.PFUC=b}catch(D){g=0}b&&(g=b.length-1);if(0n.selectedIndex())return a.uiUtil().msgBox(b.IDS_MSGBOX_COMMON_ERROR_NO_SELECTED_CERT),!1;var f=a.loadUI("certverify")({type:null,args:{idx:parseInt(n.selectedIndex())},onConfirm:function(){f.dispose();c.focus()},onCancel:function(){f.dispose();c.focus()}});f.show();a.uiUtil().loadingBox(!1,"us-div-list-load");return!0}function F(c,b){if(!c||!b)return!1;if(!a.certsList||0>n.selectedIndex())return a.uiUtil().msgBox(b.IDS_MSGBOX_COMMON_ERROR_NO_SELECTED_CERT),!1;var f=a.loadUI("certview")({type:null,args:{type:"Base64",idx:parseInt(n.selectedIndex()),cert:a.certsList.list[parseInt(n.selectedIndex())-1].cert},onConfirm:function(){f.dispose();c.focus()},onCancel:function(){f.dispose();c.focus()}});f.show();a.uiUtil().loadingBox(!1,"us-div-list-load");return!0}function la(c){if(!c)return!1;var b="https://raadmin.crosscert.com/customer/tk/Main.jsp?";if(4<=a.ESVS.Mode)if(a.nimservice()){var f=a.usWebToolkit.util.encode64(document.URL);a.nimservice().EncryptDataWithSymmKey("SEED","mOdFccVPHK7xnZYc",f,"utf-8",!1,function(c,f,g){0==c&&(b+="&Y3Jvc3NjZXJ0=",b+=g);"firefox"==a.browserName?window.open(b,"crosscert_url","scrollbars=1"):window.open(b)})}else"firefox"==a.browserName?window.open(b,"crosscert_url","scrollbars=1"):window.open(b);else"firefox"==a.browserName?window.open(b,"crosscert_url","scrollbars=1"):window.open(b);c.focus()}function ma(c){if(!c)return!1;var b=document.getElementById("us-div-cert-select");b.style.display="none";var f=a.loadUI("certmanage")({type:"CERT_MANAGEMENT",args:{style:"child"},onCancel:function(){f.dispose();b.style.display="block";var d=document.getElementById("us-div-cert-select");switch(m){case a.CONST.__USFB_M_DISK.device:X(d,t);break;case a.CONST.__USFB_M_MOBILE.device:Y(d,t);break;case a.CONST.__USFB_M_HDD.device:Z(d,t);break;case a.CONST.__PF_M_LS.device:aa(d,t);break;case a.CONST.__PF_M_SS.device:K(d,t);break;case a.CONST.__USFB_M_MOBILETOKEN.device:case a.CONST.__USFB_M_SECUREDISK.device:case a.CONST.__USFB_M_HSMKEY.device:case a.CONST.__USFB_M_SMARTCARD.device:case a.CONST.__PF_M_CLOUDSIGN.device:break;default:M(d,t)}c.focus()}});f.show()}function ba(c,b,f,d){if(a.CONST.__USFB_M_DISK.device>c||!b||!f||!d)return l=!1;var h=a.loadUI("driveselect")({type:"DEVICE_REMOVABLE_DISK",args:b,onConfirm:function(g){g=b.list[g-1].index;0c||!f||!d)return l=!1;var h=a.loadUI("sectokenselect")({type:c,args:b,onConfirm:function(g){var k=b.list[g-1].name;if(0==a.ESVS.IssueCertInBIOToken&&("CERT_RENEWAL_KMCERT"===e.type||"CERT_RENEWAL"===e.type||"CERT_RENEWAL_SIGN"===e.type||"CERT_REVOCATION"===e.type||"CERT_SOE"===e.type)&&c==a.CONST.__USFB_M_HSMKEY.device&&-1!=k.indexOf("BIO_"))return a.uiUtil().errMsgBox(d.IDS_CANT_ISSUECERT_BIOTOKEN,-1),l=!1;0c||!b||!f||!d)return l=!1;var h=a.loadUI("driveselect")({type:"DEVICE_SAVE_TOKEN",args:b,onConfirm:function(b){h.dispose();a.nimservice()?a.nimservice().CheckSCardConnected(function(b,h){0===b?(PINDialog=a.loadUI("pin")({type:"PIN_SAVE_TOKEN",args:null,onConfirm:function(b){a.ESVS.Embedded?setTimeout(function(){PINDialog.dispose()},10):PINDialog.dispose();a.nimservice().CheckSCardPin(b,function(h,g){if(0!=h){switch(h){case 4904E4:a.uiUtil().msgBox(d.IDS_MSGBOX_PW_ERROR_INPUT_WRONG_SAVE_TOKEN_PIN);break;case 4905E4:a.uiUtil().msgBox(d.IDS_MSGBOX_PW_ERROR_SAVE_TOKEN_PIN_LOCKED);break;default:a.uiUtil().errMsgBox(d.IDS_MSGBOX_PW_ERROR_INPUT_WRONG_SAVE_TOKEN_PIN,h)}n.redrawList(null,0);l=!1;setTimeout(function(){f.focus()},10)}else w(c,0,d,b,function(b){0!=b?(a.uiUtil().errMsgBox(d.IDS_MSGBOX_COMMON_ERROR_GET_CERT,b),n.redrawList(null,0)):(b=x())?n.redrawList(b.list,b.list.length):n.redrawList(null,0);l=!1;setTimeout(function(){f.focus()},10)})})},onCancel:function(){l=!1;PINDialog.dispose();a.uiUtil().loadingBox(!1,"us-div-list-load");setTimeout(function(){f.focus()},10)}}),PINDialog.show()):(l=!1,a.uiUtil().msgBox(d.IDS_MSGBOX_SMART_CARD_UNCONNECTED),a.uiUtil().loadingBox(!1,"us-div-list-load"),setTimeout(function(){f.focus()},10))}):(l=!1,a.uiUtil().msgBox(d.IDS_MSGBOX_NIM_ERROR_UNLOAD),a.uiUtil().loadingBox(!1,"us-div-list-load"),setTimeout(function(){f.focus()},10))},onCancel:function(){l=!1;h.dispose();a.uiUtil().loadingBox(!1,"us-div-list-load");f.focus()}});h.show()}function K(c,b){if(!c||!b)return l=!1;m=a.CONST.__PF_M_SS.device;v=0;a.certsList&&(a.certsList=null);n.redrawList(null,-1);if("CERT_SELECT"!=e.type&&(I(b),B(),"MPKI"==a.ESVS.PKI)){c=document.getElementById("us-lbl-pw");var f=document.getElementById("us-lbl-pw2"),d=document.getElementById("us-pw-text");c.disabled=!1;f.disabled=!1;d.readOnly=!1;d.disabled=!1}a.uiUtil().loadingBox(!0,"us-div-list-load",0);setTimeout(function(){w(a.CONST.__PF_M_SS.device,0,b,"",function(c){if(0!=c)return a.uiUtil().errMsgBox(b.IDS_MSGBOX_COMMON_ERROR_GET_CERT,c),n.redrawList(null,0),l=!1;(c=x())?n.redrawList(c.list,c.list.length):n.redrawList(null,0);l=!1})},0)}function aa(c,b){if(!c||!b)return l=!1;m=a.CONST.__PF_M_LS.device;v=0;a.certsList&&(a.certsList=null);n.redrawList(null,-1);"CERT_SELECT"!=e.type&&(I(b),B());a.uiUtil().loadingBox(!0,"us-div-list-load",0);setTimeout(function(){w(a.CONST.__PF_M_LS.device,0,b,"",function(c){a.uiUtil().loadingBox(!1,"us-div-list-load",0);if(0!=c)return a.uiUtil().errMsgBox(b.IDS_MSGBOX_COMMON_ERROR_GET_CERT,c),n.redrawList(null,0),l=!1;(c=x())?n.redrawList(c.list,c.list.length):n.redrawList(null,0);l=!1})},10)}function ca(c,b){if(!c||!b)return l=!1;m=a.CONST.__PF_M_CLOUDSIGN.device;v=0;a.certsList&&(a.certsList=null);n.redrawList(null,-1);I(b);da("123456789012345678901234567890");w(a.CONST.__PF_M_CLOUDSIGN.device,0,b,"",function(c){if(0!=c)return a.uiUtil().errMsgBox(b.IDS_MSGBOX_COMMON_ERROR_GET_CERT,c),n.redrawList(null,0),l=!1;(c=x())?n.redrawList(c.list,c.list.length):n.redrawList(null,0);l=!1})}function Z(c,b){if(!c||!b)return l=!1;m=a.CONST.__USFB_M_HDD.device;v=0;a.certsList&&(a.certsList=null);n.redrawList(null,-1);"CERT_SELECT"!=e.type&&(I(b),B());if("MPKI"==a.ESVS.PKI){c=document.getElementById("us-lbl-pw");var f=document.getElementById("us-lbl-pw2"),d=document.getElementById("us-pw-text");c.disabled=!0;f.disabled=!0;d.readOnly=!0;d.disabled=!0}w(a.CONST.__USFB_M_HDD.device,0,b,"",function(c){if(0!=c)return a.uiUtil().errMsgBox(b.IDS_MSGBOX_COMMON_ERROR_GET_CERT,c),n.redrawList(null,0),l=!1;(c=x())?n.redrawList(c.list,c.list.length):n.redrawList(null,0);l=!1;return!0})}function X(c,b){if(!c||!b)return l=!1;l=!0;var f=null;m=a.CONST.__USFB_M_DISK.device;v=0;a.certsList&&(a.certsList=null);n.redrawList(null,-1);"CERT_SELECT"!=e.type&&(I(b),B());if(4&a.ESVS.Mode&&!a.uiUtil().isItPFDevice(m))if(null!=a.Whale()&&O)a.Whale().getDiskList(function(d,h,g){h=0;g&&(h=g.length);if(0==d&&0=c.length)return!1;var b=document.getElementById("us-pw-text");b.value=c;b.readOnly=!0;b.disabled=!0;if(m==a.CONST.__PF_M_CLOUDSIGN.device||"CERT_SELECT"==e.type)document.getElementById("us-div-pw").style.display="none";return!0}function B(){m!=a.CONST.__PF_M_CLOUDSIGN.device&&(document.getElementById("us-div-pw").style.display="block");var c=document.getElementById("us-pw-text");c&&(c.value="",c.readOnly=!1,c.disabled=!1)}function ta(c,b,f){if(!c||!b||!f)return!1;var d=0,e={};try{var g=a.PFSH.SetP12OnMemory(c,b);d=g.index;a.PFUC=e=g.aluc}catch(k){switch(k.code){case 1E7:0<=k.detail.indexOf("115010")?a.uiUtil().msgBox(f.IDS_MSGBOX_PW_ERROR_PASSWORD_IS_NOT_MATCHED):a.uiUtil().errMsgBox(f.IDS_MSGBOX_COMMON_ERROR_GET_CERT,k.detail);break;default:a.uiUtil().errMsgBox(f.IDS_MSGBOX_COMMON_ERROR_GET_CERT,k.code)}return!1}a.certsList&&(a.certsList=null);c=[];b={};b.index=d;b.cert=e[d].signcert;c[0]=b;a.certsList={list:c};if(d=x())return n.redrawList(d.list,d.list.length),!0;a.certsList=null;n.redrawList(null,-1);B();return!1}function P(){a.certsList&&(a.certsList=null);n.redrawList(null,-1);B();pw=""}function ea(c,b,f,d){(null==b||0>=b.length||null==f)&&d(-1);a.certsList&&(a.certsList=null);if(0=c.length||null==b||0>=b.length||null==f)&&d(-1);a.nimservice()?a.nimservice().GetPfxCertList(1,c,b,function(c,e,k){0==c?ea(k,b,f,function(c){0==c?d(0):d(-1);b="";a.uiUtil().loadingBox(!1,"us-div-list-load")}):(a.uiUtil().errMsgBox(e,c),P(),d(0),a.uiUtil().loadingBox(!1,"us-div-list-load"))}):(a.uiUtil().msgBox(f.IDS_MSGBOX_NIM_ERROR_UNLOAD),b="",d(-1))}function S(c,b,e,d){(null==c||0>=c.length||null==b||0>=b.length||null==e)&&d(-1);4<=a.ESVS.Mode&&!a.uiUtil().isItPFDevice(m)?a.nimservice()?a.nimservice().GetPfxCertList(0,c,b,function(c,f,k){0==c?ea(k,b,e,function(c){0==c?d(0):d(-1);b="";a.uiUtil().loadingBox(!1,"us-div-list-load")}):(a.uiUtil().errMsgBox(f,c),P(),d(-1),a.uiUtil().loadingBox(!1,"us-div-list-load"))}):(a.uiUtil().msgBox(e.IDS_MSGBOX_NIM_ERROR_UNLOAD),d(-1)):(rv=ta(c,b,e),b="")}function r(){e.onConfirm=fa;T=!1}function va(c){function b(){ha++;if(ha>=a.ESVS.LimitNumOfTimesToTryToInputPW)if(a.ESVS.Embedded)a.bsUtil().AhnlabClearText("us-pw-text"),h.value="",setTimeout(function(){h.focus()},10);else{var b=d.IDS_MSGBOX_PW_ERROR_OVER_NUMBER_OF_ALLOWED_BEFORE+a.ESVS.LimitNumOfTimesToTryToInputPW+d.IDS_MSGBOX_PW_ERROR_OVER_NUMBER_OF_ALLOWED_AFTER;a.uiUtil().msgBox(b);if("DIGITAL_SIGNATURE_P7"===e.type){var c=a.certsList.list[u-1].cert;(!c||0>=c.length)&&L();c=a.certUtil().getTheCertAttributes(c,"Base64");f(b,null,c,-1,"",m)}else L(!0)}else a.bsUtil().AhnlabClearText("us-pw-text"),h.value="",setTimeout(function(){h.focus()},10)}n.restoreOnMouseEvent();if(!c)return!1;var f=e.onConfirm;if(0==T)fa=e.onConfirm,T=!0;else return!1;e.onConfirm=function(){};var d=c,h=document.getElementById("us-pw-text"),g=h.value;if(m==a.CONST.__USFB_M_ETC.device&&("CERT_RENEWAL_KMCERT"===e.type||"CERT_RENEWAL"===e.type||"CERT_RENEWAL_SIGN"===e.type||"CERT_REVOCATION"===e.type||"CERT_SOE"===e.type))return a.uiUtil().errMsgBox(d.IDS_CANT_WORK_WITH_PFX,-1),r(),!1;g&&4&a.ESVS.Mode&&("touchen"==a.ESVS.SecureKeyboardType&&a.bsUtil().isTouchEnKeyUsable()?g=a.bsUtil().GetEncryptPwd("us-keyboard-secure-frm","us-pw-text"):"ahnlab"==a.ESVS.SecureKeyboardType&&a.bsUtil().isAhnlabProtectorUsable()&&(g=a.bsUtil().GetAhnlabEncInputInfo("us-pw-text")));if(a.CONST.__USFB_M_MOBILETOKEN.device!=m&&(!a.certsList||0>n.selectedIndex()))return a.uiUtil().msgBox(d.IDS_MSGBOX_COMMON_ERROR_NO_SELECTED_CERT),h.value="",setTimeout(function(){h.focus()},10),r(),!1;if(4&a.ESVS.Mode&&!a.uiUtil().isItPFDevice(m)){var k=function(){var b=parseInt(n.selectedIndex());if("DIGITAL_SIGNATURE_P7"===e.type){var q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;var k=a.certUtil().getTheCertAttributes(q,"Base64");f(d.IDS_MSGBOX_SIGN_ERROR,q,k,b,g,m)}else if("DIGITAL_SIGNATURE_P7_EXT"===e.type||"DIGITAL_SIGNATURE_P7_EXT_DISABLE_SECTOKEN"==e.type)f(d.IDS_MSGBOX_SIGN_ERROR,b,g,m,v);else if("DIGITAL_SIGNATURE_P7_XML"===e.type){q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;k=a.certUtil().getTheCertAttributes(q,"Base64");f(d.IDS_MSGBOX_SIGN_ERROR,k,b,g,m,q)}else if("DIGITAL_SIGNATURE_P1"===e.type){q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;a.usWebToolkit.x509Certificate.parser(q,"Base64");k=a.usWebToolkit.x509Certificate.getSubjectName();if(!k||0>=k.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-2),r(),!1;f(q,k,d.IDS_MSGBOX_SIGN_ERROR,b,g,m)}else if("CERT_RENEWAL"==e.type||"CERT_RENEWAL_KMCERT"==e.type){q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_RENEW_ERROR,-1),r(),!1;a.usWebToolkit.x509Certificate.parser(q,"Base64");var l=a.usWebToolkit.x509Certificate.getNotAfter();if(!l||0>=l.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_RENEW_ERROR,-2),r(),!1;"CERT_RENEWAL"==e.type?f(l,c.IDS_CONFIRMBOX_CERT_RENEWAL,m,v,b,g):f(l,c.IDS_CONFIRMBOX_KMCERT_ISSUE,m,v,b,g)}else if("CERT_REVOCATION"==e.type){q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;k=a.certUtil().getTheCertAttributes(q,"Base64");f(d.IDS_CONFIRMBOX_CERT_REVOCATION,b,g,m,v,k)}else if("CERT_SOE"==e.type){q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;k=a.certUtil().getTheCertAttributes(q,"Base64");f(d.IDS_CONFIRMBOX_CERT_SOE,b,g,m,v,k)}else if("DIGITAL_SIGNATURE_P7_AND_VID_VERIFICATION"===e.type||"DIGITAL_SIGNATURE_P1_AND_VID_VERIFICATION"==e.type){l={signErr:d.IDS_MSGBOX_SIGN_ERROR,verifySuc:d.IDS_MSGBOX_VID_SUCCESS_VERIFICATION,verifyErr:d.IDS_MSGBOX_VID_ERROR_VERIFICATION};q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;k=a.certUtil().getTheCertAttributes(q,"Base64");f(b,g,l,q,k,m);h.value=""}else if("DIGITAL_SIGNATURE_P7_FILE"===e.type){q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;k=a.certUtil().getTheCertAttributes(q,"Base64");f(b,g,d.IDS_MSGBOX_SIGN_ERROR,d.IDS_CONFIRMBOX_FILE_ALREADY_EXIT,k,m)}else if("ENCRYPT_P7"==e.type)f(b,g,d.IDS_MSGBOX_ENCRYPT_ERROR);else if("VID_VERIFICATION"===e.type){q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;k=a.certUtil().getTheCertAttributes(q,"Base64");f(b,g,d.IDS_MSGBOX_VID_SUCCESS_VERIFICATION,d.IDS_MSGBOX_VID_ERROR_VERIFICATION,"NIM",q,k,m)}else if("CERT_RENEWAL_SIGN"==e.type){q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_RENEW_ERROR,-1),r(),!1;a.usWebToolkit.x509Certificate.parser(q,"Base64");l=a.usWebToolkit.x509Certificate.getNotAfter();if(!l||0>=l.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_RENEW_ERROR,-2),r(),!1;k=a.certUtil().getTheCertAttributes(q,"Base64");f(l,c.IDS_CONFIRMBOX_CERT_RENEWAL,m,v,b,g,k)}else if("CERT_SELECT"===e.type){q=a.certsList.list[b-1].cert;if(!q||0>=q.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;k=a.certUtil().getTheCertAttributes(q,"Base64");f(d.IDS_MSGBOX_SIGN_ERROR,q,k,b,"",m,N)}else f()};if(null==a.Whale()&&!a.nimservice())return r(),!1;if(a.CONST.__USFB_M_MOBILETOKEN.device==m){if("DIGITAL_SIGNATURE_P7"===e.type)f(d.IDS_MSGBOX_SIGN_ERROR,null,null,-1,"",m);else if("DIGITAL_SIGNATURE_P7_EXT"===e.type||"DIGITAL_SIGNATURE_P7_EXT_DISABLE_SECTOKEN"==e.type)f(d.IDS_MSGBOX_SIGN_ERROR,-1,"",m,v);else if("DIGITAL_SIGNATURE_P1"===e.type)f(null,"",d.IDS_MSGBOX_SIGN_ERROR,-1,"",m);else if("CERT_RENEWAL"==e.type)f("",c.IDS_CONFIRMBOX_CERT_RENEWAL,m,v,-1,"");else if("CERT_RENEWAL_KMCERT"==e.type)f("",c.IDS_CONFIRMBOX_KMCERT_ISSUE,m,v,-1,"");else if("CERT_RENEWAL_SIGN"==e.type)f("",c.IDS_CONFIRMBOX_CERT_RENEWAL,m,v,-1,"",null);else if("CERT_REVOCATION"==e.type)f(d.IDS_CONFIRMBOX_CERT_REVOCATION,-1,"",m,v);else if("DIGITAL_SIGNATURE_P7_AND_VID_VERIFICATION"===e.type||"DIGITAL_SIGNATURE_P1_AND_VID_VERIFICATION"===e.type){var l={signErr:d.IDS_MSGBOX_SIGN_ERROR,verifySuc:d.IDS_MSGBOX_VID_SUCCESS_VERIFICATION,verifyErr:d.IDS_MSGBOX_VID_ERROR_VERIFICATION};f(-1,"",l,null,null,m)}else"DIGITAL_SIGNATURE_P7_FILE"===e.type?f(-1,"",d.IDS_MSGBOX_SIGN_ERROR,d.IDS_CONFIRMBOX_FILE_ALREADY_EXIT,null,m):"ENCRYPT_P7"==e.type?f(-1,g,d.IDS_MSGBOX_ENCRYPT_ERROR):"VID_VERIFICATION"===e.type?f(-1,"",d.IDS_MSGBOX_VID_SUCCESS_VERIFICATION,d.IDS_MSGBOX_VID_ERROR_VERIFICATION,"NIM"):"DIGITAL_SIGNATURE_P7_XML"===e.type?f(d.IDS_MSGBOX_SIGN_ERROR,null,-1,"",m,null):"CERT_SOE"==e.type?f(d.IDS_CONFIRMBOX_CERT_SOE,-1,"",m,v):"ENCRYPT_P7"==e.type?f(-1,"",d.IDS_MSGBOX_ENCRYPT_ERROR):f();h.value="";a.ESVS.Embedded&&B();return!0}var u=parseInt(n.selectedIndex());if(a.CONST.__USFB_M_HDD.device!=m&&a.CONST.__USFB_M_DISK.device!=m||null==a.Whale()||!O){if("MPKI"==a.ESVS.PKI||m==a.CONST.__USFB_M_ETC.device||m==a.CONST.__USFB_M_HSMKEY.device||"CERT_RENEWAL"!=e.type&&"CERT_RENEWAL_SIGN"!=e.type&&"CERT_RENEWAL_KMCERT"!=e.type&&"CERT_REVOCATION"!==e.type&&"CERT_SOE"!==e.type&&"DIGITAL_SIGNATURE_P1"!==e.type&&"DIGITAL_SIGNATURE_P7"!==e.type&&"DIGITAL_SIGNATURE_P7_EXT"!=e.type&&"DIGITAL_SIGNATURE_P7_EXT_DISABLE_SECTOKEN"!=e.type&&"DIGITAL_SIGNATURE_P7_AND_VID_VERIFICATION"!==e.type&&"DIGITAL_SIGNATURE_P1_AND_VID_VERIFICATION"!==e.type&&"VID_VERIFICATION"!==e.type)k();else{if(!g||0>=g.length)return a.uiUtil().msgBox(d.IDS_MSGBOX_PW_ERROR_PLEASE_INPUT_PASSWORD),setTimeout(function(){h.focus()},10),r(),!1;a.nimservice().CheckPassword(m,v,u,g,!1,function(c,e){if(0==c)return k(),h.value="",a.ESVS.Embedded&&B(),!0;r();"Enabled"===a.ESVS.UniCRS?a.uiUtil().errMsgBox(d.IDS_MSGBOX_PW_ERROR_PASSWORD_IS_NOT_MATCHED_URS,c):a.uiUtil().msgBox(""==e?d.IDS_MSGBOX_PW_ERROR_PASSWORD_IS_NOT_MATCHED:e);b();a.uiUtil().loadingBox(!1,"us-div-list-load")})}h.value="";a.ESVS.Embedded&&B();return!0}"CERT_SELECT"==e.type&&k();if(!g||0>=g.length)return a.uiUtil().msgBox(d.IDS_MSGBOX_PW_ERROR_PLEASE_INPUT_PASSWORD),setTimeout(function(){h.focus()},10),r(),!1;var p=a.usWebToolkit.util.encode64(a.usWebToolkit.util.encodeUtf8("abcdefghijklmnopqrstuvwxyz1234567890~!@#$%^&*()\ud55c\uae00"));a.Whale().getSignDataP7(p,u,g,!0,function(c,e,f){if(0!=c)a.uiUtil().msgBox(d.IDS_MSGBOX_PW_ERROR_PASSWORD_IS_NOT_MATCHED),r(),b();else return k(),h.value="",a.ESVS.Embedded&&B(),!0})}else if(2&a.ESVS.Mode&&a.uiUtil().isItPFDevice(m)){if(!g&&m!=a.CONST.__PF_M_CLOUDSIGN.device&&"CERT_SELECT"!=e.type)return a.uiUtil().msgBox(d.IDS_MSGBOX_PW_ERROR_PLEASE_INPUT_PASSWORD),setTimeout(function(){h.focus()},10),r(),!1;if(m==a.CONST.__PF_M_CLOUDSIGN.device||"CERT_SELECT"==e.type)y=!0;else{if(!a.PFUC)return r(),!1;u=parseInt(n.selectedIndex());p=null;try{p=a.usWebToolkit.pkcs8.encryptedPrivateKeyFromBase64(a.PFUC[u].signpri)}catch(A){}var y=!1;try{y=a.usWebToolkit.pkcs8.checkUserCertPassword(p,g)}catch(A){}finally{p=""}}if(!1===y)a.uiUtil().msgBox(d.IDS_MSGBOX_PW_ERROR_PASSWORD_IS_NOT_MATCHED),r(),b();else{p=null;u=parseInt(n.selectedIndex());p=m==a.CONST.__PF_M_CLOUDSIGN.device?a.certsList.list[u-1].cert:a.PFUC[u].signcert;if("DIGITAL_SIGNATURE_P7"===e.type){if(!p||0>=p.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;y=a.certUtil().getTheCertAttributes(p,"Base64");f(d.IDS_MSGBOX_SIGN_ERROR,p,y,u,g,m,N)}else if("CERT_SELECT"===e.type){if(!p||0>=p.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;y=a.certUtil().getTheCertAttributes(p,"Base64");f(d.IDS_MSGBOX_SIGN_ERROR,p,y,u,"",m,N)}else if("DIGITAL_SIGNATURE_P1"===e.type){if(!p||0>=p.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;y=a.certUtil().getTheCertAttributes(p,"Base64");f(p,y.subjectName,d.IDS_MSGBOX_SIGN_ERROR,u,g,m,N)}else if("DIGITAL_SIGNATURE_P7_AND_VID_VERIFICATION"==e.type||"DIGITAL_SIGNATURE_P1_AND_VID_VERIFICATION"==e.type){l={signErr:d.IDS_MSGBOX_SIGN_ERROR,verifySuc:d.IDS_MSGBOX_VID_SUCCESS_VERIFICATION,verifyErr:d.IDS_MSGBOX_VID_ERROR_VERIFICATION};if(!p||0>=p.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_SIGN_ERROR,-1),r(),!1;y=a.certUtil().getTheCertAttributes(p,"Base64");f(u,g,l,p,y,m)}else if("CERT_RENEWAL"==e.type){if(!p||0>=p.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_RENEW_ERROR,-1),r(),!1;a.usWebToolkit.x509Certificate.parser(p,"Base64");l=a.usWebToolkit.x509Certificate.getNotAfter();if(!l||0>=l.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_RENEW_ERROR,-2),r(),!1;f(l,d.IDS_CONFIRMBOX_CERT_RENEWAL,m,v,u,g)}else if("CERT_RENEWAL_SIGN"==e.type){if(!p||0>=p.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_RENEW_ERROR,-1),r(),!1;a.usWebToolkit.x509Certificate.parser(p,"Base64");l=a.usWebToolkit.x509Certificate.getNotAfter();if(!l||0>=l.length)return a.uiUtil().errMsgBox(d.IDS_MSGBOX_RENEW_ERROR,-2),r(),!1;y=a.certUtil().getTheCertAttributes(p,"Base64");f(l,c.IDS_CONFIRMBOX_CERT_RENEWAL,m,v,u,g,y)}else"CERT_REVOCATION"===e.type?f(d.IDS_CONFIRMBOX_CERT_REVOCATION,u,g,m,v):"VID_VERIFICATION"===e.type?a.CONST.__PF_M_CLOUDSIGN.device==m?f(u,g,d.IDS_MSGBOX_VID_SUCCESS_VERIFICATION,d.IDS_MSGBOX_VID_ERROR_VERIFICATION,"CLOUDSIGN"):f(u,g,d.IDS_MSGBOX_VID_SUCCESS_VERIFICATION,d.IDS_MSGBOX_VID_ERROR_VERIFICATION,"PFS"):"DIGITAL_SIGNATURE_P7_EXT"===e.type||"DIGITAL_SIGNATURE_P7_EXT_DISABLE_SECTOKEN"==e.type?f(d.IDS_MSGBOX_SIGN_ERROR,u,g,m,v):f();h.value="";a.ESVS.Embedded&&B();return!0}}return!1}function wa(c,b,e){if(!c||!b)return!1;ia=a.loadUI("gridlist");n=ia({type:"certslist",tblid:"us-tbl-list",tbltitleid:"us-tbl-list-th",titlelistid:"us-grid-head-div",titlerowid:"us-list-title-row",titleelementid:"us-list-title-element",titledividerid:"us-list-title-divider",titlelistcn:"us-layout-grid-head-div",titlerowcn:"us-layout-grid-head-row",titleelementcn:"us-layout-grid-row-title-element",titledividercn:"us-layout-grid-row-title-divider",tblbodyid:"us-tbl-list-td",datalistid:"us-grid-body-div",datarowid:"us-list-body-row",dataelementid:"us-list-data-element",datalistcn:"us-layout-grid-body-div",datarowcn:"us-layout-grid-body-row",dataelementcn:"us-layout-grid-row-data-element",dataselectcn:"us-layout-grid-row-data-selected-element",textObj:b});e=!0;"opera"==a.browserName&&(e=!1);n.drawList(c,c.length,null,0,ja,e);w(m,v,b,"",function(c){0!=c?a.uiUtil().errMsgBox(b.IDS_MSGBOX_COMMON_ERROR_GET_CERT,c):(c=x())?n.redrawList(c.list,c.list.length):n.redrawList(null,0);l=!1})}function H(c){if(!c)return!1;Q(c,t,"close");for(var b=a.ESVS.Media.list.split("|"),e=0;ea.ESVS.Media.list.indexOf(c.name)&&(b=!0);if(b)return!1;b=document.getElementById("us-storage-btn-list");var e=document.createElement("li");e.setAttribute("id","us-storage-btn-li-"+c.name,0);e.setAttribute("mediaIndex",c.mediaIndex,0);7==c.mediaIndex&&(e.className="line-first");"hidden"===c.visibility?(e.style.display="none",e.style.visibility="hidden"):(e.style.display="block",e.style.visibility="visible");var d=document.createElement("button");d.setAttribute("type","button",0);d.setAttribute("id","us-btn-"+c.name,0);d.setAttribute("title",c.label,0);d.setAttribute("tabindex",c.tabIndex,0);c.disabled?(d.onclick=function(){a.uiUtil().msgBox(t.IDS_MSGBOX_NOT_SUPPORTED_MEDIA)},d.className="us-layout-storage-btn-none"):(d.onclick=c.onclick,d.className=c.device===m?"us-layout-storage-btn-on":"us-layout-storage-btn-off");e.appendChild(d);if(!a.ESVS.chkEXESetup&&"cloudsign"!==c.name&&"webstorage"!==c.name&&"browsersign"!==c.name&&(c.device!=a.CONST.__USFB_M_DISK.device&&c.device!=a.CONST.__USFB_M_HDD.device||null==a.Whale()||!O)){var h=document.createElement("span");h.className="us-download-select";d.appendChild(h)}h=document.createElement("span");h.className="us-img-storage";var g=document.createElement("img");g.setAttribute("id","us-img-"+c.name,0);g.setAttribute("alt",c.label,0);"browsersign"==c.name?"unknown"==a.browserName?c.disabled?g.setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/media_"+c.name+"_d.png",0):g.setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/media_"+c.name+".png",0):c.disabled?g.setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/browser/"+a.browserName+"_d.png",0):g.setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/browser/"+a.browserName+".png",0):c.disabled?g.setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/media_"+c.name+"_d.png",0):g.setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/media_"+c.name+".png",0);h.appendChild(g);d.appendChild(h);h=document.createElement("span");h.setAttribute("id","us-lbl-"+c.name,0);h.className="us-layout-lbl-storage";h.appendChild(document.createTextNode(c.label));d.appendChild(h);e.appendChild(d);b.appendChild(e);return!0}function Q(c,b,e){if("no_more"==e)a.uiUtil().msgBox(b.IDS_MSGBOX_NOT_MORE_MEDIA);else{document.getElementById("us-storage-wrap")&&("open"==e?(c=document.getElementById("us-div-storage"),c.style.height="186px",c=document.getElementById("us-storage-more-btn"),c.setAttribute("title",b.IDS_STORAGE_MORE_VIEW+b.IDS_STORAGE_MORE_VIEW_HIDDEN+b.IDS_BUTTON,0),c.onclick=function(){Q(this,b,"close")},c=document.getElementById("us-storage-more-btn-img"),c.setAttribute("alt",b.IDS_STORAGE_MORE_VIEW+b.IDS_STORAGE_MORE_VIEW_HIDDEN,0),c.setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/media_more_btn_close.png",0)):(c=document.getElementById("us-div-storage"),c.style.height="96px",c=document.getElementById("us-storage-more-btn"),c.setAttribute("title",b.IDS_STORAGE_MORE_VIEW+b.IDS_STORAGE_MORE_VIEW_SHOW+b.IDS_BUTTON,0),c.onclick=function(){Q(this,b,"open")},c=document.getElementById("us-storage-more-btn-img"),c.setAttribute("alt",b.IDS_STORAGE_MORE_VIEW+b.IDS_STORAGE_MORE_VIEW_SHOW+b.IDS_BUTTON,0),c.setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/media_more_btn_open.png",0)));c=a.ESVS.Media.list.split("|");for(var d=0;dparseFloat(a.browserVersion))return a.uiUtil().msgBox(c.IDS_MSGBOX_SEARCH_CERT_GUIDE_FOR_SAFARI),!1;if("opera"==a.browserName||"safari"==a.browserName||"msie"==a.browserName&&8===parseInt(a.browserVersion))b.style.display="block";"safari"==a.browserName&&b.setAttribute("accept","",0);b.value="";if(""!=b.value){c=b.onchange;var e=b.parentNode;e.removeChild(b);b=document.createElement("input");b.setAttribute("type","file",0);"safari"==a.browserName?b.setAttribute("accept","",0):b.setAttribute("accept","application/x-pkcs12",0);b.setAttribute("id","us-file-search-hidden",0);b.className="us-layout-file-search-hidden";b.onchange=c;e.appendChild(b)}b.click();return!0},ImportPFX=function(c,b){function f(b,c,d,e){a.uiUtil().msgBox(h.IDS_MSGBOX_CERT_IMPORT_SUCCESS);a.CONST.__USFB_M_SMARTCARD.device===m&&1===v?w(m,v,h,e,function(a){(a=x())?n.redrawList(a.list,a.list.length):n.redrawList(null,0);l=!1}):w(m,v,h,"",function(a){(a=x())?n.redrawList(a.list,a.list.length):n.redrawList(null,0);l=!1})}function d(b,c,d,k,l){function q(d){var l=0,q=null;null!=g&&(l=1,q=g);a.nimservice().ImportCert(l,q,k,b,c,d,function(g,l){if(0==g)m==b&&v==c&&b!=a.CONST.__USFB_M_MOBILE.device?f(g,b,c,d):((g=x())?n.redrawList(g.list,g.list.length):n.redrawList(null,0),a.uiUtil().msgBox(h.IDS_MSGBOX_CERT_IMPORT_SUCCESS)),e.args&&3==e.args.type&&L(),k=d="";else switch(a.uiUtil().loadingBox(!1,"us-div-list-load"),g){case 4823E4:a.uiUtil().msgBox(h.IDS_MSGBOX_PW_ERROR_INPUT_WRONG_SEC_TOKEN_PIN);break;case 4825E4:a.uiUtil().msgBox(h.IDS_MSGBOX_PW_ERROR_SEC_TOKEN_PIN_LOCKED);break;case 4844E4:a.uiUtil().msgBox(h.IDS_MSGBOX_HSM_ERROR_MEMORY_TOO_SMALL);break;case 4846E4:a.uiUtil().msgBox(h.IDS_MSGBOX_HSM_ERROR_UNSUPPORT_KEY_LENGTH);break;case 4904E4:a.uiUtil().msgBox(h.IDS_MSGBOX_PW_ERROR_INPUT_WRONG_SAVE_TOKEN_PIN);break;case 4905E4:a.uiUtil().msgBox(h.IDS_MSGBOX_PW_ERROR_SAVE_TOKEN_PIN_LOCKED);break;case 4843E4:case 4123E4:g=a.nimservice().GetLastErrorMessage();g=h.IDS_MSGBOX_CERT_COPY_ERROR_NEWEST_CERT+"\n\n"+g;a.uiUtil().msgBox(g);break;case 4019E4:a.uiUtil().errMsgBox(l,g);break;default:switch(g=a.CONST.__PF_M_LS.device===b?g:a.nimservice().GetLastErrorCode(),g){case 3509:a.uiUtil().msgBox(h.IDS_MSGBOX_PW_ERROR_INPUT_WRONG_PASSWORD);break;default:a.uiUtil().errMsgBox(h.IDS_MSGBOX_CERT_IMPORT_ERROR,g)}}})}var p=document.getElementById("us-cert-manage-get-cert-btn");if(4<=a.ESVS.Mode)if(a.CONST.__PF_M_LS.device==b||a.CONST.__PF_M_SS.device==b){if(!a.PFSH)return a.uiUtil().msgBox("unsupport html5 storage"),!1;d=0;try{var u=a.PFSH.SetP12OnMemory(null,k),t=u.index,r=u.aluc[t];a.usWebToolkit.x509Certificate.parser(r.signcert,"Base64");var y=a.usWebToolkit.x509Certificate.getCertificatePoliciesOid(),w=a.certUtil().getIssuerEnName(y);a.PFSH.SaveUserCert(w,r,document.domain,!0)}catch(G){switch(d=G.code,G.code){case 1E7:0<=G.detail.indexOf("115010")?a.uiUtil().msgBox(h.IDS_MSGBOX_PW_ERROR_PASSWORD_IS_NOT_MATCHED):a.uiUtil().errMsgBox(h.IDS_MSGBOX_CERT_IMPORT_ERROR,G.detail);break;default:a.uiUtil().errMsgBox(h.IDS_MSGBOX_CERT_IMPORT_ERROR,G.code)}}0==d&&f(d,b,c,"");k="";l&&l.dispose();setTimeout(function(){p.focus()},10)}else a.nimservice()?a.CONST.__USFB_M_HSMKEY.device===b||a.CONST.__USFB_M_SMARTCARD.device===b?(l&&l.dispose(),l=null,l=a.CONST.__USFB_M_SMARTCARD.device===b?"PIN_SAVE_TOKEN":"PIN_SECURITY_TOKEN",PINDialog=a.loadUI("pin")({type:l,args:null,onConfirm:function(a){q(a);PINDialog.dispose();setTimeout(function(){p.focus()},10)},onCancel:function(){k="";PINDialog.dispose();setTimeout(function(){p.focus()},10)}}),PINDialog.show()):(l&&l.dispose(),q("")):a.uiUtil().msgBox(h.IDS_MSGBOX_NIM_ERROR_UNLOAD);else{if(!a.PFSH)return a.uiUtil().msgBox("unsupport html5 storage"),!1;d=0;try{u=a.PFSH.SetP12OnMemory(null,k),t=u.index,r=u.aluc[t],a.usWebToolkit.x509Certificate.parser(r.signcert,"Base64"),y=a.usWebToolkit.x509Certificate.getCertificatePoliciesOid(),w=a.certUtil().getIssuerEnName(y),a.PFSH.SaveUserCert(w,r,document.domain,!0)}catch(G){switch(d=G.code,G.code){case 1E7:0<=G.detail.indexOf("115010")?a.uiUtil().msgBox(h.IDS_MSGBOX_PW_ERROR_PASSWORD_IS_NOT_MATCHED):a.uiUtil().errMsgBox(h.IDS_MSGBOX_CERT_IMPORT_ERROR,G.detail);break;default:a.uiUtil().errMsgBox(h.IDS_MSGBOX_CERT_IMPORT_ERROR,G.code)}}0==d&&f(d,b,c,"");k="";l&&l.dispose();setTimeout(function(){p.focus()},10)}}if(!c||!b)return!1;m=a.CONST.__USFB_M_ETC.device;v=0;var h=b,g=null;document.getElementById("us-confirm-btn");var k=document.getElementById("us-cert-search-btn");if("opera"==a.browserName||"safari"==a.browserName)c.style.display="none";if("msie"==a.browserName&&8===parseInt(a.browserVersion))b=document.getElementById("us-div-cert-select"),b.onselectstart=function(){return!0},c.select(),g=c.value,c.style.display="none",b.onselectstart=function(){return!1};else if("msie"==a.browserName&&9===parseInt(a.browserVersion)){if(g=c.value,-1=a.ESVS.Media.option&&-1*a.ESVS.Media.option&Math.pow(2,h)&&a.ESVS.Media.defaultdevice!=g&&(k.disabled=!0);k.tabIndex=z;k.mediaIndex=c+1;k.visibility=6');"MPKI"==a.ESVS.PKI&&a.ESVS.Media.defaultdevice==a.CONST.__USFB_M_HDD.name&&(d=document.getElementById("us-lbl-pw"),h=document.getElementById("us-lbl-pw2"),d.disabled=!0,h.disabled=!0,u.readOnly=!0,u.disabled=!0);k=document.getElementById("us-confirm-btn");k.setAttribute("value",b.IDS_CONFIRM,0);k.onclick=function(){va(b)};if(d=document.getElementById("us-cert-verify-btn"))d.setAttribute("value",b.IDS_CERT_VERIFY,0),d.onclick=function(){E(this,b)};h=document.getElementById("us-cert-view-btn");h.setAttribute("value",b.IDS_CERT_VIEW,0);h.onclick=function(){F(this,b)};g=document.getElementById("us-cert-proposal-btn");g.setAttribute("value",b.IDS_CERT_PROPOSAL,0);g.setAttribute("title",b.IDS_LINK_TITLE,0);g.onclick=function(){la(this)};if(0==a.ESVS.CertRequestPageEnable||"MPKI"==a.ESVS.PKI)g.readOnly=!0,g.disabled=!0,g.style.display="none",g.style.visibility="hidden";document.getElementById("us-cert-get-btn");var p=document.getElementById("us-cls-btn"),r=document.getElementById("us-cert-manage-btn");r&&(r.setAttribute("value",b.IDS_CERT_MANAGE,0),r.onclick=function(){l||ma(this)},r.display="block",r.visibility="visible");a.uiUtil().isIraq()&&(c.style.visibility="hidden",g.style.visibility="hidden");if(a.ESVS.Embedded)u.setAttribute("tabindex",z++,0),k.setAttribute("tabindex",z++,0),c.setAttribute("tabindex",z++,0),g.setAttribute("tabindex",z++,0),h.setAttribute("tabindex",z++,0),d&&d.setAttribute("tabindex",z++,0);else if(u.setAttribute("tabindex",z++,0),"none"!=document.getElementById("us-div-cert").style.display&&k.setAttribute("tabindex",z++,0),c.setAttribute("tabindex",z++,0),g.setAttribute("tabindex",z++,0),h.setAttribute("tabindex",z++,0),d&&d.setAttribute("tabindex",z++,0),"none"==document.getElementById("us-div-cert").style.display&&k.setAttribute("tabindex",z++,0),r.setAttribute("tabindex",z++,0),p.setAttribute("value",b.IDS_CLOSE,0),p.setAttribute("tabindex",z++,0),p.onclick=function(){l&&a.ESVS.chkEXESetup||L()},k=document.getElementById("us-lbl-notice"),k.appendChild(document.createTextNode(b.IDS_NOTICE)),"MPKI"==a.ESVS.PKI||a.uiUtil().isIraq())k.style.visibility="hidden";p.onkeydown=function(a){a=a||window.event;var b=a.which||a.keyCode;9==b&&a.shiftKey&&(p.onblur=function(){setTimeout(function(){r.focus()},10)});9!=b||a.shiftKey||(p.onblur=function(){setTimeout(function(){f.focus()},10)})};var w=!1;f.onkeyup=function(a){a=a||window.event;9==(a.which||a.keyCode)&&a.shiftKey&&w&&(w=!1,setTimeout(function(){p.focus()},10))};f.onkeydown=function(a){a=a||window.event;if(9==(a.which||a.keyCode)&&a.shiftKey)return a.cancelBubble=!0,w=a.returnValue=!0,!1};null!=a.options.popup&&(document.getElementById("us-div-cert-select").className=document.getElementById("us-div-cert-select").className+" popup");a.ESVS.ShowGuide&&C(m);0<=a.ESVS.PKI.indexOf("MilPKI")&&(c.style.display="none",c.style.visibility="hidden",d.style.display="none",d.style.visibility="hidden",h.style.display="none",h.style.visibility="hidden",g.style.display="none",g.style.visibility="hidden",r.style.display="none",r.style.visibility="hidden");"DIGITAL_SIGNATURE_P7_EXT_DISABLE_SECTOKEN"==e.type&&(r.style.display="none",r.style.visibility="hidden");"CERT_SELECT"==e.type&&da("123456789012345678901234567890");return document.getElementById("us-div-cert-select")}()};return function(e){function x(){function e(){0x&&setTimeout(e,10),x++)}var w=document.getElementById("us-pw-text"),x=0;e();a.uiUtil().setFirstFocus("us-lbl-title");for(var E=a.ESVS.Media.list.split("|"),F=0;F