// JavaScript Document


function validatePwd() {
	//alert('hi...');
var invalid = " "; // Invalid character is a space
var minLength = 6; // Minimum length
var ctp = document.myForm.currentpasswd.value;
var pw1 = document.myForm.newpasswd1.value;
var pw2 = document.myForm.newpasswd2.value;


	if(ctp == '') {
		alert('Enter your Current Password');
	    window.document.myForm.currentpasswd.focus();
		return false;
	}
// check for a value in both fields.
	if (pw1 == '' || pw2 == '') {
	alert('Please enter your New Password in both the fields...');
	return false;
	}
	// check for minimum length
	if (document.myForm.newpasswd1.value.length < minLength) {
	alert('Your password must be at least ' + minLength + ' characters long. Try again.');
	return false;
	}
	// check for spaces
	if (document.myForm.newpasswd1.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;
	}
	  
}
}

//  End -->