//----------------------------------------------Funcoes de validacao de dado-----------------------------------------------------

//Valida CNPJ
function testa_CNPJ(x){

		if (x.value == "00.000.000/0000-00") {
			mostra_DadosCliente()
			alert('O CNPJ digitado é inválido!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		 }
		 
		if (x.value == "") {
			mostra_DadosCliente()
			alert('O CNPJ deve ser preenchido!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		 }
		 
		 /*Calculo do 1º digito */
		 var valcnpj=x.value;
		 var valor1=(valcnpj.substr(0,1))*5;
		 var valor2=(valcnpj.substr(1,1))*4;
		 var valor3=(valcnpj.substr(3,1))*3;
		 var valor4=(valcnpj.substr(4,1))*2;
		 var valor5=(valcnpj.substr(5,1))*9;
		 var valor6=(valcnpj.substr(7,1))*8;
		 var valor7=(valcnpj.substr(8,1))*7;
		 var valor8=(valcnpj.substr(9,1))*6;
		 var valor9=(valcnpj.substr(11,1))*5;
		 var valor10=(valcnpj.substr(12,1))*4;
		 var valor11=(valcnpj.substr(13,1))*3;
		 var valor12=(valcnpj.substr(14,1))*2;
		 var soma=valor1+valor2+valor3+valor4+valor5+valor6+valor7+valor8+valor9+valor10+valor11+valor12;
		 var resto=soma%11;
		 var digito1;
		 if (resto<2){
		 	digito1=0;
		 }else{
		 	digito1=11-resto;
		  }
		  
		  /*Cálculo do 2º dígito verificador*/
		 var valor1b=(valcnpj.substr(0,1))*6;
		 var valor2b=(valcnpj.substr(1,1))*5;
		 var valor3b=(valcnpj.substr(3,1))*4;
		 var valor4b=(valcnpj.substr(4,1))*3;
		 var valor5b=(valcnpj.substr(5,1))*2;
		 var valor6b=(valcnpj.substr(7,1))*9;
		 var valor7b=(valcnpj.substr(8,1))*8;
		 var valor8b=(valcnpj.substr(9,1))*7;
		 var valor9b=(valcnpj.substr(11,1))*6;
		 var valor10b=(valcnpj.substr(12,1))*5;
		 var valor11b=(valcnpj.substr(13,1))*4;
		 var valor12b=(valcnpj.substr(14,1))*3;
		 var valor13b=(valcnpj.substr(16,1))*2;
		 var somab=valor1b+valor2b+valor3b+valor4b+valor5b+valor6b+valor7b+valor8b+valor9b+valor10b+valor11b+valor12b+valor13b;
		 var restob=somab%11;
		 var digito2;
		 if (restob<2){
		 	digito2=0;
		 }else{
		 	digito2=11-restob;
		  }
		  
		 /* Testa a consistência do CNPJ*/
		 if ((valcnpj.substr(2,1)!=".") || (valcnpj.substr(6,1)!=".") || (valcnpj.substr(10,1)!="/") || (valcnpj.substr(15,1)!="-") || (valcnpj.length!=18)){
			 mostra_DadosCliente()
			alert('O CNPJ deve estar no formato XX.XXX.XXX/XXXX-XX!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		 }
		 
		 /* Testa a consistência dos digitos verificadores do CNPJ*/
		 if ((valcnpj.substr(16,1)!=digito1) || (valcnpj.substr(17,1)!=digito2)){
			mostra_DadosCliente()
			alert('Os dígitos verificadores do CNPJ não estão corretos!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		 }
		 
		 return 0;

}


function testa_CEP(x){

	var valcep=x.value;
		  if (x.value == "") {
			  mostra_DadosCliente()
			alert('O CEP deve ser preenchido!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		  }
		 
		  if (valcep.length=='00000-000') {
			  mostra_DadosCliente()
			alert('O CEP digitado não é válido!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		 }
		  
		  if (valcep.length!=9) {
			  mostra_DadosCliente()
			alert('O CEP deve estar no formato XXXXX-XXX!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		 }
		 
		 if ((valcep.substr(5,1)!="-") || (isNaN(valcep.substr(0,5))) || (isNaN(valcep.substr(6,3)))){
			mostra_DadosCliente()
			alert('O CEP deve estar no formato XXXXX-XXX!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		 }
		 
		 return 0;

}

function testa_CPF(x){

	var valcpf=x.value;
		  if (x.value == "") {
			  mostra_DadosCliente()
			alert('O CPF deve ser preenchido!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		  }
		 
		  if (valcpf.length=='000.000.000-00') {
			mostra_DadosCliente()
			alert('O CPF digitado não é válido!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		 }
		  
		  if (valcpf.length!=14) {
			mostra_DadosCliente()
			alert('O CPF deve estar no formato XXX.XXX.XXX-XX!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		 }
		 
		 if ((valcpf.substr(3,1)!=".") || (valcpf.substr(7,1)!=".") || (valcpf.substr(11,1)!="-") || (isNaN(valcpf.substr(0,3))) || (isNaN(valcpf.substr(4,3))) || (isNaN(valcpf.substr(8,3))) || (isNaN(valcpf.substr(12,2)))){
			mostra_DadosCliente()
			alert('O CPF deve estar no formato XXX.XXX.XXX-XX!');
			x.focus();
			mostra_DadosCliente()
			return 1;
		 }
		 
		 return 0;

}

function ignora_Enter(e){
    try{var keyCode1 = e.which          }catch(er){};
    try{var keyCode1 = e.keyCode    }catch(er){};
    if (keyCode1 == 13) {
        return false;
    }
}

//Arruma a tela de acordo com a PESSOA -Jurídica ou Física
function mostra_DadosCliente(){
	if(document.getElementById('cmb_pessoa').value=='Fisica'){
		document.getElementById('razaosocial').style.display='none';
		document.getElementById('nome').style.display='block';
		document.getElementById('nomefantasia').style.display='none';
		document.getElementById('apelido').style.display='block';
		document.getElementById('cnpj').style.display='none';
		document.getElementById('cpf').style.display='block';
		document.getElementById('ie').style.display='none';
		document.getElementById('rg').style.display='block';
		document.getElementById('bt_gravar').disabled=false;
	}
	if(document.getElementById('cmb_pessoa').value=='Juridica'){
		document.getElementById('razaosocial').style.display='block';
		document.getElementById('nome').style.display='none';
		document.getElementById('nomefantasia').style.display='block';
		document.getElementById('apelido').style.display='none';
		document.getElementById('cnpj').style.display='block';
		document.getElementById('cpf').style.display='none';
		document.getElementById('ie').style.display='block';
		document.getElementById('rg').style.display='none';
		document.getElementById('bt_gravar').disabled=false;
	}
	if(document.getElementById('cmb_pessoa').value=='0'){
		document.getElementById('razaosocial').style.display='none';
		document.getElementById('nome').style.display='none';
		document.getElementById('nomefantasia').style.display='none';
		document.getElementById('apelido').style.display='none';
		document.getElementById('cnpj').style.display='none';
		document.getElementById('cpf').style.display='none';
		document.getElementById('ie').style.display='none';
		document.getElementById('rg').style.display='none';
		document.getElementById('bt_gravar').disabled=true;
	}	
}


function zera_DadosCliente(){
	if(document.getElementById('cmb_pessoa').value=='Fisica'){
		document.getElementById('razaosocial').style.display='';
		document.getElementById('nomefantasia').style.display='';
		document.getElementById('cnpj').style.display='';
		document.getElementById('ie').style.display='';
	}
	if(document.getElementById('cmb_pessoa').value=='Juridica'){
		document.getElementById('nome').style.display='';
		document.getElementById('apelido').style.display='';
		document.getElementById('cpf').style.display='';
		document.getElementById('rg').style.display='';
	}
}

//OPERACOES
function mostra_Campos(){
	if(document.getElementById('cmb_operacao').value!='MudancaLocal'){
		document.getElementById('cli').style.display='block';
		document.getElementById('nota').style.display='block';
		document.getElementById('valor_nota').style.display='block';
		document.getElementById('real').style.display='block';
	}else{
		document.getElementById('cli').style.display='none';
		document.getElementById('nota').style.display='none';
		document.getElementById('real').style.display='none';
		document.getElementById('valor_nota').style.display='none';
		document.getElementById('valor_nota').value='';
		document.getElementById('cli').value='';
		document.getElementById('nota').value='';
		document.getElementById('real').value='';
	}
}
//---------------------------------------------------------Ate aki--------------------------------------------------------------
//Valida Formulário de Clientes
function Valida_Cliente(formulario){
	with (formulario){
		if(cmb_pessoa.value=='Juridica'){
			if (txt_razaosocial.value.length<=5){
				mostra_DadosCliente()
				alert('A RAZÃO SOCIAL deve ser preenchida com mais de 5 caracteres!');
				txt_razaosocial.focus();
				mostra_DadosCliente()
				return false;
			}
		}
		
		if(cmb_pessoa.value=='Fisica'){
			if (txt_nome.value.length<=5){
				mostra_DadosCliente()
				alert('O NOME deve ser preenchido com mais de 5 caracteres!');
				txt_nome.focus();
				mostra_DadosCliente()
				return false;
			}
		}
		
		if(cmb_pessoa.value=='Juridica'){
			if (txt_nomefantasia.value.length<=5){
				mostra_DadosCliente()
				alert('O NOME FANTASIA deve ser preenchido com mais de 5 caracteres!');
				txt_nomefantasia.focus();
				mostra_DadosCliente()
				return false;
			}
		}
		
		if(cmb_pessoa.value=='Fisica'){
			if (txt_apelido.value.length<=2){
				mostra_DadosCliente()
				alert('O APELIDO deve ser preenchido com mais de 2 caracteres!');
				txt_apelido.focus();
				mostra_DadosCliente()
				return false;
			}
		}
		
		if(cmb_pessoa.value=='Juridica'){
			if (testa_CNPJ(txt_cnpj)==1){
				mostra_DadosCliente()
				return false;
			} 
		}
		
		if(cmb_pessoa.value=='Fisica'){
			if (testa_CPF(txt_cpf)==1){
				mostra_DadosCliente()
				return false;
			}
		}
		
		if (testa_CEP(txt_cep)==1){
			mostra_DadosCliente()
			return false;
		}
		
		if (txt_logradouro.value<=5){
			mostra_DadosCliente()
			alert('O LOGRADOURO deve ser preenchido com mais de 5 caracteres!');
			txt_logradouro.focus();
			mostra_DadosCliente()
			return false;
		}
		
		if (txt_numero.value==''){
			mostra_DadosCliente()
			alert('O NÚMERO deve ser preenchido!');
			txt_numero.focus();
			mostra_DadosCliente()
			return false;
		}
		
		if (txt_bairro.value<=5){
			mostra_DadosCliente()
			alert('O BAIRRO deve ser preenchido com mais de 5 caracteres!');
			txt_bairro.focus();
			mostra_DadosCliente()
			return false;
		}
		
		if (txt_cidade.value<=5){
			mostra_DadosCliente()
			alert('A CIDADE deve ser preenchida com mais de 5 caracteres!');
			txt_cidade.focus();
			mostra_DadosCliente()
			return false;
		}
		
		if (txt_contato.value.length<=5){
			mostra_DadosCliente()
			alert('O CONTATO deve ser preenchido com mais de 5 caracteres!');
			txt_contato.focus();
			mostra_DadosCliente()
			return false;
		}
		
		var valtelefone1=txt_telefone.value;
		 
		  if (txt_telefone.value == "") {
			mostra_DadosCliente()
			alert('O Telefone1 deve ser preenchido!');
			txt_telefone.focus();
			mostra_DadosCliente()
			return false;
		 }
		 
		  if (valtelefone1.length!=14) {
			mostra_DadosCliente()
			alert('O Telefone1 deve estar no formato (XX) XXXX-XXXX!');
			txt_telefone.focus();mostra_DadosCliente()
			return false;
		 }
		 
		  if ((isNaN(valtelefone1.substr(1,2))) || (isNaN(valtelefone1.substr(5,4))) || (isNaN(valtelefone1.substr(10,4)))){
			mostra_DadosCliente()
			alert('O Telefone1 deve ser numérico!');
			txt_telefone.focus();
			mostra_DadosCliente()
			return false;
		 }
		
		var valtelefone2=txt_telefone2.value;
		 
		 if (txt_telefone2.value!=""){
		  if (valtelefone2.length!=14) {
			mostra_DadosCliente()
			alert('O Telefone2 deve estar no formato (XX) XXXX-XXXX!');
			txt_telefone2.focus();
			mostra_DadosCliente()
			return false;
		 }
		  if ((isNaN(valtelefone2.substr(1,2))) || (isNaN(valtelefone2.substr(5,4))) || (isNaN(valtelefone2.substr(10,4)))){
			mostra_DadosCliente()
			alert('O Telefone2 deve ser numérico!');
			txt_telefone2.focus();
			mostra_DadosCliente()
			return false;
		  }
		 }
		
		if (txt_email.value!= ""){
			parte1 = txt_email.value.indexOf("@");
			parte2 = txt_email.value.length;
			if (!(parte1 >= 3 && parte2 >= 9)) {
				mostra_DadosCliente()
				alert ("O E-MAIL digitado não é válido.");
				txt_email.focus();
				mostra_DadosCliente()
				return false;
			}
		}
		return true;
	}
}

//Valida Formulário de Clientes
function Valida_Produto(formulario){
	with (formulario){
		 
		if (txt_nome.value.length<=5){
			alert('O NOME deve ser preenchido com mais de 5 caracteres!');
			txt_nome.focus();
			return false;
		}
		
		if (txt_modelo.value.length<=5){
			alert('O MODELO deve ser preenchido com mais de 5 caracteres!');
			txt_modelo.focus();
			return false;
		}
		
		if (txt_fabricante.value.length<=5){
			alert('O FABRICANTE deve ser preenchido com mais de 5 caracteres!');
			txt_fabricante.focus();
			return false;
		}
		
		if (txt_descricao.value.length<=5){
			alert('A DESCRICAO deve ser preenchida com mais de 5 caracteres!');
			txt_descricao.focus();
			return false;
		}
		
		return true;
	}
}

//Valida Formulário de Clientes
function Valida_Entrada(formulario){
	with (formulario){
		 
		if (cmb_status.value=='0'){
			alert('Um STATUS deve ser escolhido!');
			return false;
		}
		
		if (cmb_localizacao.value=='0'){
			alert('UMA LOCALIZAÇÃO deve ser escolhida!');
			cmb_localizacao.focus();
			return false;
		}
		
		if (cmb_situacao.value=='0'){
			alert('Uma SITUAÇÃO deve ser escolhida!');
			return false;
		}
		
		if (cmb_produto.value.length=='0'){
			alert('Um PRODUTO deve ser escolhido!');
			return false;
		}
		
		if (txt_codigodebarra.value.length<1){
			alert('O CODIGO DE BARRA deve ser preenchido!');
			txt_codigodebarra.focus();
			return false;
		}
		
		return true;
	}
}

//Valida Formulário de Clientes
function Valida_Operacao(formulario){
	with (formulario){
		var data=data_movimentacao.value;
		if(data=='' || isNaN(data.substr(0,2)) || data.substr(2,1)!='/' || isNaN(data.substr(3,2)) || data.substr(5,1)!='/' || isNaN(data.substr(6,4))){
			alert('DATA inválida!');
			return false;
		}
		
		if (cmb_operacao.value.length=='0'){
			alert('Uma OPERAÇÃO deve ser escolhida!');
			return false;
		}
		
		if (cmb_localizacao.value=='0'){
			alert('Uma LOCALIZAÇÃO deve ser escolhida!!');
			cmb_localizacao.focus();
			return false;
		}
		
		if(cmb_operacao!='MudancaLocal'){
			if (cmb_cliente.value=='0'){
				alert('Um CLIENTE deve ser escolhido!');
				return false;
			}
			
			if (txt_valornota.value.length<1){
				alert('O VALOR DA NOTA deve ser preenchido!');
				txt_valornota.focus();
				return false;
			}
			
			if (txt_valorreal.value.length<1){
				alert('O VALOR REAL deve ser preenchido!');
				txt_valorreal.focus();
				return false;
			}
		}
		
		return true;
	}
}


//Função que troca o ' pelo "" (branco), não deixa colocar '
function Apost(x){ 
var ascii = "%27";   
var character = unescape(ascii); /* retorna o caracter dado o codigo ASCII HEXADEC, no caso do '*/
	with (document.forms[0]){
	var teste=x.value;
	var tamanho = teste.length;
	var i;
		for(i=0;i<tamanho;i++){
		 if (teste.substr(i,1)==character) {
			x.focus();
			var valor_novo="";
			var j;
			for(j=0;j<teste.length;j++){
				if (teste.substr(j,1)==character){
				valor_novo=valor_novo+"";
				}else{
					valor_novo=valor_novo+teste.substr(j,1);
				}
			}
			x.value=valor_novo;
			return false;
		 }
		}
		return true;
	}
}

//Função para voltar para página principal
function Abre(x){ 
	window.open(x,"info");
}

//Valida Formulário de Alteração de Senha
function Valida_Senha(){ 
	with (document.forms[0]){
		 if (txt_senha_atual.value == "") {
			alert('O campo SENHA deve ser preenchido!');
			txt_senha_atual.focus();
			return false;
		 }
		 
		 if (txt_senha_nova.value == "") {
			alert('O campo SENHA NOVA deve ser preenchido!');
			senhanova.focus();
			return false;
		 }
		 
		 if (txt_confirmacao.value == "") {
			alert('O campo de CONFIRMAÇÃO DE SENHA deve ser preenchido!');
			txt_confirmacao.focus();
			return false;
		 }
		 if (txt_senha_nova.value.length<=4){
		 	alert('A SENHA deve conter mais de 4 caracteres!')
			txt_senha_nova.focus();
			return false;
		 }
		 
		 if (txt_confirmacao.value!=txt_senha_nova.value){
		 	alert('Os campos SENHA e CONFIRMAÇÃO DE SENHA devem ser iguais!');
			txt_confirmacao.focus();
		 	return false;
		 } 
		 
		return true;
	}
}


//Coloca o foco num campo escolhido da página
function Foco(x){ 
	document.forms[0].elements[x].focus();
}

function Valida_Usuario(){
	with (document.forms[0]){
		if (cmb_integrador.value=='0'){
			alert('Um INTEGRADOR deve ser escolhido!');
			cmb_integrador.focus();
			return false;
		}
	
		if (txt_nome.value.length<3){
			alert('O NOME deve ser preenchido com mais de 2 caracteres!');
			txt_nome.focus();
			return false;
		}
		
		if (txt_email.value.length<10){
			alert('O E-MAIL deve ser preenchido com mais de 10 caracteres!');
			txt_email.focus();
			return false;
		}
		
		if (txt_email.value!= ""){
			parte1 = txt_email.value.indexOf("@");
			parte2 = txt_email.value.length;
			if (!(parte1 >= 3 && parte2 >= 9)) {
				alert ("O E-MAIL digitado não é válido.");
				txt_email.focus();
				return false;
			}
		}

		
		if (txt_login.value.length<3){
			alert('O LOGIN deve ser preenchido com mais de 4 caracteres!');
			txt_login.focus();
			return false;
		}
		
		if (cmb_permissao.value=='S'){
			alert('Um NÍVEL DE PERMISSÃO deve ser escolhido!');
			cmb_permissao.focus();
			return false;
		}
		
		return true;
	}
}



function esconde_Div(){
	document.getElementById('Layer1').style.visibility='hidden';
}

function mostra_Div(){
	document.getElementById('Layer1').style.visibility='visible';
}

function esconde_Div20(){
	document.getElementById('Layer20').style.visibility='hidden';
}

function mostra_Div20(){
	document.getElementById('Layer20').style.visibility='visible';
}

function esconde_Div3(){
	document.getElementById('Layer3').style.visibility='hidden';
}

function mostra_Div3(){
	if (document.getElementById('usuario').value!=0){
		document.getElementById('Layer3').style.visibility='visible';
	}else{
		alert("Para adicionar um checkout é necessário selecionar um servidor!");
	}
}

function esconde_Div2(){
	document.getElementById('Layer2').style.visibility='hidden';
}

function mostra_Div2(){
	document.getElementById('Layer2').style.visibility='visible';
}

function esconde_Div12(){
	document.getElementById('Layer12').style.visibility='hidden';
}

function mostra_Div12(){
	document.getElementById('Layer12').style.visibility='visible';
}

function esconde_Div13(){
	document.getElementById('Layer13').style.visibility='hidden';
}

function mostra_Div13(){
	document.getElementById('Layer13').style.visibility='visible';
}

function esconde_Div4(){
	document.getElementById('Layer4').style.visibility='hidden';
}

function mostra_Div4(){
	document.getElementById('Layer4').style.visibility='visible';
}

function esconde_Div100(){
	document.getElementById('Layer100').style.visibility='hidden';
}

function mostra_Div100(){
	document.getElementById('Layer100').style.visibility='visible';
}

function mostra_Parceiro(){
	if(document.getElementById('cmb_status').value==6){
		document.getElementById('Layer2').style.visibility='visible';
	}else{
		document.getElementById('Layer2').style.visibility='hidden';
		document.getElementById('cmb_parceiro').value=0;
		document.getElementById('cmb_parceiro').label='Selecionar';
		
	}
}

function ignora_Back(e,f){
    try{var keyCode1 = e.which          }catch(er){};
    try{var keyCode1 = e.keyCode    }catch(er){};
    if (keyCode1 == 8) {
        return false;
    }
	 if (keyCode1 == 13) {
		f();
        return false;
    }
}

function submete_Enter(e,f){
    try{var keyCode1 = e.which          }catch(er){};
    try{var keyCode1 = e.keyCode    }catch(er){};
    if (keyCode1 == 13) {
		f();
        return false;
    }
}

function libera_Botao(nome,valor){
	if (valor!=0){
		document.getElementById(nome).disabled=false;
	}else{
		document.getElementById(nome).disabled=true;
	}
}

function Desbloqueia_Campos(){
	
	document.getElementById('cmb_uf').disabled=false;
	document.getElementById('txt_cidade').disabled=false;
	document.getElementById('txt_bairro').disabled=false;
	document.getElementById('txt_logradouro').disabled=false;
	document.getElementById('cmb_uf2').disabled=false;
	document.getElementById('txt_cidade2').disabled=false;
	document.getElementById('txt_bairro2').disabled=false;
	document.getElementById('txt_logradouro2').disabled=false;
}

function trava_Botao(x){
	if (x==1){
		document.getElementById('bt_gravar').disabled=true;	
	}else{
		document.getElementById('bt_gravar').disabled=false;
	}	
}
/*
//Insere Logico e Bandeira na tabela no CADASTRO de CHECKOUT
function insereColuna(nome,campo1,campo2){
	var tabela=document.getElementById(nome);
	var logico=document.getElementById(campo1);
	var bandeira=document.getElementById(campo2);
	
	tabela.insertRow(1);
	tabela.rows[1].insertCell(0);
	tabela.rows[1].insertCell(1);
	tabela.rows[1].cells[0].innerHTML=logico.value;
	tabela.rows[1].cells[1].innerHTML=bandeira.value;
}

function contaTabela(nome){
	var tabela=document.getElementById(nome);
	
	var i;
	i=1;
	var cont=0;
		while(tabela.rows[i]){
			//alert(tabela.rows[i].innerHTML);
			i=i+1;
			cont=cont+1;			
		}
		return cont;
}

function leTabela(nome){
	var tabela=document.getElementById(nome);
	var contador=contaTabela(nome);
	var bandeira= new Array();
	var logico= new Array();
	
	for(var i=0;i<contador;i++){		
		bandeira[i]=tabela.rows[i+1].cells[0].innerHTML;
		logico[i]=tabela.rows[i+1].cells[1].innerHTML;
	} */
	/*
	for (var j=0;j<bandeira.length;j++){
		alert(bandeira[j]);
		alert(logico[j]);
	}
}
*/

//Valida Formulário de Clientes
function Valida_Contato(formulario){
	with (formulario){
		 
		if (txt_nome.value.length<=2){
			alert('O NOME deve ser preenchido com mais de 2 caracteres!');
			txt_nome.focus();
			return false;
		}
		
		if (txt_email.value.length<=8){
			alert('O E-MAIL deve ser preenchido com mais de 8 caracteres!');
			txt_email.focus();
			return false;
		}
		
		if (txt_telefone.value==''){
			alert('O TELEFONE deve ser preenchido!');
			txt_telefone.focus();
			return false;
		}
		
		if (txt_mensagem.value.length<=8){
			alert('A MENSAGEM deve ser preenchida com mais de 8 caracteres!');
			txt_mensagem.focus();
			return false;
		}
		
		return true;
	}
}
