// ---------------------------------------------------------------------------------------	
// CRITICAS DE CAMPOS TEXTO
// ---------------------------------------------------------------------------------------	

	// field -> campo
	// fieldName -> nome
	// obrig -> campo obrigatorio
	// maxLen -> tamanho máximo (Formatar Mensagem)
	// minLen -> tamanho mínimo (colocar 1 se não for necessário tamanho mínimo)
	// caracesp -> aceita caracter especial -.,/ ("True" se tiver excessão)
	// numero -> totalmente numérico
	// maior20 -> aceita maior que 20 caracteres conectados

function CriticaTXT(field, fieldName, obrig, maxLen, minLen, caracesp, numero, maior20)
{
	var msg;
	
	resp = Preenchido(field, obrig);
	if (resp == false) {
		msg = "O campo " + fieldName + " é de preenchimento obrigatório com até " + maxLen + " posições alfanuméricas.";
		error(field," " + msg);
		return false;
	}
	
	resp = Texto(field, caracesp);			
	if (resp == false) {
		if (caracesp == true)
		    msg = "O campo " + fieldName + " não pode ser acentuado \n nem ter Caracteres Especiais (Exceto & - . , / ).";
		else
		    msg = "O campo " + fieldName + " não pode ser acentuado \n nem ter Caracteres Especiais.";
		error(field," " + msg);
		return false;
	}
	
	resp = Numerico(field);
	if (field.value != "")
		if ((resp == true) && (numero == false)) {
			msg = "O campo " + fieldName + " não pode ser totalmente numérico.";
			error(field," " + msg);
			return false;
		}

	resp = MaiorQue20(field, maior20);
	if (resp == false) {
		msg = "O campo " + fieldName + " não pode ter palavras com mais de 20 caracteres.";
		error(field," " + msg);
		return false;
	}

	resp = BrancoSuperfluo(field);
	if (resp == false) {
		msg = "O campo " + fieldName + " não pode ter Brancos Supérfluos.";
		error(field," " + msg);
		return false;
	}

	resp = TamanhoTxt(field, minLen)
	if ((obrig == true) || (field.value != ""))
		if (resp == false) {
			msg = "O campo " + fieldName + " deve ter no mínimo " + minLen + " posições alfanuméricas.";
			error(field," " + msg);
			return false;
		}
	
	return true;

}

