(function($) { "use strict"; $(document).ready(function() { //global variables that are used on several ocassions $.avia_utilities = $.avia_utilities || {}; if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement) { $.avia_utilities.isMobile = true; } else { $.avia_utilities.isMobile = false; } //activate fixed bg fallback for mobile if($.fn.avia_mobile_fixed) $('.avia-bg-style-fixed').avia_mobile_fixed(); //activate parallax scrolling for backgrounds. if($.fn.avia_parallax) $('.av-parallax').avia_parallax(); //calculate the browser height and append a css rule to the head if($.fn.avia_browser_height) $('.av-minimum-height, .avia-fullscreen-slider, .av-cell-min-height').avia_browser_height(); //calculate the height of each video section if($.fn.avia_video_section) $('.av-section-with-video-bg').avia_video_section(); //creates team social icon tooltip new $.AviaTooltip({'class': "avia-tooltip", data: "avia-tooltip", delay:0, scope: "body"}); //creates icon element tooltip new $.AviaTooltip({'class': "avia-tooltip avia-icon-tooltip", data: "avia-icon-tooltip", delay:0, scope: "body"}); $.avia_utilities.activate_shortcode_scripts(); //layer slider height helper if($.fn.layer_slider_height_helper) $('.avia-layerslider').layer_slider_height_helper(); //"ajax" portfolio if($.fn.avia_portfolio_preview) { $('.grid-links-ajax').avia_portfolio_preview(); } // actiavte the masonry script: sorting/loading/etc if($.fn.avia_masonry) $('.av-masonry').avia_masonry(); //activate the accordion if($.fn.aviaccordion) $('.aviaccordion').aviaccordion(); //activate the accordion if($.fn.avia_textrotator) $('.av-rotator-container').avia_textrotator(); //activates the tab section shortcode if($.fn.avia_sc_tab_section) { $('.av-tab-section-container').avia_sc_tab_section(); } //activates the hor gallery shortcode if($.fn.avia_hor_gallery) { $('.av-horizontal-gallery').avia_hor_gallery(); } // activate columns and cells with a link if($.fn.avia_link_column) { $('.avia-link-column').avia_link_column(); } if($.fn.avia_delayed_animation_in_container) { $('.av-animation-delay-container').avia_delayed_animation_in_container(); } }); // ------------------------------------------------------------------------------------------- // ACTIVATE ALL SHORTCODES // ------------------------------------------------------------------------------------------- $.avia_utilities = $.avia_utilities || {}; $.avia_utilities.activate_shortcode_scripts = function(container) { if(typeof container == 'undefined'){ container = 'body';} //activates the form shortcode if($.fn.avia_ajax_form) { $('.avia_ajax_form:not( .avia-disable-default-ajax )', container).avia_ajax_form(); } activate_waypoints(container); //activate the video api if($.fn.aviaVideoApi) { $('.avia-slideshow iframe[src*="youtube.com"], .av_youtube_frame, .av_vimeo_frame, .avia-slideshow video').aviaVideoApi({}, 'li'); } //activates the toggle shortcode if($.fn.avia_sc_toggle) { $('.togglecontainer', container).avia_sc_toggle(); } //activates the tabs shortcode if($.fn.avia_sc_tabs) { $('.top_tab', container).avia_sc_tabs(); $('.sidebar_tab', container).avia_sc_tabs({sidebar:true}); } //activates behavior and animation for gallery if($.fn.avia_sc_gallery) { $('.avia-gallery', container).avia_sc_gallery(); } //activates animated number shortcode if($.fn.avia_sc_animated_number) { $('.avia-animated-number', container).avia_sc_animated_number(); } //animation for elements that are not connected like icon shortcode if($.fn.avia_sc_animation_delayed) { $('.av_font_icon', container).avia_sc_animation_delayed({delay:100}); $('.avia-image-container', container).avia_sc_animation_delayed({delay:100}); $('.av-hotspot-image-container', container).avia_sc_animation_delayed({delay:100}); $('.av-animated-generic', container).avia_sc_animation_delayed({delay:100}); } //activates animation for iconlist if($.fn.avia_sc_iconlist) { $('.avia-icon-list.av-iconlist-big.avia-iconlist-animate', container).avia_sc_iconlist(); } //activates animation for progress bar if($.fn.avia_sc_progressbar) { $('.avia-progress-bar-container', container).avia_sc_progressbar(); } //activates animation for testimonial if($.fn.avia_sc_testimonial) { $('.avia-testimonial-wrapper', container).avia_sc_testimonial(); } //activate the fullscreen slider if($.fn.aviaFullscreenSlider) { $('.avia-slideshow.av_fullscreen', container).aviaFullscreenSlider(); } //activate the aviaslider if($.fn.aviaSlider) { $('.avia-slideshow:not(.av_fullscreen)', container).aviaSlider(); //content slider $('.avia-content-slider-active', container).aviaSlider({wrapElement: '.avia-content-slider-inner', slideElement:'.slide-entry-wrap', fullfade:true}); //testimonial slider $('.avia-slider-testimonials', container).aviaSlider({wrapElement: '.avia-testimonial-row', slideElement:'.avia-testimonial', fullfade:true}); } //load magazine sorting if($.fn.aviaMagazine) { $('.av-magazine-tabs-active', container).aviaMagazine(); } //load image hotspot if($.fn.aviaHotspots) { $('.av-hotspot-image-container', container).aviaHotspots(); } //load countdown if($.fn.aviaCountdown) { $('.av-countdown-timer', container).aviaCountdown(); } //load audio player if($.fn.aviaPlayer) { $('.av-player', container).aviaPlayer(); } }; function activate_waypoints(container) { //activates simple css animations of the content once the user scrolls to an elements if($.fn.avia_waypoints) { if(typeof container == 'undefined'){ container = 'body';}; $('.avia_animate_when_visible', container).avia_waypoints(); $('.avia_animate_when_almost_visible', container).avia_waypoints({ offset: '80%'}); if(container == 'body') container = '.avia_desktop body'; $('.av-animated-generic', container).avia_waypoints({ offset: '95%'}); } } // ------------------------------------------------------------------------------------------- $.AviaParallaxElement = function(options, element) { this.$el = $( element ).addClass('active-parallax'); this.$win = $( window ); this.$body = $( 'body' ); this.$parent = this.$el.parent(); this.property = {}; this.isMobile = $.avia_utilities.isMobile; this.ratio = this.$el.data('avia-parallax-ratio') || 0.5; this.transform = document.documentElement.className.indexOf('avia_transform') !== -1 ? true : false; this.transform3d= document.documentElement.className.indexOf('avia_transform3d') !== -1 ? true : false; this.ticking = false; if($.avia_utilities.supported.transition === undefined) { $.avia_utilities.supported.transition = $.avia_utilities.supports('transition'); } this._init( options ); }; $.AviaParallaxElement.prototype = { _init: function( options ) { var _self = this; if(_self.isMobile) { return; //disable parallax scrolling on mobile } //fetch window constants setTimeout(function() { _self._fetch_properties(); },30); this.$win.on("debouncedresize av-height-change", $.proxy( _self._fetch_properties, _self)); this.$body.on("av_resize_finished", $.proxy( _self._fetch_properties, _self)); //activate the scrolling setTimeout(function() { _self.$win.on( 'scroll', $.proxy( _self._on_scroll, _self) ); },100); }, _fetch_properties: function() { this.property.offset = this.$parent.offset().top; this.property.wh = this.$win.height(); this.property.height = this.$parent.outerHeight(); //set the height of the element based on the windows height, offset ratio and parent height this.$el.height(Math.ceil((this.property.wh * this.ratio) + this.property.height)); //re-position the element this._parallax_scroll(); }, _on_scroll: function(e) { var _self = this; if(!_self.ticking) { _self.ticking = true; window.requestAnimationFrame( $.proxy( _self._parallax_scroll, _self) ); } }, _parallax_scroll: function(e) { var winTop = this.$win.scrollTop(), winBottom = winTop + this.property.wh, scrollPos = "0", prop = {}; //shift element when it moves into viewport if(this.property.offset < winBottom && winTop <= this.property.offset + this.property.height) { scrollPos = Math.ceil( (winBottom - this.property.offset) * this.ratio ); //parallax movement via backround position change, although if(this.transform3d) { prop[$.avia_utilities.supported.transition+"transform"] = "translate3d(0px,"+ scrollPos +"px, 0px)"; } else if(this.transform) { prop[$.avia_utilities.supported.transition+"transform"] = "translate(0px,"+ scrollPos +"px)"; } else { prop["background-position"] = "0px "+ scrollPos +"px"; } this.$el.css(prop); } this.ticking = false; } }; $.fn.avia_parallax = function(options) { return this.each(function() { var self = $.data( this, 'aviaParallax' ); if(!self) { self = $.data( this, 'aviaParallax', new $.AviaParallaxElement( options, this ) ); } }); }; // ------------------------------------------------------------------------------------------- // Helper to allow fixed bgs on mobile // ------------------------------------------------------------------------------------------- $.fn.avia_mobile_fixed = function(options) { var isMobile = $.avia_utilities.isMobile; if(!isMobile) return; return this.each(function() { var current = $(this).addClass('av-parallax-section'), $background = current.attr('style'), $attachment_class = current.data('section-bg-repeat'), template = ""; if($attachment_class == 'stretch' || $attachment_class == 'no-repeat' ) { $attachment_class = " avia-full-stretch"; } else { $attachment_class = ""; } template = "
"; current.prepend(template); current.attr('style',''); }); }; // ------------------------------------------------------------------------------------------- // shortcode javascript for delayed animation even when non connected elements are used // ------------------------------------------------------------------------------------------- $.fn.avia_sc_animation_delayed = function(options) { var global_timer = 0, delay = options.delay || 50, max_timer = 10, new_max = setTimeout(function(){ max_timer = 20; }, 500); return this.each(function() { var elements = $(this); //trigger displaying of thumbnails elements.on('avia_start_animation', function() { var element = $(this); if(global_timer < max_timer) global_timer ++; setTimeout(function() { element.addClass('avia_start_delayed_animation'); if(global_timer > 0) global_timer --; }, (global_timer * delay)); }); }); }; /*delayd animations when used within tab sections or similar elements. this way they get animated each new time a tab is shown*/ $.fn.avia_delayed_animation_in_container = function(options) { return this.each(function() { var elements = $(this); elements.on('avia_start_animation_if_current_slide_is_active', function() { var current = $(this), animate = current.find('.avia_start_animation_when_active'); animate.addClass('avia_start_animation').trigger('avia_start_animation'); }); elements.on('avia_remove_animation', function() { var current = $(this), animate = current.find('.avia_start_animation_when_active, .avia_start_animation'); animate.removeClass('avia_start_animation avia_start_delayed_animation'); }); }); }; // ------------------------------------------------------------------------------------------- // Section Height Helper // ------------------------------------------------------------------------------------------- $.fn.avia_browser_height = function() { if(!this.length) return; var win = $(window), html_el = $('html'), headFirst = $( 'head' ).first(), subtract = $('#wpadminbar, #header.av_header_top:not(.html_header_transparency #header), #main>.title_container'), css_block = $("").appendTo( headFirst ), sidebar_menu= $('.html_header_sidebar #top #header_main'), full_slider = $('.html_header_sidebar .avia-fullscreen-slider.avia-builder-el-0.avia-builder-el-no-sibling').addClass('av-solo-full'), pc_heights = [ 25, 50, 75 ], calc_height = function() { var css = "", wh100 = win.height(), ww100 = win.width(), wh100_mod = wh100, whCover = (wh100 / 9) * 16, wwCover = (ww100 / 16) * 9, solo = 0, whCustom = []; if(sidebar_menu.length) solo = sidebar_menu.height(); subtract.each(function(){ wh100_mod -= this.offsetHeight - 1; }); var whCoverMod = (wh100_mod / 9) * 16; //fade in of section content with minimum height once the height has been calculated css += ".avia-section.av-minimum-height .container{opacity: 1; }\n"; //various section heights (100-25% as well as 100% - header/adminbar in case its the first builder element) css += ".av-minimum-height-100 .container, .avia-fullscreen-slider .avia-slideshow, #top.avia-blank .av-minimum-height-100 .container, .av-cell-min-height-100 > .flex_cell{height:"+wh100+"px;}\n"; $.each( pc_heights, function( index, value ) { var wh = Math.round( wh100 * ( value / 100.0 ) ); css += ".av-minimum-height-" + value + " .container, .av-cell-min-height-" + value + " > .flex_cell {height:" + wh + "px;}\n"; }); css += ".avia-builder-el-0.av-minimum-height-100 .container, .avia-builder-el-0.avia-fullscreen-slider .avia-slideshow, .avia-builder-el-0.av-cell-min-height-100 > .flex_cell{height:"+wh100_mod+"px;}\n"; css += "#top .av-solo-full .avia-slideshow {min-height:"+solo+"px;}\n"; //fullscreen video calculations if(ww100/wh100 < 16/9) { css += "#top .av-element-cover iframe, #top .av-element-cover embed, #top .av-element-cover object, #top .av-element-cover video{width:"+whCover+"px; left: -"+(whCover - ww100)/2+"px;}\n"; } else { css += "#top .av-element-cover iframe, #top .av-element-cover embed, #top .av-element-cover object, #top .av-element-cover video{height:"+wwCover+"px; top: -"+(wwCover - wh100)/2+"px;}\n"; } if(ww100/wh100_mod < 16/9) { css += "#top .avia-builder-el-0 .av-element-cover iframe, #top .avia-builder-el-0 .av-element-cover embed, #top .avia-builder-el-0 .av-element-cover object, #top .avia-builder-el-0 .av-element-cover video{width:"+whCoverMod+"px; left: -"+(whCoverMod - ww100)/2+"px;}\n"; } else { css += "#top .avia-builder-el-0 .av-element-cover iframe, #top .avia-builder-el-0 .av-element-cover embed, #top .avia-builder-el-0 .av-element-cover object, #top .avia-builder-el-0 .av-element-cover video{height:"+wwCover+"px; top: -"+(wwCover - wh100_mod)/2+"px;}\n"; } //ie8 needs different insert method try{ css_block.text(css); } catch(err){ css_block.remove(); css_block = $("").appendTo( headFirst ); } setTimeout(function(){ win.trigger('av-height-change'); /*broadcast the height change*/ },100); }; this.each( function( index ) { var height = $(this).data('av_minimum_height_pc'); if( 'number' != typeof height ) { return this; } height = parseInt( height ); if( ( -1 == $.inArray( height, pc_heights ) ) && ( height != 100 ) ) { pc_heights.push( height ); } return this; }); win.on( 'debouncedresize', calc_height ); calc_height(); }; // ------------------------------------------------------------------------------------------- // Video Section helper // ------------------------------------------------------------------------------------------- $.fn.avia_video_section = function() { if(!this.length) return; var elements = this.length, content = "", win = $(window), headFirst = $( 'head' ).first(), css_block = $("").appendTo( headFirst ), calc_height = function(section, counter) { if(counter === 0) { content = "";} var css = "", the_id = '#' +section.attr('id'), wh100 = section.height(), ww100 = section.width(), aspect = section.data('sectionVideoRatio').split(':'), video_w = aspect[0], video_h = aspect[1], whCover = (wh100 / video_h ) * video_w, wwCover = (ww100 / video_w ) * video_h; //fullscreen video calculations if(ww100/wh100 < video_w/video_h) { css += "#top "+the_id+" .av-section-video-bg iframe, #top "+the_id+" .av-section-video-bg embed, #top "+the_id+" .av-section-video-bg object, #top "+the_id+" .av-section-video-bg video{width:"+whCover+"px; left: -"+(whCover - ww100)/2+"px;}\n"; } else { css += "#top "+the_id+" .av-section-video-bg iframe, #top "+the_id+" .av-section-video-bg embed, #top "+the_id+" .av-section-video-bg object, #top "+the_id+" .av-section-video-bg video{height:"+wwCover+"px; top: -"+(wwCover - wh100)/2+"px;}\n"; } content = content + css; if(elements == counter + 1) { //ie8 needs different insert method try{ css_block.text(content); } catch(err){ css_block.remove(); css_block = $("").appendTo( headFirst ); } } }; return this.each(function(i) { var self = $(this); win.on( 'debouncedresize', function(){ calc_height(self, i); }); calc_height(self, i); }); }; /** * Column or cell with a link * * @returns {jQuery} */ $.fn.avia_link_column = function() { return this.each( function() { $(this).on( 'click', function(e){ // if event is bubbled from an link, do not activate link of column/cell if( 'undefined' !== typeof e.target && 'undefined' !== typeof e.target.href ) { return; } var column = $(this), url = column.data('link-column-url'), target = column.data('link-column-target'), link = window.location.hostname+window.location.pathname; if( 'undefined' === typeof url || 'string' !== typeof url ) { return; } if( 'undefined' !== typeof target || '_blank' == target ) { // in FF and other browsers this opens a new window and not only a new tab // window.open( url, '_blank', 'noopener noreferrer' ); var a = document.createElement('a'); a.href = url; a.target = '_blank'; a.rel = 'noopener noreferrer'; a.click(); return false; } else { // allow smoothscroll feature when on same page and hash exists - trigger only works for current page if( column.hasClass('av-cell-link') || column.hasClass('av-column-link') ) { var reader = column.hasClass('av-cell-link') ? column.prev('a.av-screen-reader-only').first() : column.find('a.av-screen-reader-only').first(); url = url.trim(); if( (0 == url.indexOf("#")) || ((url.indexOf(link) >= 0) && (url.indexOf("#") > 0) ) ) { reader.trigger('click'); return; } } window.location.href = url; } e.preventDefault(); return; }); }); }; // ------------------------------------------------------------------------------------------- // HELPER FUNCTIONS // ------------------------------------------------------------------------------------------- //waipoint script when something comes into viewport $.fn.avia_waypoints = function(options_passed) { if(! $('html').is('.avia_transform')) return; var defaults = { offset: 'bottom-in-view' , triggerOnce: true}, options = $.extend({}, defaults, options_passed), isMobile = $.avia_utilities.isMobile; return this.each(function() { var element = $(this); setTimeout(function() { if(isMobile) { element.addClass('avia_start_animation').trigger('avia_start_animation'); } else { element.waypoint(function(direction) { var current = $(this.element), parent = current.parents('.av-animation-delay-container').eq( 0 ); if(parent.length) { current.addClass('avia_start_animation_when_active').trigger('avia_start_animation_when_active'); } if( !parent.length || (parent.length && parent.is('.__av_init_open')) || (parent.length && parent.is('.av-active-tab-content')) ) { current.addClass('avia_start_animation').trigger('avia_start_animation'); } }, options ); } },100); }); }; // window resize script var $event = $.event, $special, resizeTimeout; $special = $event.special.debouncedresize = { setup: function() { $( this ).on( "resize", $special.handler ); }, teardown: function() { $( this ).off( "resize", $special.handler ); }, handler: function( event, execAsap ) { // Save the context var context = this, args = arguments, dispatch = function() { // set correct event type event.type = "debouncedresize"; $event.dispatch.apply( context, args ); }; if ( resizeTimeout ) { clearTimeout( resizeTimeout ); } execAsap ? dispatch() : resizeTimeout = setTimeout( dispatch, $special.threshold ); }, threshold: 150 }; $.easing['jswing'] = $.easing['swing']; $.extend( $.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { return $.easing[$.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) {return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } }); })( jQuery ); /*utility functions*/ (function($) { "use strict"; $.avia_utilities = $.avia_utilities || {}; /************************************************************************ gloabl loading function *************************************************************************/ $.avia_utilities.loading = function(attach_to, delay){ var loader = { active: false, show: function() { if(loader.active === false) { loader.active = true; loader.loading_item.css({display:'block', opacity:0}); } loader.loading_item.stop().animate({opacity:1}); }, hide: function() { if(typeof delay === 'undefined'){ delay = 600; } loader.loading_item.stop().delay( delay ).animate({opacity:0}, function() { loader.loading_item.css({display:'none'}); loader.active = false; }); }, attach: function() { if(typeof attach_to === 'undefined'){ attach_to = 'body';} loader.loading_item = $('