function checkPasswords() {
var pass1 = document.getElementsByName("password1")[0];
var pass2 =document.getElementsByName("password2")[0];
if (pass1.value!=pass2.value)
{
alert("The passwords entered twice are inconsistent");
}
else
{
alert("The passwords entered twice are consistent");
}
}