function verifypass(form) {
	with (form) {
		var minLength = 6; // Minimum length
		var pw1 = form.createpassword.value;
		var pw2 = form.createpassword2.value;
		var email = form.createemail.value;
		
		// check for minimum username length
		if (form.createusername.value.length < minLength) {
			alert('Your username must be at least ' + minLength + ' characters long.');
			return false;
		}
		
		//confirm both passwords match
		if (pw1 != pw2) {
			alert('Your passwords must match.');
			return false;
		}
		
		// check for a value in both fields.
		if (pw1 == '' || pw2 == '') {
			alert('Please enter your password twice.');
			return false;
		}
		
		// check for minimum password length
		if (form.createpassword.value.length < minLength) {
			alert('Your password must be at least ' + minLength + ' characters long.');
			return false;
		}
		
		// make sure email is given
		if (email == '') {
			alert('You must enter your email address.');
			return false;
		}
		
		//make sure code is correct to prevent random registrations
		/*if (form.createcode.value != '1611') {
			alert('You must enter the correct user code. Contact nie@daytondailynews.com if you did not receive a code.');
			return false;
		}*/
		
		form.submit();
	}
}