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 he current page be the fail page. This would be better if the user disables JavaScript. Also use tags incase JavaScript isn't enabled. --> // 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",