    function validatePwd() {
        var invalid = " "; // Invalid character is a space
        var minLength = 3; // Minimum length
        var pw1 = document.myForm.newpassword.value;
        var pw2 = document.myForm.newpassword2.value;

        if (pw1 == '' || pw2 == '') {
            alert('Please enter your password twice.');
           return false;
        }
// check for minimum length
        if (document.myForm.newpassword.value.length < minLength) {
            alert('Your password must be at least ' + minLength + ' characters long. Try again.');
        return false;
        }
// check for spaces
        if (document.myForm.newpassword.value.indexOf(invalid) > -1) {
            alert("Sorry, spaces are not allowed.");
            return false;
        }
        else {
            if (pw1 != pw2) {
            alert ("You did not enter the same new password twice. Please re-enter your password.");
            return false;
            }
            else {
            return true;
            }
        }
    }


    function confirmDelete(name,id,url){
        if (confirm("Are you sure you want to remove " + name + " from the database. This is not undoable!"))
         {
             document.location=(url + "?action=delete&id=" + id  );

         }
         else {}
    }


