function validaContato() {
	
	var Form;
	Form = document.form1;
	
	if (Form.nome.value.length == 0) {
		alert("O preenchimento do nome é obrigatório!");
		Form.nome.focus();
		return false;
	}
	if (Form.fone.value.length == 0) {
		alert("O preenchimento do telefone é obrigatório!");
		Form.fone.focus();
		return false;
	}
	if (Form.cidade.value.length == 0) {
		alert("O preenchimento da cidade  é obrigatório!");
		Form.cidade.focus();
		return false;
	}
	if (Form.uf.value.length == 0) {
		alert("O preenchimento do estado  é obrigatório!");
		Form.uf.focus();
		return false;
	}
	if (Form.email.value.length == 0) {
		alert("O preenchimento do email  é obrigatório!");
		Form.email.focus();
		return false;
	}
	if (Form.mensagem.value.length == 0) {
		alert("O preenchimento da mensagem  é obrigatório!");
		Form.mensagem.focus();
		return false;
	}
	
	// define a list of invalid characters
	
	invalidCharsList = " /:,;~#";

	if ( Form.email.value.indexOf('@',0)==-1 || Form.email.value.indexOf('@',0)== 0 || Form.email.value.indexOf('.',0)==-1) {
		 alert("O endereço de e-mail parece ser inválido!");
		 Form.email.select();
		 Form.email.focus();
		 return (false);
	}
	for (i = 0; i < invalidCharsList.length; i++) {
	  errorChar = invalidCharsList.charAt(i);
	  if (Form.email.value.indexOf(errorChar,0) != -1) {
		Form.email.select();
		Form.email.focus();
		return (false);
	  }
	}	

	 //Form.submit();
	 document.form1.submit();
	 return true;

}

function validaTrabalhe() {
	
	var Form;
	Form = document.Edicao;
	
	if (Form.nome.value.length == 0) {
		alert("O preenchimento do nome é obrigatório!");
		Form.nome.focus();
		return false;
	}
	if (Form.fone.value.length == 0) {
		alert("O preenchimento do telefone é obrigatório!");
		Form.fone.focus();
		return false;
	}
	if (Form.cidade.value.length == 0) {
		alert("O preenchimento da cidade  é obrigatório!");
		Form.cidade.focus();
		return false;
	}
	if (Form.uf.value.length == 0) {
		alert("O preenchimento do estado  é obrigatório!");
		Form.uf.focus();
		return false;
	}
	if (Form.email.value.length == 0) {
		alert("O preenchimento do email  é obrigatório!");
		Form.email.focus();
		return false;
	}
	
	// define a list of invalid characters
	
	invalidCharsList = " /:,;~#";

	if ( Form.email.value.indexOf('@',0)==-1 || Form.email.value.indexOf('@',0)== 0 || Form.email.value.indexOf('.',0)==-1) {
		 alert("O endereço de e-mail parece ser inválido!");
		 Form.email.select();
		 Form.email.focus();
		 return (false);
	}
	for (i = 0; i < invalidCharsList.length; i++) {
	  errorChar = invalidCharsList.charAt(i);
	  if (Form.email.value.indexOf(errorChar,0) != -1) {
		Form.email.select();
		Form.email.focus();
		return (false);
	  }
	}	

	 //Form.submit();
	 document.Edicao.submit();
	 return true;

}

function validaCadastro() {

			var Form;
			Form = document.form1;

		if (Form.nome.value.length == 0) {
			alert("O preenchimento do nome fantasia é obrigatório!");
			Form.nome.focus();
			return false;
		}
		if (Form.razao.value.length == 0) {
			alert("O preenchimento da razao social  é obrigatório!");
			Form.razao.focus();
			return false;
		}
		if (Form.cnpj.value.length == 0) {
			alert("O preenchimento do cnpj  é obrigatório!");
			Form.cnpj.focus();
			return false;
		}
		if (Form.endereco.value.length == 0) {
			alert("O preenchimento do endereco  é obrigatório!");
			Form.endereco.focus();
			return false;
		}
		if (Form.cidade.value.length == 0) {
			alert("O preenchimento da cidade  é obrigatório!");
			Form.cidade.focus();
			return false;
		}
		if (Form.uf.value.length == 0) {
			alert("O preenchimento do estado  é obrigatório!");
			Form.uf.focus();
			return false;
		}
		if (Form.bairro.value.length == 0) {
			alert("O preenchimento do bairro  é obrigatório!");
			Form.bairro.focus();
			return false;
		}
		if (Form.cep.value.length == 0) {
			alert("O preenchimento do cep  é obrigatório!");
			Form.cep.focus();
			return false;
		}
		if (Form.telComercial.value.length == 0) {
			alert("O preenchimento do telefone comercial  é obrigatório!");
			Form.telComercial.focus();
			return false;
		}
		if (Form.email.value.length == 0) {
			alert("O preenchimento do email  é obrigatório!");
			Form.email.focus();
			return false;
		}
		
		// define a list of invalid characters
		
		invalidCharsList = " /:,;~#";
	
		if ( Form.email.value.indexOf('@',0)==-1 || Form.email.value.indexOf('@',0)== 0 || Form.email.value.indexOf('.',0)==-1) {
				 alert("O endereço de e-mail parece ser inválido!");
				 Form.email.select();
				 Form.email.focus();
				 return (false);
		}
		for (i = 0; i < invalidCharsList.length; i++) {
		  errorChar = invalidCharsList.charAt(i);
		  if (Form.email.value.indexOf(errorChar,0) != -1) {
			Form.email.select();
			Form.email.focus();
			return (false);
		  }
		}			
		
	
		 //Form.submit();
		 document.form1.submit();
		 return true;
	
}


function formataCampo(e,src,mask) {
    if(window.event) { _TXT = e.keyCode; }
    else if(e.which) { _TXT = e.which; }
    if(_TXT > 47 && _TXT < 58) {
 var i = src.value.length; var saida = mask.substring(0,1); var texto = mask.substring(i)
 if (texto.substring(0,1) != saida) { src.value += texto.substring(0,1); }
    return true; } else { if (_TXT != 8) { return false; }
 else { return true; }
    }
}