Javascript login question

Hey, I have a javascript problem;
I want 3 people to have access to my site, they will get a
window.prompt 2 times, the first one is to enter their username and the second one is to enter their password. If username and password do not match they must get a window.alert message and the whole process must start over (meaning they get the window.prompt again to enter their username and then their password).
Also, username and password can not be shorter then 4 characters and be longer then 6 characters, so if they accidently enter something outside of those range they must also get a window.alert message.
I have begun writing the script, but I have problems with or I can’t do the window.alert messages. Can you guys help me out?;
this is what I have so far:

<html>
<head>
<head>

<body>
<script language = “javascript”>
<!–

var login=false;
var username=0;
var password=0;

username=prompt(“Please enter your username:”,"");{
}

password=prompt(“Please enter your password:”,"");{
}

//These are the persons who have access to the site//

if (username=="user1" && password=="green") { 
login=true;
window.location="login.htm";
}
if (username=="user2" && password=="white") {
login=true;
window.location="login.htm";
}
if (username=="user3" && password=="black") { 
login=true;
window.location="login.htm";
}

//hide from old browsers -->
</script>

</body>
</html>

var login=false;
var username=0;
var password=0;

username=prompt(“Please enter your username:”,"");{
}

password=prompt(“Please enter your password:”,"");{
}

//These are the persons who have access to the site//

if (username=="user1" && password=="green") { 
login=true;
window.location="login.htm";
}
if (username=="user2" && password=="white") {
login=true;
window.location="login.htm";
}
if (username=="user3" && password=="black") { 
login=true;
window.location="login.htm";
}

Works fine for me dude. I get the prompts, I put in the correct user and password and it takes me to login.htm. Although I would add an else statement just in case it is wrong it can do something. And change the statements to else ifs…like this…

<SCRIPT LANGUAGE="Javascript">
<!--
var login = false;
var username = null;
var password = null;

username = prompt("Please enter your username:","");
password = prompt("Please enter your password:","");
if (username=="user1" && password=="green") { 
login = true;
window.location="login.htm";
} else if (username=="user2" && password=="white") {
login = true;
window.location="login.htm";
} else if (username=="user3" && password=="black") { 
login = true;
window.location="login.htm";
} else {
login = false
document.write("ERROR:  WRONG LOGIN");
}
-->
</SCRIPT>

It works great.

Keep in mind that this is very unsecure. People can just view the source of your page and get your username and password.

Also what is the point of login = true? Are you doing that for something else?