(function($){
'use strict';
if(typeof wpcf7==='undefined'||wpcf7===null){
return;
}
wpcf7=$.extend({
cached: 0,
inputs: []
}, wpcf7);
$(function(){
wpcf7.supportHtml5=(function(){
var features={};
var input=document.createElement('input');
features.placeholder='placeholder' in input;
var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ];
$.each(inputTypes, function(index, value){
input.setAttribute('type', value);
features[ value ]=input.type!=='text';
});
return features;
})();
$('div.wpcf7 > form').each(function(){
var $form=$(this);
wpcf7.initForm($form);
if(wpcf7.cached){
wpcf7.refill($form);
}});
});
wpcf7.getId=function(form){
return parseInt($('input[name="_wpcf7"]', form).val(), 10);
};
wpcf7.initForm=function(form){
var $form=$(form);
$form.submit(function(event){
if(! wpcf7.supportHtml5.placeholder){
$('[placeholder].placeheld', $form).each(function(i, n){
$(n).val('').removeClass('placeheld');
});
}
if(typeof window.FormData==='function'){
wpcf7.submit($form);
event.preventDefault();
}});
$('.wpcf7-submit', $form).after('');
wpcf7.toggleSubmit($form);
$form.on('click', '.wpcf7-acceptance', function(){
wpcf7.toggleSubmit($form);
});
$('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){
var name=$(this).attr('name');
$form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false);
});
$('.wpcf7-list-item.has-free-text', $form).each(function(){
var $freetext=$(':input.wpcf7-free-text', this);
var $wrap=$(this).closest('.wpcf7-form-control');
if($(':checkbox, :radio', this).is(':checked')){
$freetext.prop('disabled', false);
}else{
$freetext.prop('disabled', true);
}
$wrap.on('change', ':checkbox, :radio', function(){
var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio');
if($cb.is(':checked')){
$freetext.prop('disabled', false).focus();
}else{
$freetext.prop('disabled', true);
}});
});
if(! wpcf7.supportHtml5.placeholder){
$('[placeholder]', $form).each(function(){
$(this).val($(this).attr('placeholder'));
$(this).addClass('placeheld');
$(this).focus(function(){
if($(this).hasClass('placeheld')){
$(this).val('').removeClass('placeheld');
}});
$(this).blur(function(){
if(''===$(this).val()){
$(this).val($(this).attr('placeholder'));
$(this).addClass('placeheld');
}});
});
}
if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){
$form.find('input.wpcf7-date[type="date"]').each(function(){
$(this).datepicker({
dateFormat: 'yy-mm-dd',
minDate: new Date($(this).attr('min')),
maxDate: new Date($(this).attr('max'))
});
});
}
if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){
$form.find('input.wpcf7-number[type="number"]').each(function(){
$(this).spinner({
min: $(this).attr('min'),
max: $(this).attr('max'),
step: $(this).attr('step')
});
});
}
$('.wpcf7-character-count', $form).each(function(){
var $count=$(this);
var name=$count.attr('data-target-name');
var down=$count.hasClass('down');
var starting=parseInt($count.attr('data-starting-value'), 10);
var maximum=parseInt($count.attr('data-maximum-value'), 10);
var minimum=parseInt($count.attr('data-minimum-value'), 10);
var updateCount=function(target){
var $target=$(target);
var length=$target.val().length;
var count=down ? starting - length:length;
$count.attr('data-current-value', count);
$count.text(count);
if(maximum&&maximum < length){
$count.addClass('too-long');
}else{
$count.removeClass('too-long');
}
if(minimum&&length < minimum){
$count.addClass('too-short');
}else{
$count.removeClass('too-short');
}};
$(':input[name="' + name + '"]', $form).each(function(){
updateCount(this);
$(this).keyup(function(){
updateCount(this);
});
});
});
$form.on('change', '.wpcf7-validates-as-url', function(){
var val=$.trim($(this).val());
if(val
&& ! val.match(/^[a-z][a-z0-9.+-]*:/i)
&& -1!==val.indexOf('.')){
val=val.replace(/^\/+/, '');
val='http://' + val;
}
$(this).val(val);
});
};
wpcf7.submit=function(form){
if(typeof window.FormData!=='function'){
return;
}
var $form=$(form);
$('.ajax-loader', $form).addClass('is-active');
wpcf7.clearResponse($form);
var formData=new FormData($form.get(0));
var detail={
id: $form.closest('div.wpcf7').attr('id'),
status: 'init',
inputs: [],
formData: formData
};
$.each($form.serializeArray(), function(i, field){
if('_wpcf7'==field.name){
detail.contactFormId=field.value;
}else if('_wpcf7_version'==field.name){
detail.pluginVersion=field.value;
}else if('_wpcf7_locale'==field.name){
detail.contactFormLocale=field.value;
}else if('_wpcf7_unit_tag'==field.name){
detail.unitTag=field.value;
}else if('_wpcf7_container_post'==field.name){
detail.containerPostId=field.value;
}else if(field.name.match(/^_wpcf7_\w+_free_text_/)){
var owner=field.name.replace(/^_wpcf7_\w+_free_text_/, '');
detail.inputs.push({
name: owner + '-free-text',
value: field.value
});
}else if(field.name.match(/^_/)){
}else{
detail.inputs.push(field);
}});
wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail);
var ajaxSuccess=function(data, status, xhr, $form){
detail.id=$(data.into).attr('id');
detail.status=data.status;
detail.apiResponse=data;
var $message=$('.wpcf7-response-output', $form);
switch(data.status){
case 'validation_failed':
$.each(data.invalidFields, function(i, n){
$(n.into, $form).each(function(){
wpcf7.notValidTip(this, n.message);
$('.wpcf7-form-control', this).addClass('wpcf7-not-valid');
$('[aria-invalid]', this).attr('aria-invalid', 'true');
});
});
$message.addClass('wpcf7-validation-errors');
$form.addClass('invalid');
wpcf7.triggerEvent(data.into, 'invalid', detail);
break;
case 'acceptance_missing':
$message.addClass('wpcf7-acceptance-missing');
$form.addClass('unaccepted');
wpcf7.triggerEvent(data.into, 'unaccepted', detail);
break;
case 'spam':
$message.addClass('wpcf7-spam-blocked');
$form.addClass('spam');
wpcf7.triggerEvent(data.into, 'spam', detail);
break;
case 'aborted':
$message.addClass('wpcf7-aborted');
$form.addClass('aborted');
wpcf7.triggerEvent(data.into, 'aborted', detail);
break;
case 'mail_sent':
$message.addClass('wpcf7-mail-sent-ok');
$form.addClass('sent');
wpcf7.triggerEvent(data.into, 'mailsent', detail);
break;
case 'mail_failed':
$message.addClass('wpcf7-mail-sent-ng');
$form.addClass('failed');
wpcf7.triggerEvent(data.into, 'mailfailed', detail);
break;
default:
var customStatusClass='custom-'
+ data.status.replace(/[^0-9a-z]+/i, '-');
$message.addClass('wpcf7-' + customStatusClass);
$form.addClass(customStatusClass);
}
wpcf7.refill($form, data);
wpcf7.triggerEvent(data.into, 'submit', detail);
if('mail_sent'==data.status){
$form.each(function(){
this.reset();
});
wpcf7.toggleSubmit($form);
}
if(! wpcf7.supportHtml5.placeholder){
$form.find('[placeholder].placeheld').each(function(i, n){
$(n).val($(n).attr('placeholder'));
});
}
$message.html('').append(data.message).slideDown('fast');
$message.attr('role', 'alert');
$('.screen-reader-response', $form.closest('.wpcf7')).each(function(){
var $response=$(this);
$response.html('').attr('role', '').append(data.message);
if(data.invalidFields){
var $invalids=$('
');
$.each(data.invalidFields, function(i, n){
if(n.idref){
var $li=$('').append($('').attr('href', '#' + n.idref).append(n.message));
}else{
var $li=$('').append(n.message);
}
$invalids.append($li);
});
$response.append($invalids);
}
$response.attr('role', 'alert').focus();
});
};
$.ajax({
type: 'POST',
url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'),
data: formData,
dataType: 'json',
processData: false,
contentType: false
}).done(function(data, status, xhr){
ajaxSuccess(data, status, xhr, $form);
$('.ajax-loader', $form).removeClass('is-active');
}).fail(function(xhr, status, error){
var $e=$('').text(error.message);
$form.after($e);
});
};
wpcf7.triggerEvent=function(target, name, detail){
var $target=$(target);
var event=new CustomEvent('wpcf7' + name, {
bubbles: true,
detail: detail
});
$target.get(0).dispatchEvent(event);
$target.trigger('wpcf7:' + name, detail);
$target.trigger(name + '.wpcf7', detail);
};
wpcf7.toggleSubmit=function(form, state){
var $form=$(form);
var $submit=$('input:submit', $form);
if(typeof state!=='undefined'){
$submit.prop('disabled', ! state);
return;
}
if($form.hasClass('wpcf7-acceptance-as-validation')){
return;
}
$submit.prop('disabled', false);
$('.wpcf7-acceptance', $form).each(function(){
var $span=$(this);
var $input=$('input:checkbox', $span);
if(! $span.hasClass('optional')){
if($span.hasClass('invert')&&$input.is(':checked')
|| ! $span.hasClass('invert')&&! $input.is(':checked')){
$submit.prop('disabled', true);
return false;
}}
});
};
wpcf7.notValidTip=function(target, message){
var $target=$(target);
$('.wpcf7-not-valid-tip', $target).remove();
$('')
.text(message).appendTo($target);
if($target.is('.use-floating-validation-tip *')){
var fadeOut=function(target){
$(target).not(':hidden').animate({
opacity: 0
}, 'fast', function(){
$(this).css({ 'z-index': -100 });
});
};
$target.on('mouseover', '.wpcf7-not-valid-tip', function(){
fadeOut(this);
});
$target.on('focus', ':input', function(){
fadeOut($('.wpcf7-not-valid-tip', $target));
});
}};
wpcf7.refill=function(form, data){
var $form=$(form);
var refillCaptcha=function($form, items){
$.each(items, function(i, n){
$form.find(':input[name="' + i + '"]').val('');
$form.find('img.wpcf7-captcha-' + i).attr('src', n);
var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n);
$form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]);
});
};
var refillQuiz=function($form, items){
$.each(items, function(i, n){
$form.find(':input[name="' + i + '"]').val('');
$form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]);
$form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]);
});
};
if(typeof data==='undefined'){
$.ajax({
type: 'GET',
url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'),
beforeSend: function(xhr){
var nonce=$form.find(':input[name="_wpnonce"]').val();
if(nonce){
xhr.setRequestHeader('X-WP-Nonce', nonce);
}},
dataType: 'json'
}).done(function(data, status, xhr){
if(data.captcha){
refillCaptcha($form, data.captcha);
}
if(data.quiz){
refillQuiz($form, data.quiz);
}});
}else{
if(data.captcha){
refillCaptcha($form, data.captcha);
}
if(data.quiz){
refillQuiz($form, data.quiz);
}}
};
wpcf7.clearResponse=function(form){
var $form=$(form);
$form.removeClass('invalid spam sent failed');
$form.siblings('.screen-reader-response').html('').attr('role', '');
$('.wpcf7-not-valid-tip', $form).remove();
$('[aria-invalid]', $form).attr('aria-invalid', 'false');
$('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid');
$('.wpcf7-response-output', $form)
.hide().empty().removeAttr('role')
.removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked');
};
wpcf7.apiSettings.getRoute=function(path){
var url=wpcf7.apiSettings.root;
url=url.replace(wpcf7.apiSettings.namespace,
wpcf7.apiSettings.namespace + path);
return url;
};})(jQuery);
(function (){
if(typeof window.CustomEvent==="function") return false;
function CustomEvent(event, params){
params=params||{ bubbles: false, cancelable: false, detail: undefined };
var evt=document.createEvent('CustomEvent');
evt.initCustomEvent(event,
params.bubbles, params.cancelable, params.detail);
return evt;
}
CustomEvent.prototype=window.Event.prototype;
window.CustomEvent=CustomEvent;
})();
(function($){
"use strict";
$(window).bind("pageshow", function(event){
if(event.originalEvent.persisted){
avia_site_preloader();
}});
$(document).ready(function(){
var aviabodyclasses=AviaBrowserDetection('html');
$.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;
}
avia_hamburger_menu();
avia_header_size();
avia_sidebar_menu();
avia_sticky_submenu();
avia_scroll_top_fade();
avia_site_preloader();
aviaCalcContentWidth();
new $.AviaTooltip({"class": 'avia-search-tooltip',data: 'avia-search-tooltip', event:'click', position:'bottom', scope: "body", attach:'element', within_screen: true});
new $.AviaTooltip({"class": 'avia-related-tooltip', data: 'avia-related-tooltip', scope: ".related_posts, .av-share-box", attach:'element', delay:0});
new $.AviaAjaxSearch({scope:'#header'});
if($.fn.avia_iso_sort)
$('.grid-sort-container').avia_iso_sort();
if($.fn.aviaMegamenu)
$(".main_menu .menu").aviaMegamenu({modify_position:true});
$.avia_utilities.avia_ajax_call();
});
$.avia_utilities=$.avia_utilities||{};
$.avia_utilities.avia_ajax_call=function(container){
if(typeof container=='undefined'){ container='body';};
$('a.avianolink').on('click', function(e){ e.preventDefault(); });
$('a.aviablank').attr('target', '_blank');
$(container).avia_activate_lightbox();
if($.fn.avia_scrollspy){
if(container=='body'){
$('body').avia_scrollspy({target:'.main_menu .menu li > a'});
}else{
$('body').avia_scrollspy('refresh');
}}
if($.fn.avia_smoothscroll)
$('a[href*="#"]', container).avia_smoothscroll(container);
avia_small_fixes(container);
avia_hover_effect(container);
avia_iframe_fix(container);
if($.fn.avia_html5_activation&&$.fn.mediaelementplayer)
$(".avia_video, .avia_audio", container).avia_html5_activation({ratio:'16:9'});
}
$.avia_utilities.log=function(text, type, extra){
if(typeof console=='undefined'){return;} if(typeof type=='undefined'){type="log"} type="AVIA-" + type.toUpperCase();
console.log("["+type+"] "+text); if(typeof extra!='undefined') console.log(extra);
}
function aviaCalcContentWidth(){
var win=$(window),
width_select=$('html').is('.html_header_sidebar') ? "#main":"#header",
outer=$(width_select),
outerParent=outer.parents('div:eq(0)'),
the_main=$(width_select + ' .container:first'),
css_block="",
calc_dimensions=function(){
var css="",
w_12=Math.round(the_main.width()),
w_outer=Math.round(outer.width()),
w_inner=Math.round(outerParent.width());
css +=" #header .three.units{width:" +(w_12 * 0.25)+ "px;}";
css +=" #header .six.units{width:" +(w_12 * 0.50)+ "px;}";
css +=" #header .nine.units{width:" +(w_12 * 0.75)+ "px;}";
css +=" #header .twelve.units{width:" +(w_12) + "px;}";
css +=" .av-framed-box .av-layout-tab-inner .container{width:" +(w_inner)+ "px;}";
css +=" .html_header_sidebar .av-layout-tab-inner .container{width:" +(w_outer)+ "px;}";
css +=" .boxed .av-layout-tab-inner .container{width:" +(w_outer)+ "px;}";
css +=" .av-framed-box#top .av-submenu-container{width:" +(w_inner)+ "px;}";
try{
css_block.text(css);
}
catch(err){
css_block.remove();
css_block=$("").appendTo('head:first');
}};
if($('.avia_mega_div').length > 0||$('.av-layout-tab-inner').length > 0||$('.av-submenu-container').length > 0){
css_block=$("").appendTo('head:first')
win.on('debouncedresize', calc_dimensions);
calc_dimensions();
}}
function AviaScrollSpy(element, options){
var self=this;
var process=$.proxy(self.process, self)
, refresh=$.proxy(self.refresh, self)
, $element=$(element).is('body') ? $(window):$(element)
, href
self.$body=$('body')
self.$win=$(window)
self.options=$.extend({}, $.fn.avia_scrollspy.defaults, options)
self.selector=(self.options.target
|| ((href=$(element).attr('href'))&&href.replace(/.*(?=#[^\s]+$)/, ''))
|| '')
self.activation_true=false;
if(self.$body.find(self.selector + "[href*='#']").length){
self.$scrollElement=$element.on('scroll.scroll-spy.data-api', process);
self.$win.on('av-height-change', refresh);
self.$body.on('av_resize_finished', refresh);
self.activation_true=true;
self.checkFirst();
setTimeout(function(){
self.refresh()
self.process()
},100);
}}
AviaScrollSpy.prototype={
constructor: AviaScrollSpy
, checkFirst: function (){
var current=window.location.href.split('#')[0],
matching_link=this.$body.find(this.selector + "[href='"+current+"']").attr('href',current+'#top');
}
, refresh: function (){
if(!this.activation_true) return;
var self=this
, $targets
this.offsets=$([])
this.targets=$([])
$targets=this.$body
.find(this.selector)
.map(function (){
var $el=$(this)
, href=$el.data('target')||$el.attr('href')
, hash=this.hash
, hash=hash.replace(/\//g, "")
, $href=/^#\w/.test(hash)&&$(hash)
return($href
&& $href.length
&& [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0))&&self.$scrollElement.scrollTop()), href ]])||null
})
.sort(function (a, b){ return a[0] - b[0] })
.each(function (){
self.offsets.push(this[0])
self.targets.push(this[1])
})
}
, process: function (){
if(!this.offsets) return;
if(isNaN(this.options.offset)) this.options.offset=0;
var scrollTop=this.$scrollElement.scrollTop() + this.options.offset
, scrollHeight=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight
, maxScroll=scrollHeight - this.$scrollElement.height()
, offsets=this.offsets
, targets=this.targets
, activeTarget=this.activeTarget
, i
if(scrollTop >=maxScroll){
return activeTarget!=(i=targets.last()[0])
&& this.activate(i)
}
for (i=offsets.length; i--;){
activeTarget!=targets[i]
&& scrollTop >=offsets[i]
&& (!offsets[i + 1]||scrollTop <=offsets[i + 1])
&& this.activate(targets[i])
}}
, activate: function (target){
var active
, selector
this.activeTarget=target
$(this.selector)
.parent('.' + this.options.applyClass)
.removeClass(this.options.applyClass)
selector=this.selector
+ '[data-target="' + target + '"],'
+ this.selector + '[href="' + target + '"]'
active=$(selector)
.parent('li')
.addClass(this.options.applyClass)
if(active.parent('.sub-menu').length){
active=active.closest('li.dropdown_ul_available').addClass(this.options.applyClass)
}
active.trigger('activate')
}}
$.fn.avia_scrollspy=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('scrollspy')
, options=typeof option=='object'&&option
if(!data) $this.data('scrollspy', (data=new AviaScrollSpy(this, options)))
if(typeof option=='string') data[option]()
})
}
$.fn.avia_scrollspy.Constructor=AviaScrollSpy
$.fn.avia_scrollspy.calc_offset=function(){
var offset_1=(parseInt($('.html_header_sticky #main').data('scroll-offset'), 10))||0,
offset_2=($(".html_header_sticky:not(.html_top_nav_header) #header_main_alternate").outerHeight())||0,
offset_3=($(".html_header_sticky.html_header_unstick_top_disabled #header_meta").outerHeight())||0,
offset_4=1,
offset_5=parseInt($('html').css('margin-top'),10)||0,
offset_6=parseInt($('.av-frame-top ').outerHeight(),10)||0;
return offset_1 + offset_2 + offset_3 + offset_4 + offset_5 + offset_6;
}
$.fn.avia_scrollspy.defaults =
{
offset: $.fn.avia_scrollspy.calc_offset(),
applyClass: 'current-menu-item'
}
function avia_site_preloader(){
var win=$(window), preloader_active=$('html.av-preloader-active'), pre_wrap;
if(preloader_active.length){
var hide=function(){
pre_wrap.avia_animate({opacity:0}, function(){
preloader_active.removeClass('av-preloader-active');
});
};
pre_wrap=$('.av-siteloader-wrap');
setTimeout(function(){
$.avia_utilities.preload({container: preloader_active, global_callback: hide });
setTimeout(function(){
if(preloader_active.is('.av-preloader-active')){
hide();
$.avia_utilities.log('Hide Preloader (Fallback)');
}},4000);
if(pre_wrap.is('.av-transition-enabled')){
var comp=new RegExp(location.host),
exclude=" .no-transition, .mfp-iframe, .lightbox-added, .grid-links-ajax a, #menu-item-search a";
preloader_active.on('click', 'a:not('+exclude+')',function(e){
if(!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){
var link=this;
if(comp.test(link.href)&&link.href.split('#')[0]!=location.href.split('#')[0]&&link.target==""){
if(link.href.indexOf('mailto:')==-1&&link.href.indexOf('add-to-cart=')==-1){
e.preventDefault();
preloader_active.addClass('av-preloader-active av-preloader-reactive');
pre_wrap.avia_animate({opacity:1}, function(){
window.location=link.href;
});
}}
}});
}}, 500);
}}
function AviaBrowserDetection(outputClassElement){
if(typeof($.browser)!=='undefined'){
var bodyclass='', version=$.browser.version ? parseInt($.browser.version):"";
if($.browser.msie){
bodyclass +='avia-msie';
}else if($.browser.webkit){
bodyclass +='avia-webkit';
}else if($.browser.mozilla){
bodyclass +='avia-mozilla';
}
if($.browser.version) bodyclass +=' ' + bodyclass + '-' + version + ' ';
if($.browser.name) bodyclass +=' avia-' + $.browser.name + ' avia-' +$.browser.name +'-' + version + ' ';
if($.browser.ipad){
bodyclass +=' avia-ipad ';
}else if($.browser.iphone){
bodyclass +=' avia-iphone ';
}else if($.browser.android){
bodyclass +=' avia-android ';
}else if($.browser.win){
bodyclass +=' avia-windows ';
}else if($.browser.mac){
bodyclass +=' avia-mac ';
}else if($.browser.linux){
bodyclass +=' avia-linux ';
}}
if(outputClassElement) $(outputClassElement).addClass(bodyclass)
return bodyclass;
}
$.fn.avia_html5_activation=function(options){
var defaults =
{
ratio: '16:9'
};
var options=$.extend(defaults, options),
isMobile=$.avia_utilities.isMobile;
this.each(function(){
var fv=$(this),
id_to_apply='#' + fv.attr('id'),
posterImg=fv.attr('poster');
fv.mediaelementplayer({
defaultVideoWidth: 480,
defaultVideoHeight: 270,
videoWidth: -1,
videoHeight: -1,
audioWidth: 400,
audioHeight: 30,
startVolume: 0.8,
loop: false,
enableAutosize: false,
features: ['playpause','progress','current','duration','tracks','volume'],
alwaysShowControls: false,
iPadUseNativeControls: false,
iPhoneUseNativeControls: false,
AndroidUseNativeControls: false,
alwaysShowHours: false,
showTimecodeFrameCount: false,
framesPerSecond: 25,
enableKeyboard: true,
pauseOtherPlayers: false,
poster: posterImg,
success: function (mediaElement, domObject){
setTimeout(function(){
if(mediaElement.pluginType=='flash'){
mediaElement.addEventListener('canplay', function(){ fv.trigger('av-mediajs-loaded'); }, false);
}else{
fv.trigger('av-mediajs-loaded').addClass('av-mediajs-loaded');
}
mediaElement.addEventListener('ended', function(){ fv.trigger('av-mediajs-ended'); }, false);
},10);
},
error: function (){
},
keyActions: []
});
});
}
function avia_hover_effect(container){
if($.avia_utilities.isMobile) return;
var overlay="", cssTrans=$.avia_utilities.supports('transition');
if(container=='body'){
var elements=$('#main a img').parents('a').not('.noLightbox, .noLightbox a, .avia-gallery-thumb a, .ls-wp-container a, .noHover, .noHover a, .av-logo-container .logo a').add('#main .avia-hover-fx');
}else{
var elements=$('a img', container).parents('a').not('.noLightbox, .noLightbox a, .avia-gallery-thumb a, .ls-wp-container a, .noHover, .noHover a, .av-logo-container .logo a').add('.avia-hover-fx', container);
}
elements.each(function(e){
var link=$(this),
current=link.find('img:first');
if(current.hasClass('alignleft')) link.addClass('alignleft').css({float:'left', margin:0, padding:0});
if(current.hasClass('alignright')) link.addClass('alignright').css({float:'right', margin:0, padding:0});
if(current.hasClass('aligncenter')) link.addClass('aligncenter').css({float:'none','text-align':'center', margin:0, padding:0});
if(current.hasClass('alignnone')){
link.addClass('alignnone').css({margin:0, padding:0});;
if(!link.css('display')||link.css('display')=='inline'){ link.css({display:'inline-block'});}}
if(!link.css('position')||link.css('position')=='static'){ link.css({position:'relative', overflow:'hidden'});}
var url=link.attr('href'),
span_class="overlay-type-video",
opa=link.data('opacity')||0.7,
overlay_offset=5,
overlay=link.find('.image-overlay');
if(url){
if(url.match(/(jpg|gif|jpeg|png|tif)/)) span_class="overlay-type-image";
if(!url.match(/(jpg|gif|jpeg|png|\.tif|\.mov|\.swf|vimeo\.com|youtube\.com)/)) span_class="overlay-type-extern";
}
if(!overlay.length){
overlay=$("").appendTo(link);
}
link.on('mouseenter', function(e){
var current=link.find('img:first'),
_self=current.get(0),
outerH=current.outerHeight(),
outerW=current.outerWidth(),
pos=current.position(),
linkCss=link.css('display'),
overlay=link.find('.image-overlay');
if(outerH > 100){
if(!overlay.length){
overlay=$("").appendTo(link);
}
if(link.height()==0){ link.addClass(_self.className); _self.className=""; }
if(!linkCss||linkCss=='inline'){ link.css({display:'block'});}
overlay.css({left:(pos.left - overlay_offset) + parseInt(current.css("margin-left"),10), top:pos.top + parseInt(current.css("margin-top"),10)})
.css({overflow:'hidden',display:'block','height':outerH,'width':(outerW + (2*overlay_offset))});
if(cssTrans===false) overlay.stop().animate({opacity:opa}, 400);
}else{
overlay.css({display:"none"});
}}).on('mouseleave', elements, function(){
if(overlay.length){
if(cssTrans===false) overlay.stop().animate({opacity:0}, 400);
}});
});
}
(function($){
$.fn.avia_smoothscroll=function(apply_to_container){
if(!this.length) return;
var the_win=$(window),
$header=$('#header'),
$main=$('.html_header_top.html_header_sticky #main').not('.page-template-template-blank-php #main'),
$meta=$('.html_header_top.html_header_unstick_top_disabled #header_meta'),
$alt=$('.html_header_top:not(.html_top_nav_header) #header_main_alternate'),
menu_above_logo=$('.html_header_top.html_top_nav_header'),
shrink=$('.html_header_top.html_header_shrinking').length,
frame=$('.av-frame-top'),
fixedMainPadding=0,
isMobile=$.avia_utilities.isMobile,
sticky_sub=$('.sticky_placeholder:first'),
calc_main_padding=function(){
if($header.css('position')=="fixed"){
var tempPadding=parseInt($main.data('scroll-offset'),10)||0,
non_shrinking=parseInt($meta.outerHeight(),10)||0,
non_shrinking2=parseInt($alt.outerHeight(),10)||0;
if(tempPadding > 0&&shrink){
tempPadding=(tempPadding / 2) + non_shrinking + non_shrinking2;
}else{
tempPadding=tempPadding + non_shrinking + non_shrinking2;
}
tempPadding +=parseInt($('html').css('margin-top'),10);
fixedMainPadding=tempPadding;
}else{
fixedMainPadding=parseInt($('html').css('margin-top'),10);
}
if(frame.length){
fixedMainPadding +=frame.height();
}
if(menu_above_logo.length){
fixedMainPadding=$('.html_header_sticky #header_main_alternate').height() + parseInt($('html').css('margin-top'),10);
}
if(isMobile){
fixedMainPadding=0;
}};
if(isMobile) shrink=false;
calc_main_padding();
the_win.on("debouncedresize av-height-change", calc_main_padding);
var hash=window.location.hash.replace(/\//g, "");
if(fixedMainPadding > 0&&hash&&apply_to_container=='body'&&hash.charAt(1)!="!"&&hash.indexOf("=")===-1){
var scroll_to_el=$(hash), modifier=0;
if(scroll_to_el.length){
the_win.on('scroll.avia_first_scroll', function(){
setTimeout(function(){
if(sticky_sub.length&&scroll_to_el.offset().top > sticky_sub.offset().top){ modifier=sticky_sub.outerHeight() - 3; }
the_win.off('scroll.avia_first_scroll').scrollTop(scroll_to_el.offset().top - fixedMainPadding - modifier);
},10);
});
}}
return this.each(function(){
$(this).click(function(e){
var newHash=this.hash.replace(/\//g, ""),
clicked=$(this),
data=clicked.data();
if(newHash!=''&&newHash!='#'&&newHash!='#prev'&&newHash!='#next'&&!clicked.is('.comment-reply-link, #cancel-comment-reply-link, .no-scroll')){
var container="", originHash="";
if("#next-section"==newHash){
originHash=newHash;
container=clicked.parents('.container_wrap:eq(0)').nextAll('.container_wrap:eq(0)');
newHash='#' + container.attr('id') ;
}else{
container=$(this.hash.replace(/\//g, ""));
}
if(container.length){
var cur_offset=the_win.scrollTop(),
container_offset=container.offset().top,
target=container_offset - fixedMainPadding,
hash=window.location.hash,
hash=hash.replace(/\//g, ""),
oldLocation=window.location.href.replace(hash, ''),
newLocation=this,
duration=data.duration||1200,
easing=data.easing||'easeInOutQuint';
if(sticky_sub.length&&container_offset > sticky_sub.offset().top){ target -=sticky_sub.outerHeight() - 3;}
if(oldLocation+newHash==newLocation||originHash){
if(cur_offset!=target){
if(!(cur_offset==0&&target <=0)){
the_win.trigger('avia_smooth_scroll_start');
$('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function(){
if(window.history.replaceState)
window.history.replaceState("", "", newHash);
});
}}
e.preventDefault();
}}
}});
});
};})(jQuery);
function avia_iframe_fix(container){
var iframe=jQuery('iframe[src*="youtube.com"]:not(.av_youtube_frame)', container),
youtubeEmbed=jQuery('iframe[src*="youtube.com"]:not(.av_youtube_frame) object, iframe[src*="youtube.com"]:not(.av_youtube_frame) embed', container).attr('wmode','opaque');
iframe.each(function(){
var current=jQuery(this),
src=current.attr('src');
if(src){
if(src.indexOf('?')!==-1){
src +="&wmode=opaque";
}else{
src +="?wmode=opaque";
}
current.attr('src', src);
}});
}
function avia_small_fixes(container){
if(!container) container=document;
var win=jQuery(window),
iframes=jQuery('.avia-iframe-wrap iframe:not(.avia-slideshow iframe):not(iframe.no_resize):not(.avia-video iframe)', container),
adjust_iframes=function(){
iframes.each(function(){
var iframe=jQuery(this), parent=iframe.parent(), proportions=56.25;
if(this.width&&this.height){
proportions=(100/ this.width) * this.height;
parent.css({"padding-bottom":proportions+"%"});
}});
};
adjust_iframes();
}
(function($){
$.fn.avia_activate_lightbox=function(variables){
var defaults={
groups:['.avia-slideshow', '.avia-gallery', '.av-instagram-pics', '.portfolio-preview-image', '.portfolio-preview-content', '.isotope', '.post-entry', '.sidebar', '#main', '.main_menu'],
autolinkElements: 'a.lightbox, a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href*=".jpg?"], a[href*=".png?"], a[href*=".gif?"], a[href*=".jpeg?"], a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
videoElements:'a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
exclude:'.noLightbox, .noLightbox a, .fakeLightbox, .lightbox-added, a[href*="dropbox.com"]',
},
options=$.extend({}, defaults, variables),
av_popup={
type: 'image',
mainClass: 'avia-popup mfp-zoom-in',
tLoading: '',
tClose: '',
removalDelay: 300,
closeBtnInside: true,
closeOnContentClick:false,
midClick: true,
fixedContentPos: false,
image: {
titleSrc: function(item){
var title=item.el.attr('title');
if(!title) title=item.el.find('img').attr('title');
if(!title) title=item.el.parent().next('.wp-caption-text').html();
if(typeof title=="undefined") return "";
return title;
}},
gallery: {
tPrev: '',
tNext: '',
tCounter: '%curr% / %total%',
enabled: true,
preload: [1,1]
},
callbacks:
{
beforeOpen: function(){
if(this.st.el&&this.st.el.data('fixed-content')){
this.fixedContentPos=true;
}},
open: function(){
$.magnificPopup.instance.next=function(){
var self=this;
self.wrap.removeClass('mfp-image-loaded');
setTimeout(function(){ $.magnificPopup.proto.next.call(self); }, 120);
}
$.magnificPopup.instance.prev=function(){
var self=this;
self.wrap.removeClass('mfp-image-loaded');
setTimeout(function(){ $.magnificPopup.proto.prev.call(self); }, 120);
}
if(this.st.el&&this.st.el.data('av-extra-class')){
this.wrap.addClass(this.currItem.el.data('av-extra-class'));
}},
imageLoadComplete: function(){
var self=this;
setTimeout(function(){ self.wrap.addClass('mfp-image-loaded'); }, 16);
},
change: function(){
if(this.currItem.el){
var current=this.currItem.el;
this.content.find('.av-extra-modal-content, .av-extra-modal-markup').remove();
if(current.data('av-extra-content')){
var extra=current.data('av-extra-content');
this.content.append("");
}
if(current.data('av-extra-markup')){
var markup=current.data('av-extra-markup');
this.wrap.append("");
}}
},
}},
active = !$('html').is('.av-custom-lightbox');
if(!active) return this;
return this.each(function(){
var container=$(this),
videos=$(options.videoElements, this).not(options.exclude).addClass('mfp-iframe'),
ajaxed = !container.is('body')&&!container.is('.ajax_slide');
for (var i=0; i < options.groups.length; i++){
container.find(options.groups[i]).each(function(){
var links=$(options.autolinkElements, this);
if(ajaxed) links.removeClass('lightbox-added');
links.not(options.exclude).addClass('lightbox-added').magnificPopup(av_popup);
});
}});
}})(jQuery);
(function($){
$.fn.aviaMegamenu=function(variables){
var defaults =
{
modify_position:true,
delay:300
};
var options=$.extend(defaults, variables),
win=$(window);
return this.each(function(){
var the_html=$('html:first'),
main=$('#main .container:first'),
left_menu=the_html.filter('.html_menu_left, .html_logo_center').length,
isMobile=$.avia_utilities.isMobile,
menu=$(this),
menuItems=menu.find(">li:not(.ignore_menu)"),
megaItems=menuItems.find(">div").parent().css({overflow:'hidden'}),
menuActive=menu.find('>.current-menu-item>a, >.current_page_item>a'),
dropdownItems=menuItems.find(">ul").parent(),
parentContainer=menu.parent(),
mainMenuParent=menu.parents('.main_menu').eq(0),
parentContainerWidth=parentContainer.width(),
delayCheck={},
mega_open=[];
if(!menuActive.length){ menu.find('.current-menu-ancestor:eq(0) a:eq(0), .current_page_ancestor:eq(0) a:eq(0)').parent().addClass('active-parent-item')}
if(!the_html.is('.html_header_top')){ options.modify_position=false; }
menuItems.on('click' ,'a', function(){
if(this.href==window.location.href + "#"||this.href==window.location.href + "/#")
return false;
});
menuItems.each(function(){
var item=$(this),
pos=item.position(),
megaDiv=item.find("div:first").css({opacity:0, display:"none"}),
normalDropdown="";
if(!megaDiv.length){
normalDropdown=item.find(">ul").css({display:"none"});
}
if(megaDiv.length||normalDropdown.length){
var link=item.addClass('dropdown_ul_available').find('>a');
link.append('');
if(typeof link.attr('href')!='string'||link.attr('href')=="#"){ link.css('cursor','default').click(function(){return false;});}}
if(options.modify_position&&megaDiv.length){
item.on('mouseenter', function(){ calc_offset(item, pos, megaDiv, parentContainerWidth) });
}});
function calc_offset(item, pos, megaDiv, parentContainerWidth){
pos=item.position();
if(!left_menu){
if(pos.left + megaDiv.width() < parentContainerWidth){
megaDiv.css({right: -megaDiv.outerWidth() + item.outerWidth() });
}
else if(pos.left + megaDiv.width() > parentContainerWidth){
megaDiv.css({right: -mainMenuParent.outerWidth() + (pos.left + item.outerWidth()) });
}}else{
if(megaDiv.width() > pos.left + item.outerWidth()){
megaDiv.css({left: (pos.left* -1)});
}
else if(pos.left + megaDiv.width() > parentContainerWidth){
megaDiv.css({left: (megaDiv.width() - pos.left) * -1 });
}}
}
function megaDivShow(i){
if(delayCheck[i]==true){
var item=megaItems.filter(':eq('+i+')').css({overflow:'visible'}).find("div:first"),
link=megaItems.filter(':eq('+i+')').find("a:first");
mega_open["check"+i]=true;
item.stop().css('display','block').animate({opacity:1},300);
if(item.length){
link.addClass('open-mega-a');
}}
}
function megaDivHide (i){
if(delayCheck[i]==false){
megaItems.filter(':eq('+i+')').find(">a").removeClass('open-mega-a');
var listItem=megaItems.filter(':eq('+i+')'),
item=listItem.find("div:first");
item.stop().css('display','block').animate({opacity:0},300, function(){
$(this).css('display','none');
listItem.css({overflow:'hidden'});
mega_open["check"+i]=false;
});
}}
if(isMobile){
megaItems.each(function(i){
$(this).bind('click', function(){
if(mega_open["check"+i]!=true) return false;
});
});
}
megaItems.each(function(i){
$(this).hover(function(){
delayCheck[i]=true;
setTimeout(function(){megaDivShow(i); },options.delay);
},
function(){
delayCheck[i]=false;
setTimeout(function(){megaDivHide(i); },options.delay);
}
);
});
dropdownItems.find('li').addBack().each(function(){
var currentItem=$(this),
sublist=currentItem.find('ul:first'),
showList=false;
if(sublist.length){
sublist.css({display:'block', opacity:0, visibility:'hidden'});
var currentLink=currentItem.find('>a');
currentLink.bind('mouseenter', function(){
sublist.stop().css({visibility:'visible'}).animate({opacity:1});
});
currentItem.bind('mouseleave', function(){
sublist.stop().animate({opacity:0}, function(){
sublist.css({visibility:'hidden'});
});
});
}});
});
};})(jQuery);
$.fn.avia_iso_sort=function(options){
return this.each(function(){
var the_body=$('body'),
container=$(this),
portfolio_id=container.data('portfolio-id'),
parentContainer=container.parents('.entry-content-wrapper, .avia-fullwidth-portfolio'),
filter=parentContainer.find('.sort_width_container[data-portfolio-id="' + portfolio_id + '"]').find('#js_sort_items').css({visibility:"visible", opacity:0}),
links=filter.find('a'),
imgParent=container.find('.grid-image'),
isoActive=false,
items=$('.post-entry', container);
function applyIso(){
container.addClass('isotope_activated').isotope({
layoutMode:'fitRows', itemSelector:'.flex_column'
});
container.isotope('on', 'layoutComplete', function(){
container.css({overflow:'visible'});
the_body.trigger('av_resize_finished');
});
isoActive=true;
setTimeout(function(){ parentContainer.addClass('avia_sortable_active'); }, 0);
};
links.bind('click',function(){
var current=$(this),
selector=current.data('filter'),
linktext=current.html(),
activeCat=parentContainer.find('.av-current-sort-title');
if(activeCat.length) activeCat.html(linktext);
links.removeClass('active_sort');
current.addClass('active_sort');
container.attr('id', 'grid_id_'+selector);
parentContainer.find('.open_container .ajax_controlls .avia_close').trigger('click');
container.isotope({ layoutMode:'fitRows', itemSelector:'.flex_column' , filter: '.'+selector});
return false;
});
$(window).on('debouncedresize', function(){
applyIso();
});
$.avia_utilities.preload({container: container, single_callback: function(){
filter.animate({opacity:1}, 400); applyIso();
setTimeout(function(){ applyIso(); });
imgParent.css({height:'auto'}).each(function(i){
var currentLink=$(this);
setTimeout(function(){
currentLink.animate({opacity:1},1500);
}, (100 * i));
});
}});
});
};
function avia_sticky_submenu(){
var win=$(window),
html=$('html:first'),
header=$('.html_header_top.html_header_sticky #header'),
html_margin=parseInt($('html:first').css('margin-top'), 10),
setWitdth=$('.html_header_sidebar #main, .boxed #main'),
menus=$('.av-submenu-container'),
bordermod=html.is('.html_minimal_header') ? 0:1,
fixed_frame=$('.av-frame-top').height(),
calc_margin=function(){
html_margin=parseInt(html.css('margin-top'), 10);
if(!$('.mobile_menu_toggle:visible').length){
$('.av-open-submenu').removeClass('av-open-submenu');
}
menus.filter('.av-sticky-submenu').each(function(){
$(this).next('.sticky_placeholder').height($(this).height());
});
},
calc_values=function(){
var content_width=setWitdth.width();
html_margin=parseInt(html.css('margin-top'), 10);
menus.width(content_width);
},
check=function(placeholder, no_timeout){
var menu_pos=this.offset().top,
top_pos=placeholder.offset().top,
scrolled=win.scrollTop(),
modifier=html_margin, fixed=false;
if(header.length){
modifier +=header.outerHeight() + parseInt(header.css('margin-top'), 10);
}
if(fixed_frame){
modifier +=fixed_frame;
}
if(scrolled + modifier > top_pos){
if(!fixed){
this.css({top: modifier - bordermod, position: 'fixed'});fixed=true
}}else{
this.css({top: 'auto', position: 'absolute'});fixed=false
}},
toggle=function(e){
e.preventDefault();
var clicked=$(this),
menu=clicked.siblings('.av-subnav-menu');
if(menu.hasClass('av-open-submenu')){
menu.removeClass('av-open-submenu');
}else{
menu.addClass('av-open-submenu');
}};
win.on("debouncedresize av-height-change", calc_margin); calc_margin();
if(setWitdth.length){
win.on("debouncedresize av-height-change", calc_values);
calc_values();
}
menus.each(function(){
var menu=$(this), sticky=menu.filter('.av-sticky-submenu'), placeholder=menu.next('.sticky_placeholder'), mobile_button=menu.find('.mobile_menu_toggle');
if(sticky.length) win.on('scroll', function(){ window.requestAnimationFrame($.proxy(check, sticky, placeholder))});
if(mobile_button.length){
mobile_button.on('click', toggle);
}});
html.on('click', '.av-submenu-hidden .av-open-submenu li a', function(){
var current=$(this);
var list_item=current.siblings('ul, .avia_mega_div');
if(list_item.length){
if(list_item.hasClass('av-visible-sublist')){
list_item.removeClass('av-visible-sublist');
}else{
list_item.addClass('av-visible-sublist');
}
return false;
}});
$('.avia_mobile').on('click', '.av-menu-mobile-disabled li a', function(){
var current=$(this);
var list_item=current.siblings('ul');
if(list_item.length){
if(list_item.hasClass('av-visible-mobile-sublist')){
}else{
$('.av-visible-mobile-sublist').removeClass('av-visible-mobile-sublist');
list_item.addClass('av-visible-mobile-sublist');
return false;
}}
});
}
function avia_sidebar_menu(){
var win=$(window),
main=$('#main'),
sb_header=$('.html_header_sidebar #header_main'),
sidebar=$('.html_header_sidebar #header.av_conditional_sticky');
if(!sb_header.length) return;
if(!sidebar.length) return;
var innerSidebar=$('#header_main'),
wrap=$('#wrap_all'),
fixed_frame=$('.av-frame-top').height() * 2,
subtract=parseInt($('html').css('margin-top'), 10),
calc_values=function(){
if(innerSidebar.outerHeight() + fixed_frame < win.height()){
sidebar.addClass('av_always_sticky');
}else{
sidebar.removeClass('av_always_sticky');
}
wrap.css({'min-height': win.height() - subtract});
};
calc_values();
win.on("debouncedresize av-height-change", calc_values);
}
function av_change_class($element, change_method, class_name){
if($element[0].classList){
if(change_method=="add"){
$element[0].classList.add(class_name);
}else{
$element[0].classList.remove(class_name);
}}else{
if(change_method=="add"){
$element.addClass(class_name);
}else{
$element.removeClass(class_name);
}}
}
function avia_header_size(){
var win=$(window),
header=$('.html_header_top.html_header_sticky #header'),
unsticktop=$('.av_header_unstick_top');
if(!header.length&&!unsticktop.length) return;
var logo=$('#header_main .container .logo img, #header_main .container .logo a'),
elements=$('#header_main .container:not(#header_main_alternate>.container), #header_main .main_menu ul:first-child > li > a:not(.avia_mega_div a, #header_main_alternate a), #header_main #menu-item-shop .cart_dropdown_link'),
el_height=$(elements).filter(':first').height(),
isMobile=$.avia_utilities.isMobile,
scroll_top=$('#scroll-top-link'),
transparent=header.is('.av_header_transparency'),
shrinking=header.is('.av_header_shrinking'),
topbar_height=header.find('#header_meta').outerHeight(),
set_height=function(){
var st=win.scrollTop(), newH=0, st_real=st;
if(unsticktop) st -=topbar_height;
if(st < 0) st=0;
if(shrinking&&!isMobile){
if(st < el_height/2){
newH=el_height - st;
if(st <=0){
newH=el_height;
}
av_change_class(header, 'remove', 'header-scrolled');
}else{
newH=el_height/2;
av_change_class(header, 'add', 'header-scrolled');
}
if(st - 30 < el_height){
av_change_class(header, 'remove', 'header-scrolled-full');
}else{
av_change_class(header, 'add', 'header-scrolled-full');
}
elements.css({'height': newH + 'px', 'lineHeight': newH + 'px'});
logo.css({'maxHeight': newH + 'px'});
}
if(unsticktop.length){
if(st <=0){
if(st_real <=0) st_real=0;
unsticktop.css({"margin-top":"-"+st_real+"px"});
}else{
unsticktop.css({"margin-top":"-"+topbar_height+"px"});
}}
if(transparent){
if(st > 50){
av_change_class(header, 'remove', 'av_header_transparency');
}else{
av_change_class(header, 'add', 'av_header_transparency');
}}
}
if($('body').is('.avia_deactivate_menu_resize')) shrinking=false;
if(!transparent&&!shrinking&&!unsticktop.length) return;
win.on('debouncedresize', function(){ el_height=$(elements).attr('style',"").filter(':first').height(); set_height(); });
win.on('scroll', function(){ window.requestAnimationFrame(set_height)});
set_height();
}
function avia_scroll_top_fade(){
var win=$(window),
timeo=false,
scroll_top=$('#scroll-top-link'),
set_status=function(){
var st=win.scrollTop();
if(st < 500){
scroll_top.removeClass('avia_pop_class');
}
else if(!scroll_top.is('.avia_pop_class')){
scroll_top.addClass('avia_pop_class');
}};
win.on('scroll', function(){ window.requestAnimationFrame(set_status)});
set_status();
}
function avia_hamburger_menu(){
var header=$('#header'),
header_main=$('#main .av-logo-container'),
menu=$('#avia-menu'),
burger_wrap=$('.av-burger-menu-main a'),
htmlEL=$('html').eq(0),
overlay=$(''),
overlay_scroll=$('').appendTo(overlay),
inner_overlay=$('').appendTo(overlay_scroll),
bgColor=$('').appendTo(overlay),
animating=false,
first_level={},
logo_container=$('.av-logo-container .inner-container'),
menu_in_logo_container=logo_container.find('.main_menu'),
cloneFirst=htmlEL.is('.html_av-submenu-display-click.html_av-submenu-clone'),
menu_generated=false,
set_list_container_height=function(){
if($.avia_utilities.isMobile){
overlay_scroll.outerHeight(window.innerHeight);
}},
create_list=function(items , append_to){
if(!items) return;
var list, link, current, subitems, megaitems, sub_current, sub_current_list, new_li, new_ul;
items.each(function(){
current=$(this);
subitems=current.find(' > .sub-menu > li');
link=current.find('>a').clone(true).attr('style','');
new_li=$('').append(link);
append_to.append(new_li);
if(subitems.length){
new_ul=$('