There isn't any direct way for a client-side scripting language to communicate with a server language, except perhaps some special IE mumbo-jumbo (you know as much as I).
The login script, does it actually log users in with JavaScript? It validates the names with it? That's highly insecure, if so. Anyone that knows how to click "View Source" can look at your passwords.
My guess is that it does some pre-submit work and then submits the form to PHP.
HTH,
Snib
<><