// Função » 'Geral'(Formulário Dinâmico)
function Check(sString01, sString02){
	dString01 = sString01;
	dString02 = sString02;
	setTimeout("Mask()",1);
}
function Mask(){
	dString01.value = dString02(dString01.value);
}
// Função » 'E-mail'
function fcExec_Email(sEmail){
	if(sEmail.search(/^[a-zA-Z0-9]+[_a-zA-Z0-9-]*(\.[_a-z0-9-]+)*@[a-z?G0-9]+(-[a-z?G0-9]+)*(\.[a-z?G0-9-]+)*(\.[a-z]{2,4})$/) != -1)
		return true;
	else
		return false;
}
// Função » 'Telefone'
function fcExec_Telefone(sString){
	sString = sString.replace(/\D/g,"")
	sString = sString.replace(/^(\d\d)(\d)/g,"($1) $2")
	sString = sString.replace(/(\d{4})(\d)/,"$1-$2")
	return sString;
}
// Função » Formulário
function CURInscricao(list_Form){
	if(list_Form.sNome.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nome'");
		list_Form.sNome.focus();
		return(false);
	}
	if(list_Form.dNascimento.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Data De Nascimento'");
		list_Form.dNascimento.focus();
		return(false);
	}
	if(list_Form.sCPF.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'CPF'");
		list_Form.sCPF.focus();
		return(false);
	}
	if(list_Form.sRG.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'RG'");
		list_Form.sRG.focus();
		return(false);
	}
	if(list_Form.sOrgaoExpeditor.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Órgão Expeditor'");
		list_Form.sOrgaoExpeditor.focus();
		return(false);
	}
	if(list_Form.dDataExpedicao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Data de Expedição'");
		list_Form.dDataExpedicao.focus();
		return(false);
	}
	if(list_Form.sNaturalidade.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Naturalidade'");
		list_Form.sNaturalidade.focus();
		return(false);
	}
	if(list_Form.sNacionalidade.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nacionalidade'");
		list_Form.sNacionalidade.focus();
		return(false);
	}
	if(list_Form.sTelefonePessoal.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Telefone Pessoal'");
		list_Form.sTelefonePessoal.focus();
		return(false);
	}
	if(!fcExec_Email(list_Form.sEmailPessoal.value)){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'E-mail Pessoal'");
		list_Form.sEmailPessoal.focus();
		return false;
	}
	if(list_Form.sEndereco.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Endereço'");
		list_Form.sEndereco.focus();
		return(false);
	}
	if(list_Form.sNumero.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Número'");
		list_Form.sNumero.focus();
		return(false);
	}
	if(list_Form.sBairro.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Bairro'");
		list_Form.sBairro.focus();
		return(false);
	}
	if(list_Form.sCidade.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Cidade'");
		list_Form.sCidade.focus();
		return(false);
	}
	if(list_Form.sLocalGraduacao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Local de Graduação'");
		list_Form.sLocalGraduacao.focus();
		return(false);
	}
	if(list_Form.sCursoGraduacao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Curso de Graduação'");
		list_Form.sCursoGraduacao.focus();
		return(false);
	}
	if(list_Form.nAnoGraduacao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Ano de Graduação'");
		list_Form.nAnoGraduacao.focus();
		return(false);
	}
	if(list_Form.sLogin.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Login'");
		list_Form.sLogin.focus();
		return(false);
	}
	if(list_Form.sSenha.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Senha'");
		list_Form.sSenha.focus();
		return(false);
	}
}
function CURLogin(list_Form){
	if(list_Form.sLogin.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Login'");
		list_Form.sLogin.focus();
		return(false);
	}
	if(list_Form.sSenha.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Senha'");
		list_Form.sSenha.focus();
		return(false);
	}
	return(true);
}
function Depoimento(list_Form){
	if(list_Form.sNome.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nome'");
		list_Form.sNome.focus();
		return(false);
	}
	if(!fcExec_Email(list_Form.sEmail.value)){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'E-mail'");
		list_Form.sEmail.focus();
		return false;
	}
	if(list_Form.sArea.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Área'");
		list_Form.sArea.focus();
		return(false);
	}
	if(list_Form.sCidade.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Cidade'");
		list_Form.sCidade.focus();
		return(false);
	}
	if(list_Form.sDepoimento.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Depoimento'");
		list_Form.sDepoimento.focus();
		return(false);
	}
	return(true);
}
function FaleConosco(list_Form){
	if(list_Form.sNome.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nome'");
		list_Form.sNome.focus();
		return(false);
	}
	if(!fcExec_Email(list_Form.sEmail.value)){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'E-mail'");
		list_Form.sEmail.focus();
		return false;
	}
	if(list_Form.sTelefone.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Telefone'");
		list_Form.sTelefone.focus();
		return(false);
	}
	if(list_Form.sCidade.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Cidade'");
		list_Form.sCidade.focus();
		return(false);
	}
	if(list_Form.sAssunto.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Assunto'");
		list_Form.sAssunto.focus();
		return(false);
	}
	if(list_Form.sMensagem.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Mensagem'");
		list_Form.sMensagem.focus();
		return(false);
	}
	return(true);
}
function Newsletter(list_Form){
	if(list_Form.sNome.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nome'");
		list_Form.sNome.focus();
		return(false);
	}
	if(!fcExec_Email(list_Form.sEmail.value)){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'E-mail'");
		list_Form.sEmail.focus();
		return false;
	}
	return(true);
}
function Servicos(list_Form){
	if(list_Form.sNome.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nome'");
		list_Form.sNome.focus();
		return(false);
	}
	if(list_Form.dNascimento.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Data de Nascimento'");
		list_Form.dNascimento.focus();
		return(false);
	}
	if(list_Form.sNaturalidade.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Naturalidade'");
		list_Form.sNaturalidade.focus();
		return(false);
	}
	if(!fcExec_Email(list_Form.sEmail.value)){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'E-mail'");
		list_Form.sEmail.focus();
		return false;
	}
	if(list_Form.sTelefone.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Telefone'");
		list_Form.sTelefone.focus();
		return(false);
	}
	if(list_Form.sArea.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Área'");
		list_Form.sArea.focus();
		return(false);
	}
	if(list_Form.sCidade.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Cidade'");
		list_Form.sCidade.focus();
		return(false);
	}
	if(list_Form.sProfissao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Profissão'");
		list_Form.sProfissao.focus();
		return(false);
	}
	if(list_Form.sLocalGraduacao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Local de Graduação'");
		list_Form.sLocalGraduacao.focus();
		return(false);
	}
	if(list_Form.nAnoGraduacao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Ano de Graduação'");
		list_Form.nAnoGraduacao.focus();
		return(false);
	}
	return(true);
}
function CURClean(){
	document.CURForm.reset();
}
function DEPClean(){
	document.DEPForm.reset();
}
function FALClean(){
	document.FALForm.reset();
}
function LOGClean(){
	document.LOGForm.reset();
}
function NEWClean(){
	document.NEWForm.reset();
}
function SERClean(){
	document.SERForm.reset();
}
// Função » Formulário(Área de Administração)
function Login(list_Form){
	if(list_Form.sLogin.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Login'");
		list_Form.sLogin.focus();
		return(false);
	}
	if(list_Form.sSenha.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Senha'");
		list_Form.sSenha.focus();
		return false;
	}
	return(true);
}
function loAlunos(list_Form){
	if(list_Form.sNome.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nome'");
		list_Form.sNome.focus();
		return(false);
	}
	if(list_Form.dNascimento.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Data De Nascimento'");
		list_Form.dNascimento.focus();
		return(false);
	}
	if(list_Form.sCPF.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'CPF'");
		list_Form.sCPF.focus();
		return(false);
	}
	if(list_Form.sRG.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'RG'");
		list_Form.sRG.focus();
		return(false);
	}
	if(list_Form.sOrgaoExpeditor.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Órgão Expeditor'");
		list_Form.sOrgaoExpeditor.focus();
		return(false);
	}
	if(list_Form.dDataExpedicao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Data de Expedição'");
		list_Form.dDataExpedicao.focus();
		return(false);
	}
	if(list_Form.sNaturalidade.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Naturalidade'");
		list_Form.sNaturalidade.focus();
		return(false);
	}
	if(list_Form.sNacionalidade.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nacionalidade'");
		list_Form.sNacionalidade.focus();
		return(false);
	}
	if(list_Form.sEndereco.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Endereço'");
		list_Form.sEndereco.focus();
		return(false);
	}
	if(list_Form.sNumero.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Número'");
		list_Form.sNumero.focus();
		return(false);
	}
	if(list_Form.sBairro.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Bairro'");
		list_Form.sBairro.focus();
		return(false);
	}
	if(list_Form.sCidade.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Cidade'");
		list_Form.sCidade.focus();
		return(false);
	}
	if(list_Form.sLocalGraduacao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Local de Graduação'");
		list_Form.sLocalGraduacao.focus();
		return(false);
	}
	if(list_Form.sCursoGraduacao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Curso de Graduação'");
		list_Form.sCursoGraduacao.focus();
		return(false);
	}
	if(list_Form.nAnoGraduacao.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Ano de Graduação'");
		list_Form.nAnoGraduacao.focus();
		return(false);
	}
	if(list_Form.sLogin.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Login'");
		list_Form.sLogin.focus();
		return(false);
	}
	if(list_Form.sSenha.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Senha'");
		list_Form.sSenha.focus();
		return(false);
	}
}
function loAreasDeAtuacao(list_Form){
	if(list_Form.sNome.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nome (PT)'");
		list_Form.sNome.focus();
		return(false);
	}
	if(list_Form.sNome_EN.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nome (EN)'");
		list_Form.sNome_EN.focus();
		return false;
	}
	return(true);
}
function loArtigos(list_Form){
	if(list_Form.sNome.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Nome'");
		list_Form.sNome.focus();
		return(false);
	}
	if(list_Form.sAutor.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Autor'");
		list_Form.sAutor.focus();
		return false;
	}
	if(list_Form.sURL.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Arquivo'");
		list_Form.sURL.focus();
		return false;
	}
	return(true);
}
function loAtividades(list_Form){
	if(list_Form.nTipo[0].checked){
		if(list_Form.sNome_Curso.value == ""){
			alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Aula'");
			list_Form.sNome_Curso.focus();
			return(false);
		}
	}
	if(list_Form.nTipo[2].checked){
		if(list_Form.sNome_Reuniao.value == ""){
			alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Reunião'");
			list_Form.sNome_Reuniao.focus();
			return(false);
		}
	}
	if(list_Form.nTipo[4].checked){
		if(list_Form.sNome_Workshop.value == ""){
			alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Workshop'");
			list_Form.sNome_Workshop.focus();
			return(false);
		}
	}
	if(list_Form.dDataInicial.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Data Inicial'");
		list_Form.dDataInicial.focus();
		return(false);
	}
	if(list_Form.dHoraInicial.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Horário Inicial'");
		list_Form.dHoraInicial.focus();
		return(false);
	}
	if(list_Form.dDataFinal.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Data Final'");
		list_Form.dDataFinal.focus();
		return(false);
	}
	if(list_Form.dHoraFinal.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Horário Final'");
		list_Form.dHoraFinal.focus();
		return(false);
	}
	return(true);
}
function loNewsletter(list_Form){
	if(list_Form.sAssunto.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'Assunto'");
		list_Form.sAssunto.focus();
		return(false);
	}
	if(list_Form.sEmail.value == ""){
		alert("| CTC Veda | Centro de Terapia Cognitiva Veda\n\terro | preencher 'E-mail'");
		list_Form.sEmail.focus();
		return false;
	}
	return(true);
}
// Função » Desabilitar 'Cópia' p/ Internet Explorer
document.onselectstart = new Function ("return false");
// Função » Layer TC, Depoimento 1 e Depoimento 2
function fArtigos(){
	if(document.getElementById){
		if(document.getElementById("fArtigos").style.display=="block"){
			document.getElementById("fArtigos").style.display="none";
		}else{
			document.getElementById("fArtigos").style.display="block";
		}
	}
}
function fTexto(){
	if(document.getElementById){
		if(document.getElementById("fTerapiaCognitiva").style.display=="block"){
			document.getElementById("fTerapiaCognitiva").style.display="none";
		}else{
			document.getElementById("fTerapiaCognitiva").style.display="block";
		}
	}
}
function fDepoimento1(){
	if(document.getElementById){
		if(document.getElementById("fDepoimento1").style.display=="block"){
			document.getElementById("fDepoimento1").style.display="none";
		}else{
			document.getElementById("fDepoimento1").style.display="block";
		}
	}
}
function fDepoimento2(){
	if(document.getElementById){
		if(document.getElementById("fDepoimento2").style.display=="block"){
			document.getElementById("fDepoimento2").style.display="none";
		}else{
			document.getElementById("fDepoimento2").style.display="block";
		}
	}
}
function fInscricao(){
	if(document.getElementById){
		if(document.getElementById("fInscricao").style.display=="block"){
			document.getElementById("fInscricao").style.display="none";
		}else{
			document.getElementById("fInscricao").style.display="block";
		}
	}
}
function fProfissionais(){
	if(document.getElementById){
		if(document.getElementById("fProfissionais").style.display=="block"){
			document.getElementById("fProfissionais").style.display="none";
		}else{
			document.getElementById("fProfissionais").style.display="block";
		}
	}
}
// Função » Caracteres(TextArea)
function fTArea(nValor){
	nQtdd = 600;
	nTotal = nValor.length;
	if(nTotal <= nQtdd){
	nResto = nQtdd - nTotal;
		document.getElementById('nContador').innerHTML = nResto;
	}else{
		document.getElementById('sDepoimento').value = nValor.substr(0,nQtdd);
	}
}
// Função » Excluir
function fExcluir(sURL,sNome) {
	if(confirm('| CTC Veda | Centro de Terapia Cognitiva Veda\n\tVocê deseja apagar '+sNome+'?')){
		location.href = sURL;
	}
}
// Função » Opção p/ Atividade
function fcOption(Op){
	if(Op == 1){
		document.getElementById('tdCurso').style.display="block";
		document.getElementById('tdPalestra').style.display="none";
		document.getElementById('tdReuniao').style.display="none";
		document.getElementById('tdSupervisao').style.display="none";
		document.getElementById('tdWorkshop').style.display="none";
	}else if(Op == 2){
		document.getElementById('tdCurso').style.display="none";
		document.getElementById('tdPalestra').style.display="block";
		document.getElementById('tdReuniao').style.display="none";
		document.getElementById('tdSupervisao').style.display="none";
		document.getElementById('tdWorkshop').style.display="none";
	}else if(Op == 3){
		document.getElementById('tdCurso').style.display="none";
		document.getElementById('tdPalestra').style.display="none";
		document.getElementById('tdReuniao').style.display="block";
		document.getElementById('tdSupervisao').style.display="none";
		document.getElementById('tdWorkshop').style.display="none";
	}else if(Op == 4){
		document.getElementById('tdCurso').style.display="none";
		document.getElementById('tdPalestra').style.display="none";
		document.getElementById('tdReuniao').style.display="none";
		document.getElementById('tdSupervisao').style.display="block";
		document.getElementById('tdWorkshop').style.display="none";
	}else if(Op == 5){
		document.getElementById('tdCurso').style.display="none";
		document.getElementById('tdPalestra').style.display="none";
		document.getElementById('tdReuniao').style.display="none";
		document.getElementById('tdSupervisao').style.display="none";
		document.getElementById('tdWorkshop').style.display="block";
	}
}
