var objForm = [];
ArteCodigoFormIni = function() {
	var nForm = 0;
	for (nF=0; nF < document.forms.length; nF++) { 
		if (document.forms[nF].name != '') { 
			objForm[nF] = new ArteCodigoForm(document.forms[nF].name);
			objForm[document.forms[nF].name] = new ArteCodigoForm(document.forms[nF].name);
		}
	}
}
/*
ArteCodigoJS.loadFunction[ArteCodigoJS.loadFunction.length] = function() {
	ArteCodigoFormIni();
}
*/
ArteCodigoForm = function (fName,lyr1,lyr2) {
	if (lyr1 && is.ns4) {
		if (lyr2) { this.base = eval("document.layers."+lyr1+".document.layers."+lyr2+".document."+fName); } else { this.base = eval("document.layers."+lyr1+".document."+fName); }
	} else {
		this.base = eval("document."+fName);
	}
	this.elements = [];
	this.elementsName = [];
	this.elementsValue = [];
	for (i=0; i < this.base.elements.length; i++) {
		this.elements[i] 		= this.base.elements[i].type;
		this.elementsName[i] 	= this.base.elements[i].name;
		this.elementsValue[i] 	= this.base.elements[i].value;
	}
	this.senderOther = new Function();
}
ArteCodigoForm.onload = new Function();
/* valida email */
function ArteCodigoValidaEmail(campo) {
	invalidChars = " /:,;";
	email = eval("this.base."+campo+".value");
	if (this.isEmpty(campo)) return false;
	for (i=0; i < invalidChars.length; i++) {
		badChar = invalidChars.charAt(i);
		if (email.indexOf(badChar,0) > -1) return false;
	}
	atPos = email.indexOf("@",1);
	if (atPos == -1) return false;
	if (email.indexOf("@",atPos+1) != -1) return false;
	periodPos = email.indexOf(".",atPos);
	if (periodPos == -1) return false;
	if (periodPos+3 > email.length) return false;
	return true;
}
/* valida CPF */
function ArteCodigoValidaCpf(campo) {
	var soma1 = resto = dig1 = dig2 = 0;
	nCpf = eval("this.base."+campo+".value");
	invalidChars = " /:,;-..";
	var seq = [
		"00000000000",
		"11111111111",
		"22222222222",
		"33333333333",
		"44444444444",
		"55555555555",
		"66666666666",
		"77777777777",
		"88888888888",
		"99999999999",
		"01234567890"
	]
	for(nS=0; nS < seq.length; nS++){
		if(nCpf == seq[nS])
			return false
	}
	for (i=0; i < invalidChars.length; i++) {
		badChar = invalidChars.charAt(i);
		nCpf = nCpf.replace(badChar,"");
	}
	for (var i = 10; i > 1; i --) { soma1 += parseInt(nCpf.substr(nCpf.length-i-1, 1)) * i }
	resto = soma1 % 11;
	switch (resto) {
		case 0:
		case 1:
			dig1 = 0
			break
		default:
			dig1 = 11 - resto
			break
	}
	soma1 = 0;
	for (i = 11; i > 2; i--) { soma1 += parseInt(nCpf.substr(nCpf.length-i,1)) * i  }
	soma1 = soma1 + dig1 * 2;
	resto = soma1 % 11;
	switch (resto) {
		case 0:
		case 1:
			dig2 = 0
			break
		default:
			dig2 = 11 - resto
			break
	}
	var controle = String(dig1) + String(dig2);
	if (controle == nCpf.substr(9)) { return true } else { return false }
}

String.prototype.ArteCodigo_replace = function(a,b) {
	var str = "";
	for (lS=0; lS < this.length; lS++)
	{
		if(this.indexOf(a))
		{
			str += this.charAt(lS).replace(a,b)
		}
	}
	return str;
}

/* verifica RG */
function ArteCodigoRG(campo) {
	vRg = eval("this.base."+campo+".value");
	vRg = vRg.ArteCodigo_replace(" ","")
	validChars = "0123456789x";
	if(vRg == "")
		return false

	if(isNaN(vRg.substring(0,vRg.lrngth-1)))
		return false

	if(isNaN(vRg.charAt(vRg.length)) && vRg.charAt(vRg.length).toUpperCase() != "X")
		return false;

	for(nL=0; nL < vRg.length; nL++){
		if(validChars.toLowerCase().indexOf(vRg.charAt(nL).toLowerCase()) == -1)
			return false
	}
	return true
}
/* verifica CNPJ */
function ArteCodigoCNPJ(campo) {
	VCNPJ = eval("this.base."+campo+".value");
	var NewCGC = "";
	var CGC = VCNPJ;

	invalidChars = " /:,;-..";
	for (i=0; i < invalidChars.length; i++) {
		badChar = invalidChars.charAt(i);
		VCNPJ = VCNPJ.replace(badChar,"");
		CGC = CGC.replace(badChar,"");
	}

	if (
	VCNPJ.length != 14 || VCNPJ == "00000000000000" || VCNPJ == "11111111111111" ||
	VCNPJ == "22222222222222" ||	VCNPJ == "33333333333333" || VCNPJ == "44444444444444" ||
	VCNPJ == "55555555555555" || VCNPJ == "66666666666666" || VCNPJ == "77777777777777" ||
	VCNPJ == "88888888888888" || VCNPJ == "99999999999999"
	) 
	{ return false; }
	var DVCGC = CGC.substring(0,12);

	var s1 = 0;
	for (i=1;i<=4;i++) { s1 = s1 + ((DVCGC.charAt(i-1))*(6-i)); }
	for (i=5;i<=12;i++) { s1 = s1 + ((DVCGC.charAt(i-1))*(14-i)); }
	r1 = s1 % 11;
	if (r1<2) { dv1=0; } else { dv1 = 11 - r1; }

	var s2 = dv1*2;
	for (i=1;i<=5;i++) { s2 = s2 + ((DVCGC.charAt(i-1))*(7-i)); }
	for (i=6;i<=12;i++) { s2 = s2 + ((DVCGC.charAt(i-1))*(15-i)); }
	r2 = s2 % 11;
	if (r2<2) { dv2=0; } else { dv2 = 11 - r2; }
	var DV = "";
	DV = DV + dv1 + dv2;

	var NewDV = CGC.substring(12,14)
	if (NewDV==DV) { return true; } else { return false; }
}
/* verifica data */
var dia="", mes="", ano="";
function ArteCodigoIsDate(campo) {
	if (campo==null) return false;
	if(InStr(campo,'_',0)){
		date = eval("this.base."+campo+".value")
	}else{
		date = campo
	}
	date = date.split('/');
	dia = date[0]; mes = date[1]; ano = date[2]
	if (
		( isNaN(parseInt(dia)) || isNaN(parseInt(mes)) || isNaN(parseInt(ano)) ) ||
		(ano < 1900 || ano > 9999) || 
		(mes < 1 || mes > 12) || 
		(dia < 1 || dia > 31) || 
		(mes == 2 && dia > 28 && (ano % 4 != 0)) || 
		(mes == 2 && dia > 29 && (ano % 4 == 0)) || 
		(dia > 30 && (mes == 4 || mes == 6 || mes == 9 || mes== 11))
	) { return false; } else { return true; }
}
/* InStr() */
function InStr(texto,c,posInicial){
	if (posInicial<0) posInicial=0;
	for(var i=posInicial; i<texto.length;i++){
		if(texto.charAt(i)==c) return true
	}
	return false
}
/* verifica caracteres válidos pa CEP */
function ArteCodigoIsCep(campo) {
	validChars = "0123456789-";
	cont = eval("this.base."+campo+".value");
	if(cont.indexOf("-") > -1){
		if(cont.length != 9){
			return false
		}
	} else {
		if(cont.length != 8){
			return false
		}
	}
	for (i=0; i < cont.length; i++) {
		asc =  cont.charAt(i);
		if (validChars.indexOf(asc) == -1){ 
			return false;
		}
	}
	return true;
}

/* função de comparar */
function ArteCodigoCompare(campo, sameday){
	data = eval("this.base."+campo+".value")
	entrada_saida = data.split(";")
	for(i=0; i < entrada_saida.length; i++){
		if(ArteCodigoIsDate(entrada_saida[i])){
			entrada_saida[i] = ano+mes+dia
		}else{
			return false
		}
	}
	if(sameday){
		if(entrada_saida[0] > entrada_saida[1]){
			return false
		}else{
			return true
		}
	}else{
		if(entrada_saida[0] >= entrada_saida[1]){
			return false
		}else{
			return true
		}
	}
}
/* verifica se o campo esta vazio */
function ArteCodigoIsEmpty(campo) {
	valor_campo = eval("this.base."+campo+".value")
	if (valor_campo.ArteCodigo_replace(" ","") == "") { return true; } else { return false; }
}
/* verifica se o campo e numerico */
function ArteCodigoIsNum(campo) {
	if (isNaN(eval("this.base."+campo+".value")) || (eval("this.base."+campo+".value") == "")) { return true; } else { return false; }
}
/* verifica se o campo e string */
function ArteCodigoIsStr(campo) {
	if (isNaN(eval("this.base."+campo+".value"))) { return true } else { return false }
}
/* retorna quantos caracteres tem no campo */
function ArteCodigoLength(campo) {
	return eval("this.base."+campo+".value.length");
}

/* valida quantidade de caracteres  */
function ArteCodigoVerLength(campo,qntde) {
	valueall = eval("this.base."+campo+".value.length");
	if(valueall > (qntde-1) || eval("this.base."+campo+".value") == ""){
		return false
	} else {
		return true
	}
}

/* verifica caracteres invalidos */
function ArteCodigoValidChar(campo) {
	invalidChars = "@/1:4,;5&#®$6!?7¨%89*-+{2}3[0]\)(><|=|ºÜÖÄ";
	cont = eval("this.base."+campo+".value");
	for (i=0; i < invalidChars.length; i++) {
		asc = invalidChars.charAt(i);
		if (cont.indexOf(asc, 0) > -1) return false
	}
	return true
}
/* verifica Radio e CheckBox*/
function ArteCodigoRadioCheck(campo,num_sele) {
	selecteds = (num_sele)? num_sele : 1
	eval("ini = this.base."+campo)
	good = 0
	if(ini[0]){
		for (rI=0; rI < ini.length; rI++) {
			if (ini[rI].checked){
				good++
			}
		}
	} else {
		if(ini.checked){
			good++
		}
	}
	if(num_sele){
		if(good != selecteds){
			return true
		} else {
			return false
		}
	} else {
		if(good < 1){
			return true
		} else {
			return false
		}
	}

}
/* verifica APENAS UM Checkbox */
function ArteCodigoIsOneCheckboxSelected(campo) {
	eval("ini = this.base."+campo)
	if (ini.checked) return false; 
	return true
}
/* faz busca de caracter definido */
function ArteCodigoFind(campo,c) {
	cont = eval("this.base."+campo+".value");
	if (cont.indexOf(c, 0) > - 1) { return true } else { return false }
}
/* seta focus */
function ArteCodigoFocus(campo) {
	return eval("this.base."+campo+".focus()");
}
/* faz troca de OPTION de um SELECT pra outro */
function ArteCodigoChangeOption(from, to) {
	this.cTo = eval("this.base."+to);
	this.cFrom = eval("this.base."+from);
	qtC = this.cFrom.length;
	for (f=0; f < qtC; f++) {
		if (this.cFrom.selectedIndex!=-1) {
			this.cTo.options[this.cTo.length] = new Option(this.cFrom.options[this.cFrom.selectedIndex].text, this.cFrom.options[this.cFrom.selectedIndex].value);
			this.cFrom.options[this.cFrom.selectedIndex] = null;
		}
	}
}
/* troca comboBox */
var ArteCodigoComboContent = new Array ();
function ArteCodigoSetCombo(campo,masterId,setFirst) {
	var SelectedIndex = 0;
	var Combo = eval("this.base."+campo);
	for (idxs = Combo.options.length - 1; idxs > 0; idxs--)
		Combo.options[idxs] = null;
		setFirst = (setFirst) ? setFirst : " ";
		Combo.options[0] = new Option(setFirst,'');
		var j = 1;
		for(i=0; i < ArteCodigoComboContent.length; i++) {
			if (ArteCodigoComboContent[i][0] == masterId) {
				var optionNew = new Option(ArteCodigoComboContent[i][2], ArteCodigoComboContent[i][1]);
				Combo.options[j] = optionNew;
				j++;
			}
		}
	Combo.options[0].selected = true;
}

/* Compara senhas */
function ArteCodigoComparePass(campo) {
	pass = eval("this.base."+campo+".value")
	senhas = pass.split(";");
	if(senhas[0].length < 6 || senhas[0].length > 10){
		return "Senha"
	} else if(senhas[0] != senhas[1] || senhas[1].length < 6 || senhas[1].length > 10){
		return "Confirmar Senha"
	} else {
		return true
	}
}

/* verifica Telefone */
function ArteCodigoIsTel(campo) {
	validChars = "0123456789 -.()/";
	cont = eval("this.base."+campo+".value");
	if(cont.length == 0){
		return false
	}
	for (i=0; i < cont.length; i++) {
		asc =  cont.charAt(i);
		if (validChars.indexOf(asc) == -1){ 
			return false;
		}
	}
	return true;
}

function isCel(dop){
	range_operadoras = []
	dop = dop.split(",")
	ddd = dop[0]
	valor = dop[1]
	operadora = dop[2]
	valor = valor.ArteCodigo_replace("-","")
	valid = false
	range_operadoras["ddd11"] = [
		["71",1],
		["95",1],
		["96",1],
		["97",1],
		["98",1],
		["99",1],
		["81",2],
		["82",2],
		["83",2],
		["84",2],
		["85",2],
		["91",3],
		["92",3],
		["93",3],
		["94",3]
	]
	
	range_operadoras["dddoutros"] = [
		["95",1],
		["96",1],
		["97",1],
		["98",1],
		["99",1],
		["81",2],
		["82",2],
		["83",2],
		["84",2],
		["85",2],
		["91",3],
		["92",3],
		["93",3],
		["94",3]
	]
	
	if(valor == "")
		return "Celular"

	if(isNaN(Math.floor(valor)))
		return "Celular"

	if(valor.charAt(0) < 7)
		return "Celular"
	
	if(valor.length != 8)
		return "Celular"
	
	firstNumbers = valor.substring(0,2)
	if(ddd != "null" && valor != "null" && operadora != "null"){
		if(ddd == 11){
			for(nO=0; nO < range_operadoras["ddd11"].length; nO++){
				if(range_operadoras["ddd11"][nO][0] == firstNumbers && range_operadoras["ddd11"][nO][1] == operadora){
					valid = true
				}
			}
		} else {
			for(nO=0; nO < range_operadoras["dddoutros"].length; nO++){
				if(range_operadoras["dddoutros"][nO][0] == firstNumbers && range_operadoras["dddoutros"][nO][1] == operadora){
					valid = true
				}
			}
		}
	} else {
		valid = true
	}
	if(!valid)
		return "Operadora/Celular"
	
	return true
}

/* submit no form */
function ArteCodigoSubmit() {
	return this.base.submit()
}
// envia dados com parametro de [ campo | tipo de validacao ]
ArteCodigoForm.prototype.sender = function(valida) {
	if (valida==null) return false;
	var campos = "";
	for (cVal=0; cVal < valida.length; cVal++) {
		for (cL=0; cL < this.elements.length; cL++) {
			if (this.elementsName[cL] == valida[cVal][0]) {
				setEmail = (valida[cVal][1]=='email') ? "!" : ""
				if ( eval(setEmail+"this."+valida[cVal][1]+"(this.elementsName[cL])") ) {
					campos += "\t > " + this.elementsName[cL].toUpperCase().ArteCodigo_replace("_"," ") + "\n"
				}
			}
		}
	}
	this.senderOther();
	if (campos!="") {
		var msg = "Os campos:\n\n" + campos + "\n estão preenchidos de forma incorreta. \n Por favor verifique se os dados estão \n corretamente preenchidos";
		alert(msg)
		return false;
	} else {
		this.submit();
	}
}

// valida automaticamente
ArteCodigoForm.prototype.senderPlus = function(valida, nome_bt) {
	var campos = "";
	var empty = true
	ultimo = ""
	for (cL=0; cL < this.elements.length; cL++) {
		// valida isEmpty
		if (this.elementsName[cL].toLowerCase().indexOf('empty_') != -1) {
			if (this.isEmpty(this.elementsName[cL]) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}
		// valida radio e checkBox
		if (this.elementsName[cL].toLowerCase().indexOf('radio_') != -1 || this.elementsName[cL].toLowerCase().indexOf('check_') != -1) {
			if(ultimo != this.elementsName[cL]){
				split_campo = this.elementsName[cL].split("_");
				param2 = (!isNaN(split_campo[1]))? split_campo[1] : null
				if (this.radio_check(this.elementsName[cL],param2) ) {
					if (campos.indexOf(this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase()) == -1) {
						campos += "\t > "
						if(!isNaN(split_campo[1])){
							for(i=2; i < split_campo.length; i++){
								campos += split_campo[i].toUpperCase() + " "
							}
						} else {
							campos += this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ")
						}
						campos += "\n"
					}
				}
			}
			ultimo = this.elementsName[cL]
		}
		// valida APENAS UM checkBox
		if (this.elementsName[cL].toLowerCase().indexOf('checkone_') != -1) {
			if (this.check_one(this.elementsName[cL]) ) {
				if (campos.indexOf(this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase()) == -1) {
					campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
				}
			}
		}
		// valida email
		if (this.elementsName[cL].toLowerCase().indexOf('email_') != -1) {
			if (!this.email(this.elementsName[cL]) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}
		// valida cpf
		if (this.elementsName[cL].toLowerCase().indexOf('cpf_') != -1) {
			if (!this.cpf(this.elementsName[cL]) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}
		// valida cnpj
		if (this.elementsName[cL].toLowerCase().indexOf('cnpj_') != -1) {
			if (!this.cnpj(this.elementsName[cL]) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}
		// valida RG
		if (this.elementsName[cL].toLowerCase().indexOf('rg_') != -1) {
			if (!this.isRg(this.elementsName[cL]) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}
		// valida data
		if (this.elementsName[cL].toLowerCase().indexOf('date_') != -1) {
			if (!this.isDate(this.elementsName[cL]) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}
		// compara data
		if (this.elementsName[cL].toLowerCase().indexOf('compare_') != -1) {
			if (!this.Compare(this.elementsName[cL]) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}
		if (this.elementsName[cL].toLowerCase().indexOf('compare2_') != -1) {
			if (!this.Compare(this.elementsName[cL], true) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}
		// valida campo Numérico
		if (this.elementsName[cL].toLowerCase().indexOf('num_') != -1) {
			if (this.isNum(this.elementsName[cL]) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}
		// valida quantidade de caracteres
		if (this.elementsName[cL].toLowerCase().indexOf('qtd_') != -1) {
			qtd = this.elementsName[cL].split("_")
			startname = this.elementsName[cL].indexOf(qtd[2])
			if (!this.Verlength(this.elementsName[cL],qtd[1])) {
				campos += "\t > " + this.elementsName[cL].substring(startname).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}

		// valida campo Telefone
		if (this.elementsName[cL].toLowerCase().indexOf('tel_') != -1) {
			if (!this.isTel(this.elementsName[cL]) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}

		// valida campo CEP
		if (this.elementsName[cL].toLowerCase().indexOf('cep_') != -1) {
			if (!this.isCep(this.elementsName[cL]) ) {
				campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}

		// Compara senhas
		if (this.elementsName[cL].toLowerCase().indexOf('comparepass_') != -1) {
			resultadoPass = this.comparepass(this.elementsName[cL]);
			//alert(resultadoPass)
			if (resultadoPass != true) {
				campos += "\t > " + resultadoPass.toUpperCase() + "\n"
			}
		}

		// Campo Concordo
		if (this.elementsName[cL].toLowerCase().indexOf('concordo') != -1) {
			campo = this.base.elements[cL].value
			if (campo == 2 && this.base.elements[cL].checked) {
				campos += "\t > " + this.elementsName[cL].toUpperCase().ArteCodigo_replace("_"," ") + "\n"
			}
		}

		// Validação especifica para o cadastro oportunidades, Outro idioma
		if (this.elementsName[cL].toLowerCase().indexOf('outroidioma_') != -1) {
			campo = this.base.elements[cL].value
			if(campo != ""){
				campo = campo.ArteCodigo_replace(" ","").split(";")
				if (campo[0] == "" || campo[1] == "") {
					campos += "\t > " + this.elementsName[cL].substring(this.elementsName[cL].indexOf('_')+1).toUpperCase().ArteCodigo_replace("_"," ") + "\n"
				}
			}
		}

		// Validação especifica para o cadastro oportunidades, Parentes
		if (this.elementsName[cL].toLowerCase().indexOf('parente_') != -1) {
			campo = this.base.elements[cL].value
			if(campo != ""){
				campo = campo.ArteCodigo_replace(" ","").split(";");
				if(!campo[0] || campo[0] == ""){
					campos += "\t > NOME PARENTE \n"
				}
				if (!campo[1] || campo[1] == "") {
					campos += "\t > GRAU DE PARENTESCO \n"
				}
			}
		}

		// Validação especifica para o cadastro oportunidades, Parentes
		if (this.elementsName[cL].toLowerCase().indexOf('indicado_') != -1) {
			campo = this.base.elements[cL].value
			if(campo != ""){
				campo = campo.ArteCodigo_replace(" ","").split(";");
				if(!campo[0] || campo[0] == ""){
					campos += "\t > NOME DO INDICADOR \n"
				}
				if (!campo[1] || campo[1] == "") {
					campos += "\t > AREA DO INDICADOR \n"
				}
			}
		}

		// Validação especifica para o cadastro oportunidades, indicação
		if (this.elementsName[cL].toLowerCase().indexOf('indicacao_') != -1) {
			campo = this.base.elements[cL].value
			if(campo != ""){
				campo = campo.ArteCodigo_replace(" ","").split(";");
				if(campo[0]){
					dataok = true
					separa_data = campo[0].split("[a]")
					if(!separa_data[0] || separa_data[0] == "" || !separa_data[1] || separa_data[1] == ""){
						dataok = false
					} else if(separa_data[1] < separa_data[0]){
						dataok = false
					}
					if(!dataok){
						campos += "\t > PERIODO \n"
					}
				}

				if (!campo[1] || campo[1] == "") {
					campos += "\t > ÁREA \n"
				}
				if(!campo[2] || campo[2] == ""){
					campos += "\t > NOME DO SUPERIOR IMEDIATO \n"
				}
			}
		}

		// Validação especifica para o cadastro oportunidades, Parte 2 - Periodo
		if (this.elementsName[cL].toLowerCase().indexOf('compara_periodo') != -1) {
			campo = this.base.elements[cL].value.ArteCodigo_replace(" ","").split(";");
			periodook = true
			if(!campo[0] || campo[0] == ""){
				periodook = false
			} else if(campo[0].length < 6){
				periodook = false
			}
			if (campo[1] || campo[1] != "") {
				if(Math.floor(campo[0]) > Math.floor(campo[1])){
					periodook = false
				}
			}
			if(!periodook)
				campos += "\t > PERIODO \n"
		}
	}

	this.senderOther();
	if (campos!="") {
		var msg = "Os campos abaixo seguem incorretos.\n\n" + campos + "\n Por favor verifique os dados.";
		alert(msg);
		return false;
	} else {
		if (nome_bt){
			eval("this.base."+ nome_bt +".disabled = true");
			eval("this.base."+ nome_bt +".style.width = 100");
			eval("this.base."+ nome_bt +".value = 'Processando'");
		}
		this.submit();
	}
}

function submitPlus(nome_obj, nome_bt){
	if(objForm[nome_obj]){
		objForm[nome_obj].senderPlus(null, nome_bt);
	} else {
		ArteCodigoFormIni();
		if(objForm[nome_obj]){
			objForm[nome_obj].senderPlus(null, nome_bt);
		} else {
			alert("Formulário \"" + nome_obj +  "\" não foi encontrado")
			return false
		}
	}
}


ArteCodigoForm.prototype.email 					= ArteCodigoValidaEmail
ArteCodigoForm.prototype.cpf 						= ArteCodigoValidaCpf
ArteCodigoForm.prototype.cnpj 					= ArteCodigoCNPJ
ArteCodigoForm.prototype.isRg						= ArteCodigoRG
ArteCodigoForm.prototype.isDate					= ArteCodigoIsDate
ArteCodigoForm.prototype.Compare				= ArteCodigoCompare
ArteCodigoForm.prototype.isEmpty 				= ArteCodigoIsEmpty
ArteCodigoForm.prototype.isNum 					= ArteCodigoIsNum
ArteCodigoForm.prototype.isTel 					= ArteCodigoIsTel
ArteCodigoForm.prototype.isCep 					= ArteCodigoIsCep
ArteCodigoForm.prototype.isStr 					= ArteCodigoIsStr
ArteCodigoForm.prototype.length 				= ArteCodigoLength
ArteCodigoForm.prototype.Verlength 			= ArteCodigoVerLength
ArteCodigoForm.prototype.validChar	 		= ArteCodigoValidChar
ArteCodigoForm.prototype.radio_check 		= ArteCodigoRadioCheck
ArteCodigoForm.prototype.check_one			= ArteCodigoIsOneCheckboxSelected
ArteCodigoForm.prototype.find 					= ArteCodigoFind
ArteCodigoForm.prototype.focus 					= ArteCodigoFocus
ArteCodigoForm.prototype.changeOption 	= ArteCodigoChangeOption
ArteCodigoForm.prototype.setCombo 			= ArteCodigoSetCombo
ArteCodigoForm.prototype.submit 				= ArteCodigoSubmit
ArteCodigoForm.prototype.comparepass		= ArteCodigoComparePass
