function validateForm() {
	if (validateField('SB_Validator.notEmpty', 'code', 'EMPTY-SITE-FAMILY-CODE')
		&& validateField('SB_Validator.isAlnum', 'code', 'INVALID-SITE-FAMILY-CODE')
		&& validateField('SB_Validator.notEmpty', 'title', 'EMPTY-SITE-FAMILY-TITLE')
	) {
		return true;
	} else {
		return false;
	}
}

function validateFormForUpload() {
	if (validateField('SB_Validator.notEmpty', 'idUploadLogo', 'SELECT-FILE')
		&& extendedValidateField("SB_Validator.isRegex(document.getElementById('idUploadLogo').value, /\.(gif|jpe?g|png|bmp)$/i)", 'idUploadLogo', 'INVALID-FILE-TYPE')
	) {
		return true;
	} else {
		return false;
	}
}

function submitForm() {
	if (!validateForm()) {
		return false;
	}
	
	document.forms.siteFamilyForm.submit();
	return true;
}

function submitForUpload() {
	if (!validateFormForUpload()) {
		return false;
	}
	
	addHiddenToForm('isTemporarySave', 1, 'siteFamilyForm');
	
	document.forms.siteFamilyForm.submit();
	return true;
}

function deleteSiteFamilies() {
	if (countSelectedCheckBoxes() > 0) {
		if (confirm(SbGetLocaleByKey('SURE-TO-DELETE'))) {
			document.forms.listForm.action.value = '/Admin/SiteFamilies/Delete';
			document.forms.listForm.submit();
		}
	} else {
		alert(SbGetLocaleByKey('SELECT-FOR-DELETE'));
	}
}
