PageSourceSearch

https://www.newhistorian.com/wp-content/themes/goodnews5/js/main.js?ver=1.0

js newhistorian.com collected 2026-10-02 08:33:55 UTC 66,328 bytes, 1,448 lines download raw bytes

1jQuery(document).ready (function ($) {
2"use strict";
3	// remove empty p
4	$('p')
5	.filter(function() {
6	    return $.trim($(this).text()) === '' && $(this).children().length == 0
7	})
8	.remove();
9
10//place holder
11    $('input').each(function() {
12    $(this).data('holder',$(this).attr('placeholder'));
13
14    $('input').focusin(function(){
15        $(this).attr('placeholder','');
16    });
17    $('input').focusout(function(){
18        $(this).attr('placeholder',$(this).data('holder'));
19    });
20        });
21    $('textarea').each(function() {
22	    $(this).data('holder',$(this).attr('placeholder'));
23
24	    $(this).focusin(function(){
25	        $(this).attr('placeholder','');
26	    });
27	    $(this).focusout(function(){
28	        $(this).attr('placeholder',$(this).data('holder'));
29	    });
30    });
31//alert-bar
32if (jQuery(".alert-bar").length) {
33        $('.alert-bar').slideDown('600');
34
35    setTimeout(function() {
36        $('.alert-bar').slideUp('800', function() {
37        	$('.alert-bar').remove();
38        })
39    }, 5000);
40}
41// search
42$('#navigation .nav-button').click(function(e) {
43    if (!$(this).hasClass('active')) {
44	$('#navigation .nav-button').removeClass('active');
45	$(this).addClass('active');
46	$('.nb-inner-wrap').removeClass('sw-show');
47	$(this).next('.nb-inner-wrap').addClass('sw-show');
48    } else {
49	$(this).removeClass('active');
50	$('.nb-inner-wrap').removeClass('sw-show');
51    }
52    e.stopPropagation();
53
54});
55$('.nb-inner-wrap').click(function(e) {
56    e.stopPropagation();
57});
58
59$('body').click(function(e) {
60    $('#navigation .nav-button').removeClass('active');
61    $('.nb-inner-wrap').removeClass('sw-show');
62});
63
64//Sticky navigation
65if ($(window).width() > 1000) {
66   if ($('body').hasClass('sticky_navigation_on')) {
67        var aboveHeight = $('#header-wrapper').outerHeight();
68        $(window).scroll(function(){
69	        //if scrolled down more than the headerÕs height
70                if ($(window).scrollTop() > aboveHeight){
71	        // if yes, add ÒfixedÓ class to the <nav>
72	        // add padding top to the #content
73            if ( $('#wpadminbar').length ) {
74                $('#navigation').addClass('sticky-nav').css('top','28px').next().css('padding-top','52px');
75             } else {
76                $('#navigation').addClass('sticky-nav').css('top','0').next().css('padding-top','52px');
77            }
78                } else {
79
80	        // when scroll up or less than aboveHeight,
81                $('#navigation').removeClass('sticky-nav').css('top', 0).next().css('padding-top','0');
82                }
83        });
84    }
85}
86//tabbed widget
87    jQuery(".widget_momizattabber").each(function(){
88        var ul = jQuery(this).find(".main_tabs ul.tabs");
89
90        jQuery(this).find(".tab-content").each(function() {
91            jQuery(this).find('a.mom-tw-title').wrap('<li></li>').parent().detach().appendTo(ul);
92        });
93    });
94
95// secondary sidebar in all devices
96
97if (! $('body').hasClass('responsive_disabled') && $('body').hasClass('show_secondary_sidebar_on_ipad')) {
98if ($(window).width() < 1310) {
99	$('.secondary-sidebar').show();
100	$('.secondary-sidebar').insertBefore('.main-sidebar');
101	$('.secondary-sidebar').removeClass('secondary-sidebar vc_sec_sidebar alignlefti alignrighti').addClass('main-sidebar vc_sidebar moded');
102	if($(window).width() > 1000) {
103		$('.vc_column_container.main-sidebar.moded').css('margin-right', '15px');
104	}
105}
106
107$(window).resize(function() {
108if ($(window).width() < 1310) {
109	$('.secondary-sidebar').show();
110	$('.secondary-sidebar').insertBefore('.main-sidebar');
111	$('.secondary-sidebar').removeClass('secondary-sidebar vc_sec_sidebar alignlefti alignrighti').addClass('main-sidebar vc_sidebar moded');
112	if($(window).width() > 1000) {
113		$('.vc_column_container.main-sidebar.moded').css('margin-right', '15px');
114	}
115}
116});
117}
118
119// Main Tabs
120    if ($(".main_tabs ul.tabs").length) { $("ul.tabs").momtabs("div.tabs-content-wrap > .tab-content", { effect: 'fade'}); }
121
122//HIDPI Images
123    var hidpi = window.devicePixelRatio > 1 ? true : false;
124    if (hidpi) {
125    // Replace img src with data-hidpi
126    $('img[data-hidpi]').each(function() {
127    // If width x height hasn't been set, fill it in
128    if ($(this).parents('.tab-content').length === 0) {
129	/*
130	if ($(this).attr('width') === undefined) {
131	$(this).attr('width', $(this).width());
132	}
133	if ($(this).attr('height') === undefined) {
134	$(this).attr('height', $(this).height());
135	}
136	*/
137    }
138    $(this).attr('src', $(this).data('hidpi'));
139    });
140    }
141// weather widget
142    $('.weather-widget').on('click', '.day-summary',function() {
143        var $this = $(this);
144        if ($this.hasClass('active')) {
145            $(this).next('.day-details').slideToggle(250, function() {
146                $this.toggleClass('active');
147            });
148        } else {
149                $this.toggleClass('active');
150            $(this).next('.day-details').slideToggle(250);
151        }
152    });
153
154//time line
155    if ($('.mom-timeline').length) {
156	$('.tl-month:first-child').removeClass('closed').addClass('opened');
157        $('.tl-month').each(function() {
158            if ($(this).hasClass('opened')) {
159                $(this).find('.tl-days').show();
160                $(this).find('.tlm-title .handle').removeClass('brankic-icon-add');
161                $(this).find('.tlm-title .handle').addClass('brankic-icon-minus3');
162            }
163    });
164        $('.tl-month .tlm-title .handle').click(function() {
165            var $this = $(this);
166            var month = $(this).parent().parent();
167            if (month.hasClass('closed')) {
168                month.removeClass('closed');
169                month.addClass('opened');
170                month.find('.tl-days').slideDown();
171                $this.removeClass('brankic-icon-add');
172                $this.addClass('brankic-icon-minus3');
173            } else {
174                month.removeClass('opened');
175                month.find('.tl-days').slideUp('normal', function() {
176                month.addClass('closed');
177                $this.removeClass('brankic-icon-minus3');
178                $this.addClass('brankic-icon-add');
179                });
180            }
181        });
182    }
183
184//social icons
185if ($('.mom-social-icons').length) {
186    $('.mom-social-icons li').each(function () {
187    var dataHover = $('a',this).attr('data-bghover');
188    if (typeof dataHover !== 'undefined' && dataHover !== false) {
189	 var origBg = $('a',this).css('background');
190	 var hoverBg = $('a',this).data('bghover');
191	$('a', this).hover(function() {
192	    $(this).css('background', hoverBg)
193	}, function() {
194	    $(this).css('background', origBg)
195	});
196    }
197    });
198}
199
200//images
201if(!( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )) {
202    // fade images on appear
203    $('body.fade-imgs-in-appear .main_container img, body.fade-imgs-in-appear .sidebar img, body.fade-imgs-in-appear #footer img, body.fade-imgs-in-appear .wpb_row img').addClass('disappear');
204    $('body.fade-imgs-in-appear .main_container img, body.fade-imgs-in-appear .sidebar img, body.fade-imgs-in-appear #footer img,  body.fade-imgs-in-appear .wpb_row img').one('inview', function() {$(this).addClass('mom_appear');});
205
206    //body background link
207    $('body.use_bg_as_ad.layout-boxed').click(function(e){
208	if (e.target === this) {
209
210			window.open(
211			  momAjaxL.bodyad,
212			  '_blank' // <- This is what makes it open in a new window.
213			);
214
215	}
216    });
217}
218
219// responsive videos
220$('.video_frame').each(function(index, el) {
221	var t = $(this);
222	var w = t.width();
223	var h = w/16;
224	h = h*9;
225
226	t.find('iframe').css('height', h+'px');
227
228});
229window.onresize = function(event) {
230$('.video_frame').each(function(index, el) {
231	var t = $(this);
232	var w = t.width();
233	var h = w/16;
234	h = h*9;
235
236	t.find('iframe').css('height', h+'px');
237
238});
239};
240
241$('.entry-content .video_frame iframe').each(function(index, el) {
242	var t = $(this);
243	var w = t.width();
244	var h = w/16;
245	h = h*9;
246
247	t.css('height', h+'px');
248
249});
250window.onresize = function(event) {
251$('.entry-content .video_frame iframe').each(function(index, el) {
252	var t = $(this);
253	var w = t.width();
254	var h = w/16;
255	h = h*9;
256
257	t.css('height', h+'px');
258
259});
260};
261//Submenu auto align
262        $('ul.main-menu > li').each(function(e){
263            var t = $(this),
264                submenu = t.find('.cats-mega-wrap');
265            if( submenu.length > 0 ) {
266                var offset = submenu.offset(),
267                    w = submenu.width();
268                if( offset.left + w > $(window).width() ) {
269                    t.addClass('sub-menu-left');
270                } else {
271                    t.removeClass('sub-menu-left');
272                }
273            }
274        });
275//category mega menu
276	$('.cats-mega-wrap ul.sub-menu li').mouseenter(function() {
277	    var id = $(this).attr('id');
278	    var id = id.split('-');
279	    //console.log(id[2]);
280	    $(this).parent().find('li').removeClass('active');
281	    $(this).addClass('active');
282	    $(this).parent().next('.subcat').find('.mom-cat-latest').hide();
283	    $(this).parent().next('.subcat').find('#mn-latest-'+id[2]).show();
284	});
285
286//breaking news
287if ($('.news-ticker').length) {
288	var timeout = $('.news-ticker').data('timeout');
289    $('body:not(.rtl) .news-ticker:not(.custom-animation) > ul').liScroll();
290    $('body.rtl .news-ticker:not(.custom-animation) > ul').liScrollRight();
291    $('.news-ticker.animation-updown ul').newsTicker({
292    row_height: 39,
293    max_rows: 1,
294    speed: 600,
295    direction: 'up',
296    duration: timeout,
297    autostart: 1,
298    pauseOnHover: 1
299});
300/*
301$('.news-ticker ul').each(function() {
302	var t = $(this),
303			w = 0;
304
305	t.children('li').each(function() {
306		w += $(this).width() + 20;
307	});
308	t.width(w)
309});
310*/
311
312if ($('body').hasClass('ticker_has_live_time')) {
313$.startTime = function () {
314    var today=new Date();
315    var h=today.getHours();
316    var m=today.getMinutes();
317    var s=today.getSeconds();
318    m = $.checkTime(m);
319    s = $.checkTime(s);
320    if ($('body').hasClass('time_in_twelve_format')) {
321	h = ((h+11) % 12) +1;
322    }
323    //document.getElementById('txt').innerHTML = h+":"+m+":"+s;
324    $('span.current_time span').html(h+":"+m+":"+s);
325    var t = setTimeout(function(){$.startTime()},500);
326}
327$.checkTime = function(i) {
328    if (i<10) {i = "0" + i};  // add zero in front of numbers < 10
329    return i;
330}
331$.startTime();
332}
333
334}
335
336// smooth scroll
337if ($('body').hasClass('smooth_scroll_enable')) {
338	$("html").niceScroll();
339}
340//social share
341$('.mom-social-share a').click(function(e) { e.preventDefault(); });
342
343//twitter widget buttons
344$('.twiter-list ul.twiter-buttons li a').click( function(e) {
345    e.preventDefault();
346});
347
348//Porfolio filter
349$('ul.portfolio-filter').each( function() {
350	var $this = $(this);
351	$this.find('li a').click(function() {
352	    $this.find('li').removeClass('current');
353	    $(this).parent().addClass('current');
354	});
355});
356
357// Avanced search form Validate
358$('.advanced-search-form [type="submit"]').click(function(e) {
359    var s = $(this).parent().find('input[name="s"]');
360    if (s.val() === '' ) {
361	e.preventDefault()
362	s.addClass('invalid');
363	s.attr('placeholder', s.data('nokeyword'));
364    }
365});
366
367// videos
368$('.mom-video-widget').fitVids();
369//scroll to top
370$('.scrollToTop').hide();
371	$(window).scroll(function () {
372		if( $(this).scrollTop() > 100 ) {
373			$('.scrollToTop').fadeIn(300);
374		}
375		else {
376			$('.scrollToTop').fadeOut(300);
377		}
378	});
379
380	$('.scrollToTop').click(function(){
381		$('html, body').animate({scrollTop:0}, 500 );
382		return false;
383	});
384// sidebars categories
385$('.sidebar li.cat-item, .sidebar .widget_archive li').each(function(){
386          var $contents = $(this).contents();
387          if ($contents.length > 1)  {
388	  $contents.eq(1).wrap('<span class="cat_num"></span>');
389
390	  $contents.eq(1).each(function(){
391	});
392    }
393    }).contents();
394	    $('.sidebar li.cat-item .cat_num, .sidebar .widget_archive li .cat_num').each(function () {
395	       $(this).html($(this).text().substring(2));
396	      $(this).html( $(this).text().replace(/\)/gi, "") );
397	    });
398
399if ($('.sidebar li.cat-item').length) {
400    $('.sidebar li.cat-item .cat_num .line').each( function() {
401	if ($(this).is(':empty')){
402	    $(this).parent().hide();
403	}
404
405});
406}
407// footer Categories
408$('#footer li.cat-item').parent().addClass('two_columns_categoreis clearfix');
409/*-----------------------------------------
410*	Shortcode
411*-----------------------------------------*/
412
413//Accordion
414$('.accordion.mom_accordion').each( function() {
415    var acc = $(this);
416    if (acc.hasClass('toggle_acc')) {
417        acc.find('li:first .acc_title').addClass('active');
418        acc.find('.acc_toggle_open').addClass('active');
419        acc.find('.acc_toggle_open').next('.acc_content').show();
420        acc.find('.acc_toggle_close').removeClass('active');
421        acc.find('.acc_toggle_close').next('.acc_content').hide();
422        acc.find('.acc_title').click(function() {
423        $(this).toggleClass('active');
424        $(this).next('.acc_content').slideToggle();
425    });
426    } else {
427    acc.find('li:first .acc_title').addClass('active');
428    acc.find('.acc_title').click(function() {
429        if(!$(this).hasClass('active')) {
430        acc.find('.acc_title').removeClass('active');
431        acc.find('.acc_content').slideUp();
432        $(this).addClass('active');
433        $(this).next('.acc_content').slideDown();
434        }
435    });
436    }
437});
438$(".accordion").each(function () {
439    $(this).find('.acc_title').each(function(i) {
440        $(this).find('.acch_numbers').text(i+1);
441    });
442});
443
444// lists
445if ($('.mom_list').length) {
446    $('.mom_list li').each(function() {
447	var i = $(this).children('i');
448	var cl = i.data('color');
449	var clh = i.data('color_hover');
450	var bg = i.data('bg');
451	var bgh = i.data('bg_hover');
452	if (clh !== '') {
453	    $(this).hover(function() {
454		i.css('color', clh);
455	    }, function() {
456		i.css('color', cl);
457	    });
458	}
459	if (bgh !== '') {
460	    $(this).hover(function() {
461		i.css('background', bgh);
462	    }, function() {
463		i.css('background', bg);
464	    });
465	}
466
467
468    });
469}
470//callitout
471if ($('.mom_callout').length) {
472    $('.mom_callout').each( function () {
473	if ($(this).find('.cobtr').length) {
474	var btwidth = parseFloat($(this).find('.cobtr').css('width'))+30;
475	var btheight = parseFloat($(this).find('.cobtr').css('height'))/2;
476	$(this).find('.callout_content').css('margin-right',btwidth+'px');
477	$(this).find('.cobtr').css('margin-top', '-'+btheight+'px');
478	}
479	if ($(this).find('.cobtl').length) {
480	var btwidth = parseFloat($(this).find('.cobtl').css('width'))+30;
481	var btheight = parseFloat($(this).find('.cobtl').css('height'))/2;
482	$(this).find('.callout_content').css('margin-left',btwidth+'px');
483	$(this).find('.cobtl').css('margin-top', '-'+btheight+'px');
484	}
485    });
486}
487	jQuery('.mom_button').hover(
488		function(){
489		var $hoverbg = jQuery(this).attr('data-hoverbg');
490		var $texthcolor = jQuery(this).attr('data-texthover');
491		var $borderhover = jQuery(this).attr('data-borderhover');
492		jQuery(this).css("background-color",$hoverbg);
493		jQuery(this).css("color",$texthcolor);
494		jQuery(this).css("border-color",$borderhover);
495	},function() {
496		var $bgcolor = jQuery(this).attr('data-bg');
497		var $textColor = jQuery(this).attr('data-text');
498		var $bordercolor = jQuery(this).attr('data-border');
499		if($bgcolor!==undefined){
500			jQuery(this).css("background-color",$bgcolor);
501		}else {
502			jQuery(this).css("background-color",'');
503		}
504		if($textColor!==undefined){
505			jQuery(this).css("color",$textColor);
506		}else {
507			jQuery(this).css("color",'');
508		}
509		if($bordercolor !== undefined){
510			jQuery(this).css("border-color",$bordercolor);
511		}else {
512			jQuery(this).css("border-color",'');
513		}
514	});
515// Tab Current icon
516if (('.main_tabs ul.tabs li a i').length) {
517    $('.main_tabs').each(function () {
518	var $this = $(this);
519	var current_tab = $this.find('.tabs li a.current i[class*="-icon-"]');
520	current_tab.css('color', current_tab.attr('data-current'));
521	$this.find('.tabs li a').click(function () {
522	if ($(this).hasClass('current')) {
523	var $current = $(this).find('[class*="-icon-"]').attr('data-current');
524	var $orig = $(this).find('[class*="-icon-"]').attr('data-color');
525
526	$this.find('.tabs li a i[class*="-icon-"]').css('color',$orig);
527	$('[class*="-icon-"]', this).css('color', $current);
528	}
529	});
530    });
531}
532// Accordion Current icon
533if (('h2.acc_title i').length) {
534    $('.accordion').each(function () {
535	var $this = $(this);
536	var current_acc = $this.find('h2.active i[class*="-icon-"]');
537	current_acc.css('color', current_acc.attr('data-current'));
538	$this.find('h2.acc_title').click(function () {
539	if ($(this).hasClass('active')) {
540	var $current = $(this).find('[class*="-icon-"]').attr('data-current');
541	var $orig = $(this).find('[class*="-icon-"]').attr('data-color');
542
543	$this.find('h2.acc_title i[class*="-icon-"]').css('color',$orig);
544	$('[class*="-icon-"]', this).css('color', $current);
545	}
546	});
547    });
548}
549
550//team members
551	var tm_cols = 2;
552	var tm_2_i = 0;
553	$(".team_member2").each(function(){
554		tm_2_i++;
555		tm_cols = 2;
556		if (tm_2_i % tm_cols === 0) {$(this).addClass("last");}
557	});
558	var tm_3_i = 0;
559	$(".team_member3").each(function(){
560		tm_3_i++;
561		tm_cols = 3;
562		if (tm_3_i % tm_cols === 0) {$(this).addClass("last");}
563	});
564	var tm_4_i = 0;
565	$(".team_member4").each(function(){
566		tm_4_i++;
567		tm_cols = 4;
568		if (tm_4_i % tm_cols === 0) {$(this).addClass("last");}
569	});
570	var tm_5_i = 0;
571	$(".team_member5").each(function(){
572		tm_5_i++;
573		tm_cols = 5;
574		if (tm_5_i % tm_cols === 0) {$(this).addClass("last");}
575	});
576$('.team_member').each( function () {
577    var socials = $(this).find('.member_social ul li');
578    var width = 100/socials.length;
579    socials.css('width',width+'%');
580});
581
582//Icon Colors in hover
583jQuery('.mom_iconbox').hover(
584	function(){
585	var icon = $(this).find('[class*="-icon-"]');
586	var icon_wrap = $(this).find('.iconb_wrap');
587
588	var $hover = icon.attr('data-hover');
589	var $bghover = icon_wrap.attr('data-hover');
590	var $bdhover = icon_wrap.attr('data-border_hover');
591
592	if ($hover !== '') {
593	icon.css("color",$hover);
594	}
595	if ($bghover !== '') {
596	icon_wrap.css("background",$bghover);
597	}
598	if ($bdhover !== '') {
599	icon_wrap.css("border-color",$bdhover);
600	}
601},function() {
602	var icon = $(this).find('[class*="-icon-"]');
603	var icon_wrap = $(this).find('.iconb_wrap');
604
605	var $color = icon.attr('data-color');
606	var $origcolor = icon.css('color');
607	var $bgcolor = icon_wrap.attr('data-color');
608	var $origbg = icon_wrap.css('background-color');
609	var $bdcolor = icon_wrap.attr('data-border_color');
610	var $origbd = icon_wrap.css('border-color');
611	if($color!==undefined){
612		icon.css("color",$color);
613	}else {
614		icon.css("color",$origcolor);
615	}
616	if($bgcolor!==undefined){
617		icon_wrap.css("background",$bgcolor);
618	}else {
619		icon_wrap.css("background",$origbg);
620	}
621	if($bdcolor!==undefined){
622		icon_wrap.css("border-color",$bdcolor);
623	}else {
624	}
625});
626
627//icona
628jQuery('.mom_icona').hover(
629	function(){
630	var icon = $(this).find('[class*="-icon-"]');
631	var icon_wrap = $(this);
632	var $hover = icon.attr('data-hover');
633	var $bghover = icon_wrap.attr('data-hover');
634	var $bdhover = icon_wrap.attr('data-border_hover');
635	icon.css("color",$hover);
636	icon_wrap.css("background",$bghover);
637	icon_wrap.css("border-color",$bdhover);
638},function() {
639	var icon = $(this).find('[class*="-icon-"]');
640	var icon_wrap = $(this);
641	var $color = icon.attr('data-color');
642	var $origcolor = icon.css('color');
643	var $bgcolor = icon_wrap.attr('data-color');
644	var $origbg = icon_wrap.css('background-color');
645	var $bdcolor = icon_wrap.attr('data-border_color');
646	var $origbd = icon_wrap.css('border-color');
647	if($color!==undefined){
648		icon.css("color",$color);
649	}else {
650		icon.css("color",$origcolor);
651	}
652	if($bgcolor!==undefined){
653		icon_wrap.css("background",$bgcolor);
654	}else {
655		icon_wrap.css("background",$origbg);
656	}
657	if($bdcolor!==undefined){
658		icon_wrap.css("border-color",$bdcolor);
659	}else {
660	}
661});
662//Porfolio filter
663$('.protfolio_filter ul').each( function() {
664	var $this = $(this);
665	$this.find('li a').click(function() {
666	$this.find('li').removeClass('current');
667	$(this).parent().addClass('current');
668	});
669});
670
671//heighest col
672/*
673var highestCol = Math.max($('.bothsides_content').height(),$('.sideb').height());
674$('.bothsides_content, .sideb').height(highestCol);
675*/
676
677// comment form
678if($('#commentform').length) {
679$('#commentform input').each(function() {
680$(this).data('holder',$(this).attr('placeholder'));
681
682$('#commentform input').focusin(function(){
683    $(this).attr('placeholder','');
684});
685$('#commentform input').focusout(function(){
686    $(this).attr('placeholder',$(this).data('holder'));
687});
688    });
689$('#commentform #comment').data('holder',$('#commentform #comment').attr('placeholder'));
690
691$('#commentform #comment').focusin(function(){
692    $(this).attr('placeholder','');
693});
694$('#commentform #comment').focusout(function(){
695    $(this).attr('placeholder',$(this).data('holder'));
696});
697}
698
699// Contact form
700if($('.mom_contact_form').length) {
701$('.mom_contact_form input').each(function() {
702	$(this).data('holder',$(this).attr('placeholder'));
703
704	$('.mom_contact_form input').focusin(function(){
705	$(this).attr('placeholder','');
706	});
707	$('.mom_contact_form input').focusout(function(){
708	$(this).attr('placeholder',$(this).data('holder'));
709	});
710});
711
712$('.mom_contact_form textarea').each(function() {
713	$(this).data('holder',$(this).attr('placeholder'));
714	$('.mom_contact_form textarea').focusin(function(){
715$(this).attr('placeholder','');
716	});
717	$('.mom_contact_form textarea').focusout(function(){
718$(this).attr('placeholder',$(this).data('holder'));
719	});
720});
721
722}
723//share
724if ($('.mom_share_buttons').length) {
725    $('.mom_share_buttons').data('height',$('.mom_share_buttons').css('height'));
726    var curHeight = $('.mom_share_buttons').height();
727    $('.mom_share_buttons').css('height', 'auto');
728    var autoHeight = $('.mom_share_buttons').height();
729    $('.mom_share_buttons').css('height', curHeight);
730    $('.mom_share_it .sh_arrow').toggle(function () {
731	$('.mom_share_buttons').stop().animate({height: autoHeight}, 300);
732	$(this).find('i').removeClass();
733	$(this).find('i').addClass('momizat-icon-193');
734    }, function () {
735	$('.mom_share_buttons').stop().animate({height: $('.mom_share_buttons').data('height')}, 300);
736	$(this).find('i').removeClass();
737	$(this).find('i').addClass('momizat-icon-194');
738    });
739}
740
741//toggles
742jQuery("h4.toggle_title").click(function () {
743	$(this).next(".toggle_content").slideToggle();
744	$(this).toggleClass("active_toggle");
745	$(this).parent().toggleClass("toggle_active");
746});
747
748$("h4.toggle_min").click(function () {
749	$(this).next(".toggle_content_min").slideToggle();
750	$(this).toggleClass("active_toggle_min");
751});
752
753//scroll to top
754$('.scrollTo_top').hide();
755	$(window).scroll(function () {
756		if( $(this).scrollTop() > 100 ) {
757			$('.scrollTo_top').fadeIn(300);
758		}
759		else {
760			$('.scrollTo_top').fadeOut(300);
761		}
762	});
763
764	$('.scrollTo_top').click(function(){
765		$('html, body').animate({scrollTop:0}, 500 );
766		return false;
767	});
768
769//lightbox
770if ($('.mom_lightbox').length) {
771$(".mom_lightbox > a").prettyPhoto({animation_speed:'fast',slideshow:10000, deeplinking: false});
772}
773
774    $('body.open_images_in_lightbox a').each(function() {
775        if(/\.(?:jpg|jpeg|gif|png)$/i.test($(this).attr('href'))){
776            $(this).prettyPhoto();
777        }
778    });
779// Mobile
780if ($('.top_menu_handle').length) {
781    $('.top_menu_handle').toggle( function () {
782	$(this).next('.mobile_top_nav').show();
783	$(this).addClass('tmh_close');
784    }, function () {
785	$(this).next('.mobile_top_nav').hide();
786	$(this).removeClass('tmh_close');
787    });
788}
789
790if ($('.mobile_main_nav_handle').length) {
791    $('.mobile_main_nav_handle').toggle( function () {
792	$(this).next('.mom_mobile_main_nav .nav').slideDown();
793    }, function () {
794	$(this).next('.mom_mobile_main_nav .nav').slideUp();
795    });
796
797}
798
799$(window).resize(function() {
800  if ($(window).width() < 978) {
801	$('.video_wrap').fitVids();
802  }
803});
804
805  if ($(window).width() < 978) {
806	$('.video_wrap').fitVids();
807  }
808//$('.video_frame').fitVids();
809$(window).resize(function() {
810  if ($(window).width() < 460) {
811    $('.topbar .mom-social-icons li').hide();
812    $(".topbar .mom-social-icons li:lt(7)").show();
813  }
814});
815
816  if ($(window).width() < 460) {
817    $('.topbar .mom-social-icons li').hide();
818    $(".topbar .mom-social-icons li:lt(7)").show();
819  }
820//$("html").niceScroll();
821
822/*
823     $('a').click(function(){
824	$('html, body').animate({
825	    scrollTop: $('[name="' + $.attr(this, 'href').substr(1) + '"]').offset().top
826	}, 500);
827	return false;
828    });
829 */
830$('.animator.animated, .iconb_wrap.animated').each( function() {
831    var $this = $(this);
832    var animation = $(this).attr('data-animate');
833
834$this.bind('inview', function(event, isInView, visiblePartX, visiblePartY) {
835  if (isInView) {
836	    $(this).addClass(animation);
837	    $(this).css('visibility', 'visible');
838	    if(animation.indexOf('fade') === -1)
839	    {
840	      $(this).css('opacity', '1');
841	    }
842    if (visiblePartY == 'top') {
843      // top part of element is visible
844    } else if (visiblePartY == 'bottom') {
845      // bottom part of element is visible
846    } else {
847      // whole part of element is visible
848    }
849  } else {
850    // element has gone out of viewport
851  }
852});
853
854});
855if ($('.progress_outer').length) {
856    $('.progress_outer').each( function() {
857	var $this = $(this);
858    $this.bind('inview', function(event, isInView, visiblePartX, visiblePartY) {
859      if (isInView) {
860		$(this).find('.parograss_inner').show();
861		$(this).find('.parograss_inner').addClass('ani-bar');
862	if (visiblePartY == 'top') {
863	  // top part of element is visible
864	} else if (visiblePartY == 'bottom') {
865	  // bottom part of element is visible
866	} else {
867	  // whole part of element is visible
868	}
869      } else {
870	// element has gone out of viewport
871      }
872    });
873
874    });
875}
876//responsive headings
877    if ($(window).width() < 767) {
878	$('h1,h2,h3,h4,h5,h6, span, .mom_google_font').each(function() {
879	    if ($(this).attr('font-size')) {
880		var fs = parseFloat($(this).css('font-size'));
881		if (fs > 24) {
882		    $(this).css('font-size','23px');
883		}
884	    }
885	});
886    }
887
888if ($('.mom_custom_background').length) {
889    $('.mom_custom_background').each(function() {
890	var $this = $(this);
891	$(window).scroll(function () {
892		var speed = 8.0;
893		$this.css({backgroundPosition:(-window.pageXOffset / speed) + "px " + (-window.pageYOffset / speed) + "px"});
894		//document.body.style.backgroundPosition = (-window.pageXOffset / speed) + "px " + (-window.pageYOffset / speed) + "px";
895	});
896    });
897}
898//Default Gallery
899if (! $('body').hasClass('disable_lightbox_in_wp_gallery')) {
900	if ($('.gallery .gallery-item').length) {
901	    $(".gallery .gallery-item a").attr('rel', 'prettyPhoto[pp_gal]');
902	    $(".gallery .gallery-item a").prettyPhoto();
903	}
904}
905
906//lightbox
907if ($('img.lightbox').length) {
908    $('img.lightbox').each(function() {
909	$(this).parent('a').prettyPhoto();
910    })
911}
912
913/*----------------------------
914    Ads
915 ----------------------------*/
916if ($('.mca-fixed').length) {
917    var mca_top = $('.mca-fixed').offset().top;
918    var mca = $('.mca-fixed');
919        $(window).scroll(function(){
920	    if ($(window).scrollTop() > mca_top){
921		if ( $('#wpadminbar').length ) {
922		    mca.css({ top:'28px', position: 'fixed' });
923		    mca.addClass('mca_touch_top');
924		 } else {
925		    mca.css({ top:'0', position: 'fixed' });
926		    mca.addClass('mca_touch_top');
927		}
928	    } else {
929		mca.css({ top:'auto', position: 'absolute' });
930		mca.removeClass('mca_touch_top');
931	    }
932        });
933}
934
935
936/* ==========================================================================
937 *                Responsive mode
938   ========================================================================== */
939
940// double tab on navigation
941if(( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )) {
942    $('#navigation .main-menu > li.menu-item-has-children').doubleTapToGo();
943}
944
945// Responsive menus
946$('.top-menu-holder').click(function(e) {
947    e.stopPropagation();
948    $('.device-top-nav').slideToggle();
949    $(this).toggleClass('active');
950});
951$('.device-top-nav, .device-menu').click(function(e) {
952    e.stopPropagation();
953});
954$('body').click(function() {
955    $('.device-top-nav').slideUp();
956    $('.device-menu').slideUp();
957});
958
959$('.device-menu-holder').click(function(e) {
960    e.stopPropagation();
961    if ($(this).hasClass('active')) {
962	    $('.device-menu li').each(function() {
963		if ($(this).find('.mom_mega_wrap').length !== 0) {
964		} else {
965		    $(this).find('.sub-menu').slideUp();
966		}
967	    });
968	    $('.device-menu').find('.dm-active').removeClass('dm-active');
969	    $('.device-menu').find('.mom_custom_mega').slideUp();
970    }
971    $('.device-menu').slideToggle();
972    $(this).toggleClass('active');
973    $('#navigation .nav-buttons').toggleClass('mh-active');
974
975});
976$('.responsive-caret').click(function() {
977    var li = $(this).closest('li');
978    if (li.hasClass('dm-active') || li.find('.dm-active').length !== 0 || li.find('.sub-menu').is(':visible') || li.find('.mom_custom_mega').is(':visible') ) {
979	li.removeClass('dm-active');
980	li.children('.sub-menu').slideUp();
981	if (li.find('.mom_mega_wrap').length === 0) {
982	    	li.find('.sub-menu').slideUp();
983	}
984	if (li.hasClass('mom_default_menu_item') || li.find('.cats-mega-wrap').length !== 0) {
985	    li.find('.sub-menu').slideUp();
986	}
987	li.find('.dm-active').removeClass('dm-active');
988	if (li.find('.mom_custom_mega').length !== 0) {
989	    li.find('.mom_custom_mega').slideUp();
990	}
991
992    } else {
993	$('.device-menu').find('.dm-active').removeClass('dm-active');
994	li.addClass('dm-active');
995	li.children('.sub-menu').slideDown();
996	if (li.find('.cats-mega-wrap').length !== 0) {
997	    li.find('.sub-menu').slideDown();
998	}
999	if (li.find('.mom_custom_mega').length !== 0) {
1000	    li.find('.mom_custom_mega').slideDown();
1001	}
1002
1003    }
1004})
1005$('.the_menu_holder_area').html($('.device-menu').find('.current-menu-item').children('a').html());
1006
1007var nbts = $('.nav-buttons .nav-button');
1008var rnp = 0;
1009nbts.each(function () {
1010    var w = $(this).outerWidth()-1;
1011    rnp += w;
1012});
1013    if (nbts.length === 3) {
1014	rnp = rnp+2;
1015    }
1016
1017$('body:not(.rtl) .device-menu-wrap').css('padding-right',rnp+'px');
1018$('body.rtl .device-menu-wrap').css('padding-left',rnp+'px');
1019
1020// scrolling box
1021$(window).resize(function() {
1022  if ($(window).width() < 670) {
1023	$('.scrolling-box .sb-item .sb-item-img').each( function(e) {
1024	    var img = $(this).find('img');
1025	    img.attr('src', img.data('hidpi'));
1026	});
1027  }
1028    if ($(window).width() < 480) {
1029	$('.recent-news .news-image, .news-list .news-image, .blog-post .bp-detail
1029s .post-img').each( function(e) {
1030	    var img = $(this).find('img');
1031	    var attr = img.attr('data-hidpi');
1032	    if (typeof attr !== 'undefined' && attr !== false) {
1033		img.attr('src', img.data('hidpi'));
1034	    }
1035	});
1036  }
1037});
1038  if ($(window).width() < 670) {
1039	$('.scrolling-box .sb-item .sb-item-img').each( function(e) {
1040	    var img = $(this).find('img');
1041	    img.attr('src', img.data('hidpi'));
1042	});
1043  }
1044  if ($(window).width() < 480) {
1045	$('.recent-news .news-image, .news-list .news-image, .blog-post .bp-details .post-img').each( function(e) {
1046	    var img = $(this).find('img');
1047	    var attr = img.attr('data-hidpi');
1048	    if (typeof attr !== 'undefined' && attr !== false) {
1049		img.attr('src', img.data('hidpi'));
1050	    }
1051	});
1052  }
1053  //buddypress
1054  $('.widget:not(.bos_searchbox_widget_class) select, select#notifications-sort-order-list, select#members-friends, select#groups-sort-by, #members-order-by, #message-type-select, #activity-filter-by').wrap('<div class="mom-select"></div>');
1055    $('#buddypress div#object-nav.item-list-tabs ul li.last.filter').prev().addClass('mom_last_child');
1056
1057    //top banner
1058    $('.top_banner').show();
1059    $('a.tob_banner_close').on('click', function(e) {
1060	    $('.top_banner').slideUp(400);
1061	    var exp = $(this).date('exp');
1062	    if (exp === '') {
1063		exp = 7;
1064	    }
1065	    if (typeof($.cookie) == "function") {
1066		$.cookie('tb_clase', 'yes', { expires: exp, path: '/' });
1067	    }
1068	e.preventDefault();
1069    });
1070
1071    if (typeof($.cookie) == "function") {
1072	/* if (!$('a.tob_banner_close').hasClass('tb_save_close')) {
1073	    $('body').css('background', 'green');
1074	    $.cookie("tb_clase", null);
1075	    $.removeCookie('tb_clase');
1076	}*/
1077	if ($.cookie('tb_clase') === 'yes') {
1078	    $('.top_banner').hide();
1079	}
1080    }
1081
1082
1083//alert($.cookie('tb_clase'));
1084
1085	 $('.mom_mega_cats .cats-mega-inner > ul > li').on('mouseenter', function(e) {
1086	    e.preventDefault();
1087	    var t = $(this);
1088	    var tid = t.attr('id');
1089	    tid = tid.split('-');
1090	    tid = tid[2];
1091	    var d = t.parent().next('.subcat').find('#mn-latest-'+tid);
1092	    var dest = t.parent().next('.subcat').find('#mn-latest-'+tid+' > ul');
1093	    var id = d.data('id');
1094	    var object = d.data('object');
1095	    var layout = d.data('layout');
1096	    if (dest.children().length === 0) {
1097			jQuery.ajax({
1098			    type: "post",
1099			    url: momAjaxL.url,
1100			    dataType: 'html',
1101			    data: "action=mmcl&nonce="+momAjaxL.nonce+"&id="+id+"&object="+object+"&layout="+layout,
1102			    beforeSend: function() {
1103					dest.addClass('loading');
1104			    },
1105			    success: function(data){
1106				dest.removeClass('loading');
1107				dest.html(data);
1108			    }
1109			});
1110    	    }
1111	});
1112
1113/*------------------------------------------------
1114			login widget
1115-------------------------------------------------*/
1116$('.mom-login-widget .button.user-submit').click(function () {
1117	var p = $(this).parents('.mom-login-form');
1118	var user = p.find('input[name="log"]');
1119	var pwd = p.find('input[name="pwd"]');
1120	if (user.val() === '' || pwd.val() === '') {
1121		user.addClass('error');
1122		pwd.addClass('error');
1123		return false;
1124	}
1125});
1126/*------------------------------------------------
1127			Feature Slider
1128-------------------------------------------------*/
1129if ($('.feature-slider').length) {
1130	$('.feature-slider').each(function() {
1131		var t = $(this);
1132		if (!t.hasClass('gallery-post-slider')) {
1133		var animation = t.data('sanimation');
1134		var speed = t.data('speed');
1135		var timeout = t.data('timeout');
1136		var easing = t.data('easing');
1137		var rndn = t.data('rndn');
1138		var rtl = false;
1139		var autoplay = t.data('autoplay');
1140		var items = t.data('items');
1141
1142		var animation_new = t.data('animation_new');
1143		var animation_in = t.data('animation_in');
1144		var animation_out = t.data('animation_out');
1145		var margin = 10;
1146		var auto_height = 0;
1147		var thumbs_event = t.data('thumbs_event');
1148		if(typeof thumbs_event === 'undefined'){
1149			thumbs_event = 'click';
1150		}
1151		if (t.hasClass('no_spaces')) {
1152			margin = 5;
1153			auto_height = 1;
1154		}
1155
1156		t.find('.fs-image-nav .fs-thumb').each(function(i) {
1157				$(this).addClass( 'item'+i );
1158					if (t.hasClass('old-style')) {
1159						$(this).click(function() {
1160							t.find('.fslides').trigger( 'slideTo', [i, 0, true] );
1161						return false;
1162						});
1163					}
1164			});
1165
1166			t.find('.fs-image-nav .fs-thumb.item0').addClass( 'active' );
1167
1168			var carou_items = 6;
1169			if ($(window).width() < 768) {
1170					carou_items = 5;
1171			}
1172			if ($(window).width() < 568) {
1173					carou_items = 4;
1174			}
1175
1176			if ($(window).width() < 480 ) {
1177					carou_items = 2;
1178			}
1179
1180			if ($('body').hasClass('rtl')) {
1181				rtl = true;
1182			}
1183
1184			if (!t.hasClass('old-style')) {
1185				var owl = t.find('.fslides');
1186				var slides_count = owl.children('.fslide').length;
1187				if (slides_count == 1) {
1188					t.addClass('fs-with-one-slide');
1189				}
1190				if (slides_count > 1) {
1191				owl.owlCarousel({
1192					items: 1,
1193					baseClass: 'mom-carousel',
1194					rtl: rtl,
1195					autoplay:autoplay,
1196					autoplayTimeout:timeout,
1197					autoplayHoverPause : true,
1198					loop: true,
1199		            animateOut: animation_out,
1200		            animateIn: animation_in,
1201		            smartSpeed:1000,
1202		            autoHeight: true,
1203				});
1204			t.find('.fslides').imagesLoaded( function() {
1205				t.find('.fs-image-nav .fs-thumbs').owlCarousel({
1206					items: items,
1207					baseClass: 'mom-carousel',
1208					rtl: rtl,
1209					loop: true,
1210		            margin : margin,
1211				});
1212				//var thumb_height = t.find('.fs-image-nav .fs-thumbs .fs-thumb').eq(0).css('height');
1213				//t.find('.fs-image-nav .fs-thumbs').css('max-height', thumb_height);
1214
1215
1216				owl.on('changed.owl.carousel', function(event) {
1217    					var pos = $(event.target).find(".fslide").eq(event.item.index).data('i');
1218						//console.log(pos);
1219						$('.fc-nav-'+rndn+' .fs-thumb').removeClass( 'active' );
1220						$('.fc-nav-'+rndn+' .fs-thumb.item'+pos).addClass( 'active' );
1221						var page = Math.floor( pos / items );
1222						t.find('.fs-image-nav .fs-thumbs').trigger( 'to.owl.carousel', page );
1223				});
1224
1225
1226				t.find('.fs-image-nav .fs-thumb').on(thumbs_event, function() {
1227					var i = $(this).data('i');
1228 					owl.trigger('to.owl.carousel', [i]);
1229				});
1230
1231				t.find('.fs-image-nav .fs-prev, .fsd-prev').click(function() {
1232 					owl.trigger('prev.owl.carousel');
1233				});
1234
1235				t.find('.fs-image-nav .fs-next, .fsd-next').click(function() {
1236 					owl.trigger('next.owl.carousel');
1237				});
1238			});
1239			}
1240			} else {
1241			t.find('.fslides').carouFredSel({
1242					circular: true,
1243                    responsive: true,
1244					swipe: {
1245						onTouch: true,
1246						fx : 'scroll'
1247					},
1248					items: 1,
1249					auto: {
1250                                             play: autoplay,
1251                                             duration: speed,
1252                                             timeoutDuration: timeout,
1253                                             },
1254					prev: '.fc-nav-'+rndn+' .fs-prev, .fs-dnav-'+rndn+' span.fsd-prev',
1255					next: '.fc-nav-'+rndn+' .fs-next, .fs-dnav-'+rndn+' span.fsd-next',
1256					pagination: '.fs-nav-'+rndn,
1257					scroll: {
1258						fx: animation,
1259                                                  duration : speed,
1260                                                easing  : easing,
1261						pauseOnHover : true,
1262                                        	onBefore: function() {
1263							var pos = $(this).triggerHandler( 'currentPosition' );
1264							$('.fc-nav-'+rndn+' div').removeClass( 'active' );
1265							$('.fc-nav-'+rndn+' div.item'+pos).addClass( 'active' );
1266							var page = Math.floor( pos / carou_items );
1267							$('.fc-nav-'+rndn+' .fs-thumbs').trigger( 'slideToPage', page );
1268
1269						},
1270						onAfter: function() {
1271						}
1272
1273					}
1274			});
1275
1276			t.find('.fs-image-nav .fs-thumbs').carouFredSel({
1277						auto: false,
1278						circular:true,
1279                                        responsive: true,
1280						swipe: {
1281							onTouch: true
1282						},
1283						items: carou_items,
1284						scroll: {
1285							items:carou_items,
1286						}
1287			});
1288		}
1289
1290		} //if not the post gallery
1291
1292	});
1293}
1294// Delete share caches on click
1295	jQuery(".php-share .ss-icon a").click( function(e){
1296		var t = jQuery(this);
1297		var id = t.parent().parent().data('id');
1298			jQuery.ajax({
1299			    type: "post",
1300			    url: momAjaxL.url,
1301			    dataType: 'html',
1302			    data: "action=mcscoc&nonce="+momAjaxL.nonce+"&id="+id,
1303			    beforeSend: function() {},
1304			    success: function(){}
1305			});
1306	});
1307
1308}); // end of the file
1309
1310// ad clicks
1311jQuery(document).ready(function($) {
1312
1313	jQuery(".mom-e3lan").click( function(e){
1314		t = jQuery(this);
1315		id = t.data('id');
1316			jQuery.ajax({
1317			    type: "post",
1318			    url: momAjaxL.url,
1319			    dataType: 'html',
1320			    data: "action=mom_mom_adclicks&nonce="+momAjaxL.nonce+"&id="+id,
1321			    beforeSend: function() {},
1322			    success: function(){}
1323			});
1324	});
1325});
1326
1327
1328// Momizat User rate
1329jQuery(document).ready(function(e){e(".mom_user_rate").mousemove(function(t){var r=e(this).data("style"),s=e(this).offset(),a=t.pageX-s.left;if(t.pageY-s.top,!e(this).hasClass("rated")){var o=a/parseFloat(e(this).width())*100;i=Math.round(o),i>100&&(i=100),n=(i/20).toFixed(1),"bars"===r?(e(this).find(".ub-inner").css({width:i+"%"}),e(this).find(".ub-inner").find("span").text(i+"%")):"circles"===r||e(this).children("span").css({width:i+1+"%"}),e(this).hasClass("star-rating")&&e(this).parent().find(".yr").text(n+"/5")}}),e(".mom_user_rate, .mom_user_rate_cr").hover(function(){e(this).hasClass("rated")||(e(".review-footer .mom_user_rate_title").find(".user_rate").hide(),e(".review-footer .mom_user_rate_title").find(".your_rate").show())},function(){e(this).hasClass("rated")||(e(".mom_user_rate_title").find(".user_rate").show(),e(".mom_user_rate_title").find(".your_rate").hide())}),e(".mom_user_rate").click(function(){stars=jQuery(this),post_id=stars.data("post_id"),style=stars.data("style"),score=0,"stars"===style&&(score=parseFloat(stars.children("span").width())/parseFloat(e(this).width())*100),"bars"===style&&(score=parseFloat(stars.children(".ub-inner").width())/parseFloat(e(this).width())*100),score=Math.round(score),vc=stars.data("votes_count"),e(this).hasClass("rated")||jQuery.ajax({type:"post",url:momAjaxL.url,data:"action=user-rate&nonce="+momAjaxL.nonce+"&user_rate=&post_id="+post_id+"&user_rate_score="+score,success:function(t){"already"!=t&&(stars.addClass("rated"),e(".review-footer .mom_user_rate_title").find(".user_rate").hide(),e(".review-footer .mom_user_rate_title").find(".your_rate").show(),e(".review-footer .total-votes").find(".tv-count").text(vc+1))}})}),e(".mom-reveiw-system").length&&e(".urc-value").knob({displayInput:!1,change:function(t){e(".user-rate-circle").find(".cru-num").text(t)},release:function(t){circle=jQuery(".user-rate-circle .mom_user_rate_cr"),post_id=circle.data("post_id"),style=circle.data("style"),score=t,vc=circle.data("votes_count"),jQuery.ajax({type:"post",url:momAjaxL.url,data:"action=user-rate&nonce="+momAjaxL.nonce+"&user_rate=&post_id="+post_id+"&user_rate_score="+score,success:function(t){"already"!=t&&(circle.addClass("rated"),e(".review-footer .mom_user_rate_title").find(".user_rate").hide(),e(".review-footer .mom_user_rate_title").find(".your_rate").show(),e(".review-footer .total-votes").find(".tv-count").text(vc+1))}})}})});
1330
1331
1332// Momizat ajax
1333jQuery(document).ready(function() {
1334    jQuery(".mom-search-form input.sf").on("keyup", function() {
1335        return sf = jQuery(this), term = sf.val(), term.length > 2 ? setTimeout(function() {
1336            jQuery.ajax({
1337                type: "post",
1338                url: momAjaxL.url,
1339                dataType: "html",
1340                data: "action=mom_ajaxsearch&nonce=" + momAjaxL.nonce + "&term=" + term,
1341                beforeSend: function() {
1342                    sf.parent().parent().find(".sf-loading").fadeIn()
1343                },
1344                success: function(e) {
1345                    "" !== sf.val() ? (sf.parent().parent().next(".ajax_search_results").html(e), "" !== e ? sf.parent().parent().next(".ajax_search_results").append('<footer class="show_all_results"><a href="' + momAjaxL.homeUrl + "/?s=" + term + '">' + momAjaxL.viewAll + '<i class="fa-icon-long-arrow-right"></i></a></footer>') : (sf.parent().parent().next(".ajax_search_results").find("show_all_results").remove(), sf.parent().parent().next(".ajax_search_results").html('<span class="sw-not_found">' + momAjaxL.noResults + "</span>"))) : sf.parent().parent().next(".ajax_search_results").html(""), sf.parent().parent().find(".sf-loading").fadeOut()
1346                }
1347            })
1348        }, 300) : setTimeout(function() {
1349            jQuery.ajax({
1350                type: "post",
1351                url: momAjaxL.url,
1352                dataType: "html",
1353                data: "action=mom_ajaxsearch&nonce=" + momAjaxL.nonce + "&term=" + term,
1354                success: function() {
1355                    "" === sf.val() && sf.parent().parent().next(".ajax_search_results").html("")
1356                }
1357            })
1358        }, 300), !1
1359    })
1360}), jQuery(document).ready(function(e) {
1361    offset = "", jQuery("a.show-more-posts").click(function(a) {
1362        a.preventDefault();
1363        var t = e(this);
1364        style = t.data("style"), share = t.data("share"), count = t.data("count"), offset = t.data("offset"), display = t.data("display"), category = t.data("category"), tag = t.data("tag"), sort = t.data("sort"), orderby = t.data("orderby"), format = t.data("format"), excerpt_length = t.data("excerpt_length"), load_more_count = t.data("load_more_count"), exclude_cats = t.data("exclude_cats"), jQuery.ajax({
1365            type: "post",
1366            url: momAjaxL.url,
1367            dataType: "html",
1368            data: "action=mom_loadMore&nonce=" + momAjaxL.nonce + "&display=" + display + "&category=" + category + "&tag=" + tag + "&number_of_posts=" + count + "&sort=" + sort + "&orderby=" + orderby + "&offset=" + offset + "&format=" + format + "&excerpt_length=" + excerpt_length + "&style=" + style + "&share=" + share + "&load_more_count=" + load_more_count+ "&exclude_cats=" + exclude_cats,
1369            beforeSend: function() {
1370                t.find("i").addClass("fa-spin")
1371            },
1372            success: function(e) {
1373							if (style == 'g') {
1374								t.prev('.posts-grid').append(e);
1375							} else {
1376								t.before(e);
1377							}
1378							 t.find("i").removeClass("fa-spin"), "" === e && t.text(momAjaxL.nomore)
1379            }
1380        }), t.data("offset", offset + load_more_count), console.log(offset)
1381    })
1382}), jQuery(document).ready(function() {
1383    offset = "", offset_rest = "", jQuery(".nb-footer a.show-more-ajax").click(function(e) {
1384        e.preventDefault(), bt = jQuery(this), where = bt.parent().prev(), nbs = bt.data("nbs"), nop = bt.data("number_of_posts"), offset = bt.data("offset"), offset_rest = offset + 1, post_type = bt.data("post_type"), display = bt.data("display"), category = bt.data("category"), tag = bt.data("tag"), sort = bt.data("sort"), orderby = bt.data("orderby"), exclude_cats = bt.data("exclude_cats"), format = "", image_size = "", excerpt_length = "", "news_list" === nbs && (format = bt.data("format"), image_size = bt.data("image_size"), excerpt_length = bt.data("excerpt_length")), jQuery.ajax({
1385            type: "post",
1386            url: momAjaxL.url,
1387            dataType: "html",
1388            data: "action=nbsm&nonce=" + momAjaxL.nonce + "&display=" + display + "&category=" + category + "&tag=" + tag + "&nbs=" + nbs + "&number_of_posts=" + nop + "&sort=" + sort + "&orderby=" + orderby + "&offset=" + offset + "&offset_all=" + offset_rest + "&format=" + format + "&image_size=" + image_size + "&excerpt_length=" + excerpt_length + "&post_type=" + post_type+ "&exclude_cats=" + exclude_cats,
1389            beforeSend: function() {
1390                where.append('<i class="nb-load"></i>')
1391            },
1392            success: function(e) {
1393                "" == e && bt.parent().append('<a class="nomoreposts">' + momAjaxL.nomore + "</a>").hide().fadeIn(), "" !== e && where.html(e), where.find(".nb-load").remove()
1394            },
1395            complete: function() {}
1396        }), bt.data("offset", offset + (nop + 1))
1397    })
1398}), jQuery(document).ready(function(e) {
1399    jQuery(".weather-form").submit(function() {
1400        return form = jQuery(this), city = form.find("input").val(), lang = form.find("input").data("lang"), units = form.find("input").data("units"), jQuery.ajax({
1401            type: "post",
1402            url: momAjaxL.url,
1403            dataType: "html",
1404            data: "action=mom_ajaxweather&nonce=" + momAjaxL.nonce + "&city=" + city + "&lang=" + lang + "&units=" + units,
1405            beforeSend: function() {
1406                form.find(".sf-loading").fadeIn()
1407            },
1408            success: function(a) {
1409                "" !== city && ("" !== a ? (form.nextAll(".weather-widget").html(a).hide().fadeIn(), form.next(".message-box").fadeOut()) : (form.next(".message-box").remove(), form.after('<span class="message-box error">' + momAjaxL.werror + '<i class="brankic-icon-error"></i></span>'))), form.find(".sf-loading").fadeOut(), e(".message-box i").on("click", function() {
1410                    e(this).parent().fadeOut()
1411                })
1412            }
1413        }), !1
1414    })
1415});
1416
1417// email valid
1418function mom_isValidEmailAddress(emailAddress) {
1419    var pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i);
1420    return pattern.test(emailAddress);
1421};
1422
1423/*!
1424 * imagesLoaded PACKAGED v3.1.8
1425 * JavaScript is all like "You images are done yet or what?"
1426 * MIT License
1427 */
1428
1429(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1
1429);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit
1429("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});
1430
1431/*
1432    JQuery Advanced News Ticker 1.0.11 (20/02/14)
1433    created by risq
1434    website (docs & demos) : http://risq.github.io/jquery-advanced-news-ticker/
1435*/
1436(function(b,k,l,m){function g(a,f){this.element=a;this.$el=b(a);this.options=b.extend({},c,f);this._defaults=c;this._name=d;this.moveInterval;this.moving=this.paused=this.state=0;(this.$el.is("ul")||this.$el.is("ol"))&&this.init()}var d="newsTicker",c={row_height:20,max_rows:3,speed:400,duration:2500,direction:"up",autostart:1,pauseOnHover:1,nextButton:null,prevButton:null,startButton:null,stopButton:null,hasMoved:function(){},movingUp:function(){},movingDown:function(){},start:function(){},stop:function(){},
1437pause:function(){},unpause:function(){}};g.prototype={init:function(){this.$el.height(this.options.row_height*this.options.max_rows).css({overflow:"hidden"});this.checkSpeed();this.options.nextButton&&"undefined"!==typeof this.options.nextButton[0]&&this.options.nextButton.click(function(a){this.moveNext();this.resetInterval()}.bind(this));this.options.prevButton&&"undefined"!==typeof this.options.prevButton[0]&&this.options.prevButton.click(function(a){this.movePrev();this.resetInterval()}.bind(this));
1438this.options.stopButton&&"undefined"!==typeof this.options.stopButton[0]&&this.options.stopButton.click(function(a){this.stop()}.bind(this));this.options.startButton&&"undefined"!==typeof this.options.startButton[0]&&this.options.startButton.click(function(a){this.start()}.bind(this));this.options.pauseOnHover&&this.$el.hover(function(){this.state&&this.pause()}.bind(this),function(){this.state&&this.unpause()}.bind(this));this.options.autostart&&this.start()},start:function(){this.state||(this.state=
14391,this.resetInterval(),this.options.start())},stop:function(){this.state&&(clearInterval(this.moveInterval),this.state=0,this.options.stop())},resetInterval:function(){this.state&&(clearInterval(this.moveInterval),this.moveInterval=setInterval(function(){this.move()}.bind(this),this.options.duration))},move:function(){this.paused||this.moveNext()},moveNext:function(){"down"===this.options.direction?this.moveDown():"up"===this.options.direction&&this.moveUp()},movePrev:function(){"down"===this.options.direction?
1440this.moveUp():"up"===this.options.direction&&this.moveDown()},pause:function(){this.paused||(this.paused=1);this.options.pause()},unpause:function(){this.paused&&(this.paused=0);this.options.unpause()},moveDown:function(){this.moving||(this.moving=1,this.options.movingDown(),this.$el.children("li:last").detach().prependTo(this.$el).css("marginTop","-"+this.options.row_height+"px").animate({marginTop:"0px"},this.options.speed,function(){this.moving=0;this.options.hasMoved()}.bind(this)))},moveUp:function(){if(!this.moving){this.moving=
14411;this.options.movingUp();var a=this.$el.children("li:first");a.animate({marginTop:"-"+this.options.row_height+"px"},this.options.speed,function(){a.detach().css("marginTop","0").appendTo(this.$el);this.moving=0;this.options.hasMoved()}.bind(this))}},updateOption:function(a,b){"undefined"!==typeof this.options[a]&&(this.options[a]=b,"duration"==a||"speed"==a)&&(this.checkSpeed(),this.resetInterval())},add:function(a){this.$el.append(b("<li>").html(a))},getState:function(){return paused?2:this.state},
1442checkSpeed:function(){this.options.duration<this.options.speed+25&&(this.options.speed=this.options.duration-25)},destroy:function(){this._destroy()}};b.fn[d]=function(a){var f=arguments;return this.each(function(){var c=b(this),e=b.data(this,"plugin_"+d),h="object"===typeof a&&a;e||c.data("plugin_"+d,e=new g(this,h));"string"===typeof a&&e[a].apply(e,Array.prototype.slice.call(f,1))})}})(jQuery,window,document);
1443/*!
1444 * jquery.okayNav.js 2.0.4 (https://github.com/VPenkov/okayNav)
1445 * Author: Vergil Penkov (http://vergilpenkov.com/)
1446 * MIT license: https://opensource.org/licenses/MIT
1447 */
1448!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(n,i){return void 0===i&&(i="undefined"!=typeof window?require("jquery"):require("jquery")(n)),e(i),i}:e(jQuery)}(function(e){function n(n,i){self=this,this.options=e.extend({},s,i),self.options=this.options,self.navigation=e(n),self.document=e(document),self.window=e(window),""==this.options.parent?this.options.parent=self.navigation.parent():"",self.nav_open=!1,self.parent_full_width=0,self.radCoef=180/Math.PI,self.sTouch={x:0,y:0},self.cTouch={x:0,y:0},self.sTime=0,self.nav_position=0,self.percent_open=0,self.nav_moving=!1,self.init()}var i="okayNav",s={parent:"",toggle_icon_class:"okayNav__menu-toggle",toggle_icon_content:"<span /><span /><span />",align_right:!0,swipe_enabled:!0,threshold:50,resize_delay:10,beforeOpen:function(){},afterOpen:function(){},beforeClose:function(){},afterClose:function(){},itemHidden:function(){},itemDisplayed:function(){}};n.prototype={init:function(){e("body").addClass("okayNav-loaded"),self.navigation.addClass("okayNav loaded").children("ul").addClass("okayNav__nav--visible"),self.options.align_right?self.navigation.append('<ul class="okayNav__nav--invisible transition-enabled nav-right" />').append('<a href="#" class="'+self.options.toggle_icon_class+' okay-invisible">'+self.options.toggle_icon_content+"</a>"):self.navigation.prepend('<ul class="okayNav__nav--invisible transition-enabled nav-left" />').prepend('<a href="#" class="'+self.options.toggle_icon_class+' okay-invisible">'+self.options.toggle_icon_content+"</a>"),self.nav_visible=self.navigation.children(".okayNav__nav--visible"),self.nav_inv
1448isible=self.navigation.children(".okayNav__nav--invisible"),self.toggle_icon=self.navigation.children("."+self.options.toggle_icon_class),self.toggle_icon_width=self.toggle_icon.outerWidth(!0),self.default_width=self.getChildrenWidth(self.navigation),self.parent_full_width=e(self.options.parent).outerWidth(!0),self.last_visible_child_width=0,self.initEvents(),self.nav_visible.contents().filter(function(){return this.nodeType=Node.TEXT_NODE&&/\S/.test(this.nodeValue)===!1}).remove(),1==self.options.swipe_enabled&&self.initSwipeEvents()},initEvents:function(){self.document.on("click.okayNav",function(n){var i=e(n.target);self.nav_open===!0&&0==i.closest(".okayNav").length&&self.closeInvisibleNav(),i.hasClass(self.options.toggle_icon_class)&&(n.preventDefault(),self.toggleInvisibleNav())});var n=self._debounce(function(){self.recalcNav()},self.options.recalc_delay);self.window.on("load.okayNav resize.okayNav",n)},initSwipeEvents:function(){self.document.on("touchstart.okayNav",function(n){if(self.nav_invisible.removeClass("transition-enabled"),1==n.originalEvent.touches.length){var i=n.originalEvent.touches[0];(i.pageX<25&&0==self.options.align_right||i.pageX>e(self.options.parent).outerWidth(!0)-25&&1==self.options.align_right||self.nav_open===!0)&&(self.sTouch.x=self.cTouch.x=i.pageX,self.sTouch.y=self.cTouch.y=i.pageY,self.sTime=Date.now())}}).on("touchmove.okayNav",function(e){var n=e.originalEvent.touches[0];self._triggerMove(n.pageX,n.pageY),self.nav_moving=!0}).on("touchend.okayNav",function(e){self.sTouch={x:0,y:0},self.cTouch={x:0,y:0},self.sTime=0,self.percent_open>100-self.options.threshold?(self.nav_position=0,self.closeInvisibleNav()):1==self.nav_moving&&(self.nav_position=self.nav_invisible.width(),self.openInvisibleNav()),self.nav_moving=!1,self.nav_invisible.addClass("transition-enabled")})},_getDirection:function(e){return self.options.align_right?e>0?-1:1:0>e?-1:1},_triggerMove:function(e,n){self.cTouch.x=e,self.cTouch.y=n;var i=Date.now(),s=self.cTouch.x-self.sTouch.x,l=self.cTouch.y-self.sTouch.y,t=l*l,o=Math.sqrt(s*s+t),a=Math.sqrt(t),f=Math.asin(Math.sin(a/o))*self.radCoef;o/(i-self.sTime);if(self.sTouch.x=e,self.sTouch.y=n,20>f){var v=self._getDirection(s),c=self.nav_position+v*o,r=self.nav_invisible.width(),d=0;0>c?d=-c:c>r&&(d=r-c);var _=r-(self.nav_position+v*o+d),p=_/r*100;self.nav_position+=v*o+d,self.percent_open=p,self.nav_invisible.css("transform","translateX("+(self.options.align_right?1:-1)*p+"%)")}},getParent:function(){return self.options.parent},getVisibleNav:function(){return self.nav_visible},getInvisibleNav:function(){return self.nav_invisible},getNavToggleIcon:function(){return self.toggle_icon},_debounce:function(e,n,i){var s;return function(){var l=this,t=arguments,o=function(){s=null,i||e.apply(l,t)},a=i&&!s;clearTimeout(s),s=setTimeout(o,n),a&&e.apply(l,t)}},openInvisibleNav:function(){self.options.enable_swipe?"":self.options.beforeOpen.call(),self.toggle_icon.addClass("icon--active"),self.nav_invisible.addClass("nav-open"),self.nav_open=!0,self.nav_invisible.css({"-webkit-transform":"translateX(0%)",transform:"translateX(0%)"}),self.options.afterOpen.call()},closeInvisibleNav:function(){self.options.enable_swipe?"":self.options.beforeClose.call(),self.toggle_icon.removeClass("icon--active"),self.nav_invisible.removeClass("nav-open"),self.options.align_right?self.nav_invisible.css({"-webkit-transform":"translateX(100%)",transform:"translateX(100%)"}):self.nav_invisible.css({"-webkit-transform":"translateX(-100%)",transform:"translateX(-100%)"}),self.nav_open=!1,self.options.afterClose.call()},toggleInvisibleNav:function(){self.nav_open?self.closeInvisibleNav():self.openInvisibleNav()},getChildrenWidth:function(n){for(var i=0,s=e(n).children(),l=0;l<s.length;l++)i+=e(s[l]).outerWidth(!0);return i},getVisibleItemCount:function(){return e("li",self.nav_visible).length},getHiddenItemCount:function(){return e("li",self.nav_invisible).length},recalcNav:function(){var n=e(self.options.parent).outerWidth(!0),i=self.getChildrenWidth(self.options.parent),s=self.navigation.outerWidth(!0),l=self.getVisibleItemCount(),t=self.nav_visible.outerWidth(!0)+self.toggle_icon_width,o=i+self.last_visible_child_width+self.toggle_icon_width,a=i-s+self.default_width;return n>a?(self._expandAllItems(),void self.toggle_icon.addClass("okay-invisible")):(l>0&&t>=s&&o>
1448=n&&self._collapseNavItem(),n>o+self.toggle_icon_width+15&&self._expandNavItem(),void(0==self.getHiddenItemCount()?self.toggle_icon.addClass("okay-invisible"):self.toggle_icon.removeClass("okay-invisible")))},_collapseNavItem:function(){var n=e("li:last-child",self.nav_visible);self.last_visible_child_width=n.outerWidth(!0),self.document.trigger("okayNav:collapseItem",n),n.detach().prependTo(self.nav_invisible),self.options.itemHidden.call(),self.recalcNav()},_expandNavItem:function(){var n=e("li:first-child",self.nav_invisible);self.document.trigger("okayNav:expandItem",n),n.detach().appendTo(self.nav_visible),self.options.itemDisplayed.call()},_expandAllItems:function(){e("li",self.nav_invisible).detach().appendTo(self.nav_visible),self.options.itemDisplayed.call()},_collapseAllItems:function(){e("li",self.nav_visible).detach().appendTo(self.nav_invisible),self.options.itemHidden.call()},destroy:function(){e("li",self.nav_invisible).appendTo(self.nav_visible),self.nav_invisible.remove(),self.nav_visible.removeClass("okayNav__nav--visible"),self.toggle_icon.remove(),self.document.unbind(".okayNav"),self.window.unbind(".okayNav")}},e.fn[i]=function(s){var l=arguments;if(void 0===s||"object"==typeof s)return this.each(function(){e.data(this,"plugin_"+i)||e.data(this,"plugin_"+i,new n(this,s))});if("string"==typeof s&&"_"!==s[0]&&"init"!==s){var t;return this.each(function(){var o=e.data(this,"plugin_"+i);o instanceof n&&"function"==typeof o[s]&&(t=o[s].apply(o,Array.prototype.slice.call(l,1))),"destroy"===s&&e.data(this,"plugin_"+i,null)}),void 0!==t?t:this}}});

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.