I agree with planoie - client-side javascript is not much use for this
if you use NTLM authentication then the browser will send the username to the webserver. If its possible for you, you could turn your HTML page into, say, an ASP page and populate a javascript variable with the username, from Request.ServerVariables("LOGON_USER"). Then you would have the logon name available in your client-side
js.