You shouldn't be securing a login with JavaScript (especially an admin panel), it can easily be bypassed by disabling JavaScript or tampering with the code.
Try googling
PHP login and finding something server-side, something people can't
see or
tamper with (easily).
And by the way, the scripts you provided aren't related and you are probably missing a large portion of it.
Code:
onsubmit="return authPass(this.user.value,this.pass.value)">
There should be a JavaScript function
authPass() which submits the user and pass inputs and returns whether it is valid, JavaScript validation like this should be used for checking whether the username is at least 0 characters or something that is not really important to security.