var __driveselect=function(a){var t=function(g){function q(a){if(!a)return alert("UI load error."),!1;var b=document.createElement("div");document.body.insertBefore(b,document.body.firstChild);b.innerHTML=a;return!0}var p=function(){var b=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");b.open("GET",a.ESVS.SRCPath+"unisignweb/rsrc/layout/driveselect.html?version="+a.ver,!1);b.send(null);return b.responseText},h=function(){var b=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");b.open("GET",a.ESVS.SRCPath+"unisignweb/rsrc/lang/"+a.ESVS.Language+"/driveselect_"+a.ESVS.Language+".js?version="+a.ver,!1);b.send(null);return b.responseText},e=a.ESVS.TabIndex;return function(){var b=a.CustomEval(p),c=a.CustomEval(h,!0),d=g.type,m=g.args.list,k=g.args.list.length;q(b());b=document.getElementById("us-drive-select-lbl-title");var f=document.getElementById("us-drive-select-disk-img"),r=document.getElementById("us-drive-select-disk-name"),l=document.getElementById("us-drive-select-disk-lbl"),n=document.getElementById("us-drive-select-disk-select");document.getElementById("us-drive-select-cls-btn-img").setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/x-btn.png",0);if("DEVICE_REMOVABLE_DISK"===d){if(b.appendChild(document.createTextNode(c.IDS_DRIVE_SELECTION)),b.setAttribute("tabindex",e,0),f.setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/media_removable.png",0),r.appendChild(document.createTextNode(c.IDS_DRIVE_REMOVABLE)),l.appendChild(document.createTextNode(c.IDS_DRIVE_SELECTION_CHOOSE_DISK)),n.setAttribute("tabindex",e+1,0),0<k)for(f=0;f<k;f++)l=document.createElement("option"),l.setAttribute("value",m[f].index,0),l.appendChild(document.createTextNode(m[f].name)),n.appendChild(l)}else if("DEVICE_SAVE_TOKEN"===d&&(b.appendChild(document.createTextNode(c.IDS_SAVE_TOKEN_SELECTION)),b.setAttribute("tabindex",e,0),f.setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/media_savetoken.png",0),r.appendChild(document.createTextNode(c.IDS_SAVE_TOKEN)),l.appendChild(document.createTextNode(c.IDS_SAVE_TOKEN_CHOOSE_SAVE_TOKEN)),n.setAttribute("tabindex",e+1,0),0<k))for(f=0;f<k;f++)l=document.createElement("option"),l.setAttribute("value",m[f].index,0),l.appendChild(document.createTextNode(m[f].name)),n.appendChild(l);m=document.getElementById("us-drive-select-confirm-btn");m.setAttribute("value",c.IDS_CONFIRM,0);m.setAttribute("tabindex",e+2,0);m.onclick=function(){var a=document.getElementById("us-drive-select-disk-select");a=parseInt(a.selectedIndex)+1;g.onConfirm(a)};k=document.getElementById("us-drive-select-cancel-btn");k.setAttribute("value",c.IDS_CANCEL,0);k.setAttribute("tabindex",e+3,0);k.onclick=function(){g.onCancel()};n=document.getElementById("us-drive-select-cls-img-btn");"DEVICE_REMOVABLE_DISK"===d?n.setAttribute("title",c.IDS_DRIVE_SELECTION_CLOSE,0):"DEVICE_SAVE_TOKEN"===d&&n.setAttribute("title",c.IDS_SAVE_TOKEN_CLOSE,0);n.setAttribute("tabindex",e+4,0);n.onclick=function(){g.onCancel()};a.uiUtil().setRotationTabFocus(k,m,b);a.uiUtil().setRotationTabFocus(b,k,r);return document.getElementById("us-div-drive-select")}()};return function(g){var q=a.uiLayerLevel,p=a.uiUtil().getOverlay(q),h=t({type:g.type,args:g.args,onConfirm:g.onConfirm,onCancel:g.onCancel});h.style.zIndex=q+1;a.ESVS.TargetObj.insertBefore(p,a.ESVS.TargetObj.firstChild);var e=window.onresize;return{show:function(){draggable(h,document.getElementById("us-div-drive-select-title"));p.style.display="block";var b=document.getElementById("us-div-cert-select"),c=document.getElementById("us-div-cert-manage"),d=null;b?(d=document.getElementById("us-div-list"),d=b.offsetTop+d.offsetTop+"px"):c&&(d=document.getElementById("us-div-cert-manage-list"),d=c.offsetTop+d.offsetTop+"px");a.uiUtil().offsetResize(h);d&&(h.style.top=d);window.onresize=function(){a.uiUtil().offsetResize(h);e&&e()};a.uiLayerLevel+=10;a.ESVS.TabIndex+=30;setTimeout(function(){var a=h.getElementsByTagName("p");if(0<a.length)for(var b=0;b<a.length;b++)"us-drive-select-lbl-title"==a[b].id&&a[b].focus()},10)},hide:function(){p.style.display="none";h.style.display="none"},dispose:function(){window.onresize=function(){e&&e()};h.parentNode.parentNode.removeChild(h.parentNode);p.parentNode.removeChild(p);a.uiLayerLevel-=10;a.ESVS.TabIndex-=30}}}};