PageSourceSearch

https://lakegenevaballoon.com/wp-content/plugins/goodlayers-core/include/js/page-builder.js?ver=1.3.9

js lakegenevaballoon.com collected 2026-10-08 13:52:21 UTC 90,727 bytes, 2,716 lines download raw bytes

1/* start page builder */
2(function($){
3	"use strict";
4
5	// Detect Mobile Device
6	var gdlr_core_mobile = false;
7	if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/BlackBerry/i) ||
8		navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/Windows Phone/i) ){ 
9		gdlr_core_mobile = true; 
10	}else{ 
11		gdlr_core_mobile = false; 
12	}
13
14	// Detect Screen
15	var gdlr_core_display = 'desktop';
16	if( typeof(window.matchMedia) == 'function' ){
17		$(window).on('resize themename-set-display gdlr-core-element-resize', function(){
18			if( window.matchMedia('(max-width: 419px)').matches ){
19				gdlr_core_display = 'mobile-portrait';
20			}else if( window.matchMedia('(max-width: 767px)').matches ){
21				gdlr_core_display = 'mobile-landscape'
22			}else if( window.matchMedia('(max-width: 959px)').matches ){
23				gdlr_core_display = 'tablet'
24			}else{
25				gdlr_core_display = 'desktop';
26			}
27		});
28		$(window).trigger('themename-set-display');
29	}else{
30		$(window).on('resize themename-set-display gdlr-core-element-resize', function(){
31			if( $(window).innerWidth() <= 419 ){
32				gdlr_core_display = 'mobile-portrait';
33			}else if( $(window).innerWidth() <= 767 ){
34				gdlr_core_display = 'mobile-landscape'
35			}else if( $(window).innerWidth() <= 959 ){
36				gdlr_core_display = 'tablet'
37			}else{
38				gdlr_core_display = 'desktop';
39			}
40		});
41		$(window).trigger('themename-set-display');
42	}
43	
44	// set cookie
45	function gdlr_core_set_cookie( cname, cvalue, expires ){
46		if( typeof(expires) != 'undefined' ){
47			if( expires == 0 ){
48				expires = 86400;
49			}
50
51			var now = new Date();
52			var new_time  = now.getTime() + (parseInt(expires) * 1000);
53			now.setTime(new_time);
54
55			expires = now.toGMTString();
56		}
57
58	    document.cookie = cname + "=" + encodeURIComponent(cvalue) + "; expires=" + expires + "; path=/";
59	}
60
61	// script for normal content
62	$.fn.gdlr_core_content_script = function( filter_elem, document_ready ){
63
64		$(this).gdlr_core_fluid_video( filter_elem );
65
66		// audio
67		if( !document_ready && typeof($.fn.mediaelementplayer) == 'function' ){
68			var wpme_settings = {
69				"stretching": "responsive"
70			};
71			if( typeof(_wpmejsSettings) !== 'undefined' ){ 
72				wpme_settings.pluginPath = _wpmejsSettings.pluginPath; 
73			}
74
75			$(this).find('audio, video').mediaelementplayer(wpme_settings);
76		}		
77
78		return $(this);
79	}
80
81	// responsive video
82	$.fn.gdlr_core_fluid_video = function( filter_elem ){
83		
84		if( typeof(filter_elem) == 'undefined' ){
85			var elem = $(this).find('iframe[src*="youtube"], iframe[src*="vimeo"]');
86		}else{
87			var elem = filter_elem.filter('iframe[src*="youtube"], iframe[src*="vimeo"]');
88		}
89		
90		elem.each(function(){
91
92			// ignore if inside slider
93			if( $(this).closest('.ls-container, .master-slider').length <= 0 ){ 
94				if( ($(this).is('embed') && $(this).parent('object').length) || $(this).parent('.gdlr-core-fluid-video-wrapper').length ){ return; } 
95				if( !$(this).attr('id') ){ $(this).attr('id', 'gdlr-video-' + Math.floor(Math.random()*999999)); }			
96			
97				if( $(this).attr('height') && $(this).attr('width') ){
98					var ratio = parseInt($(this).attr('height')) / parseInt($(this).attr('width'));
99				}else{
100					var ratio = $(this).height() / $(this).width();
101				}
102				$(this).removeAttr('height').removeAttr('width');
103				
104				try{
105					$(this).wrap('<div class="gdlr-core-fluid-video-wrapper"></div>').parent().css('padding-top', (ratio * 100)+"%");
106					$(this).attr('src', $(this).attr('src'));
107				}catch(e){}
108			}
109		});	
110
111		// overlay
112		$('.gdlr-core-video-item-overlay').each(function(){
113
114			var button = $(this);
115			var video = $(this).closest('.gdlr-core-video-item').find('iframe');
116
117			// vimeo
118			if( video.attr('data-player-type') == 'vimeo' ){
119
120				var player = $f(video[0]);
121							
122				button.on('click', function(){
123					$(this).css('pointer-events', 'none').fadeOut(500, function(e){
124						$(this).remove();
125					});
126
127					video[0].src += "&autoplay=1";
128				});
129			
130			}else if( video.attr('data-player-type') == 'youtube' ){
131
132				button.on('click', function(){
133					$(this).css('pointer-events', 'none').fadeOut(500, function(e){
134						$(this).remove();
135					});
136
137					video[0].src += "&autoplay=1&mute=1";
138				});	
139
140			}
141		});			
142
143		return $(this);
144	}
145
146	// ajax mejs
147	$.fn.gdlr_core_mejs_ajax = function(){
148		if( typeof($.fn.mediaelementplayer) == 'function' ){
149
150			var wpme_settings = {};
151			if( typeof(_wpmejsSettings) !== 'undefined' ){ wpme_settings.pluginPath = _wpmejsSettings.pluginPath; }
152			$(this).find('audio, video').mediaelementplayer(wpme_settings);
153
154		}
155	}
156
157	// counter item
158	$.fn.gdlr_core_counter_item = function( filter_elem ){
159		
160		if( typeof(filter_elem) == 'undefined' ){
161			var elem = $(this).find('.gdlr-core-counter-item-count[data-counter-start][data-counter-end]');
162		}else{
163			var elem = filter_elem.filter('.gdlr-core-counter-item-count[data-counter-start][data-counter-end]');
164		}
165		
166		elem.each(function(){
167			var counter_item = $(this);
168			var start_num = parseInt($(this).attr('data-counter-start'));
169			var end_num = parseInt($(this).attr('data-counter-end'));
170			var duration_time = ($(this).attr('data-duration'))? parseInt($(this).attr('data-duration')): 4000;
171			
172			if( (gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait') || $(window).scrollTop() + $(window).height() > counter_item.offset().top ){
173				$({ counter_num: start_num }).animate({ counter_num: end_num }, { duration: duration_time, easing: 'easeOutExpo', 
174					step: function(){
175						if( this.counter_num > 0.3 ){
176							counter_item.html( Math.round(this.counter_num) );
177						}else{
178							counter_item.html( 0 );
179						}
180						
181					}
182				});
183			}else{
184				$(window).on('scroll pb-scroll', function( e ){
185					if( $(this).scrollTop() + $(window).height() > counter_item.offset().top ){
186						$({ counter_num: start_num }).animate({ counter_num: end_num }, { duration: duration_time,  easing: 'easeOutQuart', 
187							step: function(){
188								if( this.counter_num > 0.3 ){
189									counter_item.html( Math.ceil(this.counter_num) );
190								}else{
191									counter_item.html( 0 );
192								}
193							}
194						});
195						
196						$(this).unbind('scroll pb-scroll', e.handleObj.handler, e);
197					}
198				});
199			}
200		});
201	}
202
203	// typed animation item
204	$.fn.gdlr_core_typed_animation = function( filter_elem ){
205		
206		if( typeof(filter_elem) == 'undefined' ){
207			var elem = $(this).find('.gdlr-core-type-animation-item-animated[data-animation-text]');
208		}else{
209			var elem = filter_elem.filter('.gdlr-core-type-animation-item-animated[data-animation-text]');
210		}
211		
212		elem.each(function(){
213
214			var animation_text = JSON.parse($(this).attr('data-animation-text'));
215			
216			if( typeof($.fn.typed) == 'function' && animation_text && animation_text.length > 0 ){
217				$(this).typed({
218					strings: animation_text,
219					typeSpeed: 50,
220					loop: true
221				});
222			}
223		});
224	}
225
226	// countdown item
227	$.fn.gdlr_core_countdown_item = function( filter_elem ){
228		
229		if( typeof(filter_elem) == 'undefined' ){
230			var elem = $(this).find('.gdlr-core-countdown-wrap');
231		}else{
232			var elem = filter_elem.filter('.gdlr-core-countdown-wrap');
233		}
234		
235		elem.each(function(){
236			var day_field = $(this).find('.gdlr-core-day');
237			var day = parseInt(day_field.text());
238			
239			var hrs_field = $(this).find('.gdlr-core-hrs');
240			var hrs = parseInt(hrs_field.text());
241			
242			var min_field = $(this).find('.gdlr-core-min');
243			var min = parseInt(min_field.text());
244			
245			var sec_field = $(this).find('.gdlr-core-sec');
246			var sec = parseInt(sec_field.text());
247			
248			$(window).on('load', function(){
249				sec_field.text('00');
250				sec_field.css('width', sec_field.width());
251				sec_field.text(sec);
252			});
253
254			var i = setInterval(function(){
255				if( sec > 0 ){
256					sec--;			
257				}else{
258					sec = 59;
259					if( min > 0 ){
260						min--;
261					}else{
262						min = 59;
263						if( hrs > 0 ){
264							hrs--;
265						}else{
266							hrs = 24;
267							if( day > 0 ){
268								day--;
269							}else{
270								day = 0;
271								hrs = 0;
272								min = 0;
273								sec = 0;
274								clearInterval(i);
275							}
276							day_field.text(day);
277						}
278						hrs_field.text(hrs);
279					}
280					min_field.text(min);
281				}
282				sec_field.text(sec);	
283			}, 1000);
284		});
285	}
286
287	// accordion
288	$.fn.gdlr_core_accordion = function( filter_elem ){
289	
290		if( typeof(filter_elem) == 'undefined' ){
291			var elem_title = $(this).find('.gdlr-core-accordion-item-title');
292			var elem_icon = $(this).find('.gdlr-core-accordion-item-icon');
293		}else{
294			var elem_title = filter_elem.filter('.gdlr-core-accordion-item-title');
295			var elem_icon = filter_elem.filter('.gdlr-core-accordion-item-icon');
296		}	
297		
298		elem_title.click(function(){
299			$(this).siblings('.gdlr-core-accordion-item-content').slideDown(200);
300			
301			var item_tab = $(this).closest('.gdlr-core-accordion-item-tab');
302			if( item_tab.hasClass('gdlr-core-active') ){
303				if( item_tab.closest('.gdlr-core-accordion-item').hasClass('gdlr-core-allow-close-all') ){
304					item_tab.removeClass('gdlr-core-active')
305						.find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200);
306				}
307			}else{
308				item_tab.addClass('gdlr-core-active')
309					.siblings('.gdlr-core-active').removeClass('gdlr-core-active')
310					.find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200);
311			}
312		});
313		elem_icon.click(function(){
314			if( $(this).closest('.gdlr-core-accordion-item-title').length ){ return; }
315
316			$(this).siblings('.gdlr-core-accordion-item-content-wrapper').children('.gdlr-core-accordion-item-content').slideDown(200);
317			
318			var item_tab = $(this).closest('.gdlr-core-accordion-item-tab');
319			if( item_tab.hasClass('gdlr-core-active') ){
320				if( item_tab.closest('.gdlr-core-accordion-item').hasClass('gdlr-core-allow-close-all') ){
321					item_tab.removeClass('gdlr-core-active')
322						.find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200);
323				}
324			}else{
325				item_tab.addClass('gdlr-core-active')
326					.siblings('.gdlr-core-active').removeClass('gdlr-core-active')
327					.find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200);
328			}
329		});
330	}
331
332	// toggle_box
333	$.fn.gdlr_core_toggle_box = function( filter_elem ){
334		
335		if( typeof(filter_elem) == 'undefined' ){
336			var elem_title = $(this).find('.gdlr-core-toggle-box-item-title');
337			var elem_icon = $(this).find('.gdlr-core-toggle-box-item-icon');
338		}else{
339			var elem_title = filter_elem.filter('.gdlr-core-toggle-box-item-title');
340			var elem_icon = filter_elem.filter('.gdlr-core-toggle-box-item-icon');
341		}		
342		
343		elem_title.click(function(){
344			var toggle_parent = $(this).closest('.gdlr-core-toggle-box-item-tab');
345			if( toggle_parent.hasClass('gdlr-core-active') ){
346				
347				toggle_parent.removeClass('gdlr-core-active');
348				$(this).siblings('.gdlr-core-toggle-box-item-content').css({display: 'block'}).slideUp(200);
349				
350			}else{
351
352				toggle_parent.addClass('gdlr-core-active');
353				$(this).siblings('.gdlr-core-toggle-box-item-content').css({display: 'none'}).slideDown(200);
354			}
355		});
356		elem_icon.click(function(){
357			if( $(this).closest('.gdlr-core-toggle-box-item-title').length ){ return; }
358			
359			var toggle_parent = $(this).closest('.gdlr-core-toggle-box-item-tab');
360			if( toggle_parent.hasClass('gdlr-core-active') ){
361				toggle_parent.removeClass('gdlr-core-active');
362				$(this).siblings('.gdlr-core-toggle-box-item-content-wrapper').children('.gdlr-core-toggle-box-item-content').css({display: 'block'}).slideUp(200);
363				
364			}else{
365				toggle_parent.addClass('gdlr-core-active');
366				$(this).siblings('.gdlr-core-toggle-box-item-content-wrapper').children('.gdlr-core-toggle-box-item-content').css({display: 'none'}).slideDown(200);
367			}
368		});
369	}	
370
371	// alert box
372	$.fn.gdlr_core_alert_box_item = function( filter_elem ){
373		
374		if( typeof(filter_elem) == 'undefined' ){
375			var elem = $(this).find('.gdlr-core-alert-box-remove');
376		}else{
377			var elem = filter_elem.filter('.gdlr-core-alert-box-remove');
378		}
379		
380		elem.click(function(){ 
381			$(this).closest('.gdlr-core-alert-box-item').slideUp(400, 'easeOutQuart', function(){
382				$(this).remove();
383			});
384		});
385	}
386
387	// particle background
388	$.fn.gdlr_core_particle_background = function( filter_elem ){
389
390		if( typeof(filter_elem) == 'undefined' ){
391			var elem = $(this).find('.gdlr-core-particle-bg');
392		}else{
393			var elem = filter_elem.filter('.gdlr-core-particle-bg');
394		}	
395
396		elem.each(function(){
397			if( typeof(window.gdlr_particle_bg_id) == 'undefined' ){
398				window.gdlr_particle_bg_id = 1;
399			}else{
400				window.gdlr_particle_bg_id++;
401			}
402
403			var item_id = 'gdlr-core-particle' + window.gdlr_particle_bg_id;
404			$(this).attr('id', item_id);
405
406			particlesJS(item_id, {
407			  "particles": {
408			    "number": {
409			      "value": 40,
410			      "density": {"enable": true,"value_area": 1500}
411			    },
412			    "color": {"value": "#ffffff"},
413			    "shape": {
414			      "type": "circle",
415			      "stroke": {"width": 0,"color": "#000000"},
416			      "polygon": {"nb_sides": 5},
417			      "image": {"src": "img/github.svg","width": 100,"height": 100}
418			    },
419			    "opacity": {
420			      "value": 0.8,
421			      "random": false,
422			      "anim": {"enable": false,"speed": 0.6,"opacity_min": 0.1,"sync": false}
423			    },
424			    "size": {
425			      "value": 2,
426			      "random": true,
427			      "anim": {"enable": false,"speed": 80,"size_min": 0.1,"sync": false}
428			    },
429			    "line_linked": {"enable": true,"distance": 300,"color": "#ffffff","opacity": 0.4,"width": 2},
430			    "move": {
431			      "enable": true,
432			      "speed": 12,
433			      "direction": "none",
434			      "random": false,
435			      "straight": false,
436			      "out_mode": "out",
437			      "bounce": false,
438			      "attract": {"enable": false,"rotateX": 600,"rotateY": 1200}
439			    }
440			  },
441			  "interactivity": {
442			    "detect_on": "canvas",
443			    "events": {
444			      "onhover": {"enable": false,"mode": "repulse"},
445			      "onclick": {"enable": false,"mode": "push"},
446			      "resize": true
447			    },
448			    "modes": {
449			      "grab": {"distance": 800,"line_linked": {"opacity": 1}},
450			      "bubble": {"distance": 800,"size": 80,"duration": 2,"opacity": 0.8,"
450speed": 3},
451			      "repulse": {"distance": 400,"duration": 0.4},
452			      "push": {"particles_nb": 4},
453			      "remove": {"particles_nb": 2}
454			    }
455			  },
456			  "retina_detect": true
457			});
458		});
459
460		return $(this);
461	}
462
463	// parallax background
464	$.fn.gdlr_core_parallax_background = function( filter_elem ){
465
466		if( typeof(filter_elem) == 'undefined' ){
467			var elem = $(this).find('.gdlr-core-parallax');
468		}else{
469			var elem = filter_elem.filter('.gdlr-core-parallax');
470		}	
471		
472		elem.each(function(){ 
473			new gdlr_core_parallax($(this)); 
474		});
475
476		return $(this);
477	}
478	
479	var gdlr_core_parallax = function(t){
480		
481		this.wrapper_bg = t;
482		this.wrapper = t.parent(); // background-wrap
483		
484		this.parallax_speed = parseFloat(t.attr('data-parallax-speed'));
485
486		this.init();
487	}
488	gdlr_core_parallax.prototype = {
489		
490		init: function(){
491			
492			var t = this;
493
494			// scroll event
495			if( t.parallax_speed != 0 ){
496				t.set_extra_height();
497				t.set_background_position(t);
498				$(window).on('load resize gdlr-core-element-resize', function(){ 
499					t.set_extra_height($(this)); 
500					t.set_background_position(t);
501				});
502
503				$(window).on('scroll pb-scroll', function(){ 
504					t.set_background_position(t);
505				});
506			}
507			
508			if( gdlr_core_mobile ){
509				t.wrapper_bg.children('[data-background-type="video"]').remove();
510				
511				if( t.wrapper_bg.attr('data-video-fallback') ){
512					t.wrapper_bg.css('background-image', 'url(' + t.wrapper_bg.attr('data-video-fallback') + ')')
513				}
514			}else{
515				t.wrapper_bg.children('[data-background-type="video"]').each(function(){
516					if( t.parallax_speed == 0 ){
517						t.set_extra_height();
518						t.set_background_position(t);
519						$(window).on('load resize gdlr-core-element-resize', function(){ 
520							t.set_extra_height($(this)); 
521							t.set_background_position(t);
522						});
523					}
524
525					// script for muting the vimeo/youtube player
526					$(this).find('iframe').each(function(){
527						if( $(this).attr('data-player-type') == 'vimeo' ){
528							var player = $f($(this)[0]);
529							
530							player.addEvent('ready', function() {
531								player.api('setVolume', 0);
532							});
533						}else if( $(this).attr('data-player-type') == 'youtube' ){
534
535							// assign the script
536							if( $('body').children('#gdlr-core-youtube-api').length == 0 ){
537								$('body').append('<script src="https://www.youtube.com/iframe_api" id="gdlr-core-youtube-api" ></script>');
538							}
539							
540							// store to global variable
541							if( typeof(window.gdlr_core_ytb) == 'undefined' ){
542								window.gdlr_core_ytb = [$(this)[0]];
543							}else{
544								window.gdlr_core_ytb.push($(this)[0]);
545							}
546
547							// script loading action
548							window.onYouTubeIframeAPIReady = function(){
549
550								if( typeof(gdlr_core_ytb) != 'undefined' ){
551									for( var key in window.gdlr_core_ytb ){
552										new YT.Player(gdlr_core_ytb[key],{
553											events: { 
554												'onReady': function(e){
555													e.target.mute();
556												}
557											}						
558										});
559									}
560								}
561							}
562						}
563					});
564				});
565			} // else gdlr_core_mobile
566			
567		}, // init
568		
569		set_extra_height: function(){
570			
571			var t = this;
572			
573			var new_height = t.wrapper.outerHeight();
574			if( gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait' ){
575				t.wrapper_bg.css({'transform': ''});
576			}else{
577				if( t.parallax_speed > 0){
578					new_height += (($(window).height() - t.wrapper.outerHeight()) * t.parallax_speed);
579				}else if( t.parallax_speed < 0){
580					new_height += (($(window).height() + t.wrapper.outerHeight()) * Math.abs(t.parallax_speed));
581				}
582			}
583			t.wrapper_bg.css({height: new_height});
584			
585			// set video height
586			var ratio = parseInt(gdlr_core_pbf.video.width) / parseInt(gdlr_core_pbf.video.height);
587			t.wrapper_bg.children('[data-background-type="video"]').each(function(){
588				if( (t.wrapper_bg.width() / t.wrapper_bg.height()) > ratio ){
589					var v_height = t.wrapper_bg.width() / ratio;
590					var v_margin = (t.wrapper_bg.height() - v_height) / 2;
591					$(this).css({width: t.wrapper_bg.width(), height: v_height, 'margin-left': 0, 'margin-top': v_margin});
592				}else{
593					var v_width = t.wrapper_bg.height() * ratio;
594					var v_margin = (t.wrapper_bg.width() - v_width) / 2;
595					$(this).css({width: v_width, height: t.wrapper_bg.height(), 'margin-left': v_margin, 'margin-top': 0});
596				}
597			});
598			
599		}, // set_extra_height
600		
601		set_background_position: function( t ){
602
603			if( gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait' ) return;
604			
605			var wrapper_top = t.wrapper.offset().top;
606			var scroll_pos = $(window).scrollTop();
607
608			if( scroll_pos + $(window).height() > wrapper_top && 
609				scroll_pos < wrapper_top + t.wrapper.outerHeight() ){
610				
611				if( t.parallax_speed > 0 ){
612					t.wrapper_bg.css({'transform': 'translate(0px, ' + (($(window).scrollTop() - wrapper_top) * t.parallax_speed) + 'px)'});
613				}else if( t.parallax_speed < 0 ){
614					t.wrapper_bg.css({'transform': 'translate(0px, ' + (($(window).scrollTop() + $(window).height() - wrapper_top) * t.parallax_speed) + 'px)'});
615				}
616			}
617		}
618	}; // gdlr_core_parallax
619	
620	// ux animation
621	var gdlr_core_ux = function( container, filter_elem ){
622		
623		if( typeof(filter_elem) == 'undefined' ){
624			this.elem = container.find('[data-gdlr-animation]');
625		}else{
626			this.elem = filter_elem.filter('[data-gdlr-animation]');
627			this.preload = filter_elem.filter('.gdlr-core-page-preload');
628		}
629		
630		this.ux_items = [];
631		this.ux_item_length = 0;
632		
633		this.init();
634
635		// for 3d effects
636		if( !gdlr_core_mobile && gdlr_core_display == 'desktop' ){
637			if( typeof(filter_elem) == 'undefined' ){
638				var elem_3d = container.find('.gdlr-core-effect-3d');
639			}else{
640				var elem_3d = filter_elem.filter('.gdlr-core-effect-3d');
641			}
642			
643			elem_3d.each(function(){
644				var plain = $(this);
645				var max_degree = $(this).attr('data-max-deg');
646				if( max_degree == null ){
647					max_degree = 30;
648				}
649
650				$(this).parent().on('mousemove', function(e){
651					if( !gdlr_core_display == 'desktop' ) return;
652
653					var posX = e.pageX - $(this).offset().left;
654					var posY = e.pageY - $(this).offset().top;
655					var half_width = $(this).outerWidth()/2;
656					var half_height = $(this).outerHeight()/2;
657					var ax = max_degree * -(half_width - posX) / half_width;
658	  				var ay = max_degree * (half_height - posY) / half_height;
659	  				
660	  				plain.removeClass('gdlr-core-animate-transform');
661	  				plain.css({'transform': 'rotateY(' + ax + 'deg) rotateX(' + ay + 'deg)'});
662				});
663				$(this).parent().on('mouseleave', function(e){
664					plain.addClass('gdlr-core-animate-transform');
665					plain.css({'transform': 'rotateY(0deg) rotateX(0deg)'});
666					setTimeout(function (){
667				        plain.removeClass('gdlr-core-animate-transform');
668				    }, 200);
669				});
670			});
671		}
672		
673	} // gdlr_core_ux
674	gdlr_core_ux.prototype = {
675		
676		init: function(){
677			
678			var t = this;
679			
680			t.ux_item_length = t.elem.each(function(){
681				var ux_item = $(this);
682				var ux_item_offset = 0.8;
683				if( $(this).attr('data-gdlr-animation-offset') ){
684					ux_item_offset = parseFloat($(this).attr('data-gdlr-animation-offset'));
685				}
686				
687				// check item at the first time the page is loaded
688				if( (gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait') || $(window).scrollTop() + $(window).height() > ux_item.offset().top ){
689					t.ux_items.push(ux_item);
690					
691				// check the item on scroll event
692				}else{
693					$(window).on('scroll pb-scroll', function(e){
694						if( $(window).scrollTop() + ($(window).height() * ux_item_offset) > ux_item.offset().top ){
695							t.ux_items.push(ux_item);
696							$(window).unbind('scroll', e.handleObj.handler, e);
697						} 
698					});
699				}
700			}).length;
701			
702			/*
703			if( typeof(t.preload) != 'undefined' && t.preload.length ){
704				$(window).on('load', function(){
705					var preload_time = t.preload.attr('data-animation-time');
706					if( !preload_time ){ preload_time = 0; }
707					
708					setTimeout(function(){
709						t.animate();
710					}, preload_time);
711				});
712			}else{
713			*/
714				t.animate();
715			// }
716			
717		},
718		
719		animate: function(){
720			
721			var t = this;
722			
723			// run the ux in order with delay
724			var ux_interval = setInterval(function(){ 
725				
726				while( t.ux_items.length > 0 ){
727
728					// animate the ux item
729					var ux_animate = t.ux_items.shift();
730					var animation_duration = '600ms';
731					if( ux_animate.attr('data-gdlr-animation-duration') ){
732						animation_duration = ux_animate.attr('data-gdlr-animation-duration');
733					}
734
735					ux_animate.css({ 'animation-duration':  animation_duration });
736					ux_animate.addClass(ux_animate.attr('data-gdlr-animation'));
737					
738					// remove selector
739					setTimeout(function(){
740						ux_animate.css({ 'animation-duration':  '' })
741							.removeClass(ux_animate.attr('data-gdlr-animation'))
742							.removeAttr('data-gdlr-animation');
743					}, parseInt(animation_duration));	
744						
745					t.ux_item_length--;
746
747					// if item is inside the screen break while loop
748					if(	$(window).scrollTop() < ux_animate.offset().top + ux_animate.outerHeight() ){
749						break;
750					}
751				}
752				
753				if( t.ux_item_length <= 0 ){
754					clearInterval(ux_interval);
755				}
756			}, 200);
757			
758		}
759		
760	}; // gdlr_core_ux.prototype
761	$.fn.gdlr_core_ux = function( filter_elem ){
762		new gdlr_core_ux( $(this), filter_elem );
763		
764		return $(this);
765	}
766	
767	// skill bar
768	$.fn.gdlr_core_skill_bar = function( filter_elem ){
769
770		if( typeof(filter_elem) == 'undefined' ){
771			var elem = $(this).find('.gdlr-core-skill-bar-filled');
772		}else{
773			var elem = filter_elem.filter('.gdlr-core-skill-bar-filled');
774		}	
775		
776		elem.each(function(){
777			var t = $(this);
778			
779			if( (gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait') || $(window).scrollTop() + $(window).height() > t.offset().top ){
780				t.animate({width: parseInt(t.attr('data-width')) + '%'}, {duration: 1200, easing: 'easeOutQuart'}).addClass('gdlr-core-animate');	
781			}else{
782				$(window).on('scroll pb-scroll', function(e){
783					if( $(window).scrollTop() + $(window).height() > t.offset().top ){
784						t.animate({width: parseInt(t.attr('data-width')) + '%'}, {duration: 1200, easing: 'easeOutQuart'}).addClass('gdlr-core-animate');
785						$(window).unbind('scroll pb-scroll', e.handleObj.handler, e);
786					} 
787				});
788			}
789		});
790	}
791	
792	// divider width
793	$.fn.gdlr_core_divider = function( filter_elem ){
794
795		if( typeof(filter_elem) == 'undefined' ){
796			var elem = $(this).find('.gdlr-core-divider-item-with-icon-inner');
797		}else{
798			var elem = filter_elem.filter('.gdlr-core-divider-item-with-icon-inner');
799		}
800	
801		elem.each(function(){
802			var divider_elem = $(this);
803			var icon_width = divider_elem.children('i, img').outerWidth();
804			var divider_width = (divider_elem.width() - icon_width) / 2;
805			$(this).children('.gdlr-core-divider-line').css({ width: divider_width }).each(function(){
806				$(this).css('margin-top', -$(this).outerHeight()/2);
807			});
808
809			$(window).on('resize gdlr-core-element-resize', function(){
810				icon_width = divider_elem.children('i, img').outerWidth();
811				divider_width = (divider_elem.width() - icon_width) / 2;
812				divider_elem.children('.gdlr-core-divider-line').css({ width: divider_width }).each(function(){
813					$(this).css('margin-top', -$(this).outerHeight()/2);
814				});
815			});
816		});
817		
818	}	
819
820	window.gdlr_core_sidebar_wrapper = function( container, filter_elem ){
821
822		if( typeof(filter_elem) == 'undefined' ){
823			this.elem = container.find('.gdlr-core-page-builder-wrapper-sidebar-container, .gdlr-core-pbf-sidebar-container');
824		}else{
825			this.elem = filter_elem.filter('.gdlr-core-page-builder-wrapper-sidebar-container, .gdlr-core-pbf-sidebar-container');
826		}
827
828		this.init();
829
830	}
831	gdlr_core_sidebar_wrapper.prototype = {
832
833		init: function(){
834
835			var t = this;
836
837			// if no background, don't sync height
838			var sync_height = false;
839			t.elem.each(function(){
840				if( $(this).children().children('.gdlr-core-pbf-background-wrap').length ){
841					sync_height = true;
842				}
843			});
844
845			// sync the height
846			if( sync_height ){
847				t.set_height();
848				$(window).on('load resize gdlr-core-element-resize', function(){ t.set_height(); });
849			}
850		},
851
852		set_height: function(){
853
854			var t = this;
855
856			t.elem.each(function(){
857
858				var sidebar_elem = $(this).find('.gdlr-core-pbf-sidebar-padding');
859				sidebar_elem.css('min-height', '');
860
861				if( gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait' ) return;
862				
863				// determine max height
864				var max_height = 0;
865				sidebar_elem.each(function(){
866					if( $(this).outerHeight() > max_height ){
867						max_height = $(this).outerHeight();
868					}
869				});
870
871				// set the height
872				sidebar_elem.css('min-height', max_height);
873
874			});
875			
876		}
877
878	};
879
880	// title divider width
881	$.fn.gdlr_core_title_divider = function( filter_elem ){
882
883		if( typeof(filter_elem) == 'undefined' ){
884			var elem = $(this).find('.gdlr-core-title-item-title-wrap.gdlr-core-with-divider');
885		}else{
886			var elem = filter_elem.filter('.gdlr-core-title-item-title-wrap.gdlr-core-with-divider');
887		}
888	
889		elem.each(function(){
890
891			var t = $(this);
892			var divider = t.children('.gdlr-core-title-item-divider');
893			var divider_num = t.children('.gdlr-core-title-item-divider').length;
894			divider_num = (divider_num)? divider_num: 1;
895			
896			var title_width = t.children('.gdlr-core-title-item-title').outerWidth(true);
897			var divider_width = (t.width() - title_width) / divider_num;
898			if( t.children('.gdlr-core-title-item-link').length ){
899				var right_pos = t.children('.gdlr-core-title-item-link').outerWidth() + 20;
900				divider_width = divider_width - right_pos;
901			}
902	
903			// for right divider with link text
904			if( t.children('.gdlr-core-title-item-link').length ){
905				divider.css({ width: divider_width, right: right_pos });
906			}else{
907				divider.css({ width: divider_width });
908			}
909
910			$(window).on('resize gdlr-core-element-resize', function(){
911				title_width = t.children('.gdlr-core-title-item-title').outerWidth(true);
912				divider_width = (t.width() - title_width) / divider_num;
913				if( t.children('.gdlr-core-title-item-link').length ){
914					right_pos = t.children('.gdlr-core-title-item-link').outerWidth() + 20;
915					divider_width = divider_width - right_pos;
916				}
917
918				// for right divider with link text
919				if( t.children('.gdlr-core-title-item-link').length ){
920					divider.css({ width: divider_width, right: right_pos });
921				}else{
922					divider.css({ width: divider_width });
923				}
924			});
925		});
926
927		if( typeof(filter_elem) == 'undefined' ){
928			var elem2 = $(this).find('.gdlr-core-title-item-title-wrap.gdlr-core-with-link-text');
929		}else{
930			var elem2 = filter_elem.filter('.gdlr-core-title-item-title-wrap.gdlr-core-with-link-text');
931		}
932		elem2.each(function(){
933			var t = $(this);
934			var title_width = t.children('.gdlr-core-title-item-title').outerWidth(true);
935			var right_pos = t.children('.gdlr-core-title-item-link').outerWidth();
936
937			if( t.width() < title_width + right_pos ){
938				t.children('.gdlr-core-title-item-link').addClass('gdlr-core-overflow');
939			}else{
940				t.children('.gdlr-core-title-item-link').removeClass('gdlr-core-overflow');
941			}
942
943			$(window).on('resize gdlr-core-element-resize', function(){
944				if( t.width() < title_width + right_pos ){
945					t.children('.gdlr-core-title-item-link').addClass('gdlr-core-overflow');
946				}else{
947					t.children('.gdlr-core-title-item-link').removeClass('gdlr-core-overflow');
948				}
949			});
950
951		});
952		
953	}
954
955	$.fn.gdlr_core_flipbox = function( filter_elem ){
956		if(typeof($.fn.flip) == 'function'){
957			
958			if( typeof(filter_elem) == 'undefined' ){
959				var elem = $(this).find('.gdlr-core-flipbox');
960			}else{
961				var elem = filter_elem.filter('.gdlr-core-flipbox');
962			}			
963			
964			elem.each(function(){
965				var flipbox_obj = $(this).flip({
966					axis: 'y',
967					trigger: 'hover',
968					autoSize: false,
969					front: '.gdlr-core-flipbox-front',
970					back: '.gdlr-core-flipbox-back'
971				});
972
973				$(this).find('.gdlr-core-flipbox-back a').click(function(){
974					if( flipbox_obj.data('flip-model') ){
975						flipbox_obj.data('flip-model').unflip();
976					}
977				});
978				
979				$(this).addClass('gdlr-core-after-init');
980			});
981		}
982
983		return $(this);
984	}
985	
986	// marquee
987	$.fn.gdlr_core_marquee = function( filter_elem ){
988		if( typeof(filter_elem) == 'undefined' ){
989			var elem = $(this).find('.gdlr-core-marquee');
990		}else{
991			var elem = filter_elem.filter('.gdlr-core-marquee');
992		}
993
994		elem.each(function(){
995			var speed = $(this).attr('data-speed')? parseFloat($(this).attr('data-speed')): 10000;
996			var direction = $(this).attr('data-direction')? parseFloat($(this).attr('data-direction')): 'left';
997
998			$(this).marquee({
999				//time in milliseconds before the marquee will start animating
1000			    delayBeforeStart: 0,
1001			    //speed in milliseconds of the marquee
1002			    duration: speed,
1003			    //gap in pixels between the tickers
1004			    gap: 50,
1005			    //'left' or 'right'
1006			    direction: direction,
1007			    //true or false - should the marquee be duplicated to show an effect of continues flow
1008			    duplicated: true,
1009			    // the marquee is visible initially positioned next to the border towards it will be moving
1010			    startVisible: true
1011			});
1012		});
1013
1014		return $(this);
1015	}
1016
1017	// pie chart
1018	function gdlr_core_skill_circle_height(t){
1019		t.children('.gdlr-core-skill-circle-content').each(function(){
1020			$(this).css({'margin-top': -$(this).outerHeight()/2});
1021		});
1022		t.css({'max-width': t.parent().width(), 'max-height': t.parent().width()});	
1023	}
1024	$.fn.gdlr_core_pie_chart = function(){
1025		if(typeof($.fn.easyPieChart) == 'function'){
1026			$(this).easyPieChart({
1027				animate: parseInt($(this).attr('data-duration')),
1028				lineWidth: parseInt($(this).attr('data-line-width')),
1029				size: parseInt($(this).attr('data-width')),
1030				barColor: $(this).attr('data-filled-color'),
1031				trackColor: $(this).attr('data-filled-background'),
1032				scaleColor: false,
1033				lineCap: 'square'
1034			});
1035		}
1036	}
1037	$.fn.gdlr_core_skill_circle = function( filter_elem ){
1038		
1039		if( typeof(filter_elem) == 'undefined' ){
1040			var elem = $(this).find('.gdlr-core-skill-circle');
1041		}else{
1042			var elem = filter_elem.filter('.gdlr-core-skill-circle');
1043		}		
1044		
1045		elem.each(function(){
1046			var t = $(this);
1047
1048			// for responsive
1049			gdlr_core_skill_circle_height(t);
1050			$(window).on('resize gdlr-core-element-resize', function(){ gdlr_core_skill_circle_height(t); });
1051			
1052			// scroll action
1053			if( $(window).scrollTop() + $(window).height() > t.offset().top ){
1054				t.gdlr_core_pie_chart();
1055			}else{
1056				$(window).on('scroll pb-scroll', function(e){
1057					if( $(window).scrollTop() + $(window).height() > t.offset().top ){
1058						t.gdlr_core_pie_chart();
1059						$(window).unbind('scroll pb-scroll', e.handleObj.handler, e);
1060					} 
1061				});
1062			}
1063		});
1064	}
1065	
1066	// chart.js
1067	$.fn.gdlr_core_chart_js = function( filter_elem ){
1068		
1069		if( typeof(filter_elem) == 'undefined' ){
1070			var elem = $(this).find('.gdlr-core-chart-js');
1071		}else{
1072			var elem = filter_elem.filter('.gdlr-core-chart-js');
1073		}		
1074
1075		if( typeof(window.gdlr_core_chart_js_id) == 'undefined' ){
1076			window.gdlr_core_chart_js_id = 0;
1077		}
1078
1079		elem.each(function(){
1080
1081			var data = [];
1082			var options = [];
1083			if( $(this).attr('data-content') ){
1084				data = JSON.parse($(this).attr('data-content'));
1085			}
1086			if( $(this).attr('data-options') ){
1087				options = JSON.parse($(this).attr('data-options'));
1088			}
1089
1090			if( $(this).attr('data-type') == 'doughnut' || $(this).attr('data-type') == 'pie' ){
1091				if( options.legend.position == 'right' || options.legend.position == 'left' ){
1092					if( gdlr_core_display == 'mobile-portrait' || gdlr_core_display == 'mobile-landscape' ){
1093						options.legend.orig_position = options.legend.position;
1094						options.legend.position = 'bottom';
1095						$(this).attr('width', $(this).width());
1096						$(this).attr('height', $(this).width() * 1);
1097					}
1098				}
1099			}
1100			options.onResize = function(chart, size){
1101				if( chart.config.type == 'doughnut' || chart.config.type == 'pie' ){
1102					if( chart.config.options.legend.position == 'right' || chart.config.options.legend.position == 'left' ){
1103						if( gdlr_core_display == 'mobile-portrait' || gdlr_core_display == 'mobile-landscape' ){
1104							chart.config.options.legend.orig_position = chart.config.options.legend.position;
1105							chart.config.options.legend.position = 'bottom';
1106							chart.aspectRatio = 1;
1107						}
1108					}else if( typeof(chart.config.options.legend.orig_position) != 'undefined' ){
1109						if( gdlr_core_display == 'tablet' || gdlr_core_display == 'desktop' ){
1110							chart.config.options.legend.position = chart.config.options.legend.orig_position;
1111							chart.aspectRatio = 2;
1112						}
1113					}
1114					
1115				}
1116				
1117			}
1118
1119			new Chart($(this), {
1120			    type: $(this).attr('data-type')? $(this).attr('data-type'): 'pie',
1121			    data: data,
1122			   	options: options
1123			});	
1124
1125		});
1126
1127	} // gdlr_core_chart_js
1128		
1129	// tab
1130	$.fn.gdlr_core_tab = function( filter_elem ){
1131		
1132		if( typeof(filter_elem) == 'undefined' ){
1133			var elem = $(this).find('.gdlr-core-tab-item, .gdlr-core-tab-action, .gdlr-core-roadmap-item, .gdlr-core-tab-feature-item, .gdlr-core-tab-feature2-item, .gdlr-core-tab-feature3-item, .gdlr-core-tab-featurev-item');
1134		}else{
1135			var elem = filter_elem.filter('.gdlr-core-tab-item, .gdlr-core-tab-action, .gdlr-core-roadmap-item, .gdlr-core-tab-feature-item, .gdlr-core-tab-feature2-item, .gdlr-core-tab-feature3-item, .gdlr-core-tab-featurev-item');
1136		}		
1137		
1138		elem.each(function(){
1139			
1140			// click action
1141			$(this).find('.gdlr-core-tab-item-title, .gdlr-core-tab-action-title, .gdlr-core-roadmap-item-head, .gdlr-core-tab-feature-title-wrap, .gdlr-core-tab-feature2-title-wrap, .gdlr-core-tab-feature3-title-wrap, .gdlr-core-tab-featurev-title').click(function(){
1142				if( $(this).hasClass('gdlr-core-active') ) return;
1143				
1144				var tab_id = $(this).attr('data-tab-id');
1145				
1146				$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
1147
1148				// for tab feature vertical
1149				if( $(this).is('.gdlr-core-tab-featurev-title') ){
1150					var parent = $(this).parent().parent();
1151
1152					parent.closest('.gdlr-core-tab-featurev-item').find('.gdlr-core-tab-featurev-background-switch').each(function(){
1153						$(this).children().removeClass('gdlr-core-active');
1154						$(this).children('[data-tab-id="' + tab_id + '"]').addClass('gdlr-core-active');
1155					});
1156				}else{
1157					var parent = $(this).parent();
1158				}
1159				parent.siblings('.gdlr-core-tab-item-content-wrap, .gdlr-core-tab-action-content-wrap, .gdlr-core-roadmap-item-content-wrap, .gdlr-core-tab-feature-item-content-wrap, .gdlr-core-tab-feature2-item-content-wrap, .gdlr-core-tab-feature3-item-content-wrap, .gdlr-core-tab-featurev-item-content-wrap').each(function(){
1160					var active_tab = $(this).children('[data-tab-id="' + tab_id + '"]');
1161
1162					if( active_tab.length ){
1163						active_tab.fadeIn(200).siblings().hide();
1164					}else{
1165						$(this).children().hide();
1166					}
1167				});
1168				
1169			});
1170			
1171			// hover action
1172			if( !(gdlr_core_mobile || gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait') && 
1173				$(this).is('.gdlr-core-tab-feature2-item, .gdlr-core-tab-feature3-item') ){
1174
1175				var slide_bar_width = 35;
1176				var slide_bar = $(this).find('.gdlr-core-tab-feature2-bottom-slide-bar, .gdlr-core-tab-feature3-bottom-slide-bar');
1177				var active_tab = slide_bar.siblings('.gdlr-core-active');
1178				
1179				if( active_tab.length ){
1180					if( active_tab.is('.gdlr-core-tab-feature3-title-wrap') ){
1181						slide_bar_width = active_tab.outerWidth();
1182					}
1183					slide_bar.css({ width: slide_bar_width, left: active_tab.position().left + (active_tab.width() - slide_bar_width)/2 });
1184				}
1185				$(window).resize(function(){
1186					active_tab = slide_bar.siblings('.gdlr-core-active');
1187					if( active_tab.is('.gdlr-core-tab-feature3-title-wrap') ){
1188						slide_bar_width = active_tab.outerWidth();
1189					}
1190					slide_bar.css({ width: slide_bar_width, left: active_tab.position().left + (active_tab.width() - slide_bar_width)/2 });
1191				});
1192				$(this).find('.gdlr-core-tab-feature2-title-wrap, .gdlr-core-tab-feature3-title-wrap').click(function(){
1193					active_tab = $(this);
1194				});
1195				$(this).find('.gdlr-core-tab-feature2-title-wrap, .gdlr-core-tab-feature3-title-wrap').hover(function(){
1196					if( $(this).is('.gdlr-core-tab-feature3-title-wrap') ){
1197						slide_bar_width = $(this).outerWidth();
1198					}
1199					slide_bar.animate({ width: slide_bar_width, left: $(this).position().left + ($(this).width() - slide_bar_width)/2 }, {duration: 200, queue: false});
1200				}, function(){
1201					if( $(this).is('.gdlr-core-tab-feature3-title-wrap') ){
1202						slide_bar_width = $(this).outerWidth();
1203					}
1204					slide_bar.animate({ width: slide_bar_width, left: active_tab.position().left + (active_tab.width() - slide_bar_width)/2 }, {duration: 200, queue: false});
1205				});
1206				
1207			}
1208
1209			if( !(gdlr_core_mobile || gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait') && 
1210				$(this).is('.gdlr-core-tab-style2-horizontal, .gdlr-core-tab-style2-vertical, .gdlr-core-tab-style3-horizontal') ){
1211
1212				var horizontal = $(this).is('.gdlr-core-tab-style2-horizontal, .gdlr-core-tab-style3-horizontal');
1213				var hover_line = $(this).find('.gdlr-core-tab-item-title-line');
1214				var hover_line_w = 0;
1215				var hover_line_l = 0;
1216				
1217				// initiate
1218				$(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-active').each(function(){
1219					if( horizontal ){
1220						hover_line_w = $(this).outerWidth();
1221						hover_line_l = $(this).position().left;
1222						hover_line.css({ width: hover_line_w, left: hover_line_l });
1223					}else{
1224						hover_line_w = $(this).outerHeight();
1225						hover_line_l = $(this).position().top;
1226						hover_line.css({ height: hover_line_w, top: hover_line_l });
1227					}
1228					hover_line.addClass('gdlr-core-initiated');
1229				});
1230				$(window).on('resize gdlr-core-element-resize', function(){
1231					$(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-active').each(function(){
1232						if( horizontal ){
1233							hover_line_w = $(this).outerWidth();
1234							hover_line_l = $(this).position().left;
1235							hover_line.css({ width: hover_line_w, left: hover_line_l });
1236						}else{
1237							hover_line_w = $(this).outerHeight();
1238							hover_line_l = $(this).position().top;
1239							hover_line.css({ height: hover_line_w, top: hover_line_l });
1240						}
1241					});
1242				});
1243				
1244				// animate
1245				$(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-tab-item-title').hover(function(){
1246					if( horizontal ){
1247						hover_line.animate({ width: $(this).outerWidth(), left: $(this).position().left }, { duration: 300, easing: 'easeOutQuart', queue: false });
1248					}else{
1249						hover_line.animate({ height: $(this).outerHeight(), top: $(this).position().top }, { duration: 300, easing: 'easeOutQuart', queue: false });
1250					}
1251				}, function(){
1252					if( horizontal ){
1253						hover_line.animate({ width: hover_line_w, left: hover_line_l }, { duration: 300, easing: 'easeOutQuart', queue: false });
1254					}else{
1255						hover_line.animate({ height: hover_line_w, top: hover_line_l }, { duration: 300, easing: 'easeOutQuart', queue: false });
1256					}
1257				});
1258				
1259				// click
1260				$(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-tab-item-title').click(function(){
1261					if( horizontal ){
1262						hover_line_w = $(this).outerWidth();
1263						hover_line_l = $(this).position().left;
1264						hover_line.css({ width: hover_line_w, left: hover_line_l });
1265					}else{
1266						hover_line_w = $(this).outerHeight();
1267						hover_line_l = $(this).position().top;
1268						hover_line.css({ height: hover_line_w, top: hover_line_l });
1269					}
1270				});
1271			}
1272		});
1273
1274		return $(this);
1275		
1276	} // gdlr_core_tab
1277
1278	$.fn.gdlr_core_price_table_tab = function( filter_elem ){
1279		if( typeof(filter_elem) == 'undefined' ){
1280			var elem = $(this).find('.gdlr-core-price-table-tab-title-wrap');
1281		}else{
1282			var elem = filter_elem.filter('.gdlr-core-price-table-tab-title-wrap');
1283		}
1284
1285		elem.each(function(){
1286
1287			var tab_title = $(this);
1288			tab_title.find('.gdlr-core-price-table-tab-title').on('click', function(){
1289				if( $(this).hasClass('gdlr-core-active') ) return;
1290
1291				var price_tab = $(this).attr('data-price-tab');
1292				$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
1293				tab_title.siblings('.gdlr-core-price-table-tab-content-wrap').find('[data-price-tab="' + price_tab + '"]').each(function(){
1294					$(this).siblings('.gdlr-core-active').css({display: 'none'}).removeClass('gdlr-core-active');
1295					$(this).fadeIn(200).addClass('gdlr-core-active');
1296				});
1297			});
1298
1299		});
1300	}
1301	
1302	$.fn.gdlr_core_sly = function( filter_elem ){
1303
1304		if( typeof(filter_elem) == 'undefined' ){
1305			var elem = $(this).find('.gdlr-core-sly-slider');
1306		}else{
1307			var elem = filter_elem.filter('.gdlr-core-sly-slider');
1308		}	
1309	
1310		elem.addClass('gdlr-core-after-init').each(function(){
1311			var sly_slider = $(this);
1312
1313			sly_slider.sly({
1314				horizontal: 1,
1315				itemNav: 'basic',
1316				smart: 1,
1317				activateOn: 'click',
1318				mouseDragging: 1,
1319				touchDragging: 1,
1320				releaseSwing: 1,
1321				startAt: 0,
1322				scrollBy: 1,
1323				speed: 1000,
1324				elasticBounds: 1,
1325				easing: 'easeOutQuart',
1326				dragHandle: 1,
1327				dynamicHandle: 1,
1328				clickBar: 1,
1329				scrollBar: $(this).siblings('.gdlr-core-sly-scroll')
1330			});
1331			$(window).on('resize gdlr-core-element-resize', function(){ sly_slider.sly('reload'); });
1332		});
1333
1334		return $(this);
1335
1336	} // gdlr-core_sly
1337
1338	$.fn.gdlr_core_flexslider = function( filter_elem ){
1339
1340		if( typeof(filter_elem) == 'undefined' ){
1341			var elem = $(this).find('.gdlr-core-flexslider');
1342		}else{
1343			var elem = filter_elem.filter('.gdlr-core-flexslider');
1344		}	
1345	
1346		elem.each(function(){
1347
1348			var flex_attr = {
1349				useCSS: false,
1350				animation: 'fade',
1351				animationLoop: true,
1352				prevText: '<i class="arrow_carrot-left"></i>',
1353				nextText: '<i class="arrow_carrot-right"></i>'
1354			};
1355
1356			if( $(this).attr('data-start-at') && $(this).attr('data-start-at') > 1 ){
1357				flex_attr.startAt = $(this).attr('data-start-at') - 1;
1358			}
1359
1360			if( $(this).find('.gdlr-core-flexslider').length > 0 ){ 
1361				$(this).children('ul.slides').addClass('parent-slides');
1362				flex_attr.selector = '.parent-slides > li';
1363			}
1364
1365			// variable settings
1366			if( $(this).attr('data-disable-autoslide') ){
1367				flex_attr.slideshow = false;
1368			}
1369			if( $(this).attr('data-pausetime') ){
1370				flex_attr.slideshowSpeed = parseInt($(this).attr('data-pausetime'));
1371			}
1372			if( $(this).attr('data-slidespeed') ){
1373				flex_attr.animationSpeed = parseInt($(this).attr('data-slidespeed'));
1374			}else{
1375				flex_attr.animationSpeed = 500;
1376			}
1377
1378			// for carousel
1379			if( $(this).attr('data-type') == 'carousel' ){
1380				flex_attr.move = $(this).attr('data-move')? parseInt($(this).attr('data-move')): 1;
1381				flex_attr.animation = 'slide';
1382
1383				// determine the spaces
1384				var column_num = parseInt($(this).attr('data-column'));
1385				if( $(this).attr('data-margin') ){
1386					flex_attr.itemMargin = parseInt($(this).attr('data-margin'));
1387				}else{
1388					flex_attr.itemMargin = 2 * parseInt($(this).children('ul.slides').children('li:first-child').css('margin-right'));
1389				}
1390				flex_attr.itemWidth = (($(this).width() + flex_attr.itemMargin) / column_num) - (flex_attr.itemMargin);
1391
1392				flex_attr.minItems = column_num;
1393				flex_attr.maxItems = column_num;
1394				
1395				var t = $(this);
1396				$(window).on('resize gdlr-core-element-resize', function(){
1397					if( t.data('goodlayers_flexslider') ){
1398						var newWidth = ((t.width() + flex_attr.itemMargin) / column_num) - (flex_attr.itemMargin);
1399						t.data('goodlayers_flexslider').editItemWidth(newWidth);
1400					}
1401				});
1402
1403			}else if( $(this).attr('data-effect') ){
1404				if( $(this).attr('data-effect') == 'kenburn' ){
1405					flex_attr.animation = 'fade';
1406				}else{
1407					flex_attr.animation = $(this).attr('data-effect');
1408				}
1409			}
1410
1411			// for navigation
1412			var data_nav = ['both', 'navigation', 'navigation-outer-plain-round', 'navigation-top', 'navigation-bottom', 'navigation-inner', 'navigation-outer'];
1413			if( !$(this).attr('data-nav') || data_nav.indexOf($(this).attr('data-nav')) != -1 ){
1414				if( !$(this).hasClass('gdlr-core-bottom-nav-1') ){ /* old style fallback */
1415					if( $(this).attr('data-nav-parent') ){
1416						if( $(this).attr('data-nav-parent') == 'self' ){
1417							flex_attr.customDirectionNav = $(this).find('.flex-prev, .flex-next');
1418						}if( $(this).attr('data-nav-type') == 'custom' ){
1419							flex_attr.customDirectionNav = $(this).closest('.' + $(this).attr('data-nav-parent')).find('.flex-prev, .flex-next');
1420						}else{
1421							$(this).closest('.' + $(this).attr('data-nav-parent')).each(function(){
1422								var flex_nav = $('<ul class="flex-direction-nav">' + 
1423												'<li class="flex-nav-prev"><a class="flex-prev" aria-label="left arrow" href="#"><i class="arrow_carrot-left"></i></a></li>' +
1424												'<li class="flex-nav-next"><a class="flex-next" aria-label="right arrow" href="#"><i class="arrow_carrot-right"></i></a></li>' +
1425											'</ul>');
1426
1427								var flex_nav_position = $(this).find('.gdlr-core-flexslider-nav');
1428								if( flex_nav_position.length ){
1429									flex_nav_position.append(flex_nav);
1430									flex_attr.customDirectionNav = flex_nav.find('.flex-prev, .flex-next');
1431								}
1432							});
1433						}
1434					}
1435				}
1436			}else{
1437				flex_attr.directionNav = false;
1438			}
1439			if( $(this).attr('data-nav') == 'both' || $(this).attr('data-nav') == 'bullet' ){
1440				flex_attr.controlNav = true;
1441			}else{
1442				flex_attr.controlNav = false;
1443			}
1444
1445			// for thumbnail 
1446			if( $(this).attr('data-thumbnail') ){
1447				var thumbnail_slide = $(this).siblings('.gdlr-core-sly-slider');
1448
1449				flex_attr.manualControls = thumbnail_slide.find('ul.slides li')
1450				flex_attr.controlNav = true;
1451			}
1452
1453			// center the navigation
1454			// add active class for kenburn effects
1455			if( $(this).attr('data-vcenter-nav') ){
1456				flex_attr.start = function(slider){
1457					$(slider).children('.gdlr-core-flexslider-custom-nav.gdlr-core-style-navigation-outer').each(function(){
1458						$(this).insertAfter($(slider).children('.flex-viewport'));
1459					});
1460					if( slider.directionNav ){
1461						$(window).on('resize gdlr-core-element-resize', function(){
1462							slider.directionNav.each(function(){
1463								var margin = -(slider.height() + $(this).outerHeight()) / 2;
1464								$(this).css('margin-top', margin);
1465							});
1466						});
1467					}
1468					if( typeof(slider.slides) != 'undefined' ){
1469						$(window).trigger('gdlr-core-element-resize');
1470						slider.slides.filter('.flex-active-slide').addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
1471					}
1472				};
1473			}else{
1474				flex_attr.start = function(slider){
1475					if( typeof(slider.slides) != 'undefined' ){
1476
1477						if( $(slider).attr('data-controls-top-margin') ){
1478							$(slider).find('.flex-control-nav').css({ 'margin-top': $(slider).attr('data-controls-top-margin') });
1479						}
1480						
1481						$(slider).children('.gdlr-core-flexslider-custom-nav.gdlr-core-style-navigation-bottom').each(function(){
1482							$(this).insertAfter($(slider).children('.flex-viewport'));
1483						});
1484
1485						$(window).trigger('gdlr-core-element-resize');
1486						slider.slides.filter('.flex-active-slide').addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
1487					}
1488				}
1489			}
1490
1491			// add the action for class
1492			flex_attr.after = function(slider){
1493				slider.slides.filter('.flex-active-slide').addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
1494			}
1495
1496			// add outer frame class
1497			if( $(this).find('.gdlr-core-outer-frame-element').length > 0 ){
1498				$(this).addClass('gdlr-core-with-outer-frame-element');
1499			}
1500
1501			$(this).goodlayers_flexslider(flex_attr);
1502		});
1503
1504		return $(this);
1505
1506	} // gdlr-core-flexslier
1507
1508	window.gdlr_core_sticky_sidebar = function( filter_elem ){
1509
1510		if( typeof(filter_elem) == 'undefined' ){
1511			this.elem = $(this).find('.gdlr-core-sticky-sidebar');
1512		}else{
1513			this.elem = filter_elem.filter('.gdlr-core-sticky-sidebar');
1514		}
1515
1516		this.init();
1517
1518	}
1519	gdlr_core_sticky_sidebar.prototype = {
1520
1521		init: function(){
1522
1523			var t = this;
1524			t.elem.each(function(){
1525				$(this).find('.gdlr-core-pbf-sidebar-left, .gdlr-core-pbf-sidebar-right, .gdlr-core-sidebar-script').each(function(){
1526
1527					var sidebar_item = $(this);
1528					var sidebar_wrap = sidebar_item.parent();
1529					var sidebar_sub = $('<div></div>');
1530
1531					var prev_scroll = 0;
1532					$(window).on('scroll resize', function(e){
1533						
1534						// sidebar larger than content
1535						if( sidebar_item.outerHeight() >= sidebar_wrap.outerHeight() ){
1536							t.return_sidebar_pos(sidebar_sub, sidebar_item);
1537							return;
1538						} 
1539
1540						// not in desktop
1541						if( gdlr_core_display != 'desktop' ){
1542							t.return_sidebar_pos(sidebar_sub, sidebar_item);
1543							return;
1544						}
1545
1546						var scroll_pos = $(window).scrollTop();
1547						var scroll_direction = (prev_scroll > scroll_pos)? 'up': 'down';
1548						prev_scroll = scroll_pos;
1549
1550						// sidebar smaller than screen
1551						if( $(window).height() > sidebar_item.height() ){
1552
1553							if( scroll_pos <= sidebar_wrap.offset().top ){
1554
1555								if( sidebar_item.hasClass('gdlr-core-fixed-sidebar') || sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar') ){
1556									t.return_sidebar_pos(sidebar_sub, sidebar_item);
1557								}
1558
1559							}else{
1560								
1561								// overflow the content - stick to the bottom
1562								if( scroll_pos + sidebar_item.outerHeight() >= sidebar_wrap.offset().top + sidebar_wrap.outerHeight() ){
1563									
1564									if( !sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar') ){
1565										t.set_sidebar_sub(sidebar_sub, sidebar_item);
1566
1567										sidebar_item.addClass('gdlr-core-fixed-bottom-sidebar').removeClass('gdlr-core-fixed-sidebar');
1568										sidebar_item.css({
1569											'position': 'absolute',
1570											'top': 'auto',
1571											'bottom': 0,
1572											'left': sidebar_sub.position().left,
1573											'width': sidebar_sub.outerWidth()
1574										});
1575									}
1576									
1577								// inside the content - fixed at the top
1578								}else{
1579
1580									if( !sidebar_item.hasClass('gdlr-core-fixed-sidebar') ){
1581										
1582										t.set_sidebar_sub(sidebar_sub, sidebar_item);
1583
1584										sidebar_item.addClass('gdlr-core-fixed-sidebar').removeClass('gdlr-core-fixed-bottom-sidebar');
1585										sidebar_item.css({
1586											'position': 'fixed',
1587											'top': 0,
1588											'bottom': 'auto',
1589											'width': sidebar_sub.outerWidth()
1590										});
1591										sidebar_item.css({
1592											'left': sidebar_sub.offset().left,
1593										});
1594
1595									}
1596
1597								}
1598
1599								if( e.type == 'resize' ){
1600
1601									if( sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar') ){
1602										sidebar_item.css({ 
1603											'width': sidebar_sub.outerWidth(),
1604											'left': sidebar_sub.position().left,
1605										});
1606									}else if( sidebar_item.hasClass('gdlr-core-fixed-sidebar') ){
1607										sidebar_item.css({ 
1608											'width': sidebar_sub.outerWidth(),
1609											'left': sidebar_sub.offset().left,
1610										});
1611									}
1612
1613								}
1614															
1615							}
1616
1617						// sidebar larger than screen
1618						}else{
1619
1620							// to the top
1621							if( scroll_pos <= sidebar_wrap.offset().top ){
1622
1623								if( sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar') || sidebar_item.hasClass('gdlr-core-stick-bottom-sidebar') ||
1624									sidebar_item.hasClass('gdlr-core-fixed-top-sidebar') || sidebar_item.hasClass('gdlr-core-stick-top-sidebar') ){
1625									t.return_sidebar_pos(sidebar_sub, sidebar_item);
1626								}
1627
1628							}else{
1629
1630								// scroll direction down
1631								if( scroll_direction == 'down' ){
1632
1633									if( sidebar_item.hasClass('gdlr-core-fixed-top-sidebar') ){
1634
1635										t.set_sidebar_sub(sidebar_sub, sidebar_item);
1636
1637										sidebar_item.addClass('gdlr-core-stick-top-sidebar').removeClass('gdlr-core-fixed-bottom-sidebar gdlr-core-fixed-top-sidebar gdlr-core-stick-bottom-sidebar');
1638										sidebar_item.css({
1639											'position': 'absolute',
1640											'top': scroll_pos - sidebar_wrap.offset().top,
1641											'bottom': 'auto',
1642											'left': sidebar_sub.position().left,
1643											'width': sidebar_sub.outerWidth()
1644										});
1645
1646									// stick at the bottom
1647									}else if( scroll_pos + $(window).height() >= sidebar_wrap.offset().top + sidebar_wrap.outerHeight() ){
1648
1649										t.set_sidebar_sub(sidebar_sub, sidebar_item);
1650
1651										sidebar_item.addClass('gdlr-core-stick-bottom-sidebar').removeClass('gdlr-core-fixed-bottom-sidebar gdlr-core-fixed-top-sidebar gdlr-core-stick-top-sidebar');
1652										sidebar_item.css({
1653											'position': 'absolute',
1654											'top': 'auto',
1655											'bottom': 0,
1656											'left': sidebar_sub.position().left,
1657											'width': sidebar_sub.outerWidth()
1658										});
1659
1660									// fixed at the bottom
1661									}else if( scroll_pos + $(window).height() > sidebar_item.offset().top + sidebar_item.outerHeight() ){
1662
1663										t.set_sidebar_sub(sidebar_sub, sidebar_item);
1664
1665										sidebar_item.addClass('gdlr-core-fixed-bottom-sidebar').removeClass('gdlr-core-stick-bottom-sidebar gdlr-core-stick-top-sidebar gdlr-core-fixed-top-sidebar');
1666										sidebar_item.css({
1667											'position': 'fixed',
1668											'top': 'auto',
1669											'bottom': '0',
1670											'left': sidebar_sub.offset().left,
1671											'width': sidebar_sub.outerWidth()
1672										});
1673									}
1674
1675								// scroll direction up
1676								}else{
1677
1678									if( sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar') ){
1679
1680										t.set_sidebar_sub(sidebar_sub, sidebar_item);
1681
1682										sidebar_item.addClass('gdlr-core-stick-bottom-sidebar').removeClass('gdlr-core-fixed-bottom-sidebar gdlr-core-fixed-top-sidebar gdlr-core-stick-top-sidebar');
1683										sidebar_item.css({
1684											'position': 'absolute',
1685											'top': scroll_pos + $(window).height() - sidebar_item.outerHeight() - sidebar_wrap.offset().top,
1686											'bottom': 'auto',
1687											'left': sidebar_sub.position().left,
1688											'width': sidebar_sub.outerWidth()
1689										});
1690
1691									}else{
1692
1693										// stick at the top
1694										if( scroll_pos < sidebar_item.offset().top ){
1695
1696											t.set_sidebar_sub(sidebar_sub, sidebar_item);
1697
1698											sidebar_item.addClass('gdlr-core-fixed-top-sidebar').removeClass('gdlr-core-stick-bottom-sidebar gdlr-core-fixed-bottom-sidebar gdlr-core-stick-top-sidebar');
1699											sidebar_item.css({
1700												'position': 'fixed',
1701												'top': '0',
1702												'bottom': 'auto',
1703												'left': sidebar_sub.offset().left,
1704												'width': sidebar_sub.outerWidth()
1705											});
1706
1707										}
1708									}
1709
1710									
1711
1712								}
1713
1714								if( e.type == 'resize' ){
1715									if( sidebar_item.hasClass('gdlr-core-stick-bottom-sidebar') || sidebar_item.hasClass('gdlr-core-stick-top-sidebar') ){
1716										sidebar_item.css({ 
1717											'width': sidebar_sub.outerWidth(),
1718											'left': sidebar_sub.position().left,
1719										});
1720									}else if( sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar') || sidebar_item.hasClass('gdlr-core-fixed-top-sidebar') ){
1721										sidebar_item.css({ 
1722											'width': sidebar_sub.outerWidth(),
1723											'left': sidebar_sub.offset().left,
1724										});
1725									}
1726								}
1727
1728							}
1729						}
1730
1731					}); // window scroll
1732
1733				});
1734			});
1735
1736		},
1737
1738		set_sidebar_sub: function(sidebar_sub, sidebar_item){
1739
1740			if(sidebar_item.hasClass('gdlr-core-sidebar-sub-added')) return;
1741
1742			// set the width
1743			var sidebar_class = '';
1744			sidebar_item.each(function(){
1745				var className = this.className.match(/gdlr-core-column-\d+/);
1746				if( className ){
1747					sidebar_class = className[0];
1748				}
1749			});
1750			sidebar_sub.addClass(sidebar_class);
1751
1752			// set position
1753			sidebar_sub.css({
1754				'float': sidebar_item.css('float'),
1755				'height': 20,
1756				'background': '#fd9'
1757			});
1758
1759			sidebar_sub.insertAfter(sidebar_item);
1760			sidebar_item.addClass('gdlr-core-sidebar-sub-added');
1761		},
1762
1763		return_sidebar_pos: function(sidebar_sub, sidebar_item){
1764			sidebar_item.css({'position': '', 'top': '', 'bottom': '', 'left': '', 'width': '', 'height': ''});
1765			sidebar_item.removeClass('gdlr-core-fixed-sidebar gdlr-core-fixed-bottom-sidebar gdlr-core-sidebar-sub-added');
1766			sidebar_item.removeClass('gdlr-core-stick-bottom-sidebar gdlr-core-fixed-bottom-sidebar gdlr-core-fixed-top-sidebar');
1767			sidebar_sub.remove();
1768		}
1769
1770	}
1771
1772	$.fn.gdlr_core_isotope = function( filter_elem ){
1773
1774		if(typeof($.fn.isotope) == 'function'){
1775
1776			if( typeof(filter_elem) == 'undefined' ){
1777				var elem = $(this).find('[data-layout="masonry"]');
1778			}else{
1779				var elem = filter_elem.filter('[data-layout="masonry"]');
1780			}
1781		
1782			elem.each(function(){
1783
1784				var t = $(this);
1785				if( t.children('ul.products').length ){
1786					t = t.children('ul.products');
1787				}
1788				var columnSize = t.width() / 60;
1789
1790				t.isotope({
1791					itemSelector: '.gdlr-core-item-list',
1792					layoutMode: 'masonry',
1793					masonry:{
1794						columnWidth: columnSize
1795					}
1796				});
1797				t.isotope();
1798
1799				t.children('.gdlr-core-item-list').gdlr_core_animate_list_item();
1800
1801				// resize event
1802				$(window).on('resize gdlr-core-element-resize', function(){
1803					
1804					columnSize = t.width() / 60;
1805					
1806					t.isotope({
1807						masonry:{
1808							columnWidth: columnSize
1809						}
1810					});
1811				});	
1812			});
1813
1814		}
1815
1816		return $(this);
1817
1818	} // gdlr-core-isotope
1819	$.fn.gdlr_core_animate_list_item = function(){
1820
1821		var ux_items = $(this).get();
1822
1823		// run the ux in order with delay
1824		var ux_interval = setInterval(function(){ 
1825			
1826			if( ux_items.length > 0 ){
1827				// animate the ux item
1828				var ux_animate = $(ux_items.shift());
1829				var animation_duration = '600ms';
1830
1831				ux_animate.css({'animation-duration': animation_duration});
1832				ux_animate.addClass('gdlr-core-animate');
1833				
1834				// remove selector
1835				setTimeout(function(){
1836					ux_animate.css({'animation-duration':  ''})
1837						.addClass('gdlr-core-animate-end')
1838						.removeClass('gdlr-core-animate gdlr-core-animate-init');
1839				}, parseInt(animation_duration));	
1840					
1841			}else{
1842				clearInterval(ux_interval);
1843			}
1844		}, 200);
1845
1846	}
1847
1848	$.fn.gdlr_core_lightbox = function( filter_elem ){
1849		
1850		// ilightbox
1851		if( typeof($.iLightBox) == 'function' ){
1852
1853			if( typeof(filter_elem) == 'undefined' ){
1854				var ilightbox = $(this).find('.gdlr-core-ilightbox');
1855			}else{
1856				var ilightbox = filter_elem.filter('.gdlr-core-ilightbox');
1857			}		
1858		
1859			var ilightbox_atts = {};
1860			var ilightbox_groups = [];
1861
1862			if( typeof(gdlr_core_pbf.ilightbox_skin) != 'undefined' ){
1863				ilightbox_atts['skin'] = gdlr_core_pbf.ilightbox_skin;
1864			}
1865
1866			ilightbox.each(function(){
1867				if( $(this).attr('data-ilightbox-group') ){
1868					if( ilightbox_groups.indexOf($(this).attr('data-ilightbox-group')) == -1 ){
1869						ilightbox_groups.push($(this).attr('data-ilightbox-group'));
1870					}
1871				}else{
1872					$(this).iLightBox(ilightbox_atts);
1873				}
1874			});
1875
1876			for( var key in ilightbox_groups ){
1877				$(this).find('.gdlr-core-ilightbox[data-ilightbox-group="' + ilightbox_groups[key] + '"]').iLightBox(ilightbox_atts);
1878			}
1879
1880		}else if( typeof($.fn.lightGallery) == 'function' ){
1881
1882			if( typeof(filter_elem) == 'undefined' ){
1883				var lightgallery = $(this).find('.gdlr-core-lightgallery');
1884			}else{
1885				var lightgallery = filter_elem.filter('.gdlr-core-lightgallery');
1886			}
1887
1888			var lightbox_groups = [];
1889
1890			lightgallery.each(function(){
1891				if( $(this).attr('data-lightbox-group') ){
1892					if( lightbox_groups.indexOf($(this).attr('data-lightbox-group')) == -1 ){
1893						lightbox_groups.push($(this).attr('data-lightbox-group'));
1894					}
1895				}else{
1896					$(this).lightGallery({ selector: 'this' });
1897				}
1898			});
1899
1900			for( var key in lightbox_groups ){
1901				var group_selector = '.gdlr-core-lightgallery[data-lightbox-group="' + lightbox_groups[key] + '"]';
1902				
1903				lightgallery.filter(group_selector).first().lightGallery({ 
1904					selector: group_selector, 
1905					selectWithin: 'body',
1906					thumbnail: false
1907				});
1908			}
1909			
1910		}
1911
1912		// lightbox gallery
1913		if( typeof(filter_elem) == 'undefined' ){
1914			var gallery_lb = $(this).find('[data-gallery-lb]');
1915		}else{
1916			var gallery_lb = filter_elem.filter('[data-gallery-lb]');
1917		}
1918
1919		gallery_lb.click(function(){
1920			if( typeof($.iLightBox) != 'undefined' ){
1921				$.iLightBox($(this).data('gallery-lb'));
1922			}else if(typeof(Strip) != 'undefined' ){
1923				Strip.show($(this).data('gallery-lb'));
1924			}else if(typeof($.fn.lightGallery) == 'function'){
1925				$(this).lightGallery({ 
1926					dynamic: true,
1927					dynamicEl: $(this).data('gallery-lb'),
1928					thumbnail: false
1929				});
1930			}
1931
1932			return false;
1933		});
1934
1935		
1936		// image overlay
1937		if( typeof(filter_elem) == 'undefined' ){
1938			var center_overlay = $(this).find('.gdlr-core-image-overlay-center, .gdlr-core-image-overlay-center-icon');
1939		}else{
1940			var center_overlay = filter_elem.filter('.gdlr-core-image-overlay-center, .gdlr-core-image-overlay-center-icon');
1941		}		
1942	
1943		center_overlay.each(function(){
1944			
1945			// for portfolio overlay content style
1946			if( $(this).hasClass('gdlr-core-image-overlay-center') ){
1947				var overlay_content = $(this).children('.gdlr-core-image-overlay-content');
1948				var wrap_height = $(this).outerHeight() - (2 * parseInt(overlay_content.css('bottom')));
1949				
1950				var overlay_icon = overlay_content.children('.gdlr-core-portfolio-icon-wrap');
1951				var icon_margin = (wrap_height - (overlay_content.outerHeight() - parseInt(overlay_icon.css('margin-bottom')))) / 2;
1952				if( icon_margin > 20 ){
1953					overlay_icon.css('margin-bottom', icon_margin);
1954				}
1955				
1956			// normal centering
1957			}else{
1958				var content_offset = 0;
1959				if( $(this).children('.gdlr-core-image-overlay-content-offset').length ){
1960					content_offset = $(this).children('.gdlr-core-image-overlay-content-offset').outerHeight(true);
1961				}
1962
1963				$(this).children('.gdlr-core-image-overlay-content').each(function(){
1964					$(this).css({ 'margin-top': -( ($(this).outerHeight() + content_offset) / 2 ) });
1965				});
1966			}
1967			
1968		});
1969		$(window).on('resize gdlr-core-element-resize', function(){
1970			center_overlay.each(function(){
1971				// for portfolio style
1972				if( $(this).hasClass('gdlr-core-image-overlay-center') ){
1973					var overlay_content = $(this).children('.gdlr-core-image-overlay-content');
1974					var wrap_height = $(this).outerHeight() - (2 * parseInt(overlay_content.css('bottom')));
1975					
1976					var overlay_icon = overlay_content.children('.gdlr-core-portfolio-icon-wrap');
1977					var icon_margin = (wrap_height - (overlay_content.outerHeight() - parseInt(overlay_icon.css('margin-bottom')))) / 2;
1978					if( icon_margin > 20 ){
1979						overlay_icon.css('margin-bottom', icon_margin);
1980					}
1981					
1982				// normal centering
1983				}else{
1984					var content_offset = 0;
1985					if( $(this).children('.gdlr-core-image-overlay-content-offset').length ){
1986						content_offset = $(this).children('.gdlr-core-image-overlay-content-offset').outerHeight(true);
1987					}
1988
1989					$(this).children('.gdlr-core-image-overlay-content').each(function(){
1990						$(this).css({ 'margin-top': -( ($(this).outerHeight() + content_offset) / 2 ) });
1991					});
1992				}
1993			});
1994		});
1995
1996		return $(this);
1997	}
1998
1999	$.fn.gdlr_core_set_image_height = function(){
2000
2001		var all_image = $(this).find('img');
2002
2003		all_image.each(function(){
2004			var img_width = $(this).attr('width');
2005			var img_height = $(this).attr('height');
2006
2007			if( img_width && img_height ){
2008				var parent_item = $(this).parent('.gdlr-core-temp-image-wrap');
2009
2010				if( parent_item.length ){
2011					parent_item.height((img_height * $(this).parent().width()) / img_width);
2012				}else{
2013					parent_item = $('<div class="gdlr-core-temp-image-wrap" ></div>');
2014					parent_item.css('height', ((img_height * $(this).closest('span, div').width()) / img_width));
2015					$(this).wrap(parent_item);
2016				}
2017			}else{
2018				return;
2019			}
2020		});
2021		$(window).on('resize gdlr-core-element-resize', function(e){
2022			all_image.each(function(){
2023				var parent_item = $(this).parent('.gdlr-core-temp-image-wrap');
2024
2025				if( parent_item.length ){
2026					$(this).unwrap();
2027				}
2028			});
2029			
2030			$(window).unbind('resize', e.handleObj.handler, e);
2031		});
2032
2033		return $(this);
2034	} // gdlr_core_set_image_height
2035
2036	// to set full height wrapper / column
2037	window.gdlr_core_set_full_height = function( container, filter_elem ){
2038		if( typeof(filter_elem) == 'undefined' ){
2039			this.elements = container.find('.gdlr-core-wrapper-full-height, .gdlr-core-column-full-height');
2040		}else{
2041			this.elements = filter_elem.filter('.gdlr-core-wrapper-full-height, .gdlr-core-column-full-height');
2042		}
2043
2044		if( this.elements.length ){
2045			this.init();
2046		}
2047	}
2048	gdlr_core_set_full_height.prototype = {
2049
2050		init: function(){
2051
2052			var t = this;
2053
2054			t.resize();
2055			$(window).on('load resize gdlr-core-element-resize', function(){ t.resize(); });
2056		},
2057
2058		resize: function(){
2059
2060			this.elements.each(function(){
2061				var offset = $(this).attr('data-decrease-height')? parseInt($(this).attr('data-decrease-height')): 0;
2062
2063				$(this).css('min-height', $(window).height() - offset);
2064
2065				if( $(this).hasClass('gdlr-core-full-height-center') ){
2066					$(this).children('.gdlr-core-full-height-pre-spaces').remove();
2067
2068					var pre_space = ($(this).height() - $(this).children('.gdlr-core-full-height-content').outerHeight(true)) / 2;
2069					if( pre_space > 0 ){
2070						$(this).prepend($('<div class="gdlr-core-full-height-pre-spaces" ></div>').height(pre_space));
2071					}
2072				}
2073			});
2074
2075		}
2076	};
2077
2078	// sync height among items
2079	window.gdlr_core_sync_height = function( container, filter_elem ){
2080
2081		// for half height item
2082		this.set_half_height(container);
2083
2084		// sync height
2085		if( typeof(window.gdlr_core_sync_height_elem) != 'undefined' ){
2086			window.gdlr_core_sync_height_elem.reinit();
2087			return;
2088		}
2089		window.gdlr_core_sync_height_elem = this;
2090
2091		if( typeof(filter_elem) == 'undefined' ){
2092			this.elements = container.find('[data-sync-height]');
2093		}else{
2094			this.elements = filter_elem.filter('[data-sync-height]');
2095		}
2096		
2097		this.elements_group = [];
2098		this.container = container;
2099		this.init();
2100	} 
2101	gdlr_core_sync_height.prototype = {
2102
2103		init: function(){
2104
2105			var t = this;
2106			t.group_elements();	
2107			t.set_height();
2108
2109			$(window).on('load resize gdlr-core-element-resize', function(){ t.set_height(); });
2110		},
2111
2112		reinit: function(){
2113			
2114			if( !this.container.is('body, .gdlr-core-page-builder-body') ){
2115				this.container = this.container.closest('.gdlr-core-page-builder-body');
2116			}
2117
2118			this.elements = this.container.find('[data-sync-height]');
2119			this.group_elements();
2120			this.set_height();
2121
2122		},	
2123
2124		group_elements: function(){
2125
2126			var t = this;
2127			
2128			// do flipbox first
2129			t.elements.filter('.gdlr-core-flipbox-front, .gdlr-core-feature-box').each(function(){
2130				if( t.elements_group.indexOf($(this).attr('data-sync-height')) == -1 ){
2131					t.elements_group.push($(this).attr('data-sync-height'));
2132				}
2133			});
2134			
2135			// do the rest elements
2136			t.elements.each(function(){
2137				if( t.elements_group.indexOf($(this).attr('data-sync-height')) == -1 ){
2138					t.elements_group.push($(this).attr('data-sync-height'));
2139				}
2140			});
2141		},
2142
2143		set_height: function(){
2144
2145			var t = this;
2146
2147			// revert to default value
2148			t.elements.css('height', 'auto').children('.gdlr-core-sync-height-pre-spaces').remove();
2149			t.elements.find('.gdlr-core-sync-height-offset').remove();
2150
2151			var sync_element = t.elements;
2152			if( gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait' ){
2153				sync_element = sync_element.filter('.gdlr-core-flipbox-front, .gdlr-core-flipbox-back, .gdlr-core-hover-content-front, .gdlr-core-hover-content-back');
2154			}
2155
2156			// setting the height by each group
2157			for( var key in t.elements_group ){
2158				var max_height = 0;
2159
2160				// determine max height
2161				sync_element.filter('[data-sync-height="' + t.elements_group[key] + '"]').each(function(){
2162					if( $(this).outerHeight() > max_height ){
2163						max_height = $(this).outerHeight();
2164					}
2165				});
2166
2167				// set the height
2168				sync_element.filter('[data-sync-height="' + t.elements_group[key] + '"]').each(function(){
2169					
2170					// set the offset space to the bottom
2171					var offset = parseInt(max_height - $(this).outerHeight());
2172					var offset_item = $(this).find('[data-sync-height-offset]');
2173					if( offset_item.length && offset > 0 ){
2174						$('<div class="gdlr-core-sync-height-offset" ></div>').css('height', offset).insertBefore(offset_item);
2175					}
2176
2177					$(this).css('height', max_height);
2178
2179					// flipbox
2180					if( $(this).hasClass('gdlr-core-flipbox-front') ){
2181						$(this).parent().css('height', max_height);
2182					}
2183
2184					// center the content if selected
2185					if( $(this).is('[data-sync-height-center]') ){
2186						var content = $(this).children('.gdlr-core-sync-height-content');
2187						
2188						// determine top padding for centering content
2189						var padding_top = max_height;
2190						if( content.length > 0 ){
2191							padding_top -= content.outerHeight();
2192						}else{
2193							$(this).children().each(function(){
2194								padding_top -= $(this).outerHeight();
2195							});
2196						}
2197						padding_top = padding_top / 2;
2198						padding_top = padding_top - (parseInt($(this).css('padding-top')) + parseInt($(this).css('border-top-width')));
2199
2200						// insert the spaces
2201						if( padding_top > 0 ){
2202							var spaces_item = $('<div class="gdlr-core-sync-height-pre-spaces" ></div>').css('padding-top', padding_top);
2203							var space_position = $(this).children('.gdlr-core-sync-height-space-position');
2204							if( space_position.length > 0 ){
2205								spaces_item.insertBefore(space_position);
2206							}else{
2207								$(this).prepend(spaces_item);
2208							}
2209						}
2210					}
2211
2212				});
2213			}
2214
2215		},
2216
2217		set_half_height: function( container ){
2218
2219			container.find('.gdlr-core-half-height').each(function(){
2220				var temp = $(this);
2221				if( !gdlr_core_mobile && (gdlr_core_display == 'tablet' || gdlr_core_display == 'desktop') ){
2222					var temp_height = temp.outerHeight();
2223					temp.gdlr_core_set_image_height();
2224					temp.css('height', temp_height / 2);
2225					temp.find('img').css('margin-top', -temp_height/4);
2226				}
2227				$(window).on('load resize', function(){
2228					temp.css('height', 'auto');
2229					temp.find('img').css('margin-top', '0');
2230					if( !gdlr_core_mobile && (gdlr_core_display == 'tablet' || gdlr_core_display == 'desktop') ){
2231						temp_height = temp.outerHeight();
2232						temp.gdlr_core_set_image_height();
2233						temp.css('height', temp_height / 2);
2234						temp.find('img').css('margin-top', -temp_height/4);
2235					}
2236				});
2237			});
2238
2239		}
2240
2241	}; // gdlr_core_sync_height.prototype
2242
2243	function gdlr_core_ajax_action(ajax_section, name, value){
2244
2245		var now_loading = $('<div class="gdlr-core-now-loading" ></div>').hide();
2246
2247		$.ajax({
2248			type: 'POST',
2249			url: gdlr_core_pbf.ajax_url,
2250			data: { 
2251				'action': ajax_section.attr('data-ajax'), 
2252				'settings': ajax_section.data('settings'), 
2253				'option': { 'name':name, 'value':value } 
2254			},
2255			dataType: 'json',
2256			beforeSend: function(jqXHR, settings){
2257				// before send action
2258				if( ajax_section.attr('data-target-action') == 'replace' ){
2259					ajax_section.siblings('.' + ajax_section.attr('data-target')).animate({opacity: 0}, 150);
2260				}
2261
2262				// for portfolio item
2263				if( (ajax_section.attr('data-target') == 'gdlr-core-portfolio-item-holder' ||
2264					 ajax_section.attr('data-target') == 'gdlr-core-personnel-item-holder') && 
2265					ajax_section.attr('data-target-action') == 'replace' ){
2266
2267					now_loading.insertBefore( ajax_section.siblings('.gdlr-core-portfolio-item-holder, .gdlr-core-personnel-item-holder') );
2268					now_loading.fadeIn(200);
2269				}
2270			},
2271			error: function(jqXHR, textStatus, errorThrown){
2272				ajax_section.removeClass('gdlr-core-disable');
2273
2274				console.log(jqXHR, textStatus, errorThrown);
2275			},
2276			success: function(data){
2277				
2278				if( data.status == 'success' ){
2279					if( data.content && ajax_section.attr('data-target') ){
2280						if( ajax_section.attr('data-target-action') == 'append' ){
2281							var content = $(data.content);
2282							ajax_section.siblings('.' + ajax_section.attr('data-target')).each(function(){
2283
2284								if( $(this).attr('data-layout') != 'masonry' || typeof($.fn.isotope) != 'function' ){
2285									content.addClass('gdlr-core-animate-init');
2286								}
2287								$(this).append(content);
2288
2289								content.gdlr_core_lightbox().gdlr_core_flexslider().gdlr_core_content_script().gdlr_core_set_image_height();
2290								new gdlr_core_sync_height(content);
2291
2292								if( $(this).attr('data-layout') == 'masonry' && typeof($.fn.isotope) == 'function' ){
2293									var addItems = $(this).isotope('addItems', content);
2294									$(this).isotope('layoutItems', addItems, true);
2295								}
2296								
2297								content.gdlr_core_animate_list_item();
2298							});
2299
2300							if( data.load_more ){
2301								if( data.load_more != 'none' ){
2302									var load_more = $(data.load_more);
2303									ajax_section.parent().append(load_more);
2304									load_more.gdlr_core_ajax(load_more);
2305									load_more.css('display', 'none').slideDown(100);
2306
2307									ajax_section.remove();
2308								}else{
2309									ajax_section.slideUp(100, function(){ $(this).remove(); });
2310								}
2311							}
2312							
2313						}else if( ajax_section.attr('data-target-action') == 'replace' ){
2314							var content = $(data.content);
2315							ajax_section.siblings('.' + ajax_section.attr('data-target')).each(function(){
2316								if( ajax_section.is('.gdlr-core-pagination') ){
2317									var scroll_position = $(this).offset().top - 120;
2318									if( $(window).scrollTop() > scroll_position ){
2319										$('html, body').animate({ scrollTop: scroll_position }, { duration: 1500, easing: 'easeOutQuart', queue: false });
2320									} 
2321								}
2322								
2323								var fix_height = false;
2324								var current_height = $(this).height();
2325
2326								if( $(this).attr('data-layout') != 'masonry' || typeof($.fn.isotope) != 'function' ){
2327									content.addClass('gdlr-core-animate-init');
2328								}
2329								$(this).empty().append(content);
2330
2331								content.gdlr_core_lightbox().gdlr_core_flexslider().gdlr_core_fluid_video().gdlr_core_set_image_height();
2332								new gdlr_core_sync_height(content);
2333
2334								if( $(this).attr('data-layout') == 'masonry' && typeof($.fn.isotope) == 'function' ){
2335									$(this).isotope('destroy');
2336									$(this).parent().gdlr_core_isotope();
2337									fix_height = true;
2338								}else{
2339									content.gdlr_core_animate_list_item();
2340								}
2341
2342								var new_height = $(this).height();
2343								$(this).css({height:current_height}).animate({'height':new_height, opacity:1}, {'duration':400, 'easing':'easeOutExpo', 'complete': function(){
2344									if( !fix_height ){ $(this).css('height',''); }
2345								}});
2346							});
2347
2348							// pagination
2349							if( data.pagination ){
2350								ajax_section.siblings('.gdlr-core-pagination').slideUp(100, function(){ $(this).remove(); });
2351
2352								if( data.pagination != 'none' ){
2353									var pagination = $(data.pagination);
2354									ajax_section.parent().append(pagination);
2355									pagination.gdlr_core_ajax(pagination);
2356									pagination.css('display', 'none').slideDown(100);
2357								}
2358							}
2359
2360							// load more button
2361							if( data.load_more ){
2362								ajax_section.siblings('.gdlr-core-load-more-wrap').slideUp(100, function(){ $(this).remove(); });
2363								
2364								if( data.load_more != 'none' ){
2365									var load_more = $(data.load_more);
2366									ajax_section.parent().append(load_more);
2367									load_more.gdlr_core_ajax(load_more);
2368									load_more.css('display', 'none').slideDown(100);
2369								}
2370							}
2371
2372						}
2373					}
2374
2375					if( typeof(data.settings) != 'undefined' ){
2376						ajax_section.data('settings', data.settings);
2377					}
2378
2379					now_loading.fadeOut(200, function(){ 
2380						$(this).remove(); 
2381						ajax_section.removeClass('gdlr-core-disable');
2382					});
2383				}else{
2384					ajax_section.removeClass('gdlr-core-disable');
2385				}
2386				
2387			}
2388		});	
2389
2390	} // gdlr_core_ajax_action
2391	$.fn.gdlr_core_ajax = function( filter_elem ){
2392
2393		if( typeof(filter_elem) == 'undefined' ){
2394			var elem = $(this).find('[data-ajax]');
2395		}else{
2396			var elem = filter_elem.filter('[data-ajax]');
2397		}
2398
2399		elem.each(function(){
2400
2401			var ajax_section = $(this);
2402
2403			// button click
2404			$(this).on('click', 'a, .gdlr-core-ajax-link', function(){
2405				if( $(this).hasClass('gdlr-core-active') || ajax_section.hasClass('gdlr-core-disable') ){
2406					return false;
2407				}
2408
2409				ajax_section.addClass('gdlr-core-disable');
2410				$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
2411				
2412				var name = $(this).attr('data-ajax-name');
2413				var value = $(this).attr('data-ajax-value');
2414
2415				gdlr_core_ajax_action(ajax_section, name, value);
2416
2417				if( $(this).is('a') ){
2418					return false;
2419				}
2420			});
2421
2422			// filter changed
2423			$(this).on('change', 'select', function(){
2424				var name = $(this).attr('data-ajax-name');
2425				var value = $(this).val();
2426
2427				gdlr_core_ajax_action(ajax_section, name, value);
2428			});
2429
2430		});	
2431
2432	} // gdlr_core_ajax
2433	$.fn.gdlr_core_ajax_slide_bar = function( filter_elem ){
2434		if( typeof(filter_elem) == 'undefined' ){
2435			var elem = $(this).find('[data-ajax]');
2436		}else{
2437			var elem = filter_elem.filter('[data-ajax]');
2438		}
2439
2440		elem.each(function(){
2441
2442			var ajax_section = $(this);
2443
2444			// filter slide bar
2445			$(this).children('.gdlr-core-filterer-slide-bar').each(function(){
2446				var slide_bar = $(this);
2447				var active_slide = slide_bar.siblings('.gdlr-core-active');
2448				slide_bar.css({'width': active_slide.outerWidth(), 'left': active_slide.position().left + parseInt(active_slide.css('margin-left')) });
2449
2450				$(window).on('load resize', function(){
2451					active_slide = slide_bar.siblings('.gdlr-core-active');
2452					slide_bar.css({'width': active_slide.outerWidth(), 'left': active_slide.position().left + parseInt(active_slide.css('margin-left')) });
2453				});
2454				
2455				ajax_section.find('a').hover(function(){
2456					slide_bar.animate({'width': $(this).outerWidth(), 'left': $(this).position().left + parseInt($(this).css('margin-left')) }, {queue: false, duration: 200});
2457				}, function(){
2458					active_slide = slide_bar.siblings('.gdlr-core-active');
2459					slide_bar.animate({'width': active_slide.outerWidth(), 'left': active_slide.position().left + parseInt(active_slide.css('margin-left')) }, {queue: false, duration: 200});
2460				});
2461			});
2462
2463		});	
2464	}
2465
2466	$.fn.gdlr_core_dropdown_tab = function( filter_elem ){
2467
2468		if( typeof(filter_elem) == 'undefined' ){
2469			var elem = $(this).find('.gdlr-core-dropdown-tab');
2470		}else{
2471			var elem = filter_elem.filter('.gdlr-core-dropdown-tab');
2472		}	
2473	
2474		elem.each(function(){
2475			var tab_title = $(this).children('.gdlr-core-dropdown-tab-title');
2476			var tab_title_text = tab_title.children('.gdlr-core-head');
2477			var tab_dropdown = tab_title.children('.gdlr-core-dropdown-tab-head-wrap');
2478			var tab_content = $(this).children('.gdlr-core-dropdown-tab-content-wrap');
2479
2480			// dropdown
2481			tab_title.click(function(){
2482				if( $(this).hasClass('gdlr-core-active') ){
2483					$(this).removeClass('gdlr-core-active');
2484					tab_dropdown.hide();
2485				}else{
2486					$(this).addClass('gdlr-core-active');
2487					tab_dropdown.slideDown(200);
2488				}
2489			});
2490			tab_dropdown.children().click(function(){
2491				tab_title_text.html($(this).html());
2492				$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
2493
2494				var content_active = tab_content.children('[data-index="' + $(this).attr('data-index') + '"]');
2495				content_active.fadeIn(200).addClass('gdlr-core-active');
2496				content_active.siblings().hide().removeClass('gdlr-core-active');
2497			});
2498
2499		});
2500
2501	} // gdlr_core_dropdown_tab
2502
2503	if( !gdlr_core_pbf.admin ){
2504		
2505		$(document).ready(function(){
2506
2507			var wpcf7_select = $('.wpcf7-form select');
2508			if( wpcf7_select.length ){
2509				$('<div class="wpcf7-form-indicator" ><i class="fa fa-angle-down" ></i></div>').insertAfter(wpcf7_select);
2510			}
2511			
2512			$('body').each(function(){
2513				
2514				// turns image link to open in lightbox
2515				if( $(this).hasClass('gdlr-core-link-to-lightbox') ){
2516					var image_link = $(this).find('a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"], a[href$=".gif"]')
2517						.not('.gdlr-core-ilightbox, .strip, [data-rel], .gdlr-core-lightgallery, .gdlr-core-social-share-pinterest')
2518						.addClass('strip gdlr-core-ilightbox gdlr-core-lightgallery').each(function(){
2519							
2520							if( $(this).closest('.gallery').length ){
2521								var gallery_wrap = $(this).closest('.gallery');
2522								if( gallery_wrap.attr('data-gallery-id') ){
2523									var gallery_id = gallery_wrap.attr('data-gallery-id');
2524								}else{
2525									var gallery_id = Math.floor((Math.random() * 10000) + 1);
2526									gallery_wrap.attr('data-gallery-id', gallery_id);
2527								}
2528
2529								$(this).attr('data-ilightbox-group', 'wp-gallery-' + gallery_id);
2530								$(this).attr('data-lightbox-group', 'wp-gallery-' + gallery_id);
2531								$(this).attr('data-strip-group', 'wp-gallery-' + gallery_id);
2532
2533							}
2534						});
2535					$(this).gdlr_core_lightbox( image_link );
2536				}
2537
2538				var gdlr_core_js = $(this).find('.gdlr-core-js, iframe[src*="youtube"], iframe[src*="vimeo"]');
2539				
2540				// video resizing
2541				$(this).gdlr_core_content_script( gdlr_core_js, true );
2542				
2543				// counter item
2544				$(this).gdlr_core_counter_item( gdlr_core_js );	
2545				
2546				// type animation item
2547				$(this).gdlr_core_typed_animation( gdlr_core_js );	
2548
2549				// countdown item
2550				$(this).gdlr_core_countdown_item( gdlr_core_js );		
2551
2552				// alert box item
2553				$(this).gdlr_core_alert_box_item( gdlr_core_js );
2554				
2555				// accordion item
2556				$(this).gdlr_core_accordion( gdlr_core_js );
2557				
2558				// toggle box item
2559				$(this).gdlr_core_toggle_box( gdlr_core_js );
2560				
2561				// divider
2562				$(this).gdlr_core_divider( gdlr_core_js );
2563				
2564				// flipbox
2565				$(this).gdlr_core_flipbox( gdlr_core_js );
2566				
2567				// marquee
2568				$(this).gdlr_core_marquee( gdlr_core_js );
2569
2570				// chart.js
2571				$(this).gdlr_core_chart_js( gdlr_core_js );
2572
2573				// skill circle
2574				$(this).gdlr_core_skill_circle( gdlr_core_js );
2575				
2576				// skill bar
2577				$(this).gdlr_core_skill_bar( gdlr_core_js );
2578				
2579				// tab
2580				$(this).gdlr_core_tab( gdlr_core_js );
2581				$(this).gdlr_core_price_table_tab( gdlr_core_js );
2582
2583				// dropdown tab
2584				$(this).gdlr_core_dropdown_tab( gdlr_core_js );
2585				
2586				// lightbox
2587				$(this).gdlr_core_lightbox( gdlr_core_js );
2588
2589				// ajax action
2590				$(this).gdlr_core_ajax( gdlr_core_js );
2591				$(this).gdlr_core_ajax_slide_bar( gdlr_core_js );
2592				
2593				// sync height
2594				new gdlr_core_sync_height( $(this), gdlr_core_js );
2595
2596				// set height
2597				new gdlr_core_set_full_height( $(this), gdlr_core_js );
2598
2599				// sidebar wrapper height
2600				new gdlr_core_sidebar_wrapper( $(this), gdlr_core_js );
2601				
2602				// ux animation
2603				// $(this).gdlr_core_ux( gdlr_core_js );
2604				new gdlr_core_ux( $(this), gdlr_core_js );
2605				
2606				// background parallax
2607				$(this).gdlr_core_parallax_background( gdlr_core_js );
2608
2609				// particle
2610				$(this).gdlr_core_particle_background( gdlr_core_js );
2611
2612				// custom dropdown
2613				gdlr_core_js.filter('.gdlr-core-custom-dropdown').each(function(){
2614					var custom_dropdown = $(this);
2615					var dropdown_current = custom_dropdown.find('.gdlr-core-custom-dropdown-current');
2616
2617					$(this).on('click', '.gdlr-core-custom-dropdown-current', function(){
2618						dropdown_current.siblings('.gdlr-core-custom-dropdown-list').slideDown(150);
2619					});
2620					$(document).click(function(e){
2621						if( !$(e.target).is('.gdlr-core-custom-dropdown-current') ){
2622							dropdown_current.siblings('.gdlr-core-custom-dropdown-list').slideUp(150, function(){
2623								if( $(e.target).is('.gdlr-core-custom-dropdown-list-item') ){
2624									$(e.target).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active')
2625								}
2626							});
2627							if( $(e.target).is('.gdlr-core-custom-dropdown-list-item') ){
2628								dropdown_current.html( $(e.target).html() );
2629							}
2630						}
2631					});
2632				});
2633
2634				// privacy box cookie
2635				gdlr_core_js.filter('.gdlr-core-privacy-box-button').on('click', function(){
2636					var privacy_box_wrap = $(this).closest('.gdlr-core-privacy-box-wrap');
2637					if( privacy_box_wrap.is('.gdlr-core-pos-bottom-bar, .gdlr-core-pos-top-bar') ){
2638						privacy_box_wrap.slideUp(200);
2639					}else{
2640						privacy_box_wrap.fadeOut(250);
2641					}
2642
2643					var cookie_time = $(this).attr('data-cookie-time')? $(this).attr('data-cookie-time'): 2592000;
2644					gdlr_core_set_cookie('gdlr-core-privacy-box', 1, cookie_time);
2645					
2646					window.location.reload();
2647					
2648					return false;
2649				});
2650
2651				// gdlr lightbox
2652				gdlr_core_js.filter('[data-gdlr-lb]').each(function(){
2653					var lb_wrap = $('#' + $(this).data('gdlr-lb'));
2654					if( lb_wrap.length ){
2655						
2656						// open lightbox action
2657						$(this).on('click', function(){
2658							lb_wrap.fadeIn(200);
2659							return false;
2660						});
2661
2662						// bind the lightbox close action
2663						lb_wrap.find('.gdlr-core-lightbox-form-close').on('click', function(){
2664							$(this).closest('.gdlr-core-lightbox-wrapper').fadeOut();
2665							return false;
2666						});
2667					}
2668				});
2669
2670				// gdpr form
2671				gdlr_core_js.filter('#gdlr-core-gdpr-form').each(function(){
2672					
2673					// change tab
2674					$(this).on('click', '.gdlr-core-gdlr-form-nav li', function(){
2675						$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
2676
2677						var nav_id = $(this).data('gdlr-nav');
2678						var content_wrap = $(this).closest('.gdlr-core-gdpr-form-left').siblings('.gdlr-core-gdpr-form-right');
2679						content_wrap.find('[data-gdlr-nav="' + nav_id + '"]').each(function(){
2680							$(this).siblings('[data-gdlr-nav]').removeClass('gdlr-core-active').css('display', 'none');
2681							$(this).fadeIn(200, function(){ $(this).addClass('gdlr-core-active'); });
2682						});
2683					});
2684				});
2685
2686				// sticky sidebar
2687				new gdlr_core_sticky_sidebar(gdlr_core_js);
2688			});
2689
2690		}); // document.ready
2691
2692		$(window).on('load', function(){
2693			
2694			$('body').each(function(){
2695
2696				var gdlr_core_js = $(this).find('.gdlr-core-js-2');
2697			
2698				// title divider
2699				$(this).gdlr_core_title_divider( gdlr_core_js );
2700
2701				// flexslider
2702				$(this).gdlr_core_flexslider( gdlr_core_js );
2703
2704				// sly slider
2705				$(this).gdlr_core_sly( gdlr_core_js );
2706
2707				// isotope
2708				$(this).gdlr_core_isotope( gdlr_core_js );
2709
2710			});
2711
2712		}); // window.load
2713
2714	}
2715
2716})(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.