This works on the Mac:
On Windows you can probably go to the command prompt and type "set" to list the available environment variables, I don't know whether AD set such a variable.
On Windows you can get the name of the user like this:
alert((Folder.temp + "").slice (12,-14));
Thanks, as it turns out the environment function, with a little tweak, also works in Windows.