function setFilters () {
	$fp_obj = document.getElementById("selectAdditionParamTranslation");
	$iCurSelectOption = $fp_obj.selectedIndex;
	$sVal = $fp_obj.options[$iCurSelectOption].value;
	$aInput = document.forms['formChannels'].getElementsByTagName("input");
	if ($aInput && $aInput.length) {
		for (var i = 0; i < $aInput.length; i++) {
			if ($aInput[i].getAttributeNode("type").value == "checkbox") {
				if ($aInput[i].value == "title" || $aInput[i].value == "description") {
					$aInput[i].checked = false;
					if ($aInput[i].id != "") {
						sInpChecId = $aInput[i].id;
						$iEnd = sInpChecId.length;
						sId = $aInput[i].id.substr(2, $iEnd);
						document.getElementById(sId).style.display = "none";
					}
				}
				if ($sVal == "title_description") {
					if ($aInput[i].value == "title" || $aInput[i].value == "description") {
						$aInput[i].checked = true;
						if ($aInput[i].id != "") {
							sInpChecId = $aInput[i].id;
							$iEnd = sInpChecId.length;
							sId = $aInput[i].id.substr(2, $iEnd);
							document.getElementById(sId).style.display = "inline";
						}
					}
				} else {
					if ($sVal == $aInput[i].value) {
						$aInput[i].checked = true;
						if ($aInput[i].id != "") {
							sInpChecId = $aInput[i].id;
							$iEnd = sInpChecId.length;
							sId = $aInput[i].id.substr(2, $iEnd);
							document.getElementById(sId).style.display = "inline";
						}
					}
				}
				if ($aInput[i].value == "link") {
					$aInput[i].checked = true;
				}
			}
		}
	}
}

function submitChannels () {
	$sAction = false;
	$aInput = document.forms['formChannels'].getElementsByTagName("input");	
	if ($aInput && $aInput.length) {
		for (var i = 0; i < $aInput.length; i++) {
			$s = $aInput[i].value * 1;
			if ($s > 0) {
				if ($aInput[i].checked) {
					$sAction = true;
				}
			}
		}
	}
	if ($sAction) {
		document.forms['formChannels'].submit();
	} else {
		alert("Нужно выбрать канал");
	}
}

function submitChannelsAndSave () {
	sVal = document.formChannels.nameConf.value;
	if (sVal == "") {
		alert("Необходимо ввести название для информера");
	} else {
		$sAction = false;
		$aInput = document.forms['formChannels'].getElementsByTagName("input");	
		if ($aInput && $aInput.length) {
			for (var i = 0; i < $aInput.length; i++) {
				$s = $aInput[i].value * 1;
				if ($s > 0) {
					if ($aInput[i].checked) {
						$sAction = true;
					}
				}
			}
		}
		if ($sAction) {
			document.forms['formChannels'].submit();
		} else {
			alert("Необходимо выбрать источник данных");
		}
	}
}

