PageSourceSearch

https://www.domaquino.mt.gov.br/transparencia/js/funcoes.js

js domaquino.mt.gov.br collected 2026-10-04 01:09:31 UTC 14,574 bytes, 452 lines download raw bytes

1$(document).ready(function(){
2
3    var URL = "";
4
5
6    // função de aparecer as subcategorias
7    $('.categoria-pai, .categoria-filha').on('mouseover', function(){
8        $('.categoria-pai a').addClass('current');
9        $('.categoria-filha').show();
10    });
11
12    // função de sumir as subcategorias
13    $('.categoria-pai').on('mouseout', function(){
14        $('.categoria-pai a').removeClass('current');
15        $('.categoria-filha').hide();
16    });
17
18    // função de aparecer as subcategorias
19    $('.categoria-pai1, .categoria-filha1').on('mouseover', function(){
20        $('.categoria-pai1 a').addClass('current');
21        $('.categoria-filha1').show();
22    });
23    $('.categoria-pai2, .categoria-filha2').on('mouseover', function(){
24        $('.categoria-pai2 a').addClass('current');
25        $('.categoria-filha2').show();
26    });
27    $('.categoria-pai3, .categoria-filha3').on('mouseover', function(){
28        $('.categoria-pai3 a').addClass('current');
29        $('.categoria-filha3').show();
30    });
31    $('.categoria-pai4, .categoria-filha4').on('mouseover', function(){
32        $('.categoria-pai4 a').addClass('current');
33        $('.categoria-filha4').show();
34    });
35
36    // função de sumir as subcategorias
37    $('.categoria-pai1').on('mouseout', function(){
38        $('.categoria-pai1 a').removeClass('current');
39        $('.categoria-filha1').hide();
40    });
41    $('.categoria-pai2').on('mouseout', function(){
42        $('.categoria-pai2 a').removeClass('current');
43        $('.categoria-filha2').hide();
44    });
45    $('.categoria-pai3').on('mouseout', function(){
46        $('.categoria-pai3 a').removeClass('current');
47        $('.categoria-filha3').hide();
48    });
49    $('.categoria-pai4').on('mouseout', function(){
50        $('.categoria-pai4 a').removeClass('current');
51        $('.categoria-filha4').hide();
52    });
53
54
55	$('.pai-submenu, .submenu').on('mouseover', function(){
56        $('.pai-submenu').addClass('ativo');
57    });
58
59    $('.pai-submenu').on('mouseout', function(){
60        $('.pai-submenu').removeClass('ativo');
61    });
62
63    ///////////////////////////////////////////////////////////////////////////////////
64    //Lista de imagens
65    $('.listaImagens li a').click(function(event){
66
67        event.preventDefault();
68
69        var imgMaior = $(this).attr('target');
70        var imgMedia = $(this).attr('href');
71
72        $('.listaImagens li').removeClass('current');
73        $(this).parents('li').addClass('current');
74
75        $('.listagemImagens li').addClass('current');
76
77        $('.thumbMaior').attr('href', imgMaior);
78        $('.thumbMaior img').attr('src', imgMedia);
79
80        return false;
81    });
82
83    $('.externo').attr('target', '_blanck');
84
85    // função do player
86    timeInterval = setInterval(playerNext, 4000);
87
88    function playerNext() {
89        if($('.paginas-banner a.current').next().hasClass('bt')) {
90            $('.paginas-banner a.current').next().click();
91        } else {
92            $('.paginas-banner a:first').click();
93        }
94    }
95
96    $('.paginas-banner a').click(function(event){
97
98        $('.paginas-banner a').removeClass('current');
99        $(this).addClass('current');
100
101        var playerEsconder = $('.conteudo-player .item.current');
102        var playerExibir = $($(this).attr('href'));
103
104        playerEsconder.fadeOut(200, function(){
105            playerExibir.fadeIn(400, function(){
106                playerExibir.addClass('current');
107                playerEsconder.removeClass('current');
108                clearInterval(timeInterval);
109                timeInterval = setInterval(playerNext, 4000);
110            });
111        });
112
113        event.preventDefault();
114        return false;
115
116    });
117	
118	//NEWSLATTER
119    efect_clear_input('#nome', 'Digite o seu nome');
120    efect_clear_input('#email', 'Digite o seu E-mail');
121
122    jQuery("#cad-news").submit(function(g){
123
124
125        var e = false;
126        if (jQuery("#nome").val() == "" ) {
127            e = true
128        }
129
130        var e = false;
131        if ( (jQuery("#email").val() == "") || (!validaEmail(jQuery("#email").val())) ) {
132            e = true
133        }
134
135        if (e == false) {
136            var f = jQuery(this).serialize();
137
138            jQuery.ajax({
139                header: {
140                    "Content-Type": "text/html;  charset=ISO-8859-1"
141                },
142                type: "post",
143                data: "acao=newsletter&" + f,
144                url: URL+"ajax.php",
145                dataType: "json",
146                success: function(h){
147                    if (h.error == false) {
148                        jQuery("#nome").val("Digite o seu nome");
149
150                        jQuery("#email").val("Digite o seu E-mail");
151
152                        jAlert(h.msg, 'Sucesso!');
153                    }
154                    else {
155                        jAlert(h.msg, 'Erro!');
156                    }
157                    g.preventDefault(g);
158                    return false;
159                }
160            })
161        }else{
162            jAlert('<p>*Preencha os campos corretamente.</p>', 'Erro!');
163        }
164        g.preventDefault(g);
165        return false;
166    });
167    //NEWSLATTER
168	
169
170    // Formulario Indique
171    $('#bt-enviar-contato').click(function(event){
172
173        error = false;
174
175        nome = $('#nome').val();
176        email = $('#email').val();
177        mensagem = $('#comentario').val();
178        assunto = $('#assunto').val();
179        fone = $('#fone').val();
180
181        // Remove os Avissos
182        $('.avisso').remove();
183
184
185        if (nome == '') {
186            $('#nome').parent().prepend('<span class="avisso">Informe o seu nome</span>');
187            error = true;
188        }
189		if (fone == '') {
190            $('#fone').parent().prepend('<span class="avisso">Informe o seu telefone </span>');
191            error = true;
192        }
193        if (email == '') {
194            $('#email').parent().prepend('<span class="avisso">Informe o seu e-mail </span>');
195            error = true;
196        }
197        if (assunto == '') {
198            $('#assunto').parent().prepend('<span class="avisso">Informe um assunto </span>');
199            error = true;
200        }
201        else {
202            if (!validaEmail(email)) {
203                $('#email').parent().prepend('<span class="avisso">Informe um e-mail v&aacute;lido</span>');
204                error = true;
205            }
206        }
207
208        if (assunto == '') {
209            $('#assunto-span').parent().prepend('<span class="avisso">Selecione o assunto</span>');
210            error = true;
211        }
212
213        if (mensagem == '') {
214            $('#comentario').parent().prepend('<span class="avisso">Informe o seu coment&aacute;rio </span>');
215            error = true;
216        }
217
218
219        // verifica se há Erros
220        if (!error) {
221            $('#bt-enviar-comentario').attr('src', './img/carregando.gif');
222
223            $.ajax({
224                type: 'post',
225                url: 'ajax.php',
226                //Não deixa deixa fazer outras requisições
227                async: false,
228                data: $('#form-comentario').serialize(),
229                dataType: 'json',
230                success: function(resp){
231                    if (resp.error) {
232                        alert( resp.msg);
233                        $('#form-comentario fieldset').prepend('<span class="avisso">' + resp.msg + '</span>');
234                        $('#bt-enviar-comentario').attr('src', './img/bt-enviar.jpg');
235                    }
236                    else {
237                        $('#form-comentario').hide();
238                        $('#form-comentario').parent().append('<div class="sucesso">' + resp.msg + '</div>');
239                        $('#bt-enviar-comentario').attr('src', './img/bt-enviar.jpg');
240
241                    }
242
243                }
244            });
245        }
246        event.preventDefault(event);
247        return false;
248
249    });
250	
251	
252	// Bind no input e propertychange para pegar ctrl-v
253    // e outras formas de input
254    $(".phonemasc").bind('input propertychange',function(){
255        // pego o valor do telefone
256        var texto = $(this).val();
257        // Tiro tudo que não é numero
258        texto = texto.replace(/[^\d]/g, '');
259        // Se tiver alguma coisa
260        if (texto.length > 0)
261        {
262            // Ponho o primeiro parenteses do DDD
263            texto = "(" + texto;
264
265            if (texto.length > 3)
266            {
267                // Fecha o parenteses do DDD
268                texto = [texto.slice(0, 3), ") ", texto.slice(3)].join('');
269            }
270            if (texto.length > 12)
271            {
272                // Se for 13 digitos ( DDD + 9 digitos) ponhe o traço no quinto digito
273                if (texto.length > 13)
274                    texto = [texto.slice(0, 10), "-", texto.slice(10)].join('');
275                else
276                // Se for 12 digitos ( DDD + 8 digitos) ponhe o traço no quarto digito
277                    texto = [texto.slice(0, 9), "-", texto.slice(9)].join('');
278            }
279            // Não adianta digitar mais digitos!
280            if (texto.length > 15)
281                texto = texto.substr(0,15);
282        }
283        // Retorna o texto
284        $(this).val(texto);
285    })
286	
287
288
289	  //////////////////////////////////////////////////////////////////////////////////////////
290		// FaceBox	
291		jQuery("a[rel=galeria]").fancybox({
292			'transitionIn'	: 'elastic',
293			'transitionOut'	: 'elastic',
294			'speedIn'		:	500,
295			'speedOut'		:	200,
296			'titlePosition' 	: 'over',
297			'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
298				return '<span id="fancybox-title-over">Foto ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
299			}
300		});
301		
302		   // fazer o box de marcas passar automaticamente
303    $(".itens-slide").jCarouselLite({
304        btnPrev : '.seta-voltar', // Navegação: voltar imagem
305        btnNext : '.seta-avancar', // Navegação: Próxima imagem
306        auto : 4000, // Auto-scroll do carrossel. Tempo em milisegundos.
307        speed : 800, // Velocidade de "sliding". 0 irá remover o efeito de slide.
308        visible : 1 // Número de itens (fotos) visíveis no carrossel de imagens.
309    });
310
311
312
313});
314
315function efect_clear_input(ident_element, string_sub) {
316    jQuery(ident_element).focus(function(){
317        if( jQuery(this).val() == string_sub) {
318            jQuery(this).val('');
319        }
320    }).blur(function(){
321        if(jQuery(this).val() == "") {
322            jQuery(this).val(string_sub);
323        }
324    });
325}
326
327function loadMapa(endCompleto, id, ponto, local ){
328    var geocoder;
329    var map;
330    var marker;
331
332    geocoder = new google.maps.Geocoder();
333    var latlng = new google.maps.LatLng(-22.724976500000000000, -47.647600600000030000);
334    var myOptions = {
335        zoom: 10,
336        center: latlng,
337        mapTypeControl:false,
338        scrollwheel: false,
339        mapTypeId: google.maps.MapTypeId.ROADMAP
340    }
341    map = new google.maps.Map(document.getElementById(id), myOptions);
342
343    if(local == true){
344        var address = endCompleto;
345        geocoder.geocode( { 'address': address}, function(results, status) {
346            if (status == google.maps.GeocoderStatus.OK) {
347                map.setCenter(results[0].geometry.location);
348                if(ponto == true){
349                    var marker = new google.maps.Marker({map: map,position: results[0].geometry.location});
350                }
351            } else {
352                //alert("Geocode was not successful for the following reason: " + status);
353            }
354        });
355    }else{
356        marker = new google.maps.Marker({
357            position: latlng,
358            map: map
359        });
360    }
361
362}
363
364//Função para validar e-mails
365function validaEmail(mail){
366    var er = RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
367    if (er.test(mail) == false) {
368        return false;
369    }
370    
371    return true;
372}
373
374
375///////////////////////////////////////////////////////////////////////////////
376///////////////////////////////////////////////////////////////////////////////
377// Enquete
378$(function(){
379    var loader = $('#loader');
380    var pollcontainer = $('#pollcontainer');
381    loader.fadeIn();
382    idEnquete = $('#enquete-id').text();
383    
384    
385    if (idEnquete != "") {
386        //Load the poll form
387        $.get('http://www.lucelia.sp.gov.br/poll.php', {
388            "id": idEnquete
389        }, function(data, status){
390            pollcontainer.html(data);
391            animateResults(pollcontainer);
392            
393            
394            pollcontainer.find('#viewresult').click(function(){
395                //if user wants to see result
396                loader.fadeIn();
397                $.get('http://www.lucelia.sp.gov.br/poll.php', {
398                    "id": idEnquete,
399                    "result": 1
400                }, function(data, status){
401                    pollcontainer.fadeOut(1000, function(){
402                        $(this).html(data);
403                        animateResults(this);
404                    });
405                    loader.fadeOut();
406                });
407                //prevent default behavior
408                return false;
409            }).end().find('#pollform').submit(function(){
410                var selected_val = $(this).find('input[name=poll]:checked').val();
411                if (selected_val != '') {
412                    //post data only if a value is selected
413                    loader.fadeIn();
414                    $.post('http://www.lucelia.sp.gov.br/poll.php', $(this).serialize(), function(data, status){
415                        $('#formcontainer').fadeOut(100, function(){
416                            $(this).html(data);
417                            animateResults(this);
418                            loader.fadeOut();
419                        });
420                    });
421                }
422                //prevent form default behavior
423                return false;
424            });
425            loader.fadeOut();
426        });
427        
428    }
429    else {
430        $('#box-enquete').hide();
431    }
432    
433    function animateResults(data){
434        $(data).find('.bar').hide().end().fadeIn('slow', function(){
435            $(this).find('.bar').each(function(){
436                var bar_width = $(this).css('width');
437                $(this).css('width', '0').animate({
438                    width: bar_width
439                }, 1000);
440            });
441        });
442    }
443    
444});
445
446function m_gp_submit_busca_desktop() {
447	if (document.getElementById('c-busca-input-desktop').value == "" || document.getElementById('c-busca-input-desktop').value == "BUSCAR") {
448		alert("Informe o termo para busca!");
449		return false;
450	}
451	return true;
452}

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.