(function($){
"use strict";
var gdlr_core_mobile=false;
if(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/BlackBerry/i) ||
navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/Windows Phone/i)){
gdlr_core_mobile=true;
}else{
gdlr_core_mobile=false;
}
var gdlr_core_display='desktop';
if(typeof(window.matchMedia)=='function'){
$(window).on('resize themename-set-display gdlr-core-element-resize', function(){
if(window.matchMedia('(max-width: 419px)').matches){
gdlr_core_display='mobile-portrait';
}else if(window.matchMedia('(max-width: 767px)').matches){
gdlr_core_display='mobile-landscape'
}else if(window.matchMedia('(max-width: 959px)').matches){
gdlr_core_display='tablet'
}else{
gdlr_core_display='desktop';
}});
$(window).trigger('themename-set-display');
}else{
$(window).on('resize themename-set-display gdlr-core-element-resize', function(){
if($(window).innerWidth() <=419){
gdlr_core_display='mobile-portrait';
}else if($(window).innerWidth() <=767){
gdlr_core_display='mobile-landscape'
}else if($(window).innerWidth() <=959){
gdlr_core_display='tablet'
}else{
gdlr_core_display='desktop';
}});
$(window).trigger('themename-set-display');
}
function gdlr_core_set_cookie(cname, cvalue, expires){
if(typeof(expires)!='undefined'){
if(expires==0){
expires=86400;
}
var now=new Date();
var new_time=now.getTime() + (parseInt(expires) * 1000);
now.setTime(new_time);
expires=now.toGMTString();
}
document.cookie=cname + "=" + encodeURIComponent(cvalue) + "; expires=" + expires + "; path=/";
}
$.fn.gdlr_core_monitor_swipe=function (settings){
settings=$.extend({
mouseEvent: true,
swipeThreshold: 150,
allowedTime: 300
},
settings
);
var swipeArea=$(this);
var startX=0, startTime=0;
var startEvent=settings.mouseEvent ? 'mousedown touchstart':'touchstart';
var endEvent=settings.mouseEvent ? 'mouseup touchend':'touchend';
swipeArea.on(startEvent,
function (e){
startX=e.clientX;
startTime=new Date().getTime();
}
);
swipeArea.on(endEvent,
function (e){
var swipeDistance=e.clientX - startX;
var elapsedTime=new Date().getTime() - startTime;
if(elapsedTime <=settings.allowedTime&&Math.abs(swipeDistance) > settings.swipeThreshold){
if(swipeDistance > 0){
swipeArea.trigger('swiperight');
}else{
swipeArea.trigger('swipeleft');
}}
}
);
if(settings.mouseEvent){
swipeArea.on('dragstart',
function (e){
e.preventDefault();
}
);
}}
$.fn.gdlr_core_content_script=function(filter_elem, document_ready){
$(this).gdlr_core_fluid_video(filter_elem);
if(!document_ready&&typeof($.fn.mediaelementplayer)=='function'){
var wpme_settings={
"stretching": "responsive"
};
if(typeof(_wpmejsSettings)!=='undefined'){
wpme_settings.pluginPath=_wpmejsSettings.pluginPath;
}
$(this).find('audio, video').mediaelementplayer(wpme_settings);
}
return $(this);
}
$.fn.gdlr_core_fluid_video=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('iframe[src*="youtube"], iframe[src*="vimeo"]');
}else{
var elem=filter_elem.filter('iframe[src*="youtube"], iframe[src*="vimeo"]');
}
elem.each(function(){
if($(this).closest('.ls-container, .master-slider, rs-module-wrap').length <=0){
if(($(this).is('embed')&&$(this).parent('object').length)||$(this).parent('.gdlr-core-fluid-video-wrapper').length){ return; }
if(!$(this).attr('id')){ $(this).attr('id', 'gdlr-video-' + Math.floor(Math.random()*999999)); }
if($(this).attr('height')&&$(this).attr('width')){
var ratio=parseInt($(this).attr('height')) / parseInt($(this).attr('width'));
}else{
var ratio=$(this).height() / $(this).width();
}
$(this).removeAttr('height').removeAttr('width');
try{
$(this).wrap('<div class="gdlr-core-fluid-video-wrapper"></div>').parent().css('padding-top', (ratio * 100)+"%");
$(this).attr('src', $(this).attr('src'));
}catch(e){}}
});
$('.gdlr-core-video-item-overlay').each(function(){
var button=$(this);
var video=$(this).closest('.gdlr-core-video-item').find('iframe');
if(video.attr('data-player-type')=='vimeo'){
var player=$f(video[0]);
button.on('click', function(){
$(this).css('pointer-events', 'none').fadeOut(500, function(e){
$(this).remove();
});
video[0].src +="&autoplay=1";
});
}else if(video.attr('data-player-type')=='youtube'){
button.on('click', function(){
$(this).css('pointer-events', 'none').fadeOut(500, function(e){
$(this).remove();
});
video[0].src +="&autoplay=1&mute=1";
});
}});
return $(this);
}
$.fn.gdlr_core_mejs_ajax=function(){
if(typeof($.fn.mediaelementplayer)=='function'){
var wpme_settings={};
if(typeof(_wpmejsSettings)!=='undefined'){ wpme_settings.pluginPath=_wpmejsSettings.pluginPath; }
$(this).find('audio, video').mediaelementplayer(wpme_settings);
}}
$.fn.gdlr_core_hover_box=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-hover-box .gdlr-core-hover-thumbnail');
}else{
var elem=filter_elem.filter('.gdlr-core-hover-box').find('.gdlr-core-hover-thumbnail');
}
elem.each(function(){
$(this).closest('.gdlr-core-hover-box').hover(function(){
var ch1=$(this).find('.gdlr-core-hover-thumbnail').children('img').eq(0);
var ch2=$(this).find('.gdlr-core-hover-thumbnail').children('img').eq(1);
ch1.css('display', 'none');
ch2.fadeIn(300);
}, function(){
var ch1=$(this).find('.gdlr-core-hover-thumbnail').children('img').eq(0);
var ch2=$(this).find('.gdlr-core-hover-thumbnail').children('img').eq(1);
ch2.css('display', 'none');
ch1.fadeIn(300);
});
});
}
$.fn.gdlr_core_counter_item=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-counter-item-count[data-counter-start][data-counter-end]');
}else{
var elem=filter_elem.filter('.gdlr-core-counter-item-count[data-counter-start][data-counter-end]');
}
elem.each(function(){
var counter_item=$(this);
var start_num=parseFloat($(this).attr('data-counter-start'));
var end_num=parseFloat($(this).attr('data-counter-end'));
var duration_time=($(this).attr('data-duration'))? parseInt($(this).attr('data-duration')): 4000;
var decimal=0;
if($(this).attr('data-counter-end')){
var decimalArray=$(this).attr('data-counter-end').split('.');
if(decimalArray[1]){
decimal=decimalArray[1].length;
}}
if((gdlr_core_display=='mobile-landscape'||gdlr_core_display=='mobile-portrait')||$(window).scrollTop() + $(window).height() > counter_item.offset().top){
$({ counter_num: start_num * (10 ** decimal) }).animate({ counter_num: end_num * (10 ** decimal) }, { duration: duration_time, easing: 'easeOutExpo',
step: function(){
if(this.counter_num > 0.3){
counter_item.html(Math.round(this.counter_num) / (10 ** decimal));
}else{
counter_item.html(0);
}}
});
console.log(decimal, (10 ** decimal));
}else{
$(window).on('scroll pb-scroll', function(e){
if($(this).scrollTop() + $(window).height() > counter_item.offset().top){
$({ counter_num: start_num * (10 ** decimal) }).animate({ counter_num: end_num * (10 ** decimal) }, { duration: duration_time,  easing: 'easeOutQuart',
step: function(){
if(this.counter_num > 0.3){
counter_item.html(Math.ceil(this.counter_num) / (10 ** decimal));
}else{
counter_item.html(0);
}}
});
console.log((10 ^ decimal));
$(this).unbind('scroll pb-scroll', e.handleObj.handler, e);
}});
}});
}
$.fn.gdlr_core_typed_animation=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-type-animation-item-animated[data-animation-text]');
}else{
var elem=filter_elem.filter('.gdlr-core-type-animation-item-animated[data-animation-text]');
}
elem.each(function(){
var animation_text=JSON.parse($(this).attr('data-animation-text'));
if(typeof($.fn.typed)=='function'&&animation_text&&animation_text.length > 0){
$(this).typed({
strings: animation_text,
typeSpeed: 50,
loop: true
});
}});
}
$.fn.gdlr_core_countdown_item=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-countdown-wrap');
}else{
var elem=filter_elem.filter('.gdlr-core-countdown-wrap');
}
elem.each(function(){
var day_field=$(this).find('.gdlr-core-day');
var day=parseInt(day_field.text());
var hrs_field=$(this).find('.gdlr-core-hrs');
var hrs=parseInt(hrs_field.text());
var min_field=$(this).find('.gdlr-core-min');
var min=parseInt(min_field.text());
var sec_field=$(this).find('.gdlr-core-sec');
var sec=parseInt(sec_field.text());
$(window).on('load', function(){
sec_field.text('00');
sec_field.css('width', sec_field.width());
sec_field.text(sec);
});
var i=setInterval(function(){
if(sec > 0){
sec--;
}else{
sec=59;
if(min > 0){
min--;
}else{
min=59;
if(hrs > 0){
hrs--;
}else{
hrs=24;
if(day > 0){
day--;
}else{
day=0;
hrs=0;
min=0;
sec=0;
clearInterval(i);
}
day_field.text(day);
}
hrs_field.text(hrs);
}
min_field.text(min);
}
sec_field.text(sec);
}, 1000);
});
}
$.fn.gdlr_core_accordion=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem_title=$(this).find('.gdlr-core-accordion-item-title');
var elem_icon=$(this).find('.gdlr-core-accordion-item-icon');
}else{
var elem_title=filter_elem.filter('.gdlr-core-accordion-item-title');
var elem_icon=filter_elem.filter('.gdlr-core-accordion-item-icon');
}
elem_title.click(function(){
$(this).siblings('.gdlr-core-accordion-item-content').slideDown(200);
var item_tab=$(this).closest('.gdlr-core-accordion-item-tab');
if(item_tab.hasClass('gdlr-core-active')){
if(item_tab.closest('.gdlr-core-accordion-item').hasClass('gdlr-core-allow-close-all')){
item_tab.removeClass('gdlr-core-active')
.find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200);
}}else{
item_tab.addClass('gdlr-core-active')
.siblings('.gdlr-core-active').removeClass('gdlr-core-active')
.find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200);
}});
elem_icon.click(function(){
if($(this).closest('.gdlr-core-accordion-item-title').length){ return; }
$(this).siblings('.gdlr-core-accordion-item-content-wrapper').children('.gdlr-core-accordion-item-content').slideDown(200);
var item_tab=$(this).closest('.gdlr-core-accordion-item-tab');
if(item_tab.hasClass('gdlr-core-active')){
if(item_tab.closest('.gdlr-core-accordion-item').hasClass('gdlr-core-allow-close-all')){
item_tab.removeClass('gdlr-core-active')
.find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200);
}}else{
item_tab.addClass('gdlr-core-active')
.siblings('.gdlr-core-active').removeClass('gdlr-core-active')
.find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200);
}});
}
$.fn.gdlr_core_toggle_box=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem_title=$(this).find('.gdlr-core-toggle-box-item-title');
var elem_icon=$(this).find('.gdlr-core-toggle-box-item-icon');
}else{
var elem_title=filter_elem.filter('.gdlr-core-toggle-box-item-title');
var elem_icon=filter_elem.filter('.gdlr-core-toggle-box-item-icon');
}
elem_title.click(function(){
var toggle_parent=$(this).closest('.gdlr-core-toggle-box-item-tab');
if(toggle_parent.hasClass('gdlr-core-active')){
toggle_parent.removeClass('gdlr-core-active');
$(this).siblings('.gdlr-core-toggle-box-item-content').css({display: 'block'}).slideUp(200);
}else{
toggle_parent.addClass('gdlr-core-active');
$(this).siblings('.gdlr-core-toggle-box-item-content').css({display: 'none'}).slideDown(200);
}});
elem_icon.click(function(){
if($(this).closest('.gdlr-core-toggle-box-item-title').length){ return; }
var toggle_parent=$(this).closest('.gdlr-core-toggle-box-item-tab');
if(toggle_parent.hasClass('gdlr-core-active')){
toggle_parent.removeClass('gdlr-core-active');
$(this).siblings('.gdlr-core-toggle-box-item-content-wrapper').children('.gdlr-core-toggle-box-item-content').css({display: 'block'}).slideUp(200);
}else{
toggle_parent.addClass('gdlr-core-active');
$(this).siblings('.gdlr-core-toggle-box-item-content-wrapper').children('.gdlr-core-toggle-box-item-content').css({display: 'none'}).slideDown(200);
}});
}
$.fn.gdlr_core_alert_box_item=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-alert-box-remove');
}else{
var elem=filter_elem.filter('.gdlr-core-alert-box-remove');
}
elem.click(function(){
$(this).closest('.gdlr-core-alert-box-item').slideUp(400, 'easeOutQuart', function(){
$(this).remove();
});
});
}
$.fn.gdlr_core_particle_background=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-particle-bg');
}else{
var elem=filter_elem.filter('.gdlr-core-particle-bg');
}
elem.each(function(){
if(typeof(window.gdlr_particle_bg_id)=='undefined'){
window.gdlr_particle_bg_id=1;
}else{
window.gdlr_particle_bg_id++;
}
var item_id='gdlr-core-particle' + window.gdlr_particle_bg_id;
$(this).attr('id', item_id);
particlesJS(item_id, {
"particles": {
"number": {
"value": 40,
"density": {"enable": true,"value_area": 1500}},
"color": {"value": "#ffffff"},
"shape": {
"type": "circle",
"stroke": {"width": 0,"color": "#000000"},
"polygon": {"nb_sides": 5},
"image": {"src": "img/github.svg","width": 100,"height": 100}},
"opacity": {
"value": 0.8,
"random": false,
"anim": {"enable": false,"speed": 0.6,"opacity_min": 0.1,"sync": false}},
"size": {
"value": 2,
"random": true,
"anim": {"enable": false,"speed": 80,"size_min": 0.1,"sync": false}},
"line_linked": {"enable": true,"distance": 300,"color": "#ffffff","opacity": 0.4,"width": 2},
"move": {
"enable": true,
"speed": 12,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {"enable": false,"rotateX": 600,"rotateY": 1200}}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {"enable": false,"mode": "repulse"},
"onclick": {"enable": false,"mode": "push"},
"resize": true
},
"modes": {
"grab": {"distance": 800,"line_linked": {"opacity": 1}},
"bubble": {"distance": 800,"size": 80,"duration": 2,"opacity": 0.8,"speed": 3},
"repulse": {"distance": 400,"duration": 0.4},
"push": {"particles_nb": 4},
"remove": {"particles_nb": 2}}
},
"retina_detect": true
});
});
return $(this);
}
$.fn.gdlr_core_parallax_background=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-parallax');
}else{
var elem=filter_elem.filter('.gdlr-core-parallax');
}
elem.each(function(){
new gdlr_core_parallax($(this));
});
return $(this);
}
var gdlr_core_parallax=function(t){
this.wrapper_bg=t;
this.wrapper=t.parent();
this.parallax_speed=parseFloat(t.attr('data-parallax-speed'));
this.init();
}
gdlr_core_parallax.prototype={
init: function(){
var t=this;
if(t.parallax_speed!=0){
t.set_extra_height();
t.set_background_position(t);
$(window).on('load resize gdlr-core-element-resize', function(){
t.set_extra_height($(this));
t.set_background_position(t);
});
$(window).on('scroll pb-scroll', function(){
t.set_background_position(t);
});
}
if(gdlr_core_mobile){
t.wrapper_bg.children('[data-background-type="video"]').remove();
if(t.wrapper_bg.attr('data-video-fallback')){
t.wrapper_bg.css('background-image', 'url(' + t.wrapper_bg.attr('data-video-fallback') + ')')
}}else{
t.wrapper_bg.children('[data-background-type="video"]').each(function(){
if(t.parallax_speed==0){
t.set_extra_height();
t.set_background_position(t);
$(window).on('load resize gdlr-core-element-resize', function(){
t.set_extra_height($(this));
t.set_background_position(t);
});
}
$(this).find('iframe').each(function(){
if($(this).attr('data-player-type')=='vimeo'){
var player=$f($(this)[0]);
player.addEvent('ready', function(){
player.api('setVolume', 0);
});
}else if($(this).attr('data-player-type')=='youtube'){
if($('body').children('#gdlr-core-youtube-api').length==0){
$('body').append('<script src="https://www.youtube.com/iframe_api" id="gdlr-core-youtube-api" ></script>');
}
if(typeof(window.gdlr_core_ytb)=='undefined'){
window.gdlr_core_ytb=[$(this)[0]];
}else{
window.gdlr_core_ytb.push($(this)[0]);
}
window.onYouTubeIframeAPIReady=function(){
if(typeof(gdlr_core_ytb)!='undefined'){
for(var key in window.gdlr_core_ytb){
new YT.Player(gdlr_core_ytb[key],{
events: {
'onReady': function(e){
e.target.mute();
e.target.playVideo();
}}
});
}}
}}
});
});
}},
set_extra_height: function(){
var t=this;
var new_height=t.wrapper.outerHeight();
if(gdlr_core_display=='mobile-landscape'||gdlr_core_display=='mobile-portrait'){
t.wrapper_bg.css({'transform': ''});
}else{
if(t.parallax_speed > 0){
new_height +=(($(window).height() - t.wrapper.outerHeight()) * t.parallax_speed);
}else if(t.parallax_speed < 0){
new_height +=(($(window).height() + t.wrapper.outerHeight()) * Math.abs(t.parallax_speed));
}}
t.wrapper_bg.css({height: new_height});
var ratio=parseInt(gdlr_core_pbf.video.width) / parseInt(gdlr_core_pbf.video.height);
t.wrapper_bg.children('[data-background-type="video"]').each(function(){
if((t.wrapper_bg.width() / t.wrapper_bg.height()) > ratio){
var v_height=t.wrapper_bg.width() / ratio;
var v_margin=(t.wrapper_bg.height() - v_height) / 2;
$(this).css({width: t.wrapper_bg.width(), height: v_height, 'margin-left': 0, 'margin-top': v_margin});
}else{
var v_width=t.wrapper_bg.height() * ratio;
var v_margin=(t.wrapper_bg.width() - v_width) / 2;
$(this).css({width: v_width, height: t.wrapper_bg.height(), 'margin-left': v_margin, 'margin-top': 0});
}});
},
set_background_position: function(t){
if(gdlr_core_display=='mobile-landscape'||gdlr_core_display=='mobile-portrait') return;
var wrapper_top=t.wrapper.offset().top;
var scroll_pos=$(window).scrollTop();
if(scroll_pos + $(window).height() > wrapper_top &&
scroll_pos < wrapper_top + t.wrapper.outerHeight()){
if(t.parallax_speed > 0){
t.wrapper_bg.css({'transform': 'translate(0px, ' + (($(window).scrollTop() - wrapper_top) * t.parallax_speed) + 'px)'});
}else if(t.parallax_speed < 0){
t.wrapper_bg.css({'transform': 'translate(0px, ' + (($(window).scrollTop() + $(window).height() - wrapper_top) * t.parallax_speed) + 'px)'});
}}
}};
var gdlr_core_ux=function(container, filter_elem){
if(typeof(filter_elem)=='undefined'){
this.elem=container.find('[data-gdlr-animation]');
}else{
this.elem=filter_elem.filter('[data-gdlr-animation]');
this.preload=filter_elem.filter('.gdlr-core-page-preload');
}
this.ux_items=[];
this.ux_item_length=0;
this.init();
if(!gdlr_core_mobile&&gdlr_core_display=='desktop'){
if(typeof(filter_elem)=='undefined'){
var elem_3d=container.find('.gdlr-core-effect-3d');
}else{
var elem_3d=filter_elem.filter('.gdlr-core-effect-3d');
}
elem_3d.each(function(){
var plain=$(this);
var max_degree=$(this).attr('data-max-deg');
if(max_degree==null){
max_degree=30;
}
$(this).parent().on('mousemove', function(e){
if(!gdlr_core_display=='desktop') return;
var posX=e.pageX - $(this).offset().left;
var posY=e.pageY - $(this).offset().top;
var half_width=$(this).outerWidth()/2;
var half_height=$(this).outerHeight()/2;
var ax=max_degree * -(half_width - posX) / half_width;
var ay=max_degree * (half_height - posY) / half_height;
plain.removeClass('gdlr-core-animate-transform');
plain.css({'transform': 'rotateY(' + ax + 'deg) rotateX(' + ay + 'deg)'});
});
$(this).parent().on('mouseleave', function(e){
plain.addClass('gdlr-core-animate-transform');
plain.css({'transform': 'rotateY(0deg) rotateX(0deg)'});
setTimeout(function (){
plain.removeClass('gdlr-core-animate-transform');
}, 200);
});
});
}}
gdlr_core_ux.prototype={
init: function(){
var t=this;
t.ux_item_length=t.elem.each(function(){
var ux_item=$(this);
var ux_item_offset=0.8;
if($(this).attr('data-gdlr-animation-offset')){
ux_item_offset=parseFloat($(this).attr('data-gdlr-animation-offset'));
}
if((gdlr_core_display=='mobile-landscape'||gdlr_core_display=='mobile-portrait')||$(window).scrollTop() + $(window).height() > ux_item.offset().top){
t.ux_items.push(ux_item);
}else{
$(window).on('scroll pb-scroll', function(e){
if($(window).scrollTop() + ($(window).height() * ux_item_offset) > ux_item.offset().top){
t.ux_items.push(ux_item);
$(window).unbind('scroll', e.handleObj.handler, e);
}});
}}).length;
/*
if(typeof(t.preload)!='undefined'&&t.preload.length){
$(window).on('load', function(){
var preload_time=t.preload.attr('data-animation-time');
if(!preload_time){ preload_time=0; }
setTimeout(function(){
t.animate();
}, preload_time);
});
}else{
*/
t.animate();
},
animate: function(){
var t=this;
var ux_interval=setInterval(function(){
while(t.ux_items.length > 0){
var ux_animate=t.ux_items.shift();
var animation_duration='600ms';
if(ux_animate.attr('data-gdlr-animation-duration')){
animation_duration=ux_animate.attr('data-gdlr-animation-duration');
}
ux_animate.css({ 'animation-duration':  animation_duration });
ux_animate.addClass(ux_animate.attr('data-gdlr-animation'));
setTimeout(function(){
ux_animate.css({ 'animation-duration':  '' })
.removeClass(ux_animate.attr('data-gdlr-animation'))
.removeAttr('data-gdlr-animation');
}, parseInt(animation_duration));
t.ux_item_length--;
if($(window).scrollTop() < ux_animate.offset().top + ux_animate.outerHeight()){
break;
}}
if(t.ux_item_length <=0){
clearInterval(ux_interval);
}}, 200);
}};
$.fn.gdlr_core_ux=function(filter_elem){
new gdlr_core_ux($(this), filter_elem);
return $(this);
}
$.fn.gdlr_core_skill_bar=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-skill-bar-filled');
}else{
var elem=filter_elem.filter('.gdlr-core-skill-bar-filled');
}
elem.each(function(){
var t=$(this);
if((gdlr_core_display=='mobile-landscape'||gdlr_core_display=='mobile-portrait')||$(window).scrollTop() + $(window).height() > t.offset().top){
t.animate({width: parseInt(t.attr('data-width')) + '%'}, {duration: 1200, easing: 'easeOutQuart'}).addClass('gdlr-core-animate');
}else{
$(window).on('scroll pb-scroll', function(e){
if($(window).scrollTop() + $(window).height() > t.offset().top){
t.animate({width: parseInt(t.attr('data-width')) + '%'}, {duration: 1200, easing: 'easeOutQuart'}).addClass('gdlr-core-animate');
$(window).unbind('scroll pb-scroll', e.handleObj.handler, e);
}});
}});
}
$.fn.gdlr_core_divider=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-divider-item-with-icon-inner');
}else{
var elem=filter_elem.filter('.gdlr-core-divider-item-with-icon-inner');
}
elem.each(function(){
var divider_elem=$(this);
var icon_width=divider_elem.children('i, img').outerWidth();
var divider_width=(divider_elem.width() - icon_width) / 2;
$(this).children('.gdlr-core-divider-line').css({ width: divider_width }).each(function(){
$(this).css('margin-top', -$(this).outerHeight()/2);
});
$(window).on('resize gdlr-core-element-resize', function(){
icon_width=divider_elem.children('i, img').outerWidth();
divider_width=(divider_elem.width() - icon_width) / 2;
divider_elem.children('.gdlr-core-divider-line').css({ width: divider_width }).each(function(){
$(this).css('margin-top', -$(this).outerHeight()/2);
});
});
});
}
window.gdlr_core_sidebar_wrapper=function(container, filter_elem){
if(typeof(filter_elem)=='undefined'){
this.elem=container.find('.gdlr-core-page-builder-wrapper-sidebar-container, .gdlr-core-pbf-sidebar-container');
}else{
this.elem=filter_elem.filter('.gdlr-core-page-builder-wrapper-sidebar-container, .gdlr-core-pbf-sidebar-container');
}
this.init();
}
gdlr_core_sidebar_wrapper.prototype={
init: function(){
var t=this;
var sync_height=false;
t.elem.each(function(){
if($(this).children().children('.gdlr-core-pbf-background-wrap').length){
sync_height=true;
}});
if(sync_height){
t.set_height();
$(window).on('load resize gdlr-core-element-resize', function(){ t.set_height(); });
}},
set_height: function(){
var t=this;
t.elem.each(function(){
var sidebar_elem=$(this).find('.gdlr-core-pbf-sidebar-padding');
sidebar_elem.css('min-height', '');
if(gdlr_core_display=='mobile-landscape'||gdlr_core_display=='mobile-portrait') return;
var max_height=0;
sidebar_elem.each(function(){
if($(this).outerHeight() > max_height){
max_height=$(this).outerHeight();
}});
sidebar_elem.css('min-height', max_height);
});
}};
$.fn.gdlr_core_title_divider=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-title-item-title-wrap.gdlr-core-with-divider');
}else{
var elem=filter_elem.filter('.gdlr-core-title-item-title-wrap.gdlr-core-with-divider');
}
elem.each(function(){
var t=$(this);
var divider=t.children('.gdlr-core-title-item-divider');
var divider_num=t.children('.gdlr-core-title-item-divider').length;
divider_num=(divider_num)? divider_num: 1;
var title_width=t.children('.gdlr-core-title-item-title').outerWidth(true);
var divider_width=(t.width() - title_width) / divider_num;
if(t.children('.gdlr-core-title-item-link').length){
var right_pos=t.children('.gdlr-core-title-item-link').outerWidth() + 20;
divider_width=divider_width - right_pos;
}
if(t.children('.gdlr-core-title-item-link').length){
divider.css({ width: divider_width, right: right_pos });
}else{
divider.css({ width: divider_width });
}
$(window).on('resize gdlr-core-element-resize', function(){
title_width=t.children('.gdlr-core-title-item-title').outerWidth(true);
divider_width=(t.width() - title_width) / divider_num;
if(t.children('.gdlr-core-title-item-link').length){
right_pos=t.children('.gdlr-core-title-item-link').outerWidth() + 20;
divider_width=divider_width - right_pos;
}
if(t.children('.gdlr-core-title-item-link').length){
divider.css({ width: divider_width, right: right_pos });
}else{
divider.css({ width: divider_width });
}});
});
if(typeof(filter_elem)=='undefined'){
var elem2=$(this).find('.gdlr-core-title-item-title-wrap.gdlr-core-with-link-text');
}else{
var elem2=filter_elem.filter('.gdlr-core-title-item-title-wrap.gdlr-core-with-link-text');
}
elem2.each(function(){
var t=$(this);
var title_width=t.children('.gdlr-core-title-item-title').outerWidth(true);
var right_pos=t.children('.gdlr-core-title-item-link').outerWidth();
if(t.width() < title_width + right_pos){
t.children('.gdlr-core-title-item-link').addClass('gdlr-core-overflow');
}else{
t.children('.gdlr-core-title-item-link').removeClass('gdlr-core-overflow');
}
$(window).on('resize gdlr-core-element-resize', function(){
if(t.width() < title_width + right_pos){
t.children('.gdlr-core-title-item-link').addClass('gdlr-core-overflow');
}else{
t.children('.gdlr-core-title-item-link').removeClass('gdlr-core-overflow');
}});
});
}
$.fn.gdlr_core_flipbox=function(filter_elem){
if(typeof($.fn.flip)=='function'){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-flipbox');
}else{
var elem=filter_elem.filter('.gdlr-core-flipbox');
}
elem.each(function(){
var flipbox_obj=$(this).flip({
axis: 'y',
trigger: 'hover',
autoSize: false,
front: '.gdlr-core-flipbox-front',
back: '.gdlr-core-flipbox-back'
});
$(this).find('.gdlr-core-flipbox-back a').click(function(){
if(flipbox_obj.data('flip-model')){
flipbox_obj.data('flip-model').unflip();
}});
$(this).find('.gdlr-core-flipbox-back').on('touchstart', function(){
$(this).closest('.gdlr-core-flipbox').data('flip-model').unflip();
});
$(this).find('.gdlr-core-flipbox-front').on('touchstart', function(){
$(this).closest('.gdlr-core-flipbox').data('flip-model').flip();
});
$(this).addClass('gdlr-core-after-init');
});
}
return $(this);
}
$.fn.gdlr_core_marquee=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-marquee');
}else{
var elem=filter_elem.filter('.gdlr-core-marquee');
}
elem.each(function(){
var speed=$(this).attr('data-speed')? parseFloat($(this).attr('data-speed')): 10000;
var direction=$(this).attr('data-direction')? parseFloat($(this).attr('data-direction')): 'left';
$(this).marquee({
delayBeforeStart: 0,
duration: speed,
gap: 50,
direction: direction,
duplicated: true,
startVisible: true
});
});
return $(this);
}
function gdlr_core_skill_circle_height(t){
t.children('.gdlr-core-skill-circle-content').each(function(){
$(this).css({'margin-top': -$(this).outerHeight()/2});
});
t.css({'max-width': t.parent().width(), 'max-height': t.parent().width()});
}
$.fn.gdlr_core_pie_chart=function(){
if(typeof($.fn.easyPieChart)=='function'){
$(this).easyPieChart({
animate: parseInt($(this).attr('data-duration')),
lineWidth: parseInt($(this).attr('data-line-width')),
size: parseInt($(this).attr('data-width')),
barColor: $(this).attr('data-filled-color'),
trackColor: $(this).attr('data-filled-background'),
scaleColor: false,
lineCap: 'square'
});
}}
$.fn.gdlr_core_skill_circle=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-skill-circle');
}else{
var elem=filter_elem.filter('.gdlr-core-skill-circle');
}
elem.each(function(){
var t=$(this);
gdlr_core_skill_circle_height(t);
$(window).on('resize gdlr-core-element-resize', function(){ gdlr_core_skill_circle_height(t); });
if($(window).scrollTop() + $(window).height() > t.offset().top){
t.gdlr_core_pie_chart();
}else{
$(window).on('scroll pb-scroll', function(e){
if($(window).scrollTop() + $(window).height() > t.offset().top){
t.gdlr_core_pie_chart();
$(window).unbind('scroll pb-scroll', e.handleObj.handler, e);
}});
}});
}
$.fn.gdlr_core_chart_js=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-chart-js');
}else{
var elem=filter_elem.filter('.gdlr-core-chart-js');
}
if(typeof(window.gdlr_core_chart_js_id)=='undefined'){
window.gdlr_core_chart_js_id=0;
}
elem.each(function(){
var data=[];
var options=[];
if($(this).attr('data-content')){
data=JSON.parse($(this).attr('data-content'));
}
if($(this).attr('data-options')){
options=JSON.parse($(this).attr('data-options'));
}
if($(this).attr('data-type')=='doughnut'||$(this).attr('data-type')=='pie'){
if(options.legend.position=='right'||options.legend.position=='left'){
if(gdlr_core_display=='mobile-portrait'||gdlr_core_display=='mobile-landscape'){
options.legend.orig_position=options.legend.position;
options.legend.position='bottom';
$(this).attr('width', $(this).width());
$(this).attr('height', $(this).width() * 1);
}}
}
options.onResize=function(chart, size){
if(chart.config.type=='doughnut'||chart.config.type=='pie'){
if(chart.config.options.legend.position=='right'||chart.config.options.legend.position=='left'){
if(gdlr_core_display=='mobile-portrait'||gdlr_core_display=='mobile-landscape'){
chart.config.options.legend.orig_position=chart.config.options.legend.position;
chart.config.options.legend.position='bottom';
chart.aspectRatio=1;
}}else if(typeof(chart.config.options.legend.orig_position)!='undefined'){
if(gdlr_core_display=='tablet'||gdlr_core_display=='desktop'){
chart.config.options.legend.position=chart.config.options.legend.orig_position;
chart.aspectRatio=2;
}}
}}
var chartType=$(this).attr('data-type')? $(this).attr('data-type'): 'pie';
if(chartType=='horizontalBar'){
chartType='bar';
options['indexAxis']='y';
}
new Chart($(this), {
type: chartType,
data: data,
options: options
});
});
}
$.fn.gdlr_core_tab=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
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');
}else{
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');
}
var url_hash=window.location.hash;
if(url_hash){
url_hash=url_hash.replace('#', '');
elem.find('[data-tab-id="' + url_hash + '"]').each(function(){
$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
});
}
elem.each(function(){
$(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(){
if($(this).hasClass('gdlr-core-active')) return;
var tab_id=$(this).attr('data-tab-id');
$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
if($(this).is('.gdlr-core-tab-featurev-title')){
var parent=$(this).parent().parent();
parent.closest('.gdlr-core-tab-featurev-item').find('.gdlr-core-tab-featurev-background-switch').each(function(){
$(this).children().removeClass('gdlr-core-active');
$(this).children('[data-tab-id="' + tab_id + '"]').addClass('gdlr-core-active');
});
}else{
var parent=$(this).parent();
}
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(){
var active_tab=$(this).children('[data-tab-id="' + tab_id + '"]');
if(active_tab.length){
active_tab.fadeIn(200).siblings().hide();
}else{
$(this).children().hide();
}});
});
if(!(gdlr_core_mobile||gdlr_core_display=='mobile-landscape'||gdlr_core_display=='mobile-portrait') &&
$(this).is('.gdlr-core-tab-feature2-item, .gdlr-core-tab-feature3-item')){
var slide_bar_width=35;
var slide_bar=$(this).find('.gdlr-core-tab-feature2-bottom-slide-bar, .gdlr-core-tab-feature3-bottom-slide-bar');
var active_tab=slide_bar.siblings('.gdlr-core-active');
if(active_tab.length){
if(active_tab.is('.gdlr-core-tab-feature3-title-wrap')){
slide_bar_width=active_tab.outerWidth();
}
slide_bar.css({ width: slide_bar_width, left: active_tab.position().left + (active_tab.width() - slide_bar_width)/2 });
}
$(window).resize(function(){
active_tab=slide_bar.siblings('.gdlr-core-active');
if(active_tab.is('.gdlr-core-tab-feature3-title-wrap')){
slide_bar_width=active_tab.outerWidth();
}
slide_bar.css({ width: slide_bar_width, left: active_tab.position().left + (active_tab.width() - slide_bar_width)/2 });
});
$(this).find('.gdlr-core-tab-feature2-title-wrap, .gdlr-core-tab-feature3-title-wrap').click(function(){
active_tab=$(this);
});
$(this).find('.gdlr-core-tab-feature2-title-wrap, .gdlr-core-tab-feature3-title-wrap').hover(function(){
if($(this).is('.gdlr-core-tab-feature3-title-wrap')){
slide_bar_width=$(this).outerWidth();
}
slide_bar.animate({ width: slide_bar_width, left: $(this).position().left + ($(this).width() - slide_bar_width)/2 }, {duration: 200, queue: false});
}, function(){
if($(this).is('.gdlr-core-tab-feature3-title-wrap')){
slide_bar_width=$(this).outerWidth();
}
slide_bar.animate({ width: slide_bar_width, left: active_tab.position().left + (active_tab.width() - slide_bar_width)/2 }, {duration: 200, queue: false});
});
}
if(!(gdlr_core_mobile||gdlr_core_display=='mobile-landscape'||gdlr_core_display=='mobile-portrait') &&
$(this).is('.gdlr-core-tab-style2-horizontal, .gdlr-core-tab-style2-vertical, .gdlr-core-tab-style3-horizontal')){
var horizontal=$(this).is('.gdlr-core-tab-style2-horizontal, .gdlr-core-tab-style3-horizontal');
var hover_line=$(this).find('.gdlr-core-tab-item-title-line');
var hover_line_w=0;
var hover_line_l=0;
$(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-active').each(function(){
if(horizontal){
hover_line_w=$(this).outerWidth();
hover_line_l=$(this).position().left;
hover_line.css({ width: hover_line_w, left: hover_line_l });
}else{
hover_line_w=$(this).outerHeight();
hover_line_l=$(this).position().top;
hover_line.css({ height: hover_line_w, top: hover_line_l });
}
hover_line.addClass('gdlr-core-initiated');
});
$(window).on('resize gdlr-core-element-resize', function(){
$(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-active').each(function(){
if(horizontal){
hover_line_w=$(this).outerWidth();
hover_line_l=$(this).position().left;
hover_line.css({ width: hover_line_w, left: hover_line_l });
}else{
hover_line_w=$(this).outerHeight();
hover_line_l=$(this).position().top;
hover_line.css({ height: hover_line_w, top: hover_line_l });
}});
});
$(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-tab-item-title').hover(function(){
if(horizontal){
hover_line.animate({ width: $(this).outerWidth(), left: $(this).position().left }, { duration: 300, easing: 'easeOutQuart', queue: false });
}else{
hover_line.animate({ height: $(this).outerHeight(), top: $(this).position().top }, { duration: 300, easing: 'easeOutQuart', queue: false });
}}, function(){
if(horizontal){
hover_line.animate({ width: hover_line_w, left: hover_line_l }, { duration: 300, easing: 'easeOutQuart', queue: false });
}else{
hover_line.animate({ height: hover_line_w, top: hover_line_l }, { duration: 300, easing: 'easeOutQuart', queue: false });
}});
$(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-tab-item-title').click(function(){
if(horizontal){
hover_line_w=$(this).outerWidth();
hover_line_l=$(this).position().left;
hover_line.css({ width: hover_line_w, left: hover_line_l });
}else{
hover_line_w=$(this).outerHeight();
hover_line_l=$(this).position().top;
hover_line.css({ height: hover_line_w, top: hover_line_l });
}});
}});
return $(this);
}
$.fn.gdlr_core_price_table_tab=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-price-table-tab-title-wrap');
}else{
var elem=filter_elem.filter('.gdlr-core-price-table-tab-title-wrap');
}
elem.each(function(){
var tab_title=$(this);
tab_title.find('.gdlr-core-price-table-tab-title').on('click', function(){
if($(this).hasClass('gdlr-core-active')) return;
var price_tab=$(this).attr('data-price-tab');
$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
tab_title.siblings('.gdlr-core-price-table-tab-content-wrap').find('[data-price-tab="' + price_tab + '"]').each(function(){
$(this).siblings('.gdlr-core-active').css({display: 'none'}).removeClass('gdlr-core-active');
$(this).fadeIn(200).addClass('gdlr-core-active');
});
});
});
}
$.fn.gdlr_core_sliding_gallery=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-sliding-gallery');
}else{
var elem=filter_elem.filter('.gdlr-core-sliding-gallery');
}
elem.each(function(){
var container=$(this);
var speed=container.attr('data-speed');
var firstImage=$(this).children().first();
var secondImage=firstImage.next();
if(!speed){
speed=100;
}else{
speed=parseFloat(speed) / 100;
}
setInterval(function(){
var margin_left=parseFloat(firstImage.css('margin-left'));
margin_left -=speed;
firstImage.css('margin-left', margin_left);
if(secondImage.position().left <=0){
firstImage.css('margin-left', 0);
container.append(firstImage);
firstImage=secondImage;
secondImage=firstImage.next();
}}, 10);
});
}
$.fn.gdlr_core_sly=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-sly-slider');
}else{
var elem=filter_elem.filter('.gdlr-core-sly-slider');
}
elem.addClass('gdlr-core-after-init').each(function(){
var sly_slider=$(this);
var sly_atts={
horizontal: 1,
itemNav: 'basic',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 0,
scrollBy: 1,
speed: 1000,
elasticBounds: 1,
easing: 'easeOutQuart',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
scrollBar: $(this).siblings('.gdlr-core-sly-scroll')
};
if(sly_slider.hasClass('gdlr-core-with-bullet')){
var nav=$('<ul class="gdlr-core-sly-nav" ></ul>');
nav.insertAfter(sly_slider);
sly_atts['pagesBar']=nav;
sly_atts['activatePageOn']='click';
}
sly_slider.sly(sly_atts);
$(window).on('resize gdlr-core-element-resize', function(){ sly_slider.sly('reload'); });
});
return $(this);
}
$.fn.gdlr_core_flexslider=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-flexslider');
}else{
var elem=filter_elem.filter('.gdlr-core-flexslider');
}
elem.each(function(){
var flex_attr={
useCSS: false,
animation: 'fade',
animationLoop: true,
pauseOnHover: false,
prevText: '<i class="arrow_carrot-left"></i>',
nextText: '<i class="arrow_carrot-right"></i>'
};
if($(this).attr('data-start-at')&&$(this).attr('data-start-at') > 1){
flex_attr.startAt=$(this).attr('data-start-at') - 1;
}
if($(this).find('.gdlr-core-flexslider').length > 0){
$(this).children('ul.slides').addClass('parent-slides');
flex_attr.selector='.parent-slides > li';
}
if($(this).attr('data-disable-autoslide')){
flex_attr.slideshow=false;
}
if($(this).attr('data-pausetime')){
flex_attr.slideshowSpeed=parseInt($(this).attr('data-pausetime'));
}
if($(this).attr('data-slidespeed')){
flex_attr.animationSpeed=parseInt($(this).attr('data-slidespeed'));
}else{
flex_attr.animationSpeed=500;
}
if($(this).attr('data-type')=='carousel'){
flex_attr.move=$(this).attr('data-move')? parseInt($(this).attr('data-move')): 1;
flex_attr.animation='slide';
var column_num=parseInt($(this).attr('data-column'));
if($(this).attr('data-margin')){
flex_attr.itemMargin=parseInt($(this).attr('data-margin'));
}else{
flex_attr.itemMargin=2 * parseInt($(this).children('ul.slides').children('li:first-child').css('margin-right'));
}
flex_attr.itemWidth=(($(this).width() + flex_attr.itemMargin) / column_num) - (flex_attr.itemMargin);
flex_attr.minItems=column_num;
flex_attr.maxItems=column_num;
var slides=$(this).find('ul.slides').children();
var flex_item=$(this);
if(slides.length < column_num){
flex_item.addClass('gdlr-core-flex-inactive');
$(window).on('resize gdlr-core-element-resize', function(){
if(gdlr_core_display=='mobile-landscape'||gdlr_core_display=='mobile-portrait'){
flex_item.removeClass('gdlr-core-flex-inactive');
}else{
flex_item.addClass('gdlr-core-flex-inactive');
}});
}
var t=$(this);
$(window).on('resize gdlr-core-element-resize', function(){
if(t.data('goodlayers_flexslider')){
var newWidth=((t.width() + flex_attr.itemMargin) / column_num) - (flex_attr.itemMargin);
t.data('goodlayers_flexslider').editItemWidth(newWidth);
}});
}else if($(this).attr('data-effect')){
if($(this).attr('data-effect')=='kenburn'){
flex_attr.animation='fade';
}else{
flex_attr.animation=$(this).attr('data-effect');
}}
var data_nav=['both', 'navigation', 'navigation-outer-plain-round', 'navigation-top', 'navigation-bottom', 'navigation-inner', 'navigation-outer'];
if(!$(this).attr('data-nav')||data_nav.indexOf($(this).attr('data-nav'))!=-1){
if(!$(this).hasClass('gdlr-core-bottom-nav-1')){ 
if($(this).attr('data-nav-parent')){
if($(this).attr('data-nav-parent')=='self'){
flex_attr.customDirectionNav=$(this).find('.flex-prev, .flex-next');
}if($(this).attr('data-nav-type')=='custom'){
flex_attr.customDirectionNav=$(this).closest('.' + $(this).attr('data-nav-parent')).find('.flex-prev, .flex-next');
}else{
$(this).closest('.' + $(this).attr('data-nav-parent')).each(function(){
var flex_nav=$('<ul class="flex-direction-nav">' +
'<li class="flex-nav-prev"><a class="flex-prev" aria-label="left arrow" href="#"><i class="arrow_carrot-left"></i></a></li>' +
'<li class="flex-nav-next"><a class="flex-next" aria-label="right arrow" href="#"><i class="arrow_carrot-right"></i></a></li>' +
'</ul>');
var flex_nav_position=$(this).find('.gdlr-core-flexslider-nav');
if(flex_nav_position.length){
flex_nav_position.append(flex_nav);
flex_attr.customDirectionNav=flex_nav.find('.flex-prev, .flex-next');
}});
}}
}}else if($(this).attr('data-nav')=='touch-navigation'||$(this).attr('data-nav')=='touch-navigation-bullet'){
var navFollow=$('<div class="goodlayers-carousel-nav-follow"></div>');
navFollow.attr('data-type', 'touch-slide-black');
var container=$(this).find('ul.slides');
$(this).append(navFollow);
container.get(0).addEventListener('mousemove', function(e){
if(!navFollow.hasClass('goodlayers-active')){
navFollow.addClass('goodlayers-active');
}
navFollow.css({'left': e.clientX, 'top': e.clientY});
});
container.on('mouseleave', function(){
navFollow.removeClass('goodlayers-active');
});
container.on('mouseenter', 'a', function(){
navFollow.addClass('goodlayers-over-link');
});
container.on('mouseleave', 'a', function(){
navFollow.removeClass('goodlayers-over-link');
});
container.gdlr_core_monitor_swipe();
flex_attr.directionNav=false;
}else{
flex_attr.directionNav=false;
}
if($(this).hasClass('gdlr-core-has-bullet')){
flex_attr.controlNav=true;
}else{
flex_attr.controlNav=false;
}
if($(this).attr('data-thumbnail')){
var thumbnail_slide=$(this).siblings('.gdlr-core-sly-slider');
flex_attr.manualControls=thumbnail_slide.find('ul.slides li')
flex_attr.controlNav=true;
}
if($(this).attr('data-vcenter-nav')){
flex_attr.start=function(slider){
$(slider).children('.gdlr-core-flexslider-custom-nav.gdlr-core-style-navigation-outer').each(function(){
$(this).insertAfter($(slider).children('.flex-viewport'));
});
if(slider.directionNav){
$(window).on('resize gdlr-core-element-resize', function(){
slider.directionNav.each(function(){
var margin=-(slider.height() + $(this).outerHeight()) / 2;
$(this).css('margin-top', margin);
});
});
}
if(typeof(slider.slides)!='undefined'){
$(window).trigger('gdlr-core-element-resize');
slider.slides.filter('.flex-active-slide').addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
}};}else{
flex_attr.start=function(slider){
if(typeof(slider.slides)!='undefined'){
if($(slider).attr('data-controls-top-margin')){
$(slider).find('.flex-control-nav').css({ 'margin-top': $(slider).attr('data-controls-top-margin') });
}
$(slider).children('.gdlr-core-flexslider-custom-nav.gdlr-core-style-navigation-bottom').each(function(){
$(this).insertAfter($(slider).children('.flex-viewport'));
});
$(window).trigger('gdlr-core-element-resize');
slider.slides.filter('.flex-active-slide').addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
}}
}
flex_attr.after=function(slider){
slider.slides.filter('.flex-active-slide').addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
}
if($(this).find('.gdlr-core-outer-frame-element').length > 0){
$(this).addClass('gdlr-core-with-outer-frame-element');
}
var slider_item=$(this).goodlayers_flexslider(flex_attr);
$(this).find('.gdlr-custom-flex-prev, .gdlr-custom-flex-next').on('click', function(){
if($(this).is('.gdlr-custom-flex-prev')){
slider_item.goodlayers_flexslider('prev');
}else{
slider_item.goodlayers_flexslider('next');
}});
$(this).closest('.gdlr-core-flexslider-outer').find('.gdlr-core-flexslider-left-content-nav').each(function(){
$(this).find('.gdlr-custom-flex-prev, .gdlr-custom-flex-next').on('click', function(){
if($(this).is('.gdlr-custom-flex-prev')){
slider_item.goodlayers_flexslider('prev');
}else{
slider_item.goodlayers_flexslider('next');
}});
});
$(this).find('ul.slides').on('swipeleft', function(){
slider_item.goodlayers_flexslider('next');
});
$(this).find('ul.slides').on('swiperight', function(){
slider_item.goodlayers_flexslider('prev');
});
});
return $(this);
}
window.gdlr_core_sticky_sidebar=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
this.elem=$(this).find('.gdlr-core-sticky-sidebar');
}else{
this.elem=filter_elem.filter('.gdlr-core-sticky-sidebar');
}
this.init();
}
gdlr_core_sticky_sidebar.prototype={
init: function(){
var t=this;
t.elem.each(function(){
$(this).find('.gdlr-core-pbf-sidebar-left, .gdlr-core-pbf-sidebar-right, .gdlr-core-sidebar-script').each(function(){
var sidebar_item=$(this);
var sidebar_wrap=sidebar_item.parent();
var sidebar_sub=$('<div></div>');
var offset=sidebar_item.attr('data-sticky-offset');
if(!offset){
offset=0;
}else{
offset=parseInt(offset);
}
var prev_scroll=0;
$(window).on('scroll resize', function(e){
if(sidebar_item.outerHeight() >=sidebar_wrap.outerHeight()){
t.return_sidebar_pos(sidebar_sub, sidebar_item);
return;
}
if(gdlr_core_display!='desktop'){
t.return_sidebar_pos(sidebar_sub, sidebar_item);
return;
}
var scroll_pos=$(window).scrollTop();
var scroll_direction=(prev_scroll > scroll_pos)? 'up': 'down';
prev_scroll=scroll_pos;
if($(window).height() > sidebar_item.height()){
if(scroll_pos + offset <=sidebar_wrap.offset().top){
if(sidebar_item.hasClass('gdlr-core-fixed-sidebar')||sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar')){
t.return_sidebar_pos(sidebar_sub, sidebar_item);
}}else{
if(scroll_pos + sidebar_item.outerHeight() >=sidebar_wrap.offset().top + sidebar_wrap.outerHeight()){
if(!sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar')){
t.set_sidebar_sub(sidebar_sub, sidebar_item);
sidebar_item.addClass('gdlr-core-fixed-bottom-sidebar').removeClass('gdlr-core-fixed-sidebar');
sidebar_item.css({
'position': 'absolute',
'top': 'auto',
'bottom': 0,
'left': sidebar_sub.position().left,
'width': sidebar_sub.outerWidth()
});
}}else{
if(!sidebar_item.hasClass('gdlr-core-fixed-sidebar')){
t.set_sidebar_sub(sidebar_sub, sidebar_item);
sidebar_item.addClass('gdlr-core-fixed-sidebar').removeClass('gdlr-core-fixed-bottom-sidebar');
sidebar_item.css({
'position': 'fixed',
'top': offset,
'bottom': 'auto',
'width': sidebar_sub.outerWidth()
});
sidebar_item.css({
'left': sidebar_sub.offset().left,
});
}}
if(e.type=='resize'){
if(sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar')){
sidebar_item.css({
'width': sidebar_sub.outerWidth(),
'left': sidebar_sub.position().left,
});
}else if(sidebar_item.hasClass('gdlr-core-fixed-sidebar')){
sidebar_item.css({
'width': sidebar_sub.outerWidth(),
'left': sidebar_sub.offset().left,
});
}}
}}else{
if(scroll_pos <=sidebar_wrap.offset().top){
if(sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar')||sidebar_item.hasClass('gdlr-core-stick-bottom-sidebar') ||
sidebar_item.hasClass('gdlr-core-fixed-top-sidebar')||sidebar_item.hasClass('gdlr-core-stick-top-sidebar')){
t.return_sidebar_pos(sidebar_sub, sidebar_item);
}}else{
if(scroll_direction=='down'){
if(sidebar_item.hasClass('gdlr-core-fixed-top-sidebar')){
t.set_sidebar_sub(sidebar_sub, sidebar_item);
sidebar_item.addClass('gdlr-core-stick-top-sidebar').removeClass('gdlr-core-fixed-bottom-sidebar gdlr-core-fixed-top-sidebar gdlr-core-stick-bottom-sidebar');
sidebar_item.css({
'position': 'absolute',
'top': scroll_pos - sidebar_wrap.offset().top,
'bottom': 'auto',
'left': sidebar_sub.position().left,
'width': sidebar_sub.outerWidth()
});
}else if(scroll_pos + $(window).height() >=sidebar_wrap.offset().top + sidebar_wrap.outerHeight()){
t.set_sidebar_sub(sidebar_sub, sidebar_item);
sidebar_item.addClass('gdlr-core-stick-bottom-sidebar').removeClass('gdlr-core-fixed-bottom-sidebar gdlr-core-fixed-top-sidebar gdlr-core-stick-top-sidebar');
sidebar_item.css({
'position': 'absolute',
'top': 'auto',
'bottom': 0,
'left': sidebar_sub.position().left,
'width': sidebar_sub.outerWidth()
});
}else if(scroll_pos + $(window).height() > sidebar_item.offset().top + sidebar_item.outerHeight()){
t.set_sidebar_sub(sidebar_sub, sidebar_item);
sidebar_item.addClass('gdlr-core-fixed-bottom-sidebar').removeClass('gdlr-core-stick-bottom-sidebar gdlr-core-stick-top-sidebar gdlr-core-fixed-top-sidebar');
sidebar_item.css({
'position': 'fixed',
'top': 'auto',
'bottom': '0',
'left': sidebar_sub.offset().left,
'width': sidebar_sub.outerWidth()
});
}}else{
if(sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar')){
t.set_sidebar_sub(sidebar_sub, sidebar_item);
sidebar_item.addClass('gdlr-core-stick-bottom-sidebar').removeClass('gdlr-core-fixed-bottom-sidebar gdlr-core-fixed-top-sidebar gdlr-core-stick-top-sidebar');
sidebar_item.css({
'position': 'absolute',
'top': scroll_pos + $(window).height() - sidebar_item.outerHeight() - sidebar_wrap.offset().top,
'bottom': 'auto',
'left': sidebar_sub.position().left,
'width': sidebar_sub.outerWidth()
});
}else{
if(scroll_pos < sidebar_item.offset().top){
t.set_sidebar_sub(sidebar_sub, sidebar_item);
sidebar_item.addClass('gdlr-core-fixed-top-sidebar').removeClass('gdlr-core-stick-bottom-sidebar gdlr-core-fixed-bottom-sidebar gdlr-core-stick-top-sidebar');
sidebar_item.css({
'position': 'fixed',
'top': '0',
'bottom': 'auto',
'left': sidebar_sub.offset().left,
'width': sidebar_sub.outerWidth()
});
}}
}
if(e.type=='resize'){
if(sidebar_item.hasClass('gdlr-core-stick-bottom-sidebar')||sidebar_item.hasClass('gdlr-core-stick-top-sidebar')){
sidebar_item.css({
'width': sidebar_sub.outerWidth(),
'left': sidebar_sub.position().left,
});
}else if(sidebar_item.hasClass('gdlr-core-fixed-bottom-sidebar')||sidebar_item.hasClass('gdlr-core-fixed-top-sidebar')){
sidebar_item.css({
'width': sidebar_sub.outerWidth(),
'left': sidebar_sub.offset().left,
});
}}
}}
});
});
});
},
set_sidebar_sub: function(sidebar_sub, sidebar_item){
if(sidebar_item.hasClass('gdlr-core-sidebar-sub-added')) return;
var sidebar_class='';
sidebar_item.each(function(){
var className=this.className.match(/gdlr-core-column-\d+/);
if(className){
sidebar_class=className[0];
}});
sidebar_sub.addClass(sidebar_class);
sidebar_sub.css({
'float': sidebar_item.css('float'),
'height': 20,
'background': '#fd9'
});
sidebar_sub.insertAfter(sidebar_item);
sidebar_item.addClass('gdlr-core-sidebar-sub-added');
},
return_sidebar_pos: function(sidebar_sub, sidebar_item){
sidebar_item.css({'position': '', 'top': '', 'bottom': '', 'left': '', 'width': '', 'height': ''});
sidebar_item.removeClass('gdlr-core-fixed-sidebar gdlr-core-fixed-bottom-sidebar gdlr-core-sidebar-sub-added');
sidebar_item.removeClass('gdlr-core-stick-bottom-sidebar gdlr-core-fixed-bottom-sidebar gdlr-core-fixed-top-sidebar');
sidebar_sub.remove();
}}
$.fn.gdlr_core_isotope=function(filter_elem){
if(typeof($.fn.isotope)=='function'){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('[data-layout="masonry"]');
}else{
var elem=filter_elem.filter('[data-layout="masonry"]');
}
elem.each(function(){
var t=$(this);
if(t.children('ul.products').length){
t=t.children('ul.products');
}
var columnSize=t.width() / 60;
t.isotope({
itemSelector: '.gdlr-core-item-list',
layoutMode: 'masonry',
masonry:{
columnWidth: columnSize
}});
t.isotope();
t.find('.gdlr-core-item-list').gdlr_core_animate_list_item();
$(window).on('resize gdlr-core-element-resize', function(){
columnSize=t.width() / 60;
t.isotope({
masonry:{
columnWidth: columnSize
}});
});
});
}
return $(this);
}
$.fn.gdlr_core_animate_list_item=function(){
var ux_items=$(this).get();
var ux_interval=setInterval(function(){
if(ux_items.length > 0){
var ux_animate=$(ux_items.shift());
var animation_duration='600ms';
ux_animate.css({'animation-duration': animation_duration});
ux_animate.addClass('gdlr-core-animate');
setTimeout(function(){
ux_animate.css({'animation-duration':  ''})
.addClass('gdlr-core-animate-end')
.removeClass('gdlr-core-animate gdlr-core-animate-init');
}, parseInt(animation_duration));
}else{
clearInterval(ux_interval);
}}, 200);
}
$.fn.gdlr_core_lightbox=function(filter_elem){
if(typeof($.iLightBox)=='function'){
if(typeof(filter_elem)=='undefined'){
var ilightbox=$(this).find('.gdlr-core-ilightbox');
}else{
var ilightbox=filter_elem.filter('.gdlr-core-ilightbox');
}
var ilightbox_atts={};
var ilightbox_groups=[];
if(typeof(gdlr_core_pbf.ilightbox_skin)!='undefined'){
ilightbox_atts['skin']=gdlr_core_pbf.ilightbox_skin;
}
ilightbox.each(function(){
if($(this).attr('data-ilightbox-group')){
if(ilightbox_groups.indexOf($(this).attr('data-ilightbox-group'))==-1){
ilightbox_groups.push($(this).attr('data-ilightbox-group'));
}}else{
$(this).iLightBox(ilightbox_atts);
}});
for(var key in ilightbox_groups){
$(this).find('.gdlr-core-ilightbox[data-ilightbox-group="' + ilightbox_groups[key] + '"]').iLightBox(ilightbox_atts);
}}else if(typeof($.fn.lightGallery)=='function'){
if(typeof(filter_elem)=='undefined'){
var lightgallery=$(this).find('.gdlr-core-lightgallery');
}else{
var lightgallery=filter_elem.filter('.gdlr-core-lightgallery');
}
var lightbox_groups=[];
lightgallery.each(function(){
if($(this).attr('data-lightbox-group')){
if(lightbox_groups.indexOf($(this).attr('data-lightbox-group'))==-1){
lightbox_groups.push($(this).attr('data-lightbox-group'));
}}else{
$(this).lightGallery({ selector: 'this' });
}});
for(var key in lightbox_groups){
var group_selector='.gdlr-core-lightgallery[data-lightbox-group="' + lightbox_groups[key] + '"]';
lightgallery.filter(group_selector).first().lightGallery({
selector: group_selector,
selectWithin: 'body',
thumbnail: false
});
}}else if(typeof(lightGallery)=='function'){
if(typeof(filter_elem)=='undefined'){
var lightgallery=$(this).find('.gdlr-core-lightgallery');
}else{
var lightgallery=filter_elem.filter('.gdlr-core-lightgallery');
}
var lightbox_groups=[];
lightgallery.each(function(){
if($(this).attr('data-lightbox-group')){
if(lightbox_groups.indexOf($(this).attr('data-lightbox-group'))==-1){
lightbox_groups.push($(this).attr('data-lightbox-group'));
}}else{
lightGallery($(this).get(0), {
selector: 'this',
plugins: [lgVideo, lgShare],
zoomFromOrigin: false,
mobileSettings: {
showCloseIcon: true
}});
}});
for(var key in lightbox_groups){
var group_selector='.gdlr-core-lightgallery[data-lightbox-group="' + lightbox_groups[key] + '"]';
lightGallery(document.body, {
selector: group_selector,
plugins: [lgVideo, lgShare],
zoomFromOrigin: false,
mobileSettings: {
showCloseIcon: true
}});
}}
if(typeof(filter_elem)=='undefined'){
var gallery_lb=$(this).find('[data-gallery-lb]');
}else{
var gallery_lb=filter_elem.filter('[data-gallery-lb]');
}
gallery_lb.click(function(){
if(typeof($.iLightBox)!='undefined'){
$.iLightBox($(this).data('gallery-lb'));
}else if(typeof(Strip)!='undefined'){
Strip.show($(this).data('gallery-lb'));
}else if(typeof($.fn.lightGallery)=='function'){
$(this).lightGallery({
dynamic: true,
dynamicEl: $(this).data('gallery-lb'),
thumbnail: false,
mobileSettings: {
showCloseIcon: true
}});
}else if(typeof(lightGallery)=='function'){
lightGallery($(this), {
dynamic: true,
dynamicEl: $(this).data('gallery-lb'),
thumbnail: false,
mobileSettings: {
showCloseIcon: true
}}).openGallery();
}
return false;
});
if(typeof(filter_elem)=='undefined'){
var center_overlay=$(this).find('.gdlr-core-image-overlay-center, .gdlr-core-image-overlay-center-icon');
}else{
var center_overlay=filter_elem.filter('.gdlr-core-image-overlay-center, .gdlr-core-image-overlay-center-icon');
}
center_overlay.each(function(){
if($(this).hasClass('gdlr-core-image-overlay-center')){
var overlay_content=$(this).children('.gdlr-core-image-overlay-content');
var wrap_height=$(this).outerHeight() - (2 * parseInt(overlay_content.css('bottom')));
var overlay_icon=overlay_content.children('.gdlr-core-portfolio-icon-wrap');
var icon_margin=(wrap_height - (overlay_content.outerHeight() - parseInt(overlay_icon.css('margin-bottom')))) / 2;
if(icon_margin > 20){
overlay_icon.css('margin-bottom', icon_margin);
}}else{
var content_offset=0;
if($(this).children('.gdlr-core-image-overlay-content-offset').length){
content_offset=$(this).children('.gdlr-core-image-overlay-content-offset').outerHeight(true);
}
$(this).children('.gdlr-core-image-overlay-content').each(function(){
$(this).css({ 'margin-top': -(($(this).outerHeight() + content_offset) / 2) });
});
}});
$(window).on('resize gdlr-core-element-resize', function(){
center_overlay.each(function(){
if($(this).hasClass('gdlr-core-image-overlay-center')){
var overlay_content=$(this).children('.gdlr-core-image-overlay-content');
var wrap_height=$(this).outerHeight() - (2 * parseInt(overlay_content.css('bottom')));
var overlay_icon=overlay_content.children('.gdlr-core-portfolio-icon-wrap');
var icon_margin=(wrap_height - (overlay_content.outerHeight() - parseInt(overlay_icon.css('margin-bottom')))) / 2;
if(icon_margin > 20){
overlay_icon.css('margin-bottom', icon_margin);
}}else{
var content_offset=0;
if($(this).children('.gdlr-core-image-overlay-content-offset').length){
content_offset=$(this).children('.gdlr-core-image-overlay-content-offset').outerHeight(true);
}
$(this).children('.gdlr-core-image-overlay-content').each(function(){
$(this).css({ 'margin-top': -(($(this).outerHeight() + content_offset) / 2) });
});
}});
});
return $(this);
}
$.fn.gdlr_core_set_image_height=function(){
var all_image=$(this).find('img');
all_image.each(function(){
var img_width=$(this).attr('width');
var img_height=$(this).attr('height');
if(img_width&&img_height){
var parent_item=$(this).parent('.gdlr-core-temp-image-wrap');
if(parent_item.length){
parent_item.height((img_height * $(this).parent().width()) / img_width);
}else{
parent_item=$('<div class="gdlr-core-temp-image-wrap" ></div>');
parent_item.css('height', ((img_height * $(this).closest('span, div').width()) / img_width));
$(this).wrap(parent_item);
}}else{
return;
}});
$(window).on('resize gdlr-core-element-resize', function(e){
all_image.each(function(){
var parent_item=$(this).parent('.gdlr-core-temp-image-wrap');
if(parent_item.length){
$(this).unwrap();
}});
$(window).unbind('resize', e.handleObj.handler, e);
});
return $(this);
}
window.gdlr_core_set_full_height=function(container, filter_elem){
if(typeof(filter_elem)=='undefined'){
this.elements=container.find('.gdlr-core-wrapper-full-height, .gdlr-core-column-full-height');
}else{
this.elements=filter_elem.filter('.gdlr-core-wrapper-full-height, .gdlr-core-column-full-height');
}
if(this.elements.length){
this.init();
}}
gdlr_core_set_full_height.prototype={
init: function(){
var t=this;
t.resize();
$(window).on('load resize gdlr-core-element-resize', function(){ t.resize(); });
},
resize: function(){
this.elements.each(function(){
var offset=$(this).attr('data-decrease-height')? parseInt($(this).attr('data-decrease-height')): 0;
$(this).css('min-height', $(window).height() - offset);
if($(this).hasClass('gdlr-core-full-height-center')){
$(this).children('.gdlr-core-full-height-pre-spaces').remove();
var pre_space=($(this).height() - $(this).children('.gdlr-core-full-height-content').outerHeight(true)) / 2;
if(pre_space > 0){
$(this).prepend($('<div class="gdlr-core-full-height-pre-spaces" ></div>').height(pre_space));
}}
});
}};
window.gdlr_core_sync_height=function(container, filter_elem){
this.set_half_height(container);
if(typeof(window.gdlr_core_sync_height_elem)!='undefined'){
window.gdlr_core_sync_height_elem.reinit();
return;
}
window.gdlr_core_sync_height_elem=this;
if(typeof(filter_elem)=='undefined'){
this.elements=container.find('[data-sync-height]');
}else{
this.elements=filter_elem.filter('[data-sync-height]');
}
this.elements_group=[];
this.container=container;
this.init();
}
gdlr_core_sync_height.prototype={
init: function(){
var t=this;
t.group_elements();
t.set_height();
$(window).on('load resize gdlr-core-element-resize', function(){ t.set_height(); });
},
reinit: function(){
if(!this.container.is('body, .gdlr-core-page-builder-body')){
this.container=this.container.closest('.gdlr-core-page-builder-body');
}
this.elements=this.container.find('[data-sync-height]');
this.group_elements();
this.set_height();
},
group_elements: function(){
var t=this;
t.elements.filter('.gdlr-core-flipbox-front, .gdlr-core-feature-box').each(function(){
if(t.elements_group.indexOf($(this).attr('data-sync-height'))==-1){
t.elements_group.push($(this).attr('data-sync-height'));
}});
t.elements.each(function(){
if(t.elements_group.indexOf($(this).attr('data-sync-height'))==-1){
t.elements_group.push($(this).attr('data-sync-height'));
}});
},
set_height: function(){
var t=this;
t.elements.css('height', 'auto').children('.gdlr-core-sync-height-pre-spaces').remove();
t.elements.find('.gdlr-core-sync-height-offset').remove();
var sync_element=t.elements;
if(gdlr_core_display=='mobile-landscape'||gdlr_core_display=='mobile-portrait'){
sync_element=sync_element.filter('.gdlr-core-flipbox-front, .gdlr-core-flipbox-back, .gdlr-core-hover-content-front, .gdlr-core-hover-content-back');
}
for(var key in t.elements_group){
var max_height=0;
sync_element.filter('[data-sync-height="' + t.elements_group[key] + '"]').each(function(){
if($(this).outerHeight() > max_height){
max_height=$(this).outerHeight();
}});
sync_element.filter('[data-sync-height="' + t.elements_group[key] + '"]').each(function(){
var offset=parseInt(max_height - $(this).outerHeight());
var offset_item=$(this).find('[data-sync-height-offset]');
if(offset_item.length&&offset > 0){
$('<div class="gdlr-core-sync-height-offset" ></div>').css('height', offset).insertBefore(offset_item);
}
$(this).css('height', max_height);
if($(this).hasClass('gdlr-core-flipbox-front')){
$(this).parent().css('height', max_height);
}
if($(this).is('[data-sync-height-center]')){
var content=$(this).children('.gdlr-core-sync-height-content');
var padding_top=max_height;
if(content.length > 0){
padding_top -=content.outerHeight();
}else{
$(this).children().each(function(){
padding_top -=$(this).outerHeight();
});
}
padding_top=padding_top / 2;
padding_top=padding_top - (parseInt($(this).css('padding-top')) + parseInt($(this).css('border-top-width')));
if(padding_top > 0){
var spaces_item=$('<div class="gdlr-core-sync-height-pre-spaces" ></div>').css('padding-top', padding_top);
var space_position=$(this).children('.gdlr-core-sync-height-space-position');
if(space_position.length > 0){
spaces_item.insertBefore(space_position);
}else{
$(this).prepend(spaces_item);
}}
}});
}},
set_half_height: function(container){
container.find('.gdlr-core-half-height').each(function(){
var temp=$(this);
if(!gdlr_core_mobile&&(gdlr_core_display=='tablet'||gdlr_core_display=='desktop')){
var temp_height=temp.outerHeight();
temp.gdlr_core_set_image_height();
temp.css('height', temp_height / 2);
temp.find('img').css('margin-top', -temp_height/4);
}
$(window).on('load resize', function(){
temp.css('height', 'auto');
temp.find('img').css('margin-top', '0');
if(!gdlr_core_mobile&&(gdlr_core_display=='tablet'||gdlr_core_display=='desktop')){
temp_height=temp.outerHeight();
temp.gdlr_core_set_image_height();
temp.css('height', temp_height / 2);
temp.find('img').css('margin-top', -temp_height/4);
}});
});
}};
function gdlr_core_ajax_action(ajax_section, name, value){
var now_loading=$('<div class="gdlr-core-now-loading" ></div>').hide();
$.ajax({
type: 'POST',
url: gdlr_core_pbf.ajax_url,
data: {
'action': ajax_section.attr('data-ajax'),
'settings': ajax_section.data('settings'),
'option': { 'name':name, 'value':value }},
dataType: 'json',
beforeSend: function(jqXHR, settings){
if(ajax_section.attr('data-target-action')=='replace'){
ajax_section.siblings('.' + ajax_section.attr('data-target')).animate({opacity: 0}, 150);
}
if((ajax_section.attr('data-target')=='gdlr-core-portfolio-item-holder' ||
ajax_section.attr('data-target')=='gdlr-core-blog-item-holder' ||
ajax_section.attr('data-target')=='gdlr-core-product-item-holder' ||
ajax_section.attr('data-target')=='gdlr-core-product-item-table-holder' ||
ajax_section.attr('data-target')=='gdlr-core-personnel-item-holder') &&
ajax_section.attr('data-target-action')=='replace'){
now_loading.insertBefore(ajax_section.siblings('.gdlr-core-portfolio-item-holder, .gdlr-core-personnel-item-holder, .gdlr-core-blog-item-holder, .gdlr-core-product-item-holder, .gdlr-core-product-item-table-holder'));
now_loading.fadeIn(200);
}},
error: function(jqXHR, textStatus, errorThrown){
ajax_section.removeClass('gdlr-core-disable');
console.log(jqXHR, textStatus, errorThrown);
},
success: function(data){
if(data.status=='success'){
if(data.content&&ajax_section.attr('data-target')){
if(ajax_section.attr('data-target-action')=='append'){
var content=$(data.content);
ajax_section.siblings('.' + ajax_section.attr('data-target')).each(function(){
if($(this).attr('data-layout')!='masonry'||typeof($.fn.isotope)!='function'){
content.addClass('gdlr-core-animate-init');
}
$(this).append(content);
content.gdlr_core_lightbox().gdlr_core_flexslider().gdlr_core_content_script().gdlr_core_set_image_height();
new gdlr_core_sync_height(content);
if($(this).attr('data-layout')=='masonry'&&typeof($.fn.isotope)=='function'){
var addItems=$(this).isotope('addItems', content);
$(this).isotope('layoutItems', addItems, true);
}else if(content.is('.gdlr-core-flexslider')){
content.gdlr_core_flexslider(content);
}
content.gdlr_core_animate_list_item();
});
if(data.load_more){
if(data.load_more!='none'){
var load_more=$(data.load_more);
ajax_section.parent().append(load_more);
load_more.gdlr_core_ajax(load_more);
load_more.css('display', 'none').slideDown(100);
ajax_section.remove();
}else{
ajax_section.slideUp(100, function(){ $(this).remove(); });
}}
}else if(ajax_section.attr('data-target-action')=='replace'){
var content=$(data.content);
ajax_section.siblings('.' + ajax_section.attr('data-target')).each(function(){
if(ajax_section.is('.gdlr-core-pagination')){
var scroll_position=$(this).offset().top - 120;
if($(window).scrollTop() > scroll_position){
$('html, body').animate({ scrollTop: scroll_position }, { duration: 1500, easing: 'easeOutQuart', queue: false });
}}
var fix_height=false;
var current_height=$(this).height();
if($(this).attr('data-layout')!='masonry'||typeof($.fn.isotope)!='function'){
content.addClass('gdlr-core-animate-init');
}
$(this).empty().append(content);
content.gdlr_core_lightbox().gdlr_core_flexslider().gdlr_core_fluid_video().gdlr_core_set_image_height();
new gdlr_core_sync_height(content);
var height_delay=0;
if($(this).attr('data-layout')=='masonry'&&typeof($.fn.isotope)=='function'){
$(this).isotope('destroy');
$(this).parent().gdlr_core_isotope();
fix_height=true;
}else if(content.is('.gdlr-core-flexslider')){
content.gdlr_core_flexslider(content);
height_delay=300;
}else{
content.gdlr_core_animate_list_item();
}
if(height_delay==0){
var new_height=$(this).height();
$(this).css({height:current_height}).animate({'height':new_height, opacity:1}, {'duration':400, 'easing':'easeOutExpo', 'complete': function(){
if(!fix_height){ $(this).css('height',''); }}});
}else{
var current_item=$(this);
current_item.css('height', current_height);
setTimeout(function(){
current_item.css('height', '');
var new_height=current_item.height();
current_item.css({height:current_height}).animate({'height':new_height, opacity:1}, {'duration':400, 'easing':'easeOutExpo', 'complete': function(){
if(!fix_height){ current_item.css('height',''); }}});
}, height_delay);
}});
if(data.pagination){
ajax_section.siblings('.gdlr-core-pagination').slideUp(100, function(){ $(this).remove(); });
if(data.pagination!='none'){
var pagination=$(data.pagination);
ajax_section.parent().append(pagination);
pagination.gdlr_core_ajax(pagination);
pagination.css('display', 'none').slideDown(100);
}}
if(data.load_more){
ajax_section.siblings('.gdlr-core-load-more-wrap').slideUp(100, function(){ $(this).remove(); });
if(data.load_more!='none'){
var load_more=$(data.load_more);
ajax_section.parent().append(load_more);
load_more.gdlr_core_ajax(load_more);
load_more.css('display', 'none').slideDown(100);
}}
}}
if(typeof(data.settings)!='undefined'){
ajax_section.data('settings', data.settings);
}
now_loading.fadeOut(200, function(){
$(this).remove();
ajax_section.removeClass('gdlr-core-disable');
});
}else{
ajax_section.removeClass('gdlr-core-disable');
}}
});
}
$.fn.gdlr_core_ajax=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('[data-ajax]');
}else{
var elem=filter_elem.filter('[data-ajax]');
}
elem.each(function(){
var ajax_section=$(this);
$(this).on('click', 'a, .gdlr-core-ajax-link', function(){
if($(this).hasClass('gdlr-core-active')||ajax_section.hasClass('gdlr-core-disable')){
return false;
}
ajax_section.addClass('gdlr-core-disable');
$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
var name=$(this).attr('data-ajax-name');
var value=$(this).attr('data-ajax-value');
gdlr_core_ajax_action(ajax_section, name, value);
var text=$(this).html();
$(this).closest('.gdlr-core-filterer-dropdown').each(function(){
$(this).siblings('.gdlr-core-filterer-dropdown-text').html(text);
});
if($(this).is('a')){
return false;
}});
$(this).on('change', 'select', function(){
var name=$(this).attr('data-ajax-name');
var value=$(this).val();
gdlr_core_ajax_action(ajax_section, name, value);
});
});
}
$.fn.gdlr_core_ajax_slide_bar=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('[data-ajax]');
}else{
var elem=filter_elem.filter('[data-ajax]');
}
elem.each(function(){
var ajax_section=$(this);
$(this).children('.gdlr-core-filterer-slide-bar').each(function(){
var slide_bar=$(this);
var active_slide=slide_bar.siblings('.gdlr-core-active');
slide_bar.css({'width': active_slide.outerWidth(), 'left': active_slide.position().left + parseInt(active_slide.css('margin-left')) });
$(window).on('load resize', function(){
active_slide=slide_bar.siblings('.gdlr-core-active');
slide_bar.css({'width': active_slide.outerWidth(), 'left': active_slide.position().left + parseInt(active_slide.css('margin-left')) });
});
ajax_section.find('a').hover(function(){
slide_bar.animate({'width': $(this).outerWidth(), 'left': $(this).position().left + parseInt($(this).css('margin-left')) }, {queue: false, duration: 200});
}, function(){
active_slide=slide_bar.siblings('.gdlr-core-active');
slide_bar.animate({'width': active_slide.outerWidth(), 'left': active_slide.position().left + parseInt(active_slide.css('margin-left')) }, {queue: false, duration: 200});
});
});
});
}
$.fn.gdlr_core_dropdown_tab=function(filter_elem){
if(typeof(filter_elem)=='undefined'){
var elem=$(this).find('.gdlr-core-dropdown-tab');
}else{
var elem=filter_elem.filter('.gdlr-core-dropdown-tab');
}
elem.each(function(){
var tab_title=$(this).children('.gdlr-core-dropdown-tab-title');
var tab_title_text=tab_title.children('.gdlr-core-head');
var tab_dropdown=tab_title.children('.gdlr-core-dropdown-tab-head-wrap');
var tab_content=$(this).children('.gdlr-core-dropdown-tab-content-wrap');
tab_title.click(function(){
if($(this).hasClass('gdlr-core-active')){
$(this).removeClass('gdlr-core-active');
tab_dropdown.hide();
}else{
$(this).addClass('gdlr-core-active');
tab_dropdown.slideDown(200);
}});
tab_dropdown.children().click(function(){
tab_title_text.html($(this).html());
$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
var content_active=tab_content.children('[data-index="' + $(this).attr('data-index') + '"]');
content_active.fadeIn(200).addClass('gdlr-core-active');
content_active.siblings().hide().removeClass('gdlr-core-active');
});
});
}
if(!gdlr_core_pbf.admin){
$(document).ready(function(){
var wpcf7_select=$('.wpcf7-form select');
if(wpcf7_select.length){
$('<div class="wpcf7-form-indicator" ><i class="fa fa-angle-down" ></i></div>').insertAfter(wpcf7_select);
}
$('body').each(function(){
if($(this).hasClass('gdlr-core-link-to-lightbox')){
var image_link=$(this).find('a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"], a[href$=".gif"]')
.not('.gdlr-core-ilightbox, .strip, [data-rel], .gdlr-core-lightgallery, .gdlr-core-social-share-pinterest')
.addClass('strip gdlr-core-ilightbox gdlr-core-lightgallery').each(function(){
if($(this).closest('.gallery').length){
var gallery_wrap=$(this).closest('.gallery');
if(gallery_wrap.attr('data-gallery-id')){
var gallery_id=gallery_wrap.attr('data-gallery-id');
}else{
var gallery_id=Math.floor((Math.random() * 10000) + 1);
gallery_wrap.attr('data-gallery-id', gallery_id);
}
$(this).attr('data-ilightbox-group', 'wp-gallery-' + gallery_id);
$(this).attr('data-lightbox-group', 'wp-gallery-' + gallery_id);
$(this).attr('data-strip-group', 'wp-gallery-' + gallery_id);
}});
$(this).gdlr_core_lightbox(image_link);
}
var gdlr_core_js=$(this).find('.gdlr-core-js, iframe[src*="youtube"], iframe[src*="vimeo"]');
$(this).gdlr_core_content_script(gdlr_core_js, true);
$(this).gdlr_core_hover_box(gdlr_core_js);
$(this).gdlr_core_counter_item(gdlr_core_js);
$(this).gdlr_core_typed_animation(gdlr_core_js);
$(this).gdlr_core_countdown_item(gdlr_core_js);
$(this).gdlr_core_alert_box_item(gdlr_core_js);
$(this).gdlr_core_accordion(gdlr_core_js);
$(this).gdlr_core_toggle_box(gdlr_core_js);
$(this).gdlr_core_divider(gdlr_core_js);
$(this).gdlr_core_flipbox(gdlr_core_js);
$(this).gdlr_core_marquee(gdlr_core_js);
$(this).gdlr_core_chart_js(gdlr_core_js);
$(this).gdlr_core_skill_circle(gdlr_core_js);
$(this).gdlr_core_skill_bar(gdlr_core_js);
$(this).gdlr_core_tab(gdlr_core_js);
$(this).gdlr_core_price_table_tab(gdlr_core_js);
$(this).gdlr_core_dropdown_tab(gdlr_core_js);
$(this).gdlr_core_lightbox(gdlr_core_js);
$(this).gdlr_core_ajax(gdlr_core_js);
$(this).gdlr_core_ajax_slide_bar(gdlr_core_js);
new gdlr_core_sync_height($(this), gdlr_core_js);
new gdlr_core_set_full_height($(this), gdlr_core_js);
new gdlr_core_sidebar_wrapper($(this), gdlr_core_js);
new gdlr_core_ux($(this), gdlr_core_js);
$('.gdlr-core-feature-content-wrap').each(function(){
var fcontent=$(this);
var pcontent=$(this).closest('.gdlr-core-feature-content');
pcontent.on('mouseenter', function(){
fcontent.slideDown({
duration: 350,
queue: false,
easing: 'easeOutCubic'
});
}).on('mouseleave', function(){
fcontent.slideUp({
duration: 350,
queue: false,
easing: 'easeOutCubic'
});
});
});
$(this).gdlr_core_parallax_background(gdlr_core_js);
$(this).gdlr_core_particle_background(gdlr_core_js);
$('.gdlr-core-price-plan-item').each(function(){
var plan_options=$(this).children('.gdlr-core-price-plan-options');
var plan_forms=$(this).children('.gdlr-core-price-plan-forms');
plan_options.find('.gdlr-core-active .gdlr-core-price-plan-content').css('display', 'block');
plan_options.on('click', '.gdlr-core-price-plan', function(){
var price_plan=$(this);
price_plan.find('.gdlr-core-price-plan-content').slideDown(150);
price_plan.addClass('gdlr-core-active');
price_plan.siblings('.gdlr-core-active').find('.gdlr-core-price-plan-content').slideUp(150);
price_plan.siblings('.gdlr-core-active').removeClass('gdlr-core-active');
});
$('.gdlr-core-price-plan-item').on('click', '.gdlr-core-step2', function(){
var selected_plan=parseInt($(this).siblings('.gdlr-core-price-plan.gdlr-core-active').attr('data-tab-id')) - 1;
plan_forms.children().css('display', 'none');
plan_forms.children().eq(selected_plan).css('display', 'block');
plan_options.hide();
plan_forms.fadeIn();
});
$('.gdlr-core-price-plan-forms').on('click', '.gdlr-core-step1', function(){
plan_options.fadeIn();
plan_forms.hide();
});
});
gdlr_core_js.filter('.gdlr-core-custom-dropdown').each(function(){
var custom_dropdown=$(this);
var dropdown_current=custom_dropdown.find('.gdlr-core-custom-dropdown-current');
$(this).on('click', '.gdlr-core-custom-dropdown-current', function(){
dropdown_current.siblings('.gdlr-core-custom-dropdown-list').slideDown(150);
});
$(document).click(function(e){
if(!$(e.target).is('.gdlr-core-custom-dropdown-current')){
dropdown_current.siblings('.gdlr-core-custom-dropdown-list').slideUp(150, function(){
if($(e.target).is('.gdlr-core-custom-dropdown-list-item')){
$(e.target).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active')
}});
if($(e.target).is('.gdlr-core-custom-dropdown-list-item')){
dropdown_current.html($(e.target).html());
}}
});
});
gdlr_core_js.filter('.gdlr-core-privacy-box-button').on('click', function(){
var privacy_box_wrap=$(this).closest('.gdlr-core-privacy-box-wrap');
if(privacy_box_wrap.is('.gdlr-core-pos-bottom-bar, .gdlr-core-pos-top-bar')){
privacy_box_wrap.slideUp(200);
}else{
privacy_box_wrap.fadeOut(250);
}
var cookie_time=$(this).attr('data-cookie-time')? $(this).attr('data-cookie-time'): 2592000;
gdlr_core_set_cookie('gdlr-core-privacy-box', 1, cookie_time);
window.location.reload();
return false;
});
gdlr_core_js.filter('[data-gdlr-lb]').each(function(){
var lb_wrap=$('#' + $(this).data('gdlr-lb'));
if(lb_wrap.length){
$(this).on('click', function(){
lb_wrap.fadeIn(200);
return false;
});
lb_wrap.find('.gdlr-core-lightbox-form-close').on('click', function(){
$(this).closest('.gdlr-core-lightbox-wrapper').fadeOut();
return false;
});
}});
gdlr_core_js.filter('#gdlr-core-gdpr-form').each(function(){
$(this).on('click', '.gdlr-core-gdlr-form-nav li', function(){
$(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active');
var nav_id=$(this).data('gdlr-nav');
var content_wrap=$(this).closest('.gdlr-core-gdpr-form-left').siblings('.gdlr-core-gdpr-form-right');
content_wrap.find('[data-gdlr-nav="' + nav_id + '"]').each(function(){
$(this).siblings('[data-gdlr-nav]').removeClass('gdlr-core-active').css('display', 'none');
$(this).fadeIn(200, function(){ $(this).addClass('gdlr-core-active'); });
});
});
});
new gdlr_core_sticky_sidebar(gdlr_core_js);
});
});
$(window).on('load', function(){
$('body').each(function(){
var gdlr_core_js=$(this).find('.gdlr-core-js-2');
$(this).gdlr_core_title_divider(gdlr_core_js);
$(this).gdlr_core_flexslider(gdlr_core_js);
$(this).gdlr_core_sly(gdlr_core_js);
$(this).gdlr_core_sliding_gallery(gdlr_core_js);
$(this).gdlr_core_isotope(gdlr_core_js);
});
});
}})(jQuery);