PageSourceSearch

https://ital.org.br/assets/js/scripts.js?v=1406859236

js ital.org.br collected 2026-10-04 08:22:35 UTC 10,023 bytes, 390 lines download raw bytes

1function limpa_formulário_cep() {
2	// Limpa valores do formulário de cep.
3	$("#endereco").val("");
4	$("#bairro").val("");
5	$("#cidade").val("");
6	$("#uf").val("");
7	//$("#ibge").val("");
8}
9
10function getEndereco(tipo) {
11	switch (tipo) {
12		default:
13			//Nova variável "cep" somente com dígitos.
14			var cep = $("#cep").val().replace(/\D/g, '');
15
16			//Verifica se campo cep possui valor informado.
17			if (cep != "") {
18
19				//Expressão regular para validar o CEP.
20				var validacep = /^[0-9]{8}$/;
21
22				//Valida o formato do CEP.
23				if (validacep.test(cep)) {
24
25					//Preenche os campos com "..." enquanto consulta webservice.
26					$("#endereco").val("...");
27					$("#bairro").val("...");
28					$("#cidade").val("...");
29					$("#uf").val("...");
30					//$("#ibge").val("...");
31
32					//Consulta o webservice viacep.com.br/
33					$.getJSON("https://viacep.com.br/ws/" + cep + "/json/?callback=?", function (dados) {
34
35						if (!("erro" in dados)) {
36							//Atualiza os campos com os valores da consulta.
37							$("#endereco").val(dados.logradouro);
38							$("#bairro").val(dados.bairro);
39							$("#cidade").val(dados.localidade);
40							$("#uf").val(dados.uf);
41							//$("#ibge").val(dados.ibge);
42						} //end if.
43						else {
44							//CEP pesquisado não foi encontrado.
45							limpa_formulário_cep();
46							//alert("CEP não encontrado.");
47						}
48					});
49				} //end if.
50				else {
51					//cep é inválido.
52					limpa_formulário_cep();
53					alert("Formato de CEP inválido.");
54				}
55			} //end if.
56			else {
57				//cep sem valor, limpa formulário.
58				limpa_formulário_cep();
59			}
60			break;
61	}
62}
63
64function abrirFechar(id, conteudo) {
65	var e = $('#' + conteudo);
66	var cl1 = $(id).attr("class");
67	var cl2 = e.attr("class");
68
69	if (cl1 == 'ce-arrow-open') {
70		$(id).removeClass('ce-arrow-open');
71		$(id).addClass('ce-arrow-close');
72	} else {
73		$(id).addClass('ce-arrow-open');
74		$(id).removeClass('ce-arrow-close');
75	}
76
77	if (cl2 == 'd-none') {
78		e.removeClass('d-none');
79	} else {
80		e.addClass('d-none');
81	}
82}
83
84function remover() {
85	$('.cloneParticipante:last').remove();
86};
87
88$(function () {
89	$('map').imageMapResize();
90
91	bsCustomFileInput.init();
92
93	$('.open-close').click(function () {
94		var classe = $(this).find('div').attr('class');
95
96		$(this).parent().find('li').each(function () {
97			$(this).find('div').addClass('d-none');
98			$(this).find('span').removeClass('active');
99		});
100
101		if (classe == 'd-none') {
102			$(this).find('span').addClass('active');
103			$(this).find('div').removeClass('d-none');
104			$(this).find('i').removeClass('fa-angle-right');
105			$(this).find('i').addClass('fa-angle-down');
106		} else {
107			$(this).find('span').removeClass('active');
108			$(this).find('div').addClass('d-none');
109			$(this).find('i').removeClass('fa-angle-down');
110			$(this).find('i').addClass('fa-angle-right');
111		}
112	});
113
114	$('.open-close2').click(function () {
115		var classe = $(this).closest('li').find('div').attr('class');
116
117		console.log(classe);
118
119		$(this).closest().find('li').each(function () {
120			console.log('ha');
121			$(this).closest('li').find('div').addClass('d-none');
122		});
123
124		if (classe == 'content d-none') {
125			$(this).closest('li').find('div').removeClass('d-none');
126			$(this).closest('li').find('i').removeClass('fa-chevron-right');
127			$(this).closest('li').find('i').addClass('fa-chevron-down');
128		} else {
129			$(this).closest('li').find('div').addClass('d-none');
130			$(this).closest('li').find('i').removeClass('fa-chevron-down');
131			$(this).closest('li').find('i').addClass('fa-chevron-right');
132		}
133	});
134
135	$(".box a").mouseover(function () {
136		$(this).parents('div.caption:eq(0)').parent().find('a').first().css('opacity', '1');
137	});
138	$(".box a").mouseout(function () {
139		$(this).parents('div.caption:eq(0)').parent().find('a').first().css('opacity', '');
140	});
141
142	$("#formEnviar").click(function () {
143		$('#confirmacaoModal').modal('hide')
144	})
145
146
147	// validate signup form on keyup and submit
148	$("#formContato,#formsCetea").validate({
149		rules: {
150			email: {
151				required: true,
152				email: true
153			},
154			cpf: {
155				required: true,
156				digits: true
157			},
158			cpf_solicitante: {
159				required: true,
160				digits: true
161			},
162		},
163		messages: {
164			email: "Digite um e-mail válido",
165			cpf: {
166				required: "O campo obrigatório",
167				digits: "Digite somente números"
168			},
169			cpf_solicitante: {
170				required: "O campo obrigatório",
171				digits: "Digite somente números"
172			}
173		},
174		errorElement: "em",
175		errorPlacement: function (error, element) {
176			// Add the `help-block` class to the error element
177			error.addClass("help-block");
178
179			if (element.prop("type") === "checkbox") {
180				error.insertAfter(element.parent("label"));
181			} else {
182				error.insertAfter(element);
183			}
184		},
185		submitHandler: function (form) {
186			$.ajax({
187				type: "POST",
188				url: "/contato",
189				data: $(form).serialize(),
190				success: function (retorno) {
191					if (retorno == 'ok') {
192						$(form).html("<div id='message'></div>");
193						$('#message').html("<h2>Sua solicitação está a caminho!!!</h2>")
194							.append("<p>Em breve entraremos em contato</p>")
195							.hide()
196							.fadeIn(1500, function () {
197								$('#message').append('<i class="far fa-check-circle"></i>');
198							});
199					} else {
200						//$("#captcha-error").html('<p class="alert alert-danger">Ative o captcha.</p>');
201						$(form).html("<div id='message'></div>");
202						$('#message').html("<h2>Sua solicitação está a caminho!!!</h2>")
203							.append("<p>Em breve entraremos em contato</p>")
204							.hide()
205							.fadeIn(1500, function () {
206								$('#message').append('<i class="far fa-check-circle"></i>');
207							});
208					}
209				}
210			});
211
212			return false; // required to block normal submit since you used ajax
213		}
214	});
215	// validate signup form on keyup and submit
216	$("#formContato2").validate({
217		rules: {
218			email: {
219				required: true,
220				email: true
221			},
222			cpf: {
223				required: true,
224				digits: true
225			},
226			cpf_solicitante: {
227				required: true,
228				digits: true
229			},
230		},
231		messages: {
232			email: "Digite um e-mail válido",
233			cpf: {
234				required: "O campo obrigatório",
235				digits: "Digite somente números"
236			},
237			cpf_solicitante: {
238				required: "O campo obrigatório",
239				digits: "Digite somente números"
240			}
241		},
242		errorElement: "em",
243		errorPlacement: function (error, element) {
244			// Add the `help-block` class to the error element
245			error.addClass("help-block");
246
247			if (element.prop("type") === "checkbox") {
248				error.insertAfter(element.parent("label"));
249			} else {
250				error.insertAfter(element);
251			}
252		}
253	});
254
255	// validate signup form on keyup and submit
256	$("#formOportunidade").validate({
257		rules: {
258			email: {
259				required: true,
260				email: true
261			},
262		},
263		messages: {
264			email: "Digite um e-mail válido",
265		},
266		errorElement: "em",
267		errorPlacement: function (error, element) {
268			// Add the `help-block` class to the error element
269			error.addClass("help-block");
270
271			if (element.prop("type") === "checkbox") {
272				error.insertAfter(element.parent("label"));
273			} else {
274				error.insertAfter(element);
275			}
276		}
277	});
278	$("#formOportunidade2").validate({
279		rules: {
280			email: {
281				required: true,
282				email: true
283			},
284		},
285		messages: {
286			email: "Digite um e-mail válido",
287		},
288		errorElement: "em",
289		errorPlacement: function (error, element) {
290			// Add the `help-block` class to the error element
291			error.addClass("help-block");
292
293			if (element.prop("type") === "checkbox") {
294				error.insertAfter(element.parent("label"));
295			} else {
296				error.insertAfter(element);
297			}
298		}
299	});
300
301	$('#atividadesAnalises').change(function () {
302		var opcao = $(this).val();
303		if (opcao == 'analise') {
304			$('#analises').removeClass('d-none');
305			$('#grupos').addClass('d-none');
306		} else {
307			$('#analises').addClass('d-none');
308			$('#grupos').removeClass('d-none');
309		}
310	});
311
312	var cloneCntr = 1;
313	$("#go").click(function () {
314		$("#participantes").show();
315		$(".remove_field").show();
316		var clone = $("#dadosParticipante").clone(true);
317		$("*", clone).add(clone).each(function () {
318			if (this.id) {
319				this.id = this.id + "_clone" + cloneCntr;
320			}
321		});
322		++cloneCntr;
323		clone.addClass('cloneParticipante');
324		clone.find('input:text, input:password, input:file, select, textarea').val('');
325		$("#participantes").append(clone);
326	});
327
328	//Botoes Oportunidades
329	$(".portugues").click(function () {
330		$(".pt").show();
331		$(".en").hide();
332	});
333
334	$(".english").click(function () {
335		$(".en").show();
336		$(".pt").hide();
337	});
338
339	$("#est").hide();
340
341	$('input:radio[name="nacionalidade"]').change(function () {
342		if ($(this).is(':checked') && $(this).val() == 'Brasileiro') {
343			$("#br").show();
344			$("#est").hide();
345			$("#file-22").attr('disabled', true);
346			$("#file-21").attr('disabled', false);
347		} else {
348			$("#br").hide();
349			$("#est").show();
350			$("#file-22").attr('disabled', false);
351			$("#file-21").attr('disabled', true);
352		}
353	});
354
355	$('#myModal').modal();
356
357
358})
359
360function toggleInfo(header) {
361	const infoDiv = header.parentElement.querySelector('.hide-info');
362	const icon = header.querySelector('i');
363
364	if (infoDiv.classList.contains('d-none') && infoDiv.classList.contains('hide-info')) {
365		infoDiv.classList.remove('d-none');
366		icon.classList.remove('fa-angle-right');
367		icon.classList.add('fa-angle-down');
368		infoDiv.style.maxHeight = infoDiv.scrollHeight + 'px'; // Define a altura máxima como a altura do conteúdo
369	} else {
370		infoDiv.style.maxHeight = '0'; // Define a altura máxima como 0 para ocultar
371		icon.classList.remove('fa-angle-down');
372		icon.classList.add('fa-angle-right');
373		setTimeout(() => {
374			infoDiv.classList.add('d-none');
375		}, 300); // Espere a transição terminar antes de ocultar completamente
376	}
377}
378
379function translateLanguage(language) {
380	var translateElement = document.querySelector('#google_translate_element select');
381	for (var i = 0; i < translateElement.children.length; i++) {
382		var option = translateElement.children[i];
383		if (option.value.includes(language)) {
384			translateElement.selectedIndex = i;
385			translateElement.dispatchEvent(new Event('change'));
386			break;
387		}
388	}
389}
390

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.