// JavaScript Document


//VALIDAÇÔES


function Contato(){
	
	frm = document.frm_contato;
	
	parte1 = frm.email.value.indexOf("@");
    parte2 = frm.email.value.indexOf(".");
    parte3 = frm.email.value.length;
	
	if (frm.nome.value == ''){
		alert("Preencha campo NOME corretamente.");
		frm.nome.focus();
		return false;
	}
	
	else if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
         alert ("O campo E-mail deve ser conter um endereco eletrônico válido!");
         frm.email.focus();
         return false;
    }
	
	else if (frm.mensagem.value == ''){
		alert("Preencha campo MENSAGEM corretamente.");
		frm.mensagem.focus();
		return false;
	}
	
	return true;
}


function PedidosOracao(){
	
	frm = document.frm_pedido_oracao;
	
	parte1 = frm.email.value.indexOf("@");
    parte2 = frm.email.value.indexOf(".");
    parte3 = frm.email.value.length;
	
	if (frm.nome.value == ''){
		alert("Preencha campo NOME corretamente.");
		frm.nome.focus();
		return false;
	}
	
	else if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
         alert ("O campo E-mail deve ser conter um endereco eletrônico válido!");
         frm.email.focus();
         return false;
    }
	
	else if (frm.cidade.value == ''){
		alert("Preencha campo CIDADE corretamente.");
		frm.cidade.focus();
		return false;
	}
	
	else if (frm.estado.value == ''){
		alert("Preencha campo ESTADO corretamente.");
		frm.estado.focus();
		return false;
	}
	
	else if (frm.mensagem.value == ''){
		alert("Preencha campo MENSAGEM corretamente.");
		frm.mensagem.focus();
		return false;
	}
	
	return true;
}




function Testemunho(){
	
	frm = document.frm_testemunho;	
	
	if (frm.nome.value == ''){
		alert("Preencha campo NOME corretamente.");
		frm.nome.focus();
		return false;
	}
	
	else if (frm.titulo.value == ''){
		alert("Preencha campo TÍTULO corretamente.");
		frm.titulo.focus();
		return false;
	}
	
	else if (frm.testemunho.value == ''){
		alert("Preencha campo TESTEMUNHO corretamente.");
		frm.testemunho.focus();
		return false;
	}	
	
	return true;
}


function LembrarSenha(){
	if (document.lembrar_senha.email.value == ''){
		alert("O campo E-mail não pode ser nulo. Infome uma conta de email valida !");
		document.lembrar_senha.email.focus();
		return false;
	}	
	return true;
}



var tamanho = 10;
function aumentaTexto(alvo) {
	var texto = document.getElementById(alvo);
	var novoTamanho = tamanho+1;
	if (novoTamanho < 20) {
		tamanho = novoTamanho;
		texto.style.fontSize = novoTamanho+'px';
	}		
}

function diminuiTexto(alvo) {
	var texto = document.getElementById(alvo);
	var novoTamanho = tamanho-1;
	if (novoTamanho > 8) {
		tamanho = novoTamanho;
		texto.style.fontSize = novoTamanho+'px';
	}
}



