PageSourceSearch

https://festivalvallenato.com/wp-content/themes/embrad/assets/js/theme.js?ver=1.0

js festivalvallenato.com collected 2026-10-02 12:19:05 UTC 73,442 bytes, 1,898 lines download raw bytes

1/*
2 * Embrad Theme Js 
3 */ 
4
5(function( $ ) {
6
7	"use strict";
8		  
9	$( document ).ready(function() {
10	
11		/* Page Loader */
12		$( window ).load(function() {
13			$(".page-loader").fadeOut("slow");
14		});
15		
16		/* Set Header Height */
17		var $window = $(window);
18		var $header_cont = $('.portfolio-single-wrapper .portfolio-single-slide .item');
19		$header_cont.height( $window.height() );
20		$window.resize(function() {
21			$header_cont.height( $window.height() );
22		});
23		
24		/* Shortcode CSS Append */
25		var css_out = '';
26		if( $( ".embrad-inline-css" ).length ){
27			$( ".embrad-inline-css" ).each(function() {
28				var shortcode = $( this );
29				var shortcode_css = shortcode.attr("data-css");		
30				css_out += ($).parseJSON( shortcode_css );
31				shortcode.removeAttr("data-css");
32			});
33		}
34		
35		/* VC Row Custom Style */
36		if( $( ".embrad-vc-row" ).length ){
37			$( ".embrad-vc-row" ).each(function() {
38				var shortcode = $( this );
39				var row_class = shortcode.attr("data-class");
40				if( shortcode.attr("data-color") ){
41					var row_color = shortcode.attr("data-color");		
42					css_out += "." + row_class + "{ color:" + row_color + ";}"; 
43					shortcode.removeAttr("data-color");
44				}
45				if( shortcode.attr("data-bg-overlay") ){
46					var row_overlay = shortcode.attr("data-bg-overlay");
47					css_out += "." + row_class + "{ position: relative; }";
48					css_out += "." + row_class + " > span.row-overlay { background-color:" + row_overlay + ";}";
49					shortcode.removeAttr("data-bg-overlay");				
50				}
51				shortcode.removeAttr("data-class");
52			});
53		}
54		//If custom styles 
55		if( css_out != '' ){
56			$('head').append( '<style id="embrad-shortcode-styles">'+ css_out +'</style>' );
57		}
58			
59
60		/* Secondary Toggle */
61		if( $( ".secondary-space-toggle" ).length ){
62			$( document ).on( "click", ".secondary-space-toggle", function() {
63				$('.secondary-space-toggle').toggleClass('active');
64				$('body').toggleClass('secondary-active');
65				var sec_width = $( ".secondary-menu-area" ).width();
66				var sec_pos = $( ".secondary-menu-area" ).data('pos') ? $( ".secondary-menu-area" ).data('pos') : 'left';
67				
68				if( sec_pos == 'overlay' ){
69					$( ".secondary-menu-area" ).fadeToggle(500);
70				}else if( $('body').hasClass('secondary-active') ){
71					if( sec_pos == 'left' ){
72						if( $( ".secondary-menu-area" ).hasClass('left-overlay') ){
73							$( ".secondary-menu-area" ).animate( { left : "0" }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } );
74						}else{
75							$('body').toggleClass('secondary-push-actived');
76							$( ".secondary-menu-area" ).animate( { left : "0" }, { duration: 500 } );
77							$( "body" ).css('overflow','hidden');
78							$( "body .embrad-wrapper" ).animate( { left : sec_width +"px" }, 500 );
79							if( $( ".sticky-outer" ).length ) {
80								$( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { left : sec_width +"px", right: "-" + sec_width +"px" }, 500 );
81							}
82						}
83					}else{
84						if( $( ".secondary-menu-area" ).hasClass('right-overlay') ){
85							$( ".secondary-menu-area" ).animate( { right : "0" }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } );
86						}else{
87							$('body').toggleClass('secondary-push-actived');
88							$( ".secondary-menu-area" ).animate( { right : "0" }, { duration: 500 } );
89							$( "body" ).css('overflow','hidden');
90							$( "body .embrad-wrapper" ).animate( { right : sec_width +"px" }, 500 );
91							if( $( ".sticky-outer" ).length ){
92								$( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { right : sec_width +"px", left : "-" + sec_width +"px" }, 500 );
93							}
94						}
95					}
96				}else{
97					if( sec_pos == 'left' ){
98						if( $( ".secondary-menu-area" ).hasClass('left-overlay') ){
99							$( ".secondary-menu-area" ).animate( { left : "-"+ sec_width +"px" }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } );
100						}else{
101							$('body').toggleClass('secondary-push-actived');
102							$( ".secondary-menu-area" ).animate( { left : "-"+ sec_width +"px" }, { duration: 500 } );
103							$( "body .embrad-wrapper" ).animate( { left : 0 }, 500, function(){ $( "body" ).css('overflow-y','scroll'); } );
104							if( $( ".sticky-outer" ).length ){
105								$( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { left : 0, right: 0 }, 500 );
106							}
107						}
108					}else{
109						if( $( ".secondary-menu-area" ).hasClass('right-overlay') ){
110							$( ".secondary-menu-area" ).animate( { right : "-"+ sec_width +"px" }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } );
111						}else{
112							$('body').toggleClass('secondary-push-actived');
113							$( ".secondary-menu-area" ).animate( { right : "-"+ sec_width +"px" }, { duration: 500 } );
114							$( "body .embrad-wrapper" ).animate( { right : 0 }, 500, function(){ $( "body" ).css('overflow-y','scroll'); } );
115							if( $( ".sticky-outer" ).length ){
116								$( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { right: 0, left : 0 }, 500 );
117							}
118						}
119					}
120				}
121				
122				/* Slider Revolution Issue Fixed */
123				if( $(".rev_slider_wrapper").length ){
124					$(".rev_slider_wrapper").css("left" , "inherit");    
125				}
126				
127				return false;
128			});
129		}
130		
131		/* Header Bar Center Item Margin Fun */
132		setTimeout( embradCenterMenuMargin, 300 );
133		
134		/* Set Sticky Height for Menu Bars */
135		embradSetStickyOuterHeight();
136		
137		/* Sticky Menu */
138		if($('.header-inner .sticky-head').length){
139			embradStickyPart( '.header-inner' );
140		}
141		
142		/* Scroll Sticky */
143		if($('.header-inner .sticky-scroll').length){
144			embradStickyScrollUpPart( '.header-inner', 'header' );
145		}
146		
147		/* Mobile Header Sticky Menu */
148		if($('.mobile-header-inner .sticky-head').length){
149			embradStickyPart( '.mobile-header-inner' );
150		}
151		
152		/* Mobile Header Scroll Sticky */
153		if($('.mobile-header-inner .sticky-scroll').length){
154			embradStickyScrollUpPart( '.mobile-header-inner', '.mobile-header' );
155		}
156		
157		/* Sticky Header Space Menu to Modern Toggle Menu Convert */
158		if( $('.sticky-header-space').length ){
159			
160			//Add toggle dropdown icon
161			$( ".sticky-header-space .embrad-main-menu" ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle fa fa-caret-down"></span>' );
162			$( ".sticky-header-space .embrad-main-menu" ).find('.sub-menu').slideToggle();
163			
164			//zmm dropdown toggle
165			$( ".sticky-header-space .zmm-dropdown-toggle" ).on( "click", function() {
166				var parent = $( this ).parent('li').children('.sub-menu');
167				$( this ).parent('li').children('.sub-menu').slideToggle();
168				$( this ).toggleClass('fa-caret-up');
169				if( $( parent ).find('.sub-menu').length ){
170					$( parent ).find('.sub-menu').slideUp();
171					$( parent ).find('.zmm-dropdown-toggle').removeClass('fa-caret-up');
172				}
173			});
174			
175		}
176		
177		/* Full Search Toggle */
178		if( $( ".full-search-toggle" ).length ){
179			$( document ).on( "click", ".full-search-toggle", function() {
180				$('.full-search-wrapper').toggleClass("search-wrapper-opened");
181				$('.full-search-wrapper').fadeToggle(500);
182				var search_in = $('.search-wrapper-opened').find("input.form-control");
183				search_in.focus();			
184				return false;
185			});	
186		}
187		
188		/* Mobile Bar Animate Toggle */
189		if( $( ".mobile-bar-toggle" ).length ){
190			$( document ).on( "click", ".mobile-bar-toggle", function() {
191				$( ".mobile-bar" ).toggleClass('active');
192				$( "body" ).toggleClass('mobile-bar-active');
193				if( $( ".mobile-bar" ).hasClass('animate-from-left') ){
194					if( $( ".mobile-bar" ).hasClass('active') )
195						$( ".mobile-bar" ).animate( { left : 0 }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } );
196					else
197						$( ".mobile-bar" ).animate( { left : "-100%" }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } );
198				}
199				if( $( ".mobile-bar" ).hasClass('animate-from-right') ){
200					if( $( ".mobile-bar" ).hasClass('active') )
201						$( ".mobile-bar" ).animate( { right : 0 }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } );
202					else
203						$( ".mobile-bar" ).animate( { right : "-100%" }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } );
204				}
205				if( $( ".mobile-bar" ).hasClass('animate-from-top') ){
206					if( $( ".mobile-bar" ).hasClass('active') )
207						$( ".mobile-bar" ).animate( { top : 0 }, { duration: 500, specialEasing: { top: "easeInOutExpo" } } );
208					else
209						$( ".mobile-bar" ).animate( { top : "-100%" }, { duration: 500, specialEasing: { top: "easeInOutExpo" } } );
210				}
211				if( $( ".mobile-bar" ).hasClass('animate-from-bottom') ){
212					if( $( ".mobile-bar" ).hasClass('active') )
213						$( ".mobile-bar" ).animate( { bottom : 0 }, { duration: 500, specialEasing: { bottom: "easeInOutExpo" } } );
214					else
215						$( ".mobile-bar" ).animate( { bottom : "-100%" }, { duration: 500, specialEasing: { bottom: "easeInOutExpo" } } );
216				}
217				return false;
218			});
219		}
220		
221		/* Mobile Bar Menu to Modern Toggle Menu Convert */
222		if( $('.mobile-bar').length ){
223			
224			if( $( ".embrad-main-menu" ).length || $( ".secondary-menu-area-inner ul.menu" ).length ){
225			
226				var main_menu = ".embrad-main-menu";
227				if( !$( ".embrad-main-menu" ).length ){
228					$( ".secondary-menu-area-inner ul.menu" ).addClass( "embrad-main-menu" );
229				}
230				
231				var mobile_menu = ".mobile-bar .embrad-mobile-main-menu";
232				var find_classes = ".dropdown, .mega-dropdown, .dropdown-toggle, .dropdown-menu, .mega-dropdown-menu, .mega-child-heading, .mega-child-dropdown, .mega-child-dropdown-menu, .hidden-xs-up, .row, .mega-sub-dropdown, .mega-sub-dropdown-menu, .mega-sub-child, .mega-sub-child-inner, .left-side";
233				var removable_classes = "dropdown mega-dropdown dropdown-toggle dropdown-menu mega-dropdown-menu mega-child-heading mega-child-dropdown mega-child-dropdown-menu hidden-xs-up row mega-sub-dropdown mega-sub-dropdown-menu mega-sub-child mega-sub-child-inner left-side";
234				
235				//Mobile menu copy from main menu
236				$(main_menu).clone().appendTo( mobile_menu );
237				
238				//Add main class name
239				$( mobile_menu + " " + main_menu ).addClass( "flex-column" );
240				
241				//Remove unwanted item from mobile menu
242				$( mobile_menu + " .mega-child-widget" ).parent( "li.menu-item" ).remove();
243				$( mobile_menu + " .mega-child-divider" ).remove();
244				$( mobile_menu + " .menu-item-logo" ).remove();
245				$( mobile_menu + " li.menu-item" ).removeClass (function (index, css) {
246					return ( css.match (/\bcol-\S+/g) || [] ).join(' ');
247
248				});
249				$( mobile_menu + " li.menu-item" ).removeClass (function (index, css) {
250					return ( css.match (/\bmax-col-\S+/g) || [] ).join(' ');
251				});
252				
253				//Change class name
254				$( mobile_menu ).find( ".dropdown-menu, .mega-child-dropdown-menu, .mega-sub-child-inner" ).toggleClass( "sub-menu" );
255				
256				//Content reform
257				$( mobile_menu + " .mega-child-item-disabled" ).replaceWith( "<a class='nav-link' href='#'>" + $( mobile_menu + " .mega-child-item-disabled" ).html() + "</a>" );
258				
259				//Remove unwanted classes
260				$( mobile_menu ).find( find_classes ).removeClass( removable_classes );
261				
262				//Remove Background
263				$( mobile_menu + " .sub-menu" ).css('background','none');
264				
265				//Add toggle dropdown icon
266				$( ".mobile-bar " + main_menu ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle fa fa-caret-down"></span>' );
267				$( ".mobile-bar " + main_menu ).find('.sub-menu').slideToggle();
268				
269				$( ".mobile-bar " + main_menu ).removeClass('embrad-main-menu').addClass('embrad-mobile-menu');
270				
271				//dropdown toggle
272				$( ".mobile-bar .zmm-dropdown-toggle" ).on( "click", function() {
273					var parent = $( this ).parent('li').children('.sub-menu');
274					$( this ).parent('li').children('.sub-menu').slideToggle();
275					$( this ).toggleClass('fa-caret-up');
276					if( $( parent ).find('.sub-menu').length ){
277						$( parent ).find('.sub-menu').slideUp();
278						$( parent ).find('.zmm-dropdown-toggle').removeClass('fa-caret-up');
279					}
280				});
281			}// check page have main menu or not
282			
283		}
284		
285		/* Mobile Bar Menu to Modern Toggle Menu Convert */
286		if( $('.secondary-menu-area-inner ul.menu').length ){
287				
288				var sec_menu = ".secondary-menu-area-inner ul.menu";
289				//Add main class name
290				$( sec_menu ).addClass( "flex-column" );
291				
292				//Add toggle dropdown icon
293				$( sec_menu ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle fa fa-caret-down"></span>' );
294				$( sec_menu ).find('.sub-menu').slideToggle();
295				
296				//dropdown toggle
297				$( sec_menu + " .zmm-dropdown-toggle" ).on( "click", function() {
298					var parent = $( this ).parent('li').children('.sub-menu');
299					$( this ).parent('li').children('.sub-menu').slideToggle();
300					$( this ).toggleClass('fa-caret-up');
301					if( $( parent ).find('.sub-menu').length ){
302						$( parent ).find('.sub-menu').slideUp();
303						$( parent ).find('.zmm-dropdown-toggle').removeClass('fa-caret-up');
304					}
305				});
306			
307		}
308		
309		/* Twitter Widget Slider(newsticker) */
310		if( $( ".twitter-slider" ).length ){
311			$( ".twitter-slider" ).each(function() {
312				var twit_slider = $(this);	
313				var slide = twit_slider.attr( "data-show" );
314				twit_slider.easyTicker({
315					direction: 'up',
316					visible: parseInt(slide),
317					easing: 'swing',
318					interval: 4000
319				});
320			});
321		}
322		
323		/* Menu Scroll */
324		var cur_offset = 0;
325		
326		var o_stat = 0; // One Page Menu Status
327		$( '.embrad-main-menu li.menu-item, .embrad-mobile-menu li.menu-item' ).each(function( index ) {
328			var cur_item = this;
329			var target = $(cur_item).children("a").attr("href");
330			if( target && target.indexOf("#section-") != -1 ){
331				o_stat = 1;
332				var res = target.split("#");
333				if( res.length == 2 ){
334					$(cur_item).children("a").attr("data-target", res[0]);
335					$(cur_item).children("a").attr("href", "#"+res[1]);
336				}	
337			}
338		});
339		
340		if( o_stat ){
341		
342			if( $('.embrad-main-menu .menu-item').find('a[href="#section-top"]').length ){
343				$("body").attr("id","section-top");
344			}
345			
346			$( '.embrad-main-menu li.menu-item, .embrad-mobile-menu li.menu-item' ).removeClass("current-menu-item");
347			
348			$(window).bind('scroll', function () {
349				var minus_height = $("#wpadminbar").length ? $("#wpadminbar").outerHeight() : 0;
350				minus_height += $(".embrad-header .sticky-outer").length ? $(".embrad-header .sticky-outer").outerHeight() : 0;
351				minus_height += 10;
352				$('.vc_row[id*="section-"], body').each(function () {
353					var anchored = $(this).attr("id"),
354						targetOffset = $(this).offset().top - minus_height;
355						
356					if ($(window).scrollTop() > targetOffset) {
357						$('.embrad-main-menu .menu-item').find("a").removeClass("active");
358						$('.embrad-main-menu .menu-item').find('a[href="#'+ anchored +'"]').addClass("active");
359						
360						//Mobile menu scroll spy active
361						$('.embrad-mobile-menu .menu-item').find("a").removeClass("active");
362						$('.embrad-mobile-menu .menu-item').find('a[href="#'+ anchored +'"]').addClass("active");
363					}
364				});
365			});
366			
367			$( '.embrad-main-menu .menu-item > a[href^="#section-"], .embrad-mobile-main-menu .menu-item > a[href^="#section-"]' ).on('click',function (e) {
368				
369				var cur_item = this;
370				var target = $(cur_item).attr("href");
371				
372				if( $(cur_item).parents(".embrad-mobile-main-menu").length ) {
373					$(".mobile-bar-toggle.close").trigger( "click" );
374				}
375				if( $( ".secondary-menu-area" ) ){
376					$( ".secondary-menu-area .secondary-space-toggle.active" ).trigger( "click" );
377				}
378				
379				var target_id = target.slice( target.indexOf("#"), ( target.length ) );
380				var cur_url = location.protocol + '//' + location.host + location.pathname; //window.location.href;
381				var data_targ = $(cur_item).attr("data-target");
382				var another_page = false;
383				if( target_id == '#section-top' && data_targ != '' ){
384					if( cur_url != data_targ ){
385						another_page = true;
386					}
387				}
388				
389				if( $( target_id ).length && !another_page ){
390					var offs = $(target_id).offset().top;
391					
392					var hght_ele;
393					if( $(".mobile-header").height() ){
394						hght_ele = $(".mobile-header .sticky-head");
395					}else {
396						hght_ele = $(".embrad-header .sticky-head");
397					}
398					
399					var sticky_head_hgt = hght_ele.outerHeight();
400					if( hght_ele.length ){
401						offs = offs - parseInt( sticky_head_hgt );
402					}
403					if( $( "#wpadminbar" ).length ) offs = offs - parseInt( $( "#wpadminbar" ).outerHeight() );
404					
405					var sec_ani_call = 1;
406					if( target_id == '#section-top' ){
407						sec_ani_call = 1;
408						offs = 0;
409					}
410					
411					$('html,body').animate({ 'scrollTop': offs }, 1000, 'easeInOutExpo', function() {
412						if( sticky_head_hgt != hght_ele.outerHeight() && sec_ani_call ){
413							sec_ani_call = 0;
414							var n_hgth = sticky_head_hgt - hght_ele.outerHeight();
415							offs += n_hgth;
416							$('html,body').animate({ 'scrollTop': offs }, 100, 'easeInOutExpo' );
417						}
418					 });
419					return false;
420				}else{
421						if( target_id == '#section-top' && cur_url == data_targ ){
422						$('html,body').animate({ 'scrollTop': 0 }, 1000, 'easeInOutExpo' );
423						return false;
424					}else{
425						if( cur_url != data_targ && target_id != '#' ){
426							window.location.href = data_targ + target;
427						}else{
428							window.location.href = target;
429						}
430					}
431				}
432			
433			});	
434			
435		}
436		
437		/*Back to top*/
438		if( $( ".back-to-top" ).length ){
439			$( document ).on('click', '#back-to-top', function(){
440				$('html,body').animate({ 'scrollTop': 0 }, 1000, 'easeInOutExpo' );
441				return false;
442			});
443			$( document ).scroll(function() {
444				var y = $( this ).scrollTop();
445				if ( y > 300 )
446					$( '#back-to-top' ).fadeIn();
447				else
448					$( '#back-to-top' ).fadeOut();
449			});
450		}
451		
452		/*Woo Cart Item Remove Through Ajax*/
453		if( $('.mini-cart-items').length ){
454			$( document ).on('click', '.remove-cart-item', function(){
455				var product_id = $(this).attr("data-product_id");
456				var loader_url = $(this).attr("data-url");
457				var main_parent = $(this).parents('li.menu-item.dropdown');
458				var parent_li = $(this).parents('li.cart-item');
459				parent_li.find('.product-thumbnail > .remove-item-overlay').css({'display':'block'});
460				$.ajax({
461					type: 'post',
462					dataType: 'json',
463					url: embrad_ajax_var.admin_ajax_url,
464					data: { action: "embrad_product_remove", 
465							product_id: product_id
466					},success: function(data){
467						main_parent.html( data["mini_cart"] );
468						$( document.body ).trigger( 'wc_fragment_refresh' );
469					},error: function(xhr, status, error) {
470						$('.mini-cart-items').children('ul.cart-dropdown-menu').html('<li class="cart-item"><p class="cart-update-pbm text-center">'+ embrad_ajax_var.cart_update_pbm +'</p></li>');
471					}
472				});
473				return false;
474			});	
475		}
476		if( $('.quantity').length ){
477			$('.quantity').on('click', '.plus', function(e) {
478				var input = $(this).parent('.quantity').children('input.qty');
479				var val = parseInt($(input).val());
480				var step = $(input).attr('step');
481				step = 'undefined' !== typeof(step) ? parseInt(step) : 1;
482				$(input).val( val + step ).change();
483				return false;
484			});
485			$('.quantity').on('click', '.minus', 
486				function(e) {
487				var input = $(this).parent('.quantity').children('input.qty');
488				var val = parseInt($(input).val());
489				var step = $(input).attr('step');
490				step = 'undefined' !== typeof(step) ? parseInt(step) : 1;
491				if (val > 0) {
492					$(input).val( val - step ).change();
493				}
494				return false;
495			});
496		}
497		
498		/* Top Sliding Bar */
499		if( $( ".top-sliding-bar" ).length ){
500			$( document ).on('click', '.top-sliding-toggle', function(){
501				$( ".top-sliding-bar-inner" ).slideToggle();
502				$( ".top-sliding-toggle" ).toggleClass( "fa-minus" );
503				return false;
504			});
505		}
506		
507		/* Sticky Header Space */
508		if( $('.sticky-header-space').length ){
509			var elem_pos = $('.sticky-header-space').hasClass('left-sticky') ? 'left' : 'right';
510			var elem_width = $('.sticky-header-space').outerWidth();
511			
512			embradStickyHeaderAdjust(elem_pos, elem_width);
513			$( window ).resize(function() {
514				embradStickyHeaderAdjust(elem_pos, elem_width);
515			});
516		}
517		
518		/* Toggle Search Modal Triggers */
519		if( $( ".textbox-search-toggle" ).length ){
520			$( document ).on('click', '.textbox-search-toggle', function(){
521				$(this).parents('.search-toggle-wrap').toggleClass('active');
522				return false;
523			});
524		}else if( $( ".full-bar-search-toggle" ).length ){
525			$( document ).on('click', '.full-bar-search-toggle', function(){
526				$('.full-bar-search-wrap').toggleClass('active');
527				return false;
528			});
529		}else if( $( ".bottom-search-toggle" ).length ){
530			$( document ).on('click', '.bottom-search-toggle', function(){
531				$(this).parents('.search-toggle-wrap').toggleClass('active');
532				return false;
533			});
534		}
535		
536		/* Sticky Footer */
537		if( $( ".footer-fixed" ).length ){
538			if( $( window ).width() > 767 ){
539				$( ".embrad-wrapper" ).css({ 'margin-bottom' : $( ".footer-fixed" ).outerHeight() + 'px' });
540			}else{
541				$( ".embrad-wrapper" ).css({ 'margin-bottom' : '0' });
542			}
543		}else if( $( ".footer-bottom-fixed" ).length ){
544			if( $( window ).width() > 767 ){
545				$( ".embrad-wrapper" ).css({ 'margin-bottom' : $( ".footer-bottom-fixed" ).outerHeight() + 'px' });
546			}else{
547				$( ".embrad-wrapper" ).css({ 'margin-bottom' : '0' });
548			}
549		}
550		$( window ).resize(function() {
551			if( $( ".footer-fixed" ).length ){
552				if( $( window ).width() > 767 ){
553					$( ".embrad-wrapper" ).css({ 'margin-bottom' : $( ".footer-fixed" ).outerHeight() + 'px' });
554				}else{
555					$( ".embrad-wrapper" ).css({ 'margin-bottom' : '0' });
556				}
557			}else if( $( ".footer-bottom-fixed" ).length ){
558				if( $( window ).width() > 767 ){
559					$( ".embrad-wrapper" ).css({ 'margin-bottom' : $( ".footer-bottom-fixed" ).outerHeight() + 'px' });
560				}else{
561					$( ".embrad-wrapper" ).css({ 'margin-bottom' : '0' });
562				}
563			}
564		});							
565		
566		/* Stellar Parallax */
567		if( $( ".parallax-item" ).length ){
568			$.stellar({
569				horizontalScrolling: false,
570				verticalOffset: 40
571			});
572		}
573		
574		/* Embrad Tooltip */
575		if( $('[data-tooltip]').length ){
576			embradTooltipUpdate();			
577		}
578		
579		if( $('[data-toggle="tab"]').length ){
580			$( document ).on( 'click', '[data-toggle="tab"]', function(e) {
581				e.preventDefault();
582				var cur_tab = $(this);
583				var targ = cur_tab.attr("href");
584				var tab_parent = cur_tab.parents(".embrad-tabs-wrapper");
585				tab_parent.find(".tab-content > .tab-pane").removeClass("active show");
586				tab_parent.find(targ).addClass("active show");
587				tab_parent.find(".nav-tabs").find("a.active").removeClass("active");
588				cur_tab.addClass("active");
589			});
590		}
591		
592		/* Post Like */
593		if( $( ".post-like, .post-dislike" ).length ){
594			$( document ).on( 'click', ".post-like, .post-dislike", function( event) {
595		
596				var current = $(this);
597				var like_stat = current.data("stat");
598				var post_id = current.data("id");
599				var parent = current.parents('.post-like-wrap');
600
601				if( like_stat != '' ){
602					
603					if( like_stat == '1' ){
604						parent.find('.post-disliked').removeClass('fa-thumbs-down post-disliked').addClass('fa-thumbs-o-down post-dislike');
605						current.removeClass('fa-thumbs-o-up post-like').addClass('fa-thumbs-up post-liked');
606					}else{
607						parent.find('.post-liked').removeClass('fa-thumbs-up post-liked').addClass('fa-thumbs-o-up post-like');
608						current.removeClass('fa-thumbs-o-down post-dislike').addClass('fa-thumbs-down post-disliked');
609					}
610					
611					// Ajax call
612					$.ajax({
613						type: "post",
614						url: embrad_ajax_var.admin_ajax_url,
615						data: "action=post_like_act&nonce="+embrad_ajax_var.like_nonce+"&like_stat="+like_stat+"&post_id="+post_id,
616						success: function(res){
617							$( parent ).html(res);
618							embradTooltipUpdate();
619						},
620						error: function (jqXHR, exception) {
621							console.log(jqXHR);
622						}
623					});
624				}
625				return false;
626			});
627		}
628		$( document ).on( 'click', ".post-liked, .post-disliked, .post-fav-done", function( event) {
629			return false;
630		});															 
631																		 
632		
633		/* Post Favourite */
634		if( $( ".post-favourite" ).length ){
635			$( document ).on( 'click', ".post-favourite", function( event) {
636		
637				var current = $(this);
638				var post_id = current.data("id");
639				var parent = current.parents('.post-fav-wrap');
640
641				if( post_id != '' ){
642					// Ajax call
643					$.ajax({
644						type: "post",
645						url: embrad_ajax_var.admin_ajax_url,
646						data: "action=post_fav_act&nonce="+embrad_ajax_var.fav_nonce+"&post_id="+post_id,
647						success: function(res){
648							$( parent ).html(res);
649						},
650						error: function (jqXHR, exception) {
651							console.log(jqXHR);
652						}
653					});
654				}
655				return false;
656			});
657		}
658
659		/* Magnific Zoom Gallery Code */
660		if( $( ".zoom-gallery" ).length ){
661			$('.zoom-gallery').magnificPopup({
662				delegate: 'a',
663				type: 'image',
664				closeOnContentClick: false,
665				closeBtnInside: false,
666				mainClass: 'mfp-with-zoom mfp-img-mobile',
667				gallery: {
668					enabled: true
669				},
670				zoom: {
671				enabled: true,
672					duration: 300, // don't foget to change the duration also in CSS
673					opener: function(element) {
674						return element.find('img');
675					}
676				}
677			});
678		}
679		
680		if( $( ".image-gallery" ).length ){
681			$('.image-gallery').magnificPopup({
682				delegate: '.image-gallery-link',
683				type: 'image',
684				closeOnContentClick: false,
685				closeBtnInside: false,
686				mainClass: 'mfp-with-zoom mfp-img-mobile',
687				gallery: {
688					enabled: true
689				},
690			});
691		}
692		
693		/* Magnific Popup Code */
694		if( $('.popup-video-post').length ){
695			$('.popup-video-post').magnificPopup({
696				disableOn: 700,
697				type: 'iframe',
698				mainClass: 'mfp-fade',
699				removalDelay: 160,
700				preloader: false,
701				fixedContentPos: false
702			});
703		}
704		
705		if( $('.popup-with-zoom-anim').length ){
706			$('.popup-with-zoom-anim').magnificPopup({
707				disableOn: 700,
708				type: 'inline',
709				mainClass: 'mfp-fade',
710				removalDelay: 160,
711				preloader: false,
712				fixedContentPos: false,
713				callbacks: {
714					open: function() {
715						// Play video on open:
716						if( !$( this.content ).find('video').length ){
717							var parent = $( this.content ).parent( "post-video-wrap" );
718							var url = $( this.content ).find('span').data( "url" );
719							var video = '<video width="100%" height="450" preload="true" style="max-width:100%;" autoplay="true"><source src="'+ url +'" type="video/mp4"></video>';
720							$( this.content ).find('span').replaceWith( video );
721							var video = $( this.content ).find('video');
722							//$(video).mediaelementplayer();
723						}else{
724							$(this.content).find('video')[0].load();
725						}
726					},
727					close: function() {
728						// Reset video on close:
729						$(this.content).find('video')[0].pause();
730			
731					}
732				}
733			});
734		}	
735		
736		if( $('.popup-youtube').length ){
737			$('.popup-youtube').magnificPopup({
738				disableOn: 700,
739				type: 'iframe',
740				mainClass: 'mfp-fade',
741				removalDelay: 160,
742				preloader: false,
743				fixedContentPos: false
744			});
745			
746			var video_id = $('.popup-youtube').data("video");
747			var video_url = "https://www.googleapis.com/youtube/v3/videos?id="+ video_id +"&key=AIzaSyCVc9XkvvfwWU3BLTAyYzq3rZ32K9Av6w4&part=snippet,contentDetails";
748			$.ajax({
749				async: false,
750				type: 'GET',
751				url: video_url,
752				success: function(data) {
753					if (data.items.length > 0) {
754						var vdo = data.items[0];
755						var duration = convert_time( vdo.contentDetails.duration );
756						$('.popup-youtube').next(".video-duration").text(duration);
757					}
758				}
759			}); 	
760		}
761		
762		//Modal popup
763		if( $('.modal-popup-content').length ){	
764			/* Magnific Popup Code */
765			$('.modal-box-trigger').magnificPopup({
766				type: 'inline',
767				preloader: false,
768				//focus: '#username',
769				modal: true,
770				mainClass: 'mfp-fade',
771				removalDelay: 300
772			});
773			$(document).on('click', '.popup-modal-dismiss', function (e) {
774				e.preventDefault();
775				$.magnificPopup.close();
776			});
777			$(document).keyup(function(e) {
778				if( e.keyCode === 27 && $(document).find(".mfp-wrap.mfp-ready").length ) $(document).find('.popup-modal-dismiss').trigger("click");
779			});	
780		}		
781		
782		/* Toggle Switch Tab */
783		if( $(document).find(".switch-toggle-tab-trigger").length ){
784			$(document).on('change', '.switch-toggle-tab-trigger .switch-checkbox', function() {
785				
786				if( this.checked ) {
787					var toggle_ele = $(this);
788					toggle_ele.parents(".switch-toggle-tab-wrap").addClass("switch-active-tab");
789				}else{
790					var toggle_ele = $(this);
791					toggle_ele.parents(".switch-toggle-tab-wrap").removeClass("switch-active-tab");
792				}
793			});
794		}
795		
796		/* Set Blockquote Background */
797		if( $( ".post-quote-wrap, .post-link-wrap" ).length ){
798			$( ".post-quote-wrap, .post-link-wrap" ).each(function() {
799				var img_url = $(this).data('url');
800				if( img_url ){
801					$(this).css( 'background-image','url('+ img_url +')' );	
802				}
803			});
804		}
805		
806		/* Set Background Image */
807		if( $( ".set-bg-img" ).length ){
808			$( ".set-bg-img" ).each(function() {
809				var img_url = $(this).data('src');
810				if( img_url ){
811					$(this).css( 'background-image','url('+ img_url +')' );	
812				}
813			});
814		}
815		
816		//On click video post
817		if( $( "a.onclick-video-post" ).length ){
818			$(document).on( "click", "a.onclick-video-post", function(){
819				var parent = $(this).parent('.post-video-wrap');
820				var frame = '<iframe src="'+ $(this).attr("href") +'?autoplay=1" width="100%" height="'+ parent.height() +'" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
821				$(this).fadeOut(300);
822				$(this).replaceWith( frame );
823				return false;
824			});
825		}
826		
827		if( $( ".onclick-custom-video" ).length ){
828			$(document).on( "click", ".onclick-custom-video", function(){
829				var parent = $(this).parent('.post-video-wrap');
830				var video = '<video width="100%" height="'+ parent.height() +'" preload="true" style="max-width:100%;" autoplay="true"><source src="'+ $(this).data("url") +'" type="video/mp4"></video>';
831				$(this).fadeOut(300);
832				$(this).replaceWith( video );
833				//parent.find('video').mediaelementplayer();
834				return false;
835			});
836		}
837		
838		/* Page Title Background Video */
839		if( $( "#page-title-bg .page-title-wrap-inner" ).length ){
840			$( "#page-title-bg .page-title-wrap-inner" ).YTPlayer();
841		}
842		
843		/* Comments Like/Dislike */
844		$( document ).on( 'click', ".fa-thumbs-o-up.comment-like, .fa-thumbs-o-down.comment-like", function( event) {
845	
846			var cmt_cur = $(this);
847			var cmt_meta = cmt_cur.data('id');
848			var cmt_id = cmt_cur.data('cmt-id');
849			var parent = cmt_cur.parents('.comment-like-wrapper');
850			if( cmt_meta == '1' ){
851				cmt_cur.parents('.list-inline').find('.comment-liked').removeClass('fa-thumbs-down comment-liked').addClass('fa-thumbs-o-down comment-like');
852				cmt_cur.removeClass('fa-thumbs-o-up comment-like').addClass('fa-thumbs-up comment-liked');
853			}else{
854				cmt_cur.parents('.list-inline').find('.comment-liked').removeClass('fa-thumbs-up comment-liked').addClass('fa-thumbs-o-up comment-like');
855				cmt_cur.removeClass('fa-thumbs-o-down comment-like').addClass('fa-thumbs-down comment-liked');	
856			}
857			
858			if( cmt_id != '' && cmt_meta != '' ){
859				// Ajax call
860				(jQuery).ajax({
861					type: "post",
862					url: embrad_ajax_var.admin_ajax_url,
863					data: "action=comment_like&nonce="+embrad_ajax_var.cmt_nonce+"&cmt_id="+cmt_id+"&cmt_meta="+cmt_meta,
864					success: function(res){
865						$( parent ).html(res);
866					},
867					error: function (jqXHR, exception) {
868						console.log(jqXHR);
869					}
870				});
871			}
872			return false;
873		});
874		
875		/*Mailchimp Code*/
876		if( $('.zozo-mc').length ){
877			$('.zozo-mc').live( "click", function () {
878				
879				var widg_id = $(this).attr('data-id');
880				
881				if( $('#zozo-mc-email-'+ widg_id ).val() == '' ){
882					$('#zozo-mc-email-'+ widg_id ).parent('.form-group').addClass('has-error');
883					$('#zozo-mc-err'+widg_id).text( embrad_ajax_var.must_fill );
884					return false;
885				}else{
886				
887					var btn_obj = $(this);
888					var btn_txt = $(this).val();
889		
890					$(this).val(embrad_ajax_var.wait);
891					($).ajax({
892						type: "POST",
893						url: embrad_ajax_var.admin_ajax_url,
894						data: 'action=zozo-mc&nonce='+embrad_ajax_var.mc_nounce+'&'+$('#zozo-mc-form'+widg_id).serialize(),
895						success: function (data) {
896							$('#zozo-mc-err'+widg_id).text(data);
897							$(btn_obj).val(btn_txt);
898							$('#zozo-mc-email-'+ widg_id ).val('');
899							$('#zozo-mc-first_name'+ widg_id ).val('');
900							$('#zozo-mc-last_name'+ widg_id ).val('');
901							$('#zozo-mc-email-'+ widg_id ).parent('.form-group').removeClass('has-error');
902							$('#zozo-mc-email-'+ widg_id ).parent('.form-group').attr('data-original-title', '');
903						},error: function(xhr, status, error) {
904							$('#zozo-mc-err'+widg_id).text( embrad_ajax_var.valid_email );
905						}
906					});
907				
908				}
909			});
910		} // if mailchimp exists
911		
912		/* Mailchimp Shorcode Script */
913		if( $('.mailchimp-wrapper').length ){
914			$('.mc-submit-btn').on( "click", function () {
915				var c_btn = $(this);
916				var mc_wrap = $( this ).parents('.mailchimp-wrapper');
917				var mc_form = $( this ).parents('.mc-form');
918				
919				if( mc_form.find('.mc_email').val() == '' ){
920					mc_wrap.find('.mc-notice-msg').text( embrad_ajax_var.must_fill );
921				}else{
922					c_btn.attr( "disabled", "disabled" );
923					$.ajax({
924						type: "POST",
925						url: embrad_ajax_var.admin_ajax_url,
926						data: 'action=embradmc&nonce='+embrad_ajax_var.mc_nounce+'&'+mc_form.serialize(),
927						success: function (data) {
928							//Success
929							c_btn.removeAttr( "disabled" );
930							if( data == 'mc_1' ){
931								mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-success') );
932							}else{
933								mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-fail') );
934							}
935						},error: function(xhr, status, error) {
936							c_btn.removeAttr( "disabled" );
937							mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-fail') );
938						}
939					});
940				}
941			});
942		} // if shortcode mailchimp exists
943		
944		/* Facbook Comment Width Resize */
945		if( $( '.fb-comments-wrapper' ).length ){
946			$( window ).resize(function() {
947				setTimeout(function(){
948					if($( window ).width() <= 768 ){
949						$( ".fb-comments-wrapper iframe" ).width( $( ".content-area" ).width() );
950					}else{
951						$( ".fb-comments-wrapper iframe" ).width( $( ".content-area .fb-comments" ).data('width') );
952					}
953				}, 200);
954			});
955		}
956		
957		/*Timeline Slide*/
958		if( $('.cd-horizontal-timeline').length ){
959			$('.cd-horizontal-timeline').each(function( index ) {
960				var cur_ele = $(this);
961				var line_dist = cur_ele.data("distance");
962				cur_ele.zozotimeline({
963					distance: line_dist
964				});
965			});
966		}
967
968		$(window).scroll(function(){
969			embrad_scroll_animation();
970		});		
971
972	}); // doc ready end
973	
974	
975	$( window ).load(function() {
976							  
977		if( $( ".header-slider-wrapper" ).length ){
978			$( ".header-slider-wrapper" ).css({ 'height' : 'auto' });
979		}
980		
981		/* Grid Layout Set Width for Owl and Isotope */
982		if( $( ".grid-layout.grid-normal" ).length ){
983			$( ".grid-layout.grid-normal" ).each(function() {
984			
985				var c_elem = $( this );
986				var parent_width = c_elem.width();
987				var gutter_size = c_elem.data( "gutter" );
988				var grid_cols = c_elem.data( "cols" );
989				
990				var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols );
991				c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'});
992				
993				c_elem.find( ".top-standard-post article" ).css({'width':'auto'});
994			
995			});	// each end		
996		} // .grid-layout
997
998		/* Media Element Js */
999		if( $('video, audio').length ){
1000			$( "video, audio" ).each(function( index ) {
1001				//$( this ).mediaelementplayer();
1002			});
1003		}
1004		
1005		/* Theme Owl Carousel Code */
1006		if( $('.owl-carousel').length ){
1007			$( ".owl-carousel" ).each(function() {
1008				if( !$( this ).parents( ".isotope" ).length ){
1009					embradOwlSettings( $( this ) );
1010				}
1011			});
1012		}
1013		
1014		/* Normal Grid Layout */
1015		if( $( ".grid-layout.grid-normal" ).length ){
1016			$( ".grid-layout.grid-normal" ).each(function() {
1017			
1018				var c_elem = $( this );
1019				var parent_width = c_elem.width();
1020				var gutter_size = c_elem.data( "gutter" );
1021				var grid_cols = c_elem.data( "cols" );
1022				
1023				if( $(window).width() < 768 ) grid_cols = 1;
1024				
1025				var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols );
1026				c_elem.find( "article" ).css({'width':net_width+'px', 'margin-right':gutter_size+'px', 'margin-bottom':gutter_size+'px'});
1027				c_elem.find(".grid-parent").css({ 'margin-right' : '-' + gutter_size + 'px' });
1028				
1029				c_elem.find( ".top-standard-post article" ).css({'width':'auto'});
1030				c_elem.find("article").addClass("grid-visible");
1031				
1032				$( window ).resize(function() {
1033
1034					setTimeout(function(){ 
1035			
1036						parent_width = c_elem.width();
1037						grid_cols = c_elem.data( "cols" );
1038						
1039						if( $(window).width() < 768 ) grid_cols = 1;
1040						
1041						net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols );
1042						c_elem.find( "article" ).css({'width':net_width+'px', 'margin-right':gutter_size+'px', 'margin-bottom':gutter_size+'px'});
1043						
1044						c_elem.find( "audio, video" ).each(function( index ) {
1045							$( this )[0].play();
1046							$( this )[0].pause();
1047						});
1048								
1049					}, 200);
1050					
1051				});	
1052			});	// each end
1053		}
1054		
1055		/* Isotope Grid Layout */
1056		if( $( ".grid-layout > .isotope" ).length ){
1057			$( ".grid-layout > .isotope" ).each(function() {
1058			
1059				var c_elem = $( this );
1060				c_elem.css('height','100px'); // For vc Way point js Issue solved by this code
1061				var parent_width = c_elem.width();
1062				var gutter_size = c_elem.data( "gutter" );
1063				var grid_cols = c_elem.data( "cols" );
1064
1065				var layoutmode = c_elem.is('[data-layout]') ? c_elem.data( "layout" ) : '';
1066				
1067				layoutmode = layoutmode ? layoutmode : 'masonry';
1068				
1069				if( $(window).width() < 768 ) grid_cols = 1;
1070				
1071				var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols );
1072				c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'});
1073				if( $( ".top-standard-post" ).length ){
1074					$( ".top-standard-post article" ).css({'margin-bottom':gutter_size+'px'});	
1075				}
1076				
1077				c_elem.find( ".owl-carousel" ).each(function() {
1078					embradOwlSettings( $( this ) );
1079				});
1080				
1081				c_elem.find( "video" ).each(function( index ) {
1082					$( this ).attr( "src", $( this ).find( "source" ).attr( "src" ) );
1083					$( this ).css({ 'height':'200px' });
1084				});
1085				
1086				var filter = "*";
1087				var isot_parent = c_elem.parent(".grid-layout");
1088				if( $( isot_parent ).attr("data-filter-stat") == 0 ){
1089					filter = $( isot_parent ).attr("data-first-cat") ? "." + $( isot_parent ).attr("data-first-cat") : '*';
1090				}
1091				
1092				c_elem.imagesLoaded( function(){
1093					var $cur_isotope = c_elem.isotope({
1094						itemSelector: 'article',
1095						layoutMode: layoutmode,
1096						filter: filter,
1097						masonry: {
1098							gutter: gutter_size
1099						},
1100						fitRows: {
1101						  gutter: gutter_size
1102						}
1103					});					
1104				});
1105				c_elem.children("article").addClass("grid-visible");
1106				
1107				/* Portfolio Filter Item */
1108				if( $(".portfolio-filter").length ){
1109					$( ".portfolio-filter-item" ).on( 'click', function() {
1110						$( this ).parents("ul.nav").find("li").removeClass("active");
1111						$( this ).parent("li").addClass("active");
1112						var filterValue = $( this ).attr( "data-filter" );
1113						c_elem = $( this ).parents( ".portfolio-wrapper" ).find( ".grid-layout .isotope" );
1114						c_elem.isotope({ 
1115							filter: filterValue
1116						});
1117						return false;
1118					});
1119				}
1120
1121				$( window ).resize(function() {
1122
1123					setTimeout(function(){ 
1124						grid_cols = c_elem.data( "cols" );
1125						if( $(window).width() < 768 ) grid_cols = 1;
1126						
1127						var parent_width = c_elem.width();
1128						net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols );
1129						c_elem.find( "article" ).css({'width':net_width+'px'});
1130						c_elem.imagesLoaded( function(){
1131							var $isot = c_elem.isotope({
1132								itemSelector: 'article',
1133								masonry: {
1134									gutter: gutter_size
1135								}
1136							});
1137							$isot.on( 'arrangeComplete', isotopeArrange );
1138						});
1139						
1140					}, 200);
1141					
1142				});	
1143				
1144				// Isotope Grid Infinite
1145				if( c_elem.data( "infinite" ) == 1 && $(".post-pagination").length ){
1146
1147					c_elem.infinitescroll({
1148						navSelector  : '.post-pagination',//'#page_nav',    // selector for the paged navigation 
1149						nextSelector : 'a.next-page',//'#page_nav a',  // selector for the NEXT link (to page 2)
1150						itemSelector : 'article',     // selector for all items you'll retrieve
1151						loading: {
1152							msgText : embrad_ajax_var.load_posts,
1153							finishedMsg: embrad_ajax_var.no_posts,
1154							img: embrad_ajax_var.infinite_loader
1155						}
1156					},
1157					// call Isotope as a callback
1158					function( newElements ) {
1159						
1160						var elems = $(newElements);
1161						
1162						var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols );
1163						c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'});
1164						if( $( ".top-standard-post" ).length ){
1165							$( ".top-standard-post article" ).css({'margin-bottom':gutter_size+'px'});	
1166						}
1167						
1168						c_elem.find( ".owl-carousel" ).each(function() {
1169							embradOwlSettings( $( this ) );
1170						});
1171						
1172						elems.find( "video" ).each(function( index ) {
1173							$( this ).attr( "src", $( this ).find( "source" ).attr( "src" ) );
1174							$( this ).css({ 'height':'200px' });
1175							//$( this ).mediaelementplayer();
1176						});
1177						
1178						elems.imagesLoaded( function(){
1179							c_elem.isotope( 'appended', elems );
1180							c_elem.children("article").addClass("grid-visible");
1181							embradLazyLoad();
1182						});
1183						
1184						if( c_elem.find( "article" ).hasClass( "embrad-animate" ) ){
1185							embrad_scroll_animation();
1186						}
1187
1188					});
1189				}
1190			}); // each end
1191		}
1192
1193		/* Related Slider Empty Post Image Height Set */
1194		if( $( ".related-slider .empty-post-image" ).length ){
1195			if( $( ".related-slider .item .wp-post-image" ).length ){
1196				$( ".related-slider .item .empty-post-image" ).height( $( ".related-slider .item .wp-post-image" ).height() );	
1197			}
1198		}
1199		
1200		/* Featured Slider Empty Post Image Height Set */
1201		if( $( ".featured-slider .empty-post-image" ).length ){
1202			if( $( ".featured-slider .item .wp-post-image" ).length ){
1203				$( ".featured-slider .item .empty-post-image" ).height( $( ".featured-slider .item .wp-post-image" ).height() );	
1204			}
1205		}
1206		
1207		/* Sticky Sidebar */
1208		if( $( ".embrad-sticky-obj" ).length ){
1209			var $sticky_sidebars = $( ".embrad-sticky-obj" );
1210			if( $( window ).width() > 767 ) {
1211				$sticky_sidebars.stick_in_parent();
1212			}
1213			$( window ).resize(function() {
1214				if( $( window ).width() > 767 ) {
1215					$sticky_sidebars.trigger( "sticky_kit:detach" );	
1216					$sticky_sidebars.stick_in_parent();
1217					$sticky_sidebars.trigger( "sticky_kit:recalc" );
1218				}else{
1219					$sticky_sidebars.trigger( "sticky_kit:detach" );
1220				}
1221			});
1222		}
1223		
1224		/* Counter Script */
1225		if( $( ".counter-up" ).length ){
1226			var counterUp = $( ".counter-up" );
1227			counterUp.appear(function() {
1228				var $this = $(this),
1229				countTo = $this.attr( "data-count" );
1230				$({ countNum: $this.text()}).animate({
1231						countNum: countTo
1232					},
1233					{
1234					duration: 1000,
1235					easing: 'linear',
1236					step: function() {
1237						$this.text( Math.floor( this.countNum ) );
1238					},
1239					complete: function() {
1240						$this.text( this.countNum );
1241					}
1242				});  
1243			});
1244		}
1245
1246		/* Circle Counter Shortcode Script */
1247		if( $( '.circle-progress-circle' ).length ){
1248			var circle = $( '.circle-progress-circle' );
1249			circle.appear(function() {
1250							  
1251				var c_circle = $( this );
1252				var c_value = c_circle.attr( "data-value" );
1253				var c_size = c_circle.attr( "data-size" );
1254				var c_thickness = c_circle.attr( "data-thickness" );
1255				var c_duration = c_circle.attr( "data-duration" );
1256				var c_empty = c_circle.attr( "data-empty" ) != '' ? c_circle.attr( "data-empty" ) : 'transparent';
1257				var c_scolor = c_circle.attr( "data-scolor" );
1258				var c_ecolor = c_circle.attr( "data-ecolor" ) != '' ? c_circle.attr( "data-ecolor" ) : c_scolor;
1259									
1260				c_circle.circleProgress({
1261					value: Math.floor( c_value ) / 100,
1262					size: Math.floor( c_size ),
1263					thickness: Math.floor( c_thickness ),
1264					emptyFill: c_empty,
1265					animation: {
1266						duration: Math.floor( c_duration )
1267					},
1268					lineCap: 'round',
1269					fill: {
1270						gradient: [c_scolor, c_ecolor]
1271					}
1272				}).on( 'circle-animation-progress', function( event, progress ) {
1273					$( this ).find( '.progress-value' ).html( Math.round( c_value * progress ) + '%' );
1274				});
1275			});
1276		}
1277		
1278		/* Day Counter Shortcode Script */
1279		if( $( '.day-counter' ).length ){
1280			$( '.day-counter' ).each(function() {
1281				var day_counter = $( this );
1282				var c_date = day_counter.attr('data-date');
1283				day_counter.countdown( c_date, function(event) {
1284					if( day_counter.find('.counter-day').length ){
1285						day_counter.find('.counter-day h3').text( event.strftime('%D') );
1286					}
1287					if( day_counter.find('.counter-hour').length ){
1288						day_counter.find('.counter-hour h3').text( event.strftime('%H') );
1289					}
1290					if( day_counter.find('.counter-min').length ){
1291						day_counter.find('.counter-min h3').text( event.strftime('%M') );
1292					}
1293					if( day_counter.find('.counter-sec').length ){
1294						day_counter.find('.counter-sec h3').text( event.strftime('%S') );
1295					}
1296					if( day_counter.find('.counter-week').length ){
1297						day_counter.find('.counter-week h3').text( event.strftime('%w') );
1298					}
1299				});
1300			});
1301		}
1302		
1303		/* Page Load Modal Script */
1304		if( $('.modal-popup-wrapper.page-load-modal').length ){
1305			var modal_id = $('.modal-popup-wrapper.page-load-modal .modal').attr("id");
1306			$('#'+modal_id).modal('show');
1307		}
1308		
1309		/* Canvas Shapes */
1310		if( $(".canvas_agon").length ){
1311			$( '.canvas_agon' ).each(function() {
1312				embradAgon( $(this) );
1313			});
1314		}
1315
1316	});
1317	
1318	// Using window smartresize instead of resize function
1319	$( window ).smartresize(function() {
1320		
1321		/* Mobile Bar Toggle  */
1322		setTimeout( function(){ $(".mobile-bar.active").length ?  $( ".mobile-header .mobile-bar-toggle" ).trigger( "click" ) : ''; }, 100 ); 
1323				
1324		/* Pull Center Reset  */
1325		setTimeout( embradCenterMenuMargin, 300 );
1326		
1327		/* Sticky Menu */
1328		if($('.header-inner .sticky-head').length){
1329			setTimeout( embradStickyPart( '.header-inner' ), 100 ); 
1330		}
1331		
1332		/* Scroll Sticky */
1333		if($('.header-inner .sticky-scroll').length){
1334			setTimeout( embradStickyScrollUpPart( '.header-inner', 'header' ), 100 ); 
1335		}
1336		
1337		/* Mobile Header Sticky Menu */
1338		if($('.mobile-header-inner .sticky-head').length){
1339			setTimeout( embradStickyPart( '.mobile-header-inner' ), 100 ); 
1340		}
1341		
1342		/* Mobile Header Scroll Sticky */
1343		if($('.mobile-header-inner .sticky-scroll').length){
1344			setTimeout( embradStickyScrollUpPart( '.mobile-header-inner', '.mobile-header' ), 100 ); 
1345		}
1346		
1347		embrad_scroll_animation();
1348		
1349	});
1350	
1351	$( window ).load(function() {
1352		if( $( ".embradgmap" ).length ){
1353			initEmbradGmap();
1354		}
1355		
1356		embrad_scroll_animation();
1357	});
1358	
1359	function isotopeArrange() {
1360		$( ".grid-layout > .isotope" ).find( "audio, video" ).each(function( index ) {
1361			$( this )[0].play();
1362			$( this )[0].pause();
1363		});
1364	}
1365	
1366	function embradStickyHeaderAdjust(elem_pos, elem_width){
1367		var win_width = $(window).width();
1368		var compare_wdth;
1369		if( $('.embrad-header .header-inner.hidden-md-land-down' ).length ){
1370			compare_wdth = 1024;    
1371		}else{
1372			compare_wdth = 991; 
1373		}
1374		if( win_width <= compare_wdth ){
1375			if( elem_pos == 'left' ){
1376				$('.sticky-header-space').css( 'left', '-'+ elem_width +'px' );
1377				$('body, .top-sliding-bar').css( 'padding-left', '0' );
1378			}else{
1379				$('.sticky-header-space').css( 'right', '-'+ elem_width +'px' );
1380				$('body, .top-sliding-bar').css( 'padding-right', '0' );
1381			}
1382		}else{
1383			if( elem_pos == 'left' ){
1384				$('.sticky-header-space').css( 'left', 0 );
1385				$('body, .top-sliding-bar').css( 'padding-left', elem_width +'px' );
1386			}else{
1387				$('.sticky-header-space').css( 'right', 0 );
1388				$('body, .top-sliding-bar').css( 'padding-right', elem_width +'px' );
1389			}	
1390		}	
1391	}
1392
1393	function embradCenterMenuMargin(){
1394		//Center item margin fixing
1395		$.each([ 'topbar', 'logobar', 'navbar', 'mobile-header', 'footer-bottom' ], function( index, margin_key ) {
1396			
1397			var left_width = 0,
1398				right_width = 0,
1399				center_width = 0,
1400				margin_left = 0,
1401				parent_width = 0;
1402
1403			if( $('.'+ margin_key +' .'+ margin_key +'-inner').length ){
1404			
1405				if( margin_key == 'mobile-header' )
1406					parent_width = $('.'+ margin_key +' .'+ margin_key +'-inner .container').width();
1407				else
1408					parent_width = $('.'+ margin_key +' .'+ margin_key +'-inner').width();
1409				
1410				if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-left').length ){
1411					left_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-left').width();
1412				}
1413				if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-right').length ){
1414					right_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-right').width();
1415				}
1416				if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').length ){
1417					center_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').width();
1418				}
1419					
1420				if( left_width + center_width + right_width ){
1421				
1422					if( margin_key == 'mobile-header' ){
1423						parent_width -= ( left_width + center_width + right_width );
1424						margin_left = parent_width / 2; 
1425					}else{
1426						parent_width = ( parent_width / 2 ) - ( center_width / 2 );
1427						margin_left = Math.floor( parent_width - left_width );
1428					}
1429					
1430					if( !$( "body.rtl" ).length ){
1431						$('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').css( 'margin-left', margin_left+'px' );
1432					}else{
1433						$('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').css( 'margin-right', margin_left+'px' );
1434					}
1435					
1436					$('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').addClass("show-opacity");
1437					
1438				}
1439			}
1440		});
1441	}
1442	
1443	function embradLazyLoad( $timeout ){
1444		if( embrad_ajax_var.lazy_opt == '1' ){
1445			$("img.lazy-initiate:not(.lazy-active)").appear(function() {
1446				var cur_img = $( this );
1447
1448				cur_img.removeClass('lazy-initiate').addClass('lazy-process');
1449				cur_img.parent().css('height', cur_img.height());
1450				cur_img.attr('src', cur_img.attr( 'data-src' ));
1451				cur_img.imagesLoaded( function() {
1452					setTimeout(function() {
1453						cur_img.removeClass('lazy-process').addClass("lazy-active");
1454						cur_img.parent().css('height', 'auto');
1455					}, $timeout);
1456				});
1457				
1458			});
1459		}
1460	}
1461	window.addEventListener('load', function(){
1462		embradLazyLoad( 0 );
1463	}, false);
1464	
1465	function embradStickyPart( main_class ){
1466
1467		var outer_class = '.sticky-outer';	
1468		var lastScrollTop = 0;
1469		var header_top = 0;
1470
1471		$(main_class + ' ' + outer_class).css( 'height', $(main_class + ' ' + outer_class).data( "height" ) );
1472		header_top = $(main_class + ' ' + outer_class).offset().top;
1473
1474		$(window).scroll(function(event){
1475			
1476			var st = $(this).scrollTop();
1477			if( st > header_top ){
1478				$(main_class + ' .sticky-head').addClass('header-sticky');
1479			}else{
1480				$(main_class + ' .sticky-head').removeClass('header-sticky');
1481			}
1482			
1483			if( st == 0 ){
1484				$(main_class + ' .sticky-head').removeClass('header-sticky');
1485			}
1486			
1487			lastScrollTop = st;
1488		});	
1489	}
1490	
1491	function embradStickyScrollUpPart( main_class, sticky_div ){
1492		
1493		var outer_class = '.sticky-outer';	
1494		var out_height = '';
1495		var lastScrollTop = 0;
1496		var header_top = 0;
1497	
1498		$(main_class + ' ' + outer_class).css( 'height', $(main_class + ' ' + outer_class).data( "height" ) );
1499		out_height = '-' + $(main_class + ' ' + outer_class).outerHeight() + 'px';
1500		header_top = $(main_class + ' ' + outer_class).offset().top;
1501		sticky_div = $(sticky_div).height();
1502		
1503		$(window).scroll(function(event){
1504
1505			var st = $(this).scrollTop();
1506			
1507			if( st < lastScrollTop && header_top < lastScrollTop ){
1508				// upscroll code
1509				$(main_class + ' .sticky-scroll').addClass('show-menu');
1510				$(main_class + ' .sticky-scroll.show-menu').css({'transform': 'translate3d(0px, 0px, 0px)'});
1511			}else{
1512				// downscroll code
1513				if( st < sticky_div ){
1514					$(main_class + ' .sticky-scroll').css({'transform': ''});
1515					$(main_class + ' .sticky-scroll.show-menu').removeClass('show-menu');
1516				}else{
1517					$(main_class + ' .sticky-scroll').css({'transform': 'translate3d(0px, '+ out_height +', 0px)'});
1518				}
1519			}
1520			
1521			if( st == 0 ){
1522				$(main_class + ' .sticky-scroll').css({'transform': ''});
1523				$(main_class + ' .sticky-scroll.show-menu').removeClass('show-menu');
1524			}
1525			
1526			lastScrollTop = st;
1527		});
1528		
1529	}
1530	
1531	function embradSetStickyOuterHeight(){
1532		$( ".sticky-outer" ).each(function() {
1533
1534			var class_name = '';
1535			if( $( this ).parent( "div" ).hasClass( "mobile-header-inner" ) ){
1536				class_name = $( this ).parent( "div" ).attr("class");
1537				$( this ).parent( "div" ).attr("class", "");
1538			}
1539			
1540			if( $( this ).parent( "div" ).is('[class*=hidden-]') ){
1541				class_name = $( this ).parent( "div" ).attr("class");
1542				$( this ).parent( "div" ).attr("class", "");
1543			}
1544			
1545			$( this ).css({ 'position':'absolute', 'visibility':'hidden', 'display':'block', 'height':'auto' });
1546			$( this ).attr( "data-height", $( this ).outerHeight() );
1547
1548			if( class_name != '' ){
1549				$( this ).parent( "div" ).attr("class", class_name);
1550			}
1551			$( this ).css({ 'position':'', 'visibility':'', 'display':'', 'he
1551ight': $( this ).data( "height" ) });
1552
1553		});
1554	}
1555	
1556	function embradAgon( canvas_ele ){
1557		var canvas = document.getElementById("canvas_agon");
1558		var cxt = canvas.getContext("2d");
1559		var agon_size = canvas_ele.attr( "data-size" );
1560		var agon_side = canvas_ele.attr( "data-side" );
1561		var agon_color = canvas_ele.attr( "data-color" );
1562		var div_val = 1;
1563
1564		switch( parseInt( agon_side ) ){
1565			case 3:
1566				div_val = 6;
1567			break;
1568			case 4:
1569				div_val = 4;
1570			break;
1571			case 5:
1572				div_val = 3.3;
1573			break;
1574			case 6:
1575				div_val = 3;
1576			break;
1577			case 7:
1578				div_val = 2.8;
1579			break;
1580			case 8:
1581				div_val = 2.7;
1582			break;
1583			case 9:
1584				div_val = 2.6;
1585			break;
1586			case 10:
1587				div_val = 2.5;
1588			break;
1589		}
1590
1591		// hexagon
1592		var numberOfSides = parseInt( agon_side ),
1593			size = parseInt( agon_size ),
1594			Xcenter = parseInt( agon_size ),
1595			Ycenter = parseInt( agon_size ),
1596			step  = 2 * Math.PI / numberOfSides,//Precalculate step value
1597			shift = (Math.PI / div_val);//(Math.PI / 180.0);// * 44;//Quick fix ;)
1598
1599		cxt.beginPath();
1600
1601		for (var i = 0; i <= numberOfSides;i++) {
1602			var curStep = i * step + shift;
1603		   cxt.lineTo (Xcenter + size * Math.cos(curStep), Ycenter + size * Math.sin(curStep));
1604		}
1605
1606		/* Direct Output */
1607		cxt.fillStyle = agon_color;
1608		cxt.fill();
1609	}
1610	
1611	function embradTooltipUpdate(){
1612		$( "[data-tooltip]" ).each(function() {
1613			$(this).prepend( '<span class="tooltiptext">'+ $(this).attr("data-tooltip") +'</span>' );
1614		});
1615	}
1616	
1617	function embradtesipagecallback(event){
1618		var current = event.item.index;
1619		$( event.target ).find(".owl-item.active").eq(0).addClass("current");
1620	}
1621	
1622	function embradOwlSettings(c_owlCarousel){
1623		
1624		var page_slide = false;
1625		var pagi_slide = false;
1626		if( c_owlCarousel.hasClass("embrad-page-carousel") ){ page_slide = true; }
1627		if( c_owlCarousel.hasClass("embrad-pagination-carousel") ){ pagi_slide = true; }
1628	
1629		// Data Properties
1630		var loop = c_owlCarousel.data( "loop" );
1631		var margin = c_owlCarousel.data( "margin" );
1632		var center = c_owlCarousel.data( "center" );
1633		var nav = c_owlCarousel.data( "nav" );
1634		var dots_ = c_owlCarousel.data( "dots" );
1635		var items = c_owlCarousel.data( "items" );
1636		var items_tab = c_owlCarousel.data( "items-tab" );
1637		var items_mob = c_owlCarousel.data( "items-mob" );
1638		var duration = c_owlCarousel.data( "duration" );
1639		var smartspeed = c_owlCarousel.data( "smartspeed" );
1640		var scrollby = c_owlCarousel.data( "scrollby" );
1641		var autoheight = c_owlCarousel.data( "autoheight" );
1642		var autoplay = c_owlCarousel.data( "autoplay" );
1643		var rtl = $( "body.rtl" ).length ? true : false;
1644
1645		$( c_owlCarousel ).owlCarousel({
1646			rtl : rtl,
1647			loop	: loop,
1648			autoplayTimeout	: duration,
1649			smartSpeed	: smartspeed,
1650			center: center,
1651			margin	: margin,
1652			nav		: nav,
1653			dots	: dots_,
1654			autoplay	: autoplay,
1655			autoheight	: autoheight,
1656			slideBy		: scrollby,
1657			responsive:{
1658				0:{
1659					items: items_mob
1660				},
1661				544:{
1662					items: items_tab
1663				},
1664				992:{
1665					items: items
1666				}
1667			},
1668			onInitialized: pagi_slide ? embradtesipagecallback : ''
1669		});	
1670		
1671		if( pagi_slide ){
1672			var cur_testi_slide = $( c_owlCarousel ).parent("div").children(".embrad-page-carousel");
1673			var cur_pagination_slide = $( c_owlCarousel );
1674			$( c_owlCarousel ).on('click', '.owl-item', function(event) {
1675				var current = $(this).index();
1676				$(cur_testi_slide).trigger("to.owl.carousel", [current, 500]);
1677			});
1678			$( c_owlCarousel ).on('dragged.owl.carousel', function(event) {
1679				var current = event.item.index;
1680				$(cur_testi_slide).trigger("to.owl.carousel", [current, 500]);
1681				cur_pagination_slide.find(".owl-item.current").removeClass("current");
1682				cur_pagination_slide.find(".owl-item").eq(current).addClass("current");
1683			});
1684		}
1685		if( page_slide ){
1686			var cur_pagination_slide = $( c_owlCarousel ).parent("div").children(".embrad-pagination-carousel");
1687			$( c_owlCarousel ).on('changed.owl.carousel', function(event) {
1688				var current = event.item.index;
1689				$(cur_pagination_slide).trigger("to.owl.carousel", [current, 500]);
1690				$(cur_pagination_slide).find(".owl-item.current").removeClass("current");
1691				$(cur_pagination_slide).find(".owl-item").eq(current).addClass("current");
1692			});			
1693		}
1694		
1695	}
1696	
1697	function convert_time(duration) {
1698		var a = duration.match(/\d+/g);
1699	
1700		if (duration.indexOf('M') >= 0 && duration.indexOf('H') == -1 && duration.indexOf('S') == -1) {
1701			a = [0, a[0], 0];
1702		}
1703	
1704		if (duration.indexOf('H') >= 0 && duration.indexOf('M') == -1) {
1705			a = [a[0], 0, a[1]];
1706		}
1707		if (duration.indexOf('H') >= 0 && duration.indexOf('M') == -1 && duration.indexOf('S') == -1) {
1708			a = [a[0], 0, 0];
1709		}
1710	
1711		duration = 0;
1712	
1713		if (a.length == 3) {
1714			duration = duration + parseInt(a[0]) * 3600;
1715			duration = duration + parseInt(a[1]) * 60;
1716			duration = duration + parseInt(a[2]);
1717		}
1718	
1719		if (a.length == 2) {
1720			duration = duration + parseInt(a[0]) * 60;
1721			duration = duration + parseInt(a[1]);
1722		}
1723	
1724		if (a.length == 1) {
1725			duration = duration + parseInt(a[0]);
1726		}
1727		var h = Math.floor(duration / 3600);
1728		var m = Math.floor(duration % 3600 / 60);
1729		var s = Math.floor(duration % 3600 % 60);
1730		return ((h > 0 ? h + ":" + (m < 10 ? "0" : "") : "") + m + ":" + (s < 10 ? "0" : "") + s);
1731	}
1732	
1733	function embrad_scroll_animation(){
1734		setTimeout( function() {
1735			var anim_time = 300;
1736			$('.embrad-animate:not(.run-animate)').each( function() {
1737				
1738				var elem = $(this);
1739				var bottom_of_object = elem.offset().top;
1740				var bottom_of_window = $(window).scrollTop() + $(window).height();
1741				
1742				if( bottom_of_window > bottom_of_object ){
1743					setTimeout( function() {
1744						elem.addClass("run-animate");
1745					}, anim_time );
1746				}
1747				anim_time += 300;
1748				
1749			});
1750		}, 200 );
1751	}
1752	
1753	function initEmbradGmap() {
1754		
1755		var map_styles = '{ "Aubergine" : [	{"elementType":"geometry","stylers":[{"color":"#1d2c4d"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#8ec3b9"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#1a3646"}]},{"featureType":"administrative.country","elementType":"geometry.stroke","stylers":[{"color":"#4b6878"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#64779e"}]},{"featureType":"administrative.province","elementType":"geometry.stroke","stylers":[{"color":"#4b6878"}]},{"featureType":"landscape.man_made","elementType":"geometry.stroke","stylers":[{"color":"#334e87"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#023e58"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#283d6a"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#6f9ba5"}]},{"featureType":"poi","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#023e58"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#3C7680"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#304a7d"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#98a5be"}]},{"featureType":"road","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#2c6675"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#255763"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#b0d5ce"}]},{"featureType":"road.highway","elementType":"labels.text.stroke","stylers":[{"color":"#023e58"}]},{"featureType":"transit","elementType":"labels.text.fill","stylers":[{"color":"#98a5be"}]},{"featureType":"transit","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"transit.line","elementType":"geometry.fill","stylers":[{"color":"#283d6a"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#3a4762"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#0e1626"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#4e6d70"}]}], "Silver" : [{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}], "Retro" : [{"elementType":"geometry","stylers":[{"color":"#ebe3cd"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#523735"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f1e6"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#c9b2a6"}]},{"featureType":"administrative.land_parcel","elementType":"geometry.stroke","stylers":[{"color":"#dcd2be"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#ae9e90"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#93817c"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#a5b076"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#447530"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#f5f1e6"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#fdfcf8"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#f8c967"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#e9bc62"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry","stylers":[{"color":"#e98d58"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry.stroke","stylers":[{"color":"#db8555"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#806b63"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"transit.line","elementType":"labels.text.fill","stylers":[{"color":"#8f7d77"}]},{"featureType":"transit.line","elementType":"labels.text.stroke","stylers":[{"color":"#ebe3cd"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#b9d3c2"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#92998d"}]}], "Dark" : [{"elementType":"geometry","stylers":[{"color":"#212121"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#212121"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"color":"#757575"}]},{"featureType":"administrative.country","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#181818"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"poi.park","elementType":"labels.text.stroke","stylers":[{"color":"#1b1b1b"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"color":"#2c2c2c"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#8a8a8a"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#373737"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#3c3c3c"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry","stylers":[{"color":"#4e4e4e"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"transit","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#3d3d3d"}]}], "Night" : [{"elementType":"geometry","stylers":[{"color":"#242f3e"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#746855"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#242f3e"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#263c3f"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#6b9a76"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#38414e"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"color":"#212a37"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#9ca5b3"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#746855"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#1f2835"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#f3d19c"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#2f3948"}]},{"featureType":"transit.station","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#17263c"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#515c6d"}]},{"featureType":"water","elementType":"labels.text.stroke","stylers":[{"color":"#17263c"}]}] }';
1756		
1757		var map_style_obj = JSON.parse(map_styles);
1758		
1759		var map_style_mode = [];
1760		var map_mode = '';
1761		var map_lang = '';
1762		var map_lat = '';
1763		var map_marker = '';
1764		var map_options = '';
1765		
1766		$( ".embradgmap" ).each(function( index ) {
1767			
1768			var gmap = this;
1769
1770			if( $( gmap ).attr( "data-map-style" ) ){
1771				map_mode = $( gmap ).data("map-style");
1772				map_lang = $( gmap ).data("map-lang");
1773				map_lat = $( gmap ).data("map-lat");
1774				map_marker = $( gmap ).data("map-marker");
1775				if( map_mode === 'aubergine' )
1776					map_style_mode = map_style_obj.Aubergine;
1777				else if( map_mode === 'silver' )
1778					map_style_mode = map_style_obj.Silver;
1779				else if( map_mode === 'retro' )
1780					map_style_mode = map_style_obj.Retro;
1781				else if( map_mode === 'dark' )
1782					map_style_mode = map_style_obj.Dark;
1783				else if( map_mode === 'night' )
1784					map_style_mode = map_style_obj.Night;
1785				else if( map_mode === 'custom' ){
1786					var c_style = $( gmap ).attr( "data-custom-style" ) && $( gmap ).attr( "data-custom-style" ) != '' ? JSON.parse( $( gmap ).attr( "data-custom-style" ) ) : '[]';
1787					map_style_mode = c_style;
1788				}else{
1789					map_style_mode = "[]";
1790				}
1791			}
1792			
1793			if( $( gmap ).attr( "data-multi-map" ) && $( gmap ).attr( "data-multi-map" ) == 'true' ){
1794				
1795				var map_values = JSON.parse( $( gmap ).attr( "data-maps" ) );
1796				var map_wheel = $( gmap ).attr( "data-wheel" ) && $( gmap ).attr( "data-wheel" ) == 'true' ? true : false;
1797				var map_zoom = $( gmap ).attr( "data-zoom" ) && $( gmap ).attr( "data-zoom" ) != '' ? parseInt( $( gmap ).attr( "data-zoom" ) ) : 14;
1798				var map;
1799
1800				var map_stat = 1;
1801
1802				map_values.forEach( function( map_value ) {
1803					map_lat = map_value.map_latitude;
1804					map_lang = map_value.map_longitude;
1805					var LatLng = new google.maps.LatLng( map_lat, map_lang );
1806					var mapProp= {
1807						center: LatLng,
1808						scrollwheel: map_wheel,
1809						zoom: map_zoom,
1810						styles: map_style_mode
1811					};
1812					
1813					//Create Map
1814					if( map_stat ){
1815						var t_gmap = $( gmap );
1816						map = new google.maps.Map( t_gmap[0], mapProp );
1817						
1818						google.maps.event.addDomListener( window, 'resize', function() {
1819							var center = map.getCenter();
1820							google.maps.event.trigger( map, "resize" );
1821							map.setCenter( LatLng );
1822						});
1823						
1824						map_stat = 0;
1825					}
1826					
1827					//Map Marker
1828					var marker = new google.maps.Marker({
1829						position: LatLng,
1830						icon: map_value.map_marker,
1831						map: map
1832					});
1833					
1834					//Info Window
1835					if( map_value.map_info_opt == 'on' ) {
1836						var info_title = map_value.map_info_title ? map_value.map_info_title : '';
1837						var info_addr = map_value.map_info_address;
1838						var contentString = '<div class="gmap-info-wrap">';
1839						contentString += info_title != '' ? '<h3>'+ info_title +'</h3>' : '';
1840						contentString += '<p>'+ info_addr +'</p></div>';
1841						var infowindow = new google.maps.InfoWindow({
1842						  content: contentString
1843						});
1844						marker.addListener( 'click', function() {
1845						  infowindow.open( map, marker );
1846						});
1847					}
1848				});
1849				
1850			}else{
1851			
1852				var LatLng = {lat: parseFloat(map_lat), lng: parseFloat(map_lang)};
1853				
1854				var map_wheel = $( gmap ).attr( "data-wheel" ) && $( gmap ).attr( "data-wheel" ) == 'true' ? true : false;
1855				var map_zoom = $( gmap ).attr( "data-zoom" ) && $( gmap ).attr( "data-zoom" ) != '' ? parseInt( $( gmap ).attr( "data-zoom" ) ) : 14;
1856				
1857				var mapProp= {
1858					center: LatLng,
1859					scrollwheel: map_wheel,
1860					zoom: map_zoom,
1861					styles: map_style_mode
1862				};
1863				var t_gmap = $( gmap );
1864				var map = new google.maps.Map( t_gmap[0], mapProp ); //document.getElementById("embradgmap")
1865				
1866				var marker = new google.maps.Marker({
1867				  position: LatLng,
1868				  icon: map_marker,
1869				  map: map
1870				});
1871				
1872				if( $( gmap ).attr( "data-info" ) == 1 ){
1873					var info_title = $( gmap ).attr( "data-info-title" ) ? $( gmap ).attr( "data-info-title" ) : '';
1874					var info_addr = $( gmap ).attr( "data-info-addr" ) ? $( gmap ).attr( "data-info-addr" ) : '';
1875					var contentString = '<div class="gmap-info-wrap">';
1876					contentString += info_title != '' ? '<h3>'+ info_title +'</h3>' : '';
1877					contentString += '<p>'+ info_addr +'</p></div>';
1878					var infowindow = new google.maps.InfoWindow({
1879					  content: contentString
1880					});
1881					marker.addListener( 'click', function() {
1882					  infowindow.open( map, marker );
1883					});
1884				}
1885				
1886				google.maps.event.addDomListener( window, 'resize', function() {
1887					var center = map.getCenter();
1888					google.maps.event.trigger(map, "resize");
1889					map.setCenter(LatLng);
1890				});
1891				
1892			}// data multi map false part end
1893			
1894		}); // end map each
1895		
1896	}
1897
1898})( jQuery );

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.