(function(a){a.fn.avia_ajax_form=function(e){var i={sendPath:'send.php',responseContainer:'.ajaxresponse'};var r=a.extend(i,e);return this.each(function(){var i=a(this),t=!1,e={formElements:i.find('textarea, select, input[type=text], input[type=checkbox], input[type=hidden]'),validationError:!1,button:i.find('input:submit'),dataObj:{}},n=i.next(r.responseContainer+':eq(0)');e.button.on('click',s);if(a.avia_utilities.isMobile){e.formElements.each(function(e){var r=a(this),i=r.hasClass('is_email');if(i)r.attr('type','email')})};function s(r){e.validationError=!1;e.datastring='ajax=true';e.formElements.each(function(l){var o=a(this),r=o.parent(),t=o.val(),v=o.attr('name'),n=o.attr('class'),s=!0;if(o.is(':checkbox')){if(o.is(':checked')){t=!0}
else{t=''}};e.dataObj[v]=encodeURIComponent(t);if(n&&n.match(/is_empty/)){if(t==''||t==null){r.removeClass('valid error ajax_alert').addClass('error');e.validationError=!0}
else{r.removeClass('valid error ajax_alert').addClass('valid')};s=!1};if(n&&n.match(/is_email/)){if(!t.match(/^[\w|\.|\-]+@\w[\w|\.|\-]*\.[a-zA-Z]{2,20}$/)){r.removeClass('valid error ajax_alert').addClass('error');e.validationError=!0}
else{r.removeClass('valid error ajax_alert').addClass('valid')};s=!1};if(n&&n.match(/is_ext_email/)){if(!t.match(/^[\w|\.|\-|ÄÖÜäöü]+@\w[\w|\.|\-|ÄÖÜäöü]*\.[a-zA-Z]{2,20}$/)){r.removeClass('valid error ajax_alert').addClass('error');e.validationError=!0}
else{r.removeClass('valid error ajax_alert').addClass('valid')};s=!1};if(n&&n.match(/is_phone/)){if(!t.match(/^(\d|\s|\-|\/|\(|\)|\[|\]|e|x|t|ension|\.|\+|\_|\,|\:|\;){3,}$/)){r.removeClass('valid error ajax_alert').addClass('error');e.validationError=!0}
else{r.removeClass('valid error ajax_alert').addClass('valid')};s=!1};if(n&&n.match(/is_number/)){if(!(a.isNumeric(t))||t==''){r.removeClass('valid error ajax_alert').addClass('error');e.validationError=!0}
else{r.removeClass('valid error ajax_alert').addClass('valid')};s=!1};if(n&&n.match(/captcha/)){var d=i.find('#'+v+'_verifier').val(),f=d.charAt(d.length-1),c=d.charAt(f);if(t!=c){r.removeClass('valid error ajax_alert').addClass('error');e.validationError=!0}
else{r.removeClass('valid error ajax_alert').addClass('valid')};s=!1};if(s&&t!=''){r.removeClass('valid error ajax_alert').addClass('valid')}});if(e.validationError==!1){if(i.data('av-custom-send')){l()}
else{o()}};return!1};function o(){if(t){return!1};t=!0;e.button.addClass('av-sending-button');e.button.val(e.button.data('sending-label'));var s=i.data('avia-redirect')||!1,o=i.attr('action');n.load(o+' '+r.responseContainer,e.dataObj,function(){if(s&&o!=s){i.attr('action',s);location.href=s}
else{n.removeClass('hidden').css({display:'block'});i.slideUp(400,function(){n.slideDown(400,function(){a('body').trigger('av_resize_finished')});e.formElements.val('')})}})};function l(){if(t){return!1};t=!0;var v=e.button.val();e.button.addClass('av-sending-button');e.button.val(e.button.data('sending-label'));e.dataObj.ajax_mailchimp=!0;var s=i.data('avia-redirect')||!1,l=i.attr('action'),o=i.find('.av-form-error-container'),d=i.data('avia-form-id');a.ajax({url:l,type:'POST',data:e.dataObj,beforeSend:function(){if(o.length){o.slideUp(400,function(){o.remove();a('body').trigger('av_resize_finished')})}},success:function(o){var c=jQuery('<div>').append(jQuery.parseHTML(o)),f=c.find('.av-form-error-container');if(f.length){t=!1;i.prepend(f);f.css({display:'none'}).slideDown(400,function(){a('body').trigger('av_resize_finished')});e.button.removeClass('av-sending-button');e.button.val(v)}
else{if(s&&l!=s){i.attr('action',s);location.href=s}
else{var m=c.find(r.responseContainer+'_'+d);n.html(m).removeClass('hidden').css({display:'block'});i.slideUp(400,function(){n.slideDown(400,function(){a('body').trigger('av_resize_finished')});e.formElements.val('')})}}},error:function(){},complete:function(){}})}})}})(jQuery);(function(e){'use strict';var t=['weeks','days','hours','minutes','seconds'],o=1000,a=o*60,n=a*60,i=n*24,r=i*7,d=function(t){var s={},c=new Date(),d=t.end-c;if(d<=0){clearInterval(t.countdown);return};t.time.weeks=Math.floor(d/r);t.time.days=Math.floor((d%r)/i);t.time.hours=Math.floor((d%i)/n);t.time.minutes=Math.floor((d%n)/a);t.time.seconds=Math.floor((d%a)/o);switch(t.data.maximum){case 1:t.time.seconds=Math.floor(d/o);break;case 2:t.time.minutes=Math.floor(d/a);break;case 3:t.time.hours=Math.floor(d/n);break;case 4:t.time.days=Math.floor(d/i);break};for(var u in t.time){if(typeof t.update[u]=='object'){if(t.firstrun||t.oldtime[u]!=t.time[u]){var l=(t.time[u]===1)?'single':'multi';t.update[u].time_container.text(t.time[u]);t.update[u].label_container.text(t.update[u][l])}}};if(t.firstrun)t.container.addClass('av-countdown-active');t.oldtime=e.extend({},t.time);t.firstrun=!1};e.fn.aviaCountdown=function(a){if(!this.length)return;return this.each(function(){var a={};a.update={};a.time={};a.oldtime={};a.firstrun=!0;a.container=e(this);a.data=a.container.data();a.end=new Date(a.data.year,a.data.month,a.data.day,a.data.hour,a.data.minute);for(var n in t){a.update[t[n]]={time_container:a.container.find('.av-countdown-'+t[n]+' .av-countdown-time'),label_container:a.container.find('.av-countdown-'+t[n]+' .av-countdown-time-label')};if(a.update[t[n]].label_container.length){a.update[t[n]].single=a.update[t[n]].label_container.data('label');a.update[t[n]].multi=a.update[t[n]].label_container.data('label-multi')}};d(a);a.countdown=setInterval(function(){d(a)},1000)})}}(jQuery));(function(t){t.fn.avia_sc_animated_number=function(a){if(!this.length)return;if(this.is('.avia_sc_animated_number_active'))return;this.addClass('avia_sc_animated_number_active');var r=!1,n=(a&&a.simple_up)?!0:!1,e=(a&&a.start_timer)?a.start_timer:300,i=function(t,e,s,f,o){var a=f+s;if(a>=o){t.text(e)}
else{var r='',d=e.toString().length-a.toString().length;for(var u=d;u>0;u--){r+='0'};if(n)r=0;t.text(r+a);window.requestAnimationFrame(function(){i(t,e,s,a,o)})}};return this.each(function(){var n=t(this),r=n.find('.__av-single-number'),s=n.data('timer')||3000;r.each(function(a){var i=t(this),n=i.text();if(window.addEventListener)i.text(n.replace(/./g,'0'))});n.addClass('number_prepared').on('avia_start_animation',function(){if(n.is('.avia_animation_done'))return;n.addClass('avia_animation_done');r.each(function(r){var o=t(this),a=o.data('number'),u=a,f=parseInt(o.text(),10),d=/^0+$/.test(a),n=0;if(d&&a!==0)u=a.replace(/0/g,'9');n=Math.round(u*32/s);if(n==0||n%10==0)n+=1;setTimeout(function(){i(o,a,n,f,u)},e)})});if(a&&a.instant_start==!0){n.trigger('avia_start_animation')}})}})(jQuery);(function(i){'use strict';i.avia_utilities=i.avia_utilities||{};i.fn.avia_portfolio_preview=function(t){var n=i(window),a=i('body'),s=i.avia_utilities.isMobile,o={open_in:'.portfolio-details-inner',easing:'easeOutQuint',timing:800,transition:'slide'},e=i.extend({},o,t);return this.each(function(){var r=i(this),g=r.data('portfolio-id'),l=i('.portfolio_preview_container[data-portfolio-id="'+g+'"]'),c=l.find(e.open_in),p=r.find('.grid-entry'),t={},s=!1,d=!1,v=!1,f=!1,o,u,m=i.avia_utilities.loading();o={load_item:function(e){e.preventDefault();var n=i(this),t=n.parents('.post-entry:eq(0)'),a='ID_'+t.data('ajax-id'),l=p.index(t);if(a===s||d==!0){return!1};d=!0;r.find('.active_portfolio_item').removeClass('active_portfolio_item');t.addClass('active_portfolio_item');m.show();o.ajax_get_contents(a,l)},scroll_top:function(){setTimeout(function(){var t=l.offset().top-175,a=n.scrollTop();if(a>t||t-a>100){i('html:not(:animated),body:not(:animated)').animate({scrollTop:t},e.timing,e.easing)}},10)},attach_item:function(e){t[e]=i(t[e]).appendTo(c);f=!0},remove_video:function(){var i=l.find('iframe, .avia-video').parents('.ajax_slide:not(.open_slide)');if(i.length>0){i.remove();t['ID_'+i.data('slideId')]=undefined}},show_item:function(n,r){if(n===s){return!1};d=!0;m.hide();if(!1===s){l.addClass('open_container');t[n].addClass('open_slide');o.scroll_top();l.css({display:'none'}).slideDown(e.timing,e.easing,function(){if(f){i.avia_utilities.activate_shortcode_scripts(t[n]);i.avia_utilities.avia_ajax_call(t[n]);a.trigger('av_resize_finished');f=!1};o.remove_video();a.trigger('av_resize_finished')});v=r;s=n;d=!1}
else{o.scroll_top();var p={zIndex:3},u=e.easing;if(v>r){p.left='-110%'};if(e.transition==='fade'){p.left='0%';p.opacity=0;u='easeOutQuad'};c.height(c.height());t[n].css(p).avia_animate({'left':'0%',opacity:1},e.timing,u);t[s].avia_animate({opacity:0},e.timing,u,function(){t[s].attr({'style':''}).removeClass('open_slide');t[n].addClass('open_slide');c.avia_animate({height:t[n].outerHeight()+2},e.timing/2,e.easing,function(){c.attr({'style':''});s=n;v=r;d=!1;o.remove_video();if(f){a.trigger('av_resize_finished');i.avia_utilities.activate_shortcode_scripts(t[n]);i.avia_utilities.avia_ajax_call(t[n]);f=!1}})})}},ajax_get_contents:function(e,a){if(t[e]!==undefined){o.show_item(e,a);return};t[e]=i('#avia-tmpl-portfolio-preview-'+e.replace(/ID_/,'')).html();t[e]=t[e].replace('/*<![CDATA[*/','').replace('*]]>','');o.attach_item(e);i.avia_utilities.preload({container:t[e],single_callback:function(){o.show_item(e,a)}})},add_controls:function(){u=l.find('.ajax_controlls');l.avia_keyboard_controls({27:'.avia_close',37:'.ajax_previous',39:'.ajax_next'});p.each(function(){var e=i(this),t;e.addClass('no_combo').bind('click',function(i){t=e.find('.slideshow_overlay');if(t.length){i.stopPropagation();o.load_item.apply(e.find('a:eq(0)'));return!1}})})},control_click:function(){var n,f=r.find('.active_portfolio_item').data('ajax-id'),c=r.find('.post-entry-'+f);switch(this.hash){case'#next':n=c.nextAll('.post-entry:visible:eq(0)').find('a:eq(0)');if(!n.length){n=i('.post-entry:visible:eq(0)',r).find('a:eq(0)')};n.trigger('click');break;case'#prev':n=c.prevAll('.post-entry:visible:eq(0)').find('a:eq(0)');if(!n.length){n=i('.post-entry:visible:last',r).find('a:eq(0)')};n.trigger('click');break;case'#close':d=!0;l.slideUp(e.timing,e.easing,function(){r.find('.active_portfolio_item').removeClass('active_portfolio_item');t[s].attr({'style':''}).removeClass('open_slide');l.removeClass('open_container');d=s=v=!1;o.remove_video();a.trigger('av_resize_finished')});break};return!1},resize_reset:function(){if(s===!1){c.html('');t=[]}}};o.add_controls();r.on('click','a',o.load_item);u.on('click','a',o.control_click);if(jQuery.support.leadingWhitespace){n.bind('debouncedresize',o.resize_reset)}})}}(jQuery));