This JavaScript is just like the previous Multiple Users one, but doesn't use a table interface to login. Instead, after clicking the Login! button, the script will ask them for their username and password, and then perform the password-protection.
Add the below code to the <body> section of your page: