PageSourceSearch

https://www.plottier.gob.ar/wp-content/themes/thegov/js/theme-addons.js?ver=6.7.2

js plottier.gob.ar collected 2026-10-03 00:30:10 UTC 78,272 bytes, 2,270 lines download raw bytes

1"use strict";
2// Accordion 
3function thegov_accordion_init() {
4    var item = jQuery('.wgl-accordion');
5
6    item.each(function(){
7        var header = jQuery(this).find('.wgl-accordion_header');
8        var content = jQuery(this).find('.wgl-accordion_content');
9        var acc_type = jQuery(this).data('type');
10        var speed = 400;
11        header.off("click");
12
13        header.each(function(){
14            if (jQuery(this).data('default') == 'yes') {
15                jQuery(this).addClass('active');
16                jQuery(this).next().slideDown(speed);
17            }
18        })
19
20        header.on('click', function(e){
21            e.preventDefault();
22            var $this = jQuery(this);
23    
24            if (acc_type == 'accordion') {
25                $this.toggleClass('active');
26                $this.next().slideToggle(speed);
27                content.not($this.next()).slideUp(speed);
28                header.not($this).removeClass('active');
29            } else if (acc_type == 'toggle'){
30                $this.toggleClass('active');
31                $this.next().slideToggle(speed);
32            }
33    
34        })
35
36    })
37
38}
39// Services Accordion
40function thegov_services_accordion_init() {
41    var item_module = jQuery('.wgl-accordion-services');
42
43    item_module.each(function(){
44        var item = jQuery(this).find('.wgl-services_item');
45        jQuery(this).find('.wgl-services_item:first-child').addClass('active');
46
47        item.on('mouseover', function(e){
48            jQuery(this).addClass('active').siblings().removeClass('active');
49        })
50    })
51}
52( function ($){
53
54  jQuery(document).ready(function (){ 
55    thegov_ajax_load();
56  });
57  
58  function thegov_ajax_load (){
59    var i, section;
60    var sections = document.getElementsByClassName( 'wgl_cpt_section' );
61    for ( i = 0; i < sections.length; i++ ){
62      section = sections[i];
63      thegov_ajax_init ( section );
64    }
65  }
66
67  var wait_load = false;
68  var offset_items = 0;
69  var infinity_item;
70
71  function thegov_ajax_query(grid,section, request_data){
72
73    if ( wait_load ) return;
74    wait_load = true;
75    request_data['offset_items'] = offset_items;
76    request_data['items_load'] = request_data.items_load;
77    
78    //if mode_security enabled remove sql request
79    if(request_data.query && request_data.query.request){
80      delete request_data.query.request;
81    }
82
83    $.post( wgl_core.ajaxurl, {
84      'action'    : 'wgl_ajax',
85      'data'      : request_data
86
87    }, function ( response, status ){
88      var resp, new_items, load_more_hidden, count_products;
89      resp = document.createElement( "div" );
90      resp.innerHTML = response;
91      new_items = $( ".item", resp );
92      count_products = $( ".woocommerce-result-count", resp );
93
94      load_more_hidden = $( ".hidden_load_more", resp );
95
96      if(load_more_hidden.length){
97        jQuery(section).find('.load_more_wrapper').fadeOut(300, function() { $(this).remove(); });
98      }else{
99        jQuery(section).find('.load_more_wrapper .load_more_item').removeClass('loading');
100      }
101
102      jQuery(section).find('.woocommerce-result-count').html(jQuery(count_products).html());
103
104      if($( grid ).hasClass('carousel')){
105        $( grid ).find('.slick-track').append( new_items );
106        $( grid ).find('.slick-dots').remove();
107        $( grid ).find('.wgl-carousel_slick').slick('reinit');            
108      }
109      else if($( grid ).hasClass('grid')){
110        new_items = new_items.hide();
111        $( grid ).append( new_items );
112        new_items.fadeIn('slow');         
113      }else{
114        var items = jQuery(new_items);    
115        jQuery(grid).imagesLoaded().always(function(){
116            jQuery(grid).append(items).isotope('appended', items).isotope("reloadItems");
117
118            setTimeout(function(){
119              jQuery(grid).isotope( 'layout' );             
120              thegov_scroll_animation();     
121              updateFilter(); 
122            }, 500);
123
124        });                       
125      }
126
127          //Call vc waypoint settings
128          if(typeof jQuery.fn.waypoint === "function"){
129            jQuery(grid).find(".wpb_animate_when_almost_visible:not(.wpb_start_animation)").waypoint(function() {
130              jQuery(this).addClass("wpb_start_animation animated")
131            }, { offset: "100%"}); 
132          }
133
134          //Call video background settings
135          if(typeof jarallax === 'function'){
136            thegov_parallax_video();
137          }else{
138            jQuery.getScript(wgl_core.JarallaxPluginVideo, function()
139            {
140             jQuery.getScript(wgl_core.JarallaxPlugin, function(){}
140).always(function( s, Status ) {
141              jQuery(grid).find('.parallax-video').each(function() {
142                jQuery( this ).jarallax( {
143                  loop: true,
144                  speed: 1,
145                  videoSrc: jQuery( this ).data( 'video' ),
146                  videoStartTime: jQuery( this ).data( 'start' ),
147                  videoEndTime: jQuery( this ).data( 'end' ),
148                } );    
149              });
150            });
151           });         
152          }         
153
154          //Call slick settings
155          if (jQuery(grid).find('.wgl-carousel_slick').size() > 0) {
156            jQuery.getScript(wgl_core.slickSlider).always(function( s, Status ) {
157              jQuery(grid).find('.wgl-carousel_slick').each(function() {
158                destroyCarousel(jQuery(this));
159                slickCarousel(jQuery(this));
160                if(jQuery(grid).hasClass('blog_masonry')){
161                  jQuery(grid).isotope( 'layout' );
162                }     
163              });
164            });
165          }
166
167          thegov_scroll_animation();   
168          //Update Items
169          offset_items += parseInt(request_data.items_load);
170          
171          wait_load = false;
172
173        });
174  }
175
176  function thegov_ajax_init ( section ){
177
178    var grid, form, data_field, data, request_data, load_more;
179
180    //if Section CPT return
181    if ( section == undefined ) return;
182    
183    //Get grid CPT
184    grid = section.getElementsByClassName( 'container-grid' );  
185    if ( !grid.length ) return;
186    grid = grid[0];
187    
188    //Get form CPT
189    form = section.getElementsByClassName( 'posts_grid_ajax' );
190    if ( !form.length ) return;
191    form = form[0];
192
193    //Get field form ajax
194    data_field = form.getElementsByClassName( 'ajax_data' );
195    if ( !data_field.length ) return;
196    data_field = data_field[0];
197    
198    data = data_field.value;
199    data = JSON.parse( data ); 
200    request_data =  data;
201
202    //Add pagination
203    offset_items += request_data.post_count;
204
205    infinity_item = section.getElementsByClassName( 'infinity_item' );
206
207    if ( infinity_item.length ){
208      infinity_item = infinity_item[0];
209      if(jQuery( infinity_item ).is_visible()){
210        thegov_ajax_query(grid, section, request_data);
211      }
212      var lastScrollTop = 0;
213
214      jQuery(window).on('resize scroll', function() {
215        if(jQuery( infinity_item ).is_visible()){
216          var st = jQuery(this).scrollTop();
217          if (st > lastScrollTop){
218            thegov_ajax_query(grid, section, request_data);
219          }
220          lastScrollTop = st;
221        }
222      });
223    } 
224
225    load_more = section.getElementsByClassName( 'load_more_item' );
226    if ( load_more.length ){
227      load_more = load_more[0];
228      load_more.addEventListener( 'click', function ( e ){
229          e.preventDefault();
230          jQuery(this).addClass('loading');
231          thegov_ajax_query(grid, section, request_data)
232      }, false );
233    }     
234
235
236  }
237  
238  function slickCarousel(grid) {
239    jQuery(grid).slick({
240      draggable: true,
241      fade: true,
242      speed: 900,
243      cssEase: 'cubic-bezier(0.7, 0, 0.3, 1)',
244      touchThreshold: 100
245    });
246  }
247  function destroyCarousel(grid) {
248    if (jQuery(grid).hasClass('slick-initialized')) {
249      jQuery(grid).slick('destroy');
250    }      
251  }
252
253  function updateFilter(){
254    jQuery(".isotope-filter a").each(function(){
255      var data_filter = this.getAttribute("data-filter");
256      var num = jQuery(this).closest('.wgl-portfolio').find('.wgl-portfolio-list_item').filter( data_filter ).length;
257      jQuery(this).find('.number_filter').text( num );
258    });
259      
260  }
261
262}(jQuery));
263function thegov_scroll_animation(){
264  var portfolio = jQuery('.wgl-portfolio_container');
265  var shop = jQuery('.wgl-products.appear-animation');
266
267  //Scroll Animation
268  (function($) {
269
270      var docElem = window.document.documentElement;
271
272      function getViewportH() {
273        var client = docElem['clientHeight'],
274          inner = window['innerHeight'];
275        
276        if( client < inner )
277          return inner;
278        else
279          return client;
280      }
281
282      function scrollY() {
283        return window.pageYOffset || docElem.scrollTop;
284      }
285
286      // http://stackoverflow.com/a/5598797/989439
287      function getOffset( el ) {
288        var offsetTop = 0, offsetLeft = 0;
289        do {
290          if ( !isNaN( el.offsetTop ) ) {
291            offsetTop += el.offsetTop;
292          }
293          if ( !isNaN( el.offsetLeft ) ) {
294            offsetLeft += el.offsetLeft;
295          }
296        } while( el = el.offsetParent )
297
298        return {
299          top : offsetTop,
300          left : offsetLeft
301        }
302      }
303
304      function inViewport( el, h ) {
305        var elH = el.offsetHeight,
306          scrolled = scrollY(),
307          viewed = scrolled + getViewportH(),
308          elTop = getOffset(el).top,
309          elBottom = elTop + elH,
310          h = h || 0;
311
312        return (elTop + elH * h) <= viewed && (elBottom - elH * h) >= scrolled;
313      }
314
315      function extend( a, b ) {
316        for( var key in b ) { 
317          if( b.hasOwnProperty( key ) ) {
318            a[key] = b[key];
319          }
320        }
321        return a;
322      }
323
324      function AnimOnScroll( el, options ) {  
325        this.el = el;
326        this.options = extend( this.defaults, options );
327        if(this.el.length){
328          this._init();
329        }      
330      }
331
332      AnimOnScroll.prototype = {
333        defaults : {
334          viewportFactor : 0
335        },
336        _init : function() {
337          this.items = Array.prototype.slice.call( jQuery(this.el ).children() );
338          this.itemsCount = this.items.length;
339          this.itemsRenderedCount = 0;
340          this.didScroll = false;
341          this.delay = 100;
342          
343
344          var self = this;
345
346          if(typeof imagesLoaded === 'function'){
347            imagesLoaded( this.el, this._imgLoaded(self));
348          }else{
349            this._imgLoaded(self);
350          } 
351          
352        },
353        _imgLoaded : function(self) {
354          
355          var interval;
356
357              // the items already shown...
358              self.items.forEach( function( el, i ) {
359                if( inViewport( el ) ) {
360
361                  self._checkTotalRendered();
362                  if(!jQuery(el).hasClass('show') && !jQuery(el).hasClass('animate') && inViewport( el, self.options.viewportFactor )){
363                    self._item_class(jQuery(el), self.delay, interval );
364                    self.delay += 200;
365                    setTimeout( function() {
366                      self.delay = 100;
367                    }, 200 );                    
368                  }
369                }
370              } );
371
372              // animate on scroll the items inside the viewport
373              window.addEventListener( 'scroll', function() {
374                self._onScrollFn();
375              }, false );
376              window.addEventListener( 'resize', function() {
377                self._resizeHandler();
378              }, false );          
379        },
380
381        _onScrollFn : function() {
382          var self = this;
383          if( !this.didScroll ) {
384            this.didScroll = true;
385            setTimeout( function() { self._scrollPage(); }, 60 );
386          }
387        },
388        _item_class : function(item_array, delay, interval) {
389
390          interval = setTimeout(function(){
391            if ( item_array.length) {
392              jQuery(item_array).addClass( 'animate' );
393            } else {
394              clearTimeout( interval );
395            }
396          }, delay);   
397           
398        },
399
400        _scrollPage : function() {
401          var self = this;
402          var interval;
403
404          this.items.forEach( function( el, i ) {
405            if( !jQuery(el).hasClass('show') && !jQuery(el).hasClass('animate') && inViewport( el, self.options.viewportFactor ) ) {
406              setTimeout( function() {
407                var perspY = scrollY() + getViewportH() / 2;
408
409                self._checkTotalRendered();
410                self._item_class(jQuery(el), self.delay, interval);
411                self.delay += 200;
412                setTimeout( function() {
413                  self.delay = 100;
414                }, 200 );
415
416              }, 25 );
417            }
418          });
419          this.didScroll = false;
420        },
421        _resizeHandler : function() {
422          var self = this;
423          function delayed() {
424            self._scrollPage();
425            self.resizeTimeout = null;
426          }
427          if ( this.resizeTimeout ) {
428            clearTimeout( this.resizeTimeout );
429          }
430          this.resizeTimeout = setTimeout( delayed, 1000 );
431        },
432        _checkTotalRendered : function() {
433          ++this.itemsRenderedCount;
434          if( this.itemsRenderedCount === this.itemsCount ) {
435            window.removeEventListener( 'scroll', this._onScrollFn );
436          }
437        }
438      }
439
440      // add to global namespace
441      window.AnimOnScroll = AnimOnScroll;
442
443  })(jQuery);
444
445  new AnimOnScroll( portfolio, {} );
446  new AnimOnScroll( shop, {} );
447    
448} 
449// Scroll Up button
450function thegov_scroll_up() {
451	(function($) {
452		$.fn.goBack = function (options) {
453			var defaults = {
454				scrollTop: jQuery(window).height(),
455				scrollSpeed: 600,
456				fadeInSpeed: 1000,
457				fadeOutSpeed: 500
458			};
459			var options = $.extend(defaults, options);
460			var $this = $(this);
461			$(window).on('scroll', function () {
462				if ($(window).scrollTop() > options.scrollTop) {
463					$this.addClass('active');
464				} else {
465					$this.removeClass('active');
466				}
467			})
468			$this.on('click', function () {
469				$('html,body').animate({
470					'scrollTop': 0
471				}, options.scrollSpeed)
472			})
473		}
474	})(jQuery);
475
476	jQuery('#scroll_up').goBack();
477};
478function thegov_blog_masonry_init () {
479  if (jQuery(".blog_masonry").length) {
480    var blog_dom = jQuery(".blog_masonry").get(0);
481    var $grid = imagesLoaded( blog_dom, function() {
482      // initialize masonry
483      jQuery(".blog_masonry").isotope({
484            layoutMode: 'masonry',
485            masonry: {
486                columnWidth: '.item',
487            },
488        itemSelector: '.item',
489        percentPosition: true
490      });
491      jQuery(window).trigger('resize');
492    
493    });
494  }
495}
496// wgl Carousel List
497function thegov_carousel_slick () {
498  var carousel = jQuery('.wgl-carousel_slick');
499  if (carousel.length !== 0 ) {
500    carousel.each(function(item, value){     
501      if (jQuery(this).hasClass('slick-initialized')) {
502        jQuery(this).slick('destroy');
503      }    
504      if(jQuery(this).hasClass('fade_slick')){
505        jQuery(this).slick({
506          draggable: true,
507          fade: true, 
508          speed: 900,
509          cssEase: 'cubic-bezier(0.7, 0, 0.3, 1)',
510          touchThreshold: 100
511        });
512      }else{
513        jQuery(this).slick({});
514      }
515
516    });  
517
518  jQuery('.carousel-filter a').on('click', function(e){
519    e.preventDefault();
520
521    var filterClass = jQuery(this).data('filter');
522    jQuery(this).parent().find('a').removeClass('active');
523    jQuery(this).addClass('active');
524
525    jQuery(this).closest('.wgl_cpt_section').find ('.wgl-carousel_slick').slick('slickUnfilter');
526    jQuery(this).closest('.wgl_cpt_section').find ('.wgl-carousel_slick').slick('slickFilter', jQuery(filterClass));
527  }); 
528
529  }  
530}
531
532function thegov_circuit_services() {
533  if (jQuery('.thegov_module_circuit_services').length) {
534    jQuery('.thegov_module_circuit_services').each(function(){
535      var $circle = jQuery(this).find('.services_item-icon');
536
537      var agle = 360 / $circle.length;
538      var agleCounter = -1;
539
540      $circle.each(function() {
541        var $this = jQuery(this);
542
543        jQuery(this).parents('.services_item-wrap:first-child').addClass('active');
544        $this.on('mouseover', function(){
545          jQuery(this).parents('.services_item-wrap').addClass('active').siblings().removeClass('active');
546        })
547
548        var percentWidth = (100 * parseFloat($this.css('width')) / parseFloat($this.parent().css('width')));
549        var curAgle = agleCounter * agle;
550        var radAgle = curAgle * Math.PI / 180;
551        var x = (50 + ((50 - (percentWidth / 2)) * Math.cos(radAgle))) - (percentWidth / 2);
552        var y = (50 + ((50 - (percentWidth / 2)) * Math.sin(radAgle))) - (percentWidth / 2);
553            
554        $this.css({
555          left: x + '%',
556          top: y + '%'
557        });
558        
559        agleCounter++;
560      });
561
562    });
563  }
564}
565function thegov_circuit_services_resize (){
566  if (jQuery('.thegov_module_circuit_services').length) {
567    setTimeout(function(){
568      jQuery('.thegov_module_circuit_services').each(function(){
569        var $this = jQuery(this);
570        var wwidth = $this.width();
571        if (wwidth < 370){
572          $this.removeClass('tablet_resp').addClass('mobile_resp');
573        } else if (wwidth < 460) {
574          $this.removeClass('mobile_resp').addClass('tablet_resp');
575        } else {
576          $this.removeClass('tablet_resp mobile_resp');
577        }
578      });
579    }, 1);
580  }
581}
582/*!
583 * JavaScript Cookie v2.2.0
584 * https://github.com/js-cookie/js-cookie
585 *
586 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
587 * Released under the MIT license
588 */
589;(function (factory) {
590    var registeredInModuleLoader;
591    if (typeof define === 'function' && define.amd) {
592        define(factory);
593        registeredInModuleLoader = true;
594    }
595    if (typeof exports === 'object') {
596        module.exports = factory();
597        registeredInModuleLoader = true;
598    }
599    if (!registeredInModuleLoader) {
600        var OldCookies = window.Cookies;
601        var api = window.Cookies = factory();
602        api.noConflict = function () {
603            window.Cookies = OldCookies;
604            return api;
605        };
606    }
607}(function () {
608    function extend () {
609        var i = 0;
610        var result = {};
611        for (; i < arguments.length; i++) {
612            var attributes = arguments[ i ];
613            for (var key in attributes) {
614                result[key] = attributes[key];
615            }
616        }
617        return result;
618    }
619
620    function decode (s) {
621        return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
622    }
623
624    function init (converter) {
625        function api() {}
626
627        function set (key, value, attributes) {
628            if (typeof document === 'undefined') {
629                return;
630            }
631
632            attributes = extend({
633                path: '/'
634            }, api.defaults, attributes);
635
636            if (typeof attributes.expires === 'number') {
637                attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
638            }
639
640            // We're using "expires" because "max-age" is not supported by IE
641            attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
642
643            try {
644                var result = JSON.stringify(value);
645                if (/^[\{\[]/.test(result)) {
646                    value = result;
647                }
648            } catch (e) {}
649
650            value = converter.write ?
651                converter.write(value, key) :
652                encodeURIComponent(String(value))
653                    .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
654
655            key = encodeURIComponent(String(key))
656                .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
657                .replace(/[\(\)]/g, escape);
658
659            var stringifiedAttributes = '';
660            for (var attributeName in attributes) {
661                if (!attributes[attributeName]) {
662                    continue;
663                }
664                stringifiedAttributes += '; ' + attributeName;
665                if (attributes[attributeName] === true) {
666                    continue;
667                }
668
669                // Considers RFC 6265 section 5.2:
670                // ...
671                // 3.  If the remaining unparsed-attributes contains a %x3B (";")
672                //     character:
673                // Consume the characters of the unparsed-attributes up to,
674                // not including, the first %x3B (";") character.
675                // ...
676                stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
677            }
678
679            return (document.cookie = key + '=' + value + stringifiedAttributes);
680        }
681
682        function get (key, json) {
683            if (typeof document === 'undefined') {
684                return;
685            }
686
687            var jar = {};
688            // To prevent the for loop in the first place assign an empty array
689            // in case there are no cookies at all.
690            var cookies = document.cookie ? document.cookie.split('; ') : [];
691            var i = 0;
692
693            for (; i < cookies.length; i++) {
694                var parts = cookies[i].split('=');
695                var cookie = parts.slice(1).join('=');
696
697                if (!json && cookie.charAt(0) === '"') {
698                    cookie = cookie.slice(1, -1);
699                }
700
701                try {
702                    var name = decode(parts[0]);
703                    cookie = (converter.read || converter)(cookie, name) ||
704                        decode(cookie);
705
706                    if (json) {
707                        try {
708                            cookie = JSON.parse(cookie);
709                        } catch (e) {}
710                    }
711
712                    jar[name] = cookie;
713
714                    if (key === name) {
715                        break;
716                    }
717                } catch (e) {}
718            }
719
720            return key ? jar[key] : jar;
721        }
722
723        api.set = set;
724        api.get = function (key) {
725            return get(key, false /* read as raw */);
726        };
727        api.getJSON = function (key) {
728            return get(key, true /* read as json */);
729        };
730        api.remove = function (key, attributes) {
731            set(key, '', extend(attributes, {
732                expires: -1
733            }));
734        };
735
736        api.defaults = {};
737
738        api.withConverter = init;
739
740        return api;
741    }
742
743    return init(function () {});
744}));
745// wgl Countdown function init
746function thegov_countdown_init () {
747    var countdown = jQuery('.wgl-countdown');
748    if (countdown.length !== 0 ) {
749        countdown.each(function () {
750            var data_atts = jQuery(this).data('atts');
751            var time = new Date(+data_atts.year, +data_atts.month-1, +data_atts.day, +data_atts.hours, +data_atts.minutes);
752            jQuery(this).countdown({
753                until: time,
754                padZeroes: true,
755                format: data_atts.format ? data_atts.format : 'yowdHMS',
756                labels: [data_atts.labels[0],data_atts.labels[1],data_atts.labels[2],data_atts.labels[3],data_atts.labels[4],data_atts.labels[5], data_atts.labels[6], data_atts.labels[7]],
757                labels1: [data_atts.labels[0],data_atts.labels[1],data_atts.labels[2], data_atts.labels[3], data_atts.labels[4], data_atts.labels[5], data_atts.labels[6], data_atts.labels[7]]
758            });
759        });
760    }
761}
762// wgl Counter
763function thegov_counter_init() {
764	var counters = jQuery('.wgl-counter');
765	if ( counters.length ) {
766		counters.each(function() {
767			var counter = jQuery(this).find('.wgl-counter_value-wrap .wgl-counter_value.value-placeholder');
768			counter.appear(function() {
769				var max = jQuery(this).data('end-value'),
770				from = jQuery(this).data('start-value'),
771				speed = jQuery(this).data('speed');
772				counter.countTo({
773					from: from,
774					to: max,
775					speed: speed,
776					refreshInterval: 10
777				});
778			});
779		});
780	}
781}
782
783
784function thegov_dynamic_styles(){
785    var style = jQuery('#thegov-footer-inline-css');
786
787    (function($) {
788
789        $.fn.wglAddDynamicStyles = function() {        
790
791            if (this.length === 0) { return this; }
792            
793            return this.each(function () {
794                var $style = '',
795                self = jQuery(this);
796
797                var init = function() {
798                    $style += self.text();
799                    self.remove();
800                    appendStyle(); 
801                },
802                appendStyle = function(){    
803                    jQuery('head').append('<style type="text/css">'+$style+'</style>');
804                };
805                
806                /*Init*/
807                init();
808            });
809
810        };
811    })(jQuery);
812
813    style.wglAddDynamicStyles();
814    
815} 
816function thegov_events_masonry_init () {
817  if (jQuery(".events_masonry").length) {
818    var events_dom = jQuery(".events_masonry").get(0);
819    var $grid = imagesLoaded( events_dom, function() {
820      // initialize masonry
821      jQuery(".events_masonry").isotope({
822            layoutMode: 'masonry',
823            masonry: {
824                columnWidth: '.item',
825            },
826        itemSelector: '.item',
827        percentPosition: true
828      });
829      jQuery(window).trigger('resize');
830    
831    });
832  }
833}
834//https://gist.github.com/chriswrightdesign/7955464
835function mobilecheck() {
836    var check = false;
837    (function(a){if(/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);
838    return check;
839}
840
841//Add Click event for the mobile device
842var click = mobilecheck() ? ('ontouchstart' in document.documentElement ? 'touchstart' : 'click') : 'click';
843
844function initClickEvent(){
845    click =  mobilecheck() ? ('ontouchstart' in document.documentElement ? 'touchstart' : 'click') : 'click';
846}
847jQuery(window).on('resize', initClickEvent);
848
849/*
850 ** Plugin for counter shortcode
851 */
852(function($) {
853    "use strict";
854
855    $.fn.countTo = function(options) {
856        // merge the default plugin settings with the custom options
857        options = $.extend({}, $.fn.countTo.defaults, options || {});
858
859        // how many times to update the value, and how much to increment the value on each update
860        var loops = Math.ceil(options.speed / options.refreshInterval),
861            increment = (options.to - options.from) / loops;
862
863        return $(this).each(function() {
864            var _this = this,
865                loopCount = 0,
866                value = options.from,
867                interval = setInterval(updateTimer, options.refreshInterval);
868
869            function updateTimer() {
870                value += increment;
871                loopCount++;
872                $(_this).html(value.toFixed(options.decimals));
873
874                if (typeof(options.onUpdate) === 'function') {
875                    options.onUpdate.call(_this, value);
876                }
877
878                if (loopCount >= loops) {
879                    clearInterval(interval);
880                    value = options.to;
881
882                    if (typeof(options.onComplete) === 'function') {
883                        options.onComplete.call(_this, value);
884                    }
885                }
886            }
887        });
888    };
889
890    $.fn.countTo.defaults = {
891        from: 0,  // the number the element should start at
892        to: 100,  // the number the element should end at
893        speed: 1000,  // how long it should take to count between the target numbers
894        refreshInterval: 100,  // how often the element should be updated
895        decimals: 0,  // the number of decimal places to show
896        onUpdate: null,  // callback method for every time the element is updated,
897        onComplete: null  // callback method for when the element finishes updating
898    };
899})(jQuery);
900
901/*
902 ** Plugin for slick Slider
903 */
904function thegov_slick_navigation_init (){
905  jQuery.fn.thegov_slick_navigation = function (){
906    jQuery(this).each( function (){
907      var el = jQuery(this);
908      jQuery(this).find('span.left_slick_arrow').on("click", function() {
909        jQuery(this).closest('.wgl_cpt_section').find('.slick-prev').trigger('click');
910      });
911      jQuery(this).find('span.right_slick_arrow').on("click", function() {
912        jQuery(this).closest('.wgl_cpt_section').find('.slick-next').trigger('click');
913      });
914    });
915  }
916}
917
918/*
919 ** Plugin IF visible element
920 */
921function is_visible_init (){
922  jQuery.fn.is_visible = function (){
923    var elementTop = jQuery(this).offset().top;
924    var elementBottom = elementTop + jQuery(this).outerHeight();
925    var viewportTop = jQuery(window).scrollTop();
926    var viewportBottom = viewportTop + jQuery(window).height();
927    return elementBottom > viewportTop && elementTop < viewportBottom;
928  }
929}
930
931/*
932 ** Preloader
933 */
934jQuery(window).load(function(){
935    jQuery('#preloader-wrapper').fadeOut();
936});
937// wgl image comparison
938function thegov_image_comparison () {
939	var item = jQuery('.wgl-image_comparison.cocoen');
940	if (item.length !== 0 ) {
941		item.each(function(){
942			jQuery(this).cocoen();
943		});      
944	}  
945}
946
947// wgl Image Layers
948function thegov_img_layers() {
949	jQuery('.wgl-image-layers').each(function() {
950		var container = jQuery(this);
951		var initImageLayers = function(){
952			container.appear(function() {
953				container.addClass('img-layer_animate');
954            },{done:true})
955		}
956		initImageLayers();
957		// jQuery(window).on('resize', initImageLayers);
958		// jQuery(window).on('load', initImageLayers);
959	});
960}
961function thegov_isotope () {
962  if (jQuery(".isotope").length) {
963
964    var portfolio_dom = jQuery(".isotope").get(0);
965    
966    var $grid = imagesLoaded( portfolio_dom, function() {
967      // initialize masonry
968      var mode = jQuery(".isotope").hasClass('fit_rows') ? 'fitRows' : 'masonry';
969      
970      jQuery(".isotope").isotope({
971            layoutMode: mode,
972            percentPosition: true,
973            itemSelector: '.wgl-portfolio-list_item, .item',
974            masonry: {
975                columnWidth: '.wgl-portfolio-list_item-size, .wgl-portfolio-list_item, .item',
976            }
977      }).isotope( 'layout' );
978
979      jQuery(window).trigger('resize');
980    
981    });
982  
983    jQuery(".isotope-filter a").each(function(){
984      var data_filter = this.getAttribute("data-filter");
985      var num = jQuery(this).closest('.wgl-portfolio').find('.wgl-portfolio-list_item').filter( data_filter ).length;
986      jQuery(this).find('.number_filter').text( num );      
987
988    });  
989  
990    
991    var $filter = jQuery(".isotope-filter a");
992    $filter.on("click", function (e){
993      e.preventDefault();
994      jQuery(this).addClass("active").siblings().removeClass("active");
995
996      var filterValue = jQuery(this).attr('data-filter');  
997
998      jQuery(this).closest('.wgl_cpt_section').find('.isotope').isotope({ filter: filterValue });
999    
1000    });
1001  }
1002}
1003
1004function thegov_menu_lavalamp(){
1005  var lavalamp = jQuery('.menu_line_enable > ul');
1006  if (lavalamp.length !== 0) {
1007    lavalamp.each(function(){
1008        var $this = jQuery(this);
1009        $this.lavalamp({
1010          easing: 'easeInOutCubic',
1011          duration: 600,
1012        });
1013    });
1014  }
1015}
1016
1017(function($, window) {
1018    var Lavalamp = function(element, options) {
1019        this.element = $(element).data('lavalamp', this);
1020        this.options = $.extend({}, this.options, options);
1021
1022        this.init();
1023    };
1024
1025    Lavalamp.prototype = {
1026        options: {
1027            current:   '.current-menu-ancestor,.current-menu-item,.current-category-ancestor',
1028            items:     'li',
1029            bubble:    '<div class="lavalamp-object"></div>',
1030            animation: false,
1031            blur:      $.noop,
1032            focus:     $.noop,
1033            duration:  600,
1034        },
1035        easing:      'ease',    // Easing transition
1036        duration:    700,       // Duration of animation
1037        element: null,
1038        current: null,
1039        bubble:  null,
1040        _focus:  null,
1041        init: function() {
1042            var resizeTimer,
1043                self = this,
1044                child = self.element.children('li');
1045
1046            this.onWindowResize = function() {
1047                if (resizeTimer) {
1048                    clearTimeout(resizeTimer);
1049                }
1050
1051                resizeTimer = setTimeout(function() {
1052                    self.reload();
1053                }, 100);
1054            };
1055
1056            $(window).bind('resize.lavalamp', this.onWindowResize);
1057
1058            $(child).addClass('lavalamp-item');
1059
1060            this.element
1061                .on('mouseenter.lavalamp', '.lavalamp-item' , function() {
1062                    self.current.each(function() {
1063                      self.options.blur.call(this, self);
1064                    });
1065
1066                    self._move($(this));              
1067                })
1068                .on('mouseleave.lavalamp', function() {
1069                    if (self.current.index(self._focus) < 0) {
1070                        self._focus = null;
1071
1072                        self.current.each(function() {
1073                            self.options.focus.call(this, self);
1074                        });
1075
1076                        self._move(self.current);
1077                    }
1078                });
1079
1080            this.bubble = $.isFunction(this.options.bubble)
1081                              ? this.options.bubble.call(this, this.element)
1082                              : $(this.options.bubble).prependTo(this.element);
1083
1084            self.element.addClass('lavalamp');
1085            self.element.find('.lavalamp-object').addClass(self.options.easing);
1086
1087            this.reload(); 
1088
1089            self.element.addClass("lavalamp_animate")
1090        },
1091        reload: function() {
1092            this.current = this.element.children(this.options.current);
1093
1094            if (this.current.size() === 0) {
1095                this.current = this.element.children().not('.lavalamp-object').eq(0);
1096            }
1097
1098            this._move(this.current, false);
1099        },
1100        destroy: function() {
1101            if (this.bubble) {
1102                this.bubble.remove();
1103            }
1104
1105            this.element.unbind('.lavalamp');
1106            $(window).unbind('resize.lavalamp', this.onWindowResize);
1107        },
1108        _move: function(el, animate) {
1109            var pos = el.position();
1110            pos.left = pos.left + parseInt(el.children('a').css('paddingLeft'))
1111
1112            var properties = {
1113                    transform: 'translate('+pos.left+'px,'+pos.top+'px)',
1114                    width:  '25px',
1115                };
1116
1117            this._focus = el;
1118            
1119            // Check for CSS3 animations
1120            if(this.bubble.css('opacity') === "0"){
1121              this.bubble.css({
1122                WebkitTransitionProperty: "opacity",
1123                msTransitionProperty: "opacity",
1124                MozTransitionProperty: "opacity",
1125                OTransitionProperty: "opacity",
1126                transitionProperty: "opacity",  
1127                WebkitTransitionDuration: '0s',
1128                msTransitionDuration: '0s',
1129                MozTransitionDuration: '0s',
1130                OTransitionDuration: '0s',
1131                transitionDuration: '0s',
1132
1133              });
1134            }else{
1135              this.bubble.css({
1136                WebkitTransitionProperty: "all",
1137                msTransitionProperty: "all",
1138                MozTransitionProperty: "all",
1139                OTransitionProperty: "all",
1140                transitionProperty: "all", 
1141                WebkitTransitionDuration: this.options.duration / 1000 + 's',
1142                msTransitionDuration: this.options.duration / 1000 + 's',
1143                MozTransitionDuration: this.options.duration / 1000 + 's',
1144                OTransitionDuration: this.options.duration / 1000 + 's',
1145                transitionDuration: this.options.duration / 1000 + 's',                
1146              })
1147            }
1148            
1149            this.bubble.css(properties);
1150        }
1151    };
1152
1153    $.fn.lavalamp = function(options) {
1154        if (typeof options === 'string') {
1155            var instance = $(this).data('lavalamp');
1156            return instance[options].apply(instance, Array.prototype.slice.call(arguments, 1));
1157        } else {
1158            return this.each(function() {
1159                var instance = $(this).data('lavalamp');
1160
1161                if (instance) {
1162                    $.extend(instance.options, options || {});
1163                    instance.reload();
1164                } else {
1165                    new Lavalamp(this, options);
1166                }
1167            });
1168        }
1169    };
1170})(jQuery, window);
1171
1172
1173(function( $ ) {
1174
1175  $(document).on('click', '.sl-button', function() {
1176    var button = $(this);
1177    var post_id = button.attr('data-post-id');
1178    var security = button.attr('data-nonce');
1179    var iscomment = button.attr('data-iscomment');
1180    var allbuttons;
1181    if ( iscomment === '1' ) { /* Comments can have same id */
1182      allbuttons = $('.sl-comment-button-'+post_id);
1183    } else {
1184      allbuttons = $('.sl-button-'+post_id);
1185    }
1186    var loader = allbuttons.next('#sl-loader');
1187    if (post_id !== '') {
1188      $.ajax({
1189        type: 'POST',
1190        url: wgl_core.ajaxurl,
1191        data : {
1192          action : 'thegov_like',
1193          post_id : post_id,
1194          nonce : security,
1195          is_comment : iscomment,
1196        },
1197        beforeSend:function(){
1198          loader.html('&nbsp;<div class="loader">Loading...</div>');
1199        },  
1200        success: function(response){
1201          var icon = response.icon;
1202          var count = response.count;
1203          allbuttons.html(icon+count);
1204          if(response.status === 'unliked') {
1205            var like_text = wgl_core.like;
1206            allbuttons.prop('title', like_text);
1207            allbuttons.removeClass('liked');
1208          } else {
1209            var unlike_text = wgl_core.unlike;
1210            allbuttons.prop('title', unlike_text);
1211            allbuttons.addClass('liked');
1212          }
1213          loader.empty();         
1214        }
1215      });
1216
1217    }
1218    return false;
1219  });
1220
1221})( jQuery );
1222function thegov_link_scroll () {
1223    jQuery('a.smooth-scroll, .smooth-scroll').on('click', function(event){
1224    	var href;
1225    	if(this.tagName == 'A') {
1226    		href = jQuery.attr(this, 'href');
1227    	} else {
1228    		var that = jQuery(this).find('a');
1229    		href = jQuery(that).attr('href');
1230    	}
1231        jQuery('html, body').animate({
1232            scrollTop: jQuery( href ).offset().top
1233        }, 500);
1234        event.preventDefault();
1235    });
1236}
1237//WGL MEGA MENUS GET AJAX POSTS
1238( function ($){
1239
1240  jQuery(document).ready(function (){ 
1241    
1242    thegov_ajax_mega_menu_init();
1243  
1244  });
1245  
1246  var megaMenuAjax = false;
1247  var node_str = '<div class="mega_menu_wrapper_overlay">'; 
1248  node_str  += '<div class="preloader_type preloader_dot">';
1249  node_str  += '<div class="mega_menu_wrapper_preloader wgl_preloader dot">';
1250  node_str  += '<span></span>';
1251  node_str  += '<span></span>'; 
1252  node_str  += '<span></span>'; 
1253  node_str  += '</div>';
1254  node_str  += '</div>';
1255  node_str  += '</div>';
1256
1257  function thegov_ajax_mega_menu_init ( ){
1258
1259    var grid, mega_menu_item, mega_menu_item_parent;
1260 
1261    mega_menu_item = document.querySelectorAll('li.mega-menu ul.mega-menu.sub-menu.mega-cat-sub-categories li');
1262    mega_menu_item_parent = document.querySelectorAll('li.mega-menu.mega-cat');
1263
1264    if ( mega_menu_item.length ){
1265
1266      for (var i = 0; i < mega_menu_item.length; i++) {
1267
1268        // Define an anonymous function here, to make it possible to use the i variable.
1269        (function (i) {
1270          var grid = mega_menu_item[i].closest('.mega-menu-container').getElementsByClassName( 'mega-ajax-content' );
1271          thegov_ajax_mega_menu_event(mega_menu_item[i], grid);
1272        }(i));
1273      }
1274    }     
1275
1276    if ( mega_menu_item_parent.length ){
1277
1278      for (var i = 0; i < mega_menu_item_parent.length; i++) {
1279
1280        // Define an anonymous function here, to make it possible to use the i variable.
1281        (function (i) {
1282          var grid = mega_menu_item_parent[i].getElementsByClassName( 'mega-ajax-content' );
1283          thegov_ajax_mega_menu_event(mega_menu_item_parent[i], grid);
1284        }(i));
1285      }
1286    }     
1287  }
1288
1289  function thegov_ajax_mega_menu_event(item, grid){
1290    var request_data = {};
1291
1292
1293    item.addEventListener( 'mouseenter', function ( e ){
1294      var not_uploaded = true;
1295      if(!this.classList.contains("mega-menu")){
1296
1297        if( this.classList.contains("is-active") && this.classList.contains("is-uploaded")){
1298          return;
1299        } 
1300
1301        var item_el = this.closest('ul.mega-menu').querySelectorAll( 'li.menu-item' );    
1302        for (var i = 0; i < item_el.length; i++){
1303          item_el[i].classList.remove('is-active');
1304        }
1305
1306        this.classList.add("is-active");
1307
1308        $( grid ).find('.ajax_menu').removeClass('fadeIn-menu').hide();
1309        
1310        if( ! $(grid).find('.loader-overlay').length ){
1311          $(grid).addClass('is-loading').append( node_str );
1312        }
1313
1314        $( grid ).find("[data-url='" + this.getAttribute('data-id') + "']").show(400, function(){
1315          jQuery(this).addClass('fadeIn-menu');
1316          if($(grid).hasClass('is-loading')){
1317            $(grid).removeClass('is-loading').find('.mega_menu_wrapper_overlay').remove();
1318          }
1319        });           
1320
1321      }else{
1322        var item_el = this.querySelectorAll( 'ul.mega-menu li.menu-item' );     
1323        for (var i = 0; i < item_el.length; i++){
1324          if(item_el[i].classList.contains('is-active')){
1325            $( grid ).find("[data-url='" + item_el[i].getAttribute('data-id') + "']").show().addClass('fadeIn-menu');               
1326            if($( grid ).find("[data-url='" + item_el[i].getAttribute('data-id') + "']").length == 0){
1327              not_uploaded = true;
1328            }else{
1329              not_uploaded = false;
1330            }
1331            
1332          }
1333        }
1334      }
1335
1336      var item_menu = this;
1337
1338      if(!this.classList.contains("is-uploaded") && not_uploaded){
1339
1340            // Create request
1341            request_data.id = parseInt(this.getAttribute('data-id'));
1342            request_data.posts_count = parseInt(this.getAttribute('data-posts-count'));
1343            request_data.action = 'wgl_mega_menu_load_ajax';
1344
1345            e.preventDefault(); 
1346
1347            if( megaMenuAjax && megaMenuAjax.readyState != 4 ){
1348              megaMenuAjax.abort();
1349            }
1350
1351            megaMenuAjax = $.ajax({
1352              url : wgl_core.ajaxurl,
1353              type: 'post',
1354              data: request_data,
1355              beforeSend: function(response){
1356                if( ! $(grid).find('.loader-overlay').length ){
1357                  $(grid).addClass('is-loading').append( node_str );
1358                }
1359              },
1360              success: function( response, status ){
1361                item_menu.classList.add('is-uploaded');
1362
1363                var response_container, new_items, identifier, response_wrapper;
1364                response_container = document.createElement( "div" );
1365                response_wrapper = document.createElement( "div" );
1366                response_wrapper.classList.add("ajax_menu");
1367
1368                response_container.innerHTML = response;            
1369                identifier = $( ".items_id", response_container );
1370
1371                response_wrapper.setAttribute('data-url', $(identifier).data('identifier'));
1372
1373                new_items = $( response_wrapper ).append($('.item', response_container ));
1374
1375                $('.ajax_menu').removeClass('fadeIn-menu').hide();
1376                new_items = new_items.hide();
1377                $( grid ).append( new_items );
1378                new_items.show().addClass('fadeIn-menu');
1379                if(typeof jarallax === 'function'){
1380                  thegov_parallax_video();
1381                }else{
1382                  jQuery.getScript(wgl_core.JarallaxPluginVideo, function()
1383                  {
1384                   jQuery.getScript(wgl_core.JarallaxPlugin, function()
1385                   {
1386                   }).always(function( s, Status ) {
1387                    jQuery(grid).find('.parallax-video').each(function() {
1388                      jQuery( this ).jarallax( {
1389                        loop: true,
1390                        speed: 1,
1391                        videoSrc: jQuery( this ).data( 'video' ),
1392                        videoStartTime: jQuery( this ).data( 'start' ),
1393                        videoEndTime: jQuery( this ).data( 'end' ),
1394                      } );    
1395                    });
1396                  });
1397                 });         
1398                }            
1399              },
1400              error: function( response ){
1401                item_menu.classList.remove('is-uploaded');
1402              },
1403              complete: function( response ){
1404                $(grid).removeClass('is-loading').find('.mega_menu_wrapper_overlay').remove();
1405              },
1406            });
1407          }
1408
1409
1410        }, false );       
1411}
1412
1413}(jQuery));
1414function thegov_message_anim_init(){
1415	jQuery('body').on('click', '.message_close_button', function(e){    
1416       jQuery(this).closest('.thegov_module_message_box.closable').slideUp(350);
1417    })
1418} 
1419
1420function thegov_mobile_header(){
1421	var menu = jQuery('.wgl-mobile-header .mobile_nav_wrapper .primary-nav > ul');
1422
1423	//Create plugin Mobile Menu
1424	(function($) {
1425
1426		$.fn.wglMobileMenu = function(options) {
1427			var defaults = {
1428				"toggleID"   	: ".mobile-hamburger-toggle",
1429				"switcher"      : ".button_switcher",
1430				"back"      	: ".back",
1431				"overlay"       : ".wgl-menu_overlay",
1432				"anchor"		: ".menu-item > a[href*=\\#]"
1433	    	};
1434
1435		    if (this.length === 0) { return this; }
1436
1437		    return this.each(function () {
1438		    	var wglMenu = {}, ds = $(this);
1439			    var sub_menu = jQuery('.mobile_nav_wrapper .primary-nav > ul ul');
1440			    var m_width = jQuery('.mobile_nav_wrapper').data( "mobileWidth" );
1441			    var m_toggle = jQuery('.mobile-hamburger-toggle');
1442			    var body = jQuery('body');
1443
1444			    //Helper Menu
1445				var open = "is-active",
1446			    openSubMenu = "show_sub_menu",
1447			    mobile_on = "mobile_switch_on",
1448			    mobile_switcher = "button_switcher";
1449
1450			    var init = function() {
1451			    	wglMenu.settings = $.extend({}, defaults, options);
1452			    	createButton();
1453			    	showMenu();
1454			    	addPerfectScroll();
1455			    },
1456			    showMenu = function(){
1457			    	if (jQuery(window).width() <= m_width) {
1458			    		if (!$('body').hasClass(mobile_on)) {
1459			    			create_nav_mobile_menu();
1460			    		}
1461					}else{
1462						reset_nav_mobile_menu();
1463					}
1464			    },
1465			    create_nav_mobile_menu = function() {
1466			    	sub_menu.removeClass(openSubMenu);
1467					ds.hide().addClass(mobile_on);
1468					body.removeClass(mobile_on);
1469			    },
1470			    reset_nav_mobile_menu = function() {
1471					sub_menu.removeClass(openSubMenu);
1472					body.removeClass(mobile_on);
1473					ds.show().removeClass(mobile_on);
1474					m_toggle.removeClass(open);
1475					jQuery('.' + mobile_switcher) .removeClass('is-active');
1476			    },
1477			    createButton = function() {
1478		  			ds.find('.menu-item-has-children').each(function() {
1479		  				jQuery(this).find('> a').append('<span class="'+ mobile_switcher +'"></span>');
1480		  			});
1481		        },
1482		        addPerfectScroll = function() {
1483		  			new PerfectScrollbar('#wgl-perfect-container', {
1484                    	wheelSpeed: 6,
1485                    	suppressScrollX: true
1486                	});
1487		        },
1488			    toggleMobileMenu = function(e) {
1489			    	//jQuery(m_toggle).toggleClass(open);
1490			    	ds.toggleClass(openSubMenu);
1491			    	body.toggleClass(mobile_on);
1492			    },
1493			    hideSubMenu = function(e) {
1494			    	if(!jQuery('.button_switcher').is(e.target)){
1495			    		if ( jQuery('body').hasClass(mobile_on) ){
1496					    	jQuery('.mobile_nav_wrapper .menu-item-has-children').find('.sub-menu').stop(true).slideUp(450).removeClass(openSubMenu);
1497					    	jQuery('.mobile_nav_wrapper .menu-item-has-children').find('.button_switcher').removeClass(open);
1498
1499							if (jQuery(e.target).closest('.wgl-mobile-header').length) {
1500								toggleMobileMenu();
1501							}
1502			    		}
1503			    	}
1504			    },
1505			    showSubMenu = function(e) {
1506			    	e.preventDefault();
1507			    	var item = jQuery(this).parents('li');
1508
1509			    	if(!jQuery(this).hasClass(open)){
1510			    		jQuery('.mobile_nav_wrapper .menu-item-has-children').not(item).find('.sub-menu').stop(true).slideUp(450).removeClass(openSubMenu);
1511			    		jQuery('.mobile_nav_wrapper .menu-item-has-children').not(item).find('.button_switcher').removeClass(open);
1512			    		jQuery('.mobile_nav_wrapper .menu-item-has-children').not(item).find('a[href*=\\#]').removeClass(open);
1513
1514			    		jQuery(this).parent().prev('.sub-menu').stop(true).slideDown(450).addClass(openSubMenu);
1515			    		jQuery(this).parent().next('.sub-menu').stop(true).slideDown(450).addClass(openSubMenu);
1516			    	}else{
1517			    		jQuery(this).parent().prev('.sub-menu').stop(true).slideUp(450).removeClass(openSubMenu);
1518			    		jQuery(this).parent().next('.sub-menu').stop(true).slideUp(450).removeClass(openSubMenu);
1519			   		 }
1520
1521			    	jQuery(this).toggleClass(open);
1522			    },
1523			    eventClose = function(e) {
1524                    var container = $("#wgl-perfect-container");
1525
1526                    if (!container.is(e.target) && container.has(e.target).length === 0) {
1527                    	if ($('body').hasClass(mobile_on)) {
1528							toggleMobileMenu();
1529                    	}
1530
1531                    }
1532                },
1533			    goBack = function(e) {
1534			    	e.preventDefault();
1535			    	jQuery(this).closest( '.sub-menu' ).removeClass(openSubMenu);
1536			    	jQuery(this).closest( '.sub-menu' ).prev( 'a' ).removeClass(open);
1537			    	jQuery(this).closest( '.sub-menu' ).prev( 'a' ).find('.' + mobile_switcher).removeClass(open);
1538			    };
1539
1540			    /*Init*/
1541			    init();
1542
1543			    jQuery(wglMenu.settings.toggleID).on(click, toggleMobileMenu);
1544			    jQuery(wglMenu.settings.overlay).on(click, eventClose);
1545
1546			    //switcher menu
1547			    jQuery(wglMenu.settings.switcher).on(click, showSubMenu);
1548			    jQuery(wglMenu.settings.anchor).on(click, hideSubMenu);
1549
1550			    //Go back menu
1551			    jQuery(wglMenu.settings.back).on(click, goBack);
1552
1553		    	jQuery( window ).resize(
1554		    		function() {
1555		    			showMenu();
1556		    		}
1557		    	);
1558		    });
1559
1560		};
1561	})(jQuery);
1562
1563	menu.wglMobileMenu();
1564
1565}
1566// wgl Page Title Parallax
1567function thegov_page_title_parallax() {
1568    var page_title = jQuery('.page-header.page_title_parallax')
1569    if (page_title.length !== 0 ) {
1570        page_title.paroller();
1571    }
1572}
1573
1574// wgl Extended Parallax
1575function thegov_extended_parallax() {
1576    var item = jQuery('.extended-parallax')
1577    if (item.length !== 0 ) {
1578        item.each( function() {
1579            jQuery(this).paroller();
1580        })
1581    }
1582}
1583// wgl Portfolio Single Parallax
1584function thegov_portfolio_parallax() {
1585    var portfolio = jQuery('.wgl-portfolio-item_bg.portfolio_parallax')
1586    if (portfolio.length !== 0 ) {
1587        portfolio.paroller();
1588    }
1589}
1590
1591function thegov_parallax_video () {
1592	jQuery( '.parallax-video' ).each( function() {
1593		jQuery( this ).jarallax( {
1594			loop: true,
1595			speed: 1,
1596			videoSrc: jQuery( this ).data( 'video' ),
1597			videoStartTime: jQuery( this ).data( 'start' ),
1598			videoEndTime: jQuery( this ).data( 'end' ),
1599		} );
1600	} );
1601}
1602function particles_custom () {
1603    jQuery('.particles-js').each(function () {
1604        var id = jQuery(this).attr('id');
1605        var type = jQuery(this).data('particles-type');
1606        var color_type = jQuery(this).data('particles-colors-type');
1607        var color = jQuery(this).data('particles-color');
1608        var color_line = jQuery(this).data('particles-color');
1609        var number = jQuery(this).data('particles-number');
1610        var lines = jQuery(this).data('particles-line');
1611        var size = jQuery(this).data('particles-size');
1612        var speed = jQuery(this).data('particles-speed');
1613        var hover = jQuery(this).data('particles-hover');
1614        var hover_mode = jQuery(this).data('particles-hover-mode');
1615        switch (type) {
1616            case 'particles':
1617                type = 'circle';
1618                break;
1619            case 'hexagons':
1620                type = 'polygon';
1621                break;
1622            default:
1623                type = 'circle';
1624                break;
1625        }
1626        if (color_type == 'random_colors') {
1627            color = color.split(',');
1628            color_line = color[0]
1629        }
1630        
1631        particlesJS(
1632            id, {
1633                "particles":{
1634                    "number":{
1635                        "value":number,
1636                        "density":{
1637                            "enable":true,
1638                            "value_area":800
1639                        }
1640                    },
1641                    "color":{
1642                        "value": color
1643                    },
1644                    "shape":{
1645                        "type":type,
1646                        "polygon":{
1647                            "nb_sides":6
1648                        },
1649                    },
1650                    "opacity":{
1651                        "value":1,
1652                        "random":true,
1653                        "anim":{
1654                            "enable":false,
1655                            "speed":1,
1656                            "opacity_min":0.1,
1657                            "sync":false
1658                        }
1659                    },
1660                    "size":{
1661                        "value":size,
1662                        "random":true,
1663                        "anim":{
1664                            "enable":false,
1665                            "speed":30,
1666                            "size_min": 1,
1667                            "sync":false
1668                        }
1669                    },
1670                    "line_linked":{
1671                        "enable":lines,
1672                        "distance":150,
1673                        "color":color_line,
1674                        "opacity":0.4,
1675                        "width":1
1676                    },
1677                    "move":{
1678                        "enable":true,
1679                        "speed":speed,
1680                        "direction":"none",
1681                        "random":false,
1682                        "straight":false,
1683                        "out_mode":"out",
1684                        "bounce":false,
1685                        "attract":{
1686                            "enable":false,
1687                            "rotateX":600,
1688                            "rotateY":1200
1689                        }
1690                    }
1691                },
1692                "interactivity":{
1693                    "detect_on":"canvas",
1694                    "events":{
1695                        "onhover":{
1696                            "enable":hover,
1697                            "mode":hover_mode
1698                        },
1699                        "onclick":{
1700                            "enable":true,
1701                            "mode":"push"
1702                        },
1703                        "resize":true
1704                    },
1705                    "modes":{
1706                        "grab":{
1707                            "distance":150,
1708                            "line_linked":{
1709                                "opacity":1
1710                            }
1711                        },
1712                        "bubble":{
1713                            "distance":200,
1714                            "size":size*1.6,
1715                            "duration":20,
1716                            "opacity":1,
1717                            "speed":30
1718                        },
1719                        "repulse":{
1720                            "distance":80,
1721                            "duration":0.4
1722                        },
1723                        "push":{"particles_nb":4},
1724                        "remove":{"particles_nb":2}
1725                    }
1726                },
1727                "retina_detect":true
1728            });
1729        var update;
1730        update = function() {
1731            requestAnimationFrame(update); 
1732        }; 
1733        requestAnimationFrame(update);
1734    })
1735}
1736//http://brutaldesign.github.io/swipebox/
1737function thegov_videobox_init () {
1738	if (jQuery(".videobox, .swipebox, .gallery a[href$='.jpg'], .gallery a[href$='.jpeg'], .gallery a[href$='.JPEG'], .gallery a[href$='.gif'], .gallery a[href$='.png']").length !== 0 ) {
1739		jQuery(".videobox, .swipebox, .gallery a[href$='.jpg'], .gallery a[href$='.jpeg'], .gallery a[href$='.JPEG'], .gallery a[href$='.gif'], .gallery a[href$='.png']").each(function(){
1740			jQuery(this).attr('data-elementor-open-lightbox', 'no');
1741		});
1742		jQuery(".videobox, .swipebox, .gallery a[href$='.jpg'], .gallery a[href$='.jpeg'], .gallery a[href$='.JPEG'], .gallery a[href$='.gif'], .gallery a[href$='.png']").swipebox({autoplayVideos: true});
1743	}
1744}
1745// wgl Progress Bars
1746function thegov_progress_bars_init(e) {
1747
1748    var item = jQuery('.wgl-progress_bar');
1749    
1750    if (item.length) {
1751        item.each(function() {
1752            var item = jQuery(this),
1753                slidable_label = false,
1754                item_label = item.find('.progress_label_wrap'),
1755                bar = item.find('.progress_bar'),
1756                data_width = bar.data('width'),
1757                counter = item.find('.progress_value'),
1758                duration = parseFloat(bar.css('transition-duration'))*1000,
1759                interval = Math.floor(duration/data_width),
1760                temp = 0;
1761                if (item.hasClass('dynamic-value')) {
1762                    slidable_label = true;
1763                }
1764            if(!e){
1765                item.appear(function() {
1766					bar.css('width',data_width+'%');
1767                    if ( slidable_label == true ) {
1768                        item_label.css('width', data_width+'%');
1769                    }
1770                    var recap = setInterval( function() {
1771                        counter.text(temp);
1772                        temp++;
1773                    }, interval);
1774                    var stopCounter = setTimeout(function() {
1775                        clearInterval(recap);
1776                        counter.text(data_width);
1777                    }, duration);
1778                });                
1779            } else {
1780                bar.css('width',data_width+'%');
1781                if ( slidable_label ) {
1782                    item_label.css('width', data_width+'%');
1783                }
1784                var recap = setInterval( function() {
1785                    counter.text(temp);
1786                    temp++;
1787                }, interval);
1788                var stopCounter = setTimeout(function() {
1789                clearInterval(recap);
1790                counter.text(data_width);
1791                }, duration);               
1792            }
1793        });
1794    }
1795}
1796function thegov_search_init(){
1797
1798    //Create plugin Search
1799    (function($) {
1800
1801        $.fn.wglSearch = function(options) {        
1802            var defaults = {
1803                "toggleID"      : ".header_search-button",
1804                "closeID"      : ".header_search-close",
1805                "searchField"   : ".header_search-field",
1806                "body"          : "body > *:not(header)",
1807            }; 
1808            
1809            if (this.length === 0) { return this; }
1810            
1811            return this.each(function () {
1812                var wglSearch = {}, s = $(this);
1813                var openClass = 'header_search-open',
1814                searchClass = '.header_search';
1815
1816                var init = function() {
1817                    wglSearch.settings = $.extend({}, defaults, options);
1818                },
1819                open = function () {
1820                    $(s).addClass(openClass);
1821                    setTimeout(function(){
1822                        $(s).find('input.search-field').focus();
1823                    }, 100);
1824                    return false;
1825                },                
1826                close = function () {
1827                    jQuery(s).removeClass(openClass);
1828                },
1829                toggleSearch = function(e) {
1830                    if (!$(s).closest(searchClass).hasClass(openClass)) {
1831                        open();
1832                    }else{
1833                        close();
1834                    }
1835                },
1836                eventClose = function(e) {
1837                    var element = jQuery(searchClass);
1838                    if(!$(e.target).closest('.search-form').length){
1839                        if ($(element).hasClass(openClass)) {
1840                            close();
1841                        }                        
1842                    }
1843                };
1844
1845                /*Init*/
1846                init();
1847
1848                if(jQuery(this).hasClass('search_standard')){
1849                    jQuery(this).find(wglSearch.settings.toggleID).on(click, toggleSearch);
1850                }else{
1851                    jQuery(wglSearch.settings.toggleID).on(click, toggleSearch);
1852                    jQuery(wglSearch.settings.searchField).on(click, eventClose);
1853                }
1854            
1855                jQuery(wglSearch.settings.body).on(click, eventClose);
1856                
1857            });
1858
1859        };
1860
1861    })(jQuery);
1862
1863    jQuery('.header_search').wglSearch();
1864
1865}
1866// Select Wrapper
1867function thegov_select_wrap() {
1868	jQuery( '.widget select, select.wpcf7-select, .woocommerce .woocommerce-ordering select' ).each( function() {
1869		jQuery( this ).wrap( "<div class='select__field'></div>" );
1870	} );
1871}
1872function thegov_side_panel_init(){
1873
1874    //Create plugin Side Panel
1875    (function($) {
1876
1877        $.fn.wglSidePanel = function(options) {        
1878            var defaults = {
1879                "toggleID"      : ".side_panel-toggle",
1880                "closeID"      : ".side-panel_close",
1881                "closeOverlay"  : ".side-panel_overlay",
1882                "body"          : "body > *:not(header)",
1883                "sidePanel"    : "#side-panel .side-panel_sidebar"
1884            };
1885            
1886            if (this.length === 0) { return this; }
1887            
1888            return this.each(function () {
1889                var wglSidePanel = {}, s = $(this);
1890                var openClass = 'side-panel_open',
1891                wglScroll,
1892                sidePanelClass = '.side_panel';
1893
1894                var init = function() {
1895                    wglSidePanel.settings = $.extend({}, defaults, options);
1896                },
1897                open = function () {
1898                    if(!$('#side-panel').hasClass('side-panel_active')){
1899                        $('#side-panel').addClass('side-panel_active');
1900                    }
1901
1902                    $('#side-panel').addClass(openClass);
1903                    $(s).addClass(openClass);
1904                    $('body').addClass('side-panel_active');
1905                    
1906                    var wglClassAnimated = $('#side-panel').find('section.elementor-element').data('settings');
1907                    if(wglClassAnimated && wglClassAnimated.animation){
1908                        $('#side-panel').find('section.elementor-element').removeClass('elementor-invisible').addClass('animated').addClass(wglClassAnimated.animation);
1909                    }
1910                },                
1911                close = function () {
1912                    $(s).removeClass(openClass);
1913                    $('#side-panel').removeClass(openClass);
1914                    $('body').removeClass('side-panel_active');
1915                    var wglClassAnimated = $('#side-panel').find('section.elementor-element').data('settings');
1916                    if(wglClassAnimated && wglClassAnimated.animation){
1917                        $('#side-panel').find('section.elementor-element').removeClass(wglClassAnimated.animation);
1918                    }
1919                },
1920
1921                togglePanel = function(e) {
1922                    e.preventDefault();
1923                    wglScroll = $(window).scrollTop();
1924
1925                    if (!$(s).closest(sidePanelClass).hasClass(openClass)) {
1926                        open();                    
1927                        jQuery(window).scroll(function(){
1928                            if(450 < Math.abs(jQuery(this).scrollTop() - wglScroll)){
1929                                close();
1930                            }
1931                        });
1932                    }else{
1933                        
1934                    }
1935                },
1936                closePanel = function(e){
1937                    e.preventDefault();
1938                    if ($(s).closest(sidePanelClass).hasClass(openClass)) {
1939                        close();
1940                    }
1941                },
1942                eventClose = function(e) {
1943                    var element = $(sidePanelClass),
1944                    container = $("#side-panel");
1945
1946                    if (!container.is(e.target) && container.has(e.target).length === 0) 
1947                    {
1948                        if ($(element).hasClass(openClass)) {
1949                            close();
1950                        }   
1951                    }  
1952                };
1953
1954                /*Init*/
1955                init();
1956
1957                jQuery(wglSidePanel.settings.toggleID).on(click, togglePanel);            
1958                jQuery(wglSidePanel.settings.body).on(click, eventClose);
1959                jQuery(wglSidePanel.settings.closeID).on(click, closePanel);
1960                jQuery(wglSidePanel.settings.closeOverlay).on(click, closePanel);
1961
1962                new PerfectScrollbar('#side-panel', {
1963                    wheelSpeed: 6,
1964                    suppressScrollX: true
1965                });
1966            });
1967
1968        };
1969
1970    })(jQuery);
1971
1972    jQuery('.side_panel').wglSidePanel();
1973
1974}
1975function thegov_skrollr_init(){
1976    var blog_scroll = jQuery('.blog_skrollr_init');
1977    if (blog_scroll.length) {
1978   		if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){ 
1979	      // wgl Skrollr
1980	      skrollr.init({
1981	        smoothScrolling: false,
1982	        forceHeight: false
1983	      });  
1984  		}
1985    }
1986}
1987
1988function thegov_split_slider() {
1989
1990    var split_slider = jQuery('.thegov_module_split_slider');
1991    if ( split_slider.length ) {
1992
1993        split_slider.each(function() {
1994            jQuery(this).height(jQuery(window).height()).addClass('slider_initialized');
1995
1996            jQuery(this).multiscroll({
1997                easing: 'easeInOutQuart',
1998                navigation: true,
1999                sectionSelector: '.thegov_split_slider-section',
2000                leftSelector: '.thegov_split_slider-left',
2001                rightSelector: '.thegov_split_slider-right',
2002                afterRender: function () {
2003                    var cloneLeft = jQuery(this).closest('.thegov_split_slider-left > .thegov_split_slider-section');
2004                    var cloneRight = jQuery(this).closest('.thegov_split_slider-right  > .thegov_split_slider-section');
2005                    cloneRight = Array.prototype.reverse.apply(cloneRight);
2006
2007                    var responsive = jQuery(this).closest('.thegov_module_split_slider-wrapper').find('.thegov_module_split_slider-responsive'); 
2008                    for(var i = 0; i < cloneLeft.length; i++){
2009                        jQuery(responsive).append(jQuery(cloneLeft[i]).clone(true));
2010                        jQuery(responsive).append(jQuery(cloneRight[i]).clone(true));
2011                    }
2012                    jQuery('body').addClass('ms-initialized');
2013                    thegov_progress_bars_init(true);
2014                }
2015            });
2016        });
2017 
2018        if (jQuery(window).width() <= 1024) {
2019            jQuery.fn.multiscroll.destroy();
2020        } else {
2021            jQuery.fn.multiscroll.build();
2022        }
2023
2024        jQuery(window).resize(function () {
2025            if (jQuery(window).width() <= 1024) {
2026                jQuery.fn.multiscroll.destroy();
2027            } else {
2028                jQuery.fn.multiscroll.build();
2029            }
2030
2031        });
2032    }
2033}
2034
2035function thegov_sticky_init(){
2036
2037	var section = '.wgl-sticky-header';
2038	var top = jQuery(section).height();
2039	var data = jQuery(section).data('style');
2040
2041	//For Follow In up
2042	var previousScroll = 0;
2043
2044	function init(element){        
2045		if(!element){
2046			return;
2047		}
2048
2049		var y = jQuery(window).scrollTop();
2050		if(data == 'standard'){
2051	        if ( y >= top ) {   
2052	            jQuery(section).addClass( 'sticky_active' );
2053	        } else {
2054	            jQuery(section).removeClass('sticky_active');
2055	        }   			
2056		}else{
2057	        if(y > top) {
2058	            if (y > previousScroll) {
2059	                jQuery(section).removeClass('sticky_active');
2060	            } else {
2061	                jQuery(section).addClass( 'sticky_active' );
2062	            }
2063	        } else {
2064	             jQuery(section).removeClass('sticky_active');
2065	        }
2066	        previousScroll = y;
2067		}
2068    };   
2069
2070    if ( jQuery( '.wgl-sticky-header' ).length !== 0 ) {
2071    	jQuery( window ).scroll(
2072    		function() {
2073    			init(jQuery(this));
2074    		}
2075    	);
2076
2077    	jQuery( window ).resize(
2078    		function() {
2079    			init(jQuery(this));
2080    		}
2081    	);
2082    }
2083} 
2084function thegov_sticky_sidebar() {
2085  if (jQuery('.sticky-sidebar').length) {
2086    jQuery('body').addClass('sticky-sidebar_init');
2087    jQuery('.sticky-sidebar').each(function(){
2088      jQuery(this).theiaStickySidebar({
2089        additionalMarginTop: 30,
2090        additionalMarginBottom: 30
2091      });
2092    });
2093  }
2094
2095  if (jQuery('.sticky_layout .info-wrapper').length) {
2096    jQuery('.sticky_layout .info-wrapper').each(function(){
2097      jQuery(this).theiaStickySidebar({
2098        additionalMarginTop: 150,
2099        additionalMarginBottom: 150
2100      });
2101    });
2102  }
2103} 
2104// Accordion 
2105function thegov_striped_services_init() {
2106    var item_wrap = jQuery('.wgl-striped-services');
2107
2108    item_wrap.each(function(){
2109        var item = jQuery(this).find('.service-item');
2110
2111        item.on('mouseenter', function(e){
2112            item_wrap.addClass('onhover');
2113            jQuery(this).addClass('active');
2114        })
2115        item.on('mouseleave', function(e){
2116            item_wrap.removeClass('onhover');
2117            jQuery(this).removeClass('active');
2118        })
2119    })
2120
2121}
2122// Tabs
2123function thegov_tabs_init() {
2124	if (jQuery('.wgl-tabs').length) {
2125		jQuery('.wgl-tabs').each(function(){
2126			var $this = jQuery(this);
2127		
2128			var tab = $this.find('.wgl-tabs_headings .wgl-tabs_header');
2129			var	data = $this.find('.wgl-tabs_content-wrap .wgl-tabs_content');
2130			
2131			tab.filter(':first').addClass('active');
2132
2133			data.filter(':not(:first)').hide();
2134			tab.each(function(){
2135				var currentTab = jQuery(this);
2136
2137				currentTab.on('click tap', function(){
2138					var id = currentTab.data('tab-id');
2139				
2140					currentTab.addClass('active').siblings().removeClass('active');
2141					jQuery('.wgl-tabs .wgl-tabs_content[data-tab-id='+id+']').slideDown().siblings().slideUp();			
2142				});
2143			});
2144		})
2145	}
2146}
2147		
2148function thegov_text_background() {
2149
2150    var anim_text = jQuery('.wgl-animation-background-text');
2151    if ( anim_text.length ) {
2152
2153
2154		anim_text.each(function(index){
2155			var paralax_text = jQuery('<div class="wgl-background-text"/>');
2156
2157			jQuery(this).find(">div:eq(0)").before(paralax_text);
2158			var text = window.getComputedStyle(this,':before').content;
2159
2160			text = text.slice(1, -1);
2161
2162			paralax_text.addClass('element-'+ index);
2163			paralax_text.attr('data-info', index);
2164		  	
2165		  	jQuery(this).find(paralax_text).html(text.replace(/([^\x00-\x80]|\w)/g, "<span class='letter'>$&</span>"));
2166
2167		  	var self = jQuery(this);
2168
2169		  	anim_text.appear(function() {
2170
2171		  		if(typeof anime === 'function'){
2172
2173		  			var item_anime = jQuery(this).find('.wgl-background-text').data('info');
2174
2175		  			if(item_anime === index){
2176			  			anime.timeline({loop: false})
2177			  			.add({
2178			  				targets: '.element-'+ index + ' .letter',
2179			  				translateY: [100,0],
2180			  				translateZ: 0,
2181			  				opacity: [0,1],
2182			  				easing: "easeOutExpo", 
2183			  				duration: 1400,
2184			  				delay: function(el, i) {
2185			  					return 0 + 350 * i;
2186			  				}
2187			  			});			  				
2188		  			}
2189
2190
2191		  		}
2192		  	}); 		  		
2193		  	
2194
2195		});
2196    }
2197}
2198// WGL Time Line Vertical appear
2199function thegov_init_timeline_appear() {
2200
2201    var item = jQuery('.wgl-timeline-vertical.appear_anim .time_line-item');
2202
2203    if (item.length) {
2204        item.each(function() {
2205            var item = jQuery(this);
2206            item.appear(function() {
2207                item.addClass('item_show');
2208            });
2209        });
2210    }
2211}
2212function thegov_woocommerce_helper(){
2213    jQuery('body').on('click', '.quantity.number-input span.minus', function(e){    
2214        this.parentNode.querySelector('input[type=number]').stepDown();
2215        if(document.querySelector('.woocommerce-cart-form [name=update_cart]')){
2216            document.querySelector('.woocommerce-cart-form [name=update_cart]').disabled = false;
2217        }
2218    }); 
2219    
2220    jQuery('body').on('click', '.quantity.number-input span.plus', function(e){    
2221        this.parentNode.querySelector('input[type=number]').stepUp();
2222        if(document.querySelector('.woocommerce-cart-form [name=update_cart]')){
2223            document.querySelector('.woocommerce-cart-form [name=update_cart]').disabled = false;
2224        }
2225    }); 
2226
2227    jQuery('ul.wgl-products li a.add_to_cart_button.ajax_add_to_cart').on( "click", function() {
2228        jQuery(this).closest('li').addClass('added_to_cart_item');
2229    });
2230}
2231
2232function thegov_woocommerce_login_in() {
2233
2234	if (jQuery('header .login-in').length) {
2235		var mc = jQuery('header .login-in'),
2236			icon = mc.find('a.login-in_link'),
2237			overlay = mc.find('div.overlay');
2238
2239		icon.on('click tap', function(e) { 
2240			e.preventDefault();
2241			mc.toggleClass('open_login'); 
2242		});
2243
2244		overlay.on('click tap', function(e) { 
2245			if(!jQuery(e.target).closest('.modal_content').length && !jQuery(e.target).is('.modal_content')){
2246			 	mc.removeClass('open_login'); 
2247			}
2248		});
2249
2250	};
2251};
2252
2253
2254function thegov_woocommerce_mini_cart() {
2255
2256	if (jQuery('header .mini-cart').length) {
2257		jQuery('header .mini-cart').prepend('<div class="mini_cart-overlay"></div>');
2258
2259		var mc = jQuery('header .mini-cart'),
2260			icon = mc.find('a.woo_icon'),
2261			overlay = mc.find('div.mini_cart-overlay');
2262
2263		icon.on('click tap', function() { mc.toggleClass('open_cart'); });
2264		overlay.on('click tap', function() { mc.removeClass('open_cart'); });
2265		jQuery('body').on('click', 'header a.close_mini_cart', function(){
2266			mc.removeClass('open_cart');
2267		});
2268	};
2269};
2270

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.