function validateOwnForm() {
	if (validateField('SB_Validator.isHttpUrl', 'siteUrl', 'INVALID-SITE-URL')
		&& validateField('SB_Validator.notEmpty', 'siteAlias', 'EMPTY-SITE-ALIAS')
	) {
		return true;
	} else {
		return false;
	}
}

function submitOwnForm() {
	if (!validateOwnForm()) {
		return false;
	}
	
	document.forms.ownSite.submit();
	return true;
}

function validateForm(isStrongValidationRequired) {
	var result = false;

	if (validateField('SB_Validator.notEmpty', 'alias', 'EMPTY-SITE-ALIAS')
		&& validateField('SB_Validator.notEmpty', 'owner', 'EMPTY-SITE-OWNER')
	) {
		result = true;
	}
	if (result && ('undefined' != typeof(sbPublicationSettingsForm))) {
		if (('undefined' != typeof(isStrongValidationRequired)) && isStrongValidationRequired) {
			result = sbPublicationSettingsForm.validate();
		} else {
			result = sbPublicationSettingsForm.validateIfNotEmpty();
		}
	}
	return result;
}

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

function checkTarget(action) {
	if (!validateForm(true)) {
		return false;
	}
	document.forms.editSite.action = baseUrl + action;
	document.forms.editSite.isSavingRequired.value = (self.sbApplyChangesObject.isSavingRequired()) ? 'yes' : 'no';
	document.forms.editSite.submit();
	return true;
}


function publishSite(id, backUrl) {
	document.forms.publishSiteForm.id.value = id;
	document.forms.publishSiteForm.backUrl.value = backUrl;
	document.forms.publishSiteForm.submit();
}

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