For multiple passwords, use:
<script type="text/javascript">
function askLogin(password) {
var p = prompt('Please enter your password','Password')
if p('',password') {
alert('Thanks!')
else
alert('You do not have permission to access this page!')
var newLoc = "http://www.example.com/path-to-failed-login.type"
window.location = newLoc
}
}
<body onLoad="askLogin('PASSWORD HERE','Password Here','Password Here','So on')">