There isn't any way that I know of to hide the password from someone with a web browser. Javascript isn't meant to be secure.
You could do it so easily with a PHP script and you wouldn't even need a database if you wanted to have only one user.
You would basically have the exact same script as you have with the Javascript, but with PHP syntax, and probably a PHP function to transfer you to another page or something.
Actually, now that I think of it, it'd be better to have the one page just display a login box if you aren't logged in, and display other content if you are logged in. That's pretty easy, as I've done it with ASP.
Any pages that you would want to be secure would have to be PHP pages as well and would have to check for the username/pw as well, but that's easy.
This is a bit more work than just a little javascript though.