// javascript document`

var cfg_app_nomeDisplay = "INPG"

//*****************************************************************************************************************************
// FUNÇÕES OPERACIONAIS
//*****************************************************************************************************************************

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//*   função para aceitar somente números
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

function pecaOrcamento(prod){
	window.open('peca_orcamento.asp?'+ prod, 'educavirtual', 'statusbar=0, menubars=0, resizable=0, width=350, height=400');
}

function envieAmigo(){
	window.open('envie.asp', 'INPG', 'statusbar=1, menubars=0, resizable=1, width=450, height=300');
}

function printThis(tipo,id){
	window.open('print.asp?tipo='+tipo+'&id='+id, 'INPG', 'scrollbars=1, statusbar=1, menubars=0, resizable=1, width=800, height=400');
}

function abre_creditos(url) {
	var strValue = window.open(''+url+'','Janela','scrollbars=no,status=yes,location=no,toolbar=no,menubar=no,resizable=no,height=340,width=500');
}


//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//*   função para mostrar / esconder div
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

function mostrar(id, div) {
	radio = document.getElementById(id);
	div = document.getElementById(div);
	if (radio.checked != true) {
		div.style.display = "none";
	}
	else {
		div.style.display = "block";
	}
}


//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//*   busca de CEP
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

function getEndereco() {
		
		if($.trim($("#txtCepResidencial").val()) != ""){
			
			$.getScript("http://cep.republicavirtual.com.br/web_cep.php?formato=javascript&cep="+$("#txtCepResidencial").val(), function(){
				
				if(resultadoCEP["resultado"]){
					
					$("#txtEnderecoResidencial").val(unescape(resultadoCEP["tipo_logradouro"])+" "+unescape(resultadoCEP["logradouro"]));
					$("#txtBairroResidencial").val(unescape(resultadoCEP["bairro"]));
					$("#txtCidadeResidencial").val(unescape(resultadoCEP["cidade"]));
					$("#txtEstadoResidencial").val(unescape(resultadoCEP["uf"]));
				}else{
					alert("Endereço não encontrado");
				}
			});				
		}
		
}


//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//*   busca de CEP Empresa
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

function getEnderecoEmpresa() {
		
		if($.trim($("#txtCepEmpresa").val()) != ""){
			
			$.getScript("http://cep.republicavirtual.com.br/web_cep.php?formato=javascript&cep="+$("#txtCepEmpresa").val(), function(){
				
				if(resultadoCEP["resultado"]){
					
					$("#txtEnderecoEmpresa").val(unescape(resultadoCEP["tipo_logradouro"])+" "+unescape(resultadoCEP["logradouro"]));
					$("#txtBairroEmpresa").val(unescape(resultadoCEP["bairro"]));
					$("#txtCidadeEmpresa").val(unescape(resultadoCEP["cidade"]));
					$("#txtEstadoEmpresa").val(unescape(resultadoCEP["uf"]));
				}else{
					alert("Endereço não encontrado");
				}
			});				
		}
}



//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//*   função para fazer o scroll na home (destaques)
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

function scroller() {
	var el = document.getElementById('scroller_conteudo01');
	var el2 = document.getElementById('scroller_conteudo02');
	var elprev = document.getElementById('scroller_left');
	var elnext = document.getElementById('scroller_right');
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
		el2.style.display = 'block';
	}
	else {
		el.style.display = 'block';
		el2.style.display = 'none';
	}
}


//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//*   função para ver curriculo do docente
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

function verCurriculo(doc){
	window.open('curriculo.asp?'+ doc, 'educavirtual', 'statusbar=1, menubars=0, resizable=1, scrollbars=1, width=1004, height=500');
}


//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//*   função para aceitar somente números
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

function somenteNumero(){
	if ((event.keyCode < 48 || event.keyCode > 57) && event.keyCode != 8) {
		event.keyCode = 0;
		    return false;
	}
   return true;
}

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//*   estruturando o campo conforme mask 
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

function formataGeral(Object, Mask) {
   var i, nCount, sValue, fldLen, mskLen, bolMask, sCod, nTecla, sMask
	// definindo o source do keyPress para IE
	if(document.all) {
		nTecla = event.keyCode;
	}
	// definindo o source do keyPress para NS
	else if(document.layers) {
		nTecla = event.which;
	}

   sValue = document.getElementById(Object).value;
   sMask = Mask

   sValue = sValue.toString().replace('-','');
   sValue = sValue.toString().replace('.','');
   sValue = sValue.toString().replace('/','');
   sValue = sValue.toString().replace('(','');
   sValue = sValue.toString().replace(')','');
   sValue = sValue.toString().replace(' ','');
   sValue = sValue.toString().replace(':','');

   // é necessário checar duas vezes")
   sValue = sValue.toString().replace('-','');
   sValue = sValue.toString().replace('.','');
   sValue = sValue.toString().replace('/','');
   sValue = sValue.toString().replace('(','');
   sValue = sValue.toString().replace(')','');
   sValue = sValue.toString().replace(' ','');
   sValue = sValue.toString().replace(':','');

   fldLen = sValue.length;
   mskLen = sMask.length;
   i = 0;
   nCount = 0;
   sCod = '';
   mskLen = fldLen;

   while (i <= mskLen) {

	    bolMask = ((sMask.charAt(i) == '-') || (sMask.charAt(i) == ':') || (sMask.charAt(i) == '.') || (sMask.charAt(i) == '/'))
	    bolMask = bolMask || ((sMask.charAt(i) == '(') || (sMask.charAt(i) == ')') || (sMask.charAt(i) == ' '))

	    if (bolMask) {
		    sCod += sMask.charAt(i);
		    mskLen++;
	    } else {
		    sCod += sValue.charAt(nCount);
		    nCount++;
	    }
       i++;
   }

   // retornando a construção
   document.getElementById(Object).value = sCod;


   // verificando que tipo de tecla é pressionada
   if (nTecla != 8) { // se não for backspace

	    if (sMask.charAt(i - 1) == '9') { // se for somente números
		    return ((nTecla > 47) && (nTecla < 58));
	    } else { // se for qualquer caracter
		    return true;
 	    }

    } else {
 	    return true;
    }

    i = 0;
    nCount = 0;
    mskLen = '';
 }

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//*    verificando se a data é válida      
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

function verificaData(Object, tituloObj) {

var bissexto = 0;
var data = document.getElementById(Object).value; 
var tam = data.length; 

if(data != '') { 

	if (tam == 10) 
	{ 
	 var dia = data.substr(0, 2) 
	 var mes = data.substr(3, 2) 
	 var ano = data.substr(6, 40) 
		if (ano > 1900) 
		if (ano < 2100) 
		{ 
		 switch(mes) 
			{ 
				case '01': 
				case '03': 
				case '05': 
				case '07': 
				case '08': 
				case '10': 
				case '12': 

					if  (dia <= 31) { 
						return true; 
					} 
					break; 

				case '04': 
				case '06': 
				case '09': 
				case '11': 

					if  (dia <= 30) { 
						return true; 
					} 
					break; 

				case '02': // validando ano bissexto - mês fevereiro 

					if ((ano % 4 == 0) || (ano % 100 == 0) || (ano % 400 == 0)) { 
						bissexto = 1; 
					} 

					if ((bissexto == 1) && (dia <= 29)) { 
						return true; 
					} 

					if ((bissexto != 1) && (dia <= 28)) { 
						return true; 
					} 
					break; 
			} 
		} 
	} 

	apresentaAlertas('5', tituloObj);
	document.getElementById(Object).focus(); 
	return(false);
	formReady = 0;
	
	} 
} 

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//*    função para validar e-mail     
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

function verificaEmail(Object) {
	var emailCheck = document.getElementById(Object).value; 
	
	if (emailCheck.indexOf('@', 0) == -1 || emailCheck.indexOf('.', 0) == -1){
		apresentaAlertas('8', 'O e-mail informado <strong>NÃO É UM E-MAIL VÁLIDO</strong>. Por favor verifique e tente novamente.');
		document.getElementById(Object).focus(); 
		return false;
	} else {
		return true;
	}
}


//*****************************************************************************************************************************
// FUNÇÕES PARA FORMULÁRIOS
//*****************************************************************************************************************************

// ****************************************************************************************************************
// função para LIMPAR campo de busca
// ****************************************************************************************************************
function clearSearch(act){
	if(document.getElementById){
		
		var iptSearch = document.getElementById("txtBusca");
		if(act == "in" && iptSearch.value == "Palavra-chave"){
			iptSearch.value = "";
		} else if(act == "out" && iptSearch.value == ""){
			iptSearch.value = "Palavra-chave";
		}
		
	}
}

// ****************************************************************************************************************
// função para LIMPAR campo de busca do corpo docente
// ****************************************************************************************************************
function clearSearchCorpoDocente(act){
	if(document.getElementById){
		
		var iptSearch = document.getElementById("txtBuscaDocente");
		if(act == "in" && iptSearch.value == "Nome ou Sobrenome"){
			iptSearch.value = "";
		} else if(act == "out" && iptSearch.value == ""){
			iptSearch.value = "Nome ou Sobrenome";
		}
		
	}
}


// ****************************************************************************************************************
// função para VALIDAR campo de busca
// ****************************************************************************************************************
function checkSearch(){
	if(document.getElementById){
		
		var iptSearch = document.getElementById("txtBuscaProduto");
		if(iptSearch.value != "Palavra-chave" && iptSearch.value.length > 3){
			return (true);
		} else {
			
			if(iptSearch.value == "Palavra-chave"){
				alert('Por favor digite o que deseja buscar.');
			}
			
			if(iptSearch.value.length <= 3){
				alert('Por favor digite algo com mais de três letras.');
			}
			
			return false;
			
		}
		
	}
}



// ****************************************************************************************************************
// função para ocupar a status bar e nao deixar select
// ****************************************************************************************************************

function textoStatusBar() {
	window.status = cfg_app_nomeDisplay
	setTimeout("textoStatusBar()", 1)
}

textoStatusBar();

// document.onselectstart = new Function("return false");



// ****************************************************************************************************************
// função para bloquear botao direito do mouse
// ****************************************************************************************************************

// function click() {
//	if (event.button==2||event.button==3) {
//		oncontextmenu='return false';
//	}
// }

// document.onmousedown = click
// document.oncontextmenu = new Function("return false;")


// ****************************************************************************************************************
// função para apresentar erros e alertas
// ****************************************************************************************************************

function apresentaAlertas(erroTipo, objTarget) {
	if(document.getElementById) {
	
		var targetShow 		= document.getElementById("validacao_mensagem");
		var mensegemSaida	= ""
		
		if(erroTipo == 1) {
			mensegemSaida 	= "Atenção: Você precisa preencher o campo <strong>"+ objTarget +"</strong>. Preencha este campo e clique novamente em enviar.";
			
		} else if (erroTipo == 8) {
			mensegemSaida 	= objTarget;
			
		}
		
		targetShow.innerHTML = mensegemSaida;
	}
}


// ****************************************************************************************************************
// função para trocar imagens do rodapé
// ****************************************************************************************************************

function imgChange(imgT, imgI){
	
	if(imgT == 1){		
		document.images[imgI].src='images/layout/rodape_roll_'+ imgI +'_l.gif';
	} else if(imgT == 0){
		document.images[imgI].src='images/layout/rodape_roll_'+ imgI +'_d.gif';		
	}
	
}



// ****************************************************************************************************************
// função para controlar swf dentro de frames
// ****************************************************************************************************************

objects = document.getElementsByTagName("object");
for (var i = 0; i < objects.length; i++){
	objects[i].outerHTML = objects[i].outerHTML;
}

//*****************************************************************************************************************************
// VALIDAÇÃO DE FORMULÁRIO
//*****************************************************************************************************************************


// ****************************************************************************************************************
// função para validar formulários de mais informações
// ****************************************************************************************************************

function validaFormMaisInformacoes() {
	
	if(document.getElementById("txtNome").value == "") {
		apresentaAlertas('1', 'Nome');
		document.getElementById("txtNome").focus();
		return(false);
	}
	
	if(document.getElementById("txtEmail").value == "") {
		apresentaAlertas('1', 'E-mail');
		document.getElementById("txtEmail").focus();
		return(false);
	}

	if(document.getElementById("txtTelefone").value == "") {
		apresentaAlertas('1', 'Telefone');
		document.getElementById("txtTelefone").focus();
		return(false);
	}
	
	if(document.getelementById("txtEscolaridade").value == "") {
		apresentaAlertas('1', 'Escolaridade');
		document.getElementById("txtEscolaridade").focus();
		return(false);
	}
	
	if(document.getElementById("txtMensagem").value == "") {
		apresentaAlertas('1', 'Mensagem');
		document.getElementById("txtMensagem").focus();
		return(false);
	}

}


// ****************************************************************************************************************
// função para validar formulários de fale conosco
// ****************************************************************************************************************

function validaFormFaleConosco() {
	
	if(document.getElementById("txtNome").value == "") {
		apresentaAlertas('1', 'Nome');
		document.getElementById("txtNome").focus();
		return(false);
	}
	
	if(document.getElementById("txtEmail").value == "") {
		apresentaAlertas('1', 'Email');
		document.getElementById("txtEmail").focus();
		return(false);
	}
	
	if(document.getElementById("txtTelefone").value == "") {
		apresentaAlertas('1', 'Telefone');
		document.getElementById("txtTelefone").focus();
		return(false);
	}
	
	if(document.getElementById("cboUnidade").value == "") {
		apresentaAlertas('1', 'Unidade de interesse');
		document.getElementById("cboUnidade").focus();
		return(false);
	}
	
	if(document.getElementById("cboComoConheceu").value == "") {
		apresentaAlertas('1', 'Como Conheceu');
		document.getElementById("cboComoConheceu").focus();
		return(false);
	}
	
	if(document.getElementById("txtMensagem").value == "") {
		apresentaAlertas('1', 'Mensagem');
		document.getElementById("txtMensagem").focus();
		return(false);
	}
	
}

// ****************************************************************************************************************
// função para validar formulários de palestras
// ****************************************************************************************************************

function validaFormPalestras() {
	
	if(document.getElementById("txtNome").value == "") {
		apresentaAlertas('1', 'Nome');
		document.getElementById("txtNome").focus();
		return(false);
	}
	
	if(document.getElementById("txtEmail").value == "") {
		apresentaAlertas('1', 'Email');
		document.getElementById("txtEmail").focus();
		return(false);
	}
	
	if(document.getElementById("txtTelefone").value == "") {
		apresentaAlertas('1', 'Telefone');
		document.getElementById("txtTelefone").focus();
		return(false);
	}
	
	if(document.getElementById("txtRg").value == "") {
		apresentaAlertas('1', 'RG');
		document.getElementById("txtRg").focus();
		return(false);
	}
	
	if(document.getElementById("cboComoConheceu").value == "") {
		apresentaAlertas('1', 'Como Conheceu');
		document.getElementById("cboComoConheceu").focus();
		return(false);
	}
	
	if(document.getElementById("txtMensagem").value == "") {
		apresentaAlertas('1', 'Mensagem');
		document.getElementById("txtMensagem").focus();
		return(false);
	}
	
}

// ****************************************************************************************************************
// função para validar formulários de trabalhe conosco
// ****************************************************************************************************************

function validaFormTrabalheConosco() {
	
	if(document.getElementById("txtNome").value == "") {
		apresentaAlertas('1', 'Nome');
		document.getElementById("txtNome").focus();
		return(false);
	}
	
	if(document.getElementById("txtEmail").value == "") {
		apresentaAlertas('1', 'Email');
		document.getElementById("txtEmail").focus();
		return(false);
	}
	
	if(document.getElementById("txtTelefone").value == "") {
		apresentaAlertas('1', 'Telefone');
		document.getElementById("txtTelefone").focus();
		return(false);
	}
	
	if(document.getElementById("txtSexo").value == "") {
		apresentaAlertas('1', 'Sexo');
		document.getElementById("txtSexo").focus();
		return(false);
	}
	
	if(document.getElementById("txtRg").value == "") {
		apresentaAlertas('1', 'RG');
		document.getElementById("txtRg").focus();
		return(false);
	}
	
	if(document.getElementById("txtCpf").value == "") {
		apresentaAlertas('1', 'CPF');
		document.getElementById("txtCpf").focus();
		return(false);
	}
	
	if(document.getElementById("txtNascimento").value == "") {
		apresentaAlertas('1', 'Data de Nascimento');
		document.getElementById("txtNascimento").focus();
		return(false);
	}
	
	if(document.getElementById("txtEstadoCivil").value == "") {
		apresentaAlertas('1', 'Estado Civil');
		document.getElementById("txtEstadoCivil").focus();
		return(false);
	}
	
	if(document.getElementById("txtNacionalidade").value == "") {
		apresentaAlertas('1', 'Nacionalidade');
		document.getElementById("txtNacionalidade").focus();
		return(false);
	}
	
	if(document.getElementById("txtFilhos").value == "") {
		apresentaAlertas('1', 'Número de Filhos');
		document.getElementById("txtFilhos").focus();
		return(false);
	}
	
	if(document.getElementById("txtMunicipio").value == "") {
		apresentaAlertas('1', 'Município');
		document.getElementById("txtMunicipio").focus();
		return(false);
	}
	
	if(document.getElementById("txtUf").value == "") {
		apresentaAlertas('1', 'UF');
		document.getElementById("txtUf").focus();
		return(false);
	}
	
	if(document.getElementById("txtCep").value == "") {
		apresentaAlertas('1', 'CEP');
		document.getElementById("txtCep").focus();
		return(false);
	}
	
	if(document.getElementById("txtEndereco").value == "") {
		apresentaAlertas('1', 'Endereço');
		document.getElementById("txtEndereco").focus();
		return(false);
	}
	
	if(document.getElementById("txtTelResidencial").value == "") {
		apresentaAlertas('1', 'Telefone Residencial');
		document.getElementById("txtTelResidencial").focus();
		return(false);
	}
	
	if(document.getElementById("txtTelComercial").value == "") {
		apresentaAlertas('1', 'Telefone Comercial');
		document.getElementById("txtTelComercial").focus();
		return(false);
	}
	
	if(document.getElementById("txtCelular").value == "") {
		apresentaAlertas('1', 'Telefone Celular');
		document.getElementById("txtCelular").focus();
		return(false);
	}
	
	if(document.getElementById("txtEscolaridade").value == "") {
		apresentaAlertas('1', 'Escolaridade');
		document.getElementById("txtEscolaridade").focus();
		return(false);
	}
		
	if(document.getElementById("txtAreas").value == "") {
		apresentaAlertas('1', 'Áreas de Interesse');
		document.getElementById("txtAreas").focus();
		return(false);
	}
	
	if(document.getElementById("txtFormacao").value == "") {
		apresentaAlertas('1', 'Formação Profissional');
		document.getElementById("txtFormacao").focus();
		return(false);
	}
	
	if(document.getElementById("txtExperiencia").value == "") {
		apresentaAlertas('1', 'Experiência Profissional');
		document.getElementById("txtExperiencia").focus();
		return(false);
	}
	
}

// ****************************************************************************************************************
// função para validar formulários de newsletter
// ****************************************************************************************************************

function validaFormNewsletter() {
	
	if(document.getElementById("txtEmail").value == "") {
		apresentaAlertas('1', 'Email');
		document.getElementById("txtEmail").focus();
		return(false);
	}

}

// ****************************************************************************************************************
// função para validar formulários gerados pela ferramenta criador de formulários
// ****************************************************************************************************************

function validaFormGeral() {
	
	// ***************************************************************** //
	// ************************** campo 01 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("cboTipo").value == 0) {
		document.getElementById("validaTipo").innerHTML = '<span style="color:red;">Escolha uma atividade!</span>';
		apresentaAlertas('1', 'Atividade');
		document.getElementById("cboTipo").focus();
		return(false);
	}else{
		document.getElementById("validaTipo").innerHTML = '';
	}
	
	if(document.getElementById("cboTipo").value == "") {
		document.getElementById("validaTipo").innerHTML = '<span style="color:red;">Escolha uma atividade!</span>';
		apresentaAlertas('1', 'Atividade');
		document.getElementById("cboTipo").focus();
		return(false);
	}else{
		document.getElementById("validaTipo").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 02 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("cboCategoria").value == 0) {
		document.getElementById("validaCategoria").innerHTML = '<span style="color:red;">Escolha uma opção de curso!</span>';
		apresentaAlertas('1', 'Opções de curso');
		document.getElementById("cboCategoria").focus();
		return(false);
	}else{
		document.getElementById("validaCategoria").innerHTML = '';
	}
	
	if(document.getElementById("cboCategoria").value == "") {
		document.getElementById("validaCategoria").innerHTML = '<span style="color:red;">Escolha uma opção de curso!</span>';
		apresentaAlertas('1', 'Opções de curso');
		document.getElementById("cboCategoria").focus();
		return(false);
	}else{
		document.getElementById("validaCategoria").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 03 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("cboSubCategoria").value == 0) {
		document.getElementById("validaSubCategoria").innerHTML = '<span style="color:red;">Escolha uma área!</span>';
		apresentaAlertas('1', 'Área');
		document.getElementById("cboSubCategoria").focus();
		return(false);
	}else{
		document.getElementById("validaSubCategoria").innerHTML = '';
	}
	
	if(document.getElementById("cboSubCategoria").value == "") {
		document.getElementById("validaSubCategoria").innerHTML = '<span style="color:red;">Escolha uma área!</span>';
		apresentaAlertas('1', 'Área');
		document.getElementById("cboSubCategoria").focus();
		return(false);
	}else{
		document.getElementById("validaSubCategoria").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 04 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("cboCurso").value == 0) {
		document.getElementById("validaCurso").innerHTML = '<span style="color:red;">Escolha um curso!</span>';
		apresentaAlertas('1', 'Curso');
		document.getElementById("cboCurso").focus();
		return(false);
	}else{
		document.getElementById("validaCurso").innerHTML = '';
	}
	
	if(document.getElementById("cboCurso").value == "") {
		document.getElementById("validaCurso").innerHTML = '<span style="color:red;">Escolha um curso!</span>';
		apresentaAlertas('1', 'Curso');
		document.getElementById("cboCurso").focus();
		return(false);
	}else{
		document.getElementById("validaCurso").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 05 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("cboUnidade").value == 0) {
		document.getElementById("validaUnidade").innerHTML = '<span style="color:red;">Escolha um local!</span>';
		apresentaAlertas('1', 'Local');
		document.getElementById("cboUnidade").focus();
		return(false);
	}else{
		document.getElementById("validaUnidade").innerHTML = '';
	}
	
	if(document.getElementById("cboUnidade").value == "") {
		document.getElementById("validaUnidade").innerHTML = '<span style="color:red;">Escolha um local!</span>';
		apresentaAlertas('1', 'Local');
		document.getElementById("cboUnidade").focus();
		return(false);
	}else{
		document.getElementById("validaUnidade").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 06 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtSelecaoData").value == "") {
		document.getElementById("validaSelecaoData").innerHTML = '<span style="color:red;">Escolha uma data!</span>';
		apresentaAlertas('1', 'Data Sugerida');
		document.getElementById("txtSelecaoData").focus();
		return(false);
	}else{
		document.getElementById("validaSelecaoData").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 07 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("cboTurno").value == 0) {
		document.getElementById("validaTurno").innerHTML = '<span style="color:red;">Escolha um turno!</span>';
		apresentaAlertas('1', 'Turno');
		document.getElementById("cboTurno").focus();
		return(false);
	}else{
		document.getElementById("validaTurno").innerHTML = '';
	}
	
	if(document.getElementById("cboTurno").value == "") {
		document.getElementById("validaTurno").innerHTML = '<span style="color:red;">Escolha um turno!</span>';
		apresentaAlertas('1', 'Turno');
		document.getElementById("cboTurno").focus();
		return(false);
	}else{
		document.getElementById("validaTurno").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 08 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtNome").value == "" || document.getElementById("txtNome").length < 5) {
		document.getElementById("validaNome").innerHTML = '<span style="color:red;">Digite seu nome!</span>';
		apresentaAlertas('1', 'Nome');
		document.getElementById("txtNome").focus();
		return(false);
	}else{
		document.getElementById("validaNome").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 09 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtEmail").value == "" || document.getElementById("txtEmail").length < 8 || document.getElementById("txtEmail").value.indexOf('@', 0) == -1 || document.getElementById("txtEmail").value.indexOf('.', 0) == -1) {
		document.getElementById("validaEmail").innerHTML = '<span style="color:red;">Email inválido!</span>';
		apresentaAlertas('1', 'Email');
		document.getElementById("txtEmail").focus();
		return(false);
	}else{
		document.getElementById("validaEmail").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 10 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("cboSexo").value == 0) {
		document.getElementById("validaSexo").innerHTML = '<span style="color:red;">Selecione seu sexo!</span>';
		apresentaAlertas('1', 'Sexo');
		document.getElementById("cboSexo").focus();
		return(false);
	}else{
		document.getElementById("validaSexo").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 11 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtDataNascimento").value == "") {
		document.getElementById("validaDataNascimento").innerHTML = '<span style="color:red;">Selecione sua Data de Nascimento!</span>';
		apresentaAlertas('1', 'Data de Nascimento');
		document.getElementById("txtDataNascimento").focus();
		return(false);
	}else{
		document.getElementById("validaDataNascimento").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 12 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("cboFonteRecursos").value == 0) {
		document.getElementById("validaFonteRecursos").innerHTML = '<span style="color:red;">Selecione sua Fonte de Recursos!</span>';
		apresentaAlertas('1', 'Fonte de recursos');
		document.getElementById("cboFonteRecursos").focus();
		return(false);
	}else{
		document.getElementById("validaFonteRecursos").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 13 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("cboFaixaSalarial").value == 0) {
		document.getElementById("validaFaixaSalarial").innerHTML = '<span style="color:red;">Selecione sua Faixa salarial!</span>';
		apresentaAlertas('1', 'Faixa salarial');
		document.getElementById("cboFaixaSalarial").focus();
		return(false);
	}else{
		document.getElementById("validaFaixaSalarial").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 14 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("cboEstadoCivil").value == 0) {
		document.getElementById("validaEstadoCivil").innerHTML = '<span style="color:red;">Selecione seu Estado Civil!</span>';
		apresentaAlertas('1', 'Estado Civil');
		document.getElementById("cboEstadoCivil").focus();
		return(false);
	}else{
		document.getElementById("validaEstadoCivil").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 15 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtNacionalidade").value == "") {
		document.getElementById("validaNacionalidade").innerHTML = '<span style="color:red;">Digite sua nacionalidade!</span>';
		apresentaAlertas('1', 'Nacionalidade');
		document.getElementById("txtNacionalidade").focus();
		return(false);
	}else{
		document.getElementById("validaNacionalidade").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 16 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtNaturalidade").value == "") {
		document.getElementById("validaNaturalidade").innerHTML = '<span style="color:red;">Selecione sua naturalidade!</span>';
		apresentaAlertas('1', 'Naturalidade');
		document.getElementById("txtNaturalidade").focus();
		return(false);
	}else{
		document.getElementById("validaNaturalidade").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 17 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtCepResidencial").value == "") {
		document.getElementById("validaCepResidencial").innerHTML = '<span style="color:red;">Digite o cep!</span>';
		apresentaAlertas('1', 'CEP');
		document.getElementById("txtCepResidencial").focus();
		return(false);
	}else{
		document.getElementById("validaCepResidencial").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 18 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtEnderecoResidencial").value == "") {
		document.getElementById("validaEnderecoResidencial").innerHTML = '<span style="color:red;">Digite seu endereço!</span>';
		apresentaAlertas('1', 'Endereço');
		document.getElementById("txtEnderecoResidencial").focus();
		return(false);
	}else{
		document.getElementById("validaEnderecoResidencial").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 19 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtNumeroResidencial").value == "") {
		document.getElementById("validaNumeroResidencial").innerHTML = '<span style="color:red;">Digite o número!</span>';
		apresentaAlertas('1', 'Número');
		document.getElementById("txtNumeroResidencial").focus();
		return(false);
	}else{
		document.getElementById("validaNumeroResidencial").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 20 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtComplementoResidencial").value == "") {
		document.getElementById("validaComplementoResidencial").innerHTML = '<span style="color:red;">Digite o complemento!</span>';
		apresentaAlertas('1', 'Complemento');
		document.getElementById("txtComplementoResidencial").focus();
		return(false);
	}else{
		document.getElementById("validaComplementoResidencial").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 21 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtBairroResidencial").value == "") {
		document.getElementById("validaBairroResidencial").innerHTML = '<span style="color:red;">Digite seu bairro!</span>';
		apresentaAlertas('1', 'Bairro');
		document.getElementById("txtBairroResidencial").focus();
		return(false);
	}else{
		document.getElementById("validaBairroResidencial").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 22 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtCidadeResidencial").value == "") {
		document.getElementById("validaCidadeResidencial").innerHTML = '<span style="color:red;">Digite sua cidade!</span>';
		apresentaAlertas('1', 'Cidade');
		document.getElementById("txtCidadeResidencial").focus();
		return(false);
	}else{
		document.getElementById("validaCidadeResidencial").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 23 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtEstadoResidencial").value == "") {
		document.getElementById("validaEstadoResidencial").innerHTML = '<span style="color:red;">Digite seu estado!</span>';
		apresentaAlertas('1', 'Estado');
		document.getElementById("txtEstadoResidencial").focus();
		return(false);
	}else{
		document.getElementById("validaEstadoResidencial").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 24 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtCelularPessoal").value == "") {
		document.getElementById("validaCelularPessoal").innerHTML = '<span style="color:red;">Digite seu celular!</span>';
		apresentaAlertas('1', 'Celular');
		document.getElementById("txtCelularPessoal").focus();
		return(false);
	}else{
		document.getElementById("validaCelularPessoal").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 25 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtTelefoneResidencial").value == "") {
		document.getElementById("validaTelefoneResidencial").innerHTML = '<span style="color:red;">Digite o telefone!</span>';
		apresentaAlertas('1', 'Telefone');
		document.getElementById("txtTelefoneResidencial").focus();
		return(false);
	}else{
		document.getElementById("validaTelefoneResidencial").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 26 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtTelefoneRecados").value == "") {
		document.getElementById("validaTelefoneRecados").innerHTML = '<span style="color:red;">Digite o telefone de recados!</span>';
		apresentaAlertas('1', 'Telefone de recados');
		document.getElementById("txtTelefoneRecados").focus();
		return(false);
	}else{
		document.getElementById("validaTelefoneRecados").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 27 ***************************** //
	// ***************************************************************** //
	
	
	// ***************************************************************** //
	// ************************** campo 28 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtRG").value == "") {
		document.getElementById("validaRG").innerHTML = '<span style="color:red;">Digite seu RG!</span>';
		apresentaAlertas('1', 'RG');
		document.getElementById("txtRG").focus();
		return(false);
	}else{
		document.getElementById("validaRG").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 29 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtCPF").value == "") {
		document.getElementById("validaCPF").innerHTML = '<span style="color:red;">Digite seu CPF!</span>';
		apresentaAlertas('1', 'CPF');
		document.getElementById("txtCPF").focus();
		return(false);
	}else{
		document.getElementById("validaCPF").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 30 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("txtSenha").value == "") {
		document.getElementById("validaSenha").innerHTML = '<span style="color:red;">Digite sua senha!</span>';
		apresentaAlertas('1', 'Senha');
		document.getElementById("txtSenha").focus();
		return(false);
	}else{
		document.getElementById("validaSenha").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 31 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("radBolsista").checked == true || document.getElementById("txtBolsistaJustifique").value == "") {
		document.getElementById("validaBolsistaJustifique").innerHTML = '<span style="color:red;">Digite sua justificativa!</span>';
		apresentaAlertas('1', 'Justificativa (Bolsista)');
		document.getElementById("txtBolsistaJustifique").focus();
		return(false);
	}else{
		document.getElementById("validaBolsistaJustifique").innerHTML = '';
	}
	
	// ***************************************************************** //
	// ************************** campo 32 ***************************** //
	// ***************************************************************** //
	if(document.getElementById("radExameBolsa").checked == true || document.getElementById("txtDescontoObtido").value == "") {
		document.getElementById("validaDescontoObtido").innerHTML = '<span style="color:red;">Digite o desconto obtido!</span>';
		apresentaAlertas('1', 'Desconto obtido no exame de bolsa');
		document.getElementById("txtDescontoObtido").focus();
		return(false);
	}else{
		document.getElementById("validaDescontoObtido").innerHTML = '';
	}
	
}


// ****************************************************************************************************************
// função para validar formulário de Indicação de Empresa para Convênio
// ****************************************************************************************************************

function validaFormIndicaConvenio(FormIndicaConvenio){
	if (FormIndicaConvenio.txtNome.value == ""){
		alert("Por favor preencha o campo nome.");
		document.FormIndicaConvenio.txtNome.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtEmpresa.value == ""){
		alert("Por favor preencha o campo empresa.");
		document.FormIndicaConvenio.txtEmpresa.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtHomePage.value == ""){
		alert("Por favor preencha o campo home page.");
		document.FormIndicaConvenio.txtHomePage.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtCepEmpresa.value == ""){
		alert("Por favor preencha o campo CEP.");
		document.FormIndicaConvenio.txtCepEmpresa.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtEnderecoEmpresa.value == ""){
		alert("Por favor preencha o campo endereço comercial.");
		document.FormIndicaConvenio.txtEnderecoEmpresa.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtNumeroEmpresa.value == ""){
		alert("Por favor preencha o campo número.");
		document.FormIndicaConvenio.txtNumeroEmpresa.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtComplementoEmpresa.value == ""){
		alert("Por favor preencha o complemento.");
		document.FormIndicaConvenio.txtComplementoEmpresa.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtBairroEmpresa.value == ""){
		alert("Por favor preencha o bairro.");
		document.FormIndicaConvenio.txtBairroEmpresa.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtCidadeEmpresa.value == ""){
		alert("Por favor preencha o cidade.");
		document.FormIndicaConvenio.txtCidadeEmpresa.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtEstadoEmpresa.value == ""){
		alert("Por favor preencha o estado.");
		document.FormIndicaConvenio.txtEstadoEmpresa.focus();
		return (false);
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(FormIndicaConvenio.txtEmailComercial.value))) { 
        alert("Por favor preencha o campo email comercial.");
        document.FormIndicaConvenio.txtEmailComercial.focus() 
        return (false) 
    }
	if (FormIndicaConvenio.txtTelefoneComercial.value == ""){
		alert("Por favor preencha o telefone comercial.");
		document.FormIndicaConvenio.txtTelefoneComercial.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtRamal.value == ""){
		alert("Por favor preencha o ramal.");
		document.FormIndicaConvenio.txtRamal.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtFaxEmpresa.value == ""){
		alert("Por favor preencha o FAX.");
		document.FormIndicaConvenio.txtFaxEmpresa.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtCargo.value == ""){
		alert("Por favor preencha o cargo.");
		document.FormIndicaConvenio.txtCargo.focus();
		return (false);
	}
	if (FormIndicaConvenio.txtSetor.value == ""){
		alert("Por favor preencha o setor.");
		document.FormIndicaConvenio.txtSetor.focus();
		return (false);
	}
	return (true);
}	

// ****************************************************************************************************************
// função para validar os formulários da Ouvidoria
// ****************************************************************************************************************

function validaFormInteracao(form_nova_interacao){
	if (form_nova_interacao.mensagem.value == ""){
		alert("Por favor preencha o campo mensagem.");
		document.form_nova_interacao.mensagem.focus();
		return (false);
	}
	return (true);
}	

function validaFormChamado(form_novo_chamado){
	if (form_novo_chamado.titulo.value == ""){
		alert("Por favor preencha o campo titulo.");
		document.form_novo_chamado.titulo.focus();
		return (false);
	}
	if (form_novo_chamado.mensagem.value == ""){
		alert("Por favor preencha o campo mensagem.");
		document.form_novo_chamado.mensagem.focus();
		return (false);
	}

	return (true);
}	

// ****************************************************************************************************************
// função para validar o formulário de cadastro de usuário para a ouvidoria
// ****************************************************************************************************************

function validaFormCadOuvidoria(FormCadOuvidoria){
	if (FormCadOuvidoria.txtNome.value == ""){
		alert("Por favor preencha o campo nome.");
		document.FormCadOuvidoria.txtNome.focus();
		return (false);
	}
	if (FormCadOuvidoria.txtSobrenome.value == ""){
		alert("Por favor preencha o campo sobrenome.");
		document.FormCadOuvidoria.txtSobrenome.focus();
		return (false);
	}
	if (FormCadOuvidoria.txtTelefone.value == ""){
		alert("Por favor preencha o campo telefone.");
		document.FormCadOuvidoria.txtTelefone.focus();
		return (false);
	}
	if (FormCadOuvidoria.txtEmail.value == ""){
		alert("Por favor preencha o campo e-mail.");
		document.FormCadOuvidoria.txtEmail.focus();
		return (false);
	}
	/*if (FormCadOuvidoria.txtLogin.value == ""){
		alert("Por favor preencha o campo login.");
		document.FormCadOuvidoria.txtLogin.focus();
		return (false);
	}*/
	if (FormCadOuvidoria.txtSenha.value == ""){
		alert("Por favor preencha o campo senha.");
		document.FormCadOuvidoria.txtSenha.focus();
		return (false);
	}
	return (true);
}	

