I need to access the CGI Variables or HTTP Headers in a request. Can I do that in JavaScript?

Specifically I need to access the CGI variable remote_user.

anyone?