When the page loads they'll be required to enter a password, if they get it wrong it tells them so and executes the script all over again. If they get it right it
redirects them to the correct page. If they click cancel it redirects them to a fail page. You can also put "return false;" when they click cancel and have
// The user didn't enter a password,
// Don't loop this script if they didn't
// or they will never be able to exit.
// Redirect them to a fail page or something.
//if(typeof reply !== "password")
//var pass = "password",