function validateForm() {	
	if (validateField('SB_Validator.notEmpty', 'firstName', 'EMPTY-FIRSTNAME')
		&& validateField('SB_Validator.notEmpty', 'lastName', 'EMPTY-LASTNAME')
		&& validateField('SB_Validator.notEmpty', 'email', 'EMPTY-EMAIL')
		&& validateField('SB_Validator.isEmail', 'email', 'INCORRECT-EMAIL')
		&& (!isVisible(document.getElementById('rowPassword'))
			|| extendedValidateField("SB_Validator.isEqual(document.getElementById('password').value, document.getElementById('confirmPassword').value)", 'confirmPassword', 'PASSWORD-MISMATCH')
		)
	) {
		result = true;
	} else {
		result = false;
	}
	
	if (result) {
		if (validateField('SB_Validator.notEmpty', 'listSize', 'EMPTY-LISTSIZE')
			&& validateField('SB_Validator.isInt', 'listSize', 'INCORRECT-LISTSIZE')
			&& extendedValidateField("SB_Validator.isBetween(document.getElementById('listSize').value, 1, 100)", 'listSize', 'INCORRECT-LISTSIZE')
		) {
			result = true;
		} else {
			result = false;
		}
	}
	
	if (result) {
		currentPassword = document.getElementById('currentPassword').value;
		newPassword = document.getElementById('password').value;
				
		if (SB_Validator.notEmpty(currentPassword)) {
			if (!validateField('SB_Validator.isAlnum', 'currentPassword', 'PASSWORD-INCORRECT')) {
				result = false;
			}
		}
		
		if (result && SB_Validator.notEmpty(newPassword)) {
			if (!validateField('SB_Validator.isAlnum', 'password', 'PASSWORD-INCORRECT')) {
				result = false;
			}
		}
	}
		
	return result;
}

function submitForm() {
	if (!validateForm()) {
		return false;
	}
	
	document.forms.profileForm.tab.value = sb_panel.selectedName;
	document.forms['profileForm'].submit();
	
	return true;
}