');
}
item.inlineElement=el;
return el;
}
mfp.updateStatus('ready');
mfp._parseMarkup(template, {}, item);
return template;
}}
});
var AJAX_NS='ajax',
_ajaxCur,
_removeAjaxCursor=function(){
if(_ajaxCur){
$(document.body).removeClass(_ajaxCur);
}},
_destroyAjaxRequest=function(){
_removeAjaxCursor();
if(mfp.req){
mfp.req.abort();
}};
$.magnificPopup.registerModule(AJAX_NS, {
options: {
settings: null,
cursor: 'mfp-ajax-cur',
tError: '
The content could not be loaded.'
},
proto: {
initAjax: function(){
mfp.types.push(AJAX_NS);
_ajaxCur=mfp.st.ajax.cursor;
_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
},
getAjax: function(item){
if(_ajaxCur){
$(document.body).addClass(_ajaxCur);
}
mfp.updateStatus('loading');
var opts=$.extend({
url: item.src,
success: function(data, textStatus, jqXHR){
var temp={
data:data,
xhr:jqXHR
};
_mfpTrigger('ParseAjax', temp);
mfp.appendContent($(temp.data), AJAX_NS);
item.finished=true;
_removeAjaxCursor();
mfp._setFocus();
setTimeout(function(){
mfp.wrap.addClass(READY_CLASS);
}, 16);
mfp.updateStatus('ready');
_mfpTrigger('AjaxContentAdded');
},
error: function(){
_removeAjaxCursor();
item.finished=item.loadError=true;
mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
}}, mfp.st.ajax.settings);
mfp.req=$.ajax(opts);
return '';
}}
});
var _imgInterval,
_getTitle=function(item){
if(item.data&&item.data.title!==undefined)
return item.data.title;
var src=mfp.st.image.titleSrc;
if(src){
if($.isFunction(src)){
return src.call(mfp, item);
}else if(item.el){
return item.el.attr(src)||'';
}}
return '';
};
$.magnificPopup.registerModule('image', {
options: {
markup: '
',
cursor: 'mfp-zoom-out-cur',
titleSrc: 'title',
verticalFit: true,
tError: '
The image could not be loaded.'
},
proto: {
initImage: function(){
var imgSt=mfp.st.image,
ns='.image';
mfp.types.push('image');
_mfpOn(OPEN_EVENT+ns, function(){
if(mfp.currItem.type==='image'&&imgSt.cursor){
$(document.body).addClass(imgSt.cursor);
}});
_mfpOn(CLOSE_EVENT+ns, function(){
if(imgSt.cursor){
$(document.body).removeClass(imgSt.cursor);
}
_window.off('resize' + EVENT_NS);
});
_mfpOn('Resize'+ns, mfp.resizeImage);
if(mfp.isLowIE){
_mfpOn('AfterChange', mfp.resizeImage);
}},
resizeImage: function(){
var item=mfp.currItem;
if(!item||!item.img) return;
if(mfp.st.image.verticalFit){
var decr=0;
if(mfp.isLowIE){
decr=parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
}
item.img.css('max-height', mfp.wH-decr);
}},
_onImageHasSize: function(item){
if(item.img){
item.hasSize=true;
if(_imgInterval){
clearInterval(_imgInterval);
}
item.isCheckingImgSize=false;
_mfpTrigger('ImageHasSize', item);
if(item.imgHidden){
if(mfp.content)
mfp.content.removeClass('mfp-loading');
item.imgHidden=false;
}}
},
findImageSize: function(item){
var counter=0,
img=item.img[0],
mfpSetInterval=function(delay){
if(_imgInterval){
clearInterval(_imgInterval);
}
_imgInterval=setInterval(function(){
if(img.naturalWidth > 0){
mfp._onImageHasSize(item);
return;
}
if(counter > 200){
clearInterval(_imgInterval);
}
counter++;
if(counter===3){
mfpSetInterval(10);
}else if(counter===40){
mfpSetInterval(50);
}else if(counter===100){
mfpSetInterval(500);
}}, delay);
};
mfpSetInterval(1);
},
getImage: function(item, template){
var guard=0,
onLoadComplete=function(){
if(item){
if(item.img[0].complete){
item.img.off('.mfploader');
if(item===mfp.currItem){
mfp._onImageHasSize(item);
mfp.updateStatus('ready');
}
item.hasSize=true;
item.loaded=true;
_mfpTrigger('ImageLoadComplete');
}else{
guard++;
if(guard < 200){
setTimeout(onLoadComplete,100);
}else{
onLoadError();
}}
}},
onLoadError=function(){
if(item){
item.img.off('.mfploader');
if(item===mfp.currItem){
mfp._onImageHasSize(item);
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src));
}
item.hasSize=true;
item.loaded=true;
item.loadError=true;
}},
imgSt=mfp.st.image;
var el=template.find('.mfp-img');
if(el.length){
var img=document.createElement('img');
img.className='mfp-img';
if(item.el&&item.el.find('img').length){
img.alt=item.el.find('img').attr('alt');
}
item.img=$(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
img.src=item.src;
if(el.is('img')){
item.img=item.img.clone();
}
img=item.img[0];
if(img.naturalWidth > 0){
item.hasSize=true;
}else if(!img.width){
item.hasSize=false;
}}
mfp._parseMarkup(template, {
title: _getTitle(item),
img_replaceWith: item.img
}, item);
mfp.resizeImage();
if(item.hasSize){
if(_imgInterval) clearInterval(_imgInterval);
if(item.loadError){
template.addClass('mfp-loading');
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src));
}else{
template.removeClass('mfp-loading');
mfp.updateStatus('ready');
}
return template;
}
mfp.updateStatus('loading');
item.loading=true;
if(!item.hasSize){
item.imgHidden=true;
template.addClass('mfp-loading');
mfp.findImageSize(item);
}
return template;
}}
});
var hasMozTransform,
getHasMozTransform=function(){
if(hasMozTransform===undefined){
hasMozTransform=document.createElement('p').style.MozTransform!==undefined;
}
return hasMozTransform;
};
$.magnificPopup.registerModule('zoom', {
options: {
enabled: false,
easing: 'ease-in-out',
duration: 300,
opener: function(element){
return element.is('img') ? element:element.find('img');
}},
proto: {
initZoom: function(){
var zoomSt=mfp.st.zoom,
ns='.zoom',
image;
if(!zoomSt.enabled||!mfp.supportsTransition){
return;
}
var duration=zoomSt.duration,
getElToAnimate=function(image){
var newImg=image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
transition='all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
cssObj={
position: 'fixed',
zIndex: 9999,
left: 0,
top: 0,
'-webkit-backface-visibility': 'hidden'
},
t='transition';
cssObj['-webkit-'+t]=cssObj['-moz-'+t]=cssObj['-o-'+t]=cssObj[t]=transition;
newImg.css(cssObj);
return newImg;
},
showMainContent=function(){
mfp.content.css('visibility', 'visible');
},
openTimeout,
animatedImg;
_mfpOn('BuildControls'+ns, function(){
if(mfp._allowZoom()){
clearTimeout(openTimeout);
mfp.content.css('visibility', 'hidden');
image=mfp._getItemToZoom();
if(!image){
showMainContent();
return;
}
animatedImg=getElToAnimate(image);
animatedImg.css(mfp._getOffset());
mfp.wrap.append(animatedImg);
openTimeout=setTimeout(function(){
animatedImg.css(mfp._getOffset(true));
openTimeout=setTimeout(function(){
showMainContent();
setTimeout(function(){
animatedImg.remove();
image=animatedImg=null;
_mfpTrigger('ZoomAnimationEnded');
}, 16);
}, duration);
}, 16);
}});
_mfpOn(BEFORE_CLOSE_EVENT+ns, function(){
if(mfp._allowZoom()){
clearTimeout(openTimeout);
mfp.st.removalDelay=duration;
if(!image){
image=mfp._getItemToZoom();
if(!image){
return;
}
animatedImg=getElToAnimate(image);
}
animatedImg.css(mfp._getOffset(true));
mfp.wrap.append(animatedImg);
mfp.content.css('visibility', 'hidden');
setTimeout(function(){
animatedImg.css(mfp._getOffset());
}, 16);
}});
_mfpOn(CLOSE_EVENT+ns, function(){
if(mfp._allowZoom()){
showMainContent();
if(animatedImg){
animatedImg.remove();
}
image=null;
}});
},
_allowZoom: function(){
return mfp.currItem.type==='image';
},
_getItemToZoom: function(){
if(mfp.currItem.hasSize){
return mfp.currItem.img;
}else{
return false;
}},
_getOffset: function(isLarge){
var el;
if(isLarge){
el=mfp.currItem.img;
}else{
el=mfp.st.zoom.opener(mfp.currItem.el||mfp.currItem);
}
var offset=el.offset();
var paddingTop=parseInt(el.css('padding-top'),10);
var paddingBottom=parseInt(el.css('padding-bottom'),10);
offset.top -=($(window).scrollTop() - paddingTop);
var obj={
width: el.width(),
height: (_isJQ ? el.innerHeight():el[0].offsetHeight) - paddingBottom - paddingTop
};
if(getHasMozTransform()){
obj['-moz-transform']=obj['transform']='translate(' + offset.left + 'px,' + offset.top + 'px)';
}else{
obj.left=offset.left;
obj.top=offset.top;
}
return obj;
}}
});
var IFRAME_NS='iframe',
_emptyPage='//about:blank',
_fixIframeBugs=function(isShowing){
if(mfp.currTemplate[IFRAME_NS]){
var el=mfp.currTemplate[IFRAME_NS].find('iframe');
if(el.length){
if(!isShowing){
el[0].src=_emptyPage;
}
if(mfp.isIE8){
el.css('display', isShowing ? 'block':'none');
}}
}};
$.magnificPopup.registerModule(IFRAME_NS, {
options: {
markup: '
',
srcAction: 'iframe_src',
patterns: {
youtube: {
index: 'youtube.com',
id: 'v=',
src: '//www.youtube.com/embed/%id%?autoplay=1'
},
vimeo: {
index: 'vimeo.com/',
id: '/',
src: '//player.vimeo.com/video/%id%?autoplay=1'
},
gmaps: {
index: '//maps.google.',
src: '%id%&output=embed'
}}
},
proto: {
initIframe: function(){
mfp.types.push(IFRAME_NS);
_mfpOn('BeforeChange', function(e, prevType, newType){
if(prevType!==newType){
if(prevType===IFRAME_NS){
_fixIframeBugs();
}else if(newType===IFRAME_NS){
_fixIframeBugs(true);
}}
});
_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function(){
_fixIframeBugs();
});
},
getIframe: function(item, template){
var embedSrc=item.src;
var iframeSt=mfp.st.iframe;
$.each(iframeSt.patterns, function(){
if(embedSrc.indexOf(this.index) > -1){
if(this.id){
if(typeof this.id==='string'){
embedSrc=embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
}else{
embedSrc=this.id.call(this, embedSrc);
}}
embedSrc=this.src.replace('%id%', embedSrc);
return false;
}});
var dataObj={};
if(iframeSt.srcAction){
dataObj[iframeSt.srcAction]=embedSrc;
}
mfp._parseMarkup(template, dataObj, item);
mfp.updateStatus('ready');
return template;
}}
});
var _getLoopedId=function(index){
var numSlides=mfp.items.length;
if(index > numSlides - 1){
return index - numSlides;
}else if(index < 0){
return numSlides + index;
}
return index;
},
_replaceCurrTotal=function(text, curr, total){
return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
};
$.magnificPopup.registerModule('gallery', {
options: {
enabled: false,
arrowMarkup: '
',
preload: [0,2],
navigateByImgClick: true,
arrows: true,
tPrev: 'Previous (Left arrow key)',
tNext: 'Next (Right arrow key)',
tCounter: '%curr% of %total%'
},
proto: {
initGallery: function(){
var gSt=mfp.st.gallery,
ns='.mfp-gallery',
supportsFastClick=Boolean($.fn.mfpFastClick);
mfp.direction=true;
if(!gSt||!gSt.enabled) return false;
_wrapClasses +=' mfp-gallery';
_mfpOn(OPEN_EVENT+ns, function(){
if(gSt.navigateByImgClick){
mfp.wrap.on('click'+ns, '.mfp-img', function(){
if(mfp.items.length > 1){
mfp.next();
return false;
}});
}
_document.on('keydown'+ns, function(e){
if(e.keyCode===37){
mfp.prev();
}else if(e.keyCode===39){
mfp.next();
}});
});
_mfpOn('UpdateStatus'+ns, function(e, data){
if(data.text){
data.text=_replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
}});
_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item){
var l=mfp.items.length;
values.counter=l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l):'';
});
_mfpOn('BuildControls' + ns, function(){
if(mfp.items.length > 1&&gSt.arrows&&!mfp.arrowLeft){
var markup=gSt.arrowMarkup,
arrowLeft=mfp.arrowLeft=$(markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left')).addClass(PREVENT_CLOSE_CLASS),
arrowRight=mfp.arrowRight=$(markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right')).addClass(PREVENT_CLOSE_CLASS);
var eName=supportsFastClick ? 'mfpFastClick':'click';
arrowLeft[eName](function(){
mfp.prev();
});
arrowRight[eName](function(){
mfp.next();
});
if(mfp.isIE7){
_getEl('b', arrowLeft[0], false, true);
_getEl('a', arrowLeft[0], false, true);
_getEl('b', arrowRight[0], false, true);
_getEl('a', arrowRight[0], false, true);
}
mfp.container.append(arrowLeft.add(arrowRight));
}});
_mfpOn(CHANGE_EVENT+ns, function(){
if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
mfp._preloadTimeout=setTimeout(function(){
mfp.preloadNearbyImages();
mfp._preloadTimeout=null;
}, 16);
});
_mfpOn(CLOSE_EVENT+ns, function(){
_document.off(ns);
mfp.wrap.off('click'+ns);
if(mfp.arrowLeft&&supportsFastClick){
mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
}
mfp.arrowRight=mfp.arrowLeft=null;
});
},
next: function(){
mfp.direction=true;
mfp.index=_getLoopedId(mfp.index + 1);
mfp.updateItemHTML();
},
prev: function(){
mfp.direction=false;
mfp.index=_getLoopedId(mfp.index - 1);
mfp.updateItemHTML();
},
goTo: function(newIndex){
mfp.direction=(newIndex >=mfp.index);
mfp.index=newIndex;
mfp.updateItemHTML();
},
preloadNearbyImages: function(){
var p=mfp.st.gallery.preload,
preloadBefore=Math.min(p[0], mfp.items.length),
preloadAfter=Math.min(p[1], mfp.items.length),
i;
for(i=1; i <=(mfp.direction ? preloadAfter:preloadBefore); i++){
mfp._preloadItem(mfp.index+i);
}
for(i=1; i <=(mfp.direction ? preloadBefore:preloadAfter); i++){
mfp._preloadItem(mfp.index-i);
}},
_preloadItem: function(index){
index=_getLoopedId(index);
if(mfp.items[index].preloaded){
return;
}
var item=mfp.items[index];
if(!item.parsed){
item=mfp.parseEl(index);
}
_mfpTrigger('LazyLoad', item);
if(item.type==='image'){
item.img=$('
').on('load.mfploader', function(){
item.hasSize=true;
}).on('error.mfploader', function(){
item.hasSize=true;
item.loadError=true;
_mfpTrigger('LazyLoadError', item);
}).attr('src', item.src);
}
item.preloaded=true;
}}
});
/*
Touch Support that might be implemented some day
addSwipeGesture: function(){
var startX,
moved,
multipleTouches;
return;
var namespace='.mfp',
addEventNames=function(pref, down, move, up, cancel){
mfp._tStart=pref + down + namespace;
mfp._tMove=pref + move + namespace;
mfp._tEnd=pref + up + namespace;
mfp._tCancel=pref + cancel + namespace;
};
if(window.navigator.msPointerEnabled){
addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');
}else if('ontouchstart' in window){
addEventNames('touch', 'start', 'move', 'end', 'cancel');
}else{
return;
}
_window.on(mfp._tStart, function(e){
var oE=e.originalEvent;
multipleTouches=moved=false;
startX=oE.pageX||oE.changedTouches[0].pageX;
}).on(mfp._tMove, function(e){
if(e.originalEvent.touches.length > 1){
multipleTouches=e.originalEvent.touches.length;
}else{
moved=true;
}}).on(mfp._tEnd + ' ' + mfp._tCancel, function(e){
if(moved&&!multipleTouches){
var oE=e.originalEvent,
diff=startX - (oE.pageX||oE.changedTouches[0].pageX);
if(diff > 20){
mfp.next();
}else if(diff < -20){
mfp.prev();
}}
});
},
*/
var RETINA_NS='retina';
$.magnificPopup.registerModule(RETINA_NS, {
options: {
replaceSrc: function(item){
return item.src.replace(/\.\w+$/, function(m){ return '@2x' + m; });
},
ratio: 1
},
proto: {
initRetina: function(){
if(window.devicePixelRatio > 1){
var st=mfp.st.retina,
ratio=st.ratio;
ratio = !isNaN(ratio) ? ratio:ratio();
if(ratio > 1){
_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item){
item.img.css({
'max-width': item.img[0].naturalWidth / ratio,
'width': '100%'
});
});
_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item){
item.src=st.replaceSrc(item, ratio);
});
}}
}}
});
/**
* FastClick event implementation. (removes 300ms delay on touch devices)
* Based on https://developers.google.com/mobile/articles/fast_buttons
*
* You may use it outside the Magnific Popup by calling just:
*
* $('.your-el').mfpFastClick(function(){
* console.log('Clicked!');
* });
*
* To unbind:
* $('.your-el').destroyMfpFastClick();
*
*
* Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
* If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
*
*/
(function(){
var ghostClickDelay=1000,
supportsTouch='ontouchstart' in window,
unbindTouchMove=function(){
_window.off('touchmove'+ns+' touchend'+ns);
},
eName='mfpFastClick',
ns='.'+eName;
$.fn.mfpFastClick=function(callback){
return $(this).each(function(){
var elem=$(this),
lock;
if(supportsTouch){
var timeout,
startX,
startY,
pointerMoved,
point,
numPointers;
elem.on('touchstart' + ns, function(e){
pointerMoved=false;
numPointers=1;
point=e.originalEvent ? e.originalEvent.touches[0]:e.touches[0];
startX=point.clientX;
startY=point.clientY;
_window.on('touchmove'+ns, function(e){
point=e.originalEvent ? e.originalEvent.touches:e.touches;
numPointers=point.length;
point=point[0];
if(Math.abs(point.clientX - startX) > 10 ||
Math.abs(point.clientY - startY) > 10){
pointerMoved=true;
unbindTouchMove();
}}).on('touchend'+ns, function(e){
unbindTouchMove();
if(pointerMoved||numPointers > 1){
return;
}
lock=true;
e.preventDefault();
clearTimeout(timeout);
timeout=setTimeout(function(){
lock=false;
}, ghostClickDelay);
callback();
});
});
}
elem.on('click' + ns, function(){
if(!lock){
callback();
}});
});
};
$.fn.destroyMfpFastClick=function(){
$(this).off('touchstart' + ns + ' click' + ns);
if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns);
};})();
_checkInstance(); }));
;(function ($){
"use strict";
var methods=(function (){
var c={
bcClass: 'sf-breadcrumb',
menuClass: 'sf-js-enabled',
anchorClass: 'sf-with-ul',
menuArrowClass: 'sf-arrows'
},
ios=(function (){
var ios=/iPhone|iPad|iPod/i.test(navigator.userAgent);
if(ios){
$(window).load(function (){
$('body').children().on('click', $.noop);
});
}
return ios;
})(),
wp7=(function (){
var style=document.documentElement.style;
return ('behavior' in style&&'fill' in style&&/iemobile/i.test(navigator.userAgent));
})(),
toggleMenuClasses=function ($menu, o){
var classes=c.menuClass;
if(o.cssArrows){
classes +=' ' + c.menuArrowClass;
}
$menu.toggleClass(classes);
},
setPathToCurrent=function ($menu, o){
return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels)
.addClass(o.hoverClass + ' ' + c.bcClass)
.filter(function (){
return ($(this).children(o.popUpSelector).hide().show().length);
}).removeClass(o.pathClass);
},
toggleAnchorClass=function ($li){
$li.children('a').toggleClass(c.anchorClass);
},
toggleTouchAction=function ($menu){
var touchAction=$menu.css('ms-touch-action');
touchAction=(touchAction==='pan-y') ? 'auto':'pan-y';
$menu.css('ms-touch-action', touchAction);
},
applyHandlers=function ($menu, o){
var targets='li:has(' + o.popUpSelector + ')';
if($.fn.hoverIntent&&!o.disableHI){
$menu.hoverIntent(over, out, targets);
}else{
$menu
.on('mouseenter.superfish', targets, over)
.on('mouseleave.superfish', targets, out);
}
var touchevent='MSPointerDown.superfish';
if(!ios){
touchevent +=' touchend.superfish';
}
if(wp7){
touchevent +=' mousedown.superfish';
}
$menu
.on('focusin.superfish', 'li', over)
.on('focusout.superfish', 'li', out)
.on(touchevent, 'a', o, touchHandler);
},
touchHandler=function (e){
var $this=$(this),
$ul=$this.siblings(e.data.popUpSelector);
if($ul.length > 0&&$ul.is(':hidden')){
$this.one('click.superfish', false);
if(e.type==='MSPointerDown'){
$this.trigger('focus');
}else{
$.proxy(over, $this.parent('li'))();
}}
},
over=function (){
var $this=$(this),
o=getOptions($this);
clearTimeout(o.sfTimer);
$this.siblings().superfish('hide').end().superfish('show');
},
out=function (){
var $this=$(this),
o=getOptions($this);
if(ios){
$.proxy(close, $this, o)();
}else{
clearTimeout(o.sfTimer);
o.sfTimer=setTimeout($.proxy(close, $this, o), o.delay);
}},
close=function (o){
o.retainPath=($.inArray(this[0], o.$path) > -1);
this.superfish('hide');
if(!this.parents('.' + o.hoverClass).length){
o.onIdle.call(getMenu(this));
if(o.$path.length){
$.proxy(over, o.$path)();
}}
},
getMenu=function ($el){
return $el.closest('.' + c.menuClass);
},
getOptions=function ($el){
return getMenu($el).data('sf-options');
};
return {
hide: function (instant){
if(this.length){
var $this=this,
o=getOptions($this);
if(!o){
return this;
}
var not=(o.retainPath===true) ? o.$path:'',
$ul=$this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector),
speed=o.speedOut;
if(instant){
$ul.show();
speed=0;
}
o.retainPath=false;
o.onBeforeHide.call($ul);
$ul.stop(true, true).animate(o.animationOut, speed, function (){
var $this=$(this);
o.onHide.call($this);
});
}
return this;
},
show: function (){
var o=getOptions(this);
if(!o){
return this;
}
var $this=this.addClass(o.hoverClass),
$ul=$this.children(o.popUpSelector);
o.onBeforeShow.call($ul);
if(!$($ul).parents('li').hasClass('megamenu')&&!$($ul).parents('ul').hasClass('sub-menu')&&$ul.offset()){
$ul.addClass('temp-hidden-display');
var docW=$("#top .container").width();
var elm=$ul;
var off=elm.offset();
var l=off.left - ($(window).width() - docW)/2;
var w=elm.width();
var isEntirelyVisible=(l+w <=$(window).width()-100);
if(! isEntirelyVisible){
$ul.parents('li').addClass('edge');
}else{
$ul.parents('li').removeClass('edge');
}
$ul.removeClass('temp-hidden-display');
}
$ul.stop(true, true).animate(o.animation, o.speed, function (){
o.onShow.call($ul);
});
return this;
},
destroy: function (){
return this.each(function (){
var $this=$(this),
o=$this.data('sf-options'),
$hasPopUp;
if(!o){
return false;
}
$hasPopUp=$this.find(o.popUpSelector).parent('li');
clearTimeout(o.sfTimer);
toggleMenuClasses($this, o);
toggleAnchorClass($hasPopUp);
toggleTouchAction($this);
$this.off('.superfish').off('.hoverIntent');
$hasPopUp.children(o.popUpSelector).attr('style', function (i, style){
return style.replace(/display[^;]+;?/g, '');
});
o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass);
$this.find('.' + o.hoverClass).removeClass(o.hoverClass);
o.onDestroy.call($this);
$this.removeData('sf-options');
});
},
init: function (op){
return this.each(function (){
var $this=$(this);
if($this.data('sf-options')){
return false;
}
var o=$.extend({}, $.fn.superfish.defaults, op),
$hasPopUp=$this.find(o.popUpSelector).parent('li');
o.$path=setPathToCurrent($this, o);
$this.data('sf-options', o);
toggleMenuClasses($this, o);
toggleAnchorClass($hasPopUp);
toggleTouchAction($this);
applyHandlers($this, o);
$hasPopUp.not('.' + c.bcClass).superfish('hide', true);
o.onInit.call(this);
});
}};})();
$.fn.superfish=function (method, args){
if(methods[method]){
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}
else if(typeof method==='object'||! method){
return methods.init.apply(this, arguments);
}else{
return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish');
}};
$.fn.superfish.defaults={
popUpSelector: 'ul,.sf-mega',
hoverClass: 'sfHover',
pathClass: 'overrideThisToUse',
pathLevels: 1,
delay: 800,
animation: {opacity: 'show'},
animationOut: {opacity: 'hide'},
speed: 'normal',
speedOut: 'fast',
cssArrows: true,
disableHI: false,
onInit: $.noop,
onBeforeShow: $.noop,
onShow: $.noop,
onBeforeHide: $.noop,
onHide: $.noop,
onIdle: $.noop,
onDestroy: $.noop
};
$.fn.extend({
hideSuperfishUl: methods.hide,
showSuperfishUl: methods.show
});
})(jQuery);
(function(d){var m="left",l="right",c="up",s="down",b="in",t="out",j="none",o="auto",i="swipe",p="pinch",u="tap",x="horizontal",q="vertical",g="all",e="start",h="move",f="end",n="cancel",a="ontouchstart" in window,v="TouchSwipe";var k={fingers:1,threshold:75,cancelThreshold:25,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"button, input, select, textarea, a, .noSwipe"};d.fn.swipe=function(A){var z=d(this),y=z.data(v);if(y&&typeof A==="string"){if(y[A]){return y[A].apply(this,Array.prototype.slice.call(arguments,1))}else{d.error("Method "+A+" does not exist on jQuery.swipe")}}else{if(!y&&(typeof A==="object"||!A)){return r.apply(this,arguments)}}return z};d.fn.swipe.defaults=k;d.fn.swipe.phases={PHASE_START:e,PHASE_MOVE:h,PHASE_END:f,PHASE_CANCEL:n};d.fn.swipe.directions={LEFT:m,RIGHT:l,UP:c,DOWN:s,IN:b,OUT:t};d.fn.swipe.pageScroll={NONE:j,HORIZONTAL:x,VERTICAL:q,AUTO:o};d.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:g};function r(y){if(y&&(y.allowPageScroll===undefined&&(y.swipe!==undefined||y.swipeStatus!==undefined))){y.allowPageScroll=j}if(y.click!==undefined&&y.tap===undefined){y.tap=y.click}if(!y){y={}}y=d.extend({},d.fn.swipe.defaults,y);return this.each(function(){var A=d(this);var z=A.data(v);if(!z){z=new w(this,y);A.data(v,z)}})}function w(S,ag){var aJ=(a||!ag.fallbackToMouseEvents),az=aJ?"touchstart":"mousedown",U=aJ?"touchmove":"mousemove",av=aJ?"touchend":"mouseup",D=aJ?null:"mouseleave",R="touchcancel";var ad=0,N=null,ah=0,aF=0,A=0,aj=1,aA=0,aN=0,Z=null;var H=d(S);var O="start";var aI=0;var ai=null;var I=0,Y=0,aD=0,aP=0;try{H.bind(az,at);H.bind(R,L)}catch(aG){d.error("events not supported "+az+","+R+" on jQuery.swipe")}this.enable=function(){H.bind(az,at);H.bind(R,L);return H};this.disable=function(){Q();return H};this.destroy=function(){Q();H.data(v,null);return H};this.option=function(aR,aQ){if(ag[aR]!==undefined){if(aQ===undefined){return ag[aR]}else{ag[aR]=aQ}}else{d.error("Option "+aR+" does not exist on jQuery.swipe.options")}};function at(aS){if(X()){return}if(d(aS.target).closest(ag.excludedElements,H).length>0){return}var aT=aS.originalEvent?aS.originalEvent:aS;var aR,aQ=a?aT.touches[0]:aT;O=e;if(a){aI=aT.touches.length}else{aS.preventDefault()}ad=0;N=null;aN=null;ah=0;aF=0;A=0;aj=1;aA=0;ai=T();Z=aE();z();if(!a||(aI===ag.fingers||ag.fingers===g)||ap()){aO(0,aQ);I=B();if(aI==2){aO(1,aT.touches[1]);aF=A=aa(ai[0].start,ai[1].start)}if(ag.swipeStatus||ag.pinchStatus){aR=aH(aT,O)}}else{aR=false}if(aR===false){O=n;aH(aT,O);return aR}else{ak(true)}}function P(aT){var aW=aT.originalEvent?aT.originalEvent:aT;if(O===f||O===n||af()){return}var aS,aR=a?aW.touches[0]:aW;var aU=V(aR);Y=B();if(a){aI=aW.touches.length}O=h;if(aI==2){if(aF==0){aO(1,aW.touches[1]);aF=A=aa(ai[0].start,ai[1].start)}else{V(aW.touches[1]);A=aa(ai[0].end,ai[1].end);aN=ao(ai[0].end,ai[1].end)}aj=y(aF,A);aA=Math.abs(aF-A)}if((aI===ag.fingers||ag.fingers===g)||!a||ap()){N=ar(aU.start,aU.end);C(aT,N);ad=G(aU.start,aU.end);ah=K();aK(N,ad);if(ag.swipeStatus||ag.pinchStatus){aS=aH(aW,O)}if(!ag.triggerOnTouchEnd||ag.triggerOnTouchLeave){var aQ=true;if(ag.triggerOnTouchLeave){var aV=au(this);aQ=aC(aU.end,aV)}if(!ag.triggerOnTouchEnd&&aQ){O=aM(h)}else{if(ag.triggerOnTouchLeave&&!aQ){O=aM(f)}}if(O==n||O==f){aH(aW,O)}}}else{O=n;aH(aW,O)}if(aS===false){O=n;aH(aW,O)}}function ab(aS){var aU=aS.originalEvent;if(a){if(aU.touches.length>0){aw();return true}}if(af()){aI=aP}aS.preventDefault();Y=B();if(ag.triggerOnTouchEnd||(ag.triggerOnTouchEnd==false&&O===h)){O=f;var aR=((aI===ag.fingers||ag.fingers===g)||!a);var aQ=ai[0].end.x!==0;var aT=aR&&aQ&&(an()||aB());if(aT){aH(aU,O)}else{O=n;aH(aU,O)}}else{if(!ag.triggerOnTouchEnd&&ay()){O=f;am(aU,O,u)}else{if(O===h){O=n;aH(aU,O)}}}ak(false)}function L(){aI=0;Y=0;I=0;aF=0;A=0;aj=1;z();ak(false)}function W(aQ){var aR=aQ.originalEvent;if(ag.triggerOnTouchLeave){O=aM(f);aH(aR,O)}}function Q(){H.unbind(az,at);H.unbind(R,L);H.unbind(U,P);H.unbind(av,ab);if(D){H.unbind(D,W)}ak(false)}function aM(aT){var aS=aT;var aR=aq();var aQ=ae();if(!aR){aS=n}else{if(aQ&&aT==h&&(!ag.triggerOnTouchEnd||ag.triggerOnTouchLeave)){aS=f}else{if(!aQ&&aT==f&&ag.triggerOnTouchLeave){aS=n}}}return aS}function aH(aS,aQ){var aR=undefined;if(ac()){aR=am(aS,aQ,i)}if(ap()&&aR!==false){aR=am(aS,aQ,p)}if(ay()&&aR!==false){aR=am(aS,aQ,u)}if(aQ===n){L(aS)}if(aQ===f){if(a){if(aS.touches.length==0){L(aS)}}else{L(aS)}}return aR}function am(aT,aQ,aS){var aR=undefined;if(aS==i){H.trigger("swipeStatus",[aQ,N||null,ad||0,ah||0,aI]);if(ag.swipeStatus){aR=ag.swipeStatus.call(H,aT,aQ,N||null,ad||0,ah||0,aI);if(aR===false){return false}}if(aQ==f&&aB()){H.trigger("swipe",[N,ad,ah,aI]);if(ag.swipe){aR=ag.swipe.call(H,aT,N,ad,ah,aI);if(aR===false){return false}}switch(N){case m:H.trigger("swipeLeft",[N,ad,ah,aI]);if(ag.swipeLeft){aR=ag.swipeLeft.call(H,aT,N,ad,ah,aI)}break;case l:H.trigger("swipeRight",[N,ad,ah,aI]);if(ag.swipeRight){aR=ag.swipeRight.call(H,aT,N,ad,ah,aI)}break;case c:H.trigger("swipeUp",[N,ad,ah,aI]);if(ag.swipeUp){aR=ag.swipeUp.call(H,aT,N,ad,ah,aI)}break;case s:H.trigger("swipeDown",[N,ad,ah,aI]);if(ag.swipeDown){aR=ag.swipeDown.call(H,aT,N,ad,ah,aI)}break}}}if(aS==p){H.trigger("pinchStatus",[aQ,aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchStatus){aR=ag.pinchStatus.call(H,aT,aQ,aN||null,aA||0,ah||0,aI,aj);if(aR===false){return false}}if(aQ==f&&an()){switch(aN){case b:H.trigger("pinchIn",[aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchIn){aR=ag.pinchIn.call(H,aT,aN||null,aA||0,ah||0,aI,aj)}break;case t:H.trigger("pinchOut",[aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchOut){aR=ag.pinchOut.call(H,aT,aN||null,aA||0,ah||0,aI,aj)}break}}}if(aS==u){if(aQ===n||aQ===f){if((aI===1||!a)&&(isNaN(ad)||ad===0)){H.trigger("tap",[aT.target]);if(ag.tap){aR=ag.tap.call(H,aT,aT.target)}}}}return aR}function ae(){var aQ=true;if(ag.threshold!==null){aQ=ad>=ag.threshold}if(aQ&&ag.cancelThreshold!==null){aQ=(M(N)-ad)
=ag.pinchThreshold}return true}function aq(){var aQ;if(ag.maxTimeThreshold){if(ah>=ag.maxTimeThreshold){aQ=false}else{aQ=true}}else{aQ=true}return aQ}function C(aQ,aR){if(ag.allowPageScroll===j||ap()){aQ.preventDefault()}else{var aS=ag.allowPageScroll===o;switch(aR){case m:if((ag.swipeLeft&&aS)||(!aS&&ag.allowPageScroll!=x)){aQ.preventDefault()}break;case l:if((ag.swipeRight&&aS)||(!aS&&ag.allowPageScroll!=x)){aQ.preventDefault()}break;case c:if((ag.swipeUp&&aS)||(!aS&&ag.allowPageScroll!=q)){aQ.preventDefault()}break;case s:if((ag.swipeDown&&aS)||(!aS&&ag.allowPageScroll!=q)){aQ.preventDefault()}break}}}function an(){return al()}function ap(){return !!(ag.pinchStatus||ag.pinchIn||ag.pinchOut)}function ax(){return !!(an()&&ap())}function aB(){var aQ=aq();var aS=ae();var aR=aS&&aQ;return aR}function ac(){return !!(ag.swipe||ag.swipeStatus||ag.swipeLeft||ag.swipeRight||ag.swipeUp||ag.swipeDown)}function E(){return !!(aB()&&ac())}function ay(){return !!(ag.tap)}function aw(){aD=B();aP=event.touches.length+1}function z(){aD=0;aP=0}function af(){var aQ=false;if(aD){var aR=B()-aD;if(aR<=ag.fingerReleaseThreshold){aQ=true}}return aQ}function X(){return !!(H.data(v+"_intouch")===true)}function ak(aQ){if(aQ===true){H.bind(U,P);H.bind(av,ab);if(D){H.bind(D,W)}}else{H.unbind(U,P,false);H.unbind(av,ab,false);if(D){H.unbind(D,W,false)}}H.data(v+"_intouch",aQ===true)}function aO(aR,aQ){var aS=aQ.identifier!==undefined?aQ.identifier:0;ai[aR].identifier=aS;ai[aR].start.x=ai[aR].end.x=aQ.pageX||aQ.clientX;ai[aR].start.y=ai[aR].end.y=aQ.pageY||aQ.clientY;return ai[aR]}function V(aQ){var aS=aQ.identifier!==undefined?aQ.identifier:0;var aR=J(aS);aR.end.x=aQ.pageX||aQ.clientX;aR.end.y=aQ.pageY||aQ.clientY;return aR}function J(aR){for(var aQ=0;aQ=0)){return m}else{if((aS<=360)&&(aS>=315)){return m}else{if((aS>=135)&&(aS<=225)){return l}else{if((aS>45)&&(aS<135)){return s}else{return c}}}}}function B(){var aQ=new Date();return aQ.getTime()}function au(aQ){aQ=d(aQ);var aS=aQ.offset();var aR={left:aS.left,right:aS.left+aQ.outerWidth(),top:aS.top,bottom:aS.top+aQ.outerHeight()};return aR}function aC(aQ,aR){return(aQ.x>aR.left&&aQ.xaR.top&&aQ.yt;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e){function t(e,t){for(var n in t)e[n]=t[n];return e}function n(e){return"[object Array]"===f.call(e)}function i(e){var t=[];if(n(e))t=e;else if("number"==typeof e.length)for(var i=0,r=e.length;r>i;i++)t.push(e[i]);else t.push(e);return t}function r(e,n){function r(e,n,s){if(!(this instanceof r))return new r(e,n);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=i(e),this.options=t({},this.options),"function"==typeof n?s=n:t(this.options,n),s&&this.on("always",s),this.getImages(),o&&(this.jqDeferred=new o.Deferred);var c=this;setTimeout(function(){c.check()})}function f(e){this.img=e}function a(e){this.src=e,h[e]=this}r.prototype=new e,r.prototype.options={},r.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);for(var i=n.querySelectorAll("img"),r=0,o=i.length;o>r;r++){var s=i[r];this.addImage(s)}}},r.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},r.prototype.check=function(){function e(e,r){return t.options.debug&&c&&s.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},r.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify(t,e)})},r.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},o&&(o.fn.imagesLoaded=function(e,t){var n=new r(this,e,t);return n.jqDeferred.promise(o(this))}),f.prototype=new e,f.prototype.check=function(){var e=h[this.img.src]||new a(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var h={};return a.prototype=new e,a.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},a.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},a.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},a.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},a.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},a.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},r}var o=e.jQuery,s=e.console,c=s!==void 0,f=Object.prototype.toString;"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],r):e.imagesLoaded=r(e.EventEmitter,e.eventie)}(window);
!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}();
jQuery.easing["jswing"]=jQuery.easing["swing"];jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(hn)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
!function(e){e.flexslider=function(t,n){var a=e(t),i=e.extend({},e.flexslider.defaults,n),o=i.namespace,s="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,r=s?"touchend":"click",l="vertical"===i.direction,c=i.reverse,d=0t?"next":"prev");a.flexAnimate(n,i.pauseOnAction)}),i.pausePlay&&m.pausePlay.setup(),i.slideshow&&(i.pauseOnHover&&a.hover(function(){!a.manualPlay&&!a.manualPause&&a.pause()},function(){!a.manualPause&&!a.manualPlay&&a.play()}),0'),1 ':""+n+" ",a.controlNavScaffold.append(""+t+" "),n++;a.controlsContainer?e(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold),m.controlNav.set(),m.controlNav.active(),a.controlNavScaffold.delegate("a, img",r,function(t){t.preventDefault(),t=e(this);var n=a.controlNav.index(t);t.hasClass(o+"active")||(a.direction=n>a.currentSlide?"next":"prev",a.flexAnimate(n,i.pauseOnAction))}),s&&a.controlNavScaffold.delegate("a","click touchstart",function(e){e.preventDefault()})},setupManual:function(){a.controlNav=a.manualControls,m.controlNav.active(),a.controlNav.live(r,function(t){t.preventDefault(),t=e(this);var n=a.controlNav.index(t);t.hasClass(o+"active")||(a.direction=n>a.currentSlide?"next":"prev",a.flexAnimate(n,i.pauseOnAction))}),s&&a.controlNav.live("click touchstart",function(e){e.preventDefault()})},set:function(){a.controlNav=e("."+o+"control-nav li "+("thumbnails"===i.controlNav?"img":"a"),a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(o+"active").eq(a.animatingTo).addClass(o+"active")},update:function(t,n){1"+a.count+" ")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(n).closest("li").remove(),m.controlNav.set(),1'+i.prevText+' '+i.nextText+" ");a.controlsContainer?(e(a.controlsContainer).append(t),a.directionNav=e("."+o+"direction-nav li a",a.controlsContainer)):(a.append(t),a.directionNav=e("."+o+"direction-nav li a",a)),m.directionNav.update(),a.directionNav.bind(r,function(t){t.preventDefault(),t=a.getTarget(e(this).hasClass(o+"next")?"next":"prev"),a.flexAnimate(t,i.pauseOnAction)}),s&&a.directionNav.bind("click touchstart",function(e){e.preventDefault()})},update:function(){var e=o+"disabled";1===a.pagingCount?a.directionNav.addClass(e):i.animationLoop?a.directionNav.removeClass(e):0===a.animatingTo?a.directionNav.removeClass(e).filter("."+o+"prev").addClass(e):a.animatingTo===a.last?a.directionNav.removeClass(e).filter("."+o+"next").addClass(e):a.directionNav.removeClass(e)}},pausePlay:{setup:function(){var t=e('');a.controlsContainer?(a.controlsContainer.append(t),a.pausePlay=e("."+o+"pauseplay a",a.controlsContainer)):(a.append(t),a.pausePlay=e("."+o+"pauseplay a",a)),m.pausePlay.update(i.slideshow?o+"pause":o+"play"),a.pausePlay.bind(r,function(t){t.preventDefault(),e(this).hasClass(o+"pause")?(a.manualPause=!0,a.manualPlay=!1,a.pause()):(a.manualPause=!1,a.manualPlay=!0,a.play())}),s&&a.pausePlay.bind("click touchstart",function(e){e.preventDefault()})},update:function(e){"play"===e?a.pausePlay.removeClass(o+"pause").addClass(o+"play").text(i.playText):a.pausePlay.removeClass(o+"play").addClass(o+"pause").text(i.pauseText)}},touch:function(){function e(e){m=l?o-e.touches[0].pageY:o-e.touches[0].pageX,f=l?Math.abs(m)m||a.currentSlide===a.last&&m>0?Math.abs(m)/p+2:1),a.setProps(r+m,"setTouch")))}function n(){if(t.removeEventListener("touchmove",e,!1),a.animatingTo===a.currentSlide&&!f&&null!==m){var l=c?-m:m,d=a.getTarget(l>0?"next":"prev");a.canAdvance(d)&&(550>Number(new Date)-v&&50p/2)?a.flexAnimate(d,i.pauseOnAction):u||a.flexAnimate(a.currentSlide,i.pauseOnAction,!0)}t.removeEventListener("touchend",n,!1),r=m=s=o=null}var o,s,r,p,m,v,f=!1;t.addEventListener("touchstart",function(u){a.animating?u.preventDefault():1===u.touches.length&&(a.pause(),p=l?a.h:a.w,v=Number(new Date),r=d&&c&&a.animatingTo===a.last?0:d&&c?a.limit-(a.itemW+i.itemMargin)*a.move*a.animatingTo:d&&a.currentSlide===a.last?a.limit:d?(a.itemW+i.itemMargin)*a.move*a.currentSlide:c?(a.last-a.currentSlide+a.cloneOffset)*p:(a.currentSlide+a.cloneOffset)*p,o=l?u.touches[0].pageY:u.touches[0].pageX,s=l?u.touches[0].pageX:u.touches[0].pageY,t.addEventListener("touchmove",e,!1),t.addEventListener("touchend",n,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(d||a.doMath(),u?m.smoothHeight():d?(a.slides.width(a.computedW),a.update(a.pagingCount),a.setProps()):l?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(i.smoothHeight&&m.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(e){if(!l||u){var t=u?a:a.viewport;e?t.animate({height:a.slides.eq(a.animatingTo).height()},e):t.height(a.slides.eq(a.animatingTo).height())}},sync:function(t){var n=e(i.sync).data("flexslider"),o=a.animatingTo;switch(t){case"animate":n.flexAnimate(o,i.pauseOnAction,!1,!0);break;case"play":!n.playing&&!n.asNav&&n.play();break;case"pause":n.pause()}}},a.flexAnimate=function(t,n,r,v,f){if(p&&1===a.pagingCount&&(a.direction=a.currentItema.w?2*i.itemMargin:i.itemMargin,t=(a.itemW+t)*a.move*a.animatingTo,t=t>a.limit&&1!==a.visible?a.limit:t):t=0===a.currentSlide&&t===a.count-1&&i.animationLoop&&"next"!==a.direction?c?(a.count+a.cloneOffset)*g:0:a.currentSlide===a.last&&0===t&&i.animationLoop&&"prev"!==a.direction?c?0:(a.count+1)*g:c?(a.count-1-t+a.cloneOffset)*g:(t+a.cloneOffset)*g,a.setProps(t,"",i.animationSpeed),a.transitions?(i.animationLoop&&a.atEnd||(a.animating=!1,a.currentSlide=a.animatingTo),a.container.unbind("webkitTransitionEnd transitionend"),a.container.bind("webkitTransitionEnd transitionend",function(){a.wrapup(g)})):a.container.animate(a.args,i.animationSpeed,i.easing,function(){a.wrapup(g)})}i.smoothHeight&&m.smoothHeight(i.animationSpeed)}},a.wrapup=function(e){!u&&!d&&(0===a.currentSlide&&a.animatingTo===a.last&&i.animationLoop?a.setProps(e,"jumpEnd"):a.currentSlide===a.last&&0===a.animatingTo&&i.animationLoop&&a.setProps(e,"jumpStart")),a.animating=!1,a.currentSlide=a.animatingTo,i.after(a)},a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))},a.pause=function(){clearInterval(a.animatedSlides),a.playing=!1,i.pausePlay&&m.pausePlay.update("play"),a.syncExists&&m.sync("pause")},a.play=function(){a.animatedSlides=setInterval(a.animateSlides,i.slideshowSpeed),a.playing=!0,i.pausePlay&&m.pausePlay.update("pause"),a.syncExists&&m.sync("play")},a.canAdvance=function(e,t){var n=p?a.pagingCount-1:a.last;return t?!0:p&&a.currentItem===a.count-1&&0===e&&"prev"===a.direction?!0:p&&0===a.currentItem&&e===a.pagingCount-1&&"next"!==a.direction?!1:e!==a.currentSlide||p?i.animationLoop?!0:a.atEnd&&0===a.currentSlide&&e===n&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===n&&0===e&&"next"===a.direction?!1:!0:!1},a.getTarget=function(e){return a.direction=e,"next"===e?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1},a.setProps=function(e,t,n){var o,s=e?e:(a.itemW+i.itemMargin)*a.move*a.animatingTo;o=-1*function(){if(d)return"setTouch"===t?e:c&&a.animatingTo===a.last?0:c?a.limit-(a.itemW+i.itemMargin)*a.move*a.animatingTo:a.animatingTo===a.last?a.limit:s;switch(t){case"setTotal":return c?(a.count-1-a.currentSlide+a.cloneOffset)*e:(a.currentSlide+a.cloneOffset)*e;case"setTouch":return e;case"jumpEnd":return c?e:a.count*e;case"jumpStart":return c?a.count*e:e;default:return e}}()+"px",a.transitions&&(o=l?"translate3d(0,"+o+",0)":"translate3d("+o+",0,0)",n=void 0!==n?n/1e3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",n)),a.args[a.prop]=o,(a.transitions||void 0===n)&&a.container.css(a.args)},a.setup=function(t){if(u)a.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===t&&(s?a.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+i.animationSpeed/1e3+"s ease",zIndex:1}).eq(a.currentSlide).css({opacity:1,zIndex:2}):a.slides.eq(a.currentSlide).fadeIn(i.animationSpeed,i.easing)),i.smoothHeight&&m.smoothHeight();else{var n,r;"init"===t&&(a.viewport=e('
').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=0,c&&(r=e.makeArray(a.slides).reverse(),a.slides=e(r),a.container.empty().append(a.slides))),i.animationLoop&&!d&&(a.cloneCount=2,a.cloneOffset=1,"init"!==t&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone"))),a.newSlides=e(i.selector,a),n=c?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset,l&&!d?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){a.newSlides.css({display:"block"}),a.doMath(),a.viewport.height(a.h),a.setProps(n*a.h,"init")},"init"===t?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(n*a.computedW,"init"),setTimeout(function(){a.doMath(),a.newSlides.css({width:a.computedW,"float":"left",display:"block"}),i.smoothHeight&&m.smoothHeight()},"init"===t?100:0))}d||a.slides.removeClass(o+"active-slide").eq(a.currentSlide).addClass(o+"active-slide")},a.doMath=function(){var e=a.slides.first(),t=i.itemMargin,n=i.minItems,o=i.maxItems;a.w=a.width(),a.h=e.height(),a.boxPadding=e.outerWidth()-e.width(),d?(a.itemT=i.itemWidth+t,a.minW=n?n*a.itemT:a.w,a.maxW=o?o*a.itemT:a.w,a.itemW=a.minW>a.w?(a.w-t*n)/n:a.maxWa.w?a.w:i.itemWidth,a.visible=Math.floor(a.w/(a.itemW+t)),a.move=0a.w?(a.itemW+2*t)*a.count-a.w-t:(a.itemW+t)*a.count-a.w-t):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1),a.computedW=a.itemW-a.boxPadding},a.update=function(e,t){a.doMath(),d||(ea.controlNav.length?m.controlNav.update("add"):("remove"===t&&!d||a.pagingCounta.last&&(a.currentSlide-=1,a.animatingTo-=1),m.controlNav.update("remove",a.last))),i.directionNav&&m.directionNav.update()},a.addSlide=function(t,n){var o=e(t);a.count+=1,a.last=a.count-1,l&&c?void 0!==n?a.slides.eq(a.count-n).after(o):a.container.prepend(o):void 0!==n?a.slides.eq(n).before(o):a.container.append(o),a.update(n,"add"),a.slides=e(i.selector+":not(.clone)",a),a.setup(),i.added(a)},a.removeSlide=function(t){var n=isNaN(t)?a.slides.index(e(t)):t;a.count-=1,a.last=a.count-1,isNaN(t)?e(t,a.slides).remove():l&&c?a.slides.eq(a.last).remove():a.slides.eq(t).remove(),a.doMath(),a.update(n,"remove"),a.slides=e(i.selector+":not(.clone)",a),a.setup(),i.removed(a)},m.init()},e.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}},e.fn.flexslider=function(t){if(void 0===t&&(t={}),"object"==typeof t)return this.each(function(){var n=e(this),a=n.find(t.selector?t.selector:".slides > li");1===a.length?(a.fadeIn(400),t.start&&t.start(n)):void 0==n.data("flexslider")&&new e.flexslider(this,t)});var n=e(this).data("flexslider");switch(t){case"play":n.play();break;case"pause":n.pause();break;case"next":n.flexAnimate(n.getTarget("next"),!0);break;case"prev":case"previous":n.flexAnimate(n.getTarget("prev"),!0);break;default:"number"==typeof t&&n.flexAnimate(t,!0)}}}(jQuery);
jQuery(document).ready(function($){
function prettyPhotoInit(){
$('.portfolio-items').each(function(){
var $unique_id=Math.floor(Math.random()*10000);
$(this).find('.pretty_photo').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo');
});
$("a[data-rel='prettyPhoto[product-gallery]'], a[data-rel='prettyPhoto']").each(function(){
$(this).attr('rel',$(this).attr('data-rel'));
$(this).removeAttr('data-rel');
});
if($('body').hasClass('nectar-auto-lightbox')){
$('.gallery').each(function(){
if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length==0){
var $unique_id=Math.floor(Math.random()*10000);
$(this).find('.gallery-item .gallery-icon a[href*=".jpg"], .gallery-item .gallery-icon a[href*=".png"], .gallery-item .gallery-icon a[href*=".gif"], .gallery-item .gallery-icon a[href*=".jpeg"]').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo');
}});
$('.main-content img').each(function(){
if($(this).parent().is("[href]")&&!$(this).parent().is("[rel*='prettyPhoto']")&&$(this).parents('.product-image').length==0&&$(this).parents('.iosSlider.product-slider').length==0){
var match=$(this).parent().attr('href').match(/\.(jpg|png|gif)\b/);
if(match) $(this).parent().attr('rel','prettyPhoto');
}});
}
$('a.pp').removeClass('pp').attr('rel','prettyPhoto');
var loading_animation=($('body[data-loading-animation]').attr('data-loading-animation')!='none') ? $('body').attr('data-loading-animation'):null ;
var ascend_loader=($('body').hasClass('ascend')) ? ' ' :'';
var ascend_loader_class=($('body').hasClass('ascend')) ? 'default_loader ':'';
$("a[rel^='prettyPhoto']").prettyPhoto({
theme: 'dark_rounded',
allow_resize: true,
default_width: 1024,
opacity: 0.85,
animation_speed: 'normal',
deeplinking: false,
default_height: 576,
social_tools: '',
markup: ' \
'+ascend_loader+'
\
'
});
}
function magnificInit(){
$('a.pp').removeClass('pp').addClass('magnific-popup');
$("a[rel^='prettyPhoto']:not([rel*='_gal']):not([rel*='product-gallery']):not([rel*='prettyPhoto['])").removeAttr('rel').addClass('magnific-popup');
$('.portfolio-items').each(function(){
if($(this).find('.pretty_photo').length > 0){
$(this).find('.pretty_photo').removeClass('pretty_photo').addClass('gallery').addClass('magnific');
}else if($(this).find('a[rel*="prettyPhoto["]').length > 0){
$(this).find('a[rel*="prettyPhoto["]').removeAttr('rel').addClass('gallery').addClass('magnific');
}});
$("a[data-rel='prettyPhoto[product-gallery]']").each(function(){
$(this).removeAttr('data-rel').addClass('magnific').addClass('gallery');
});
if($('body').hasClass('nectar-auto-lightbox')){
$('.gallery').each(function(){
if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length==0){
var $unique_id=Math.floor(Math.random()*10000);
$(this).find('.gallery-item .gallery-icon a[href*=".jpg"], .gallery-item .gallery-icon a[href*=".png"], .gallery-item .gallery-icon a[href*=".gif"], .gallery-item .gallery-icon a[href*=".jpeg"]').addClass('magnific').addClass('gallery').removeClass('pretty_photo');
}});
$('.main-content img').each(function(){
if($(this).parent().is("[href]")&&!$(this).parent().is(".magnific-popup")&&$(this).parents('.product-image').length==0&&$(this).parents('.iosSlider.product-slider').length==0){
var match=$(this).parent().attr('href').match(/\.(jpg|png|gif)\b/);
if(match) $(this).parent().addClass('magnific-popup').addClass('image-link');
}});
}
$('a.magnific-popup:not(.gallery):not(.nectar_video_lightbox)').magnificPopup({
type: 'image',
callbacks: {
imageLoadComplete: function(){
var $that=this;
setTimeout(function(){ $that.wrap.addClass('mfp-image-loaded'); }, 10);
},
beforeOpen: function(){
this.st.image.markup=this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
},
open: function(){
$.magnificPopup.instance.next=function(){
var $that=this;
this.wrap.removeClass('mfp-image-loaded');
setTimeout(function(){ $.magnificPopup.proto.next.call($that); }, 100);
}
$.magnificPopup.instance.prev=function(){
var $that=this;
this.wrap.removeClass('mfp-image-loaded');
setTimeout(function(){ $.magnificPopup.proto.prev.call($that); }, 100);
}}
},
fixedContentPos: false,
mainClass: 'mfp-zoom-in',
removalDelay: 400
});
$('a.magnific-popup.nectar_video_lightbox, .swiper-slide a[href*=youtube], .swiper-slide a[href*=vimeo]').magnificPopup({
type: 'iframe',
fixedContentPos: false,
mainClass: 'mfp-zoom-in',
removalDelay: 400
});
$('a.magnific.gallery').each(function(){
var $parentRow=($(this).parents('.wpb_row').length > 0) ? $(this).parents('.wpb_row'):$(this).parents('.row');
if($parentRow.length > 0&&!$parentRow.hasClass('lightbox-row')){
$parentRow.magnificPopup({
type: 'image',
delegate: 'a.magnific',
mainClass: 'mfp-zoom-in',
fixedContentPos: false,
callbacks: {
elementParse: function(item){
if($(item.el.context).is('[href]')&&$(item.el.context).attr('href').indexOf('iframe=true')!=-1){
item.type='iframe';
}else{
item.type='image';
}},
imageLoadComplete: function(){
var $that=this;
setTimeout(function(){ $that.wrap.addClass('mfp-image-loaded'); }, 10);
},
beforeOpen: function(){
this.st.image.markup=this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
},
open: function(){
$.magnificPopup.instance.next=function(){
var $that=this;
this.wrap.removeClass('mfp-image-loaded');
setTimeout(function(){ $.magnificPopup.proto.next.call($that); }, 100);
}
$.magnificPopup.instance.prev=function(){
var $that=this;
this.wrap.removeClass('mfp-image-loaded');
setTimeout(function(){ $.magnificPopup.proto.prev.call($that); }, 100);
}}
},
removalDelay: 400,
gallery: {
enabled:true
}});
$parentRow.addClass('lightbox-row');
}});
}
function lightBoxInit(){
if($('body[data-ls="pretty_photo"]').length > 0){
prettyPhotoInit();
}else if($('body[data-ls="magnific"]').length > 0){
magnificInit();
}}
lightBoxInit();
setTimeout(lightBoxInit,500);
(function(k){k.transit={version:"0.9.9",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:true,useTransitionEnd:false};var d=document.createElement("div");var q={};function b(v){if(v in d.style){return v}var u=["Moz","Webkit","O","ms"];var r=v.charAt(0).toUpperCase()+v.substr(1);if(v in d.style){return v}for(var t=0;t-1;q.transition=b("transition");q.transitionDelay=b("transitionDelay");q.transform=b("transform");q.transformOrigin=b("transformOrigin");q.transform3d=e();var i={transition:"transitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"};var f=q.transitionEnd=i[q.transition]||null;for(var p in q){if(q.hasOwnProperty(p)&&typeof k.support[p]==="undefined"){k.support[p]=q[p]}}d=null;k.cssEase={_default:"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};k.cssHooks["transit:transform"]={get:function(r){return k(r).data("transform")||new j()},set:function(s,r){var t=r;if(!(t instanceof j)){t=new j(t)}if(q.transform==="WebkitTransform"&&!a){s.style[q.transform]=t.toString(true)}else{s.style[q.transform]=t.toString()}k(s).data("transform",t)}};k.cssHooks.transform={set:k.cssHooks["transit:transform"].set};if(k.fn.jquery<"1.8"){k.cssHooks.transformOrigin={get:function(r){return r.style[q.transformOrigin]},set:function(r,s){r.style[q.transformOrigin]=s}};k.cssHooks.transition={get:function(r){return r.style[q.transition]},set:function(r,s){r.style[q.transition]=s}}}n("scale");n("translate");n("rotate");n("rotateX");n("rotateY");n("rotate3d");n("perspective");n("skewX");n("skewY");n("x",true);n("y",true);function j(r){if(typeof r==="string"){this.parse(r)}return this}j.prototype={setFromString:function(t,s){var r=(typeof s==="string")?s.split(","):(s.constructor===Array)?s:[s];r.unshift(t);j.prototype.set.apply(this,r)},set:function(s){var r=Array.prototype.slice.apply(arguments,[1]);if(this.setter[s]){this.setter[s].apply(this,r)}else{this[s]=r.join(",")}},get:function(r){if(this.getter[r]){return this.getter[r].apply(this)}else{return this[r]||0}},setter:{rotate:function(r){this.rotate=o(r,"deg")},rotateX:function(r){this.rotateX=o(r,"deg")},rotateY:function(r){this.rotateY=o(r,"deg")},scale:function(r,s){if(s===undefined){s=r}this.scale=r+","+s},skewX:function(r){this.skewX=o(r,"deg")},skewY:function(r){this.skewY=o(r,"deg")},perspective:function(r){this.perspective=o(r,"px")},x:function(r){this.set("translate",r,null)},y:function(r){this.set("translate",null,r)},translate:function(r,s){if(this._translateX===undefined){this._translateX=0}if(this._translateY===undefined){this._translateY=0}if(r!==null&&r!==undefined){this._translateX=o(r,"px")}if(s!==null&&s!==undefined){this._translateY=o(s,"px")}this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var r=(this.scale||"1,1").split(",");if(r[0]){r[0]=parseFloat(r[0])}if(r[1]){r[1]=parseFloat(r[1])}return(r[0]===r[1])?r[0]:r},rotate3d:function(){var t=(this.rotate3d||"0,0,0,0deg").split(",");for(var r=0;r<=3;++r){if(t[r]){t[r]=parseFloat(t[r])}}if(t[3]){t[3]=o(t[3],"deg")}return t}},parse:function(s){var r=this;s.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(t,v,u){r.setFromString(v,u)})},toString:function(t){var s=[];for(var r in this){if(this.hasOwnProperty(r)){if((!q.transform3d)&&((r==="rotateX")||(r==="rotateY")||(r==="perspective")||(r==="transformOrigin"))){continue}if(r[0]!=="_"){if(t&&(r==="scale")){s.push(r+"3d("+this[r]+",1)")}else{if(t&&(r==="translate")){s.push(r+"3d("+this[r]+",0)")}else{s.push(r+"("+this[r]+")")}}}}}return s.join(" ")}};function m(s,r,t){if(r===true){s.queue(t)}else{if(r){s.queue(r,t)}else{t()}}}function h(s){var r=[];k.each(s,function(t){t=k.camelCase(t);t=k.transit.propertyMap[t]||k.cssProps[t]||t;t=c(t);if(k.inArray(t,r)===-1){r.push(t)}});return r}function g(s,v,x,r){var t=h(s);if(k.cssEase[x]){x=k.cssEase[x]}var w=""+l(v)+" "+x;if(parseInt(r,10)>0){w+=" "+l(r)}var u=[];k.each(t,function(z,y){u.push(y+" "+w)});return u.join(", ")}k.fn.transition=k.fn.transit=function(z,s,y,C){var D=this;var u=0;var w=true;if(typeof s==="function"){C=s;s=undefined}if(typeof y==="function"){C=y;y=undefined}if(typeof z.easing!=="undefined"){y=z.easing;delete z.easing}if(typeof z.duration!=="undefined"){s=z.duration;delete z.duration}if(typeof z.complete!=="undefined"){C=z.complete;delete z.complete}if(typeof z.queue!=="undefined"){w=z.queue;delete z.queue}if(typeof z.delay!=="undefined"){u=z.delay;delete z.delay}if(typeof s==="undefined"){s=k.fx.speeds._default}if(typeof y==="undefined"){y=k.cssEase._default}s=l(s);var E=g(z,s,y,u);var B=k.transit.enabled&&q.transition;var t=B?(parseInt(s,10)+parseInt(u,10)):0;if(t===0){var A=function(F){D.css(z);if(C){C.apply(D)}if(F){F()}};m(D,w,A);return D}var x={};var r=function(H){var G=false;var F=function(){if(G){D.unbind(f,F)}if(t>0){D.each(function(){this.style[q.transition]=(x[this]||null)})}if(typeof C==="function"){C.apply(D)}if(typeof H==="function"){H()}};if((t>0)&&(f)&&(k.transit.useTransitionEnd)){G=true;D.bind(f,F)}else{window.setTimeout(F,t)}D.each(function(){if(t>0){this.style[q.transition]=E}k(this).css(z)})};var v=function(F){this.offsetWidth;r(F)};m(D,w,v);return this};function n(s,r){if(!r){k.cssNumber[s]=true}k.transit.propertyMap[s]=q.transform;k.cssHooks[s]={get:function(v){var u=k(v).css("transit:transform");return u.get(s)},set:function(v,w){var u=k(v).css("transit:transform");u.setFromString(s,w);k(v).css({"transit:transform":u})}}}function c(r){return r.replace(/([A-Z])/g,function(s){return"-"+s.toLowerCase()})}function o(s,r){if((typeof s==="string")&&(!s.match(/^[\-0-9\.]+$/))){return s}else{return""+s+r}}function l(s){var r=s;if(k.fx.speeds[r]){r=k.fx.speeds[r]}return o(r,"ms")}k.transit.getTransitionValue=g})(jQuery);
var $event=$.event,
dispatchMethod=$.event.handle ? 'handle':'dispatch',
resizeTimeout;
$event.special.smartresize={
setup: function(){
$(this).bind("resize", $event.special.smartresize.handler);
},
teardown: function(){
$(this).unbind("resize", $event.special.smartresize.handler);
},
handler: function(event, execAsap){
var context=this,
args=arguments;
event.type="smartresize";
if(resizeTimeout){ clearTimeout(resizeTimeout); }
resizeTimeout=setTimeout(function(){
$event[ dispatchMethod ].apply(context, args);
}, execAsap==="execAsap"? 0:100);
}};
$.fn.smartresize=function(fn){
return fn ? this.bind("smartresize", fn):this.trigger("smartresize", ["execAsap"]);
};
function niceScrollInit(){
$("html").niceScroll({
scrollspeed: 60,
mousescrollstep: 40,
cursorwidth: 15,
cursorborder: 0,
cursorcolor: '#303030',
cursorborderradius: 6,
autohidemode: false,
horizrailenabled: false
});
if($('#boxed').length==0){
$('body, body #header-outer, body #header-secondary-outer, body #search-outer').css('padding-right','16px');
}else if($('body[data-ext-responsive="true"]').length==0){
$('body').css('padding-right','16px');
}
$('html').addClass('no-overflow-y');
}
var $smoothActive=$('body').attr('data-smooth-scrolling');
var $smoothCache=($smoothActive==1) ? true:false;
if($smoothActive==1&&$(window).width() > 690&&$('body').outerHeight(true) > $(window).height()&&Modernizr.csstransforms3d&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ niceScrollInit(); }else{
$('body').attr('data-smooth-scrolling','0');
}
if($smoothCache==false&&navigator.platform.toUpperCase().indexOf('MAC')===-1&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)&&$(window).width() > 690){
!function(){function e(){var e=!1;e&&c("keydown",r),v.keyboardSupport&&!e&&u("keydown",r)}function t(){if(document.body){var t=document.body,n=document.documentElement,o=window.innerHeight,r=t.scrollHeight;if(S=document.compatMode.indexOf("CSS")>=0?n:t,w=t,e(),x=!0,top!=self)y=!0;else if(r>o&&(t.offsetHeight<=o||n.offsetHeight<=o)){var a=!1,i=function(){a||n.scrollHeight==document.height||(a=!0,setTimeout(function(){n.style.height=document.height+"px",a=!1},500))};if(n.style.height="auto",setTimeout(i,10),S.offsetHeight<=o){var l=document.createElement("div");l.style.clear="both",t.appendChild(l)}}v.fixedBackground||b||(t.style.backgroundAttachment="scroll",n.style.backgroundAttachment="scroll")}}function n(e,t,n,o){if(o||(o=1e3),d(t,n),1!=v.accelerationMax){var r=+new Date,a=r-C;if(a1&&(i=Math.min(i,v.accelerationMax),t*=i,n*=i)}C=+new Date}if(M.push({x:t,y:n,lastX:0>t?.99:-.99,lastY:0>n?.99:-.99,start:+new Date}),!T){var l=e===document.body,u=function(){for(var r=+new Date,a=0,i=0,c=0;c=v.animationTime,h=f?1:d/v.animationTime;v.pulseAlgorithm&&(h=p(h));var m=s.x*h-s.lastX>>0,w=s.y*h-s.lastY>>0;a+=m,i+=w,s.lastX+=m,s.lastY+=w,f&&(M.splice(c,1),c--)}l?window.scrollBy(a,i):(a&&(e.scrollLeft+=a),i&&(e.scrollTop+=i)),t||n||(M=[]),M.length?N(u,e,o/v.frameRate+1):T=!1};N(u,e,0),T=!0}}function o(e){x||t();var o=e.target,r=l(o);if(!r||e.defaultPrevented||s(w,"embed")||s(o,"embed")&&/\.pdf/i.test(o.src))return!0;var a=e.wheelDeltaX||0,i=e.wheelDeltaY||0;return a||i||(i=e.wheelDelta||0),!v.touchpadSupport&&f(i)?!0:(Math.abs(a)>1.2&&(a*=v.stepSize/120),Math.abs(i)>1.2&&(i*=v.stepSize/120),n(r,-a,-i),void e.preventDefault())}function r(e){var t=e.target,o=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==H.spacebar;if(/input|textarea|select|embed/i.test(t.nodeName)||t.isContentEditable||e.defaultPrevented||o)return!0;if(s(t,"button")&&e.keyCode===H.spacebar)return!0;var r,a=0,i=0,u=l(w),c=u.clientHeight;switch(u==document.body&&(c=window.innerHeight),e.keyCode){case H.up:i=-v.arrowScroll;break;case H.down:i=v.arrowScroll;break;case H.spacebar:r=e.shiftKey?1:-1,i=-r*c*.9;break;case H.pageup:i=.9*-c;break;case H.pagedown:i=.9*c;break;case H.home:i=-u.scrollTop;break;case H.end:var d=u.scrollHeight-u.scrollTop-c;i=d>0?d+10:0;break;case H.left:a=-v.arrowScroll;break;case H.right:a=v.arrowScroll;break;default:return!0}n(u,a,i),e.preventDefault()}function a(e){w=e.target}function i(e,t){for(var n=e.length;n--;)E[A(e[n])]=t;return t}function l(e){var t=[],n=S.scrollHeight;do{var o=E[A(e)];if(o)return i(t,o);if(t.push(e),n===e.scrollHeight){if(!y||S.clientHeight+100?1:-1,t=t>0?1:-1,(k.x!==e||k.y!==t)&&(k.x=e,k.y=t,M=[],C=0)}function f(e){if(e){e=Math.abs(e),D.push(e),D.shift(),clearTimeout(z);var t=h(D[0],120)&&h(D[1],120)&&h(D[2],120);return!t}}function h(e,t){return Math.floor(e/t)==e/t}function m(e){var t,n,o;return e*=v.pulseScale,1>e?t=e-(1-Math.exp(-e)):(n=Math.exp(-1),e-=1,o=1-Math.exp(-e),t=n+o*(1-n)),t*v.pulseNormalize}function p(e){return e>=1?1:0>=e?0:(1==v.pulseNormalize&&(v.pulseNormalize/=m(1)),m(e))}var w,g={frameRate:150,animationTime:500,stepSize:120,pulseAlgorithm:!0,pulseScale:8,pulseNormalize:1,accelerationDelta:20,accelerationMax:1,keyboardSupport:!0,arrowScroll:50,touchpadSupport:!0,fixedBackground:!0,excluded:""},v=g,b=!1,y=!1,k={x:0,y:0},x=!1,S=document.documentElement,D=[120,120,120],H={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},v=g,M=[],T=!1,C=+new Date,E={};setInterval(function(){E={}},1e4);var z,A=function(){var e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}(),N=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(e,t,n){window.setTimeout(e,n||1e3/60)}}(),K=/chrome/i.test(window.navigator.userAgent),L=null;"onwheel"in document.createElement("div")?L="wheel":"onmousewheel"in document.createElement("div")&&(L="mousewheel"),L&&K&&(u(L,o),u("mousedown",a),u("load",t))}();
}
function flexsliderInit(){
$('.flex-gallery').each(function(){
var $that=$(this);
imagesLoaded($(this),function(instance){
$that.flexslider({
animation: 'fade',
smoothHeight: false,
animationSpeed: 500,
useCSS: false,
touch: true
});
$('.flex-gallery .flex-direction-nav li a.flex-next').html(' ');
$('.flex-gallery .flex-direction-nav li a.flex-prev').html(' ');
});
});
}
flexsliderInit();
function flickityInit(){
if($('.nectar-flickity:not(.masonry)').length==0) return false;
$('.nectar-flickity:not(.masonry)').flickity({
contain: true,
draggable: true,
lazyLoad: false,
imagesLoaded: true,
percentPosition: true,
prevNextButtons: false,
pageDots: true,
resize: true,
setGallerySize: true,
wrapAround: true,
accessibility: false
});
}
setTimeout(flickityInit,100);
function flickityBlogInit(){
if($('.nectar-flickity.masonry.not-initialized').length==0) return false;
$('.nectar-flickity.masonry.not-initialized').each(function(){
if($(this).parents('article').hasClass('large_featured'))
$(this).insertBefore($(this).parents('article').find('.content-inner'));
});
$('.nectar-flickity.masonry.not-initialized').flickity({
contain: true,
draggable: false,
lazyLoad: false,
imagesLoaded: true,
percentPosition: true,
prevNextButtons: true,
pageDots: false,
resize: true,
setGallerySize: true,
wrapAround: true,
accessibility: false
});
$('.nectar-flickity.masonry').removeClass('not-initialized');
$('.nectar-flickity.masonry:not(.not-initialized)').each(function(){
if($(this).find('.item-count').length==0){
$('
').insertBefore($(this).find('.flickity-prev-next-button.next'));
$(this).find('.item-count').html('1 /' + $(this).find('.flickity-slider .cell').length + ' ');
$(this).find('.flickity-prev-next-button, .item-count').wrapAll('
');
if($(this).parents('article').hasClass('wide_tall'))
$(this).find('.control-wrap').insertBefore($(this));
}});
$('.masonry .flickity-prev-next-button.previous, .masonry .flickity-prev-next-button.next').click(function(){
if($(this).parents('.wide_tall').length > 0)
$(this).parent().find('.item-count .current').html($(this).parents('article').find('.nectar-flickity .cell.is-selected').index()+1);
else
$(this).parent().find('.item-count .current').html($(this).parents('.nectar-flickity').find('.cell.is-selected').index()+1);
});
$('body').on('mouseover','.flickity-prev-next-button.next',function(){
$(this).parent().find('.flickity-prev-next-button.previous, .item-count').addClass('next-hovered');
});
$('body').on('mouseleave','.flickity-prev-next-button.next',function(){
$(this).parent().find('.flickity-prev-next-button.previous, .item-count').removeClass('next-hovered');
});
}
$('.twentytwenty-container').each(function(){
var $that=$(this);
$(this).imagesLoaded(function(){
$that.twentytwenty();
});
});
var sliderAdvanceSpeed=parseInt($('#featured').attr('data-advance-speed'));
var sliderAnimationSpeed=parseInt($('#featured').attr('data-animation-speed'));
var sliderAutoplay=parseInt($('#featured').attr('data-autoplay'));
if(isNaN(sliderAdvanceSpeed)){ sliderAdvanceSpeed=5500;}
if(isNaN(sliderAnimationSpeed)){ sliderAnimationSpeed=800;}
var $yPos;
var img_urls=[];
$('[style*="background"]').each(function(){
var style=$(this).attr('style');
var pattern=/background.*?url\('(.*?)'\)/g
var match=pattern.exec(style);
if(match){
img_urls.push(match[1]);
}});
var imgArray=[];
for(i=0;i 0&&sliderHeight < 500) sliderHeight=500;
function customSliderHeight(){
if(!$('body').hasClass('mobile')){
$('#featured').attr('style', 'height: '+sliderHeight+'px !important');
$('#featured article').css('height',sliderHeight+headerPadding2-23+'px')
}else{
$('#featured').attr('style', 'height: '+sliderHeight+'px');
}
if($('#header-outer[data-transparent-header="true"]').length > 0) $('.orbit-wrapper').addClass('transparent-header');
}
customSliderHeight();
var logoHeight=parseInt($('#header-outer').attr('data-logo-height'));
var headerPadding=parseInt($('#header-outer').attr('data-padding'));
var headerPadding2=parseInt($('#header-outer').attr('data-padding'));
var extraDef=10;
var headerResize=($('body').hasClass('pp-video-function')) ? '1':$('#header-outer').attr('data-header-resize');
var headerResizeOffExtra=0;
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
var usingLogoImage=true;
var mediaElement=($('.wp-video-shortcode').length > 0) ? 36:0;
var secondaryHeader=($('#header-outer').attr('data-using-secondary')=='1') ? 32:0 ;
if(isNaN(logoHeight)){ usingLogoImage=false; logoHeight=30;}
if(isNaN(headerPadding)){ headerPadding=28; headerPadding2=28;}
if(headerResize.length==0){ extraDef=0; headerResizeOffExtra=headerPadding2; }
if($('header#top #logo img').length==0){ logoHeight=30; }
var $captionPos=(((sliderHeight-70)/2 - $('div.slider-nav span.left span.white').height()/2) + headerPadding2 - headerResizeOffExtra) - 75;
var $controlsPos=(((sliderHeight-70)/2 - $('div.slider-nav span.left span.white').height()/2) + logoHeight + headerPadding*2 + extraHeight + secondaryHeader) -10;
var $scrollTop=0;
var $videoHeight;
function homeSliderInit(){
$('#featured').orbit({
animation: 'fade',
advanceSpeed: sliderAdvanceSpeed,
animationSpeed: sliderAnimationSpeed,
timer: sliderAutoplay
});
customSliderHeight();
sliderAfterSetup();
if(!$('body').hasClass('mobile')){
$('.orbit-wrapper #featured article').css('top', ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader) + 'px');
$('.orbit-wrapper div.slider-nav span.right, .orbit-wrapper div.slider-nav span.left').html(' ');
}else{
$('.orbit-wrapper div.slider-nav span.right').html(' ');
$('.orbit-wrapper div.slider-nav span.left').html(' ');
}}
function homeSliderInit2(){
if($('#featured').length > 0&&$().orbit){
$('#featured article .post-title h2 span').show();
var sliderBackgroundColor=$('#featured').attr('data-bg-color');
if(sliderBackgroundColor.length==0) sliderBackgroundColor='#000000';
$('#featured article').css('background-color',sliderBackgroundColor);
var $firstBg=$('#featured').find('.slide:first-child > article').attr('style');
var pattern=/url\(["']?([^'")]+)['"]?\)/;
var match=pattern.exec($firstBg);
if(match&&match[1].indexOf('.')!==-1){
var slideImg=new Image();
slideImg.onload=function(){
homeSliderInit();
}
slideImg.src=match[1];
}else{
homeSliderInit();
}
if($('.slider-nav > span').find('.white').length==0){
$('.slider-nav > span').append(' ');
}
if($('body').hasClass('mobile')){
$('#featured h2, #featured .video').swipe({
swipeRight:function(e){
$('.slider-nav .left').trigger('click');
e.stopImmediatePropagation();
return false;
},
swipeLeft:function(e){
$('.slider-nav .right').trigger('click');
e.stopImmediatePropagation();
return false;
}})
}}
}
homeSliderInit2();
function sliderAfterSetup(){
$('#featured .mejs-container').css('width',$('#featured .video').width());
$('#featured .mejs-container').css('height',$('#featured .video').width()/1.7777);
$('body:not(.mobile) .orbit-wrapper #featured .orbit-slide:not(".has-video") article .container').css('top', $captionPos +"px");
$('body:not(.mobile) .orbit-wrapper #featured .orbit-slide.has-video article .container').css('top', $videoHeight +"px");
$('body:not(.mobile) .orbit-wrapper .slider-nav > span').css('top', $controlsPos +"px");
$('body:not(.mobile) .orbit-wrapper #featured .slide article').css({'top': ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader) + 'px' });
if(!$('body').hasClass('mobile')&&headerResize.length==0){
$('#featured article').css('height',sliderHeight-32+'px')
}
$(window).trigger('resize');
}
function videoSlidePos(){
$('#featured > div').has('.video').each(function(){
if($(window).width() > 1300){
$('#featured .orbit-slide.has-video .video, #featured .orbit-slide.has-video h2').css('top','0');
$('#featured .orbit-slide.has-video .post-title > a').css('top','10px');
$videoHeight=((sliderHeight-28)/2) - ((410-mediaElement)/2) + headerPadding2 - headerResizeOffExtra;
}
else if($(window).width() > 1000&&$(window).width() < 1081){
$('#featured .orbit-slide.has-video .video, #featured .orbit-slide.has-video h2').css('top','0');
$('#featured .orbit-slide.has-video .post-title > a').css('top','10px');
$videoHeight=((sliderHeight-28)/2) - ((290-mediaElement)/2) + headerPadding2 - headerResizeOffExtra;
}else{
$videoHeight=((sliderHeight-28)/2) - ((336-mediaElement)/2) +headerPadding2 - headerResizeOffExtra;
}});
}
videoSlidePos();
function controlsAndInfoPos(){
$scrollTop=$(window).scrollTop();
$('body:not(.mobile) .orbit-wrapper #featured .orbit-slide:not(".has-video") article .container').css({
'opacity':1-($scrollTop/(sliderHeight-130)),
'top':($scrollTop*-0.2) + $captionPos +"px"
});
$('body:not(.mobile) .orbit-wrapper #featured .orbit-slide.has-video article .container').css({
'opacity':1-($scrollTop/(sliderHeight-130)),
'top':($scrollTop*-0.2) + $videoHeight +"px"
});
if($('#boxed').length==0){
$('body:not(.mobile) .orbit-wrapper .slider-nav > span').css({
'opacity':1-($scrollTop/(sliderHeight-130)),
'top':($scrollTop*-0.4) + $controlsPos +"px"
});
}}
controlsInit();
function controlsInit(){
if($('#boxed').length > 0){
if(1-$scrollTop/(sliderHeight-$controlsPos-20) >=0){
$(window).off('scroll',hideControls);
$(window).on('scroll',showControls);
}else{
$(window).off('scroll',showControls);
$(window).on('scroll',hideControls);
}}else{
$(window).off('scroll',showControls);
$(window).off('scroll',hideControls);
}}
function showControls(){
if(1-$scrollTop/(sliderHeight-$controlsPos-20) >=0){
$('body:not(.mobile) .orbit-wrapper .slider-nav > span.left').stop(true,true).animate({ 'left':'0px'},450,'easeOutCubic');
if($('body').attr('data-smooth-scrolling')=='1'){
$('body:not(.mobile) .orbit-wrapper .slider-nav > span.right').stop(true,true).animate({ 'right':'15px'},450,'easeOutCubic');
}else{
$('body:not(.mobile) .orbit-wrapper .slider-nav > span.right').stop(true,true).animate({ 'right':'0px'},450,'easeOutCubic');
}
$(window).off('scroll',showControls);
$(window).on('scroll',hideControls);
}}
function hideControls(){
if(1-$scrollTop/(sliderHeight-$controlsPos-20) < 0){
$('body:not(.mobile) .orbit-wrapper .slider-nav > span.left').stop(true,true).animate({ 'left':'-80px'},450,'easeOutCubic');
$('body:not(.mobile) .orbit-wrapper .slider-nav > span.right').stop(true,true).animate({ 'right':'-80px'},450,'easeOutCubic');
$(window).off('scroll',hideControls);
$(window).on('scroll',showControls);
}}
function homeSliderParallaxScroll(){
$('#featured .mejs-mediaelement, #featured .iframe-embed').each(function(){
if($(this).parents('.container').css('opacity') <=0){
$(this).css('visibility','hidden').hide();
}else{
$(this).css('visibility','visible').show();
}});
if(!$('body').hasClass('mobile')){
controlsAndInfoPos();
$('body:not(.mobile) .orbit-wrapper #featured .slide:not(:transparent) article').css({'top': ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader) + 'px' });
}}
function homeSliderMobile(){
if(!$('body').hasClass('mobile')){
$('.orbit-wrapper #featured article').css('top', ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader) + 'px');
$('.orbit-wrapper div.slider-nav span.right, .orbit-wrapper div.slider-nav span.left').html(' ');
}else{
$('.orbit-wrapper div.slider-nav span.right').html(' ');
$('.orbit-wrapper div.slider-nav span.left').html(' ');
}
videoSlidePos();
controlsAndInfoPos();
customSliderHeight();
if(!$('body').hasClass('mobile')&&headerResize.length==0){
$('#featured article').css('height',sliderHeight-32+'px')
}}
if($('#featured').length > 0){
$(window).off('scroll.hsps');
$(window).on('scroll.hsps',homeSliderParallaxScroll);
$(window).off('resize.hsps');
$(window).on('resize.hsps',homeSliderMobile);
}
$('.jp-video-container .jp-play, jp-video-container .jp-seek-bar').click(function(){
$(this).parents('.jp-video-container').prev('.jp-jplayer').find('video').show().css('display','block');
$(this).parents('.jp-video-container').prev('.jp-jplayer').find('.jp-jplayer > img').hide();
});
$('#featured .span_12 a.more-info').click(function(){
if(!$(this).find('.btv').is(":visible")){
$(this).parent().parent().find('h2, > a').css('opacity',1);
$(this).parent().parent().find('.video').stop().animate({'top':'-400px'},800,'easeOutCubic');
$(this).parent().parent().find('h2').stop().animate({'top':'-400px'},800,'easeOutCubic');
$(this).parent().parent().find('> a').stop().animate({'top':'-380px'},800,'easeOutCubic');
$(this).find('.btv').show();
$(this).find('.mi').hide();
}else{
$(this).parent().parent().find('.video').stop().animate({'top':'0px'},800,'easeOutCubic');
$(this).parent().parent().find('h2').stop().animate({'top':'0px'},800,'easeOutCubic');
$(this).parent().parent().find('> a').stop().animate({'top':'0px'},800,'easeOutCubic');
$(this).find('.mi').show();
$(this).find('.btv').hide();
}
return false;
});
function initSF(){
$(".sf-menu").superfish({
delay: 700,
speed: 'fast',
speedOut: 'fast',
animation: {opacity:'show'}});
}
var $navLeave;
/*$('header#top nav > ul > li').hover(function(){
if(!$(this).hasClass('megamenu')){
}});*/
function addOrRemoveSF(){
if(window.innerWidth < 1000&&$('body').attr('data-responsive')=='1'){
$('body').addClass('mobile');
$('header#top nav').hide();
}else{
$('body').removeClass('mobile');
$('header#top nav').show();
$('#mobile-menu').hide();
$('.sf-sub-indicator').css('height',$('a.sf-with-ul').height());
}
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) $('body').addClass('using-mobile-browser');
}
addOrRemoveSF();
initSF();
$(window).resize(addOrRemoveSF);
function SFArrows(){
$('.sf-sub-indicator').css('height',$('a.sf-with-ul').height());
}
SFArrows();
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/))
$('body').attr('data-hhun','0');
function standardCarouselInit(){
$('.carousel:not(".clients")').each(function(){
var $that=$(this);
var maxCols=($(this).parents('.carousel-wrap').attr('data-full-width')=='true') ? 'auto':3 ;
var scrollNum=($(this).parents('.carousel-wrap').attr('data-full-width')=='true') ? 'auto':'' ;
var colWidth=($(this).parents('.carousel-wrap').attr('data-full-width')=='true') ? 500:453 ;
var scrollSpeed, easing;
var $autoplayBool=($(this).attr('data-autorotate')=='true') ? true:false;
if($('body.ascend').length > 0&&$(this).parents('.carousel-wrap').attr('data-full-width')!='true'){
if($(this).find('li').length % 3===0){
var $themeSkin=true;
var $themeSkin2=true;
}else{
var $themeSkin=false;
var $themeSkin2=true;
}}else{
var $themeSkin=true;
var $themeSkin2=true;
}
(parseInt($(this).attr('data-scroll-speed'))) ? scrollSpeed=parseInt($(this).attr('data-scroll-speed')):scrollSpeed=700;
($(this).attr('data-easing').length > 0) ? easing=$(this).attr('data-easing'):easing='linear';
var $element=$that;
if($that.find('img').length==0) $element=$('body');
imagesLoaded($element,function(instance){
$that.carouFredSel({
circular: $themeSkin,
infinite: $themeSkin2,
height:'auto',
responsive: true,
items:{
width:colWidth,
visible:{
min:1,
max:maxCols
}},
swipe:{
onTouch:true,
onMouse:true,
options:{
excludedElements: "button, input, select, textarea, .noSwipe",
tap: function(event, target){ if($(target).attr('href')&&!$(target).is('[target="_blank"]')&&!$(target).is('[rel^="prettyPhoto"]')&&!$(target).is('.magnific-popup')&&!$(target).is('.magnific')) window.open($(target).attr('href'), '_self'); }},
onBefore:function(){
$that.find('.work-item').trigger('mouseleave');
$that.find('.work-item .work-info a').trigger('mouseup');
}},
scroll: {
items:scrollNum,
easing:easing,
duration:scrollSpeed,
onBefore:function(data){
if($('body.ascend').length > 0&&$that.parents('.carousel-wrap').attr('data-full-width')!='true'){
$that.parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($that.find('li').length / $that.triggerHandler("currentVisible").length));
}},
onAfter:function(data){
if($('body.ascend').length > 0&&$that.parents('.carousel-wrap').attr('data-full-width')!='true'){
$that.parents('.carousel-wrap').find('.item-count .current').html($that.triggerHandler('currentPage') +1);
$that.parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($that.find('li').length / $that.triggerHandler("currentVisible").length));
}}
},
prev:{
button:function(){
return $that.parents('.carousel-wrap').find('.carousel-prev');
}},
next:{
button:function(){
return $that.parents('.carousel-wrap').find('.carousel-next');
}},
auto:{
play: $autoplayBool
}}, { transition: true }).animate({'opacity': 1},1300);
$that.parents('.carousel-wrap').wrap('');
if($that.parents('.carousel-wrap').attr('data-full-width')=='true') $that.parents('.carousel-outer').css('overflow','visible');
if($('body.ascend').length > 0&&$that.parents('.carousel-wrap').attr('data-full-width')!='true'){
$('
1 /'+$that.find('li').length / $that.triggerHandler("currentVisible").length +'
').insertAfter($that.parents('.carousel-wrap').find('.carousel-prev'));
}
$that.addClass('finished-loading');
carouselHeightCalcs();
if(!$('body').hasClass('mobile')&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
$(".portfolio-items.carousel .work-item.style-3 img").panr({
scaleDuration: .28
});
$(".portfolio-items:not(.carousel) .work-item.style-3-alt img").panr({ scaleDuration: .28, sensitivity: 12.6, scaleTo: 1.08, panDuration: 3 });
}});
});
}
if($('.carousel').length > 0) standardCarouselInit();
function productCarouselInit(){
$('.products-carousel').each(function(){
var $that=$(this).find('ul');
var maxCols='auto';
var scrollNum='auto';
var colWidth=($(this).parents('.full-width-content ').length > 0) ? 400:353 ;
var scrollSpeed=800;
var easing='easeInOutQuart';
var $element=$that;
if($that.find('img').length==0) $element=$('body');
$(this).append('
')
imagesLoaded($element,function(instance){
$that.carouFredSel({
circular: true,
responsive: true,
items:{
width:colWidth,
visible:{
min:1,
max:maxCols
}},
swipe:{
onTouch:true,
onMouse:true,
options:{
excludedElements: "button, input, select, textarea, .noSwipe",
tap: function(event, target){
if($(target).attr('href')&&!$(target).is('[target="_blank"]')&&!$(target).hasClass('add_to_wishlist')&&!$(target).hasClass('add_to_cart_button')&&!$(target).is('[rel^="prettyPhoto"]'))
window.open($(target).attr('href'), '_self');
if($(target).parent().attr('href')&&!$(target).parent().is('[target="_blank"]')&&!$(target).parent().hasClass('add_to_wishlist')&&!$(target).parent().hasClass('add_to_cart_button')&&!$(target).parent().is('[rel^="prettyPhoto"]'))
window.open($(target).parent().attr('href'), '_self');
}},
onBefore:function(){
$that.find('.product-wrap').trigger('mouseleave');
$that.find('.product a').trigger('mouseup');
}},
scroll: {
items:scrollNum,
easing:easing,
duration:scrollSpeed
},
prev:{
button:function(){
return $that.parents('.carousel-wrap').find('.carousel-prev');
}},
next:{
button:function(){
return $that.parents('.carousel-wrap').find('.carousel-next');
}},
auto:{
play: false
}}).animate({'opacity': 1},1300);
$that.parents('.carousel-wrap').wrap('
');
$that.addClass('finished-loading');
fullWidthContentColumns();
$(window).trigger('resize');
});
});
}
if($('.products-carousel').length > 0) productCarouselInit();
function fwCarouselLinkFix(){
var $mousePosStart=0;
var $mousePosEnd=0;
$('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mousedown(function(e){
$mousePosStart=e.clientX;
});
$('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mouseup(function(e){
$mousePosEnd=e.clientX;
});
$('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').click(function(e){
if(Math.abs($mousePosStart - $mousePosEnd) > 10) return false;
});
}
fwCarouselLinkFix();
function carouselHeightCalcs(){
$('.carousel.portfolio-items.finished-loading').each(function(){
var bottomSpace=($(this).parents('.carousel-wrap').attr('data-full-width')=='true'&&$(this).find('.style-2, .style-3, .style-4').length > 0) ? 0:28 ;
var tallestMeta=0;
$(this).find('> li').each(function(){
($(this).find('.work-meta').height() > tallestMeta) ? tallestMeta=$(this).find('.work-meta').height():tallestMeta=tallestMeta;
});
$(this).parents('.caroufredsel_wrapper').css({
'height':($(this).find('.work-item').outerHeight() + tallestMeta + bottomSpace -2) + 'px'
});
if($('body.ascend').length > 0&&$(this).parents('.carousel-wrap').attr('data-full-width')!='true'){
$(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler("currentPosition")+1)/$(this).triggerHandler("currentVisible").length));
$(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('li').length / $(this).triggerHandler("currentVisible").length));
}});
$('.carousel.finished-loading:not(".portfolio-items, .clients"), .caroufredsel_wrapper .products.finished-loading').each(function(){
var tallestColumn=0;
$(this).find('> li').each(function(){
($(this).height() > tallestColumn) ? tallestColumn=$(this).height():tallestColumn=tallestColumn;
});
$(this).css('height',tallestColumn + 5);
$(this).parents('.caroufredsel_wrapper').css('height',tallestColumn + 5);
if($('body.ascend').length > 0&&$(this).parents('.carousel-wrap').attr('data-full-width')!='true'){
$(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler("currentPosition")+1)/$(this).triggerHandler("currentVisible").length));
$(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('li').length / $(this).triggerHandler("currentVisible").length));
}});
}
function clientsCarouselInit(){
$('.carousel.clients').each(function(){
var $that=$(this);
var columns;
var $autoRotate=(!$(this).hasClass('disable-autorotate')) ? true:false;
(parseInt($(this).attr('data-max'))) ? columns=parseInt($(this).attr('data-max')):columns=5;
if($(window).width() < 690&&$('body').attr('data-responsive')=='1'){ columns=2; $(this).addClass('phone') }
var $element=$that;
if($that.find('img').length==0) $element=$('body');
imagesLoaded($element,function(instance){
$that.carouFredSel({
circular: true,
responsive: true,
items:{
height:$that.find('> div:first').height(),
width:$that.find('> div:first').width(),
visible:{
min:1,
max:columns
}},
swipe:{
onTouch:true,
onMouse:true
},
scroll: {
items:1,
easing:'easeInOutCubic',
duration:'800',
pauseOnHover:true
},
auto:{
play:$autoRotate,
timeoutDuration:2700
}}).animate({'opacity': 1},1300);
$that.addClass('finished-loading');
$that.parents('.carousel-wrap').wrap('
');
$(window).trigger('resize');
});
});
}
if($('.carousel').length > 0) clientsCarouselInit();
function clientsCarouselHeightRecalc(){
var tallestImage=0;
$('.carousel.clients.finished-loading').each(function(){
$(this).find('> div').each(function(){
($(this).height() > tallestImage) ? tallestImage=$(this).height():tallestImage=tallestImage;
});
$(this).css('height',tallestImage);
$(this).parent().css('height',tallestImage);
});
}
function carouselfGrabbingClass(){
$('body').on('mousedown','.caroufredsel_wrapper, .carousel-wrap[data-full-width="true"] .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a',function(){
$(this).addClass('active');
});
$('body').on('mouseup','.caroufredsel_wrapper, .carousel-wrap[data-full-width="true"] .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a',function(){
$(this).removeClass('active');
});
}
carouselfGrabbingClass();
$('body.ascend').on('mouseover','.carousel-next',function(){
$(this).parent().find('.carousel-prev, .item-count').addClass('next-hovered');
});
$('body.ascend').on('mouseleave','.carousel-next',function(){
$(this).parent().find('.carousel-prev, .item-count').removeClass('next-hovered');
});
function clientsFadeIn(){
$('.clients.fade-in-animation').each(function(){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
$that.find('> div').each(function(i){
$(this).delay(i*80).transition({'opacity':"1"},450);
});
setTimeout(function(){ $that.addClass('completed'); },($that.find('> div').length*80) + 450);
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
});
}
if($('.nectar-box-roll').length==0) clientsFadeIn();
jQuery.fn.setCursorPosition=function(position){
if(this.lengh==0) return this;
return $(this).setSelection(position, position);
}
jQuery.fn.setSelection=function(selectionStart, selectionEnd){
if(this.lengh==0) return this;
input=this[0];
if(input.createTextRange){
var range=input.createTextRange();
range.collapse(true);
range.moveEnd('character', selectionEnd);
range.moveStart('character', selectionStart);
range.select();
}else if(input.setSelectionRange){
input.focus();
input.setSelectionRange(selectionStart, selectionEnd);
}
return this;
}
$.extend($.expr[':'], {
transparent: function(elem, i, attr){
return($(elem).css("opacity")==="0");
}});
function getQueryParams(qs){
qs=qs.split("+").join(" ");
var params={},
tokens,
re=/[?&]?([^=]+)=([^&]*)/g;
while (tokens=re.exec(qs)){
params[decodeURIComponent(tokens[1])]
= decodeURIComponent(tokens[2]);
}
return params;
}
var $_GET=getQueryParams(document.location.search);
$.fn.countTo=function (options){
options=options||{};
return $(this).each(function (){
var settings=$.extend({}, $.fn.countTo.defaults, {
from: $(this).data('from'),
to: $(this).data('to'),
speed: $(this).data('speed'),
refreshInterval: $(this).data('refresh-interval'),
decimals: $(this).data('decimals')
}, options);
var loops=Math.ceil(settings.speed / settings.refreshInterval),
increment=(settings.to - settings.from) / loops;
var self=this,
$self=$(this),
loopCount=0,
value=settings.from,
data=$self.data('countTo')||{};
$self.data('countTo', data);
if(data.interval){
clearInterval(data.interval);
}
data.interval=setInterval(updateTimer, settings.refreshInterval);
render(value);
function updateTimer(){
value +=increment;
loopCount++;
render(value);
if(typeof(settings.onUpdate)=='function'){
settings.onUpdate.call(self, value);
}
if(loopCount >=loops){
$self.removeData('countTo');
clearInterval(data.interval);
value=settings.to;
if(typeof(settings.onComplete)=='function'){
settings.onComplete.call(self, value);
}}
}
function render(value){
var formattedValue=settings.formatter.call(self, value, settings);
$self.html(formattedValue);
}});
};
$.fn.countTo.defaults={
from: 0,
to: 0,
speed: 1000,
refreshInterval: 100,
decimals: 0,
formatter: formatter,
onUpdate: null,
onComplete: null
};
function formatter(value, settings){
return value.toFixed(settings.decimals);
}
function milestoneInit(){
$('.nectar-milestone').each(function(){
if($(this).is('[data-symbol]')){
if($(this).attr('data-symbol-pos')=='before'){
$(this).find('.number').prepend('
' + $(this).attr('data-symbol') + '
');
}else{
$(this).find('.number').append('
' + $(this).attr('data-symbol') + '
');
}
$symbol_size=($(this).attr('data-symbol-size')==$(this).find('.number').attr('data-number-size')&&$(this).attr('data-symbol-alignment')=='superscript') ? 32:parseInt($(this).attr('data-symbol-size'));
$(this).find('.symbol-wrap').css({'font-size': $symbol_size + 'px', 'line-height': $symbol_size + 'px'});
}
$(this).find('.number').css({'font-size': $(this).find('.number').attr('data-number-size') +'px', 'line-height': $(this).find('.number').attr('data-number-size') + 'px'});
});
if(!$('body').hasClass('mobile')){
var $blurCssString='';
$('.nectar-milestone.motion_blur').each(function(i){
$(this).addClass('instance-'+i);
var $currentColor=$(this).find('.number').css('color');
var colorInt=parseInt($currentColor.substring(1),16);
var R=(colorInt & 0xFF0000) >> 16;
var G=(colorInt & 0x00FF00) >> 8;
var B=(colorInt & 0x0000FF) >> 0;
var $rgbaColorStart='rgba('+R+','+G+','+B+',0.2)';
var $rgbaColorEnd='rgba('+R+','+G+','+B+',1)';
var $numberSize=parseInt($(this).find('.number').attr('data-number-size'));
$blurCssString +='@keyframes motion-blur-number-'+i+' { ' +
' 0% { '+
'opacity: 0;'+
'color: '+$rgbaColorStart+'; '+
'text-shadow: 0 '+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/4+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/4+'px 0 '+$rgbaColorStart+'; '+
'transform: translateZ(0px) translateY(-100%); '+
'-webkit-transform: translateZ(0px) translateY(-100%); '+
'} '+
'33% { opacity: 1 }' +
'100% { '+
'color: '+$rgbaColorEnd+'; '+
'text-shadow: none; '+
'transform: translateZ(0px) translateY(0px); '+
'-webkit-transform: translateZ(0px) translateY(0px); '+
'} '+
'} '+
'@-webkit-keyframes motion-blur-number-'+i+' { ' +
' 0% { '+
'opacity: 0;'+
'color: '+$rgbaColorStart+'; '+
'text-shadow: 0 '+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/4+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/4+'px 0 '+$rgbaColorStart+'; '+
'transform: translateZ(0px) translateY(-100%); '+
'-webkit-transform: translateZ(0px) translateY(-100%); '+
'} '+
'33% { opacity: 1 }' +
'100% { '+
'color: '+$rgbaColorEnd+'; '+
'text-shadow: none; '+
'transform: translateZ(0px) translateY(0px); '+
'-webkit-transform: translateZ(0px) translateY(0px); '+
'} '+
'} '+
'.nectar-milestone.motion_blur.instance-'+i+' .number span.in-sight { animation: 0.65s cubic-bezier(0, 0, 0.17, 1) 0s normal backwards 1 motion-blur-number-'+i+'; -webkit-animation: 0.65s cubic-bezier(0, 0, 0.17, 1) 0s normal backwards 1 motion-blur-number-'+i+'; } ';
$symbol=$(this).find('.symbol-wrap').clone();
$(this).find('.symbol-wrap').remove();
var characters=$(this).find('.number').text().split("");
$this=$(this).find('.number');
$this.empty();
$.each(characters, function (i, el){
$this.append("
" + el + " 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
var $endNum=parseInt($that.find('.number span:not(.symbol)').text());
if(!$that.hasClass('motion_blur')){
$that.find('.number span:not(.symbol)').countTo({
from: 0,
to: $endNum,
speed: 1500,
refreshInterval: 30
});
}else{
$that.find('span').each(function(i){
var $that=$(this);
setTimeout(function(){ $that.addClass('in-sight'); },200*i);
});
}
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
});
}
var $animationOnScrollTimeOut=($('.nectar-box-roll').length > 0) ? 850: 125;
if($('.nectar-box-roll').length==0) setTimeout(function(){ milestoneInit(); },125);
$tabbedClickCount=0;
$('body').on('click','.tabbed > ul li:not(.cta-button) a',function(){
var $id=$(this).parents('li').index()+1;
if(!$(this).hasClass('active-tab')&&!$(this).hasClass('loading')){
$(this).parents('ul').find('a').removeClass('active-tab');
$(this).addClass('active-tab');
$(this).parents('.tabbed').find('> div:not(.clear)').css({'visibility':'hidden','position':'absolute','opacity':'0','left':'-9999px','display':'none'});
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').css({'visibility':'visible', 'position':'relative','left':'0','display':'block'}).stop().transition({'opacity':1},300);
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+') .iframe-embed').length > 0||$(this).parents('.tabbed').find('> div:nth-of-type('+$id+') .portfolio-items').length > 0) setTimeout(function(){ $(window).resize(); },10);
}
if($tabbedClickCount!=0){
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-progress-bar').length > 0)
progressBars();
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('img.img-with-animation').length > 0 ||
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.col.has-animation').length > 0 ||
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.wpb_column.has-animation').length > 0)
colAndImgAnimations();
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-milestone').length > 0)
milestoneWaypoint();
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-fancy-ul').length > 0)
nectar_fancy_ul_init();
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-split-heading').length > 0)
splitLineHeadings();
if($(this).parents('.wpb_row').length > 0){
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.vc_pie_chart').length > 0 ||
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.wp-video-shortcode').length > 0 ||
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.twentytwenty-container').length > 0 ||
$(this).parents('.wpb_row').next().hasClass('parallax_section'))
$(window).trigger('resize');
}}
$(this).parents('.tabbed').find('.wpb_row').each(function(){
if(typeof $(this).find('[class*="vc_col-"]').first().offset()!='undefined'){
var $firstChildOffset=$(this).find('[class*="vc_col-"]').first().offset().left;
$(this).find('[class*="vc_col-"]').each(function(){
$(this).removeClass('no-left-margin');
if($(this).offset().left < $firstChildOffset + 15){
$(this).addClass('no-left-margin');
}else{
$(this).removeClass('no-left-margin');
}});
}});
$tabbedClickCount++;
return false;
});
function tabbedInit(){
$('.tabbed').each(function(){
if($(this).find('.swiper-container').length==0&&$(this).find('.testimonial_slider').length==0&&$(this).find('.portfolio-items:not(".carousel")').length==0&&$(this).find('.wpb_gallery .portfolio-items').length==0&&$(this).find('iframe').length==0){
$(this).find('> ul li:first-child a').click();
}
if($(this).find('.testimonial_slider').length > 0||$(this).find('.portfolio-items:not(".carousel")').length > 0||$(this).find('.wpb_gallery .portfolio-items').length > 0||$(this).find('iframe').length > 0){
var $that=$(this);
$(this).find('.wpb_tab').show().css({'opacity':0,'height':'1px'});
$(this).find('> ul li a').addClass('loading');
setTimeout(function(){
$that.find('.wpb_tab').hide().css({'opacity':1,'height':'auto'});
$that.find('> ul li a').removeClass('loading');
$that.find('> ul li:first-child a').click();
},900);
}});
}
tabbedInit();
function tabbbedDeepLinking(){
if(typeof $_GET['tab']!='undefined'){
$('.wpb_tabs_nav').each(function(){
$(this).find('li').each(function(){
var $currentText=$(this).find('a').text();
var $getText=$_GET['tab'];
var $that=$(this);
$currentText=$currentText.replace(/\s+/g, '-').toLowerCase();
$getText=$getText.replace(/\s+/g, '-').replace(/ div').slideToggle(300);
$(this).parents('.toggle').toggleClass('open');
if($(this).parents('.toggle').hasClass('open')){
$(this).find('i').attr('class','icon-minus-sign');
}else{
$(this).find('i').attr('class','icon-plus-sign');
}
if($(this).parents('.toggle').find('> div .iframe-embed').length > 0&&$(this).parents('.toggle').find('> div .iframe-embed iframe').height()=='0') responsiveVideoIframes();
if($(this).parents('.full-width-content').length > 0) setTimeout(function(){ fullWidthContentColumns(); },300);
return false;
}});
$('body').on('click','.accordion .toggle h3 a', function(){
if($(this).parents('.toggle').hasClass('open')) return false;
$(this).parents('.toggles').find('.toggle > div').slideUp(300);
$(this).parents('.toggles').find('.toggle h3 a i').attr('class','icon-plus-sign');
$(this).parents('.toggles').find('.toggle').removeClass('open');
$(this).parents('.toggle').find('> div').slideDown(300);
$(this).parents('.toggle').addClass('open');
if($(this).parents('.toggle').hasClass('open')){
$(this).find('i').attr('class','icon-minus-sign');
}else{
$(this).find('i').attr('class','icon-plus-sign');
}
if($(this).parents('.full-width-content').length > 0){
clearTimeout($t);
var $t=setTimeout(function(){ fullWidthContentColumns(); },400);
}
return false;
});
function accordionInit(){
$('.accordion').each(function(){
$(this).find('> .toggle').first().addClass('open').find('> div').show();
$(this).find('> .toggle').first().find('a i').attr('class','icon-minus-sign');
});
$('.toggles').each(function(){
var $isAccordion=($(this).hasClass('accordion')) ? true:false;
$(this).find('.toggle').each(function(){
if($(this).find('> div .testimonial_slider').length > 0||$(this).find('> div iframe').length > 0){
var $that=$(this);
$(this).find('> div').show().css({'opacity':0,'height':'1px', 'padding':'0'});
testimonialHeightResize();
setTimeout(function(){
$that.find('> div').hide().css({'opacity':1,'height':'auto', 'padding':'10px 14px'});
if($isAccordion==true&&$that.index()==0) $that.find('> div').slideDown(300);
},900);
}});
})
}
accordionInit();
function accordionDeepLinking(){
if(typeof $_GET['toggle']!='undefined'){
$('.toggles').each(function(){
$(this).find('.toggle').each(function(){
var $currentText=$(this).find('h3 a').clone();
var $getText=$_GET['toggle'];
$($currentText).find('i').remove();
$currentText=$currentText.text();
$currentText=$currentText.replace(/\s+/g, '-').toLowerCase();
$getText=$getText.replace(/\s+/g, '-').replace(/ 0)
var $color='#000000';
else
var $color='#ffffff';
}
if(!$(this).hasClass('see-through-3')) $(this).css('color',$color);
$(this).find('i').css('color',$color);
var colorInt=parseInt($color.substring(1),16);
var $hoverColor=($(this).has('[data-hover-color-override]')) ? $(this).attr('data-hover-color-override'):'no-override';
var $hoverTextColor=($(this).has('[data-hover-text-color-override]')) ? $(this).attr('data-hover-text-color-override'):'#fff';
var R=(colorInt & 0xFF0000) >> 16;
var G=(colorInt & 0x00FF00) >> 8;
var B=(colorInt & 0x0000FF) >> 0;
$opacityStr=($(this).hasClass('see-through-3')) ? '1': '0.75';
$(this).css('border-color','rgba('+R+','+G+','+B+','+$opacityStr+')');
if($(this).hasClass('see-through')){
$(this).hover(function(){
$(this).css('border-color','rgba('+R+','+G+','+B+',1)');
},function(){
$(this).css('border-color','rgba('+R+','+G+','+B+','+$opacityStr+')');
});
}else{
$(this).find('i').css('color', $hoverTextColor);
if($hoverColor!='no-override'){
$(this).hover(function(){
$(this).css({
'border-color': $hoverColor,
'background-color': $hoverColor,
'color': $hoverTextColor
});
},function(){
$opacityStr=($(this).hasClass('see-through-3')) ? '1': '0.75';
if(!$(this).hasClass('see-through-3')){
$(this).css({
'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
'background-color': 'transparent',
'color': $color
});
}else{
$(this).css({
'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
'background-color': 'transparent'
});
}});
}else{
$(this).hover(function(){
$(this).css({
'border-color': $hoverColor,
'color': $hoverTextColor
});
},function(){
$opacityStr=($(this).hasClass('see-through-3')) ? '1': '0.75';
$(this).css({
'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
'color': $hoverTextColor
});
});
}}
});
$('.nectar-button:not(.see-through):not(.see-through-2):not(.see-through-3)[data-color-override]').each(function(){
$(this).css('visibility','visible');
if($(this).attr('data-color-override')!='false'){
var $color=$(this).attr('data-color-override');
$(this).removeClass('accent-color').removeClass('extra-color-1').removeClass('extra-color-2').removeClass('extra-color-3');
$(this).css('background-color',$color);
}});
if($('.swiper-slide .solid_color_2').length > 0||$('.tilt-button-inner').length > 0){
var $tiltButtonCssString='';
$('.swiper-slide .solid_color_2 a').each(function(i){
$(this).addClass('instance-'+i);
if($(this).attr('data-color-override')!='false'){
var $color=$(this).attr('data-color-override');
}else{
if($(this).parents('.dark').length > 0)
var $color='#000000';
else
var $color='#ffffff';
}
$(this).css('color',$color);
$(this).find('i').css('color',$color);
var $currentColor=$(this).css('background-color');
var $topColor=shadeColor($currentColor, 0.13);
var $bottomColor=shadeColor($currentColor, -0.15);
$tiltButtonCssString +='.swiper-slide .solid_color_2 a.instance-'+i + ':after { background-color: '+$topColor+'; }' + ' .swiper-slide .solid_color_2 a.instance-'+i + ':before { background-color: '+$bottomColor+'; } ';
});
$('.tilt-button-wrap a').each(function(i){
$(this).addClass('instance-'+i);
var $currentColor=$(this).css('background-color');
if($(this).attr('data-color-override')!='false'){
var $color=$(this).attr('data-color-override');
$(this).css('background-color',$color);
$currentColor=$color;
}
var $topColor=shadeColor($currentColor, 0.13);
var $bottomColor=shadeColor($currentColor, -0.15);
$tiltButtonCssString +='.tilt-button-wrap a.instance-'+i + ':after { background-color: '+$topColor+'; }' + ' .tilt-button-wrap a.instance-'+i + ':before { background-color: '+$bottomColor+'; } ';
});
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=$tiltButtonCssString;
}else{
style.appendChild(document.createTextNode($tiltButtonCssString));
}
head.appendChild(style);
}}
coloredButtons();
function largeIconHover(){
$('.icon-3x').each(function(){
$(this).closest('.col').hover(function(){
$(this).find('.icon-3x').addClass('hovered')
},function(){
$('.icon-3x').removeClass('hovered')
});
});
}
largeIconHover();
function columnBGColors(){
var $columnColorCSS='';
$('.wpb_column').each(function(i){
$(this).addClass('instance-'+i);
if($(this).attr('data-has-bg-color')=='true'){
if($(this).is('[data-animation*="reveal"]')&&$(this).hasClass('has-animation'))
$columnColorCSS +='.wpb_column.instance-'+i+ ' .column-inner-wrap .column-inner:before { background-color:' + $(this).attr('data-bg-color') + '; opacity: '+$(this).attr('data-bg-opacity')+'; }';
else
$columnColorCSS +='.wpb_column.instance-'+i+ ':before { background-color:' + $(this).attr('data-bg-color') + '; opacity: '+$(this).attr('data-bg-opacity')+'; }';
}
if($(this).is('[data-hover-bg^="#"]')){
if($(this).is('[data-animation*="reveal"]')&&$(this).hasClass('has-animation'))
$columnColorCSS +='.wpb_column.instance-'+i+ ':hover .column-inner:before { background-color: '+$(this).attr('data-hover-bg') + '; opacity: '+$(this).attr('data-hover-bg-opacity')+'; }';
else
$columnColorCSS +='.wpb_column.instance-'+i+ ':hover:before { background-color: '+$(this).attr('data-hover-bg') + '; opacity: '+$(this).attr('data-hover-bg-opacity')+'; }';
}});
if($columnColorCSS.length > 1){
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=$columnColorCSS;
}else{
style.appendChild(document.createTextNode($columnColorCSS));
}
head.appendChild(style);
}}
columnBGColors();
function rowColorOverlay(){
var $rowOverlayCSS='';
$('.row > .wpb_row > .row-bg-wrap > .row-bg[data-color_overlay], #portfolio-extra > .wpb_row > .row-bg-wrap > .row-bg[data-color_overlay], .single #post-area .content-inner > .wpb_row > .row-bg-wrap > .row-bg[data-color_overlay]').each(function(i){
$(this).parent().addClass('instance-'+i);
$overlayOpacity=($(this).attr('data-overlay_strength').length > 0) ? $(this).attr('data-overlay_strength'):'1';
$overlay1=($(this).attr('data-color_overlay').length > 0) ? $(this).attr('data-color_overlay'):'transparent';
$overlay2=($(this).attr('data-color_overlay_2').length > 0) ? $(this).attr('data-color_overlay_2'):'transparent';
$gradientDirection=($(this).attr('data-gradient_direction').length > 0) ? $(this).attr('data-gradient_direction'):'left_t_right';
switch($gradientDirection){
case 'left_to_right' :
var $gradientDirectionDeg='90deg';
break;
case 'left_t_to_right_b' :
var $gradientDirectionDeg='135deg';
break;
case 'left_b_to_right_t' :
var $gradientDirectionDeg='45deg';
break;
case 'top_to_bottom' :
var $gradientDirectionDeg='to bottom';
break;
}
$enableGradient=($(this).attr('data-enable_gradient')=='true') ? true:false;
if($enableGradient){
if($overlay1=='#ffffff'&&$overlay2=='transparent') $overlay2='rgba(255,255,255,0.001)';
if($overlay1=='transparent'&&$overlay2=='#ffffff') $overlay1='rgba(255,255,255,0.001)';
if($gradientDirection=='top_to_bottom'){
if($overlay2=='transparent'||$overlay2=='rgba(255,255,255,0.001)') $rowOverlayCSS +='.row-bg-wrap.instance-'+i+ ':after { background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 0%,' + $overlay2 + ' 75%); opacity: '+$overlayOpacity+'; }';
if($overlay1=='transparent'||$overlay1=='rgba(255,255,255,0.001)') $rowOverlayCSS +='.row-bg-wrap.instance-'+i+ ':after { background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 25%,' + $overlay2 + ' 100%); opacity: '+$overlayOpacity+'; }';
if($overlay1!='transparent'&&$overlay2!='transparent') $rowOverlayCSS +='.row-bg-wrap.instance-'+i+ ':after { background: '+$overlay1+'; background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 0%,' + $overlay2 + ' 100%); opacity: '+$overlayOpacity+'; }';
} else
$rowOverlayCSS +='.row-bg-wrap.instance-'+i+ ':after { background: '+$overlay1+'; background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 0%,' + $overlay2 + ' 100%); opacity: '+$overlayOpacity+'; }';
}else{
if($(this).attr('data-color_overlay').length > 0){
$rowOverlayCSS +='.row-bg-wrap.instance-'+i+ ':after { background-color:' + $overlay1 + '; opacity: '+$overlayOpacity+'; }';
}}
});
if($rowOverlayCSS.length > 1){
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=$rowOverlayCSS;
}else{
style.appendChild(document.createTextNode($rowOverlayCSS));
}
head.appendChild(style);
}}
rowColorOverlay();
function morphingOutlines(){
if($('.morphing-outline').length > 0){
$morphingOutlineCSS='';
$('.morphing-outline').each(function(i){
$(this).addClass('instance-'+i).css({'visibility':'visible'});
var $width=$(this).find('.inner').width();
var $height=$(this).find('.inner').height();
var $border=parseInt($(this).attr("data-border-thickness"));
var $hover=($('body[data-button-style="rounded"]').length > 0) ? ':hover': '';
var $hover2=($('body[data-button-style="rounded"]').length > 0) ? '': ':hover';
$morphingOutlineCSS +='body .morphing-outline.instance-'+i+' .inner > * { color: '+$(this).attr("data-starting-color")+'; } ';
$morphingOutlineCSS +='body .morphing-outline.instance-'+i+' .inner:after { border-width:'+$(this).attr("data-border-thickness")+'px ; border-color: '+$(this).attr("data-starting-color")+'; } ';
$morphingOutlineCSS +='body .wpb_column:hover > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner > * { color: '+$(this).attr("data-hover-color")+'; } ';
$morphingOutlineCSS +='body .wpb_column:hover > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { border-color: '+$(this).attr("data-hover-color")+'; } ';
$morphingOutlineCSS +='body .wpb_column'+$hover2+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { padding: '+(($width+100 + $border*2 - $height)/2 - $border) +'px 50px}';
$morphingOutlineCSS +='.morphing-outline.instance-'+i+' { padding: '+(30+($width+80 + $border*2 - $height)/2 - $border) +'px 50px}';
$morphingOutlineCSS +='body .wpb_column'+$hover2+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { top: -'+ parseInt((($width+100 + $border*2 - $height)/2 - $border) + $border)+ 'px }';
$morphingOutlineCSS +='body .wpb_column > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { left: -' + parseInt(50+$border) + 'px }';
$morphingOutlineCSS +='body .wpb_column'+$hover+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { padding: 50px 50px}';
$morphingOutlineCSS +='body .wpb_column'+$hover+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { top: -'+parseInt(50+$border) +'px }';
});
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
style.id='morphing-outlines';
if(style.styleSheet){
style.styleSheet.cssText=$morphingOutlineCSS;
}else{
style.appendChild(document.createTextNode($morphingOutlineCSS));
}
$('#morphing-outlines').remove();
head.appendChild(style);
}}
setTimeout(morphingOutlines,100);
setTimeout(fullWidthContentColumns,126);
function svgAnimations(){
var $icon=[];
$('.svg-icon-holder').each(function(i){
var $that=$(this);
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) $that.attr('data-animation','false');
$that.css({'height': parseInt($that.attr('data-size')) +'px', 'width': parseInt($that.attr('data-size')) +'px'});
$(this).attr('id','nectar-svg-animation-instance-'+i);
var $animationSpeed=($that.is('[data-animation-speed]')&&$that.attr('data-animation-speed').length > 0) ? $that.attr('data-animation-speed'):200;
if($that.attr('data-animation')=='false'){
$animationSpeed=1;
$that.css('opacity','1');
}
$icon[i]=new Vivus($that.attr('id'), {type: 'delayed', pathTimingFunction: Vivus.EASE_OUT, animTimingFunction: Vivus.LINEAR, duration: $animationSpeed, file: $that.text(), onReady: svgInit });
$that.find('span').remove();
if($animationSpeed!==1){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
checkIfReady();
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
}else{
checkIfReady();
}
function checkIfReady(){
var $animationDelay=($that.is('[data-animation-delay]')&&$that.attr('data-animation-delay').length > 0&&$that.attr('data-animation')!='false') ? $that.attr('data-animation-delay'):0;
if($icon[$that.attr('id').slice(-1)].isReady==true){
$that.css('opacity','1');
setTimeout(function(){ $icon[$that.attr('id').slice(-1)].reset().play(); },$animationDelay);
}else{
setTimeout(checkIfReady,50);
}}
function svgInit(){
$that.find('object').css({'height': parseInt($that.attr('data-size')) +'px', 'width': parseInt($that.attr('data-size')) +'px'});
$icon[$that.attr('id').slice(-1)].reset().stop();
var svgDoc=$that.find('object')[0].contentDocument;
var styleElement=svgDoc.createElementNS("http://www.w3.org/2000/svg", "style");
styleElement.textContent="svg, svg path { stroke: "+$that.css('color')+" }";
svgDoc.getElementById("Layer_1").appendChild(styleElement);
}});
}
if($('.nectar-box-roll').length==0||$('body.mobile').length > 0) setTimeout(svgAnimations,100);
function nectar_fancy_ul_init(){
$('.nectar-fancy-ul').each(function(){
var $icon=$(this).attr('data-list-icon');
var $color=$(this).attr('data-color');
var $animation=$(this).attr('data-animation');
if($(this).find('li i').length==0)
$(this).find('li').prepend('
');
if($animation=='true'){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
$that.find('li').each(function(i){
var $that=$(this);
$that.delay(i*220).transition({
'opacity': '1',
'left':'0'
},220,'easeOutCubic');
});
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
}});
}
setTimeout(function(){
if($('.nectar-box-roll').length==0) nectar_fancy_ul_init();
},$animationOnScrollTimeOut);
window.requestAnimationFrame=window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(f){setTimeout(f, 1000/60)}
var $window=$(window);
var windowHeight=$window.height();
$window.unbind('scroll.parallaxSections').unbind('resize.parallaxSections');
$window.unbind('resize.parallaxSectionsUpdateHeight');
$window.unbind('load.parallaxSectionsOffsetL');
$window.unbind('resize.parallaxSectionsOffsetR');
$window.on('resize.parallaxSectionsUpdateHeight',psUpdateWindowHeight);
function psUpdateWindowHeight(){
windowHeight=$window.height();
}
function psUpdateOffset($this){
$this.each(function(){
firstTop=$this.offset().top;
});
}
$.fn.parallaxScroll=function(xpos, speedFactor, outerHeight){
var $this=$(this);
var getHeight;
var firstTop;
var paddingTop=0;
$this.each(function(){
firstTop=$this.offset().top;
});
$window.on('resize.parallaxSectionsOffsetR',psUpdateOffset($this));
$window.on('load.parallaxSectionsOffsetL',psUpdateOffset($this));
getHeight=function(jqo){
return jqo.outerHeight(true);
};
if(arguments.length < 1||xpos===null) xpos="50%";
if(arguments.length < 2||speedFactor===null) speedFactor=0.1;
if(arguments.length < 3||outerHeight===null) outerHeight=true;
var $element, top, height, pos;
function update(){
pos=$window.scrollTop();
$this.each(function(){
firstTop=$this.offset().top;
$element=$(this);
top=$element.offset().top;
height=getHeight($element);
if(top + height < pos||top > pos + windowHeight){
return;
}
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
if(msie > 0||!!navigator.userAgent.match(/Trident.*rv\:11\./)||$smoothCache==true||navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1){
$this.find('.row-bg.using-image').css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px");
}else{
var $ifFast=($this.find('.row-bg[data-parallax-speed="fast"]').length > 0) ? ($element.find('.row-bg').height() - height)/2:0;
$this.find('.row-bg.using-image').addClass('translate').css({ 'transform': 'translate3d(0, ' + Math.round(((window.innerHeight + pos - firstTop) * speedFactor) -($ifFast)) + 'px, 0), scale(1.005)' });
}});
}
if(window.addEventListener){
window.addEventListener('scroll', function(){
requestAnimationFrame(update);
}, false);
}
$window.on('resize.parallaxSections',update);
update();
};
function fullWidthSections(){
var $scrollBar=($('#ascrail2000').length > 0&&window.innerWidth > 1000) ? -13:4;
if($('#boxed').length==1){
$justOutOfSight=((parseInt($('.container-wrap').width()) - parseInt($('.main-content').width())) / 2) + 4;
}else{
var $extResponsivePadding=($('body[data-ext-responsive="true"]').length > 0&&window.innerWidth >=1000) ? 180:0;
if($(window).width() <=parseInt($('.main-content').css('max-width'))){
var $windowWidth=parseInt($('.main-content').css('max-width'));
if($extResponsivePadding==180) $windowWidth=$windowWidth - $scrollBar;
}else{
var $windowWidth=$(window).width();
}
$contentWidth=parseInt($('.main-content').css('max-width'));
if($('body.single-post[data-ext-responsive="true"]').length > 0&&$('.container-wrap.no-sidebar').length > 0){
$contentWidth=$('#post-area').width();
$extResponsivePadding=0;
}
$justOutOfSight=Math.ceil((($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2))
}
$('.full-width-section').each(function(){
if(!$(this).parents('.span_9').length > 0&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'&&$(this).parent().attr('id')!='portfolio-extra' &&
!$(this).hasClass('non-fw')){
$(this).css({
'margin-left': - $justOutOfSight,
'padding-left': $justOutOfSight,
'padding-right': $justOutOfSight,
'visibility': 'visible'
});
}else if($(this).parent().attr('id')=='portfolio-extra'&&$('#full_width_portfolio').length!=0){
$(this).css({
'margin-left': - $justOutOfSight,
'padding-left': $justOutOfSight,
'padding-right': $justOutOfSight,
'visibility': 'visible'
});
}else{
$(this).css({
'margin-left': 0,
'padding-left': 0,
'padding-right': 0,
'visibility': 'visible'
});
}});
$('.carousel-outer').has('.carousel-wrap[data-full-width="true"]').css('overflow','visible');
$('.carousel-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"], .full-width-content').each(function(){
if($('#boxed').length==1){
if($('body.single-post[data-ext-responsive="true"]').length > 0&&$('.container-wrap.no-sidebar').length > 0&&$(this).parents('#post-area').length > 0){
$contentWidth=$('#post-area').width();
$extResponsivePadding=0;
$windowWidth=$(window).width();
$justOutOfSight=Math.ceil((($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2))
}else{
$justOutOfSight=((parseInt($('.container-wrap').width()) - parseInt($('.main-content').width())) / 2) + 4;
}}else{
if($('body.single-post[data-ext-responsive="true"]').length > 0&&$('.container-wrap.no-sidebar').length > 0&&$(this).parents('#post-area').length > 0){
$contentWidth=$('#post-area').width();
$extResponsivePadding=0;
$windowWidth=$(window).width();
}else{
if($(window).width() <=parseInt($('.main-content').css('max-width'))){
$windowWidth=parseInt($('.main-content').css('max-width'));
if($extResponsivePadding==180) $windowWidth=$windowWidth - $scrollBar;
}
$contentWidth=parseInt($('.main-content').css('max-width'));
$extResponsivePadding=($('body[data-ext-responsive="true"]').length > 0&&window.innerWidth >=1000) ? 180:0;
}
$justOutOfSight=Math.ceil((($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2))
}
$extraSpace=($(this).hasClass('carousel-wrap')) ? 1:4;
$carouselWidth=($('#boxed').length==1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2):$(window).width() +$extraSpace + $scrollBar ;
if($(this).parent().hasClass('default-style')){
if($('#boxed').length!=0){
$carouselWidth=($('#boxed').length==1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2):$(window).width() + $extraSpace + $scrollBar ;
}else{
$carouselWidth=($('#boxed').length==1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2):$(window).width() - ($(window).width()*.025) + $extraSpace + $scrollBar ;
$windowWidth=($(window).width() <=parseInt($('.main-content').width())) ? parseInt($('.main-content').width()):$(window).width() - ($(window).width()*.025);
$justOutOfSight=Math.ceil((($windowWidth + $scrollBar - parseInt($('.main-content').width())) / 2))
}}
else if($(this).parent().hasClass('spaced')){
if($('#boxed').length!=0){
$carouselWidth=($('#boxed').length==1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2) - ($(window).width()*.02):$(window).width() + $extraSpace + $scrollBar ;
}else{
$carouselWidth=($('#boxed').length==1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2):$(window).width() - Math.ceil($(window).width()*.02) + $extraSpace + $scrollBar ;
var $windowWidth2=($(window).width() <=parseInt($('.main-content').width())) ? parseInt($('.main-content').width()):$(window).width() - ($(window).width()*.02);
$justOutOfSight=Math.ceil((($windowWidth2 + $scrollBar - parseInt($('.main-content').width())) / 2) +2)
}}
if(!$(this).parents('.span_9').length > 0&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'&&$(this).parent().attr('id')!='portfolio-extra'
&& !$(this).find('.carousel-wrap[data-full-width="true"]').length > 0
&& !$(this).find('.portfolio-items:not(".carousel")[data-col-num="elastic"]').length > 0){
if($('.single-product').length > 0&&$(this).parents('#tab-description').length > 0&&$(this).parents('.full-width-tabs').length==0){
$(this).css({
'visibility': 'visible'
});
}else{
if($(this).hasClass('portfolio-items')){
$(this).css({
'transform': 'translateX(-'+ $justOutOfSight + 'px)',
'margin-left': 0,
'width': $carouselWidth,
'visibility': 'visible'
});
}else{
$(this).css({
'margin-left': - $justOutOfSight,
'width': $carouselWidth,
'visibility': 'visible'
});
}}
}else if($(this).parent().attr('id')=='portfolio-extra'&&$('#full_width_portfolio').length!=0){
$(this).css({
'margin-left': - $justOutOfSight,
'width': $carouselWidth,
'visibility': 'visible'
});
}else{
$(this).css({
'margin-left': 0,
'visibility': 'visible'
});
}});
}
var $contentElementsNum=($('#portfolio-extra').length==0) ? $('.main-content > .row > *').length:$('.main-content > .row #portfolio-extra > *').length ;
function parallaxSrollSpeed(speedString){
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
var speed;
if(msie > 0||!!navigator.userAgent.match(/Trident.*rv\:11\./)||$smoothCache==true||navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1){
switch(speedString){
case 'slow':
speed=0.2;
break;
case 'medium':
speed=0.4;
break;
case 'fast':
speed=0.6;
break;
}}else{
switch(speedString){
case 'slow':
speed=0.6;
break;
case 'medium':
speed=0.4;
break;
case 'fast':
speed=0.25;
break;
}}
return speed;
}
function parallaxScrollInit(){
parallaxRowsBGCals();
$('.full-width-section.parallax_section, .full-width-content.parallax_section').each(function(){
var $id=$(this).attr('id');
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
if(msie > 0||!!navigator.userAgent.match(/Trident.*rv\:11\./)||$smoothCache==true||navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1){
if($(this).find('[data-parallax-speed="fixed"]').length==0) $('#'+$id + ".parallax_section").parallaxScroll("50%", parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')));
}else if($(this).find('[data-parallax-speed="fixed"]').length==0){
$('#'+$id + ".parallax_section").parallaxScroll("50%", parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')));
}});
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
parallaxScrollInit();
$(window).load(parallaxRowsBGCals);
}
function parallaxRowsBGCals(){
$('.full-width-section.parallax_section, .full-width-content.parallax_section').each(function(){
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
if(msie > 0||!!navigator.userAgent.match(/Trident.*rv\:11\./)||$smoothCache==true||navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1){
$(this).find('.row-bg').css({'height': $(this).outerHeight(true)*2.8, 'margin-top': '-' + ($(this).outerHeight(true)*2.8)/2 + 'px' });
}else{
$(this).find('.row-bg').css({'height': Math.ceil($(window).height() * parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed'))) + $(this).outerHeight(true) });
}});
}
function fwsClasses(){
$('.wpb_wrapper > .nectar-slider-wrap[data-full-width="true"]').each(function(){
if(!$(this).parent().hasClass('span_9')&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'){
if($(this).parents('.wpb_row').index()=='0'){
$(this).addClass('first-nectar-slider');
}}
});
$contentElementsNum=($('#portfolio-extra').length==0) ? $('.main-content > .row > *').length:$('.main-content > .row #portfolio-extra > *').length ;
$('.full-width-section, .full-width-content:not(.page-submenu .full-width-content), .row > .nectar-slider-wrap[data-full-width="true"], .wpb_wrapper > .nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer, .portfolio-items[data-col-num="elastic"]').each(function(){
if(!$(this).parent().hasClass('span_9')&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'){
if($(this).parents('.wpb_row').length > 0){
if($(this).parents('#portfolio-extra').length > 0&&$('#full_width_portfolio').length==0) return false;
if($(this).parents('.wpb_row').index()=='0'&&$('#page-header-bg').length!=0||$(this).parents('.wpb_row').index()=='0'&&$('.parallax_slider_outer').length!=0){
}
else if($(this).parents('.wpb_row').index()=='0'&&$('#page-header-bg').length==0&&$('.page-header-no-bg').length==0
&& $('.project-title').length==0&&$(this).parents('.wpb_row').index()=='0'
&& $('.parallax_slider_outer').length==0&&$('.project-title').length==0
&& $('body[data-bg-header="true"]').length==0){
if($('body[data-header-resize="0"]').length==1&&$('.single').length==0){
$('.container-wrap').css('padding-top','0px');
}else{
$(this).css('margin-top','-70px').addClass('first-section');
}}
if($(this).parents('.wpb_row').index()==$contentElementsNum-1&&$('#respond').length==0){
if($(this).attr('id')!='portfolio-filters-inline'){
$('.container-wrap').css('padding-bottom','0px');
$('#call-to-action .triangle').remove();
}}
}else{
if($(this).parents('#portfolio-extra').length > 0&&$('#full_width_portfolio').length==0) return false;
if($(this).find('.portfolio-filters-inline').length==0&&$(this).attr('id')!='post-area'){
if($(this).index()=='0'&&$('#page-header-bg').length!=0||$(this).index()=='0'&&$('.parallax_slider_outer').length!=0){
}
else if($(this).index()=='0'&&$('#page-header-bg').length==0&&$(this).index()=='0'&&$('.page-header-no-bg').length==0 &&
$(this).index()=='0'&&$('.parallax_slider_outer').length==0&&!$(this).hasClass('blog_next_prev_buttons')){
if($('body[data-header-resize="0"]').length==1&&$('.single').length==0){
$('.container-wrap').css('padding-top','0px');
}else{
$(this).css('margin-top','-70px').addClass('first-section');
}}
if($(this).index()==$contentElementsNum-1&&$('#respond').length==0){
$('.container-wrap').css('padding-bottom','0px');
$('.bottom_controls').css('margin-top','0px');
$('#call-to-action .triangle').remove();
}}
}}
});
$('.full-width-section.wpb_row, .full-width-content.wpb_row').each(function(){
if(!$(this).parent().hasClass('span_9')&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'){
if($(this).parents('#portfolio-extra').length > 0&&$('#full_width_portfolio').length==0) return false;
if($(this).index()=='0'&&$('#page-header-bg').length==0&&$('.page-header-no-bg').length==0
&& $('.project-title').length==0&&$('body.single').length==0
&& $('.parallax_slider_outer').length==0&&$('.project-title').length==0){
$(this).addClass('first-section');
var $that=$(this);
setTimeout(function(){ $that.addClass('loaded'); },50);
}}
});
$('#portfolio-extra > .nectar-slider-wrap[data-full-width="true"], .portfolio-wrap').each(function(){
if($(this).index()==$contentElementsNum-1&&$('#commentform').length==0&&$('#pagination').length==0){
$(this).css('margin-bottom','-40px');
$('#call-to-action .triangle').remove();
}});
$('.portfolio-filters').each(function(){
if($(this).index()=='0'&&$('#page-header-bg').length!=0||$(this).index()=='0'&&$('.parallax_slider_outer').length!=0){
$(this).css({'margin-top':'-2.1em'}).addClass('first-section nder-page-header');
}else if($(this).index()=='0'&&$('#page-header-bg').length==0||$(this).index()=='0'&&$('.parallax_slider_outer').length==0){
$(this).css({'margin-top':'0px'}).addClass('first-section');
}});
$('.portfolio-filters-inline').each(function(){
if($(this).parents('.wpb_row').length > 0){
if($(this).parents('.wpb_row').index()=='0'&&$('#page-header-bg').length!=0||$(this).parents('.wpb_row').index()=='0'&&$('.parallax_slider_outer').length!=0){
if($('body[data-header-resize="0"]').length==0) $(this).css({'margin-top':'-2.1em', 'padding-top':'19px'}).addClass('first-section nder-page-header');
}else if($(this).parents('.wpb_row').index()=='0'&&$('#page-header-bg').length==0||$(this).parents('.wpb_row').index()=='0'&&$('.parallax_slider_outer').length==0){
if($('body[data-header-resize="0"]').length==1){
}else{
$(this).css({'margin-top':'-70px', 'padding-top':'50px'}).addClass('first-section');
}}
}else{
if($(this).index()=='0'&&$('#page-header-bg').length!=0||$(this).index()=='0'&&$('.parallax_slider_outer').length!=0){
$(this).css({'margin-top':'-2.1em', 'padding-top':'19px'}).addClass('first-section nder-page-header');
}else if($(this).index()=='0'&&$('#page-header-bg').length==0||$(this).index()=='0'&&$('.parallax_slider_outer').length==0){
if($('body[data-header-resize="0"]').length==1){
$(this).css({'margin-top':'-30px', 'padding-top':'50px'}).addClass('first-section');
}else{
$(this).css({'margin-top':'-70px', 'padding-top':'50px'}).addClass('first-section');
}}
}});
$('.parallax_slider_outer').each(function(){
if(!$(this).parent().hasClass('span_9')&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'){
if($(this).parents('#portfolio-extra').length > 0&&$('#full_width_portfolio').length==0) return false;
if($(this).parent().index()=='0'&&$('#page-header-bg').length!=0){
$(this).addClass('first-section nder-page-header');
}
else if($(this).parent().index()=='0'&&$('#page-header-bg').length==0){
$(this).css('margin-top','-40px').addClass('first-section');
if(!$('body').hasClass('single-post')) $('.container-wrap').css('padding-top', '0px');
}
if($(this).parent().index()==$contentElementsNum-1&&$('#post-area').length==0){
$('#call-to-action .triangle').remove();
$('.container-wrap').hide();
}}
});
}
fullWidthSections();
fwsClasses();
function fullwidthImgOnlySizingInit(){
$('.full-width-section:not(.custom-skip)').each(function(){
var $fwsHeight=$(this).outerHeight(true);
if($(this).find('.span_12 *').length==0&&$.trim($(this).find('.span_12').text()).length==0&&$fwsHeight > 40){
$(this).addClass('bg-only');
$(this).css({'height': $fwsHeight, 'padding-top': '0px', 'padding-bottom': '0px'});
$(this).attr('data-image-height',$fwsHeight);
}});
}
function fullwidthImgOnlySizing(){
$('.full-width-section.bg-only').each(function(){
var $initialHeight=$(this).attr('data-image-height');
if(window.innerWidth < 1000&&window.innerWidth > 690){
$(this).css('height', $initialHeight - $initialHeight*.60);
}
else if(window.innerWidth <=690){
$(this).css('height', $initialHeight - $initialHeight*.78);
}
else if(window.innerWidth < 1300&&window.innerWidth >=1000){
$(this).css('height', $initialHeight - $initialHeight*.33);
}else{
$(this).css('height', $initialHeight);
}});
}
fullwidthImgOnlySizingInit();
fullwidthImgOnlySizing();
function fullWidthRowPaddingAdjustInit(){
if($('#boxed').length==0){
$('.full-width-section, .full-width-content').each(function(){
var $topPadding=$(this)[0].style.paddingTop;
var $bottomPadding=$(this)[0].style.paddingBottom;
if($topPadding.indexOf("%") >=0) $(this).attr('data-top-percent',$topPadding);
if($bottomPadding.indexOf("%") >=0) $(this).attr('data-bottom-percent',$bottomPadding);
});
}}
function fullWidthRowPaddingAdjustCalc(){
if($('#boxed').length==0){
$('.full-width-section[data-top-percent], .full-width-section[data-bottom-percent], .full-width-content[data-top-percent], .full-width-content[data-bottom-percent]').each(function(){
var $windowHeight=$(window).width();
var $topPadding=($(this).attr('data-top-percent')) ? $(this).attr('data-top-percent'):'skip';
var $bottomPadding=($(this).attr('data-bottom-percent')) ? $(this).attr('data-bottom-percent'):'skip';
if($topPadding!='skip'){
$(this).css('padding-top',$windowHeight*(parseInt($topPadding)/100));
}
if($bottomPadding!='skip'){
$(this).css('padding-bottom',$windowHeight*(parseInt($bottomPadding)/100));
}});
}}
fullWidthRowPaddingAdjustInit();
fullWidthRowPaddingAdjustCalc();
function fullWidthContentColumns(){
$('.main-content > .row > .full-width-content, #portfolio-extra > .full-width-content, .woocommerce-tabs #tab-description > .full-width-content, #post-area.span_12 article .content-inner > .full-width-content').each(function(){
if($(this).find('> .span_12 > .col').length > 1){
var tallestColumn=0;
var $columnInnerHeight=0;
$(this).find('> .span_12 > .col').each(function(){
var $padding=parseInt($(this).css('padding-top'));
($(this).find('> .wpb_wrapper').height() + ($padding*2) > tallestColumn) ? tallestColumn=$(this).find('> .wpb_wrapper').height() + ($padding*2):tallestColumn=tallestColumn;
});
$(this).find('> .span_12 > .col').each(function(){
if($(this).find('> .wpb_wrapper > *').length > 0){
$(this).css('height',tallestColumn);
}else{
$(this).css('min-height',tallestColumn);
if($(this).is('[data-animation*="reveal"]')) $(this).find('.column-inner').css('min-height',tallestColumn);
}});
var $childRows=$(this).find('> .span_12 > .col .wpb_row').length;
if(window.innerWidth > 1000){
var $padding=parseInt($(this).find('> .span_12 > .col').css('padding-top'));
}else{
$(this).find('> .span_12 > .col .wpb_row .col').css('min-height','0px');
}
if($(this).hasClass('vertically-align-columns')&&window.innerWidth > 1000){
$(this).find('> .span_12 > .col').each(function(){
$columnInnerHeight=$(this).find('> .wpb_wrapper').height();
var $marginCalc=($(this).height()/2)-($columnInnerHeight/2);
if($marginCalc <=0) $marginCalc=0;
$(this).find('> .wpb_wrapper').css('margin-top',$marginCalc);
$(this).find('> .wpb_wrapper').css('margin-bottom',$marginCalc);
});
}}
});
}
fullWidthContentColumns();
function mouseParallaxInit(){
$('.wpb_row:has(.nectar-parallax-scene)').each(function(){
if($(this).hasClass('first-section')){
$('body #header-outer[data-transparent-header="true"] .ns-loading-cover').show();
if($('body #header-outer[data-transparent-header="true"]').length > 0){
$(this).css('overflow','hidden');
$(this).find('.nectar-slider-loading').css({
'top': $('#header-space').height(),
'margin-top':'-1px'
});
$(this).find('.nectar-slider-loading .loading-icon').css({
'height':$('.first-section .nectar-parallax-scene').height() - $('#header-space').height() + 'px',
'opacity':'1'
});
}}
var $strength=parseInt($(this).find('.nectar-parallax-scene').attr('data-scene-strength'));
$(this).find('.nectar-parallax-scene').parallax({
scalarX: $strength,
scalarY: $strength
});
var images=$(this).find('.nectar-parallax-scene li');
$.each(images, function(){
if($(this).find('div').length > 0){
var el=$(this).find('div'),
image=el.css('background-image').replace(/"/g, '').replace(/url\(|\)$/ig, '');
if(image&&image!==''&&image!=='none')
images=images.add($('
').attr('src', image));
}});
var $that=$(this);
images.imagesLoaded(function(){
$that.find('> .nectar-slider-loading').fadeOut(800,'easeInOutExpo');
if($that.hasClass('first-section')){
$('body #header-outer[data-transparent-header="true"] .ns-loading-cover').fadeOut(800,'easeInOutExpo',function(){
$(this).remove();
});
}});
});
}
mouseParallaxInit();
function ulChecks(){
$('ul.checks li').prepend('
');
}
ulChecks();
function colAndImgAnimations(){
$('img.img-with-animation').each(function(){
var $that=$(this);
var $animationEasing=($('body[data-cae]').length > 0) ? $('body').attr('data-cae'):'easeOutSine';
var $animationDuration=($('body[data-cad]').length > 0) ? $('body').attr('data-cad'):'650';
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)||$('body[data-responsive="0"]').length > 0){
if($that.attr('data-animation')=='fade-in-from-left'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'left':'0px'
},$animationDuration, $animationEasing);
}else if($that.attr('data-animation')=='fade-in-from-right'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'right':'0px'
},$animationDuration, $animationEasing);
}else if($that.attr('data-animation')=='fade-in-from-bottom'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'y':'0px'
},$animationDuration, $animationEasing);
}else if($that.attr('data-animation')=='fade-in'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1
},$animationDuration, $animationEasing);
}else if($that.attr('data-animation')=='grow-in'){
setTimeout(function(){
$that.transition({ scale: 1, 'opacity':1 },$animationDuration,'cubic-bezier(0.15, 0.84, 0.35, 1.25)');
},$that.attr('data-delay'));
}
else if($that.attr('data-animation')=='flip-in'){
setTimeout(function(){
$that.transition({ rotateY: 0, 'opacity':1 },$animationDuration, $animationEasing);
},$that.attr('data-delay'));
}
$that.addClass('animated-in');
}
waypoint.destroy();
},
offset: '85%'
});
});
$('.col.has-animation:not([data-animation*="reveal"]), .wpb_column.has-animation:not([data-animation*="reveal"])').each(function(){
var $that=$(this);
var $animationEasing=($('body[data-cae]').length > 0) ? $('body').attr('data-cae'):'easeOutSine';
var $animationDuration=($('body[data-cad]').length > 0) ? $('body').attr('data-cad'):'650';
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)||$('body[data-responsive="0"]').length > 0){
if($that.attr('data-animation')=='fade-in-from-left'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'left':'0px'
},$animationDuration,$animationEasing);
}else if($that.attr('data-animation')=='fade-in-from-right'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'right':'0px'
},$animationDuration,$animationEasing);
}else if($that.attr('data-animation')=='fade-in-from-bottom'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'y':'0px'
},$animationDuration,$animationEasing);
}else if($that.attr('data-animation')=='fade-in'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1
},$animationDuration,$animationEasing);
}else if($that.attr('data-animation')=='grow-in'){
setTimeout(function(){
$that.transition({ scale: 1, 'opacity':1 },$animationDuration,'cubic-bezier(0.15, 0.84, 0.35, 1.25)');
},$that.attr('data-delay'));
}else if($that.attr('data-animation')=='flip-in'){
setTimeout(function(){
$that.transition({ rotateY: 0, 'opacity':1 },$animationDuration, $animationEasing);
},$that.attr('data-delay'));
}
$that.addClass('animated-in');
}
waypoint.destroy();
},
offset: '85%'
});
});
$('.wpb_column.has-animation[data-animation*="reveal"]').each(function(){
var $that=$(this);
var $animationEasing=($('body[data-cae]').length > 0) ? $('body').attr('data-cae'):'easeOutSine';
var $animationDuration=($('body[data-cad]').length > 0) ? $('body').attr('data-cad'):'650';
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)||$('body[data-responsive="0"]').length > 0){
if($that.attr('data-animation')=='reveal-from-bottom'||$that.attr('data-animation')=='reveal-from-top'){
setTimeout(function(){
$that.find('.column-inner-wrap, .column-inner').transition({ 'y': 0 },$animationDuration, $animationEasing);
},$that.attr('data-delay'));
}else if($that.attr('data-animation')=='reveal-from-right'||$that.attr('data-animation')=='reveal-from-left'){
setTimeout(function(){
$that.find('.column-inner-wrap, .column-inner').transition({ 'x': 0 },$animationDuration, $animationEasing);
},$that.attr('data-delay'));
}
$that.addClass('animated-in');
}
waypoint.destroy();
},
offset: '70%'
});
});
}
setTimeout(function(){
if($('.nectar-box-roll').length==0) colAndImgAnimations();
},$animationOnScrollTimeOut);
function splitLineHeadings(){
$('.nectar-split-heading').each(function(){
var $that=$(this);
var $animationEasing=($('body[data-cae]').length > 0) ? $('body').attr('data-cae'):'easeOutSine';
var $animationDuration=($('body[data-cad]').length > 0) ? $('body').attr('data-cad'):'650';
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)||$('body[data-responsive="0"]').length > 0){
$that.find('.heading-line').each(function(i){
if($that.parents('.first-section').length > 0&&$('body[data-aie="zoom-out"]').length > 0) i=i+4;
$(this).find('> span').delay(i*70).transition({
'y':'0px'
},$animationDuration,$animationEasing);
});
$that.addClass('animated-in');
}
waypoint.destroy();
},
offset: 'bottom-in-view'
});
});
}
setTimeout(function(){ splitLineHeadings(); },100);
function oneFourthClasses(){
$('.col.span_3, .vc_span3, .vc_col-sm-3').each(function(){
var $currentDiv=$(this);
var $nextDiv=$(this).next('div');
if($nextDiv.hasClass('span_3')&&!$currentDiv.hasClass('one-fourths')||$nextDiv.hasClass('vc_span3')&&!$currentDiv.hasClass('one-fourths')||$nextDiv.hasClass('vc_col-sm-3')&&!$currentDiv.hasClass('one-fourths')){
$currentDiv.addClass('one-fourths clear-both');
$nextDiv.addClass('one-fourths right-edge');
}});
/*$('.vc_span4').each(function(){
if($(this).find('.team-member').length > 0&&$(this).parents('.full-width-content').length > 0){
var $currentDiv=$(this);
var $nextDiv=$(this).next('div');
if(!$currentDiv.hasClass('one-fourths')){
$currentDiv.addClass('one-fourths clear-both');
$nextDiv.addClass('one-fourths right-edge');
}}
});*/
$('.span_12 .col.span_6').each(function(){
if($(this).next('div').hasClass('span_6')&&$.trim($(this).next('div').html()).length==0){
$(this).addClass('empty-second')
}});
}
oneFourthClasses();
function progressBars(){
$('.nectar-progress-bar').parent().each(function(i){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('completed')){
waypoint.destroy();
return;
}
$that.find('.nectar-progress-bar').each(function(i){
var percent=$(this).find('span').attr('data-width');
var $endNum=parseInt($(this).find('span strong i').text());
var $that=$(this);
$that.find('span').delay(i*90).transition({
'width':percent + '%'
},1050, 'easeInOutQuint',function(){
});
setTimeout(function(){
$that.find('span strong i').countTo({
from: 0,
to: $endNum,
speed: 850,
refreshInterval: 30,
onComplete: function(){
}});
$that.find('span strong').transition({
'opacity':1
},550, 'easeInCirc');
}, (i*90));
if(percent=='100'){
$that.find('span strong').addClass('full');
}});
$that.addClass('completed');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
});
}
if($('.nectar-box-roll').length==0) progressBars();
var $tallestCol;
function pricingTableHeight(){
$('.pricing-table[data-style="default"]').each(function(){
$tallestCol=0;
$(this).find('> div ul').each(function(){
($(this).height() > $tallestCol) ? $tallestCol=$(this).height():$tallestCol=$tallestCol;
});
if($tallestCol==0) $tallestCol='auto';
$(this).find('> div ul').css('height',$tallestCol);
});
}
pricingTableHeight();
$('body').on('click','.testimonial_slider:not([data-style="multiple_visible"]) .controls li', function(){
if($(this).find('span').hasClass('active')) return false;
var $index=$(this).index();
var currentHeight=$(this).parents('.testimonial_slider').find('.slides blockquote').eq($index).height();
$(this).parents('.testimonial_slider').find('li span').removeClass('active');
$(this).find('span').addClass('active');
$(this).parents('.testimonial_slider').find('.slides blockquote').stop().css({'opacity':'0', 'left':'-25px', 'z-index': '1'});
$(this).parents('.testimonial_slider').find('.slides blockquote').eq($index).stop(true,true).animate({'opacity':'1','left':'0'},550,'easeOutCubic').css('z-index','20');
$(this).parents('.testimonial_slider:not(.disable-height-animation)').find('.slides').stop(true,true).animate({'height':currentHeight + 40 + 'px' },450,'easeOutCubic');
resizeVideoToCover();
});
var $tallestQuote;
function createTestimonialControls(){
$('.testimonial_slider:not([data-style="multiple_visible"])').animate({'opacity':'1'},800);
$('.testimonial_slider:not([data-style="multiple_visible"])').each(function(){
if($(this).find('blockquote').length > 1&&$(this).find('.controls').length==0){
$(this).append('
');
var slideNum=$(this).find('blockquote').length;
var $that=$(this);
for(var i=0;i
')
}
$(this).find('.controls ul li').first().click();
if($(this).attr('data-autorotate').length > 0){
slide_interval=(parseInt($(this).attr('data-autorotate')) < 100) ? 4000:parseInt($(this).attr('data-autorotate'));
var $that=$(this);
var $rotate=setInterval(function(){ testimonialRotate($that) },slide_interval);
}
$(this).find('.controls li').click(function(e){
if(typeof e.clientX!='undefined') clearInterval($rotate);
});
$(this).swipe({
swipeLeft:function(e){
$(this).find('.controls ul li span.active').parent().next('li').find('span').trigger('click');
e.stopImmediatePropagation();
clearInterval($rotate);
return false;
},
swipeRight:function(e){
$(this).find('.controls ul li span.active').parent().prev('li').find('span').trigger('click');
e.stopImmediatePropagation();
clearInterval($rotate);
return false;
}});
}
else if($(this).find('.controls').length==0){
var currentHeight=$(this).find('.slides blockquote').height();
$(this).find('.slides blockquote').stop().css({'opacity':'0', 'left':'-25px', 'z-index': '1'});
$(this).find('.slides blockquote').stop(true,true).transition({'opacity':'1','left':'0'},550,'easeOutCubic').css('z-index','20');
$(this).find('.slides').stop(true,true).animate({'height':currentHeight + 20 + 'px' },450,'easeOutCubic');
}});
$('.testimonial_slider[data-style="multiple_visible"] .slides').each(function(){
var $that=$(this);
var $element=$that;
var $autoplay=($that.parents('.testimonial_slider').attr('data-autorotate').length > 1&&parseInt($that.parents('.testimonial_slider').attr('data-autorotate')) > 100) ? parseInt($that.parents('.testimonial_slider').attr('data-autorotate')):4000;
if($that.find('img').length==0) $element=$('body');
$(this).find('blockquote').each(function(){
$(this).find('.image-icon').insertAfter($(this).find('p'));
});
imagesLoaded($element,function(instance){
$that.flickity({
contain: true,
draggable: true,
lazyLoad: false,
imagesLoaded: true,
percentPosition: true,
prevNextButtons: false,
pageDots: true,
resize: true,
setGallerySize: true,
wrapAround: true,
autoPlay: $autoplay,
accessibility: false
});
$that.parents('.testimonial_slider').css('opacity','1');
});
});
}
createTestimonialControls();
function testimonialRotate(slider){
var $testimonialLength=slider.find('li').length;
var $currentTestimonial=slider.find('.pagination-switch.active').parent().index();
if(slider.parents('.toggle').length > 0&&slider.parents('.toggle').hasClass('open')){
if($currentTestimonial+1==$testimonialLength){
slider.find('ul li:first-child').click();
}else{
slider.find('.pagination-switch.active').parent().next('li').click();
}}else{
if($currentTestimonial+1==$testimonialLength){
slider.find('ul li:first-child').click();
}else{
slider.find('.pagination-switch.active').parent().next('li').click();
}}
}
function testimonialHeightResize(){
$('.testimonial_slider:not(.disable-height-animation):not([data-style="multiple_visible"])').each(function(){
var $index=$(this).find('.controls ul li span.active').parent().index();
var currentHeight=$(this).find('.slides blockquote').eq($index).height();
$(this).find('.slides').stop(true,true).css({'height':currentHeight + 40 + 'px' });
});
}
function testimonialSliderHeight(){
$('.testimonial_slider.disable-height-animation:not([data-style="multiple_visible"])').each(function(){
$tallestQuote=0;
$(this).find('blockquote').each(function(){
($(this).height() > $tallestQuote) ? $tallestQuote=$(this).height():$tallestQuote=$tallestQuote;
});
if($tallestQuote==0) $tallestQuote=100;
$(this).find('.slides').css('height',$tallestQuote+40+'px');
$(this).animate({'opacity':'1'});
fullWidthContentColumns();
});
}
testimonialSliderHeight();
function responsiveVideoIframesInit(){
$('iframe').each(function(){
if(typeof $(this).attr('src')!='undefined'&&!$(this).parent().hasClass('iframe-embed')&&$(this).parents('.ult_modal').length==0&&$(this).parents('.ls-slide').length==0&&$(this).parents('.esg-entry-media').length==0){
if($(this).attr('src').toLowerCase().indexOf("youtube") >=0||$(this).attr('src').toLowerCase().indexOf("vimeo") >=0||$(this).attr('src').toLowerCase().indexOf("twitch.tv") >=0||$(this).attr('src').toLowerCase().indexOf("kickstarter") >=0||$(this).attr('src').toLowerCase().indexOf("embed-ssl.ted") >=0||$(this).attr('src').toLowerCase().indexOf("dailymotion") >=0){
$(this).wrap('
');
$(this).attr('data-aspectRatio', this.height / this.width).removeAttr('height').removeAttr('width');
if($(this).attr('src').indexOf('wmode=transparent')==-1){
if($(this).attr('src').indexOf('?')==-1){
$(this).attr('src',$(this).attr('src') + '?wmode=transparent');
}else{
$(this).attr('src',$(this).attr('src') + '&wmode=transparent');
}}
}}else{
}});
}
function responsiveVideoIframes(){
$('iframe[data-aspectRatio]').each(function(){
var newWidth=$(this).parent().width();
var $el=$(this);
if($(this).parents('.swiper-slide').length > 0){
if($(this).is(':visible')) $el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
}else{
$el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
}});
}
function videoshortcodeSize(){
$('.wp-video').each(function(){
$(this).attr('data-aspectRatio', parseInt($(this).find('.mejs-overlay').height()) / parseInt($(this).find('.wp-video-shortcode').css('width')));
var newWidth=$(this).width();
var $el=$(this).find('.wp-video-shortcode');
$(this).width(newWidth).height(newWidth * $(this).attr('data-aspectRatio'));
});
}
responsiveVideoIframesInit();
responsiveVideoIframes();
videoshortcodeSize();
$('.video-wrap iframe').unwrap();
$('#sidebar iframe[src]').unwrap();
$('video:not(.slider-video)').attr('width','100%');
$('video:not(.slider-video)').attr('height','100%');
$('audio').attr('width','100%');
$('audio').attr('height','100%');
$('audio').css('visibility','visible');
if($('body').hasClass('mobile')){
$('video').css('visibility','hidden');
}else{
$('video').css('visibility','visible');
}
$(window).load(function(){
$('video').css('visibility','visible');
showLateIframes();
videoshortcodeSize();
});
$('.wp-video').each(function(){
video=$(this).find('video').get(0);
video.addEventListener('loadeddata', function(){
videoshortcodeSize();
$(window).trigger('resize');
}, false);
});
$('.main-content iframe[src]').each(function(){
$(this).attr('src',$(this).attr('src'));
$(this).css({'opacity':'1', 'visibility':'visible'});
});
showLateIframes();
function showLateIframes(){
$('iframe[src]').css('opacity','1');
setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 100);
setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 500);
setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 1000);
setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 1500);
setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 2500);
}
$('.wpb_row:has(".nectar-video-wrap")').each(function(i){
$(this).css('z-index',100 + i);
});
var min_w=1200;
var vid_w_orig;
var vid_h_orig;
vid_w_orig=1280;
vid_h_orig=720;
function resizeVideoToCover(){
$('.nectar-video-wrap').each(function(i){
if($(this).parents('#page-header-bg').length > 0){
if($('.container-wrap.auto-height').length > 0) return false;
var $containerHeight=$(this).parents('#page-header-bg').outerHeight();
var $containerWidth=$(this).parents('#page-header-bg').outerWidth();
}else{
var $containerHeight=$(this).parents('.wpb_row').outerHeight();
var $containerWidth=$(this).parents('.wpb_row').outerWidth();
}
$(this).width($containerWidth);
$(this).height($containerHeight);
var scale_h=$containerWidth / vid_w_orig;
var scale_v=($containerHeight - $containerHeight) / vid_h_orig;
var scale=scale_h > scale_v ? scale_h:scale_v;
min_w=1280/720 * ($containerHeight+40);
if(scale * vid_w_orig < min_w){scale=min_w / vid_w_orig;}
$(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * vid_w_orig +0));
$(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * vid_h_orig +0));
$(this).scrollLeft(($(this).find('video').width() - $containerWidth) / 2);
$(this).scrollTop(($(this).find('video').height() - ($containerHeight)) / 2);
$(this).find('.mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($containerHeight)) / 2);
if($(this).attr('data-bg-alignment')=='center bottom'||$(this).attr('data-bg-alignment')=='bottom'){
$(this).scrollTop(($(this).find('video').height() - ($containerHeight+6)));
}
else if($(this).attr('data-bg-alignment')=='center top'||$(this).attr('data-bg-alignment')=='top'){
$(this).scrollTop(0);
}});
}
function videoBGInit(){
setTimeout(function(){
resizeVideoToCover();
$('.video-color-overlay').each(function(){
$(this).css('background-color',$(this).attr('data-color'));
});
$('.nectar-video-wrap').each(function(i){
var $headerVideo=($(this).parents('#page-header-bg').length > 0) ? true:false;
var $that=$(this);
var videoReady=setInterval(function(){
if($that.find('video').get(0).readyState > 3){
$that.transition({'opacity':'1'},400);
$that.find('video').transition({'opacity':'1'},400);
$that.parent().find('.video-color-overlay').transition({'opacity':'0.7'},400);
if($headerVideo==true){
pageHeaderTextEffect();
}
$('#ajax-loading-screen').addClass('loaded');
setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
clearInterval(videoReady);
}},60);
});
},300);
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
$('.wpb_row .mobile-video-image, #page-header-wrap .mobile-video-image, .fullscreen-header .mobile-video-image').show();
$('.nectar-video-wrap').remove();
}
if(navigator.userAgent.indexOf('Chrome') > 0&&!/Edge\/12./i.test(navigator.userAgent)&&!/Edge\/13./i.test(navigator.userAgent)){
$('.nectar-video-wrap').each(function(i){
if(jQuery(this).find('video source[type="video/webm"]').length > 0){
var webmSource=jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
var firstVideo=jQuery(this).find('video').get(0);
firstVideo.src=webmSource;
firstVideo.load();
}});
}}
videoBGInit();
$('body').on('click','.slide-out-widget-area-toggle a.closed:not(.animating)',function(){
if(animating=='true') return false;
var $that=$(this);
if($('#slide-out-widget-area').hasClass('slide-out-from-right')){
$('#slide-out-widget-area .inner').css({'height':'auto', 'min-height': $('#slide-out-widget-area').height() - 25 - $('.bottom-meta-wrap').height() });
if($('#boxed').length==0){
$('.container-wrap, .home-wrap, #header-secondary-outer, #footer-outer, .nectar-box-roll, .parallax_slider_outer .swiper-slide .image-bg, .parallax_slider_outer .swiper-slide .video-wrap, .parallax_slider_outer .swiper-slide .mobile-video-image, .parallax_slider_outer .swiper-slide .container, #page-header-wrap .page-header-bg-image, #page-header-wrap .nectar-video-wrap, #page-header-wrap .mobile-video-image, #page-header-wrap #page-header-bg > .container, .page-header-no-bg, div:not(.container) > .project-title').stop(true).transition({ x: '-300px' },700,'easeInOutCubic');
if($('#header-outer[data-transparency-option="1"]').length==0){
$('#header-outer').stop(true).css('transform','translateY(0)').transition({ x: '-300px'},700,'easeInOutCubic');
}else{
$('#header-outer').stop(true).css('transform','translateY(0)').transition({ x: '-300px', 'background-color':'transparent', 'border-bottom': '1px solid rgba(255,255,255,0.22)' },700,'easeInOutCubic');
}
$('#ascrail2000').transition({ 'x': '-300px' },700,'easeInOutCubic');
$('body:not(.ascend) #header-outer .cart-menu').stop(true).transition({ 'x': '300px' },700,'easeInOutCubic');
}
$('#slide-out-widget-area').stop(true).transition({ x: '0' },700,'easeInOutCubic').addClass('open');
if($('#boxed').length==0){
if($('#header-outer[data-full-width="true"]').length > 0&&!$('body').hasClass('mobile')){
$('#header-outer').addClass('highzI');
$('#ascrail2000').addClass('z-index-adj');
$('header#top #logo').stop(true).transition({ x: '300px' },700,'easeInOutCubic');
$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': $(window).width() - 360, 'left': '300px' },700,'easeInOutCubic');
$('header#top .slide-out-widget-area-toggle .lines-button').addClass('close');
if($('#header-outer[data-remove-border="true"]').length > 0){
$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '64px' },700,'easeInOutCubic');
}else{
$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '89px' },700,'easeInOutCubic');
}
$('body #header-outer nav > ul > li > a').css({'margin-bottom':'0'});
}}
$('#header-outer').addClass('style-slide-out-from-right');
$('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).stop(true).transition({
'opacity':1
},700,'easeInOutCubic',function(){
$('.slide-out-widget-area-toggle > div > a').removeClass('animating');
});
$logoWidth=($('#logo img:visible').length > 0) ? $('#logo img:visible').width():$('#logo').width();
if($('header#top nav > .sf-menu').offset().left - $logoWidth - 300 < 20) $('#header-outer').addClass('hidden-menu');
}else if($('#slide-out-widget-area').hasClass('fullscreen')){
var $scrollDelay=0;
var $scrollDelay2=0;
if($(window).scrollTop() + $(window).height() > $('.blurred-wrap').height()){
$('body,html').stop().animate({
scrollTop: $('.blurred-wrap').height() - $(window).height()
},600,'easeInOutCubic');
$scrollDelay=550;
$scrollDelay2=200;
}
$('header#top .slide-out-widget-area-toggle .lines-button').addClass('close');
setTimeout(function(){ $('.blurred-wrap').addClass('blurred'); },$scrollDelay);
$('#slide-out-widget-area.fullscreen').show().addClass('open');
hideToTop();
$('.container-wrap').addClass('no-shadow');
$('#header-outer').stop(true).css('transform','translateY(0)');
setTimeout(function(){
$('.off-canvas-menu-container .menu > li').each(function(i){
$(this).delay(i*50).transition({y: 0, 'opacity': 1},800,'easeOutExpo');
});
$('#slide-out-widget-area.fullscreen .widget').each(function(i){
$(this).delay(i*100).transition({y: 0, 'opacity': 1},800,'easeOutExpo');
});
},300+$scrollDelay2);
setTimeout(function(){
$('#slide-out-widget-area .off-canvas-social-links').addClass('line-shown');
$('#slide-out-widget-area .off-canvas-social-links li').each(function(i){
$(this).delay(i*50).transition({'scale':1},400,'easeOutCubic');
});
$('#slide-out-widget-area .bottom-text').transition({'opacity':0.7},400,'easeOutCubic');
},700+$scrollDelay2);
setTimeout(function(){
$easing=($('body.mobile').length > 0) ? 'easeOutCubic':'easeInOutQuint';
$('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).show().stop(true).transition({
'y':'0%'
},920,$easing,function(){
$('.slide-out-widget-area-toggle > div > a').removeClass('animating');
});
},50+$scrollDelay2);
slideOutWidgetOverflowState();
if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0&&$('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').addClass('at-content');
if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0||$('.mobile').length==0&&$('#header-outer.transparent').length==0) $('#slide-out-widget-area.fullscreen .inner-wrap').css('padding-top', $('#header-outer').height());
}
$('#header-outer').removeClass('side-widget-closed').addClass('side-widget-open');
if($('#header-outer[data-transparency-option="1"]').length > 0&&$('#boxed').length==0&&$('#header-outer[data-full-width="true"]').length > 0){
$('#header-outer').addClass('transparent');
}
if($('#header-outer.dark-slide.transparent').length > 0&&$('#boxed').length==0) $('#header-outer').removeClass('dark-slide').addClass('temp-removed-dark-slide');
$('.slide-out-widget-area-toggle > div > a').removeClass('closed').addClass('open');
$('.slide-out-widget-area-toggle > div > a').addClass('animating');
return false;
});
$('body').on('click','.slide-out-widget-area-toggle a.open:not(.animating), #slide-out-widget-area .slide_out_area_close',function(){
var $that=$(this);
$('.slide-out-widget-area-toggle a').removeClass('open').addClass('closed');
$('.slide-out-widget-area-toggle a').addClass('animating');
if($('#slide-out-widget-area').hasClass('slide-out-from-right')){
$('.container-wrap, .home-wrap, #header-secondary-outer, #footer-outer, .nectar-box-roll, .parallax_slider_outer .swiper-slide .image-bg, .parallax_slider_outer .swiper-slide .container, .parallax_slider_outer .swiper-slide .video-wrap, .parallax_slider_outer .swiper-slide .mobile-video-image, #page-header-wrap .page-header-bg-image, #page-header-wrap .nectar-video-wrap, #page-header-wrap .mobile-video-image, #page-header-wrap #page-header-bg > .container, .page-header-no-bg, div:not(.container) > .project-title').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
if($('#header-outer[data-transparency-option="1"]').length > 0&&$('#boxed').length==0){
$currentRowBG=($('#header-outer[data-current-row-bg-color]').length > 0) ? $('#header-outer').attr('data-current-row-bg-color'):$('#header-outer').attr('data-user-set-bg');
$('#header-outer').stop(true).transition({ x: '0px', 'background-color': $currentRowBG },700,'easeInOutCubic');
}else{
$('#header-outer').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
}
$('#ascrail2000').stop(true).transition({ 'x': '0px' },700,'easeInOutCubic');
$('body:not(.ascend) #header-outer .cart-menu').stop(true).transition({ 'x': '0px' },700,'easeInOutCubic');
$('#slide-out-widget-area').stop(true).transition({ x: '301px' },700,'easeInOutCubic').removeClass('open');
if($('#boxed').length==0){
if($('#header-outer[data-full-width="true"]').length > 0){
$('#header-outer').removeClass('highzI');
$('header#top #logo').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': '100%', 'left': '0' },700,'easeInOutCubic');
$('.lines-button').removeClass('close');
$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
}}
$('#slide-out-widget-area-bg').stop(true).transition({
'opacity':0
},700,'easeInOutCubic',function(){
$('.slide-out-widget-area-toggle a').removeClass('animating');
$(this).css({'height':'1px','width':'1px'});
if($('#header-outer').hasClass('parallax-contained')&&$(window).scrollTop() > 0&&$('#header-outer[data-permanent-transparent="1"]').length==0){
$('#header-outer').removeClass('parallax-contained').addClass('detached').removeClass('transparent');
}
else if($(window).scrollTop()==0&&$('body[data-hhun="1"]').length > 0&&$('#page-header-bg[data-parallax="1"]').length > 0 ||
$(window).scrollTop()==0&&$('body[data-hhun="1"]').length > 0&&$('.parallax_slider_outer').length > 0){
if($('#header-outer[data-transparency-option="1"]').length > 0) $('#header-outer').addClass('transparent');
$('#header-outer').addClass('parallax-contained').removeClass('detached');
}
$('.container-wrap').css('transform','none');
});
$('#header-outer').removeClass('style-slide-out-from-right');
}else if($('#slide-out-widget-area').hasClass('fullscreen')){
$('.lines-button').removeClass('close');
$('.blurred-wrap').removeClass('blurred');
$('#slide-out-widget-area.fullscreen').transition({'opacity': 0 },700,'easeOutQuad',function(){ $('#slide-out-widget-area.fullscreen').hide().css('opacity','1'); }).removeClass('open');
$('#slide-out-widget-area.fullscreen .widget').transition({'opacity': 0},700,'easeOutQuad',function(){
$(this).transition({y: '110px'},0);
});
setTimeout(function(){
$('.off-canvas-menu-container .menu > li').transition({y: '80px', 'opacity': 0},0);
$('#slide-out-widget-area .off-canvas-social-links li').transition({'scale':0},0);
$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');
$('#slide-out-widget-area .bottom-text').transition({'opacity':0},0);
$('#slide-out-widget-area .menuwrapper .menu').removeClass('subview');
$('#slide-out-widget-area .menuwrapper .menu li').removeClass('subview subviewopen');
$('#slide-out-widget-area.fullscreen .inner .off-canvas-menu-container').css('height','auto');
},800);
setTimeout(function(){
showToTop();
$('.container-wrap').removeClass('no-shadow');
},500);
$('#slide-out-widget-area-bg').stop(true).transition({'opacity': 0},900,'easeOutQuad',function(){
if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0&&$('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').removeClass('at-content');
if($('.mobile #header-outer[data-permanent-transparent="false"]').length==0) $('#slide-out-widget-area.fullscreen .inner-wrap').css('padding-top', '0');
$('.slide-out-widget-area-toggle a').removeClass('animating');
if($('#slide-out-widget-area-bg').hasClass('dark')) $opacity=0.93;
if($('#slide-out-widget-area-bg').hasClass('medium')) $opacity=0.6;
if($('#slide-out-widget-area-bg').hasClass('light')) $opacity=0.4;
$(this).css({'height':'1px','width':'1px', 'opacity': $opacity}).transition({ y:'-100%'},0);
});
}
if($('#header-outer.temp-removed-dark-slide.transparent').length > 0&&$('#boxed').length==0) $('#header-outer').removeClass('temp-removed-dark-slide').addClass('dark-slide');
if($('#header-outer[data-permanent-transparent="1"]').length==0){
if($('.nectar-box-roll').length==0){
if($('#header-outer.small-nav').length > 0||$('#header-outer.scrolled-down').length > 0||$('#header-outer.detached').length > 0) $('#header-outer').removeClass('transparent');
}else{
if($('#header-outer.small-nav').length > 0||$('#header-outer.scrolled-down').length > 0||$('.container-wrap.auto-height').length > 0) $('#header-outer').removeClass('transparent');
}}
$('#header-outer').removeClass('hidden-menu');
$('#header-outer').removeClass('side-widget-open').addClass('side-widget-closed');
return false;
});
function slideOutWidgetOverflowState(){
if(window.innerWidth < 1000||$('body > #boxed').length > 0){
$('#slide-out-widget-area.fullscreen .off-canvas-social-links').appendTo('#slide-out-widget-area .inner');
$('#slide-out-widget-area.fullscreen .bottom-text').appendTo('#slide-out-widget-area .inner');
}else{
$('#slide-out-widget-area.fullscreen .off-canvas-social-links').appendTo('#slide-out-widget-area .inner-wrap');
$('#slide-out-widget-area.fullscreen .bottom-text').appendTo('#slide-out-widget-area .inner-wrap');
}
if($('#slide-out-widget-area.fullscreen .inner').height() >=$(window).height()-100){ $('#slide-out-widget-area.fullscreen .inner, #slide-out-widget-area.fullscreen').addClass('overflow-state'); }else{ $('#slide-out-widget-area.fullscreen .inner, #slide-out-widget-area.fullscreen').removeClass('overflow-state'); }
$('#slide-out-widget-area.fullscreen .inner').transition({ y:'-' + ($('#slide-out-widget-area.fullscreen .inner').height()/2) + 'px' },0);
if($('.slide-out-from-right.open .off-canvas-menu-container.mobile-only').length > 0&&$('body.mobile').length==0) $('#slide-out-widget-area .slide_out_area_close').trigger('click');
}
function fullWidthHeaderSlidingWidgetMenuCalc(){
$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': $(window).width() - 360, 'left': '300px' },700,'easeInOutCubic');
}
function slideOutWidgetAreaScrolling(){
$('#slide-out-widget-area').mousewheel(function(event, delta){
this.scrollTop -=(delta * 30);
event.preventDefault();
});
}
slideOutWidgetAreaScrolling();
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
$('#slide-out-widget-area').addClass('mobile');
}
;(function($, window, undefined){
'use strict';
var Modernizr=window.Modernizr, $body=$('body');
$.DLMenu=function(options, element){
this.$el=$(element);
this._init(options);
};
$.DLMenu.defaults={
animationClasses:{ classin:'dl-animate-in-1', classout:'dl-animate-out-1' },
onLevelClick:function(el, name){ return false; },
onLinkClick:function(el, ev){ return false; }};
$.DLMenu.prototype={
_init:function(options){
this.options=$.extend(true, {}, $.DLMenu.defaults, options);
this._config();
var animEndEventNames={
'WebkitAnimation':'webkitAnimationEnd',
'OAnimation':'oAnimationEnd',
'msAnimation':'MSAnimationEnd',
'animation':'animationend'
},
transEndEventNames={
'WebkitTransition':'webkitTransitionEnd',
'MozTransition':'transitionend',
'OTransition':'oTransitionEnd',
'msTransition':'MSTransitionEnd',
'transition':'transitionend'
};
this.animEndEventName=animEndEventNames[ Modernizr.prefixed('animation') ] + '.menu';
this.transEndEventName=transEndEventNames[ Modernizr.prefixed('transition') ] + '.menu',
this.supportAnimations=Modernizr.cssanimations,
this.supportTransitions=Modernizr.csstransitions;
this._initEvents();
},
_config:function(){
this.open=false;
this.$trigger=this.$el.children('.trigger');
this.$menu=this.$el.children('ul.menu');
this.$menuitems=this.$menu.find('li:not(.back) > a');
this.$el.find('ul.sub-menu').prepend(' '+$('#slide-out-widget-area').attr('data-back-txt')+' ');
this.$back=this.$menu.find('li.back');
},
_initEvents:function(){
var self=this;
this.$trigger.on('click.menu', function(){
if(self.open){
self._closeMenu();
}else{
self._openMenu();
}
return false;
});
this.$menuitems.on('click.menu', function(event){
var $item=$(this).parent('li'),
$submenu=$item.children('ul.sub-menu');
if($submenu.length > 0){
var $flyin=$submenu.clone().css('opacity', 0).insertAfter(self.$menu),
onAnimationEndFn=function(){
self.$menu.off(self.animEndEventName).removeClass(self.options.animationClasses.classout).addClass('subview');
$item.addClass('subviewopen').parents('.subviewopen:first').removeClass('subviewopen').addClass('subview');
$flyin.remove();
};
setTimeout(function(){
$flyin.addClass(self.options.animationClasses.classin);
self.$menu.addClass(self.options.animationClasses.classout);
if(self.supportAnimations){
self.$menu.on(self.animEndEventName, onAnimationEndFn);
}else{
onAnimationEndFn.call();
}
self.options.onLevelClick($item, $item.children('a:first').text());
});
$item.parents('.off-canvas-menu-container').css('height',$item.parents('.off-canvas-menu-container').find('.menuwrapper .menu').height()).transition({ 'height': $flyin.height() },500,'easeInOutQuad');
return false;
}else{
self.options.onLinkClick($item.find('> a'), event);
}});
this.$back.on('click.menu', function(event){
var $this=$(this),
$submenu=$this.parents('ul.sub-menu:first'),
$item=$submenu.parent(),
$flyin=$submenu.clone().insertAfter(self.$menu);
var onAnimationEndFn=function(){
self.$menu.off(self.animEndEventName).removeClass(self.options.animationClasses.classin);
$flyin.remove();
};
setTimeout(function(){
$flyin.addClass(self.options.animationClasses.classout);
self.$menu.addClass(self.options.animationClasses.classin);
if(self.supportAnimations){
self.$menu.on(self.animEndEventName, onAnimationEndFn);
}else{
onAnimationEndFn.call();
}
$item.removeClass('subviewopen');
var $subview=$this.parents('.subview:first');
if($subview.is('li')){
$subview.addClass('subviewopen');
}
$subview.removeClass('subview');
});
$item.parents('.off-canvas-menu-container').css('height', $item.parents('.off-canvas-menu-container').find('.menuwrapper .menu').height())
setTimeout(function(){
$item.parents('.off-canvas-menu-container').transition({ 'height': $item.parent().height() },500,'easeInOutQuad');
},50);
return false;
});
},
closeMenu:function(){
if(this.open){
this._closeMenu();
}},
_closeMenu:function(){
var self=this,
onTransitionEndFn=function(){
self.$menu.off(self.transEndEventName);
self._resetMenu();
};
this.$menu.removeClass('menuopen');
this.$menu.addClass('menu-toggle');
this.$trigger.removeClass('active');
if(this.supportTransitions){
this.$menu.on(this.transEndEventName, onTransitionEndFn);
}else{
onTransitionEndFn.call();
}
this.open=false;
},
openMenu:function(){
if(!this.open){
this._openMenu();
}},
_openMenu:function(){
var self=this;
$body.off('click').on('click.menu', function(){
self._closeMenu() ;
});
this.$menu.addClass('menuopen menu-toggle').on(this.transEndEventName, function(){
$(this).removeClass('menu-toggle');
});
this.$trigger.addClass('active');
this.open=true;
},
_resetMenu:function(){
this.$menu.removeClass('subview');
this.$menuitems.removeClass('subview subviewopen');
}};
var logError=function(message){
if(window.console){
window.console.error(message);
}};
$.fn.dlmenu=function(options){
if(typeof options==='string'){
var args=Array.prototype.slice.call(arguments, 1);
this.each(function(){
var instance=$.data(this, 'menu');
if(!instance){
logError("cannot call methods on menu prior to initialization; " +
"attempted to call method '" + options + "'");
return;
}
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){
logError("no such method '" + options + "' for menu instance");
return;
}
instance[ options ].apply(instance, args);
});
}else{
this.each(function(){
var instance=$.data(this, 'menu');
if(instance){
instance._init();
}else{
instance=$.data(this, 'menu', new $.DLMenu(options, this));
}});
}
return this;
};})(jQuery, window);
function fullscreenMenuInit(){
$('#slide-out-widget-area .off-canvas-menu-container .menu').wrap('');
$('#slide-out-widget-area .off-canvas-menu-container .menu').addClass('menuopen');
$('#slide-out-widget-area .off-canvas-menu-container .menu-wrap').dlmenu({ animationClasses:{ classin:'dl-animate-in-5', classout:'dl-animate-out-5' }});
}
fullscreenMenuInit();
$('body').on('mouseover','#slide-out-widget-area .off-canvas-menu-container .menuwrapper > .sub-menu li > a',function(){
var $currentTxt=$(this).text();
$('.off-canvas-menu-container .menuwrapper .menu li > a').removeClass('hovered');
$('.off-canvas-menu-container .menuwrapper .menu li > a:contains('+$currentTxt+')').addClass('hovered');
});
$('body').on('mouseover','.off-canvas-menu-container .menuwrapper .menu li > a',function(){
$('.off-canvas-menu-container .menuwrapper .menu li > a').removeClass('hovered');
});
var pageHeaderHeight;
var pageHeaderHeightCopy;
var pageHeadingHeight;
var extraSpaceFromResize=($('#header-outer[data-header-resize="1"]').length > 0&&$('.nectar-box-roll').length==0) ? 51:1;
function fullScreenHeaderInit(){
pageHeaderHeight=parseInt($('#page-header-bg').attr('data-height'));
pageHeaderHeightCopy=parseInt($('#page-header-bg').attr('data-height'));
if($('.fullscreen-header').length > 0){
if($('#header-outer[data-transparency-option]').length > 0&&$('#header-outer').attr('data-transparency-option')!='0'){
var calculatedNum=(!$('body').hasClass('mobile')) ? $(window).height():$(window).height() - parseInt($('#header-outer').height()) ;
}else{
var calculatedNum=(!$('body').hasClass('mobile')) ? $(window).height() - parseInt($('#header-space').height()) + extraSpaceFromResize:$(window).height() - parseInt($('#header-outer').height()) ;
}
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
if($('.nectar-box-roll').length > 0) extraHeight=0;
pageHeaderHeight=calculatedNum - extraHeight;
pageHeaderHeightCopy=calculatedNum - extraHeight;
}
$('#page-header-bg').css('height',pageHeaderHeight+'px').removeClass('not-loaded');
setTimeout(function(){ $('#page-header-bg').css('overflow','visible') },800);
}
fullScreenHeaderInit();
function pageHeader(){
$('#page-header-bg[data-animate-in-effect="zoom-out"]').addClass('loaded');
var $scrollTop=$(window).scrollTop();
if($('.fullscreen-header').length > 0){
if($('#header-outer[data-transparency-option]').length > 0&&$('#header-outer').attr('data-transparency-option')!='0'){
var calculatedNum=(!$('body').hasClass('mobile')) ? $(window).height():$(window).height() - parseInt($('#header-outer').height()) ;
if($('body[data-permanent-transparent="1"]').length > 0) calculatedNum=$(window).height();
}else{
var calculatedNum=(!$('body').hasClass('mobile')) ? $(window).height() - parseInt($('#header-space').height()) + extraSpaceFromResize:$(window).height() - parseInt($('#header-outer').height()) ;
}
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
if($('.nectar-box-roll').length > 0) extraHeight=0;
pageHeaderHeight=calculatedNum - extraHeight;
pageHeaderHeightCopy=calculatedNum - extraHeight;
}
if(window.innerWidth < 1000&&window.innerWidth > 690&&!$('body').hasClass('salient_non_responsive')){
var $multiplier=($('.fullscreen-header').length > 0) ? 1:1.6;
$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
}else if(window.innerWidth <=690&&window.innerWidth > 480&&!$('body').hasClass('salient_non_responsive')){
var $multiplier=($('.fullscreen-header').length > 0) ? 1:2.1;
$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
}else if(window.innerWidth <=480&&!$('body').hasClass('salient_non_responsive')){
var $multiplier=($('.fullscreen-header').length > 0) ? 1:2.5;
$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
}else{
$('#page-header-bg').attr('data-height', pageHeaderHeightCopy).css('height',pageHeaderHeightCopy +'px');
if($('.fullscreen-header').length > 0){
$('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
}else{
$('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
}
if($('#page-header-bg[data-parallax="1"]').length==0) $('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
}
if(!$('body').hasClass('mobile')){
pageHeaderHeight=parseInt($('#page-header-bg').attr('data-height'));
$('#page-header-bg .container > .row').css('top',0);
var $divisionMultipler=($('#header-outer[data-remove-border="true"]').length > 0) ? 2:1;
pageHeadingHeight=$('#page-header-bg .col.span_6').height();
if($('#header-outer[data-transparent-header="true"]').length > 0&&$('.fullscreen-header').length==0){
$('#page-header-bg:not("[data-parallax=1]") .col.span_6').css('top', ((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2));
}else{
var $extraResizeHeight=($('#header-outer[data-header-resize="1"]').length > 0) ? 22: 0;
$('#page-header-bg:not("[data-parallax=1]") .col.span_6').css('top', (pageHeaderHeight/2) - (pageHeadingHeight/2) + $extraResizeHeight);
}
$('#page-header-bg:not("[data-parallax=1]") .portfolio-filters').css('top', (pageHeaderHeight/2) + 2);
if($('#page-header-bg[data-parallax="1"] .span_6').css('opacity') > 0){
if($('#header-outer[data-transparent-header="true"]').length > 0&&$('body.single-post .fullscreen-header').length==0){
$('#page-header-bg[data-parallax="1"] .span_6').css({
'opacity':1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+60)),
'top':(((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2)) +"px"
});
$('#page-header-bg[data-parallax="1"] .portfolio-filters').css({
'opacity':1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
'top':($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
});
}else{
$('#page-header-bg[data-parallax="1"] .span_6').css({
'opacity':1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+60)),
'top':((pageHeaderHeight/2) - (pageHeadingHeight/2)) +10 +"px"
});
$('#page-header-bg[data-parallax="1"] .portfolio-filters').css({
'opacity':1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
'top':($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
});
}}
}else{
pageHeaderHeight=parseInt($('#page-header-bg').attr('data-height'));
var pageHeadingHeight=$('#page-header-bg .container > .row').height();
$('#page-header-bg .container > .row').css('top', (pageHeaderHeight/2) - (pageHeadingHeight/2) + 5);
}
$('#page-header-bg .container > .row').css('visibility','visible');
}
var $pt_timeout=($('body[data-ajax-transitions="true"]').length > 0&&$('#page-header-bg[data-animate-in-effect="slide-down"]').length > 0) ? 350:0;
setTimeout(function(){ pageHeader(); },$pt_timeout);
if($('#header-outer').attr('data-header-resize')==''||$('#header-outer').attr('data-header-resize')=='0'){
$('#page-header-wrap').css('margin-top','0');
}
function extractUrl(input){
return input.replace(/"/g,"").replace(/url\(|\)$/ig, "");
}
if($('#page-header-bg[data-parallax="1"]').length > 0){
var img=new Image();
var imgX, imgY, aspectRatio;
var diffX, diffY;
var pageHeadingHeight=$('#page-header-bg .col.span_6').height();
var pageHeaderHeight=parseInt($('#page-header-bg').attr('data-height'));
var headerPadding2=parseInt($('#header-outer').attr('data-padding'))*2;
var wooCommerceHeader=($('.demo_store').length > 0) ? 32:0 ;
var $initialImgCheck=extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
if($initialImgCheck&&$initialImgCheck.indexOf('.')!==-1){
img.onload=function(){
pageHeaderInit();
}
img.src=extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
}else{
pageHeaderInit();
}
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
if($('body[data-hhun="1"]').length > 0) $('#header-outer').addClass('parallax-contained');
window.addEventListener('scroll', function(){
window.requestAnimationFrame(bindHeaderParallax);
}, false);
}
function bindHeaderParallax(){
var $scrollTop=$(window).scrollTop();
var pageHeadingHeight=$('#page-header-bg .col.span_6').height();
if(!$('body').hasClass('mobile')&&navigator.userAgent.match(/iPad/i)==null){
var $multiplier1=($('body[data-hhun="1"]').length > 0) ? 0.40: 0.2;
var $multiplier2=($('body[data-hhun="1"]').length > 0) ? 0.09: 0.14;
var $parallaxHeaderHUN=($('#header-outer[data-transparency-option="1"]').length > 0) ? 0.49: 0.4;
if($('#page-header-bg .nectar-particles').length==0&&$('#page-header-bg.out-of-sight').length==0){
$('#page-header-bg[data-parallax="1"]').css({ 'transform': 'translateY('+ $scrollTop*-$multiplier1 +'px)' });
var multipler=($('body').hasClass('single')) ? 1:2;
$('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"][data-post-hs="default_minimal"] .author-section').css({
'opacity':1-($scrollTop/(pageHeaderHeight-60))
});
$('#page-header-bg[data-parallax="1"] .span_6, body[data-button-style="rounded"] #page-header-bg[data-parallax="1"] .section-down-arrow, #page-header-bg[data-parallax="1"][data-post-hs="default_minimal"] .author-section').css({ 'transform': 'translateY('+ $scrollTop*- $multiplier2+'px)' });
if($('#page-header-bg[data-parallax="1"] .span_6').css('opacity')==0){
$('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"] .portfolio-filters').hide();
}else{
$('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"] .portfolio-filters').show();
}
if($('body[data-hhun="1"]').length > 0&&!$('#header-outer').hasClass('side-widget-open')&&!$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')){
$('#header-outer.parallax-contained').css({ 'transform': 'translateY('+$scrollTop*-$parallaxHeaderHUN+'px)' });
}}
else if($('#page-header-bg.out-of-sight').length==0){
var multipler=($('body').hasClass('single')) ? 1:2;
$('#page-header-wrap .nectar-particles .fade-out').css({
'opacity':0+($scrollTop/(pageHeaderHeight+pageHeaderHeight*$multiplier))
});
}
if(($scrollTop / (pageHeaderHeight + $('#header-space').height() + extraHeight)) > 1){
$('#page-header-bg, .nectar-particles, #page-header-bg .fade-out').css('visibility','hidden').hide().addClass('out-of-sight');
}else{
$('#page-header-bg, .nectar-particles, #page-header-bg .fade-out').css('visibility','visible').show().removeClass('out-of-sight');
pageHeaderHeight=parseInt($('#page-header-bg').attr('data-height'));
$('#page-header-bg .container > .row').css('top',0);
var $divisionMultipler=($('#header-outer[data-remove-border="true"]').length > 0) ? 2:1;
pageHeadingHeight=$('#page-header-bg .col.span_6').height();
if($('#header-outer[data-transparent-header="true"]').length > 0&&$('body.single-post .fullscreen-header').length==0){
$('#page-header-bg[data-parallax="1"] .span_6').css({
'top':(((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2)) +"px"
});
}else{
$('#page-header-bg[data-parallax="1"] .span_6').css({
'top':((pageHeaderHeight/2) - (pageHeadingHeight/2)) +10 +"px"
});
}}
}}
if($('#page-header-bg').length > 0){
var $initialImgCheckAscend=extractUrl($('#page-header-bg').css('background-image'));
if($initialImgCheckAscend&&$initialImgCheckAscend.indexOf('.')!==-1){
$('#page-header-bg').addClass('has-bg');
}}
function pageHeaderInit(){
var wooCommerceHeader=($('.demo_store').length > 0) ? 32:0 ;
var centeredNavAltSpace=($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) ? $('header#top nav > .sf-menu').height() -20:null;
if($('#header-outer[data-transparent-header="true"]').length > 0){
$('#page-header-bg[data-parallax="1"]').css({'top': extraHeight+wooCommerceHeader });
}else{
if($('body[data-header-resize="0"]').length==0) $('#page-header-bg[data-parallax="1"]').css({'top': (logoHeight+headerPadding+centeredNavAltSpace+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader+wooCommerceHeader) + 'px' });
}
if($('#ajax-content-wrap').length==0||!$('body').hasClass('ajax-loaded')){
$('#page-header-bg[data-parallax="1"]').animate({ 'opacity':1},650,'easeInCubic');
}else if($('#ajax-content-wrap').length==1){
$('#page-header-bg[data-parallax="1"]').css({ 'opacity':1});
}
if($smoothCache==true&&$(window).width() > 690&&$('body').outerHeight(true) > $(window).height()&&Modernizr.csstransforms3d&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){ niceScrollInit(); $(window).trigger('resize') }
$('#page-header-bg[data-parallax="1"] .nectar-particles').append('
');
}
function nectarPageHeader(){
if($('#page-header-bg').length > 0){
fullScreenHeaderInit();
pageHeader();
}
if($('#page-header-bg[data-parallax="1"]').length > 0){
var img=new Image();
var $initialImgCheck=extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
if($initialImgCheck&&$initialImgCheck.indexOf('.')!==-1){
img.onload=function(){
pageHeaderInit();
}
img.src=extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
}else{
pageHeaderInit();
}
$('#page-header-bg[data-parallax="1"] .span_6').css({
'opacity':1
});
if(window.addEventListener){
window.addEventListener('scroll', function(){
requestAnimationFrame(bindHeaderParallax);
}, false);
}}
if($('#page-header-bg').length > 0){
var $initialImgCheckAscend=extractUrl($('#page-header-bg').css('background-image'));
if($initialImgCheckAscend&&$initialImgCheckAscend.indexOf('.')!==-1){
$('#page-header-bg').addClass('has-bg');
}}
}
if(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1||navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
window.onunload=function(){ nectarPageHeader(); };}
function pageHeaderTextEffectInit(){
$('#page-header-bg').each(function(){
if($(this).attr('data-text-effect')=='rotate_in'){
var $topHeading='none';
if($(this).find('.span_6 h1').length > 0){
$topHeading='h1';
}
if($topHeading!='none'){
var $selector=($(this).find('.nectar-particles').length > 0) ? '.inner-wrap.shape-1':'.span_6';
$(this).find($selector).find($topHeading).addClass('top-heading').contents().filter(function (){
return this.nodeType===3&&typeof this.data!='undefined'&&this.data.replace(/\s+/, "");
}).wrap(' ');
$(this).find($selector).find('.wraped').each(function (){
textNode=$(this);
text=textNode.text().split(' ');
replace='';
$.each(text, function (index, value){
if(value.replace(/\s+/, "")){
replace +='' + value + ' ';
}});
textNode.replaceWith($(replace));
});
}}
});
}
function pageHeaderTextEffect(){
if($('#page-header-bg .nectar-particles').length==0&&$('#page-header-bg[data-text-effect="none"]').length==0||$('.nectar-box-roll').length > 0&&$('#page-header-bg .nectar-particles').length==0){
var $selector=($('.nectar-box-roll').length==0) ? '#page-header-bg .span_6':'.nectar-box-roll .overlaid-content .span_6';
$($selector).find('.wraped').each(function(i){
$(this).find('span').delay(i*370).transition({ rotateX: '0', 'opacity':1, y: 0},400,'easeOutQuad');
});
setTimeout(function(){
$($selector).find('.inner-wrap > *:not(.top-heading)').each(function(i){
$(this).delay(i*370).transition({ rotateX: '0', 'opacity':1, y: 0 },650,'easeOutQuad');
});
$('.scroll-down-wrap').removeClass('hidden');
}, $($selector).find('.wraped').length * 370);
}}
var $effectTimeout=($('#ajax-loading-screen').length > 0) ? 800:0;
pageHeaderTextEffectInit();
if($('#page-header-bg .nectar-video-wrap video').length==0) setTimeout(pageHeaderTextEffect,$effectTimeout);
if($('header#top nav > ul.sf-menu ul').length > 0){
var $midnightSubmenuTimeout;
$('body').on('mouseover','#header-outer .midnightHeader .sf-with-ul, #header-outer .midnightHeader .cart-menu',function(){
if($(this).parents('.midnightHeader').offset().top - $(window).scrollTop() < 50){
$(this).parents('.midnightHeader').css({'z-index': '9999'}).addClass('overflow');
$(this).parents('.midnightInner').css('overflow','visible');
}});
$('body').on('mouseleave','#header-outer .midnightHeader',function(){
var $that=$(this);
clearTimeout($midnightSubmenuTimeout);
$midnightSubmenuTimeout=setTimeout(function(){
if(!$that.is(':hover')){
$that.css({'z-index': 'auto'}).removeClass('overflow');
$that.find('.midnightInner').css('overflow','hidden');
}},900);
});
}
function midnightInit(){
if($('#header-outer[data-permanent-transparent="1"]').length > 0&&$('body[data-bg-header="true"]').length > 0){
$('#header-outer').midnight();
if($('#header-outer[data-has-menu="false"]').length > 0){
var $buttonsOffset=$('#header-outer header#top nav > ul.buttons').position();
if($('#header-outer #logo img').length > 0){
var $logoOffset=$('#header-outer #logo img:visible').position();
var $logoOffsetTop=$('#header-outer #logo img:visible').position().top;
var $logoMargin=parseInt($('#header-outer #logo img:visible').css('margin-top'));
var $logoWidth=$('#header-outer #logo img:visible').width();
}else{
var $logoOffset=$('#header-outer .span_3 #logo:visible').offset();
var $logoOffsetTop=$('#header-outer .span_3 #logo:visible').offset().top - $(window).scrollTop();
var $logoMargin=parseInt($('#header-outer .span_3 #logo:visible').css('margin-top'));
var $logoWidth=$('#header-outer #logo').width();
}
var $containerMargin=parseInt($('#header-outer header > .container').css('padding-left'));
var $headerOffset=$('#header-outer').position();
$(window).on('smartresize', function(){
if($('#header-outer #logo img').length > 0){
$logoMargin=parseInt($('#header-outer #logo img:visible').css('margin-top'));
$logoOffset=$('#header-outer #logo img:visible').position();
$logoOffsetTop=$('#header-outer #logo img:visible').position().top;
$logoWidth=$('#header-outer #logo img:visible').width();
}else{
$logoMargin=parseInt($('#header-outer .span_3 #logo:visible').css('margin-top'));
$logoOffset=$('#header-outer .span_3 #logo:visible').offset();
$logoOffsetTop=$('#header-outer .span_3 #logo:visible').offset().top - $(window).scrollTop();
$logoWidth=$('#header-outer #logo').width();
}
$containerMargin=parseInt($('#header-outer header > .container').css('padding-left'));
$buttonsOffset=$('#header-outer header#top nav > ul.buttons').position();
$headerOffset=$('#header-outer').position();
});
$('body').mousemove(function(e){
if($('body.mobile').length==0){
if(e.clientX >=$buttonsOffset.left + $containerMargin &&
e.clientY >=$buttonsOffset.top &&
e.clientY <=$buttonsOffset.top + $headerOffset.top + $('#header-outer header#top nav > ul.buttons').height() ||
e.clientX <=$logoOffset.left + $containerMargin + $logoWidth &&
e.clientY >=$logoOffsetTop &&
e.clientY <=$logoOffsetTop + $logoMargin + $headerOffset.top + $('#header-outer #logo img:visible').height()){
$('.midnightHeader, #header-outer').removeClass('no-pointer-events');
}else{
$('.midnightHeader, #header-outer').addClass('no-pointer-events');
}}else{
$('.midnightHeader, #header-outer').removeClass('no-pointer-events');
}});
}
else if($('#header-outer[data-has-menu="true"]').length > 0){
var $headerPos=$('header#top .container').position();
var $headerOffset=$('header#top .container').offset();
$(window).on('smartresize', function(){
$headerPos=$('header#top .container').position();
$headerOffset=$('header#top .container').offset();
});
$('body').mousemove(function(e){
if($('body.mobile').length==0){
if(e.clientX >=$headerOffset.left &&
e.clientY >=$headerPos.top &&
e.clientY <=$('header#top .container .row').height()){
$('.midnightHeader, #header-outer').removeClass('no-pointer-events');
}else if($('li.sfHover').length==0){
$('.midnightHeader, #header-outer').addClass('no-pointer-events');
}}else{
$('.midnightHeader, #header-outer').removeClass('no-pointer-events');
}});
}}
}
function getScrollbarWidth(){
var outer=document.createElement("div");
outer.style.visibility="hidden";
outer.style.width="100px";
outer.style.msOverflowStyle="scrollbar";
document.body.appendChild(outer);
var widthNoScroll=outer.offsetWidth;
outer.style.overflow="scroll";
var inner=document.createElement("div");
inner.style.width="100%";
outer.appendChild(inner);
var widthWithScroll=inner.offsetWidth;
outer.parentNode.removeChild(outer);
return widthNoScroll - widthWithScroll;
}
function boxRollInit(){
if($('.nectar-box-roll').length > 0){
$('body').attr('data-scrollbar-width',getScrollbarWidth());
$('body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap').addClass('no-scroll');
$('body,html').stop().animate({ scrollTop:0 },0);
$('.container-wrap').css('opacity',0).addClass('no-transform-animation-bottom-out').addClass('bottomBoxOut');
if($('.mobile').length==0) $('#ajax-loading-screen .loading-icon > span').css({ 'left':'-'+getScrollbarWidth()/2 +'px'});
var $overlaid=$('#page-header-bg .overlaid-content').clone();
var $scrollDownOverlaid=$('.scroll-down-wrap').clone();
$('#page-header-bg').removeAttr('data-midnight');
$('#page-header-bg .overlaid-content, #page-header-bg .scroll-down-wrap').remove();
$('.nectar-box-roll').append($overlaid).attr('data-midnight','light');
$('.overlaid-content').append($scrollDownOverlaid);
nectarBoxRollContentHeight();
setTimeout(function(){ pageLoadHash(); },700);
}else{
$('#ajax-content-wrap, .blurred-wrap').addClass('at-content');
$('body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap').removeClass('no-scroll');
$('.container-wrap').css('opacity',1).removeClass('no-transform-animation-bottom-out').removeClass('bottomBoxOut').removeClass('bottomBoxIn');
perspect='not-rolled';
}}
boxRollInit();
function nectarBoxRollContentHeight(){
if($('#header-outer[data-transparent-header="true"]').length==0){
$('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css({'height':window.innerHeight - $('#header-space').height(), 'min-height':window.innerHeight - $('#header-space').height() });
if($('.mobile').length==0){ $('#ajax-content-wrap').css('margin-top',$('#header-space').height()); $('#slide-out-widget-area.fullscreen').css('margin-top','-'+$('#header-space').height()+'px'); }
else $('#ajax-content-wrap, #slide-out-widget-area.fullscreen').css('margin-top','0');
}else{
$('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css('height',window.innerHeight);
}}
if($('.nectar-box-roll').length > 0) $(window).on('resize',nectarBoxRollContentHeight);
var perspect='not-rolled';
var animating='false';
function boxRoll(e,d){
if($('#slide-out-widget-area.open').length > 0) return false;
if($('.nectar-box-roll canvas').length > 0&&$('.nectar-box-roll canvas[data-loaded="true"]').length==0) return false;
if(perspect=='not-rolled'&&animating=='false'&&d==-1){
perspect='rolled';
animating='true';
$('body').addClass('box-animating').addClass('box-perspective-rolled').addClass('box-rolling');
$('.nectar-box-roll #page-header-bg').removeClass('topBoxIn').addClass('topBoxOut').css('will-change','transform');
$('.nectar-box-roll .overlaid-content').removeClass('topBoxIn2').removeClass('topBoxIn').addClass('topBoxOut2').css('will-change','transform');
$('.container-wrap').removeClass('bottomBoxOut').addClass('bottomBoxIn').removeClass('no-transform-animation-bottom-out').addClass('nectar-box-roll-class').css('will-change','transform');
if($('#header-outer[data-transparent-header="true"]').length==0){
$('.container-wrap').css({'height':$(window).height() - $('#header-space').height(), 'opacity': 1});
$('#slide-out-widget-area.fullscreen').css('margin-top','0px');
}else{
$('.container-wrap').css({'height':$(window).height(), 'opacity': 1});
}
$('.nectar-slider-wrap').css({'opacity':0});
updateRowRightPadding(d);
pauseVideoBG();
var timeout1=1220;
var timeout2=1650;
var timeout3=1700;
var timeout4=1350;
if($('html.no-cssanimations').length > 0){
timeout1=1;
timeout2=1;
timeout3=1;
timeout4=1;
}
$('.container-wrap').css('padding-right',$('body').attr('data-scrollbar-width') + 'px');
setTimeout(function(){
$('#header-outer, #wpadminbar, .cart-outer .cart-menu, .midnightHeader .midnightInner').animate({'padding-right': $('body').attr('data-scrollbar-width')},250);
$('.nectar-box-roll .canvas-bg').addClass('out-of-sight');
if($('#header-outer[data-permanent-transparent="1"]').length==0) $('#header-outer').removeClass('transparent');
if($('body.mobile').length > 0) $('.nectar-box-roll').css({'z-index':'1'});
},timeout1);
setTimeout(function(){
updateRowRightPadding(1);
$('body,html,#ajax-content-wrap, .container-wrap, .blurred-wrap').removeClass('no-scroll');
$('#ajax-content-wrap, .blurred-wrap').addClass('at-content');
$('.container-wrap, #footer-outer').removeClass('bottomBoxIn').removeClass('nectar-box-roll-class').addClass('auto-height');
$('#header-outer, #wpadminbar, .container-wrap, .cart-outer .cart-menu, .midnightHeader .midnightInner').stop().css('padding-right',0);
if($smoothActive==1&&$(window).width() > 690&&Modernizr.csstransforms3d&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
niceScrollInit();
}
$('.nectar-box-roll').css({'z-index':'-1000'}).transition({'y': '-200%'},0);
$('.nectar-box-roll canvas').hide();
$('body').removeClass('box-rolling');
$('.nectar-slider-wrap').transition({'opacity':1},600,'easeOutCubic');
$('.nectar-box-roll #page-header-bg, .nectar-box-roll .overlaid-content, .container-wrap').css('will-change','auto');
if($waypointsBound==false) waypoints();
},timeout2);
setTimeout(function(){
$('.container-wrap .main-content > .row > div > div[class*="col"]').css({'opacity':1});
},timeout4);
setTimeout(function(){
animating='false';
$('body').removeClass('box-animating');
},timeout3);
if($('#header-outer[data-permanent-transparent="1"]').length==0&&$('.mobile').length==0&&$('#header-outer[data-transparent-header="true"]').length!=0){
$('#ajax-content-wrap').transition({'margin-top':$('#header-outer').outerHeight(true) + $('#header-outer').offset().top},2000,'easeInOutQuad');
}
if($('.mobile #header-outer[data-permanent-transparent="1"]').length > 0&&$('.mobile #header-outer[data-mobile-fixed="false"]').length==1) $('#header-outer').transition({'y':'-100%'},400,'easeOutCubic');
}
else if(perspect=='rolled'&&animating=='false'&&d==1&&$(window).scrollTop() < 100){
$('.container-wrap').removeClass('auto-height');
if($('#header-outer[data-transparent-header="true"]').length==0){
$('.container-wrap').css({'height':$(window).height() - $('#header-space').height(), 'opacity': 1});
}else{
$('.container-wrap').css({'height':$(window).height(), 'opacity': 1});
}
$('#footer-outer').removeClass('auto-height');
$('body').addClass('box-rolling');
perspect='not-rolled';
animating='true';
$('body').addClass('box-animating').addClass('box-perspective-not-rolled');
$('#header-outer, #wpadminbar, .container-wrap, .cart-outer .cart-menu, .midnightHeader .midnightInner').css('padding-right',$('body').attr('data-scrollbar-width') + 'px');
$('.nectar-slider-wrap').transition({'opacity':0},600,'easeOutCubic');
$('.container-wrap .main-content > .row > div > div[class*="col"]').stop(true).css({'opacity':0});
setTimeout(function(){
$('#header-outer, #wpadminbar, .cart-outer .cart-menu, .midnightHeader .midnightInner').animate({'padding-right': 0},250);
$('.nectar-box-roll .canvas-bg').removeClass('out-of-sight');
resizeVideoToCover();
if($('#header-outer[data-transparent-header="true"]').length!=0){
$('#ajax-content-wrap').stop(true,true).transition({'margin-top':0},2000,'easeInOutCubic');
}else{
if($('.mobile').length==0) $('#slide-out-widget-area.fullscreen').css('margin-top','-'+$('#header-space').height()+'px');
}},30);
var timeout1=1700;
var timeout2=1600;
var timeout3=1300;
if($('html.no-cssanimations').length > 0){
timeout1=1;
timeout2=1;
timeout3=1;
}
if($('body.mobile').length > 0){
setTimeout(function(){
$('.nectar-box-roll').css('z-index','1000');
},timeout3);
}else{
$('.nectar-box-roll').css('z-index','1000');
}
updateRowRightPadding(d);
removeNiceScroll();
$('.nectar-box-roll').transition({'y': '0'},0);
$('.nectar-box-roll canvas').show();
setTimeout(function(){
updateRowRightPadding(1);
animating='false';
$('body').removeClass('box-animating');
$('#page-header-bg').removeClass('topBoxIn');
$('.overlaid-content').removeClass('topBoxIn2');
$('body').removeClass('box-rolling');
resumeVideoBG();
$('.nectar-box-roll #page-header-bg, .nectar-box-roll .overlaid-content, .container-wrap').css('will-change','auto');
},timeout1);
setTimeout(function(){
if($('.mobile #header-outer[data-permanent-transparent="1"]').length > 0&&$('.mobile #header-outer[data-mobile-fixed="false"]').length==1) $('#header-outer').transition({'y':'0%'},400,'easeOutCubic');
},timeout2);
$('body,html,#ajax-content-wrap, .container-wrap, .blurred-wrap').addClass('no-scroll');
$('#ajax-content-wrap, .blurred-wrap').removeClass('at-content');
$('.container-wrap').addClass('nectar-box-roll-class');
$('.nectar-box-roll #page-header-bg').removeClass('topBoxOut').addClass('topBoxIn').css('will-change','transform');
$('.container-wrap').removeClass('bottomBoxIn').addClass('bottomBoxOut').css('will-change','transform');
if($('#header-outer[data-transparent-header="true"]').length > 0&&$('#header-outer[data-permanent-transparent="1"]').length==0) $('#header-outer').addClass('transparent');
$('.nectar-box-roll .overlaid-content').removeClass('topBoxOut2').removeClass('topBoxOut').addClass('topBoxIn2').css('will-change','transform');
if($('#header-outer[data-header-resize="1"]').length > 0){ bigNav(); }
$('.nectar-box-roll .trigger-scroll-down').removeClass('hovered');
}}
function boxScrollEvent(event, delta){
if($('#slide-out-widget-area.open.fullscreen').length > 0) return false;
boxRoll(event,delta);
}
function boxRollMouseWheelInit(){
if($('.nectar-box-roll').length > 0){
$('body').on("mousewheel", boxScrollEvent);
}else{
$('body').off("mousewheel", boxScrollEvent);
}}
boxRollMouseWheelInit();
$('body').on('click','.nectar-box-roll .section-down-arrow',function(){
boxRoll(null,-1);
$(this).addClass('hovered');
setTimeout(function(){ $('.nectar-box-roll .section-down-arrow').removeClass('hovered'); },2000);
return false;
});
function updateRowRightPadding(d){
$('.wpb_row.full-width-section').each(function(){
if($(this).hasClass('extraPadding')&&d==1){
$(this).css('padding-right',parseInt($(this).css('padding-right')) - parseInt($('body').attr('data-scrollbar-width')) + 'px').removeClass('extraPadding');
}else{
$(this).css('padding-right',parseInt($('body').attr('data-scrollbar-width')) + parseInt($(this).css('padding-right')) + 'px').addClass('extraPadding');
}});
$('.wpb_row.full-width-content').each(function(){
if($(this).find('.row-bg.using-image').length==0){
if($(this).hasClass('extraPadding')&&d==1){
$(this).find('.row-bg').css('width',parseInt($(this).width()) - parseInt($('body').attr('data-scrollbar-width')) + 'px').removeClass('extraPadding');
}else{
$(this).find('.row-bg').css('width',parseInt($('body').attr('data-scrollbar-width')) + $(this).width() + 'px').addClass('extraPadding');
}}
});
}
function pauseVideoBG(){
if($('.nectar-box-roll video').length > 0) $('.nectar-box-roll video')[0].pause();
}
function resumeVideoBG(){
if($('.nectar-box-roll video').length > 0) $('.nectar-box-roll video')[0].play();
}
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)&&$('.nectar-box-roll').length > 0){
$('body').swipe({
swipeStatus: function(event, phase, direction, distance, duration, fingers){
if($('#slide-out-widget-area.open').length > 0) return false;
if(direction=='up'){
boxRoll(null,-1);
if($('#ajax-content-wrap.no-scroll').length==0) $('body').swipe("option", "allowPageScroll", 'vertical');
}else if(direction=="down"&&$(window).scrollTop()==0){
boxRoll(null,1);
$('body').swipe("option", "allowPageScroll", 'auto');
}}
});
}
function removeNiceScroll(){
if($().niceScroll&&$("html").getNiceScroll()){
var nice=$("html").getNiceScroll();
nice.stop();
$('html').removeClass('no-overflow-y');
$('.nicescroll-rails').hide();
if($('#boxed').length==0){
$('body, body #header-outer, body #header-secondary-outer, body #search-outer, .midnightHeader .midnightInner').css('padding-right','0px');
}else if($('body[data-ext-responsive="true"]').length==0){
$('body').css('padding-right','0px');
}
$('body').attr('data-smooth-scrolling','0');
}}
$waypointsBound=false;
function waypoints(){
colAndImgAnimations();
progressBars();
clientsFadeIn();
svgAnimations();
milestoneInit();
nectar_fancy_ul_init();
headerRowColorInheritInit();
morphingOutlines();
$waypointsBound=true;
}
var timeout;
var productToAdd;
$('body').on('click','.product .add_to_cart_button', function(){
productToAdd=$(this).parents('li').find('h3').text();
$('#header-outer .cart-notification span.item-name').html(productToAdd);
});
$('body').on('mouseenter','#header-outer .cart-notification',function(){
$(this).fadeOut(400);
$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(300);
$('#header-outer .cart_list').stop(true,true).fadeIn(300);
clearTimeout(timeout);
});
$('#header-outer div.cart-outer').hoverIntent(function(){
$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(300);
$('#header-outer .cart_list').stop(true,true).fadeIn(300);
clearTimeout(timeout);
$('#header-outer .cart-notification').fadeOut(300);
});
$('body').on('mouseleave','#header-outer div.cart-outer',function(){
var $that=$(this);
setTimeout(function(){
if(!$that.is(':hover')){
$('#header-outer .widget_shopping_cart').stop(true,true).fadeOut(300);
$('#header-outer .cart_list').stop(true,true).fadeOut(300);
}},100);
});
$('body').on('added_to_cart', shopping_cart_dropdown_show);
$('body').on('added_to_cart', shopping_cart_dropdown);
function shopping_cart_dropdown(){
if(!$('.widget_shopping_cart .widget_shopping_cart_content .cart_list .empty').length&&$('.widget_shopping_cart .widget_shopping_cart_content .cart_list').length > 0){
$('.cart-menu-wrap').addClass('has_products');
$('header#top nav > ul, #search-outer #search #close a').addClass('product_added');
if(!$('.cart-menu-wrap').hasClass('static')) $('.cart-menu-wrap').addClass('first-load');
if($('#header-outer').hasClass('directional-nav-effect')&&$('#header-outer .cart-icon-wrap .dark').length==0&&$('body.ascend').length > 0){
$('#header-outer .cart-outer .cart-icon-wrap').each(function(){
$(this).find('> i, > span.light, > span.dark, > span.original').remove();
$(this).append(' ');
$(this).find('.original').attr('data-w',$(this).find('span.original').width()+1);
});
}}
}
function shopping_cart_dropdown_show(e){
clearTimeout(timeout);
if(!$('.widget_shopping_cart .widget_shopping_cart_content .cart_list .empty').length&&$('.widget_shopping_cart .widget_shopping_cart_content .cart_list').length > 0&&typeof e.type!='undefined'){
if(!$('#header-outer .cart-menu-wrap').hasClass('has_products')){
setTimeout(function(){ $('#header-outer .cart-notification').fadeIn(400); },400);
}
else if(!$('#header-outer .cart-notification').is(':visible')){
$('#header-outer .cart-notification').fadeIn(400);
}else{
$('#header-outer .cart-notification').show();
}
timeout=setTimeout(hideCart,2700);
$('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy');
}}
function hideCart(){
$('#header-outer .cart-notification').stop(true,true).fadeOut();
}
function checkForWooItems(){
var checkForCartItems=setInterval(shopping_cart_dropdown,250);
setTimeout(function(){ clearInterval(checkForCartItems); },4500);
}
checkForWooItems();
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
var secondaryHeader=($('#header-outer').attr('data-using-secondary')=='1') ? 32:0 ;
function searchFieldCenter(){
$('#search-outer').css('top',$('#header-outer').outerHeight() + extraHeight + secondaryHeader);
$('#search-outer > #search #search-box').css('top',($(window).height()/2) - ($('#search-outer > #search input').height()/2) - $('#header-outer').outerHeight());
}
$('body').on('mouseover','.text_on_hover .product-wrap',function(){
$(this).parent().addClass('hovered');
});
$('body').on('mouseover','.text_on_hover > a:first-child',function(){
$(this).parent().addClass('hovered');
});
$('body').on('mouseout','.text_on_hover .product-wrap',function(){
$(this).parent().removeClass('hovered');
});
$('body').on('mouseout','.text_on_hover > a:first-child',function(){
$(this).parent().removeClass('hovered');
});
/*
$('.text_on_hover.product .star-rating span').each(function(){
$(this).attr('data-width',$(this).width());
$(this).css('width', $(this).attr('data-width') - 40);
});*/
var $placeholder=$('#search input[type=text]').attr('data-placeholder');
var logoHeight=parseInt($('#header-outer').attr('data-logo-height'));
$('body').on('click', '#search-btn a', function(){ return false; });
$('body').on('mousedown', '#search-btn a:not(.inactive)', function(){
if($(this).hasClass('open-search')){ return false; }
if($('body').hasClass('ascend')){
$('#search-outer > #search form, #search-outer #search .span_12 span').css('opacity',0);
$('#search-outer > #search form').css('bottom','10px');
$('#search-outer #search .span_12 span').css('top','10px');
$('#search-outer').show();
$('#search-outer').stop().transition({scale: '1,0', 'opacity': 1},0).transition({ scale: '1,1'},400,'easeInOutCubic');
$('#search-outer > #search form').delay(400).animate({'opacity':1, 'bottom':0},'easeOutCirc');
$('#search-outer #search .span_12 span').delay(470).animate({'opacity':1, 'top':0},'easeOutCirc');
}else{
$('#search-outer').stop(true).fadeIn(600,'easeOutExpo');
}
$('body:not(.ascend) #search-outer > #search input[type="text"]').css({
'top':$('#search-outer').height()/2 - $('#search-outer > #search input[type="text"]').height()/2
});
setTimeout(function(){
$('#search input[type=text]').focus();
if($('#search input[type=text]').attr('value')==$placeholder){
$('#search input[type=text]').setCursorPosition(0);
}},300);
if($('body').hasClass('ascend')){
searchFieldCenter();
}
$(this).toggleClass('open-search');
$('.slide-out-widget-area-toggle a.open:not(.animating)').trigger('click');
return false;
});
$('body').on('keydown','#search input[type=text]',function(){
if($(this).attr('value')==$placeholder){
$(this).attr('value', '');
}});
$('body').on('keyup','#search input[type=text]',function(){
if($(this).attr('value')==''){
$(this).attr('value', $placeholder);
$(this).setCursorPosition(0);
}});
$('body').on('click','#close',function(){
closeSearch();
$('#search-btn a').removeClass('open-search');
return false;
});
$('body').on('blur','#search-box input[type=text]',function(e){
closeSearch();
$('#search-btn a').removeClass('open-search');
});
function closeSearch(){
if($('body').hasClass('ascend')){
$('#search-outer').stop().transition({'opacity' :0},300,'easeOutCubic');
$('#search-btn a').addClass('inactive');
setTimeout(function(){ $('#search-outer').hide(); $('#search-btn a').removeClass('inactive'); },300);
}else{
$('#search-outer').stop(true).fadeOut(450,'easeOutExpo');
}}
$('body').on('click', '#mobile-menu #mobile-search .container a#show-search',function(){
$('#mobile-menu .container > ul').slideUp(500);
return false;
});
var logoHeight=parseInt($('#header-outer').attr('data-logo-height'));
var headerPadding=parseInt($('#header-outer').attr('data-padding'));
var usingLogoImage=$('#header-outer').attr('data-using-logo');
if(isNaN(headerPadding)||headerPadding.length==0){ headerPadding=28; }
if(isNaN(logoHeight)||usingLogoImage.length==0){ usingLogoImage=false; logoHeight=30;}
function headerInit(){
$('#header-outer #logo img').css({
'height':logoHeight,
});
$('#header-outer').css({
'padding-top':headerPadding
});
if($('body.mobile').length==0){
$('header#top nav > ul > li > a').css({
'padding-bottom':Math.floor(((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding),
'padding-top':Math.floor((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2))
});
}
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('#header-outer .cart-menu').css({
'padding-bottom':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding),
'padding-top':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding)
});
}else{
$('#header-outer .cart-menu').css({
'padding-bottom':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding + logoHeight/2 + 7),
'padding-top':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding + logoHeight/2 + 7)
});
}
$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').css({
'padding-bottom':(logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2),
'padding-top':(logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2)
});
if($('body.ascend ').length > 0&&$('#header-outer[data-full-width="true"]').length > 0){
$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').css({
'padding-top': 0,
'padding-bottom': 0
});
$('header#top nav > ul.buttons').css({
'margin-top':- headerPadding,
'height':Math.floor(logoHeight + headerPadding*2) -1
});
$('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').css({
'visibility':'visible',
'padding-top': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding),
'padding-bottom': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding)
});
}
$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').css({
'top':$('header#top nav > ul > li > a').outerHeight()
});
setTimeout(function(){
$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').css({
'top': parseInt($('#header-outer').outerHeight())+'px'
});
},1000);
$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').css({
'top': parseInt($('#header-outer').outerHeight())+'px'
});
if($('.nectar-parallax-scene.first-section').length==0){
if($('#header-outer').attr('data-using-secondary')=='1'){
if($('#header-outer[data-mobile-fixed="false"]').length > 0||$('body.mobile').length==0){
$('#header-space').css('height', parseInt($('#header-outer').outerHeight()) + $('#header-secondary-outer').height());
}else{
$('#header-space').css('height', parseInt($('#header-outer').outerHeight()));
}}else{
$('#header-space').css('height', $('#header-outer').outerHeight());
}}
$('#header-outer .container, #header-outer .cart-menu').css('visibility','visible');
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('body:not(.ascend) #search-outer, #search .container').css({
'height':logoHeight + headerPadding*2
});
$('body:not(.ascend) #search-outer > #search input[type="text"]').css({
'font-size':43,
'height':'59px',
'top':((logoHeight + headerPadding*2)/2) - $('#search-outer > #search input[type="text"]').height()/2
});
$('body:not(.ascend) #search-outer > #search #close a').css({
'top':((logoHeight + headerPadding*2)/2) - 8
});
}else{
$('body:not(.ascend) #search-outer, #search .container').css({
'height':logoHeight + headerPadding*2 + logoHeight + 17
});
$('body:not(.ascend) #search-outer > #search input[type="text"]').css({
'font-size':43,
'height':'59px',
'top':((logoHeight + headerPadding*2)/2) - ($('#search-outer > #search input[type="text"]').height()/2) + logoHeight/2 + 17
});
$('body:not(.ascend) #search-outer > #search #close a').css({
'top':((logoHeight + headerPadding*2)/2) - 8 + logoHeight/2 + 17
});
}}
$(window).load(function(){
if($(window).scrollTop()==0) headerSpace();
});
var headerResize=$('#header-outer').attr('data-header-resize');
var headerHideUntilNeeded=$('body').attr('data-hhun');
if($(window).scrollTop()!=0&&$('#header-outer.transparent[data-permanent-transparent="false"]').length==1) $('#header-outer').removeClass('transparent');
if(headerResize==1&&headerHideUntilNeeded!='1'){
headerInit();
$(window).off('scroll.headerResizeEffect');
$(window).on('scroll.headerResizeEffect',smallNav);
}else if(headerHideUntilNeeded!='1'){
headerInit();
$(window).off('scroll.headerResizeEffectOpaque');
- $(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
}else if(headerHideUntilNeeded=='1'){
headerInit();
if($('.nectar-box-roll').length > 0) $('#header-outer').addClass('at-top-before-box');
var previousScroll=0,
menuOffset=$('#header-space').height()*2,
detachPoint=($('body.mobile').length > 0) ? 150:600,
hideShowOffset=6;
function hhunCalcs(e){
if($('body.animated-scrolling').length > 0&&$('#header-outer.detached').length > 0) return false;
if($('#header-outer[data-mobile-fixed="false"]').length > 0&&$('body.mobile').length > 0){ $('#header-outer').removeClass('detached'); return false; }
var currentScroll=$(this).scrollTop(),
scrollDifference=Math.abs(currentScroll - previousScroll);
if(!$('#header-outer').hasClass('side-widget-open')&&!$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')){
if(currentScroll > menuOffset){
if(currentScroll > detachPoint){
if(!$('#header-outer').hasClass('detached'))
$('#header-outer').addClass('detached').removeClass('parallax-contained');
if($('#header-outer[data-permanent-transparent="1"]').length==0) $('#header-outer').removeClass('transparent');
}
if(scrollDifference >=hideShowOffset){
if(currentScroll > previousScroll){
if(!$('#header-outer').hasClass('invisible'))
$('#header-outer').addClass('invisible').removeClass('at-top');
$('.page-submenu.stuck').css('transform','translateY(0px)').addClass('header-not-visible');
}else{
if($('#header-outer').hasClass('invisible'))
$('#header-outer').removeClass('invisible');
$('.page-submenu.stuck').css('transform','translateY('+$('#header-outer').outerHeight()+'px)').removeClass('header-not-visible');
}}
}else{
$topDetachNum=($('#header-outer[data-using-secondary="1"]').length > 0) ? 32:0;
if(currentScroll <=$topDetachNum){
$('#header-outer').removeClass('detached').addClass('at-top');
if($('#header-outer[data-transparent-header="true"]').length > 0&&$('.nectar-box-roll').length==0) $('#header-outer').addClass('transparent').css('transform','translateY(0)');
else if($('.nectar-box-roll').length > 0) $('#header-outer').css('transform','translateY(0)').addClass('at-top-before-box');
if($('.parallax_slider_outer').length > 0||$('#page-header-bg[data-parallax="1"]').length > 0) $('#header-outer').addClass('parallax-contained').css('transform','translateY(0)');
}}
if((window.innerHeight + window.scrollY) >=document.body.offsetHeight){
$('#header-outer').removeClass('invisible');
$('.page-submenu.stuck').css('transform','translateY('+$('#header-outer').outerHeight()+'px)').removeClass('header-not-visible');
}}
previousScroll=currentScroll;
}
hhunCalcs();
$(window).scroll(hhunCalcs);
}
midnightInit();
var shrinkNum=6;
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
function smallNav(){
var $offset=$(window).scrollTop();
var $windowWidth=$(window).width();
if($offset > 0&&$windowWidth > 1000){
if($('#header-outer').attr('data-transparent-header')=='true'&&$('#header-outer.side-widget-open').length==0&&$('#header-outer[data-permanent-transparent="1"]').length==0) $('#header-outer').removeClass('transparent');
$('.ns-loading-cover').hide();
$('#header-outer').addClass('small-nav');
$('body.home').addClass('scrolled');
$('#header-outer #logo img').stop(true,true).animate({
'height':logoHeight - shrinkNum
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('#header-outer').stop(true,true).animate({
'padding-top':Math.ceil(headerPadding / 1.8)
},{queue:false, duration:800, easing: 'easeOutCubic'});
if($('body.ascend[data-slide-out-widget-area="true"] #header-outer[data-has-menu="false"][data-permanent-transparent="false"][data-full-width="false"] header#top').length > 0||$('body:not(.ascend)[data-slide-out-widget-area="true"] #header-outer[data-has-menu="false"][data-permanent-transparent="false"] header#top').length > 0){
$('#header-outer header#top').stop(true,true).animate({
'padding-bottom':Math.ceil(headerPadding / 1.8)
},{queue:false, duration:800, easing: 'easeOutCubic'});
}
$('header#top nav > ul > li > a').stop(true,true).animate({
'padding-bottom':Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding / 1.8) ,
'padding-top':Math.floor(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2))
},{queue:false, duration:800, easing: 'easeOutCubic'});
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('#header-outer .cart-menu').stop(true,true).animate({
'padding-top':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7),
'padding-bottom':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7) +1
},{queue:false, duration:800, easing: 'easeOutCubic'});
}else{
$('#header-outer .cart-menu').stop(true,true).animate({
'padding-bottom':Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding / 1.7) + (logoHeight-shrinkNum)/2 + 9,
'padding-top':Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding / 1.7) + (logoHeight-shrinkNum)/2 + 9
},{queue:false, duration:800, easing: 'easeOutCubic'});
}
if($('body.ascend ').length > 0&&$('#header-outer[data-full-width="true"]').length > 0){
$('header#top nav > ul.buttons').stop(true,true).animate({
'margin-top':- Math.ceil(headerPadding/ 1.8),
'height':Math.floor((headerPadding*2)/ 1.8 + logoHeight-shrinkNum)
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').stop(true,true).animate({
'padding-top':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7),
'padding-bottom':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7) +1
},{queue:false, duration:800, easing: 'easeOutCubic'});
}else{
$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').stop(true,true).animate({
'padding-bottom':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2)),
'padding-top':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2))
},{queue:false, duration:800, easing: 'easeOutCubic'});
}
$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
'top':Math.floor($('header#top nav > ul > li > a').height() + (((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2))*2 + headerPadding / 1.8),
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({
'top': Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) +'px'
},{queue:false, duration:800, easing: 'easeOutCubic'});
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
'height':Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8)
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
'font-size':30,
'line-height':'30px',
'height':'44px',
'top':((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
'top':((logoHeight-shrinkNum + headerPadding+5)/2) - 10
},{queue:false, duration:800, easing: 'easeOutCubic'});
}else{
$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
'height':Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) + logoHeight - shrinkNum + 17
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
'font-size':30,
'line-height':'30px',
'height':'44px',
'top':((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2 + (logoHeight- shrinkNum)/2 + 8
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
'top':((logoHeight-shrinkNum + headerPadding+5)/2) - 10 + (logoHeight- shrinkNum)/2 + 8
},{queue:false, duration:800, easing: 'easeOutCubic'});
}
if($('.nectar-box-roll').length > 0&&$('#header-outer[data-permanent-transparent="1"]').length==0) $('#ajax-content-wrap').animate({'margin-top': (Math.floor((logoHeight-shrinkNum) +(headerPadding*2)/ 1.8 + extraHeight + secondaryHeader)) },{queue:false, duration:250, easing: 'easeOutCubic'})
if($('body').hasClass('ascend')){
$('#search-outer').stop(true,true).animate({
'top':Math.floor((logoHeight-shrinkNum) +(headerPadding*2)/ 1.8 + extraHeight + secondaryHeader)
},{queue:false, duration:800, easing: 'easeOutCubic'});
}
if(usingLogoImage==false) $('header#top #logo').stop(true,true).animate({
'margin-top':0
},{queue:false, duration:450, easing: 'easeOutExpo'});
$(window).off('scroll',smallNav);
$(window).on('scroll',bigNav);
$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease');
$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none');
setTimeout(function(){
$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease, border-color 0.40s ease');
$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.40s ease');
},300);
}}
function bigNav(){
var $offset=$(window).scrollTop();
var $windowWidth=$(window).width();
if($offset==0&&$windowWidth > 1000||$('.small-nav').length > 0&&$('#ajax-content-wrap.no-scroll').length > 0){
$('#header-outer').removeClass('small-nav');
$('body.home').removeClass('scrolled');
if($('#header-outer').attr('data-transparent-header')=='true'&&$('.nectar-box-roll').length==0) $('#header-outer').addClass('transparent');
$('.ns-loading-cover').show();
$('#header-outer #logo img').stop(true,true).animate({
'height':logoHeight,
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('#header-outer').stop(true,true).animate({
'padding-top':headerPadding
},{queue:false, duration:800, easing: 'easeOutCubic'});
if($('body.ascend[data-slide-out-widget-area="true"] #header-outer[data-has-menu="false"][data-permanent-transparent="false"][data-full-width="false"] header#top').length > 0||$('body:not(.ascend)[data-slide-out-widget-area="true"] #header-outer[data-has-menu="false"][data-permanent-transparent="false"] header#top').length > 0){
$('#header-outer header#top').stop(true,true).animate({
'padding-bottom':headerPadding
},{queue:false, duration:800, easing: 'easeOutCubic'});
}
$('header#top nav > ul > li > a').stop(true,true).animate({
'padding-bottom':((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding,
'padding-top':(logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)
},{queue:false, duration:800, easing: 'easeOutCubic'});
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('#header-outer .cart-menu').stop(true,true).animate({
'padding-bottom':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding),
'padding-top':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding)
},{queue:false, duration:800, easing: 'easeOutCubic'});
}else{
$('#header-outer .cart-menu').stop(true,true).animate({
'padding-bottom':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding) + logoHeight/2 + 7,
'padding-top':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding) + logoHeight/2 + 7
},{queue:false, duration:800, easing: 'easeOutCubic'});
}
if($('body.ascend ').length > 0&&$('#header-outer[data-full-width="true"]').length > 0){
$('header#top nav > ul.buttons').stop(true,true).animate({
'margin-top':- Math.ceil(headerPadding),
'height':Math.floor(headerPadding*2 + logoHeight) -1
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').stop(true,true).animate({
'padding-top': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding),
'padding-bottom': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding)
},{queue:false, duration:800, easing: 'easeOutCubic'});
}else{
$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').stop(true,true).animate({
'padding-bottom':Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2)),
'padding-top':Math.ceil((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2))
},{queue:false, duration:800, easing: 'easeOutCubic'});
}
$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
'top':Math.ceil($('header#top nav > ul > li > a').height() + (((logoHeight)/2) - ($('header#top nav > ul > li > a').height()/2))*2 + headerPadding),
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({
'top': Math.ceil(logoHeight + headerPadding*2) +'px'
},{queue:false, duration:800, easing: 'easeOutCubic'});
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
'height':Math.ceil(logoHeight + headerPadding*2)
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
'font-size':43,
'line-height':'43px',
'height':'59px',
'top':((logoHeight + headerPadding*2)/2) - 30
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
'top':((logoHeight + headerPadding*2)/2) - 8
},{queue:false, duration:800, easing: 'easeOutCubic'});
}else{
$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
'height':Math.ceil(logoHeight + headerPadding*2) + logoHeight + 17
},{queue:false, duration:800, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
'font-size':43,
'line-height':'43px',
'height':'59px',
'top':((logoHeight + headerPadding*2)/2) - 30 + (logoHeight)/2 + 8
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
'top':((logoHeight + headerPadding*2)/2) - 8 + (logoHeight)/2 + 8
},{queue:false, duration:800, easing: 'easeOutCubic'});
}
if($('body').hasClass('ascend')){
$('#search-outer').stop(true,true).animate({
'top':(logoHeight) +(headerPadding*2) + extraHeight + secondaryHeader
},{queue:false, duration:800, easing: 'easeOutCubic'});
}
if(usingLogoImage==false) $('header#top #logo').stop(true,true).animate({
'margin-top':4
},{queue:false, duration:450, easing: 'easeOutExpo'});
if($('.nectar-box-roll').length > 0&&$('#header-outer[data-permanent-transparent="1"]').length==0) $('#ajax-content-wrap').animate({'margin-top': (Math.floor((logoHeight) +(headerPadding*2) + extraHeight + secondaryHeader)) },{queue:false, duration:250, easing: 'easeOutCubic'})
$(window).off('scroll',bigNav);
$(window).on('scroll',smallNav);
$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease');
$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none');
setTimeout(function(){
$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease, border-color 0.40s ease');
$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.40s ease');
},300);
}}
function headerSpace(){
if($('.mobile').length > 0){
if(window.innerHeight < window.innerWidth&&window.innerWidth > 1000){
$('#header-space').css('height', $('#header-outer').outerHeight() + $('#header-secondary-outer').height());
}else{
$('#header-space').css('height', $('#header-outer').outerHeight());
}}else{
if($('.nectar-parallax-scene.first-section').length==0){
var shrinkNum=6;
var headerPadding=parseInt($('#header-outer').attr('data-padding'));
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
var headerPadding2=headerPadding - headerPadding/1.8;
var $headerHeight=($('#header-outer[data-header-resize="1"]').length > 0&&$('.small-nav').length > 0) ? $('#header-outer').outerHeight() + (parseInt(shrinkNum) + headerPadding2*2):$('#header-outer').outerHeight();
if($('#header-outer').attr('data-using-secondary')=='1'){
$('#header-space').css('height', $headerHeight + $('#header-secondary-outer').height());
}else{
$('#header-space').css('height', $headerHeight);
}}
}}
var lastPosition=-1;
function headerOffsetAdjust(){
var $scrollTop=$(window).scrollTop();
if(lastPosition==$scrollTop){
requestAnimationFrame(headerOffsetAdjust);
return false;
} else lastPosition=$scrollTop;
if($('body.mobile').length > 0){
var $eleHeight=0;
var $endOffset=($('#wpadminbar').css('position')=='fixed') ? $('#wpadminbar').height():0;
if($('#header-secondary-outer').length > 0) $eleHeight +=$('#header-secondary-outer').height();
if($('#wpadminbar').length > 0) $eleHeight +=$('#wpadminbar').height();
if($eleHeight - $scrollTop > $endOffset){
$('#header-outer').css('top', $eleHeight - $scrollTop + 'px');
}else{ $('#header-outer').css('top', $endOffset); }}else{
var $eleHeight=0;
if($('#header-secondary-outer').length > 0) $eleHeight +=$('#header-secondary-outer').height();
if($('#wpadminbar').length > 0) $eleHeight +=$('#wpadminbar').height();
$('#header-outer').css('top',$eleHeight+'px');
}
requestAnimationFrame(headerOffsetAdjust);
}
if($('#header-outer[data-mobile-fixed="1"]').length > 0&&$('#wpadminbar').length > 0||$('#header-outer[data-mobile-fixed="1"]').length > 0&&$('#header-secondary-outer').length > 0){
requestAnimationFrame(headerOffsetAdjust);
}
function footerRevealCalcs(){
if($(window).height() - $('#wpadminbar').height() - $('#header-outer').outerHeight() - $('#footer-outer').height() - 1 -$('#page-header-bg').height() -$('.parallax_slider_outer').height() - $('.page-header-no-bg').height() > 0){
$resizeExtra=($('#header-outer[data-header-resize="1"]').length > 0) ? 55: 0;
$('.container-wrap').css({'margin-bottom': $('#footer-outer').height()-1, 'min-height': $(window).height() - $('#wpadminbar').height() - $('#header-outer').outerHeight() - $('#footer-outer').height() -1 - $('.page-header-no-bg').height() -$('#page-header-bg').height() -$('.parallax_slider_outer').height() + $resizeExtra });
}else{
$('.container-wrap').css({'margin-bottom': $('#footer-outer').height()-1 });
}
if($(window).width() < 1000) $('#footer-outer').attr('data-midnight','light');
else $('#footer-outer').removeAttr('data-midnight');
}
if($('body[data-footer-reveal="1"]').length > 0){
footerRevealCalcs();
if($('body[data-footer-reveal-shadow="large_2"]').length > 0) $('.container-wrap').css({ boxShadow: '0 70px 110px -30px '+$('#footer-outer').css('backgroundColor') });
}
function opaqueCheck(){
var $offset=$(window).scrollTop();
var $windowWidth=$(window).width();
if($offset > 0&&$windowWidth > 1000){
if($('#header-outer').attr('data-transparent-header')=='true'&&$('#header-outer[data-permanent-transparent="1"]').length==0) $('#header-outer').removeClass('transparent').addClass('scrolled-down');
$('.ns-loading-cover').hide();
$(window).off('scroll',opaqueCheck);
$(window).on('scroll',transparentCheck);
}}
function transparentCheck(){
var $offset=$(window).scrollTop();
var $windowWidth=$(window).width();
if($offset==0&&$windowWidth > 1000){
if($('#header-outer').attr('data-transparent-header')=='true') $('#header-outer').addClass('transparent').removeClass('scrolled-down');
$('.ns-loading-cover').show();
$(window).off('scroll',transparentCheck);
$(window).on('scroll',opaqueCheck);
}}
var adminBarHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
function headerRowColorInheritInit(){
if($('body[data-header-inherit-rc="true"]').length > 0&&$('.mobile').length==0){
var headerOffset=($('#header-outer[data-permanent-transparent="1"]').length==0) ? (logoHeight - shrinkNum) + Math.ceil((headerPadding*2) / 1.8) + adminBarHeight:logoHeight/2 + headerPadding + adminBarHeight;
$('.main-content > .row > .wpb_row').each(function(){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if(direction=='down'){
if($that.find('.row-bg.using-bg-color').length > 0){
var $textColor=($that.find('> .col.span_12.light').length > 0) ? 'light-text':'dark-text';
$('#header-outer').css('background-color',$that.find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor);
$('#header-outer').attr('data-current-row-bg-color',$that.find('.row-bg').css('background-color'));
}else{
$('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text');
$('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg'));
}}else{
if($that.prev('div.wpb_row').find('.row-bg.using-bg-color').length > 0){
var $textColor=($that.prev('div.wpb_row').find('> .col.span_12.light').length > 0) ? 'light-text':'dark-text';
$('#header-outer').css('background-color',$that.prev('div.wpb_row').find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor);
$('#header-outer').attr('data-current-row-bg-color', $that.prev('div.wpb_row').find('.row-bg').css('background-color'));
}else{
$('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text');
$('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg'));
}}
},
offset: headerOffset
});
});
}}
if($('.nectar-box-roll').length==0) headerRowColorInheritInit();
if($('.page-submenu[data-sticky="true"]').length > 0){
(function(){
'use strict'
var $=window.jQuery
var Waypoint=window.Waypoint
var $offsetHeight=0;
var shrinkNum=6;
var headerPadding=parseInt($('#header-outer').attr('data-padding'));
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
var headerPadding2=headerPadding - headerPadding/1.8;
var $headerHeight=($('#header-outer[data-header-resize="1"]').length > 0&&$('body.mobile').length==0) ? $('#header-outer').outerHeight() - (parseInt(shrinkNum) + headerPadding2*2):$('#header-outer').outerHeight();
if($('#header-secondary-outer').length > 0&&$('body.mobile').length==0) $headerHeight +=$('#header-secondary-outer').height();
$(window).on('smartresize',function(){
$headerHeight=($('#header-outer[data-header-resize="1"]').length > 0&&$('.small-nav').length==0&&$('body.mobile').length==0) ? $('#header-outer').outerHeight() - (parseInt(shrinkNum) + headerPadding2*2):$('#header-outer').outerHeight();
if($('#header-secondary-outer').length > 0&&$('body.mobile').length==0) $headerHeight +=$('#header-secondary-outer').height();
$offsetHeight=0;
if($('#wpadminbar').length > 0&&$('#wpadminbar').css('position')=='fixed') $offsetHeight +=$('#wpadminbar').height();
if($('body[data-hhun="0"] #header-outer').length > 0&&!($('body.mobile').length > 0&&$('#header-outer[data-mobile-fixed="false"]').length > 0)) $offsetHeight +=$headerHeight;
if($('.page-submenu.stuck').length > 0){
$('.page-submenu.stuck').addClass('no-trans').css('top',$offsetHeight).css('transform','translateY(0)').addClass('stuck');
var $that=this;
setTimeout(function(){ $('.page-submenu.stuck').removeClass('no-trans'); },50);
$('.page-submenu.stuck').parents('.wpb_row').css('z-index',10000);
if($('#boxed').length > 0){
var $negMargin=($(window).width() > 1000) ? $('.container-wrap').width()*0.04 :39;
$('.page-submenu.stuck').css({'margin-left':'-'+$negMargin+'px', 'width':$('.container-wrap').width()});
}}else{
$('.page-submenu.stuck').css('top','0').removeClass('stuck');
$('.page-submenu.stuck').parents('.wpb_row').css('z-index','auto');
if($('#boxed').length > 0) $('.page-submenu.stuck').css({'margin-left':'0px', 'width':'100%'});
}});
function Sticky(options){
this.options=$.extend({}, Waypoint.defaults, Sticky.defaults, options)
this.element=this.options.element
this.$element=$(this.element)
this.createWrapper()
this.createWaypoint()
}
Sticky.prototype.createWaypoint=function(){
var originalHandler=this.options.handler
$offsetHeight=0;
if($('#wpadminbar').length > 0&&$('#wpadminbar').css('position')=='fixed') $offsetHeight +=$('#wpadminbar').height();
if($('body[data-hhun="0"] #header-outer').length > 0&&!($('body.mobile').length > 0&&$('#header-outer[data-mobile-fixed="false"]').length > 0)) $offsetHeight +=$headerHeight;
this.waypoint=new Waypoint($.extend({}, this.options, {
element: this.wrapper,
handler: $.proxy(function(direction){
var shouldBeStuck=this.options.direction.indexOf(direction) > -1
var wrapperHeight=shouldBeStuck ? this.$element.outerHeight(true):''
this.$wrapper.height(wrapperHeight)
if(shouldBeStuck){
this.$element.addClass('no-trans').css('top',$offsetHeight).css('transform','translateY(0)').addClass('stuck');
var $that=this;
setTimeout(function(){ $that.$element.removeClass('no-trans'); },50);
this.$element.parents('.wpb_row').css('z-index',10000);
if($('#boxed').length > 0){
var $negMargin=($(window).width() > 1000) ? $('.container-wrap').width()*0.04 :39;
this.$element.css({'margin-left':'-'+$negMargin+'px', 'width':$('.container-wrap').width()});
}}else{
this.$element.css('top','0').removeClass('stuck');
if($('#boxed').length > 0) this.$element.css({'margin-left':'0px', 'width':'100%'});
}
if(originalHandler){
originalHandler.call(this, direction)
}}, this),
offset: $offsetHeight
}))
var $that=this;
setInterval(function(){
if($('body[data-hhun="1"] #header-outer.detached:not(.invisible)').length > 0)
$that.waypoint.options.offset=$offsetHeight + $headerHeight;
else
$that.waypoint.options.offset=$offsetHeight;
Waypoint.refreshAll();
},100);
}
Sticky.prototype.createWrapper=function(){
if(this.options.wrapper){
this.$element.wrap(this.options.wrapper)
}
this.$wrapper=this.$element.parent()
this.wrapper=this.$wrapper[0]
}
Sticky.prototype.destroy=function(){
if(this.$element.parent()[0]===this.wrapper){
this.waypoint.destroy()
this.$element.removeClass(this.options.stuckClass)
if(this.options.wrapper){
this.$element.unwrap()
}}
}
Sticky.defaults={
wrapper: '
',
stuckClass: 'stuck',
direction: 'down right'
}
Waypoint.Sticky=Sticky
}())
;
if($('.page-submenu').parents('.span_12').find('> .wpb_column').length > 1){
var pageMenu=$('.page-submenu').clone();
var pageMenuParentRow=$('.page-submenu').parents('.wpb_row');
$('.page-submenu').remove();
pageMenuParentRow.before(pageMenu);
}
var sticky=new Waypoint.Sticky({
element: $('.page-submenu[data-sticky="true"]')[0]
});
}
$('.page-submenu').parents('.wpb_row').css('z-index',10000);
$('.page-submenu .mobile-menu-link').on('click',function(){
$(this).parents('.page-submenu').find('ul').stop(true).slideToggle(350);
return false;
});
$('.page-submenu ul li a').on('click',function(){
if($('body.mobile').length > 0) $(this).parents('.page-submenu').find('ul').stop(true).slideToggle(350);
});
$('body').on('click','#toggle-nav',function(){
$('#mobile-menu').stop(true,true).slideToggle(500);
return false;
});
if($('header#top nav > ul > li.menu-item-language').length > 0&&$('#header-secondary-outer ul > li.menu-item-language').length==0){
var $langSelector=$('header#top nav > ul > li.menu-item-language').clone();
$langSelector.insertBefore('#mobile-menu ul #mobile-search');
}
$('#mobile-menu .container ul li').each(function(){
if($(this).find('> ul').length > 0){
$(this).addClass('has-ul');
$(this).find('> a').append(' ');
}});
$('#mobile-menu .container ul li:has(">ul") > a .sf-sub-indicator').click(function(){
$(this).parent().parent().toggleClass('open');
$(this).parent().parent().find('> ul').stop(true,true).slideToggle();
return false;
});
function piVertCenter(){
$('.portfolio-items > .col').each(function(){
$(this).find('.style-4 .work-info .bottom-meta:not(.shown)').stop().animate({
'bottom':'-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px'
},420,'easeOutCubic');
});
}
$(window).load(function(){
portfolioCommentOrder();
fullWidthContentColumns();
resizeVideoToCover();
});
function ie8Width(){
if($(window).width() >=1300){
$('.container').css('max-width','1100px');
}else{
$('.container').css('max-width','880px');
}}
if($(window).width() >=1300&&$('html').hasClass('no-video')){ $('.container').css('max-width','1100px'); $(window).resize(ie8Width); };
function smartResizeInit(){
carouselHeightCalcs();
clientsCarouselHeightRecalc();
portfolioCommentOrder();
testimonialHeightResize();
testimonialSliderHeight();
fullWidthContentColumns();
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
parallaxRowsBGCals();
}
slideOutWidgetOverflowState();
recentPostHeight();
morphingOutlines();
if($('.slide-out-widget-area-toggle a.open').length > 0&&$('#header-outer[data-full-width="true"]').length > 0) fullWidthHeaderSlidingWidgetMenuCalc();
}
$(window).off('smartresize.srInit');
$(window).on('smartresize.srInit', smartResizeInit);
function resizeInit(){
portfolioDeviceCheck();
fullWidthSections();
fullwidthImgOnlySizing();
fullWidthContentColumns();
fullWidthRowPaddingAdjustCalc();
responsiveVideoIframes();
videoshortcodeSize();
if($('.nectar-social.full-width').length > 0){
nectarLoveFWCenter();
}
if($('body').hasClass('ascend')){
searchFieldCenter();
}
if($('body').hasClass('single-post')) centerPostNextButtonImg();
sidebarPxConversion();
headerSpace();
if($('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) vcMobileColumns();
if($('body[data-footer-reveal="1"]').length > 0) footerRevealCalcs();
if($('#page-header-bg').length > 0) pageHeader();
if($('.nectar-video-bg').length > 0){
resizeVideoToCover();
}}
$(window).off('resize.srInit');
$(window).on('resize.srInit', resizeInit);
$(window).on("orientationchange",function(){
setTimeout(clientsCarouselHeightRecalc,200);
});
function postNextButtonEffect(){
$('.blog_next_prev_buttons').imagesLoaded(function(){
centerPostNextButtonImg();
$('.blog_next_prev_buttons img').css('opacity','1');
if(!$('body').hasClass('mobile')&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
$('.blog_next_prev_buttons img').panr({
scaleDuration: .28,
sensitivity: 22,
scaleTo: 1.06
});
}});
}
function centerPostNextButtonImg(){
if($('.blog_next_prev_buttons').length==0) return false;
if($('.blog_next_prev_buttons img').height() >=$('.blog_next_prev_buttons').height() + 50){
var $height='auto';
var $width=$('.blog_next_prev_buttons').width();
}else{
if($('.blog_next_prev_buttons').width() < $('.blog_next_prev_buttons img').width()){
var $height=$('.blog_next_prev_buttons').height() + 49;
var $width='auto';
}else{
var $height='auto';
var $width='100%';
}}
$('.blog_next_prev_buttons img').css({ 'height':$height, 'width': $width });
$('.blog_next_prev_buttons img').css({
'top':($('.blog_next_prev_buttons').height()/2) - ($('.blog_next_prev_buttons img').height()/2) + 'px',
'left':($('.blog_next_prev_buttons').width()/2) - ($('.blog_next_prev_buttons img').width()/2) + 'px'
});
$('.blog_next_prev_buttons .inner').each(function(){
$(this).css({'top': $(this).parent().height()/2 - ($(this).height()/2), 'opacity':'1' });
})
}
postNextButtonEffect();
function recentPostHeight(){
$('.blog-recent[data-style="title_only"]').each(function(){
if($(this).find('> .col').length > 1) return false;
if($(this).parent().parent().hasClass('vc_col-sm-3') ||
$(this).parent().parent().hasClass('vc_col-sm-4') ||
$(this).parent().parent().hasClass('vc_col-sm-6') ||
$(this).parent().parent().hasClass('vc_col-sm-8') ||
$(this).parent().parent().hasClass('vc_col-sm-9')){
if($('body.mobile').length==0&&$(this).next('div').length==0){
var tallestColumn=0;
$(this).find('> .col').css('padding', '50px 20px');
$(this).parents('.wpb_row').find('> .span_12 > .wpb_column').each(function(){
(Math.floor($(this).height()) > tallestColumn) ? tallestColumn=Math.floor($(this).height()):tallestColumn=tallestColumn;
});
if(Math.floor($(this).find('> .col').outerHeight(true)) < Math.floor($(this).parents('.wpb_row').height()) - 1){
$(this).find('> .col').css('padding-top',(tallestColumn-$(this).find('> .col').height())/2 + 'px');
$(this).find('> .col').css('padding-bottom',(tallestColumn-$(this).find('> .col').height())/2 + 'px');
}}else{
$(this).find('> .col').css('padding', '50px 20px');
}}
});
}
recentPostHeight();
function recentPostsFlickityInit(){
if($('.nectar-recent-posts-slider-inner').length==0) return false;
var $rpF=$('.nectar-recent-posts-slider-inner').flickity({
contain: true,
draggable: true,
lazyLoad: false,
imagesLoaded: true,
percentPosition: true,
prevNextButtons: false,
pageDots: true,
resize: true,
setGallerySize: true,
wrapAround: true,
accessibility: false
});
setTimeout(function(){
$('.nectar-recent-posts-slider-inner').addClass('loaded');
},1150);
var flkty=$rpF.data('flickity');
$rpF.on('dragStart', function(){
$('.flickity-viewport').addClass('is-moving');
});
$rpF.on('dragEnd', function(){
$('.flickity-viewport').removeClass('is-moving');
});
recentPostSliderHeight();
$(window).resize(recentPostSliderHeight);
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/))
$(window).resize(recentPostSliderParallaxMargins);
function recentPostSliderHeight(){
$('.nectar-recent-posts-slider').each(function(){
var $heightCalc;
var $minHeight=250;
var $windowWidth=$(window).width();
var $definedHeight=parseInt($(this).attr('data-height'));
var dif=($('body[data-ext-responsive="true"]').length > 0) ? $(window).width() / 1400:$(window).width() / 1100;
if(window.innerWidth > 1000&&$('#boxed').length==0){
if($(this).parents('.full-width-content').length==0){
if($('body[data-ext-responsive="true"]').length > 0&&window.innerWidth >=1400){
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight));
}else if($('body[data-ext-responsive="true"]').length==0&&window.innerWidth >=1100){
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight));
}else{
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
}}else{
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
}}else{
var $parentCol=($(this).parents('.wpb_column').length > 0) ? $(this).parents('.wpb_column'):$(this).parents('.col') ;
if($parentCol.length==0) $parentCol=$('.main-content');
if(!$parentCol.hasClass('vc_span12')&&!$parentCol.hasClass('main-content')&&!$parentCol.hasClass('span_12')&&!$parentCol.hasClass('vc_col-sm-12')){
var $parentColWidth=sliderColumnDesktopWidth($parentCol);
var $aspectRatio=$definedHeight/$parentColWidth;
if($aspectRatio*$parentCol.width() <=$minHeight){
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$minHeight);
}else{
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$aspectRatio*$parentCol.width());
}}else{
if($definedHeight*dif <=$minHeight){
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$minHeight);
}else{
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
}}
}});
}
function sliderColumnDesktopWidth(parentCol){
var $parentColWidth=1100;
var $columnNumberParsed=$(parentCol).attr('class').match(/\d+/);
if($columnNumberParsed=='2'){ $parentColWidth=170 }
else if($columnNumberParsed=='3'){ $parentColWidth=260 }
else if($columnNumberParsed=='4'){ $parentColWidth=340 }
else if($columnNumberParsed=='6'){ $parentColWidth=530 }
else if($columnNumberParsed=='8'){ $parentColWidth=700 }
else if($columnNumberParsed=='9'){ $parentColWidth=805 }
else if($columnNumberParsed=='10'){ $parentColWidth=916.3 }
else if($columnNumberParsed=='12'){ $parentColWidth=1100 }
return $parentColWidth;
}}
recentPostsFlickityInit();
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/))
window.requestAnimationFrame(recentPostSliderParallax);
function recentPostSliderParallax(){
$('.nectar-recent-posts-slider').each(function(){
var $offset=parseInt($(this).find('.flickity-slider').position().left);
var $slideLength=$(this).find('.nectar-recent-post-slide').length;
var $lastChildIndex=$(this).find('.nectar-recent-post-slide:last-child').index();
var $slideWidth=$(this).find('.nectar-recent-post-slide').width();
if($offset >=-3){
$(this).find('.nectar-recent-post-slide:last-child .nectar-recent-post-bg').css('margin-left',parseInt(Math.ceil($slideWidth/3.5))+'px');
}else{
$(this).find('.nectar-recent-post-slide:last-child .nectar-recent-post-bg').css('margin-left','-'+parseInt(Math.ceil($slideWidth/3.5*$lastChildIndex))+'px');
}
if(Math.abs($offset) >=($slideLength-1) * $slideWidth){
$(this).find('.nectar-recent-post-slide:first-child .nectar-recent-post-bg').css('margin-left','-'+parseInt(Math.ceil(($slideWidth/3.5)*$slideLength))+'px');
}else{
$(this).find('.nectar-recent-post-slide:first-child .nectar-recent-post-bg').css('margin-left','0px');
}
$(this).find('.nectar-recent-post-bg').css('transform','translateX('+Math.ceil($(this).find('.flickity-slider').position().left/-3.5)+'px)');
});
requestAnimationFrame(recentPostSliderParallax);
}
function recentPostSliderParallaxMargins(){
$('.nectar-recent-posts-slider').each(function(){
var $slideWidth=$(this).find('.nectar-recent-post-slide').width();
$(this).find('.nectar-recent-post-slide').each(function(i){
$(this).find('.nectar-recent-post-bg').css('margin-left','-'+ parseInt(Math.ceil($slideWidth/3.5)*i)+'px');
});
});
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/))
recentPostSliderParallaxMargins();
function portfolioHoverEffects(){
if(!$('body').hasClass('mobile')&&!navigator.userAgent.match(/(iPad|IEMobile)/)){
$('.portfolio-items .col .work-item:not(.style-3-alt):not(.style-3):not([data-custom-content="on"])').hover(function(){
$(this).find('.work-info .vert-center').css({'margin-top':0});
$(this).find('.work-info, .work-info .vert-center *, .work-info > i').css({'opacity':1});
$(this).find('.work-info-bg').css({ 'opacity':0.9 });
},function(){
$(this).find('.work-info .vert-center').css({ 'margin-top':-20 });
$(this).find('.work-info, .work-info .vert-center *, .work-info > i').css({ 'opacity':0 });
$(this).find('.work-info-bg').css({ 'opacity':0 });
});
$('.portfolio-items .col .work-item.style-3').hover(function(){
$(this).find('.work-info-bg').css({ 'opacity':0 });
},function(){
$(this).find('.work-info-bg').css({ 'opacity':0.45 });
});
$('.portfolio-items .col .work-item.style-4').hover(function(){
$(this).find('img').stop().animate({
'top':'-'+$(this).find('.work-info .bottom-meta').outerHeight()/2+'px'
},250,'easeOutCubic');
$(this).find('.work-info .bottom-meta').addClass('shown').stop().animate({
'bottom':'0px'
},320,'easeOutCubic');
},function(){
$(this).find('img').stop().animate({
'top':'0px'
},250,'easeOutCubic');
$(this).find('.work-info .bottom-meta').removeClass('shown').stop().animate({
'bottom':'-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px'
},320,'easeOutCubic');
});
}else{
portfolioDeviceCheck();
}}
portfolioHoverEffects();
function style6Img(){
$('.style-5').each(function(){
$(this).find('.sizer').insertBefore($(this).find('.parallaxImg'));
});
$('.style-5').parents('.wpb_row').css('z-index','100');
var d=document,
de=d.documentElement,
bd=d.getElementsByTagName('body')[0],
htm=d.getElementsByTagName('html')[0],
win=window,
imgs=d.querySelectorAll('.parallaxImg'),
totalImgs=imgs.length,
supportsTouch='ontouchstart' in win||navigator.msMaxTouchPoints;
if(totalImgs <=0){
return;
}
for(var l=0;l ');
if(!(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1)){ $(thisImg).parent().append(shadowHTML); }
var w=thisImg.clientWidth||thisImg.offsetWidth||thisImg.scrollWidth;
if(supportsTouch){
/*win.preventScroll=false;
(function(_thisImg,_layers,_totalLayers,_shine){
$(thisImg).parents('.style-5').on('touchmove', function(e){
if(win.preventScroll){
e.preventDefault();
}
window.requestAnimationFrame(function(){
processMovement(e,true,_thisImg,_layers,_totalLayers,_shine);
});
});
$(thisImg).parents('.style-5').on('touchstart', function(e){
win.preventScroll=true;
processEnter(e,_thisImg,_layers,_totalLayers,_shine);
});
$(thisImg).parents('.style-5').on('touchend', function(e){
win.preventScroll=false;
processExit(e,_thisImg,_layers,_totalLayers,_shine);
});
})(thisImg,layers,totalLayerElems,shineHTML); */
}else{
(function(_thisImg,_layers,_totalLayers,_shine){
$(thisImg).parents('.style-5').on('mousemove', function(e){
var now=Date.now();
if(now > lastMove + eventThrottle){
lastMove=now;
window.requestAnimationFrame(function(){
processMovement(e,false,_thisImg,_layers,_totalLayers,_shine);
});
}});
$(thisImg).parents('.style-5').on('mouseenter', function(e){
processEnter(e,_thisImg,_layers,_totalLayers,_shine);
});
$(thisImg).parents('.style-5').on('mouseleave', function(e){
processExit(e,_thisImg,_layers,_totalLayers,_shine);
});
})(thisImg,layers,totalLayerElems,shineHTML);
}
(function(_thisImg,_layers,_totalLayers,_shine){
depths(false,_thisImg,_layers,_totalLayers,_shine);
window.addEventListener('resize', function(e){
depths(false,_thisImg,_layers,_totalLayers,_shine);
});
})(thisImg,layers,totalLayerElems,shineHTML);
}
function processMovement(e, touchEnabled, elem, layers, totalLayers, shine){
if(!$(elem.firstChild).hasClass('over')){ processExit(e,elem,layers,totalLayers,shine); return false }
if($(elem).parents('.col.wide').length > 0){
var yMult=0.03;
var xMult=0.063;
}else if($(elem).parents('.col.regular').length > 0){
var yMult=0.045;
var xMult=0.045;
}else if($(elem).parents('.col.tall').length > 0){
var yMult=0.05;
var xMult=0.015;
}else if($(elem).parents('.col.wide_tall').length > 0){
var yMult=0.04;
var xMult=0.04;
}else{
var yMult=0.045;
var xMult=0.075;
}
var bdst=bd.scrollTop||htm.scrollTop,
bdsl=bd.scrollLeft,
pageX=(touchEnabled)? e.touches[0].pageX:e.pageX,
pageY=(touchEnabled)? e.touches[0].pageY:e.pageY,
offsets=elem.getBoundingClientRect(),
w=elem.clientWidth||elem.offsetWidth||elem.scrollWidth,
h=elem.clientHeight||elem.offsetHeight||elem.scrollHeight,
wMultiple=320/w,
offsetX=0.52 - (pageX - offsets.left - bdsl)/w,
offsetY=0.52 - (pageY - offsets.top - bdst)/h,
dy=(pageY - offsets.top - bdst) - h / 2,
dx=(pageX - offsets.left - bdsl) - w / 2,
yRotate=(offsetX - dx)*(yMult * wMultiple),
xRotate=(dy - offsetY)*(xMult * wMultiple);
if($(elem).parents('.wide_tall').length==0&&$(elem).parents('.wide').length==0&&$(elem).parents('.tall').length==0){
var imgCSS=' perspective('+ w*3 +'px) rotateX(' + xRotate + 'deg) rotateY(' + yRotate + 'deg) translateY('+offsetY*-10+'px) translateX('+offsetX*-10+'px) scale(1.03)';
}else{
var imgCSS=' perspective('+ w*3 +'px) rotateX(' + xRotate + 'deg) rotateY(' + yRotate + 'deg) translateY('+offsetY*-10+'px) translateX('+offsetX*-10+'px) scale(1.013)';
}
if(elem.firstChild.className.indexOf(' over')!=-1){
if($(elem).parents('.portfolio-items.masonry-items').length > 0){
}else{
}}
$(elem).find('.parallaxImg-container').css('transform',imgCSS);
if(!(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1)){
$(elem).parents('.parallaxImg-wrap').find('.parallaxImg-shadow').css('transform',imgCSS);
}}
function processShineMovement(e, touchEnabled, elem, layers, totalLayers, shine){
var bdst=bd.scrollTop||htm.scrollTop,
bdsl=bd.scrollLeft,
pageX=(touchEnabled)? e.touches[0].pageX:e.pageX,
pageY=(touchEnabled)? e.touches[0].pageY:e.pageY,
offsets=elem.getBoundingClientRect(),
w=elem.clientWidth||elem.offsetWidth||elem.scrollWidth,
h=elem.clientHeight||elem.offsetHeight||elem.scrollHeight,
wMultiple=320/w,
offsetX=0.52 - (pageX - offsets.left - bdsl)/w,
offsetY=0.52 - (pageY - offsets.top - bdst)/h,
dy=(pageY - offsets.top - bdst) - h / 2,
dx=(pageX - offsets.left - bdsl) - w / 2,
yRotate=(offsetX - dx)*(0.040 * wMultiple),
xRotate=(dy - offsetY)*(0.070 * wMultiple),
arad=Math.atan2(dy, dx),
angle=arad * 180 / Math.PI - 90;
if(angle < 0){
angle=angle + 360;
}
shine.style.background='linear-gradient(' + angle + 'deg, rgba(255,255,255,' + (pageY - offsets.top - bdst)/h * 0.3 + ') 0%,rgba(255,255,255,0) 80%)';
shine.style.transform='translateX(' + (offsetX * totalLayers) - 0.1 + 'px) translateY(' + (offsetY * totalLayers) - 0.1 + 'px) ';
}
function processEnter(e, elem, layers, totalLayers, shine){
elem.firstChild.className +=' over';
elem.className +=' over';
$(elem).addClass('transition');
var $timeout=setTimeout(function(){ $(elem).removeClass('transition'); },200);
}
function processExit(e, elem, layers, totalLayers, shine){
var w=elem.clientWidth||elem.offsetWidth||elem.scrollWidth;
var container=elem.firstChild;
container.className=container.className.replace(' over','');
elem.className=elem.className.replace(' over','');
$(container).css('transform', 'perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0)');
$(elem).parents('.parallaxImg-wrap').find('.parallaxImg-shadow').css('transform','perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0)');
$(elem).addClass('transition');
var $timeout=setTimeout(function(){ $(elem).removeClass('transition'); },200);
}
function depths(touchEnabled, elem, layers, totalLayers, shine){
var w=elem.clientWidth||elem.offsetWidth||elem.scrollWidth;
var revNum=totalLayers;
var container=elem.firstChild;
for(var ly=0;ly 0){
$('.portfolio-items .col .work-item').find('a.pp').css('display','none');
}else{
$('.portfolio-items .col .work-item').find('a:not(".pp")').css('display','none');
}}else{
$('.portfolio-items .col .work-item').find('a').css('display','inline');
}}
function portfolioAccentColor(){
var portfolioSocialColorCss='';
$('.portfolio-items .col').each(function(){
if($(this).has('[data-project-color]')){
$(this).find('.work-info-bg, .bottom-meta').css('background-color',$(this).attr('data-project-color'));
$(this).find('.parallaxImg-rendered-layer .bg-overlay').css('border-color',$(this).attr('data-project-color'));
var $projColor=$(this).attr('data-project-color');
if($(this).find('.custom-content .nectar-social').length > 0&&$('body[data-button-style="rounded"]')) portfolioSocialColorCss +='body[data-button-style="rounded"] .col[data-project-color="'+$projColor+'"] .custom-content .nectar-social > *:hover i { color: '+ $projColor +'!important; } ';
}});
if(portfolioSocialColorCss.length > 1){
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=portfolioSocialColorCss;
}else{
style.appendChild(document.createTextNode(portfolioSocialColorCss));
}
head.appendChild(style);
}}
portfolioAccentColor();
$('body').on('mouseenter','.portfolio-filters',function(){
$(this).find('> ul').stop(true,true).slideDown(500,'easeOutExpo');
$(this).find('a#sort-portfolio span').html($(this).find('a#sort-portfolio').attr('data-sortable-label'));
});
$('body').on('mouseleave','.portfolio-filters',function(){
var $activeCat=$(this).find('a.active').html();
if(typeof $activeCat=='undefined'||$activeCat.length==0) $activeCat=$(this).attr('data-sortable-label');
$(this).find('a#sort-portfolio span').html($activeCat);
$(this).find('> ul').stop(true,true).slideUp(500,'easeOutExpo');
});
$('body').on('click','.portfolio-filters ul li a', function(){
$(this).parents('.portfolio-filters').find('#sort-portfolio span').html($(this).html());
});
$('body').on('click','.portfolio-filters-inline ul li a',function(){
$(this).parents('ul').find('li a').removeClass('active');
$(this).addClass('active');
$(this).parents('.portfolio-filters-inline').find('#current-category').html($(this).html());
});
function portfolioFiltersInit(){
if($('body').hasClass('mobile')||navigator.userAgent.match(/(iPad|IEMobile)/)){
$('.portfolio-filters').unbind('mouseenter mouseleave');
$('.portfolio-filters > a, .portfolio-filters ul li a').click(function(e){
if(e.originalEvent!==undefined) $(this).parents('.portfolio-filters').find('> ul').stop(true,true).slideToggle(600,'easeOutCubic');
});
}
$('.portfolio-filters-inline .container > ul > li:nth-child(2) a').click();
$('body.single-portfolio #header-outer nav > ul > li > a:contains("Portfolio")').parents('li').addClass('current-menu-item');
$('body.single-post #header-outer nav > ul > li > a:contains("Blog")').parents('li').addClass('current-menu-item');
}
portfolioFiltersInit();
function centerLove(){
$('.post').each(function(){
var $loveWidth=$(this).find('.post-meta .nectar-love').outerWidth();
var $loveWrapWidth=$(this).find('.post-meta .nectar-love-wrap').width();
$(this).find('.post-meta .nectar-love').css('margin-left', $loveWrapWidth/2 - $loveWidth/2 + 'px');
$(this).find('.nectar-love-wrap').css('visibility','visible');
});
}
$('.nectar-love').on('click',function(){
centerLove();
});
centerLove();
function portfolioCommentOrder(){
if($('body').hasClass('mobile')&&$('body').hasClass('single-portfolio')&&$('#respond').length > 0){
$('#sidebar').insertBefore('.comments-section');
}
else if($('body').hasClass('single-portfolio')&&$('#respond').length > 0){
$('#sidebar').insertAfter('#post-area');
}}
portfolioCommentOrder();
var sidebarFollow=$('.single-portfolio #sidebar').attr('data-follow-on-scroll');
function portfolioSidebarFollow(){
sidebarFollow=$('.single-portfolio #sidebar').attr('data-follow-on-scroll');
if($('body.single-portfolio').length > 0&&sidebarFollow==1&&!$('body').hasClass('mobile')&&parseInt($('#sidebar').height()) + 50 <=parseInt($('#post-area').height())){
$('#sidebar').addClass('fixed-sidebar');
var $footer=($('.comment-wrap.full-width-section').length==0) ? '#footer-outer':'.comment-wrap';
if($('#call-to-action').length > 0) $footer='#call-to-action';
sidebarPxConversion();
$('#sidebar').stickyMojo({footerID: $footer, contentID: '#post-area'});
}}
function sidebarPxConversion(){
if($('body.single-portfolio').length > 0&&sidebarFollow==1&&!$('body').hasClass('mobile')){
var $containerWidth=$('.main-content > .row').width();
var $sidebarWidth=$containerWidth*.235;
if(window.innerWidth > 1300){
$sidebarWidth=$containerWidth*.235;
}else if(window.innerWidth < 1300&&window.innerWidth > 1000){
$sidebarWidth=$containerWidth*.273;
}
$('#sidebar').css('width',$sidebarWidth+'px');
}}
$(window).load(function(){
setTimeout(portfolioSidebarFollow,200);
});
function isotopeCatSelection(){
$('.portfolio-items:not(".carousel")').each(function(){
var isotopeCatArr=[];
var $portfolioCatCount=0;
$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(i){
if($(this).find('a').length > 0){
isotopeCatArr[$portfolioCatCount]=$(this).find('a').attr('data-filter').substring(1);
$portfolioCatCount++;
}});
isotopeCatArr.shift();
var itemCats='';
$(this).find('> div').each(function(i){
itemCats +=$(this).attr('data-project-cat');
});
itemCats=itemCats.split(' ');
itemCats.pop();
itemCats=$.unique(itemCats);
if($(this).attr('data-categories-to-show').length!=0&&$(this).attr('data-categories-to-show')!='all'){
$userSelectedCats=$(this).attr('data-categories-to-show').replace(/,/g , ' ');
$userSelectedCats=$userSelectedCats.split(' ');
if(!$(this).hasClass('infinite_scroll')) $(this).removeAttr('data-categories-to-show');
}else{
$userSelectedCats=itemCats;
}
var notFoundCats=[];
$.grep(isotopeCatArr, function(el){
if($.inArray(el, itemCats)==-1) notFoundCats.push(el);
if($.inArray(el, $userSelectedCats)==-1) notFoundCats.push(el);
});
if(notFoundCats.length!=0){
$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(){
if($(this).find('a').length > 0){
if($.inArray($(this).find('a').attr('data-filter').substring(1), notFoundCats)!=-1){
$(this).hide();
}else{
$(this).show();
}}
})
}});
}
isotopeCatSelection();
/*jQuery.sharedCount=function(url, fn){
url=encodeURIComponent(url||location.href);
var arg={
url: "//" + (location.protocol=="https:" ? "sharedcount.appspot":"api.sharedcount") + ".com/?url=" + url,
cache: true,
dataType: "json"
};
if('withCredentials' in new XMLHttpRequest){
arg.success=fn;
}else{
var cb="sc_" + url.replace(/\W/g, '');
window[cb]=fn;
arg.jsonpCallback=cb;
arg.dataType +="p";
}
return jQuery.ajax(arg);
};*/
var completed=0;
var windowLocation=window.location.href.replace(window.location.hash, '');
function facebookShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
window.open('https://www.facebook.com/sharer/sharer.php?u='+windowLocation, "facebookWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function googlePlusShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
window.open('https://plus.google.com/share?url='+windowLocation, "googlePlusWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function twitterShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
if($(".section-title h1").length > 0){
var $pageTitle=encodeURIComponent($(".section-title h1").text());
}else{
var $pageTitle=encodeURIComponent($(document).find("title").text());
}
window.open('http://twitter.com/intent/tweet?text='+$pageTitle +' '+windowLocation, "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function wooTwitterShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
window.open('http://twitter.com/intent/tweet?text='+$("h1.product_title").text() +' '+windowLocation, "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function linkedInShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
if($(".section-title h1").length > 0){
var $pageTitle=encodeURIComponent($(".section-title h1").text());
}else{
var $pageTitle=encodeURIComponent($(document).find("title").text());
}
window.open('http://www.linkedin.com/shareArticle?mini=true&url='+windowLocation+'&title='+$pageTitle+'', "linkedInWindow", "height=480,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function woolinkedInShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
window.open('http://www.linkedin.com/shareArticle?mini=true&url='+windowLocation+'&title='+$("h1.product_title").text(), "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function pinterestShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
var $sharingImg=($('.single-portfolio').length > 0&&$('div[data-featured-img]').attr('data-featured-img')!='empty') ? $('div[data-featured-img]').attr('data-featured-img'):$('#ajax-content-wrap img').first().attr('src');
if($(".section-title h1").length > 0){
var $pageTitle=encodeURIComponent($(".section-title h1").text());
}else{
var $pageTitle=encodeURIComponent($(document).find("title").text());
}
window.open('http://pinterest.com/pin/create/button/?url='+windowLocation+'&media='+$sharingImg+'&description='+$pageTitle, "pinterestWindow", "height=640,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function wooPinterestShare(){
$imgToShare=($('img.attachment-shop_single').length > 0) ? $('img.attachment-shop_single').first().attr('src'):$('.single-product-main-image img').first().attr('src');
windowLocation=window.location.href.replace(window.location.hash, '');
window.open('http://pinterest.com/pin/create/button/?url='+windowLocation+'&media='+$imgToShare+'&description='+$('h1.product_title').text(), "pinterestWindow", "height=640,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function socialFade(){
if(completed==$('a.nectar-sharing').length&&$('a.nectar-sharing').parent().hasClass('in-sight')){
$('.nectar-social .nectar-love span').show(350,'easeOutSine',function(){
$(this).stop().animate({'opacity':1},800);
});
$('.nectar-social > a').each(function(i){
var $that=$(this);
$(this).find('> span').show(350,'easeOutSine',function(){
$that.find('> span').stop().animate({'opacity':1},800);
});
});
var $totalShares=0;
$('.nectar-social > a .count').each(function(){
$totalShares +=parseInt($(this).html());
});
if($totalShares!=1){
$('.single .meta-share-count .plural').css({'opacity':'1', 'display':'inline'});
$('.single .meta-share-count .singular').remove();
}else{
$('.single .meta-share-count .singular').css({'opacity':'1', 'position':'relative', 'display':'inline'});
$('.single .meta-share-count .plural').remove();
}
$('.meta-share-count .share-count-total').html($totalShares).css('opacity',1);
}}
$('body').on('click','#single-below-header .nectar-social a', function(){ return false; });
$('body').on('click','.facebook-share:not(.inactive)', facebookShare);
$('body').on('click','.google-plus-share:not(.inactive)', googlePlusShare);
$('body').on('click','.nectar-social:not(".woo") .twitter-share:not(.inactive)', twitterShare);
$('body').on('click','.nectar-social.woo .twitter-share', wooTwitterShare);
$('body').on('click','.nectar-social:not(".woo") .linkedin-share:not(.inactive)', linkedInShare);
$('body').on('click','.nectar-social.woo .linkedin-share', woolinkedInShare);
$('body').on('click','.nectar-social:not(".woo") .pinterest-share:not(.inactive)', pinterestShare);
$('body').on('click','.nectar-social.woo .pinterest-share', wooPinterestShare);
function socialSharingInit(){
if($('body').hasClass('mobile')&&$('.single-post .fullscreen-header').length > 0){
$('#single-below-header .nectar-social .nectar-sharing, #single-below-header .nectar-social .nectar-sharing-alt').addClass('inactive');
}
completed=0;
if($('a.facebook-share').length > 0||$('a.twitter-share').length > 0||$('a.google-plus-share').length > 0||$('a.linkedin-share').length > 0||$('a.pinterest-share').length > 0){
if($('a.facebook-share:not(.sharing-default-minimal a.facebook-share)').length > 0&&$('body[data-button-style="rounded"]').length==0||$('#project-meta a.facebook-share').length > 0||$('#single-meta a.facebook-share').length > 0||$('#single-below-header .facebook-share').length > 0){
$.getJSON("https://graph.facebook.com/?id="+ windowLocation +'&callback=?', function(data){
if((data.shares!=0)&&(data.shares!=undefined)&&(data.shares!=null)){
$('.facebook-share a span.count, a.facebook-share span.count').html(data.shares);
}else{
$('.facebook-share a span.count, a.facebook-share span.count').html(0);
}
completed++;
socialFade();
});
}else if($('a.facebook-share').length > 0&&$('body[data-button-style="rounded"]').length > 0||$('.sharing-default-minimal a.facebook-share').length > 0){
completed++;
socialFade();
}
if($('a.twitter-share:not(.sharing-default-minimal a.twitter-share)').length > 0&&$('body[data-button-style="rounded"]').length==0||$('#project-meta a.twitter-share').length > 0||$('#single-meta a.twitter-share').length > 0||$('#single-below-header .twitter-share').length > 0){
$('.twitter-share a span.count, a.twitter-share span.count').html(0);
completed++;
socialFade();
}else if($('a.twitter-share').length > 0&&$('body[data-button-style="rounded"]').length > 0||$('.sharing-default-minimal a.twitter-share').length > 0){
completed++;
socialFade();
}
if($('a.linkedin-share:not(.sharing-default-minimal a.linkedin-share)').length > 0&&$('body[data-button-style="rounded"]').length==0||$('#project-meta a.linkedin-share').length > 0||$('#single-meta a.linkedin-share').length > 0||$('#single-below-header .linkedin-share').length > 0){
$('.linkedin-share a span.count, a.linkedin-share span.count').html(0);
completed++;
socialFade();
}else if($('a.linkedin-share').length > 0&&$('body[data-button-style="rounded"]').length > 0||$('.sharing-default-minimal a.linkedin-share').length > 0){
completed++;
socialFade();
}
if($('a.pinterest-share:not(.sharing-default-minimal a.pinterest-share)').length > 0&&$('body[data-button-style="rounded"]').length==0||$('#project-meta a.pinterest-share').length > 0||$('#single-meta a.pinterest-share').length > 0||$('#single-below-header .pinterest-share').length > 0){
$.getJSON('https://api.pinterest.com/v1/urls/count.json?url='+windowLocation+'&callback=?', function(data){
if((data.count!=0)&&(data.count!=undefined)&&(data.count!=null)){
$('.pinterest-share a span.count, a.pinterest-share span.count').html(data.count);
}else{
$('.pinterest-share a span.count, a.pinterest-share span.count').html(0);
}
completed++;
socialFade();
});
}else if($('a.pinterest-share').length > 0&&$('body[data-button-style="rounded"]').length > 0||$('.sharing-default-minimal a.pinterest-share').length > 0){
completed++;
socialFade();
}
$('a.nectar-sharing > span.count, a.nectar-sharing-alt > span.count').hide().css('width','auto');
$('.nectar-social').each(function(){
if($(this).parents('.custom-content').length==0){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
$slide_timeout=($('#page-header-bg[data-animate-in-effect="slide-down"] .nectar-social').length > 0) ? 900:1;
setTimeout(function(){
$that.addClass('in-sight');
socialFade();
if($('#page-header-bg .nectar-social').length==0){
$that.find('> *').each(function(i){
var $that=$(this);
var $timeout=($('body[data-button-style="rounded"]').length > 0) ? 0: 750;
setTimeout(function(){
$that.delay(i*80).queue(function(){
var $that=$(this); $(this).addClass('hovered');
setTimeout(function(){
$that.removeClass('hovered');
},300);
});
},$timeout);
});
}},$slide_timeout);
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
}});
}}
socialSharingInit();
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
var $socialTimeout;
$('body').on('mouseenter','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
clearTimeout($socialTimeout);
if($(this).parents('[id*="single-meta"]').length > 0&&$('[data-tab-pos="fullwidth"]').length==0)
$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'right':'0px'},0);
else
$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'left':'0px'},0);
$(this).parents('[id*="-meta"]').addClass('social-hovered');
$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':0},250);
$(this).find('.nectar-social a').each(function(i){
$(this).stop(true).delay(i*40).animate({'opacity': 1, 'left':'0px'}, 150);
});
});
$('body').on('mouseleave','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
$(this).parents('[id*="-meta"]').removeClass('social-hovered');
if($(this).parents('[id*="single-meta"]').length > 0&&$('[data-tab-pos="fullwidth"]').length==0)
$(this).find('.nectar-social').stop(true).animate({'opacity': 0, 'right':'-20px'}, 200);
else
$(this).find('.nectar-social').stop(true).animate({'opacity': 0, 'left':'-20px'}, 200);
$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':1},250);
var $that=$(this);
$socialTimeout=setTimeout(function(){
$that.find('.nectar-social').hide();
if($that.parents('[id*="single-meta"]').length > 0&&$('[data-tab-pos="fullwidth"]').length==0)
$that.find('.nectar-social a').stop(true).animate({'opacity': 0, 'left':'20px'},0);
else
$that.find('.nectar-social a').stop(true).animate({'opacity': 0, 'left':'-20px'},0);
}, 200);
});
}else{
var $socialTimeout;
$('body').on('click','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
clearTimeout($socialTimeout);
if($(this).parents('[id*="single-meta"]').length > 0&&$('[data-tab-pos="fullwidth"]').length==0)
$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'right':'0px'},0);
else
$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'left':'0px'},0);
$(this).parents('[id*="-meta"]').addClass('social-hovered');
$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':0},250);
$(this).find('.nectar-social a').each(function(i){
$(this).stop(true).delay(i*40).animate({'opacity': 1, 'left':'0px'}, 150);
});
return false;
});
}
$('body').on('mouseenter','.fullscreen-header .meta-share-count', function(){
$(this).find('> a, > i').stop(true).animate({'opacity': 0},400);
$(this).find('.nectar-social > *').each(function(i){
$(this).stop(true).delay(i*50).animate({'opacity':'1', 'top': '0px'},250,'easeOutCubic');
});
setTimeout(function(){ $('.meta-share-count .nectar-sharing, .meta-share-count .nectar-sharing-alt').removeClass('inactive'); },300);
});
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
$('body').on('mouseleave','.fullscreen-header .meta-share-count', function(){
$(this).find('> a, > i').stop(true).animate({'opacity': 1},300,'easeInCubic');
$(this).find('.nectar-social > *').each(function(i){
$(this).stop(true).animate({'opacity':'0', 'top': '10px'},200,'easeInCubic');
});
});
}
function nectarLoveFWCenter(){
$('.nectar-social.full-width').each(function(){
$(this).find('.n-shortcode .nectar-love').css('padding-top', $(this).find('> a').css('padding-top'));
});
}
nectarLoveFWCenter();
$('body').on('click','.nectar-love', function(){
var $loveLink=$(this);
var $id=$(this).attr('id');
var $that=$(this);
if($loveLink.hasClass('loved')) return false;
if($(this).hasClass('inactive')) return false;
var $dataToPass={
action: 'nectar-love',
loves_id: $id,
love_nonce: nectarLove.loveNonce
}
$.post(nectarLove.ajaxurl, $dataToPass, function(data){
$loveLink.find('span').html(data);
$loveLink.addClass('loved').attr('title','You already love this!');
$loveLink.find('span').css({'opacity': 1,'width':'auto'});
if($('body').hasClass('ascend')&&$that.parents('.classic_enhanced').length==0){
$loveLink.find('.icon-salient-heart.loved').show().transition({ scale: 1 },800,'cubic-bezier(0.15, 0.84, 0.35, 1.5)');
setTimeout(function(){ $loveLink.find('.icon-salient-heart-2').css('opacity','0'); },400);
if($loveLink.parents('.sharing-default-minimal').length > 0&&$loveLink.parents('.bottom-meta').length >0) $loveLink.find('.icon-salient-heart-2').remove();
}else if($that.parents('.classic_enhanced').length > 0){
$that.find('.icon-salient-heart-2').addClass('loved');
}});
$(this).addClass('inactive');
return false;
});
function infiniteScrollInit(){
if($('.infinite_scroll').length > 0){
$('.portfolio-items.infinite_scroll').infinitescroll({
navSelector:"div#pagination",
nextSelector:"div#pagination a:first",
itemSelector:".portfolio-items.infinite_scroll .element",
finishedMsg: "Congratulations, you've reached the end of the internet. ",
msgText: " ",
},function(newElements){
var $container=$('.portfolio-items.infinite_scroll:not(.carousel)');
var $newElems=$(newElements).css('opacity',0);
$newElems.imagesLoaded(function(){
$(newElements).css('opacity',1);
$container.isotope('appended', $(newElements));
$(newElements).find('.work-item').addClass('ajax-loaded');
$(newElements).addClass('ajax-loaded');
$(newElements).find('.work-meta, .nectar-love-wrap').css({'opacity':1});
if($('.portfolio-filters-inline').length > 0||$('.portfolio-filters').length > 0){
if($('.portfolio-filters-inline').length > 0){
var selector=$('.portfolio-filters-inline a.active').attr('data-filter');
}else{
var selector=$('.portfolio-filters a.active').attr('data-filter');
}
$('.portfolio-filters-inline a.active').attr('data-filter');
$container.isotope({ filter: selector });
}
portfolioItemWidths();
reLayout();
if($(newElements).find('.work-item.style-5').length > 0) style6Img();
if($(newElements).find('.inner-wrap').attr('data-animation')=='none'){
$('.portfolio-items .col .inner-wrap').removeClass('animated');
}else{
$(newElements).each(function(i){
$(this).delay(130*i).queue(function(next){
$(this).addClass("animated-in");
next();
});
});
}
portfolioHoverEffects();
portfolioAccentColor();
if($smoothCache==true&&$(window).width() > 690&&$('body').outerHeight(true) > $(window).height()&&Modernizr.csstransforms3d&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ niceScrollInit(); $(window).trigger('resize') }
if(!$('body').hasClass('mobile')&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
$(".portfolio-items:not(.carousel) .work-item.style-3 img").panr({
scaleDuration: .28
});
$(".portfolio-items:not(.carousel) .work-item.style-3-alt img").panr({ scaleDuration: .28, sensitivity: 12.6, scaleTo: 1.08, panDuration: 3 });
}
$('.portfolio-items').each(function(){
var $unique_id=Math.floor(Math.random()*10000);
$(this).find('a[rel^="prettyPhoto"], a.pretty_photo').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo');
});
lightBoxInit();
piVertCenter();
setTimeout(function(){masonryZindex(); reLayout(); $(newElements).removeClass('ajax-loaded'); },700);
isotopeCatSelection();
parallaxRowsBGCals();
});
});
$('#post-area.infinite_scroll .posts-container').infinitescroll({
navSelector:"div#pagination",
nextSelector:"div#pagination a:first",
itemSelector:"#post-area .posts-container .post",
finishedMsg: "Congratulations, you've reached the end of the internet. ",
msgText: " "
},function(newElements){
if($('.masonry.meta_overlaid').length==0){
centerLove();
$(newElements).find('.flex-gallery').each(function(){
var $that=$(this);
$that.flexslider({
animation: 'fade',
smoothHeight: false,
animationSpeed: 500,
useCSS: false,
touch: true
});
$('.flex-gallery .flex-direction-nav li a.flex-next').html(' ');
$('.flex-gallery .flex-direction-nav li a.flex-prev').html(' ');
});
if($().mediaelementplayer) $(newElements).find('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer();
lightBoxInit();
if($('.carousel').length > 0){
standardCarouselInit();
clientsCarouselInit();
}
showLateIframes();
$(newElements).find('.nectar-milestone').each(function(){
if($(this).has('[data-symbol]')){
if($(this).attr('data-symbol-pos')=='before'){
$(this).find('.number').prepend($(this).attr('data-symbol'));
}else{
$(this).find('.number').append($(this).attr('data-symbol'));
}}
});
if(!$('body').hasClass('mobile')){
$(newElements).find('.nectar-milestone').each(function(){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
var $endNum=parseInt($that.find('.number span').text());
$that.find('.number span').countTo({
from: 0,
to: $endNum,
speed: 1500,
refreshInterval: 30
});
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
});
}
if($().vcChat) $(newElements).find('.vc_pie_chart').vcChat();
nectar_fancy_ul_init();
$('.testimonial_slider').animate({'opacity':'1'},800);
createTestimonialControls();
testimonialSliderHeight();
testimonialHeightResize();
$(newElements).find('.nectar-progress-bar').each(function(i){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
var percent=$that.find('span').attr('data-width');
var $endNum=parseInt($that.find('span strong i').text());
$that.find('span').transition({
'width':percent + '%'
},1600, 'easeInOutCirc',function(){
});
$that.find('span strong').transition({
'opacity':1
},1350);
$that.find('span strong i').countTo({
from: 0,
to: $endNum,
speed: 1100,
refreshInterval: 30,
onComplete: function(){
}});
if(percent=='100'){
$that.find('span strong').addClass('full');
}
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
});
colAndImgAnimations();
splitLineHeadings();
setTimeout(function(){
videoshortcodeSize();
responsiveVideoIframesInit();
responsiveVideoIframes();
$(window).trigger('resize');
},500);
parallaxRowsBGCals();
$(window).trigger('resize');
}else{
parallaxRowsBGCals();
$(window).trigger('resize');
}
var $container=$('.posts-container');
if($container.parent().hasClass('masonry')){
$(newElements).addClass('masonry-blog-item');
$(newElements).prepend(' ');
$(newElements).each(function(){
var $metaClone=$(this).find('.post-meta').clone();
$(this).find('.post-meta').remove();
if($('#post-area.meta_overlaid').length > 0){
$(this).find('.post-header h2').after($metaClone);
}else{
$(this).find('.content-inner').after($metaClone);
}});
}
var $newElems=$(newElements);
if($newElems.find('img').length==0) $newElems=$('body');
$newElems.imagesLoaded(function(){
$container.isotope('appended', $(newElements));
flickityBlogInit();
$(newElements).addClass('ajax-loaded');
if($container.parent().hasClass('classic_enhanced')){
$container.find('.large_featured.has-post-thumbnail.ajax-loaded .post-featured-img, .wide_tall.has-post-thumbnail.ajax-loaded .post-featured-img').each(function(){
var $src=$(this).find('img').attr('src');
$(this).css('background-image','url('+$src+')');
});
$container.find('.large_featured.ajax-loaded .nectar-flickity, .wide_tall.ajax-loaded .nectar-flickity').each(function(){
$(this).find('.cell').each(function(){
var $src=$(this).find('img').attr('src');
$(this).css('background-image','url('+$src+')');
});
});
}
if($(newElements).parents('.posts-container').attr('data-animation')=='none'){
$(newElements).find('.inner-wrap').removeClass('animated');
}else{
$(newElements).each(function(i){
$(this).delay(130*i).queue(function(next){
$(this).addClass("animated-in");
next();
});
});
}
setTimeout(function(){$(newElements).removeClass('ajax-loaded'); },700);
});
});
}}
infiniteScrollInit();
function destroyInfiniteScroll(){
$('#post-area.infinite_scroll .posts-container').infinitescroll('destroy');
$('.portfolio-items.infinite_scroll').infinitescroll('destroy');
}
$(window).scroll(function(){
var scroll=$(window).scrollTop();
if(scroll >=150){
$("#header-outer").addClass("homeani");
}else{
$("#header-outer").removeClass("homeani");
}});
var $scrollTop=$(window).scrollTop();
function toTopBind(){
if($('#to-top').length > 0&&$(window).width() > 1020||$('#to-top').length > 0&&$('#to-top.mobile-enabled').length > 0){
if($scrollTop > 350){
$(window).on('scroll',hideToTop);
}else{
$(window).on('scroll',showToTop);
}}
}
toTopBind();
function showToTop(){
if($scrollTop > 350&&$('#slide-out-widget-area.fullscreen.open').length==0){
$('#to-top').stop().transition({
'bottom':'17px'
},350,'easeInOutCubic');
$(window).off('scroll',showToTop);
$(window).on('scroll',hideToTop);
}}
function hideToTop(){
if($scrollTop < 350||$('#slide-out-widget-area.fullscreen.open').length > 0){
$animationTiming=($('#slide-out-widget-area.fullscreen.open').length > 0) ? 1150:350;
$('#to-top').stop().transition({
'bottom':'-30px'
},$animationTiming,'easeInOutQuint');
$(window).off('scroll',hideToTop);
$(window).on('scroll',showToTop);
}}
if($('#to-top').length > 0){
var $windowHeight, $pageHeight, $footerHeight, $ctaHeight;
function calcToTopColor(){
$scrollTop=$(window).scrollTop();
$windowHeight=$(window).height();
$pageHeight=$('body').height();
$footerHeight=$('#footer-outer').height();
$ctaHeight=($('#call-to-action').length > 0) ? $('#call-to-action').height():0;
if(($scrollTop-35 + $windowHeight) >=($pageHeight - $footerHeight)&&$('#boxed').length==0){
$('#to-top').addClass('dark');
}else{
$('#to-top').removeClass('dark');
}}
$(window).scroll(calcToTopColor);
$(window).resize(calcToTopColor);
}
if($('body[data-button-style="rounded"]').length > 0){
var $clone=$('#to-top .icon-angle-up').clone();
$clone.addClass('top-icon');
$('#to-top').prepend($clone)
}
$('body').on('click','#to-top, a[href="#top"]',function(){
$('body,html').stop().animate({
scrollTop:0
},800,'easeOutQuad',function(){
if($('.nectar-box-roll').length > 0){
$('body').trigger('mousewheel', [1, 0, 0]);
}})
return false;
});
function scrollSpyInit(){
$("#header-outer a[href*='" + location.pathname + "']").each(function(){
var $href=$(this).attr('href');
if($href.indexOf("#")!=-1&&$('div'+$href.substr($href.indexOf("#"))).length > 0){
$(this).attr('href',$href.substr($href.indexOf("#")));
$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
}});
$target=($('.page-submenu[data-sticky="true"]').length==0) ? '#header-outer nav': '.page-submenu';
$('body').scrollspy({
target: $target,
offset: $('#header-outer').height() + adminBarHeight + 40
});
}
function pageLoadHash(){
var $hash=window.location.hash;
if($hash&&$($hash).length > 0){
$timeoutVar=0;
if($('.nectar-box-roll').length > 0&&$('.container-wrap.bottomBoxOut').length > 0){
boxRoll(null,-1);
$timeoutVar=2050;
}
setTimeout(function(){
if($('body[data-permanent-transparent="1"]').length==0){
if(!$('body').hasClass('mobile')){
$resize=($('#header-outer[data-header-resize="0"]').length > 0) ? 0:parseInt(shrinkNum) + headerPadding2*2;
var $scrollTopDistance=$($hash).offset().top - parseInt($('#header-space').height()) +$resize + 3 - adminBarHeight;
}else{
var $scrollTopDistance=($('#header-outer[data-mobile-fixed="1"]').length > 0) ? $($hash).offset().top + 2 - $('#header-space').height() + adminBarHeight:$($hash).offset().top - adminBarHeight + 1;
}}else{
var $scrollTopDistance=$($hash).offset().top - adminBarHeight + 1;
}
var $pageSubMenu=($('.page-submenu[data-sticky="true"]').length > 0) ? $('.page-submenu').height():0;
$('body,html').stop().animate({
scrollTop: $scrollTopDistance - $pageSubMenu
},800,'easeInOutCubic');
},$timeoutVar);
}}
if($('body[data-animated-anchors="true"]').length > 0){
+ function(t){
"use strict";
function s(e, i){
var r=t.proxy(this.process, this);
this.$body=t("body"), this.$scrollElement=t(t(e).is("body") ? window:e), this.options=t.extend({}, s.DEFAULTS, i), this.selector=(this.options.target||"") + " ul li > a", this.offsets=[], this.targets=[], this.activeTarget=null, this.scrollHeight=0, this.$scrollElement.on("scroll.bs.scrollspy", r), this.refresh(), this.process()
}
function e(e){
return this.each(function(){
var i=t(this),
r=i.data("bs.scrollspy"),
o="object"==typeof e&&e;
r||i.data("bs.scrollspy", r=new s(this, o)), "string"==typeof e&&r[e]()
})
}
s.VERSION="3.2.0", s.DEFAULTS={
offset: 10
}, s.prototype.getScrollHeight=function(){
return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
}, s.prototype.refresh=function(){
var s="offset",
e=0;
t.isWindow(this.$scrollElement[0])||(s="position", e=this.$scrollElement.scrollTop()), this.offsets=[], this.targets=[], this.scrollHeight=this.getScrollHeight();
var i=this;
this.$body.find(this.selector).map(function(){
var i=t(this),
r=i.data("target")||i.attr("href"),
o=/^#./.test(r)&&t(r);
return o&&o.length&&o.is(":visible")&&[
[o[s]().top + e, r]
]||null
}).sort(function(t, s){
return t[0] - s[0]
}).each(function(){
i.offsets.push(this[0]), i.targets.push(this[1])
})
}, s.prototype.process=function(){
var $pageSubMenu=($('.page-submenu[data-sticky="true"]').length > 0&&$('body[data-hhun="1"]').length==0) ? $('.page-submenu').height():0;
var t, s=this.$scrollElement.scrollTop() + this.options.offset + $pageSubMenu,
e=this.getScrollHeight(),
i=this.options.offset + e - this.$scrollElement.height() -$pageSubMenu,
r=this.offsets,
o=this.targets,
l=this.activeTarget;
if(this.scrollHeight!=e&&this.refresh(), s >=i) return l!=(t=o[o.length - 1])&&this.activate(t);
if(l&&s <=r[0]) return l!=(t=o[0])&&this.activate(t);
for (t=r.length; t--;) l!=o[t]&&s >=r[t]&&(!r[t + 1]||s <=r[t + 1])&&this.activate(o[t])
}, s.prototype.activate=function(s){
this.activeTarget=s, t(this.selector).parentsUntil(this.options.target, ".current-menu-item").removeClass("current-menu-item").removeClass('sfHover');
var e=this.selector + '[data-target="' + s + '"],' + this.selector + '[href="' + s + '"]',
i=t(e).parents("li").addClass("current-menu-item");
i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("current-menu-item")), i.trigger("activate.bs.scrollspy")
};
var i=t.fn.scrollspy;
t.fn.scrollspy=e, t.fn.scrollspy.Constructor=s, t.fn.scrollspy.noConflict=function(){
return t.fn.scrollspy=i, this
}}(jQuery);
var shrinkNum=6;
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
headerPadding2=headerPadding - headerPadding/1.8;
setTimeout(scrollSpyInit,200);
var $animatedScrollingTimeout;
$('body').on('click','#header-outer nav .sf-menu a, #footer-outer .nectar-button, .container-wrap a:not(.wpb_tabs_nav a):not(.woocommerce-tabs a), .swiper-slide .button a, #slide-out-widget-area a, #mobile-menu .container ul li a, #slide-out-widget-area .inner div a',function(e){
var $hash=$(this).prop("hash");
$('body').addClass('animated-scrolling');
clearTimeout($animatedScrollingTimeout);
$animatedScrollingTimeout=setTimeout(function(){ $('body').removeClass('animated-scrolling'); },850);
if($hash&&$($hash).length > 0&&$hash!='#top'&&$hash!=''&&$(this).attr('href').indexOf(window.location.href.split("#")[0])!==-1||$(this).is('[href^="#"]')&&$hash!=''&&$($hash).length > 0&&$hash!='#top'){
if(history.pushState){
history.pushState(null, null, $hash);
}else{
location.hash=$hash;
}
if($(this).parents('ul').length > 0){
$(this).parents('ul').find('li').removeClass('current-menu-item');
}
if($(this).parents('#slide-out-widget-area').length > 0){
$('#slide-out-widget-area .slide_out_area_close').trigger('click');
}
if($(this).parents('#mobile-menu').length > 0) $('#toggle-nav').trigger('click');
var $mobileMenuHeight=($(this).parents('#mobile-menu').length > 0) ? $(this).parents('#mobile-menu').height():null;
$timeoutVar=1;
if($('.nectar-box-roll').length > 0&&$('.container-wrap.bottomBoxOut').length > 0){
boxRoll(null,-1);
$timeoutVar=2050;
}
var $that=$(this);
setTimeout(function(){
var $headerSpace=($('body[data-permanent-transparent="1"]').length > 0) ? 0:parseInt($('#header-space').height());
if($('body[data-permanent-transparent="1"]').length==0){
if(!$('body').hasClass('mobile')){
$resize=($('#header-outer[data-header-resize="0"]').length > 0) ? 0:parseInt(shrinkNum) + headerPadding2*2;
var $scrollTopDistance=$($hash).offset().top - $mobileMenuHeight - parseInt($('#header-space').height()) +$resize + 3 - adminBarHeight;
}else{
var $scrollTopDistance=($('#header-outer[data-mobile-fixed="1"]').length > 0) ? $($hash).offset().top + 2 - $('#header-space').height() + adminBarHeight:$($hash).offset().top - $mobileMenuHeight - adminBarHeight + 1;
}}else{
var $scrollTopDistance=$($hash).offset().top - adminBarHeight + 1;
}
if($('body[data-hhun="1"]').length > 0){
if($('#header-outer.detached').length==0||$that.parents('.page-submenu[data-sticky="true"]').length > 0)
$scrollTopDistance=$scrollTopDistance + $('#header-space').height();
if($that.parents('.page-submenu[data-sticky="true"]').length > 0){
$('#header-outer.detached').addClass('invisible');
$('.page-submenu').addClass('header-not-visible').css('transform','translateY(0px)');
}}
var $pageSubMenu=($that.parents('.page-submenu[data-sticky="true"]').length > 0) ? $that.parents('.page-submenu').height():0;
$('body,html').stop().animate({
scrollTop: $scrollTopDistance - $pageSubMenu
},800,'easeInOutCubic');
},$timeoutVar);
e.preventDefault();
}
if($hash=='#top'){
if($(this).parents('#slide-out-widget-area').length > 0){
$('#slide-out-widget-area .slide_out_area_close').trigger('click');
}}
});
if($('.nectar-box-roll').length==0) $(window).load(pageLoadHash);
}
if($('.portfolio-items .col .style-3-alt').length > 0||$('.portfolio-items .col .style-3').length > 0||$('.portfolio-items .col .style-2').length > 0||$('.portfolio-items .col .style-5').length > 0){
var portfolioColorCss='';
$('.portfolio-items .col').each(function(){
$titleColor=$(this).attr('data-title-color');
$subTitleColor=$(this).attr('data-subtitle-color');
if($titleColor.length > 0) portfolioColorCss +='.col[data-title-color="'+$titleColor+'"] .vert-center h3, .portfolio-items[data-ps="6"] .col[data-title-color="'+$titleColor+'"] .work-meta h4 { color: '+$titleColor+'; } ';
if($subTitleColor.length > 0) portfolioColorCss +='.col[data-subtitle-color="'+$subTitleColor+'"] .vert-center p, .portfolio-items[data-ps="6"] .col[data-title-color="'+$titleColor+'"] .work-meta p { color: '+$subTitleColor+'; } ';
});
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=portfolioColorCss;
}else{
style.appendChild(document.createTextNode(portfolioColorCss));
}
head.appendChild(style);
}
var $portfolio_containers=[];
$('.portfolio-items:not(.carousel)').each(function(i){
$portfolio_containers[i]=$(this);
});
function masonryPortfolioInit(){
$portfolio_containers=[];
$('.portfolio-items:not(.carousel)').each(function(i){
$portfolio_containers[i]=$(this);
});
var $window=jQuery(window);
$.each($portfolio_containers,function(i){
$portfolio_containers[i].imagesLoaded(function(){
if($smoothCache==true&&$(window).width() > 690&&$('body').outerHeight(true) > $(window).height()&&Modernizr.csstransforms3d&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ niceScrollInit(); $(window).trigger('resize') }
var $isoUseTransforms=true;
if(!$('body').hasClass('mobile')&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
$(".portfolio-items:not(.carousel) .work-item.style-3 img").panr({ scaleDuration: .28 });
$(".portfolio-items:not(.carousel) .work-item.style-3-alt img").panr({ scaleDuration: .28, sensitivity: 20, scaleTo: 1.12, panDuration: 1 });
$isoUseTransforms=true;
}
piVertCenter();
var $layoutMode=($portfolio_containers[i].hasClass('masonry-items')) ? 'packery':'fitRows';
var $startingFilter=($portfolio_containers[i].attr('data-starting-filter')!=''&&$portfolio_containers[i].attr('data-starting-filter')!='default') ? '.' + $portfolio_containers[i].attr('data-starting-filter'):'*';
reLayout();
$portfolio_containers[i].isotope({
itemSelector:'.element',
filter: $startingFilter,
layoutMode: $layoutMode,
transitionDuration: '0.6s',
packery: {
gutter: 0
}}).isotope('layout');
if($startingFilter!='*'){
$('.portfolio-filters ul a[data-filter="'+$startingFilter+'"], .portfolio-filters-inline ul a[data-filter="'+$startingFilter+'"]').click();
}
masonryZindex();
setTimeout(function(){masonryZindex(); },800);
$window.resize(reLayout);
$window.smartresize(function(){
setTimeout(masonryZindex,700);
});
if($portfolio_containers[i].parents('.full-width-content').length > 0){ setTimeout(function(){ fullWidthContentColumns(); },200); }
$('.portfolio-loading').stop(true,true).fadeOut(200);
if($portfolio_containers[i].find('.inner-wrap').attr('data-animation')=='none'){
$('.portfolio-items .col .inner-wrap').removeClass('animated');
}else{
$('.portfolio-items').each(function(){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
$that.find('.col').each(function(i){
$(this).delay(130*i).queue(function(next){
$(this).addClass("animated-in");
next();
});
});
waypoint.destroy();
},
offset: '90%'
});
});
}});
});
}
masonryPortfolioInit();
var mediaQuerySize;
function reLayout(){
clearTimeout(clearIsoAnimation);
$('.portfolio-items .col').addClass('no-transition');
clearIsoAnimation=setTimeout(function(){ $('.portfolio-items .col').removeClass('no-transition'); },700);
var windowSize=$window.width();
var masonryObj;
var masonryObjHolder=[];
var userDefinedColWidth;
$.each($portfolio_containers,function(i){
if($portfolio_containers[i].attr('data-user-defined-cols')=='span4'){
userDefinedColWidth=3
}
else if($portfolio_containers[i].attr('data-user-defined-cols')=='span3'){
userDefinedColWidth=4
}
var isFullWidth=$portfolio_containers[i].attr('data-col-num')=='elastic';
if(window.innerWidth > 1600){
if($portfolio_containers[i].hasClass('constrain-max-cols')){
mediaQuerySize='four';
}else{
mediaQuerySize='five';
}}else if(window.innerWidth <=1600&&window.innerWidth > 1300){
mediaQuerySize='four';
}else if(window.innerWidth <=1300&&window.innerWidth > 990){
if($portfolio_containers[i].hasClass('constrain-max-cols')){
mediaQuerySize='four';
}else{
mediaQuerySize='three';
}}else if(window.innerWidth <=990&&window.innerWidth > 470){
mediaQuerySize='two';
}else if(window.innerWidth <=470){
mediaQuerySize='one';
}
if($('#boxed').length > 0){
if(window.innerWidth > 1300){
mediaQuerySize='four';
}else if(window.innerWidth < 1300&&window.innerWidth > 990){
if($portfolio_containers[i].hasClass('constrain-max-cols')){
mediaQuerySize='four';
}else{
mediaQuerySize='three';
}}else if(window.innerWidth < 990){
mediaQuerySize='one';
}}
switch (mediaQuerySize){
case 'five':
(isFullWidth) ? colWidth=5:colWidth=userDefinedColWidth;
masonryObj={ columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
break;
case 'four':
(isFullWidth) ? colWidth=4:colWidth=userDefinedColWidth;
masonryObj={ columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
break;
case 'three':
(isFullWidth) ? colWidth=3:colWidth=userDefinedColWidth;
masonryObj={ columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
break;
case 'two':
masonryObj={ columnWidth: Math.floor($portfolio_containers[i].width() / 2) };
break;
case 'one':
masonryObj={ columnWidth: Math.floor($portfolio_containers[i].width() / 1) };
break;
}
portfolioItemWidths();
if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length > 0||$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="wide"]:first:visible').length > 0||$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"]:first:visible').length > 0||$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="wide_tall"]:first:visible').length > 0){
var multipler=(window.innerWidth > 470) ? 2:1;
$itemClassForSizing='regular';
if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length==0&&$portfolio_containers[i].find('.col.elastic-portfolio-item.wide:first:visible').length > 0){
$itemClassForSizing='wide';
}else if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length==0&&$portfolio_containers[i].find('.col.elastic-portfolio-item.wide_tall:first:visible').length > 0){
$itemClassForSizing='wide_tall';
multipler=1;
}else if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length==0&&$portfolio_containers[i].find('.col.elastic-portfolio-item.tall:first:visible').length > 0){
$itemClassForSizing='tall';
multipler=1;
}
$portfolio_containers[i].find('.col.elastic-portfolio-item.'+$itemClassForSizing+' img').css('height','auto');
var tallColHeight=$portfolio_containers[i].find('.col.elastic-portfolio-item.'+$itemClassForSizing+':first:visible img').height();
$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img, .col.elastic-portfolio-item.wide img, .col.elastic-portfolio-item.regular img').removeClass('auto-height');
$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img:not(.custom-thumbnail)').css('height',(tallColHeight*multipler));
$portfolio_containers[i].find('.col.elastic-portfolio-item.wide img:not(.custom-thumbnail), .col.elastic-portfolio-item.regular img:not(.custom-thumbnail)').css('height',tallColHeight);
$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] .parallaxImg').css('height',(tallColHeight*multipler) + parseInt($portfolio_containers[i].find('.col.elastic-portfolio-item').css('padding-bottom'))*2);
$portfolio_containers[i].find('.col.elastic-portfolio-item.regular .parallaxImg, .col.elastic-portfolio-item.wide .parallaxImg').css('height',tallColHeight);
}else{
$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img, .col.elastic-portfolio-item.wide img, .col.elastic-portfolio-item.regular img').addClass('auto-height');
}
if($portfolio_containers[i].hasClass('no-masonry')&&$portfolio_containers[i].find('.col:first:visible').length > 0&&$portfolio_containers[i].parents('.wpb_gallery').length==0){
$portfolio_containers[i].find('.col img').css('height','auto');
var tallColHeight=$portfolio_containers[i].find('.col:first:visible img').height();
$portfolio_containers[i].find('.col img:not(.custom-thumbnail)').css('height',tallColHeight);
$portfolio_containers[i].find('.col .parallaxImg').css('height',tallColHeight);
}
masonryObjHolder[i]=masonryObj;
if($portfolio_containers[i].isotope()) $portfolio_containers[i].isotope('layout');
});
}
function portfolioItemWidths(){
$.each($portfolio_containers,function(i,v){
var $colSize=4;
var $mult=(mediaQuerySize=='one') ? 1:2;
if(mediaQuerySize=='five') $colSize=5;
if(mediaQuerySize=='four') $colSize=4;
if(mediaQuerySize=='three') $colSize=3;
if(mediaQuerySize=='two') $colSize=2;
if(mediaQuerySize=='one') $colSize=1;
if($(v).is('[data-ps="6"]')&&$colSize==5) $colSize=4;
if($(v).width() % $colSize==0){
$(v).find('.elastic-portfolio-item:not(.wide):not(.wide_tall)').css('width',Math.floor($(v).width()/$colSize) +'px');
$(v).find('.elastic-portfolio-item.wide, .elastic-portfolio-item.wide_tall').css('width',Math.floor($(v).width()/$colSize*$mult) +'px');
}else{
for(var i=1; i<4; i++){
if(($(v).width() - i) % $colSize==0){
$(v).find('.elastic-portfolio-item:not(.wide):not(.wide_tall)').css('width',($(v).width()- i)/$colSize +'px');
$(v).find('.elastic-portfolio-item.wide, .elastic-portfolio-item.wide_tall').css('width',($(v).width()-i)/$colSize*$mult +'px');
}}
}});
}
function masonryZindex(){
if($('body .portfolio-items:not(".carousel") .elastic-portfolio-item').css('left')){
var $coords={};
var $zindexRelation={};
$('body .portfolio-items:not(".carousel") .elastic-portfolio-item').each(function(){
$(this).css('z-index',Math.abs(Math.floor($(this).offset().left/20)));
});
/*var $corrdsArr=$.map($coords, function (value){ return value; });
$corrdsArr=removeDuplicates($corrdsArr);
$corrdsArr.sort(function(a,b){return a-b});
for(var i=0; i < $corrdsArr.length; i++){
$zindexRelation[$corrdsArr[i]]=i*10;
}
$.each($coords,function(k,v){
var $zindex;
var $coordCache=v;
$.each($zindexRelation,function(k,v){
if($coordCache==k){
$zindex=v;
}});
$('body .portfolio-items:not(".carousel") .elastic-portfolio-item:eq('+k+')').css('z-index',$zindex);
});*/
}}
function blogMasonryZindex(){
if($('body .masonry.meta_overlaid .masonry-blog-item').css('left')){
var $coords={};
var $zindexRelation={};
$('body .masonry.meta_overlaid .masonry-blog-item').each(function(){
$coords[$(this).index()]=$(this).css('left').substring(0, $(this).css('left').length - 2);
});
var $corrdsArr=$.map($coords, function (value){ return value; });
$corrdsArr=removeDuplicates($corrdsArr);
$corrdsArr.sort(function(a,b){return a-b});
for(var i=0; i < $corrdsArr.length; i++){
$zindexRelation[$corrdsArr[i]]=i*10;
}
$.each($coords,function(k,v){
var $zindex;
var $coordCache=v;
$.each($zindexRelation,function(k,v){
if($coordCache==k){
$zindex=v;
}});
$('body .masonry.meta_overlaid .masonry-blog-item:eq('+k+')').css('z-index',$zindex);
});
}}
function matrixToArray(matrix){
return matrix.substr(7, matrix.length - 8).split(', ');
}
function removeDuplicates(inputArray){
var i;
var len=inputArray.length;
var outputArray=[];
var temp={};
for (i=0; i < len; i++){
temp[inputArray[i]]=0;
}
for (i in temp){
outputArray.push(i);
}
return outputArray;
}
var clearIsoAnimation=null;
var $checkForScrollBar=null;
$('.portfolio-items:not(".carousel")').each(function(i){
$(this).attr('instance',i);
$(this).parent().parent().find('div[class^=portfolio-filters]').attr('instance',i);
});
function isoClickFilter(){
var $timeout;
if(window.innerWidth > 690&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
/*clearInterval($checkForScrollBar);
if($('html').outerHeight(true) > $(window).height()){
$checkForScrollBar=null;
$checkForScrollBar=setInterval(function(){
if($('body').height() <=$(window).height()){
fullWidthSections();
$(window).trigger('resize');
clearInterval($checkForScrollBar);
}},40);
}else{
$checkForScrollBar=null;
$checkForScrollBar=setInterval(function(){
if($('html').outerHeight(true) > $(window).height()){
fullWidthSections();
$(window).trigger('resize');
clearInterval($checkForScrollBar);
}},40);
}*/
/* clearTimeout(clearIsoAnimation);
$('.isotope, .isotope .isotope-item').css('transition-duration','0.7s');
clearIsoAnimation=setTimeout(function(){ $('.isotope, .isotope .isotope-item').css('transition-duration','0s'); },700); */
clearTimeout($timeout);
$timeout=setTimeout(function(){masonryZindex(); },600);
}
var selector=$(this).attr('data-filter');
var $instance=$(this).parents('div[class^=portfolio-filters]').attr('instance');
$.each($portfolio_containers,function(i){
if($portfolio_containers[i].attr('instance')==$instance) $portfolio_containers[i].isotope({ filter: selector }).attr('data-current-cat',selector);
});
$(this).parent().parent().find('li a').removeClass('active');
$(this).addClass('active');
if($('.portfolio-items a[rel^="prettyPhoto"]').length > 0){
setTimeout(updatePrettyPhotoGallery,170);
}else{
setTimeout(updateMagPrettyPhotoGallery,170);
}
return false;
}
$('body').on('click','.portfolio-filters ul li a, .portfolio-filters-inline ul li a', isoClickFilter);
function updatePrettyPhotoGallery(){
$('.portfolio-items').each(function(){
if($(this).find('a[rel^="prettyPhoto"]').length > 0){
var $unique_id=Math.floor(Math.random()*10000);
var $currentCat=$(this).attr('data-current-cat');
$(this).find('.col'+$currentCat).find('a[rel^="prettyPhoto"]').attr('rel','prettyPhoto['+$unique_id+'_sorted]');
}});
}
function updateMagPrettyPhotoGallery(){
$('.portfolio-items').each(function(){
var $currentCat=$(this).attr('data-current-cat');
$(this).find('.col').each(function(){
$(this).find('a.gallery').removeClass('gallery').removeClass('magnific');
if($(this).is($currentCat))
$(this).find('.work-info a').addClass('gallery').addClass('magnific');
});
});
}
function masonryBlogInit(){
var $posts_container=$('.posts-container')
if($posts_container.parent().hasClass('masonry')){
$posts_container.find('article').addClass('masonry-blog-item');
$posts_container.find('article').prepend(' ');
$posts_container.find('article').each(function(){
var $metaClone=$(this).find('.post-meta').clone();
$(this).find('.post-meta').remove();
if($('#post-area.meta_overlaid').length > 0){
$(this).find('.post-header h2').after($metaClone);
}else{
$(this).find('.content-inner').after($metaClone);
}});
if($posts_container.parent().hasClass('masonry')&&$posts_container.parent().hasClass('full-width-content')){
$posts_container.parent().wrap('
').removeClass('full-width-content').css({'margin-left':'0','width':'auto'});
if($posts_container.parents('.wpb_row').length > 0) $posts_container.parents('.wpb_row').css('z-index',100);
if($('.masonry.meta_overlaid').length==0){
if($('.masonry.classic_enhanced').length > 0){
$posts_container.parent().parents('.full-width-content').css({
'padding':'0px 0.2% 0px 2.4%'
});
}else{
$posts_container.parent().parents('.full-width-content').css({
'padding':'0px 0.2% 0px 3.2%'
});
}}else{
$posts_container.parent().parents('.full-width-content').addClass('meta-overlaid');
$('.container-wrap').addClass('meta_overlaid_blog');
}
fullWidthSections();
}
var $cols=3;
var $element=$posts_container;
if($posts_container.find('img').length==0) $element=$(' ');
imagesLoaded($element,function(instance){
if($('body').hasClass('mobile')||$('#post-area').hasClass('span_9')){
$cols=2;
}
if($posts_container.parent().hasClass('classic_enhanced')){
$posts_container.find('.large_featured.has-post-thumbnail .post-featured-img, .wide_tall.has-post-thumbnail .post-featured-img').each(function(){
var $src=$(this).find('img').attr('src');
$(this).css('background-image','url('+$src+')');
});
$posts_container.find('.large_featured .nectar-flickity, .wide_tall .nectar-flickity').each(function(){
$(this).find('.cell').each(function(){
var $src=$(this).find('img').attr('src');
$(this).css('background-image','url('+$src+')');
});
});
}
$cols=blogColumnNumbCalcs();
blogHeightCalcs($posts_container, $cols);
if($('#post-area.meta_overlaid').length > 0){
$posts_container.isotope({
itemSelector: 'article',
transitionDuration: '0s',
layoutMode: 'packery',
packery: {
gutter: 0
}}).isotope('layout');
}else{
if($posts_container.parent().hasClass('classic_enhanced')){
if($('.span_9.masonry').length==0){
$multiplier=(window.innerWidth > 1600) ? .015 : .02;
}else{
$multiplier=.04;
}}else{
$multiplier=($('.span_9.masonry').length==0) ? .02: .04;
}
$posts_container.isotope({
itemSelector: 'article',
transitionDuration: '0s',
layoutMode: 'packery',
packery: {
gutter: $('#post-area').width()*$multiplier
}}).isotope('layout');
}
blogLoadIn();
flickityBlogInit();
$(window).trigger('resize');
blogMasonryZindex();
setTimeout(blogMasonryZindex,700);
$window.smartresize(function(){
setTimeout(blogMasonryZindex,700);
});
});
$(window).resize(function(){
$cols=blogColumnNumbCalcs();
blogHeightCalcs($posts_container, $cols);
if($('#post-area.meta_overlaid').length > 0){
$posts_container.isotope({
layoutMode: 'packery',
packery: {
gutter: 0
}});
}else{
if($posts_container.parent().hasClass('classic_enhanced')){
if($('.span_9.masonry').length==0){
$multiplier=(window.innerWidth > 1600) ? .015 : .02;
}else{
$multiplier=.04;
}}else{
$multiplier=($('.span_9.masonry').length==0) ? .02: .04;
}
$posts_container.isotope({
layoutMode: 'packery',
packery: {
gutter: $('#post-area').width()*$multiplier
}});
}});
}else{
blogLoadIn();
}}
masonryBlogInit();
function blogLoadIn(){
$('.posts-container').each(function(){
if($(this).attr('data-load-animation')=='none'){
$(this).find('.inner-wrap').removeClass('animated');
}else{
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
$that.find('article').each(function(i){
$(this).delay(130*i).queue(function(next){
$(this).addClass("animated-in");
next();
});
});
waypoint.destroy();
},
offset: '90%'
});
}});
}
function blogHeightCalcs($posts_container, cols){
if($posts_container.parent().hasClass('meta_overlaid')&&$posts_container.find('article[class*="regular"]').length > 0){
$.each($posts_container,function(i,v){
var $colSize=4;
var $mult=(cols==1) ? 1:2;
if($('html.no-csstransitions').length==0){
$(v).find('article[class*="regular"]').css('width',Math.floor($(v).width()/cols) +'px');
$(v).find('article[class*="tall"]').css('width',Math.floor($(v).width()/cols*$mult) +'px');
}else{
$('#post-area.masonry').css('width','100%');
}});
$posts_container.find('article[class*="regular"] img').css('height','auto');
var tallColHeight=Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote") img').first().height());
var multipler=(window.innerWidth > 470) ? 2:1 ;
$posts_container.find('article[class*="tall"] img, .article.wide img, article.regular img').removeClass('auto-height');
$posts_container.find('article[class*="tall"] img').css('height',(tallColHeight*multipler));
$posts_container.find('article[class*="regular"] img').css('height',(tallColHeight));
$posts_container.find('article.regular.format-link,article.regular.format-quote').each(function(){
if(window.innerWidth > 470){
$(this).css({
'height': tallColHeight
});
}else{
$(this).css({
'height': 'auto'
});
}});
}else{
$posts_container.find('article[class*="tall"] img, article.regular img').addClass('auto-height');
}
if($posts_container.parent().hasClass('classic_enhanced')&&$posts_container.find('article[class*="regular"]').length > 0){
if($(window).width() > 690)
classicEnhancedSizing($posts_container.find('article:not(.large_featured):not(.wide_tall)'));
else
classicEnhancedSizing($posts_container.find('article:not(.wide_tall)'));
var tallColHeight=($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().length > 0) ? Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().css('height','auto').height()):600;
if($(window).width() > 690)
$posts_container.find('article.large_featured, article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
else
$posts_container.find('article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
}else if($posts_container.parent().hasClass('classic_enhanced')&&$posts_container.find('article[class*="regular"]').length==0){
var tallColHeight=($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().length > 0) ? Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().css('height','auto').height()):600;
if($(window).width() > 690)
$posts_container.find('article.large_featured, article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
else
$posts_container.find('article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
}
if($('html.no-csstransitions').length > 0)
$('#post-area.masonry').css('width','100%');
}
function classicEnhancedSizing(elements){
var tallestCol=0;
elements.find('.article-content-wrap').css('height','auto');
elements.filter('.has-post-thumbnail').each(function(){
($(this).find('.article-content-wrap').outerHeight(true) > tallestCol) ? tallestCol=$(this).find('.article-content-wrap').outerHeight(true):tallestCol=tallestCol;
});
elements.filter('.has-post-thumbnail').find('.article-content-wrap').css('height',(tallestCol));
}
var blogMediaQuerySize;
function blogColumnNumbCalcs(){
if($('body').hasClass('mobile')&&window.innerWidth < 990||$('#post-area').hasClass('span_9')&&$('#post-area.meta_overlaid').length==0){
$cols=2;
}else if($('#post-area').hasClass('full-width-content')||$('#post-area').parent().hasClass('full-width-content')&&$('#boxed').length==0||$('#post-area.meta_overlaid').length > 0){
var windowSize=$(window).width();
if(window.innerWidth > 1600){
blogMediaQuerySize=($('#post-area.meta_overlaid').length > 0) ? 'four' :'five';
}else if(window.innerWidth <=1600&&window.innerWidth >=1300){
blogMediaQuerySize='four';
}else if(window.innerWidth < 1300&&window.innerWidth >=990){
blogMediaQuerySize=($('#post-area.meta_overlaid').length > 0) ? 'four' :'three';
}else if(window.innerWidth < 990&&window.innerWidth >=470){
blogMediaQuerySize='two';
}else if(window.innerWidth < 470){
blogMediaQuerySize=($('#post-area.meta_overlaid').length > 0) ? 'two' :'one';
}
if($('#boxed').length > 0){
if(window.innerWidth > 1300){
blogMediaQuerySize='four';
}else if(window.innerWidth < 1300&&window.innerWidth > 990){
blogMediaQuerySize=($('#post-area.meta_overlaid').length > 0) ? 'four' :'three';
}else if(window.innerWidth < 990){
blogMediaQuerySize=($('#post-area.meta_overlaid').length > 0) ? 'two' :'one';
}}
switch (blogMediaQuerySize){
case 'five':
$cols=5;
break;
case 'four':
$cols=4;
break;
case 'three':
$cols=3;
break;
case 'two':
$cols=2;
break;
case 'one':
$cols=1;
break;
}}else{
$cols=3;
}
return $cols;
}
var shrinkNum=6;
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
headerPadding2=headerPadding - headerPadding/1.8;
$('body').on('click','.section-down-arrow',function(){
if($(this).parents('.nectar-box-roll').length > 0) return false;
var $currentSection=$(this).parents('#page-header-bg');
var $topDistance=$currentSection.attr('data-height');
var $offset=($currentSection.parents('.first-section').length==0||$('body[data-transparent-header="false"]').length > 0) ? $currentSection.offset().top:0;
if($('body[data-permanent-transparent="1"]').length==0){
if(!$('body').hasClass('mobile')){
if($('body[data-hhun="1"]').length > 0){
$('body,html').stop().animate({
scrollTop: parseInt($topDistance) + $offset + 2
},1000,'easeInOutCubic')
}else{
$resize=($('#header-outer[data-header-resize="0"]').length > 0) ? 0:parseInt(shrinkNum) + headerPadding2*2;
$('body,html').stop().animate({
scrollTop: parseInt($topDistance - $('#header-space').height()) +$resize + 3 + $offset
},1000,'easeInOutCubic')
}}else{
$scrollPos=($('#header-outer[data-mobile-fixed="1"]').length > 0) ? parseInt($topDistance) - $('#header-space').height() + parseInt($currentSection.offset().top) + 2:parseInt($topDistance) + parseInt($currentSection.offset().top) + 2;
$('body,html').stop().animate({
scrollTop: $scrollPos
},1000,'easeInOutCubic')
}}else{
$('body,html').stop().animate({
scrollTop: parseInt($topDistance) + parseInt($currentSection.offset().top) + 2
},1000,'easeInOutCubic')
}
return false;
});
function crossBrowserFixes(){
if($("body").hasClass("single-portfolio")||$('body').hasClass("error404")||$('body').hasClass("search-results")){
$("li").removeClass("current_page_parent").removeClass("current-menu-ancestor").removeClass('current_page_ancestor');
}
$('.recent_projects_widget div a:nth-child(3n+3), #sidebar #flickr div:nth-child(3n+3) a, #footer-outer #flickr div:nth-child(3n+3) a').css('margin-right','0px');
$('code').find('br').remove();
if($('.container.main-content > .row > div:last-child').hasClass('clear')){
$('.container.main-content > .row > div:last-child').css('padding-bottom','0');
}
$('.container-wrap .blog-recent > div:last-child').addClass('col_last');
if($('.single .blog_next_prev_buttons').length > 0) $('.container-wrap').css('padding-bottom',0);
$('.wpcf7-form p:has(input[type=submit])').css('padding-bottom','0px');
$('.full-width-content .wpcf7-submit').on('click',function(){ setTimeout(function(){ fullWidthContentColumns() },1000); setTimeout(function(){ fullWidthContentColumns() },2000); });
$('#featured article').each(function(){
if($(this).find('h2').attr('data-has-caption')=='0'){
$(this).parents('.slide').addClass('no-caption');
}});
$('.gform_body').click(function(){
setTimeout(function(){ fullWidthContentColumns(); },200);
});
$('article.post.format-chat .content-inner dt:odd').css('color','#333');
$('.full-width-section').each(function(){
$(this).find('> .span_12 > div.col_last').last().css('margin-bottom','0');
});
$('#portfolio-extra p').each(function(){
if($(this).find('*').length==1&&$(this).find('img').length==1){
$(this).find('img').unwrap();
}});
$('.vc_text_separator').each(function(){
if($(this).parents('.full-width-section').length > 0) $(this).find('div').css('background-color',$(this).parents('.full-width-section').find('.row-bg').css('background-color'));
});
$('.carousel-heading').each(function(){
if($(this).find('h2').length > 0) $(this).find('.carousel-prev, .carousel-next').css('top','7px');
});
$('.carousel-wrap').each(function(){
if($(this).find('.carousel-heading .container:empty').length > 0) $(this).find('.carousel-heading').remove();
});
$('.woocommerce div.product div.images div.thumbnails a:nth-child(4n+4)').css('margin-right','0px');
$('article.post .gallery-slider .gallery, article.post .gallery-slider .jetpack-slideshow, .single-portfolio .gallery-slider .gallery, .single-portfolio .gallery-slider .jetpack-slideshow').remove();
$('.woocommerce .span_9 .products.related .products li:nth-child(4), .woocommerce .span_9 .products.upsells .products li:nth-child(4)').remove();
$('.woocommerce .span_9 .products.related .products li:nth-child(3), .woocommerce .span_9 .products.upsells .products li:nth-child(3)').css('margin-right','0');
$('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy');
$('div.clients').each(function(){
$(this).find('> div').each(function(){
if($(this).find('a').length==0){
$(this).addClass('no-link');
}});
});
if(nectarLove.disqusComments=='true') $('#post-area article a, .blog_next_prev_buttons a, #portfolio-nav #prev-link a, #portfolio-nav #next-link a, .portfolio-items .col .work-item .work-info a').addClass('no-ajaxy');
if($('.blog_next_prev_buttons').find('.bg-color-only-indicator').length > 0) $('.blog_next_prev_buttons').addClass('bg-color-only').find('.bg-color-only-indicator').remove();
if($('#single-below-header').hasClass('fullscreen-header')&&$('.blog_next_prev_buttons').length==0) $('#author-bio, .comment-wrap').addClass('lighter-grey');
if($('body.woocommerce').find('#page-header-bg').length > 0){
$('.container-wrap').css({'margin-top':'0px','padding-top':'30px'});
}
$('header#top nav .megamenu .sub-menu a.sf-with-ul .sf-sub-indicator').remove();
if($('.demo_store').length > 0) $('#header-outer, #header-space').css('margin-top','32px');
$('#footer-widgets .container .row > div:last-child').addClass('col_last');
$('.swiper-slide.external-button-1 .buttons > div:nth-child(1) a').attr('target','_blank');
$('.swiper-slide.external-button-2 .buttons > div:nth-child(2) a').attr('target','_blank');
$(".portfolio-items a[href*='http://']:not([href*='"+window.location.hostname+"']), .recent_projects_widget a[href*='http://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank");
$('.container-wrap .row > .wpb_row').each(function(){
if($(this).find('> .span_12 > .wpb_column > .wpb_wrapper').length > 0&&$(this).find('> .span_12 > .wpb_column > .wpb_wrapper').find('*').length==0) $(this).find('> .span_12 ').remove();
});
$('.full-width-content .col.boxed').removeClass('boxed');
$('.full-width-content .wpb_column .nectar-slider-wrap[data-full-width="true"]').attr('data-full-width','false');
if($('.nectar-slider-wrap.first-section').length==0 &&
$('.full-width-section.first-section > .span_12 > .vc_span12 > .wpb_wrapper > .nectar-slider-wrap').length==0 &&
$('.parallax_slider_outer.first-section').length==0 &&
$('.full-width-content.first-section .wpb_wrapper > .nectar-slider-wrap').length==0 &&
!($('.wpb_row.first-section > .nectar-parallax-scene').length==1&&$('#header-outer[data-transparent-header="true"]').length==1)){
$('#header-outer .ns-loading-cover').remove();
}
var $tmpTitle=null;
$('.portfolio-items > .col a[title]').hover(function(){
$tmpTitle=$(this).attr('title');
$(this).attr('title',' ');
},function(){
$(this).attr('title', $tmpTitle);
});
$('.portfolio-items > .col a[title]').click(function(){
$(this).attr('title', $tmpTitle);
});
};
crossBrowserFixes();
function wooPriceSlider(){
if(typeof woocommerce_price_slider_params==='undefined'||!$('body').hasClass('woocommerce')){
return false;
}
$('input#min_price, input#max_price').hide();
$('.price_slider, .price_label').show();
var min_price=$('.price_slider_amount #min_price').data('min'),
max_price=$('.price_slider_amount #max_price').data('max');
current_min_price=parseInt(min_price, 10);
current_max_price=parseInt(max_price, 10);
if(woocommerce_price_slider_params.min_price) current_min_price=parseInt(woocommerce_price_slider_params.min_price, 10);
if(woocommerce_price_slider_params.max_price) current_max_price=parseInt(woocommerce_price_slider_params.max_price, 10);
$('body').bind('price_slider_create price_slider_slide', function(event, min, max){
if(woocommerce_price_slider_params.currency_pos==='left'){
$('.price_slider_amount span.from').html(woocommerce_price_slider_params.currency_symbol + min);
$('.price_slider_amount span.to').html(woocommerce_price_slider_params.currency_symbol + max);
}else if(woocommerce_price_slider_params.currency_pos==='left_space'){
$('.price_slider_amount span.from').html(woocommerce_price_slider_params.currency_symbol + " " + min);
$('.price_slider_amount span.to').html(woocommerce_price_slider_params.currency_symbol + " " + max);
}else if(woocommerce_price_slider_params.currency_pos==='right'){
$('.price_slider_amount span.from').html(min + woocommerce_price_slider_params.currency_symbol);
$('.price_slider_amount span.to').html(max + woocommerce_price_slider_params.currency_symbol);
}else if(woocommerce_price_slider_params.currency_pos==='right_space'){
$('.price_slider_amount span.from').html(min + " " + woocommerce_price_slider_params.currency_symbol);
$('.price_slider_amount span.to').html(max + " " + woocommerce_price_slider_params.currency_symbol);
}
$('body').trigger('price_slider_updated', min, max);
});
$('.price_slider').slider({
range: true,
animate: true,
min: min_price,
max: max_price,
values: [ current_min_price, current_max_price ],
create:function(event, ui){
$('.price_slider_amount #min_price').val(current_min_price);
$('.price_slider_amount #max_price').val(current_max_price);
$('body').trigger('price_slider_create', [ current_min_price, current_max_price ]);
},
slide: function(event, ui){
$('input#min_price').val(ui.values[0]);
$('input#max_price').val(ui.values[1]);
$('body').trigger('price_slider_slide', [ ui.values[0], ui.values[1] ]);
},
change: function(event, ui){
$('body').trigger('price_slider_change', [ ui.values[0], ui.values[1] ]);
},
});
}
function vcMobileColumns(){
$('.wpb_row').each(function(){
if(typeof $(this).find('.span_12').offset()!='undefined'){
$(this).find('[class*="vc_col-"]').each(function(){
var $firstChildOffset=$(this).parents('.span_12').offset().left;
$(this).removeClass('no-left-margin');
if($(this).offset().left < $firstChildOffset + 27){
$(this).addClass('no-left-margin');
}else{
$(this).removeClass('no-left-margin');
}});
}});
}
if($('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) vcMobileColumns();
if($('body[data-form-style="minimal"]').length > 0){
function convertPlaceholders(){
$('form input[placeholder], form textarea[placeholder]').each(function(i){
if($(this).attr('placeholder').length > 1){
var $placeholder=$(this).attr('placeholder');
var $inputID=($(this).is('[id]')) ? $(this).attr('id'):'id-'+i;
if($(this).parents('.wpcf7-form-control-wrap').length==0){
if($(this).prev('label').length==0||$(this).is('textarea')){
$(''+$placeholder+' ').insertBefore($(this));
}}else{
if($(this).parents('.wpcf7-form-control-wrap').find('label').length==0){
$(''+$placeholder+' ').insertBefore($(this).parents('.wpcf7-form-control-wrap '));
}}
$(this).removeAttr('placeholder');
}});
}
convertPlaceholders();
setTimeout(convertPlaceholders,500);
$('#billing_country, #shipping_country, .country_to_state').on('change',function(){
convertPlaceholders();
removeExcessLabels();
var $wooDynamicPlaceholders=setInterval(function(){
convertPlaceholders();
convertToMinimalStyle('form label');
removeExcessLabels();
},30);
setTimeout(function(){ clearInterval($wooDynamicPlaceholders); },600);
});
function convertToMinimalStyle(selector){
$(selector).each(function(){
if($(this).parent().find('input:not([type="checkbox"]):not([type="hidden"]):not(#search-outer input):not(.adminbar-input):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="date"]):not([type="color"]):not([type="range"]):not([role="button"]):not([role="combobox"]):not(.select2-focusser)').length==1||$(this).parent().find('textarea').length==1){
if($(this).parents('.minimal-form-input').length==0){
if($(this).next('input').length==1){
$(this).next('input').andSelf().wrapAll('
');
}else{
$(this).parent().wrapInner('
');
}
$html=$(this).html();
$(this)[0].innerHTML=''+$html+' ';
if($(this).parent().find('textarea').length==1) $(this).parents('.minimal-form-input').addClass('textarea');
}}
});
$(selector).each(function(){
if($(this).parents('.minimal-form-input').length==1&&$(this).find('.text').length==0){
$html=$(this).html();
$(this)[0].innerHTML=''+$html+' ';
}});
}
convertToMinimalStyle('form label');
setTimeout(function(){ convertToMinimalStyle('form label'); removeExcessLabels(); checkValueOnLoad(); },501);
function removeExcessLabels(){
$('.minimal-form-input').each(function(){
if($(this).find('label').length > 1){
$lngth=0;
$(this).find('label').each(function(){
if($(this).text().length >=$lngth){
$lngth=$(this).text().length;
$(this).parents('.minimal-form-input').find('label').addClass('tbr');
$(this).removeClass('tbr');
}});
$(this).find('label.tbr').remove();
}});
}
removeExcessLabels();
$('input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not(#search-outer input):not([type="hidden"]):not([type="button"]):not([type="date"]):not([type="color"]):not([type="number"]):not([type="range"]):not([role="button"]):not([role="combobox"]):not(.select2-focusser), textarea').each(function(){
if($(this).parents('.minimal-form-input').length==0){
$(' ').insertBefore($(this));
convertToMinimalStyle($(this).prev('label'));
}});
$('body').on('focus','.minimal-form-input input, .minimal-form-input textarea',function(){
$(this).parents('.minimal-form-input').addClass('filled').removeClass('no-text');
});
$('body').on('blur','.minimal-form-input input, .minimal-form-input textarea',function(){
if($(this).val().length > 0) $(this).parents('.minimal-form-input').addClass('has-text').removeClass('no-text');
else $(this).parents('.minimal-form-input').removeClass('has-text').addClass('no-text');
$(this).parents('.minimal-form-input').removeClass('filled');
});
function checkValueOnLoad(){
$('.minimal-form-input input, .minimal-form-input textarea').each(function(){
if($(this).val().length > 0) $(this).parents('.minimal-form-input').addClass('has-text').removeClass('no-text');
});
}
checkValueOnLoad();
var hiddenDiv=$('.hiddendiv').first();
if(!hiddenDiv.length){
hiddenDiv=$('
');
$('body').append(hiddenDiv);
}
var text_area_selector='textarea';
function textareaAutoResize($textarea){
var fontFamily=$textarea.css('font-family');
var fontSize=$textarea.css('font-size');
if(fontSize){ hiddenDiv.css('font-size', fontSize); }
if(fontFamily){ hiddenDiv.css('font-family', fontFamily); }
if($textarea.attr('wrap')==="off"){
hiddenDiv.css('overflow-wrap', "normal")
.css('white-space', "pre");
}
hiddenDiv.text($textarea.val() + '\n');
var content=hiddenDiv.html().replace(/\n/g, ' ');
hiddenDiv.html(content);
if($textarea.is(':visible')){
hiddenDiv.css('width', $textarea.width());
}else{
hiddenDiv.css('width', $(window).width()/2);
}
$textarea.css('height', hiddenDiv.height());
}
$(text_area_selector).each(function (){
var $textarea=$(this);
if($textarea.val().length){
textareaAutoResize($textarea);
}});
$('body').on('keyup keydown autoresize', text_area_selector, function (){
textareaAutoResize($(this));
});
}
if($('body[data-fancy-form-rcs="1"]').length > 0){
$('input[type="checkbox"]').each(function(){
$id=$(this).attr('id');
if(typeof $id!==typeof undefined&&$id!==false&&$('label[for="'+$id+'"]').length > 0){
$('label[for="'+$id+'"]').prepend(' ');
}});
$('.wpcf7-radio .wpcf7-list-item-label').each(function(i){
var $data=$(this).html();
var $name=$(this).parent().find('input').attr('name') + i;
$(this).parent().find('input').attr('id',$name);
$(this).replaceWith(''+$data+' ');
});
$('.wpcf7-checkbox .wpcf7-list-item-label').each(function(){
var $data=$(this).html();
var $name=$(this).parent().find('input').attr('value');
$(this).parent().find('input').attr('id',$name);
$(this).replaceWith(' '+$data+' ');
});
$('select:not(.comment-form-rating #rating)').each(function(){
if($(this).parents('.wpcf7-form-control-wrap').length > 0){
if($(this).parents('.wpcf7-form-control-wrap').find('.select2-container').length > 0){
$selector=$($(this).prev('.select2-container'));
}else{
$selector=$(this);
}
if($selector.parents('.wpcf7-form-control-wrap').parent().find('label').length==1){
$selector.parents('.wpcf7-form-control-wrap').parent().wrapInner('
');
}else{
$selector.wrap('
');
}}else{
if($(this).prev('.select2-container').length > 0){
$selector=$(this).prev('.select2-container');
}else{
$selector=$(this);
}
if($selector.prev('label').length==1){
$selector.prev('label').andSelf().wrapAll('
');
}else if($selector.next('label').length==1){
$selector.next('label').andSelf().wrapAll('
');
}else{
$selector.wrap('
');
}}
});
function select2Init(){
$('select:not(.state_select):not(.country_select):not(.comment-form-rating #rating)').each(function(){
$(this).select2({
minimumResultsForSearch: 7
});
});
}
select2Init();
}
$('a#toggle-section').click(function(){
if(!$('#style-selection').hasClass('open')){
var $distance=($('body[data-smooth-scrolling="0"]').length > 0) ? '0px':'13px';
$('#style-selection').addClass('open');
$('#style-selection').stop().animate({
'right':$distance
},600,'easeOutCubic');
}else{
var $distance=($('body[data-smooth-scrolling="0"]').length > 0) ? '-196px':'-177px';
$('#style-selection').removeClass('open');
$('#style-selection').stop().animate({
'right':$distance
},500,'easeInCubic');
if($('#style-selection .select2-choice').length > 0){
$('#style-selection .select2-container').removeClass('select2-container-active').removeClass('select2-dropdown-open');
$('.select2-drop, .select2-drop-mask').hide();
}}
return false;
});
if($('body[data-ajax-transitions="true"]').length > 0&&$('#ajax-loading-screen[data-method="ajax"]').length > 0&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)&&$(window).width() > 690){
$('#ajax-content-wrap').ajaxify({
'selector':'#ajax-content-wrap a:not(.no-ajaxy):not([target="_blank"]):not([href^="#"]):not(.comment-edit-link):not(#cancel-comment-reply-link):not(.comment-reply-link):not(#toggle-nav):not(.cart_list a):not(.logged-in-as a):not(.no-widget-added a):not(.add_to_cart_button):not(.product-wrap a):not(.section-down-arrow):not([data-filter]):not(.product_list_widget a):not(.pp):not([rel^="prettyPhoto"]):not(.pretty_photo), #header-outer li:not(.no-ajaxy) > a:not(.no-ajaxy), #header-outer #logo',
'verbosity': 0,
requestDelay: 400,
previewoff:true,
memoryoff: true,
turbo:false
});
$(window).on("pronto.render", initPage)
.on("pronto.load", destroyPage)
.on("pronto.request", transitionPage);
initPage();
}else if($('body[data-ajax-transitions="true"]').length > 0&&$('#ajax-loading-screen[data-method="standard"]').length > 0){
$('html').addClass('page-trans-loaded');
if($('#ajax-loading-screen[data-effect="standard"]').length > 0){
if($('.nectar-particles').length==0) setTimeout(function(){ $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ $(this).css({'display':'none'});});$('#ajax-loading-screen .loading-icon').transition({'opacity':0},800) },100);
if(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1||navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
window.onunload=function(){ $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ $(this).css({'display':'none'});});$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600) };
window.onpageshow=function(event){
if(event.persisted){
$('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){
$(this).css({'display':'none'});
});
$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600);
}}
}else if(navigator.userAgent.indexOf('Firefox')!=-1){
window.onunload=function(){};}}else{
if($('#page-header-wrap #page-header-bg[data-animate-in-effect="zoom-out"] .nectar-video-wrap').length==0&&$('.parallax_slider_outer').length==0&&$('.first-nectar-slider').length==0){
setTimeout(function(){
$('#ajax-loading-screen').addClass('loaded');
setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
},150);
}
if(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1||navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
window.onunload=function(){ $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ $(this).css({'display':'none'});});$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600) };
window.onpageshow=function(event){
if(event.persisted){
$('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){
$(this).css({'display':'none'});
});
$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600);
}}
}else if(navigator.userAgent.indexOf('Firefox')!=-1){
window.onunload=function(){};}}
$('.portfolio-loading, .nectar-slider-loading .loading-icon').remove();
if($('#ajax-loading-screen[data-disable-fade-on-click="1"]').length==0){
$('a[href]:not(.no-ajaxy):not([target="_blank"]):not([href^="#"]):not([href^="mailto:"]):not(.comment-edit-link):not(.magnific-popup):not(.magnific):not(.meta-comment-count a):not(.comments-link):not(#cancel-comment-reply-link):not(.comment-reply-link):not(#toggle-nav):not(.logged-in-as a):not(.add_to_cart_button):not(.section-down-arrow):not([data-filter]):not(.pp):not([rel^="prettyPhoto"]):not(.pretty_photo)').click(function(e){
if($(this).parent('.menu-item-has-children').length > 0&&$(this).parents('.off-canvas-menu-container').length > 0){
}else{
if(!$(this).parent().hasClass('no-ajaxy')){
var $targetLocation=$(this).attr('href');
var $timeOutDur=0;
if($targetLocation!=''){
$('#ajax-loading-screen').addClass('set-to-fade');
transitionPageStandard();
setTimeout(function(){
window.location=$targetLocation;
},$timeOutDur)
return false;
}}
}});
}}
function transitionPage(e){
if($(window).scrollTop() > 0){
if($().niceScroll&&$("html").getNiceScroll()){
var nice=$("html").getNiceScroll();
nice.stop();
}
$('body,html').stop(true,true).animate({
scrollTop:0
},500,'easeOutQuad',function(){
$('#ajax-loading-screen').css({'opacity':'1', 'display':'none'});
$('#ajax-loading-screen').stop(true,true).fadeIn(600,function(){
$('#ajax-loading-screen .loading-icon').animate({'opacity':1},400);
setTimeout(function(){ if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click'); },400);
});
});
}else{
$('#ajax-loading-screen').css('opacity','1').stop().fadeIn(600,function(){
$('#ajax-loading-screen .loading-icon').animate({'opacity':1},400);
});
setTimeout(function(){ if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click'); },400);
}}
function transitionPageStandard(e){
$('#ajax-loading-screen').css('opacity','1').stop().fadeIn(500);
}
function destroyPage(e){
$(window).off('scroll.appear');
}
function initPage(e){
if(!$('body').hasClass('ajax-loaded')) return false;
lightBoxInit();
addOrRemoveSF();
$(".sf-menu").superfish('destroy');
$('#header-outer').removeClass('dark-slide');
initSF();
SFArrows();
headerInit();
var $effectTimeout=($('#ajax-loading-screen').length > 0) ? 800:0;
pageHeaderTextEffectInit();
if($('#page-header-bg .nectar-video-wrap video').length==0) setTimeout(pageHeaderTextEffect,$effectTimeout);
videoSlidePos();
controlsInit();
coloredButtons();
columnBGColors();
fwCarouselLinkFix();
if($('.carousel').length > 0){
standardCarouselInit();
clientsCarouselInit();
carouselHeightCalcs();
}
if($('.products-carousel').length > 0) productCarouselInit();
flexsliderInit();
progressBars();
milestoneInit();
accordionInit();
tabbedInit();
tabbbedDeepLinking();
accordionDeepLinking();
ulChecks();
oneFourthClasses();
carouselfGrabbingClass();
clientsFadeIn();
fullWidthSections();
fwsClasses();
fullwidthImgOnlySizingInit();
fullwidthImgOnlySizing();
fullWidthRowPaddingAdjustInit();
fullWidthRowPaddingAdjustCalc();
boxRollInit();
setTimeout(function(){
colAndImgAnimations();
},100);
if($('body[data-animated-anchors="true"]').length > 0) setTimeout(scrollSpyInit,200);
nectar_fancy_ul_init();
socialSharingInit();
pricingTableHeight();
createTestimonialControls();
testimonialSliderHeight();
largeIconHover();
fullscreenMenuInit();
boxRollMouseWheelInit();
midnightInit();
setTimeout(morphingOutlines,100);
responsiveVideoIframesInit();
responsiveVideoIframes();
fullWidthContentColumns();
videoBGInit();
$window.unbind('scroll.parallaxSections').unbind('resize.parallaxSections');
parallaxScrollInit();
masonryBlogInit();
masonryPortfolioInit();
portfolioAccentColor();
portfolioHoverEffects();
portfolioFiltersInit();
style6Img();
isotopeCatSelection();
$(window).unbind('.infscr');
infiniteScrollInit();
toTopBind();
centerLove();
postNextButtonEffect();
if($('.nectar-box-roll').length==0) headerRowColorInheritInit();
pageLoadHash();
slideOutWidgetAreaScrolling();
if($().wpcf7InitForm) $('div.wpcf7 > form').wpcf7InitForm();
wooPriceSlider();
if(typeof twttr!='undefined'){ twttr.widgets.load(); }
if(typeof init_rhc==='function'){ init_rhc(); }
$('.video-wrap iframe').unwrap();
$('#sidebar iframe[src]').unwrap();
$('video:not(.slider-video)').attr('width','100%');
$('video:not(.slider-video)').attr('height','100%');
$('.wp-video-shortcode.mejs-container').each(function(){
$(this).attr('data-aspectRatio', parseInt($(this).css('height')) / parseInt($(this).css('width')));
});
$('video.wp-media-shortcode-ajax, audio.wp-media-shortcode-ajax').each(function(){
if(!$(this).parent().hasClass('mejs-mediaelement')&&$().mediaelementplayer){
$(this).mediaelementplayer();
}});
$('.mejs-container').css({'height': '100%', 'width': '100%'});
$('audio').attr('width','100%');
$('audio').attr('height','100%');
$('audio').css('visibility','visible');
if($('body').hasClass('mobile')){
$('video').css('visibility','hidden');
}else{
$('video').css('visibility','visible');
}
$('.wpb_row:has(".nectar-video-wrap")').each(function(i){
$(this).css('z-index',100 + i);
});
showLateIframes();
mouseParallaxInit();
if(navigator.userAgent.indexOf('Chrome') > 0){
$('.swiper-wrapper .video-wrap').each(function(i){
var webmSource=jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
var firstVideo=jQuery(this).find('video').get(0);
firstVideo.src=webmSource;
firstVideo.load();
});
}
if($('.nectar-video-bg').length > 0){
setTimeout(function(){
resizeVideoToCover();
$('.video-color-overlay').each(function(){
$(this).css('background-color',$(this).attr('data-color'));
});
$('.nectar-video-wrap').transition({'opacity':'1'},0);
$('.video-color-overlay').transition({'opacity':'0.7'},0);
},400);
}
nectarPageHeader();
if($('#featured').length > 0){
customSliderHeight();
homeSliderInit2();
$(window).off('scroll.hsps');
$(window).on('scroll.hsps',homeSliderParallaxScroll);
$(window).off('resize.hsps');
$(window).on('resize.hsps',homeSliderMobile);
}
$('#header-outer div.cart-outer').hoverIntent(function(){
$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(400);
$('#header-outer .cart_list').stop(true,true).fadeIn(400);
clearTimeout(timeout);
$('#header-outer .cart-notification').fadeOut(300);
});
$('.portfolio-loading, .nectar-slider-loading .loading-icon').remove();
setTimeout(portfolioSidebarFollow,250);
setTimeout(portfolioSidebarFollow,500);
setTimeout(portfolioSidebarFollow,1000);
crossBrowserFixes();
$(window).trigger('resize');
$("#wpadminbar").show();
if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');
setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0});});closeSearch(); },200);
setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0});});closeSearch(); },900);
}
(function($){
if(!$.fn.textareaCount){
$.fn.textareaCount=function(options, fn){
var defaults={
maxCharacterSize: -1,
originalStyle: 'originalTextareaInfo',
warningStyle: 'warningTextareaInfo',
warningNumber: 20,
displayFormat: '#input characters | #words words'
};
var options=$.extend(defaults, options);
var container=$(this);
$("
").insertAfter(container);
var charLeftCss={
'width':container.width()
};
var charLeftInfo=getNextCharLeftInformation(container);
charLeftInfo.addClass(options.originalStyle);
var numInput=0;
var maxCharacters=options.maxCharacterSize;
var numLeft=0;
var numWords=0;
container.bind('keyup', function(event){limitTextAreaByCharacterCount();})
.bind('mouseover', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);})
.bind('paste', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);});
limitTextAreaByCharacterCount();
function limitTextAreaByCharacterCount(){
charLeftInfo.html(countByCharacters());
if(typeof fn!='undefined'){
fn.call(this, getInfo());
}
return true;
}
function countByCharacters(){
var content=container.val();
var contentLength=content.length;
if(options.maxCharacterSize > 0){
if(contentLength >=options.maxCharacterSize){
content=content.substring(0, options.maxCharacterSize);
}
var newlineCount=getNewlineCount(content);
var systemmaxCharacterSize=options.maxCharacterSize - newlineCount;
if(!isWin()){
systemmaxCharacterSize=options.maxCharacterSize
}
if(contentLength > systemmaxCharacterSize){
var originalScrollTopPosition=this.scrollTop;
container.val(content.substring(0, systemmaxCharacterSize));
this.scrollTop=originalScrollTopPosition;
}
charLeftInfo.removeClass(options.warningStyle);
if(systemmaxCharacterSize - contentLength <=options.warningNumber){
charLeftInfo.addClass(options.warningStyle);
}
numInput=container.val().length + newlineCount;
if(!isWin()){
numInput=container.val().length;
}
numWords=countWord(getCleanedWordString(container.val()));
numLeft=maxCharacters - numInput;
}else{
var newlineCount=getNewlineCount(content);
numInput=container.val().length + newlineCount;
if(!isWin()){
numInput=container.val().length;
}
numWords=countWord(getCleanedWordString(container.val()));
}
return formatDisplayInfo();
}
function formatDisplayInfo(){
var format=options.displayFormat;
format=format.replace('#input', numInput);
format=format.replace('#words', numWords);
if(maxCharacters > 0){
format=format.replace('#max', maxCharacters);
format=format.replace('#left', numLeft);
}
return format;
}
function getInfo(){
var info={
input: numInput,
max: maxCharacters,
left: numLeft,
words: numWords
};
return info;
}
function getNextCharLeftInformation(container){
return container.next('.charleft');
}
function isWin(){
var strOS=navigator.appVersion;
if(strOS.toLowerCase().indexOf('win')!=-1){
return true;
}
return false;
}
function getNewlineCount(content){
var newlineCount=0;
for(var i=0; i=0; i--){
if(_this.container.childNodes[i].className){
var _wrapperClasses=_this.container.childNodes[i].className.split(/\s+/);
for (var j=0; j < _wrapperClasses.length; j++){
if(_wrapperClasses[j]===params.wrapperClass){
wrapper=_this.container.childNodes[i];
}}
}}
_this.wrapper=wrapper;
_this._extendSwiperSlide=function (el){
el.append=function (){
if(params.loop){
el.insertAfter(_this.slides.length-_this.loopedSlides);
_this.removeLoopedSlides();
_this.calcSlides();
_this.createLoop();
}else{
_this.wrapper.appendChild(el);
}
_this.reInit();
return el;
}
el.prepend=function (){
if(params.loop){
_this.wrapper.insertBefore(el, _this.slides[_this.loopedSlides]);
_this.removeLoopedSlides();
_this.calcSlides();
_this.createLoop();
}else{
_this.wrapper.insertBefore(el, _this.wrapper.firstChild);
}
_this.reInit();
return el;
}
el.insertAfter=function (index){
if(typeof index==='undefined') return false;
var beforeSlide;
if(params.loop){
beforeSlide=_this.slides[index + 1 + _this.loopedSlides];
_this.wrapper.insertBefore(el, beforeSlide);
_this.removeLoopedSlides();
_this.calcSlides();
_this.createLoop();
}else{
beforeSlide=_this.slides[index + 1];
_this.wrapper.insertBefore(el, beforeSlide)
}
_this.reInit();
return el;
}
el.clone=function (){
return _this._extendSwiperSlide(el.cloneNode(true))
}
el.remove=function (){
_this.wrapper.removeChild(el);
_this.reInit();
}
el.html=function (html){
if(typeof html==='undefined'){
return el.innerHTML;
}else{
el.innerHTML=html;
return el;
}}
el.index=function (){
var index;
for (var i=_this.slides.length - 1; i >=0; i--){
if(el===_this.slides[i]) index=i;
}
return index;
}
el.isActive=function (){
if(el.index()===_this.activeIndex) return true;
else return false;
}
if(!el.swiperSlideDataStorage) el.swiperSlideDataStorage={};
el.getData=function (name){
return el.swiperSlideDataStorage[name];
}
el.setData=function (name, value){
el.swiperSlideDataStorage[name]=value;
return el;
}
el.data=function (name, value){
if(!value){
return el.getAttribute('data-'+name);
}else{
el.setAttribute('data-'+name,value);
return el;
}}
el.getWidth=function (outer){
return _this.h.getWidth(el, outer);
}
el.getHeight=function (outer){
return _this.h.getHeight(el, outer);
}
el.getOffset=function(){
return _this.h.getOffset(el);
}
return el;
}
_this.calcSlides=function (forceCalcSlides){
var oldNumber=_this.slides ? _this.slides.length:false;
_this.slides=[];
_this.displaySlides=[];
for (var i=0; i < _this.wrapper.childNodes.length; i++){
if(_this.wrapper.childNodes[i].className){
var _className=_this.wrapper.childNodes[i].className;
var _slideClasses=_className.split(' ');
for (var j=0; j < _slideClasses.length; j++){
if(_slideClasses[j]===params.slideClass){
_this.slides.push(_this.wrapper.childNodes[i]);
}}
}}
for (i=_this.slides.length - 1; i >=0; i--){
_this._extendSwiperSlide(_this.slides[i]);
}
if(!oldNumber) return;
if(oldNumber!==_this.slides.length||forceCalcSlides){
removeSlideEvents();
addSlideEvents();
_this.updateActiveSlide();
if(params.createPagination&&_this.params.pagination) _this.createPagination();
_this.callPlugins('numberOfSlidesChanged');
}}
_this.createSlide=function (html, slideClassList, el){
var slideClassList=slideClassList||_this.params.slideClass;
var el=el||params.slideElement;
var newSlide=document.createElement(el);
newSlide.innerHTML=html||'';
newSlide.className=slideClassList;
return _this._extendSwiperSlide(newSlide);
}
_this.appendSlide=function (html, slideClassList, el){
if(!html) return;
if(html.nodeType){
return _this._extendSwiperSlide(html).append()
}else{
return _this.createSlide(html, slideClassList, el).append()
}}
_this.prependSlide=function (html, slideClassList, el){
if(!html) return;
if(html.nodeType){
return _this._extendSwiperSlide(html).prepend()
}else{
return _this.createSlide(html, slideClassList, el).prepend()
}}
_this.insertSlideAfter=function (index, html, slideClassList, el){
if(typeof index==='undefined') return false;
if(html.nodeType){
return _this._extendSwiperSlide(html).insertAfter(index);
}else{
return _this.createSlide(html, slideClassList, el).insertAfter(index);
}}
_this.removeSlide=function (index){
if(_this.slides[index]){
if(params.loop){
if(!_this.slides[index+_this.loopedSlides]) return false;
_this.slides[index+_this.loopedSlides].remove();
_this.removeLoopedSlides();
_this.calcSlides();
_this.createLoop();
}
else _this.slides[index].remove();
return true;
}
else return false;
}
_this.removeLastSlide=function (){
if(_this.slides.length>0){
if(params.loop){
_this.slides[_this.slides.length - 1 - _this.loopedSlides].remove();
_this.removeLoopedSlides();
_this.calcSlides();
_this.createLoop();
}
else _this.slides[ (_this.slides.length-1) ].remove();
return true;
}else{
return false;
}}
_this.removeAllSlides=function (){
for (var i=_this.slides.length - 1; i >=0; i--){
_this.slides[i].remove()
}}
_this.getSlide=function (index){
return _this.slides[index]
}
_this.getLastSlide=function (){
return _this.slides[ _this.slides.length-1 ]
}
_this.getFirstSlide=function (){
return _this.slides[0]
}
_this.activeSlide=function (){
return _this.slides[_this.activeIndex]
}
var _plugins=[];
for (var plugin in _this.plugins){
if(params[plugin]){
var p=_this.plugins[plugin](_this, params[plugin]);
if(p) _plugins.push(p);
}}
_this.callPlugins=function(method, args){
if(!args) args={}
for (var i=0; i<_plugins.length; i++){
if(method in _plugins[i]){
_plugins[i][method](args);
}}
}
_this.fireCallback=function(){
var callback=arguments[0];
if(Object.prototype.toString.call(callback)==='[object Array]'){
for (var i=0; i < callback.length; i++){
if(typeof callback[i]==='function'){
callback[i](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5])
}}
}else{
callback(arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
}}
function isArray (obj){
"use strict";
if(Object.prototype.toString.apply(obj)==='[object Array]') return true;
return false;
}
_this.addCallback=function (callback, func){
"use strict";
var _this=this, tempFunc;
if(_this.params['on' + callback]){
if(isArray(this.params['on' + callback])){
return this.params['on' + callback].push(func);
}else if(typeof this.params['on' + callback]==='function'){
tempFunc=this.params['on' + callback];
this.params['on' + callback]=[];
this.params['on' + callback].push(tempFunc);
return this.params['on' + callback].push(func);
}}else{
this.params['on' + callback]=[];
return this.params['on' + callback].push(func);
}}
_this.removeCallbacks=function (callback){
if(_this.params['on' + callback]){
return _this.params['on' + callback]=null;
}}
if(_this.browser.ie10&&!params.onlyExternal){
_this.wrapper.classList.add('swiper-wp8-' + (isH ? 'horizontal':'vertical'));
}
if(params.freeMode){
_this.container.className+=' swiper-free-mode';
}
_this.initialized=false;
_this.init=function(force, forceCalcSlides){
var _width=_this.h.getWidth(_this.container);
var _height=_this.h.getHeight(_this.container);
if(_width===_this.width&&_height===_this.height&&!force) return;
_this.width=_width;
_this.height=_height;
containerSize=isH ? _width:_height;
var wrapper=_this.wrapper;
if(force){
_this.calcSlides(forceCalcSlides);
}
if(params.slidesPerView==='auto'){
var slidesWidth=0;
var slidesHeight=0;
if(params.slidesOffset>0){
wrapper.style.paddingLeft='';
wrapper.style.paddingRight='';
wrapper.style.paddingTop='';
wrapper.style.paddingBottom='';
}
wrapper.style.width='';
wrapper.style.height='';
if(params.offsetPxBefore>0){
if(isH) _this.wrapperLeft=params.offsetPxBefore;
else _this.wrapperTop=params.offsetPxBefore;
}
if(params.offsetPxAfter>0){
if(isH) _this.wrapperRight=params.offsetPxAfter;
else _this.wrapperBottom=params.offsetPxAfter;
}
if(params.centeredSlides){
if(isH){
_this.wrapperLeft=(containerSize - this.slides[0].getWidth(true))/2;
_this.wrapperRight=(containerSize - _this.slides[ _this.slides.length-1 ].getWidth(true))/2;
}else{
_this.wrapperTop=(containerSize - _this.slides[0].getHeight(true))/2;
_this.wrapperBottom=(containerSize - _this.slides[ _this.slides.length-1 ].getHeight(true))/2;
}}
if(isH){
if(_this.wrapperLeft>=0) wrapper.style.paddingLeft=_this.wrapperLeft+'px';
if(_this.wrapperRight>=0) wrapper.style.paddingRight=_this.wrapperRight+'px';
}else{
if(_this.wrapperTop>=0) wrapper.style.paddingTop=_this.wrapperTop+'px';
if(_this.wrapperBottom>=0) wrapper.style.paddingBottom=_this.wrapperBottom+'px';
}
var slideLeft=0;
var centeredSlideLeft=0;
_this.snapGrid=[];
_this.slidesGrid=[];
var slideMaxHeight=0;
for(var i=0; i<_this.slides.length; i++){
var slideWidth=_this.slides[i].getWidth(true);
var slideHeight=_this.slides[i].getHeight(true);
if(params.calculateHeight){
slideMaxHeight=Math.max(slideMaxHeight, slideHeight)
}
var _slideSize=isH ? slideWidth:slideHeight;
if(params.centeredSlides){
var nextSlideWidth=i===_this.slides.length-1 ? 0:_this.slides[i+1].getWidth(true);
var nextSlideHeight=i===_this.slides.length-1 ? 0:_this.slides[i+1].getHeight(true);
var nextSlideSize=isH ? nextSlideWidth:nextSlideHeight;
if(_slideSize>containerSize){
for (var j=0; j<=Math.floor(_slideSize/(containerSize+_this.wrapperLeft)); j++){
if(j===0) _this.snapGrid.push(slideLeft+_this.wrapperLeft);
else _this.snapGrid.push(slideLeft+_this.wrapperLeft+containerSize*j);
}
_this.slidesGrid.push(slideLeft+_this.wrapperLeft);
}else{
_this.snapGrid.push(centeredSlideLeft);
_this.slidesGrid.push(centeredSlideLeft);
}
centeredSlideLeft +=_slideSize/2 + nextSlideSize/2;
}else{
if(_slideSize>containerSize){
for (var j=0; j<=Math.floor(_slideSize/containerSize); j++){
_this.snapGrid.push(slideLeft+containerSize*j);
}}else{
_this.snapGrid.push(slideLeft);
}
_this.slidesGrid.push(slideLeft);
}
slideLeft +=_slideSize;
slidesWidth +=slideWidth;
slidesHeight +=slideHeight;
}
if(params.calculateHeight) _this.height=slideMaxHeight;
if(isH){
wrapperSize=slidesWidth + _this.wrapperRight + _this.wrapperLeft;
wrapper.style.width=(slidesWidth)+'px';
wrapper.style.height=(_this.height)+'px';
}else{
wrapperSize=slidesHeight + _this.wrapperTop + _this.wrapperBottom;
wrapper.style.width=(_this.width)+'px';
wrapper.style.height=(slidesHeight)+'px';
}}
else if(params.scrollContainer){
wrapper.style.width='';
wrapper.style.height='';
var wrapperWidth=_this.slides[0].getWidth(true);
var wrapperHeight=_this.slides[0].getHeight(true);
wrapperSize=isH ? wrapperWidth:wrapperHeight;
wrapper.style.width=wrapperWidth+'px';
wrapper.style.height=wrapperHeight+'px';
slideSize=isH ? wrapperWidth:wrapperHeight;
}else{
if(params.calculateHeight){
var slideMaxHeight=0;
var wrapperHeight=0;
if(!isH) _this.container.style.height='';
wrapper.style.height='';
for (var i=0; i<_this.slides.length; i++){
_this.slides[i].style.height='';
slideMaxHeight=Math.max(_this.slides[i].getHeight(true), slideMaxHeight);
if(!isH) wrapperHeight+=_this.slides[i].getHeight(true);
}
var slideHeight=slideMaxHeight;
_this.height=slideHeight;
if(isH) wrapperHeight=slideHeight;
else containerSize=slideHeight, _this.container.style.height=containerSize+'px';
}else{
var slideHeight=isH ? _this.height:_this.height/params.slidesPerView;
var wrapperHeight=isH ? _this.height:_this.slides.length*slideHeight;
}
var slideWidth=isH ? _this.width/params.slidesPerView:_this.width;
var wrapperWidth=isH ? _this.slides.length*slideWidth:_this.width;
slideSize=isH ? slideWidth:slideHeight;
if(params.offsetSlidesBefore>0){
if(isH) _this.wrapperLeft=slideSize*params.offsetSlidesBefore;
else _this.wrapperTop=slideSize*params.offsetSlidesBefore;
}
if(params.offsetSlidesAfter>0){
if(isH) _this.wrapperRight=slideSize*params.offsetSlidesAfter;
else _this.wrapperBottom=slideSize*params.offsetSlidesAfter;
}
if(params.offsetPxBefore>0){
if(isH) _this.wrapperLeft=params.offsetPxBefore;
else _this.wrapperTop=params.offsetPxBefore;
}
if(params.offsetPxAfter>0){
if(isH) _this.wrapperRight=params.offsetPxAfter;
else _this.wrapperBottom=params.offsetPxAfter;
}
if(params.centeredSlides){
if(isH){
_this.wrapperLeft=(containerSize - slideSize)/2;
_this.wrapperRight=(containerSize - slideSize)/2;
}else{
_this.wrapperTop=(containerSize - slideSize)/2;
_this.wrapperBottom=(containerSize - slideSize)/2;
}}
if(isH){
if(_this.wrapperLeft>0) wrapper.style.paddingLeft=_this.wrapperLeft+'px';
if(_this.wrapperRight>0) wrapper.style.paddingRight=_this.wrapperRight+'px';
}else{
if(_this.wrapperTop>0) wrapper.style.paddingTop=_this.wrapperTop+'px';
if(_this.wrapperBottom>0) wrapper.style.paddingBottom=_this.wrapperBottom+'px';
}
wrapperSize=isH ? wrapperWidth + _this.wrapperRight + _this.wrapperLeft:wrapperHeight + _this.wrapperTop + _this.wrapperBottom;
if(!params.cssWidthAndHeight){
if(parseFloat(wrapperWidth) > 0){
wrapper.style.width=wrapperWidth+'px';
}
if(parseFloat(wrapperHeight) > 0){
wrapper.style.height=wrapperHeight+'px';
}}
var slideLeft=0;
_this.snapGrid=[];
_this.slidesGrid=[];
for (var i=0; i<_this.slides.length; i++){
_this.snapGrid.push(slideLeft);
_this.slidesGrid.push(slideLeft);
slideLeft+=slideSize;
if(!params.cssWidthAndHeight){
if(parseFloat(slideWidth) > 0){
_this.slides[i].style.width=slideWidth+'px';
}
if(parseFloat(slideHeight) > 0){
_this.slides[i].style.height=slideHeight+'px';
}}
}}
if(!_this.initialized){
_this.callPlugins('onFirstInit');
if(params.onFirstInit) _this.fireCallback(params.onFirstInit,_this);
}else{
_this.callPlugins('onInit');
if(params.onInit) _this.fireCallback(params.onInit,_this);
}
_this.initialized=true;
}
_this.reInit=function (forceCalcSlides){
_this.init(true, forceCalcSlides);
}
_this.resizeFix=function (reInit){
_this.callPlugins('beforeResizeFix');
_this.init(params.resizeReInit||reInit);
if(!params.freeMode){
_this.swipeTo((params.loop ? _this.activeLoopIndex:_this.activeIndex), 0, false);
}
else if(_this.getWrapperTranslate() < -maxWrapperPosition()){
_this.setWrapperTransition(0);
_this.setWrapperTranslate(-maxWrapperPosition());
}
_this.callPlugins('afterResizeFix');
}
function maxWrapperPosition(){
var a=(wrapperSize - containerSize);
if(params.freeMode){
a=wrapperSize - containerSize;
}
if(params.slidesPerView > _this.slides.length) a=0;
if(a<0) a=0;
return a;
}
function minWrapperPosition(){
var a=0;
return a;
}
function initEvents(){
var bind=_this.h.addEventListener;
if(!_this.browser.ie10){
if(_this.support.touch){
bind(_this.wrapper, 'touchstart', onTouchStart);
bind(_this.wrapper, 'touchmove', onTouchMove);
bind(_this.wrapper, 'touchend', onTouchEnd);
}
if(params.simulateTouch){
bind(_this.wrapper, 'mousedown', onTouchStart);
bind(document, 'mousemove', onTouchMove);
bind(document, 'mouseup', onTouchEnd);
}}else{
bind(_this.wrapper, _this.touchEvents.touchStart, onTouchStart);
bind(document, _this.touchEvents.touchMove, onTouchMove);
bind(document, _this.touchEvents.touchEnd, onTouchEnd);
}
if(params.autoResize){
bind(window, 'resize', _this.resizeFix);
}
addSlideEvents();
_this._wheelEvent=false;
if(params.mousewheelControl){
if(document.onmousewheel!==undefined){
_this._wheelEvent="mousewheel";
}
try {
WheelEvent("wheel");
_this._wheelEvent="wheel";
} catch (e){}
if(!_this._wheelEvent){
_this._wheelEvent="DOMMouseScroll";
}
if(_this._wheelEvent){
bind(_this.container, _this._wheelEvent, handleMousewheel);
}}
if(params.keyboardControl){
bind(document, 'keydown', handleKeyboardKeys);
}
if(params.updateOnImagesReady){
_this.imagesToLoad=$$('img', _this.container);
for (var i=0; i<_this.imagesToLoad.length; i++){
_loadImage(_this.imagesToLoad[i].getAttribute('src'))
}}
function _loadImage(src){
var image=new Image();
image.onload=function(){
_this.imagesLoaded++;
if(_this.imagesLoaded==_this.imagesToLoad.length){
_this.reInit();
if(params.onImagesReady) _this.fireCallback(params.onImagesReady, _this);
}}
image.src=src;
}}
_this.destroy=function(removeResizeFix){
var unbind=_this.h.removeEventListener;
if(!_this.browser.ie10){
if(_this.support.touch){
unbind(_this.wrapper, 'touchstart', onTouchStart);
unbind(_this.wrapper, 'touchmove', onTouchMove);
unbind(_this.wrapper, 'touchend', onTouchEnd);
}
if(params.simulateTouch){
unbind(_this.wrapper, 'mousedown', onTouchStart);
unbind(document, 'mousemove', onTouchMove);
unbind(document, 'mouseup', onTouchEnd);
}}else{
unbind(_this.wrapper, _this.touchEvents.touchStart, onTouchStart);
unbind(document, _this.touchEvents.touchMove, onTouchMove);
unbind(document, _this.touchEvents.touchEnd, onTouchEnd);
}
if(params.autoResize){
unbind(window, 'resize', _this.resizeFix);
}
removeSlideEvents();
if(params.paginationClickable){
removePaginationEvents();
}
if(params.mousewheelControl&&_this._wheelEvent){
unbind(_this.container, _this._wheelEvent, handleMousewheel);
}
if(params.keyboardControl){
unbind(document, 'keydown', handleKeyboardKeys);
}
if(params.autoplay){
_this.stopAutoplay();
}
_this.callPlugins('onDestroy');
_this=null;
}
function addSlideEvents(){
var bind=_this.h.addEventListener,
i;
if(params.preventLinks){
var links=$$('a', _this.container);
for (i=0; i=scrollLeft&&point[0]<=scrollLeft+windowWidth &&
point[1]>=scrollTop&&point[1]<=scrollTop+windowHeight
){
inView=true;
}}
if(!inView) return;
}
if(isH){
if(kc==37||kc==39){
if(e.preventDefault) e.preventDefault();
else e.returnValue=false;
}
if(kc==39) _this.swipeNext();
if(kc==37) _this.swipePrev();
}else{
if(kc==38||kc==40){
if(e.preventDefault) e.preventDefault();
else e.returnValue=false;
}
if(kc==40) _this.swipeNext();
if(kc==38) _this.swipePrev();
}}
var allowScrollChange=true;
var lastScrollTime=(new Date()).getTime();
function handleMousewheel (e){
var we=_this._wheelEvent;
var delta=0;
if(e.detail) delta=-e.detail;
else if(we=='mousewheel') delta=e.wheelDelta;
else if(we=='DOMMouseScroll') delta=-e.detail;
else if(we=='wheel'){
delta=Math.abs(e.deltaX)>Math.abs(e.deltaY) ? - e.deltaX:- e.deltaY;
}
if(!params.freeMode){
if(delta<0) _this.swipeNext();
else _this.swipePrev();
}else{
var position=_this.getWrapperTranslate() + delta;
if(position > 0) position=0;
if(position < -maxWrapperPosition()) position=-maxWrapperPosition();
_this.setWrapperTransition(0);
_this.setWrapperTranslate(position);
_this.updateActiveSlide(position);
}
if(params.autoplay) _this.stopAutoplay();
if(e.preventDefault) e.preventDefault();
else e.returnValue=false;
return false;
}
if(params.grabCursor){
var containerStyle=_this.container.style;
containerStyle.cursor='move';
containerStyle.cursor='grab';
containerStyle.cursor='-moz-grab';
containerStyle.cursor='-webkit-grab';
}
_this.allowSlideClick=true;
function slideClick(event){
if(_this.allowSlideClick){
setClickedSlide(event);
this.fireCallback(params.onSlideClick, _this, event);
}}
function slideTouch(event){
setClickedSlide(event);
_this.fireCallback(params.onSlideTouch, _this, event);
}
function setClickedSlide(event){
if(!event.currentTarget){
var element=event.srcElement;
do {
if(element.className.indexOf(params.slideClass) > -1){
break;
}}
while (element=element.parentNode);
_this.clickedSlide=element;
}else{
_this.clickedSlide=event.currentTarget;
}
_this.clickedSlideIndex=_this.slides.indexOf(_this.clickedSlide);
_this.clickedSlideLoopIndex=_this.clickedSlideIndex - (_this.loopedSlides||0);
}
_this.allowLinks=true;
function preventClick(e){
if(!_this.allowLinks){
if(e.preventDefault) e.preventDefault();
else e.returnValue=false;
return false;
}}
function releaseForms(e){
if(e.stopPropagation) e.stopPropagation();
else e.returnValue=false;
return false;
}
var isTouchEvent=false;
var allowThresholdMove;
var allowMomentumBounce=true;
function onTouchStart(event){
if(jQuery(event.target).parents('.swiper-container').attr('data-desktop-swipe')=='false'&&!Modernizr.touch) return false;
if(jQuery(event.target).parents('.swiper-container').find('.swiper-slide').length==1) return false;
if(jQuery(event.target).parents('.swiper-container').find('.swiper-slide.duplicate-transition').length > 0) return false;
if(params.preventLinks) _this.allowLinks=true;
if(_this.isTouched||params.onlyExternal){
return false;
}
if(params.noSwiping&&(event.target||event.srcElement)&&noSwipingSlide(event.target||event.srcElement)) return false;
allowMomentumBounce=false;
_this.isTouched=true;
isTouchEvent=event.type=='touchstart';
if(!isTouchEvent||event.targetTouches.length==1){
_this.callPlugins('onTouchStartBegin');
if(!isTouchEvent){
if(event.preventDefault) event.preventDefault();
else event.returnValue=false;
}
var pageX=isTouchEvent ? event.targetTouches[0].pageX:(event.pageX||event.clientX);
var pageY=isTouchEvent ? event.targetTouches[0].pageY:(event.pageY||event.clientY);
_this.touches.startX=_this.touches.currentX=pageX;
_this.touches.startY=_this.touches.currentY=pageY;
_this.touches.start=_this.touches.current=isH ? pageX:pageY;
_this.setWrapperTransition(0);
_this.positions.start=_this.positions.current=_this.getWrapperTranslate();
_this.setWrapperTranslate(_this.positions.start);
_this.times.start=(new Date()).getTime();
isScrolling=undefined;
if(params.moveStartThreshold>0) allowThresholdMove=false;
if(params.onTouchStart) _this.fireCallback(params.onTouchStart, _this);
_this.callPlugins('onTouchStartEnd');
}}
var velocityPrevPosition, velocityPrevTime;
function onTouchMove(event){
if(!_this.isTouched||params.onlyExternal) return;
if(isTouchEvent&&event.type=='mousemove') return;
var pageX=isTouchEvent ? event.targetTouches[0].pageX:(event.pageX||event.clientX);
var pageY=isTouchEvent ? event.targetTouches[0].pageY:(event.pageY||event.clientY);
if(typeof isScrolling==='undefined'&&isH){
isScrolling = !!(isScrolling||Math.abs(pageY - _this.touches.startY) > Math.abs(pageX - _this.touches.startX));
}
if(typeof isScrolling==='undefined'&&!isH){
isScrolling = !!(isScrolling||Math.abs(pageY - _this.touches.startY) < Math.abs(pageX - _this.touches.startX));
}
if(isScrolling){
_this.isTouched=false;
return;
}
if(event.assignedToSwiper){
_this.isTouched=false;
return;
}
event.assignedToSwiper=true;
if(params.preventLinks){
_this.allowLinks=false;
}
if(params.onSlideClick){
_this.allowSlideClick=false;
}
if(params.autoplay){
_this.stopAutoplay();
}
if(!isTouchEvent||event.touches.length==1){
if(!_this.isMoved){
_this.callPlugins('onTouchMoveStart');
if(params.loop){
_this.fixLoop();
_this.positions.start=_this.getWrapperTranslate();
}
if(params.onTouchMoveStart) _this.fireCallback(params.onTouchMoveStart, _this);
}
_this.isMoved=true;
if(event.preventDefault) event.preventDefault();
else event.returnValue=false;
_this.touches.current=isH ? pageX:pageY ;
_this.positions.current=(_this.touches.current - _this.touches.start) * params.touchRatio + _this.positions.start;
if(_this.positions.current > 0&¶ms.onResistanceBefore){
_this.fireCallback(params.onResistanceBefore, _this, _this.positions.current);
}
if(_this.positions.current < -maxWrapperPosition()&¶ms.onResistanceAfter){
_this.fireCallback(params.onResistanceAfter, _this, Math.abs(_this.positions.current + maxWrapperPosition()));
}
if(params.resistance&¶ms.resistance!='100%'){
if(_this.positions.current > 0){
var resistance=1 - _this.positions.current/containerSize/2;
if(resistance < 0.5)
_this.positions.current=(containerSize/2);
else
_this.positions.current=_this.positions.current * resistance;
}
if(_this.positions.current < -maxWrapperPosition()){
var diff=(_this.touches.current - _this.touches.start)*params.touchRatio + (maxWrapperPosition()+_this.positions.start);
var resistance=(containerSize+diff)/(containerSize);
var newPos=_this.positions.current-diff*(1-resistance)/2;
var stopPos=-maxWrapperPosition() - containerSize/2;
if(newPos < stopPos||resistance<=0)
_this.positions.current=stopPos;
else
_this.positions.current=newPos;
}}
if(params.resistance&¶ms.resistance=='100%'){
if(_this.positions.current > 0&&!(params.freeMode&&!params.freeModeFluid)){
_this.positions.current=0;
}
if((_this.positions.current) < -maxWrapperPosition()&&!(params.freeMode&&!params.freeModeFluid)){
_this.positions.current=-maxWrapperPosition();
}}
if(!params.followFinger) return;
if(!params.moveStartThreshold){
_this.setWrapperTranslate(_this.positions.current);
}else{
if(Math.abs(_this.touches.current - _this.touches.start)>params.moveStartThreshold||allowThresholdMove){
allowThresholdMove=true;
_this.setWrapperTranslate(_this.positions.current);
}else{
_this.positions.current=_this.positions.start;
}}
if(params.freeMode||params.watchActiveIndex){
_this.updateActiveSlide(_this.positions.current);
}
if(params.grabCursor){
_this.container.style.cursor='move';
_this.container.style.cursor='grabbing';
_this.container.style.cursor='-moz-grabbing';
_this.container.style.cursor='-webkit-grabbing';
}
if(!velocityPrevPosition) velocityPrevPosition=_this.touches.current;
if(!velocityPrevTime) velocityPrevTime=(new Date).getTime();
_this.velocity=(_this.touches.current - velocityPrevPosition)/((new Date).getTime() - velocityPrevTime)/2;
if(Math.abs(_this.touches.current - velocityPrevPosition)<2) _this.velocity=0;
velocityPrevPosition=_this.touches.current;
velocityPrevTime=(new Date).getTime();
_this.callPlugins('onTouchMoveEnd');
if(params.onTouchMove) _this.fireCallback(params.onTouchMove, _this);
return false;
}}
function onTouchEnd(event){
if(isScrolling){
_this.swipeReset();
}
if(params.onlyExternal||!_this.isTouched) return;
_this.isTouched=false
if(params.grabCursor){
_this.container.style.cursor='move';
_this.container.style.cursor='grab';
_this.container.style.cursor='-moz-grab';
_this.container.style.cursor='-webkit-grab';
}
if(!_this.positions.current&&_this.positions.current!==0){
_this.positions.current=_this.positions.start
}
if(params.followFinger){
_this.setWrapperTranslate(_this.positions.current);
}
_this.times.end=(new Date()).getTime();
_this.touches.diff=_this.touches.current - _this.touches.start
_this.touches.abs=Math.abs(_this.touches.diff)
_this.positions.diff=_this.positions.current - _this.positions.start
_this.positions.abs=Math.abs(_this.positions.diff)
var diff=_this.positions.diff ;
var diffAbs=_this.positions.abs ;
var timeDiff=_this.times.end - _this.times.start
if(diffAbs < 5&&(timeDiff) < 300&&_this.allowLinks==false){
if(!params.freeMode&&diffAbs!=0) _this.swipeReset()
if(params.preventLinks){
_this.allowLinks=true;
}
if(params.onSlideClick){
_this.allowSlideClick=true;
}}
setTimeout(function (){
if(params.preventLinks){
_this.allowLinks=true;
}
if(params.onSlideClick){
_this.allowSlideClick=true;
}}, 100);
var maxPosition=maxWrapperPosition();
if(!_this.isMoved&¶ms.freeMode){
_this.isMoved=false;
if(params.onTouchEnd) _this.fireCallback(params.onTouchEnd, _this);
_this.callPlugins('onTouchEnd');
return;
}
if(!_this.isMoved||_this.positions.current > 0||_this.positions.current < -maxPosition){
_this.swipeReset();
if(params.onTouchEnd) _this.fireCallback(params.onTouchEnd, _this);
_this.callPlugins('onTouchEnd');
return;
}
_this.isMoved=false;
if(params.freeMode){
if(params.freeModeFluid){
var momentumDuration=1000*params.momentumRatio;
var momentumDistance=_this.velocity*momentumDuration;
var newPosition=_this.positions.current + momentumDistance
var doBounce=false;
var afterBouncePosition;
var bounceAmount=Math.abs(_this.velocity)*20*params.momentumBounceRatio;
if(newPosition < -maxPosition){
if(params.momentumBounce&&_this.support.transitions){
if(newPosition + maxPosition < -bounceAmount) newPosition=-maxPosition-bounceAmount;
afterBouncePosition=-maxPosition;
doBounce=true;
allowMomentumBounce=true;
}
else newPosition=-maxPosition;
}
if(newPosition > 0){
if(params.momentumBounce&&_this.support.transitions){
if(newPosition>bounceAmount) newPosition=bounceAmount;
afterBouncePosition=0
doBounce=true;
allowMomentumBounce=true;
}
else newPosition=0;
}
if(_this.velocity!=0) momentumDuration=Math.abs((newPosition - _this.positions.current)/_this.velocity)
_this.setWrapperTranslate(newPosition);
_this.setWrapperTransition(momentumDuration);
if(params.momentumBounce&&doBounce){
_this.wrapperTransitionEnd(function (){
if(!allowMomentumBounce) return;
if(params.onMomentumBounce) params.onMomentumBounce(_this);
_this.setWrapperTranslate(afterBouncePosition);
_this.setWrapperTransition(300);
})
}
_this.updateActiveSlide(newPosition)
}
if(!params.freeModeFluid||timeDiff >=300) _this.updateActiveSlide(_this.positions.current)
if(params.onTouchEnd) params.onTouchEnd(_this)
_this.callPlugins('onTouchEnd');
return;
}
direction=diff < 0 ? "toNext":"toPrev"
if(direction=="toNext"&&(timeDiff <=300)){
if(diffAbs < 30||!params.shortSwipes) _this.swipeReset()
else _this.swipeNext(true);
}
if(direction=="toPrev"&&(timeDiff <=300)){
if(diffAbs < 30||!params.shortSwipes) _this.swipeReset()
else _this.swipePrev(true);
}
var targetSlideSize=0;
if(params.slidesPerView=='auto'){
var currentPosition=Math.abs(_this.getWrapperTranslate());
var slidesOffset=0;
var _slideSize;
for (var i=0; i<_this.slides.length; i++){
_slideSize=isH ? _this.slides[i].getWidth(true):_this.slides[i].getHeight(true);
slidesOffset+=_slideSize;
if(slidesOffset>currentPosition){
targetSlideSize=_slideSize;
break;
}}
if(targetSlideSize>containerSize) targetSlideSize=containerSize;
}else{
targetSlideSize=slideSize * params.slidesPerView;
}
if(direction=="toNext"&&(timeDiff > 300)){
if(diffAbs >=targetSlideSize*0.5){
_this.swipeNext(true)
}else{
_this.swipeReset()
}}
if(direction=="toPrev"&&(timeDiff > 300)){
if(diffAbs >=targetSlideSize*0.5){
_this.swipePrev(true);
}else{
_this.swipeReset()
}}
if(params.onTouchEnd) params.onTouchEnd(_this)
_this.callPlugins('onTouchEnd');
}
function noSwipingSlide(el){
var noSwiping=false;
do{
if(el.className.indexOf(params.noSwipingClass)>-1){
noSwiping=true;
}
el=el.parentElement;
} while(!noSwiping&&el.parentElement&&el.className.indexOf(params.wrapperClass)==-1);
if(!noSwiping&&el.className.indexOf(params.wrapperClass)>-1&&el.className.indexOf(params.noSwipingClass)>-1)
noSwiping=true;
return noSwiping;
}
_this.swipeNext=function(internal){
if(!internal&¶ms.loop) _this.fixLoop();
_this.callPlugins('onSwipeNext');
var currentPosition=_this.getWrapperTranslate();
var newPosition=currentPosition;
if(params.slidesPerView=='auto'){
for (var i=0; i<_this.snapGrid.length; i++){
if(-currentPosition >=_this.snapGrid[i]&&-currentPosition<_this.snapGrid[i+1]){
newPosition=-_this.snapGrid[i+1]
break;
}}
}else{
var groupSize=slideSize * params.slidesPerGroup;
newPosition=-(Math.floor(Math.abs(currentPosition)/Math.floor(groupSize))*groupSize + groupSize);
}
if(newPosition < - maxWrapperPosition()){
newPosition=- maxWrapperPosition()
};
if(newPosition==currentPosition) return false;
swipeToPosition(newPosition, 'next');
return true
}
_this.swipePrev=function(internal){
if(!internal&¶ms.loop) _this.fixLoop();
if(!internal&¶ms.autoplay) _this.stopAutoplay();
_this.callPlugins('onSwipePrev');
var currentPosition=Math.ceil(_this.getWrapperTranslate());
var newPosition;
if(params.slidesPerView=='auto'){
newPosition=0;
for (var i=1; i<_this.snapGrid.length; i++){
if(-currentPosition==_this.snapGrid[i]){
newPosition=-_this.snapGrid[i-1]
break;
}
if(-currentPosition > _this.snapGrid[i]&&-currentPosition<_this.snapGrid[i+1]){
newPosition=-_this.snapGrid[i]
break;
}}
}else{
var groupSize=slideSize * params.slidesPerGroup;
newPosition=-(Math.ceil(-currentPosition/groupSize)-1)*groupSize;
}
if(newPosition > 0) newPosition=0;
if(newPosition==currentPosition) return false;
swipeToPosition(newPosition, 'prev');
return true;
}
_this.swipeReset=function(){
_this.callPlugins('onSwipeReset');
var currentPosition=_this.getWrapperTranslate();
var groupSize=slideSize * params.slidesPerGroup;
var newPosition;
var maxPosition=-maxWrapperPosition();
if(params.slidesPerView=='auto'){
newPosition=0;
for (var i=0; i<_this.snapGrid.length; i++){
if(-currentPosition===_this.snapGrid[i]) return;
if(-currentPosition >=_this.snapGrid[i]&&-currentPosition<_this.snapGrid[i+1]){
if(_this.positions.diff>0) newPosition=-_this.snapGrid[i+1]
else newPosition=-_this.snapGrid[i]
break;
}}
if(-currentPosition >=_this.snapGrid[_this.snapGrid.length-1]) newPosition=-_this.snapGrid[_this.snapGrid.length-1];
if(currentPosition <=-maxWrapperPosition()) newPosition=-maxWrapperPosition()
}else{
newPosition=currentPosition<0 ? Math.round(currentPosition/groupSize)*groupSize:0
}
if(params.scrollContainer){
newPosition=currentPosition<0 ? currentPosition:0;
}
if(newPosition < -maxWrapperPosition()){
newPosition=-maxWrapperPosition()
}
if(params.scrollContainer&&(containerSize>slideSize)){
newPosition=0;
}
if(newPosition==currentPosition) return false;
swipeToPosition(newPosition, 'reset');
return true;
}
_this.swipeTo=function(index, speed, runCallbacks){
index=parseInt(index, 10);
_this.callPlugins('onSwipeTo', {index:index, speed:speed});
if(params.loop) index=index + _this.loopedSlides;
var currentPosition=_this.getWrapperTranslate();
if(index > (_this.slides.length-1)||index < 0) return;
var newPosition
if(params.slidesPerView=='auto'){
newPosition=-_this.slidesGrid[ index ];
}else{
newPosition=-index*slideSize;
}
if(newPosition < - maxWrapperPosition()){
newPosition=- maxWrapperPosition();
};
if(newPosition==currentPosition) return false;
runCallbacks=runCallbacks===false ? false:true;
swipeToPosition(newPosition, 'to', {index:index, speed:speed, runCallbacks:runCallbacks});
return true;
}
function swipeToPosition(newPosition, action, toOptions){
var speed=(action=='to'&&toOptions.speed >=0) ? toOptions.speed:params.speed;
var timeOld=+ new Date();
if(_this.support.transitions||!params.DOMAnimation){
_this.setWrapperTranslate(newPosition);
_this.setWrapperTransition(speed);
}else{
var currentPosition=_this.getWrapperTranslate();
var animationStep=Math.ceil((newPosition - currentPosition)/speed*(1000/60));
var direction=currentPosition > newPosition ? 'toNext':'toPrev';
var condition=direction=='toNext' ? currentPosition > newPosition:currentPosition < newPosition;
if(_this._DOMAnimating) return;
anim();
}
function anim(){
var timeNew=+ new Date();
var time=timeNew - timeOld;
currentPosition +=animationStep * time / (1000/60);
condition=direction=='toNext' ? currentPosition > newPosition:currentPosition < newPosition;
if(condition){
_this.setWrapperTranslate(Math.round(currentPosition));
_this._DOMAnimating=true
window.setTimeout(function(){
anim()
}, 1000 / 60)
}else{
if(params.onSlideChangeEnd) _this.fireCallback(params.onSlideChangeEnd, _this);
_this.setWrapperTranslate(newPosition);
_this._DOMAnimating=false;
}}
_this.updateActiveSlide(newPosition);
if(params.onSlideNext&&action=='next'){
_this.fireCallback(params.onSlideNext, _this, newPosition);
}
if(params.onSlidePrev&&action=='prev'){
_this.fireCallback(params.onSlidePrev, _this, newPosition);
}
if(params.onSlideReset&&action=='reset'){
_this.fireCallback(params.onSlideReset, _this, newPosition);
}
if(action=='next'||action=='prev'||(action=='to'&&toOptions.runCallbacks==true))
slideChangeCallbacks(action);
}
_this._queueStartCallbacks=false;
_this._queueEndCallbacks=false;
function slideChangeCallbacks(direction){
_this.callPlugins('onSlideChangeStart');
if(params.onSlideChangeStart){
if(params.queueStartCallbacks&&_this.support.transitions){
if(_this._queueStartCallbacks) return;
_this._queueStartCallbacks=true;
_this.fireCallback(params.onSlideChangeStart, _this, direction)
_this.wrapperTransitionEnd(function(){
_this._queueStartCallbacks=false;
})
}
else _this.fireCallback(params.onSlideChangeStart, _this, direction)
}
if(params.onSlideChangeEnd){
if(_this.support.transitions){
if(params.queueEndCallbacks){
if(_this._queueEndCallbacks) return;
_this._queueEndCallbacks=true;
_this.wrapperTransitionEnd(function(swiper){
setTimeout(function(){ if(params.loop) _this.fixLoop(); },50);
_this.fireCallback(params.onSlideChangeEnd, swiper, direction)
})
}
else _this.wrapperTransitionEnd(function(swiper){
setTimeout(function(){ if(params.loop) _this.fixLoop(); },50);
_this.fireCallback(params.onSlideChangeEnd, swiper, direction)
})
}else{
if(!params.DOMAnimation){
setTimeout(function(){
_this.fireCallback(params.onSlideChangeStart, _this, direction)
},10)
}}
}}
_this.updateActiveSlide=function(position){
if(!_this.initialized) return;
if(_this.slides.length==0) return;
_this.previousIndex=_this.activeIndex;
if(typeof position=='undefined') position=_this.getWrapperTranslate();
if(position>0) position=0;
if(params.slidesPerView=='auto'){
var slidesOffset=0;
_this.activeIndex=_this.slidesGrid.indexOf(-position);
if(_this.activeIndex<0){
for (var i=0; i<_this.slidesGrid.length-1; i++){
if(-position>_this.slidesGrid[i]&&-position<_this.slidesGrid[i+1]){
break;
}}
var leftDistance=Math.abs(_this.slidesGrid[i] + position)
var rightDistance=Math.abs(_this.slidesGrid[i+1] + position)
if(leftDistance<=rightDistance) _this.activeIndex=i;
else _this.activeIndex=i+1;
}}else{
_this.activeIndex=Math[params.visibilityFullFit ? 'ceil':'round'](-position/slideSize);
}
if(_this.activeIndex==_this.slides.length) _this.activeIndex=_this.slides.length - 1;
if(_this.activeIndex < 0) _this.activeIndex=0;
if(!_this.slides[_this.activeIndex]) return;
_this.calcVisibleSlides(position);
var activeClassRegexp=new RegExp("\\s*" + params.slideActiveClass);
var inViewClassRegexp=new RegExp("\\s*" + params.slideVisibleClass);
for (var i=0; i < _this.slides.length; i++){
_this.slides[ i ].className=_this.slides[ i ].className.replace(activeClassRegexp, '').replace(inViewClassRegexp, '');
if(_this.visibleSlides.indexOf(_this.slides[ i ])>=0){
_this.slides[ i ].className +=' ' + params.slideVisibleClass;
}}
_this.slides[ _this.activeIndex ].className +=' ' + params.slideActiveClass;
if(params.loop){
var ls=_this.loopedSlides;
_this.activeLoopIndex=_this.activeIndex - ls;
if(_this.activeLoopIndex >=_this.slides.length - ls*2){
_this.activeLoopIndex=_this.slides.length - ls*2 - _this.activeLoopIndex;
}
if(_this.activeLoopIndex<0){
_this.activeLoopIndex=_this.slides.length - ls*2 + _this.activeLoopIndex;
}}else{
_this.activeLoopIndex=_this.activeIndex;
}
if(params.pagination){
_this.updatePagination(position);
}}
_this.createPagination=function (firstInit){
if(params.paginationClickable&&_this.paginationButtons){
removePaginationEvents();
}
var paginationHTML="";
var numOfSlides=_this.slides.length;
var numOfButtons=numOfSlides;
if(params.loop) numOfButtons -=_this.loopedSlides*2
for (var i=0; i < numOfButtons; i++){
paginationHTML +='<'+params.paginationElement+' class="'+params.paginationElementClass+'">'+params.paginationElement+'>'
}
_this.paginationContainer=params.pagination.nodeType ? params.pagination:$$(params.pagination)[0];
_this.paginationContainer.innerHTML=paginationHTML;
_this.paginationButtons=$$('.'+params.paginationElementClass, _this.paginationContainer);
if(!firstInit) _this.updatePagination()
_this.callPlugins('onCreatePagination');
if(params.paginationClickable){
addPaginationEvents();
}}
function removePaginationEvents(){
var pagers=_this.paginationButtons;
for (var i=0; i=_this.slides.length-_this.loopedSlides*2){
visIndex=_this.slides.length - _this.loopedSlides*2 - visIndex;
visIndex=Math.abs(visIndex)
}
visibleIndexes.push(visIndex)
}
for (i=0; i0) position=position+_this.wrapperLeft;
if(!isH&&_this.wrapperTop>0) position=position+_this.wrapperTop;
for (var i=0; i<_this.slides.length; i++){
_slideLeft +=_slideSize;
if(params.slidesPerView=='auto')
_slideSize=isH ? _this.h.getWidth(_this.slides[i],true):_this.h.getHeight(_this.slides[i],true);
else _slideSize=slideSize;
_slideRight=_slideLeft + _slideSize;
var isVisibile=false;
if(params.visibilityFullFit){
if(_slideLeft >=-position&&_slideRight <=-position+containerSize) isVisibile=true;
if(_slideLeft <=-position&&_slideRight >=-position+containerSize) isVisibile=true;
}else{
if(_slideRight > -position&&_slideRight <=((-position+containerSize))) isVisibile=true;
if(_slideLeft >=-position&&_slideLeft < ((-position+containerSize))) isVisibile=true;
if(_slideLeft < -position&&_slideRight > ((-position+containerSize))) isVisibile=true;
}
if(isVisibile) visibleSlides.push(_this.slides[i])
}
if(visibleSlides.length==0) visibleSlides=[ _this.slides[ _this.activeIndex ] ]
_this.visibleSlides=visibleSlides;
}
_this.autoPlayIntervalId=undefined;
_this.startAutoplay=function (){
if(typeof _this.autoPlayIntervalId!=='undefined') return false;
if(params.autoplay&&!params.loop){
_this.autoPlayIntervalId=setInterval(function(){
if(!_this.swipeNext(true)) _this.swipeTo(0);
}, params.autoplay)
}
if(params.autoplay&¶ms.loop){
_this.autoPlayIntervalId=setInterval(function(){
_this.swipeNext();
}, params.autoplay)
}
_this.callPlugins('onAutoplayStart');
}
_this.stopAutoplay=function (){
if(_this.autoPlayIntervalId) clearInterval(_this.autoPlayIntervalId);
_this.autoPlayIntervalId=undefined;
_this.callPlugins('onAutoplayStop');
}
_this.loopCreated=false;
_this.removeLoopedSlides=function(){
if(_this.loopCreated){
for (var i=0; i<_this.slides.length; i++){
if(_this.slides[i].getData('looped')===true) _this.wrapper.removeChild(_this.slides[i]);
}}
}
_this.createLoop=function(){
if(_this.slides.length==0) return;
_this.loopedSlides=params.slidesPerView + params.loopAdditionalSlides;
if(_this.loopedSlides > _this.slides.length){
_this.loopedSlides=_this.slides.length;
}
var slideFirstHTML='',
slideLastHTML='',
i;
for (i=0; i<_this.loopedSlides; i++){
slideFirstHTML +=_this.slides[i].outerHTML;
}
for (i=_this.slides.length-_this.loopedSlides; i<_this.slides.length; i++){
slideLastHTML +=_this.slides[i].outerHTML;
}
wrapper.innerHTML=slideLastHTML + wrapper.innerHTML + slideFirstHTML;
_this.loopCreated=true;
_this.calcSlides();
for (i=0; i<_this.slides.length; i++){
if(i<_this.loopedSlides||i>=_this.slides.length-_this.loopedSlides) _this.slides[i].setData('looped', true);
}
_this.callPlugins('onCreateLoop');
}
_this.fixLoop=function(){
if(_this.params.loop==true){
var newIndex;
if(_this.activeIndex < _this.loopedSlides){
newIndex=_this.slides.length - _this.loopedSlides*3 + _this.activeIndex;
_this.swipeTo(newIndex, 0, false);
}
else if(_this.activeIndex > _this.slides.length - params.slidesPerView*2){
newIndex=-_this.slides.length + _this.activeIndex + _this.loopedSlides
_this.swipeTo(newIndex, 0, false);
}}
}
_this.loadSlides=function(){
var slidesHTML='';
_this.activeLoaderIndex=0;
var slides=params.loader.slides;
var slidesToLoad=params.loader.loadAllSlides ? slides.length:params.slidesPerView*(1+params.loader.surroundGroups);
for (var i=0; i< slidesToLoad; i++){
if(params.loader.slidesHTMLType=='outer') slidesHTML+=slides[i];
else {
slidesHTML+='<'+params.slideElement+' class="'+params.slideClass+'" data-swiperindex="'+i+'">'+slides[i]+''+params.slideElement+'>';
}}
_this.wrapper.innerHTML=slidesHTML;
_this.calcSlides(true);
if(!params.loader.loadAllSlides){
_this.wrapperTransitionEnd(_this.reloadSlides, true);
}}
_this.reloadSlides=function(){
var slides=params.loader.slides;
var newActiveIndex=parseInt(_this.activeSlide().data('swiperindex'),10)
if(newActiveIndex<0||newActiveIndex>slides.length-1) return
_this.activeLoaderIndex=newActiveIndex;
var firstIndex=Math.max(0, newActiveIndex - params.slidesPerView*params.loader.surroundGroups)
var lastIndex=Math.min(newActiveIndex+params.slidesPerView*(1+params.loader.surroundGroups)-1, slides.length-1)
if(newActiveIndex>0){
var newTransform=-slideSize*(newActiveIndex-firstIndex)
_this.setWrapperTranslate(newTransform);
_this.setWrapperTransition(0);
}
if(params.loader.logic==='reload'){
_this.wrapper.innerHTML='';
var slidesHTML='';
for (var i=firstIndex; i<=lastIndex; i++){
slidesHTML +=params.loader.slidesHTMLType=='outer' ? slides[i]:'<'+params.slideElement+' class="'+params.slideClass+'" data-swiperindex="'+i+'">'+slides[i]+''+params.slideElement+'>';
}
_this.wrapper.innerHTML=slidesHTML;
}else{
var minExistIndex=1000;
var maxExistIndex=0;
for (var i=0; i<_this.slides.length; i++){
var index=_this.slides[i].data('swiperindex');
if(indexlastIndex){
_this.wrapper.removeChild(_this.slides[i]);
}else{
minExistIndex=Math.min(index, minExistIndex)
maxExistIndex=Math.max(index, maxExistIndex)
}}
for (var i=firstIndex; i<=lastIndex; i++){
if(imaxExistIndex){
var newSlide=document.createElement(params.slideElement);
newSlide.className=params.slideClass;
newSlide.setAttribute('data-swiperindex',i);
newSlide.innerHTML=slides[i];
_this.wrapper.appendChild(newSlide);
}}
}
_this.reInit(true);
}
function makeSwiper(){
_this.calcSlides();
if(params.loader.slides.length>0&&_this.slides.length==0){
_this.loadSlides();
}
if(params.loop){
_this.createLoop();
}
_this.init();
initEvents();
if(params.pagination&¶ms.createPagination){
_this.createPagination(true);
}
if(params.loop||params.initialSlide>0){
_this.swipeTo(params.initialSlide, 0, false);
}else{
_this.updateActiveSlide(0);
}
if(params.autoplay){
_this.startAutoplay();
}}
makeSwiper();
}
Swiper.prototype={
plugins:{},
wrapperTransitionEnd:function(callback, permanent){
var a=this,
el=a.wrapper,
events=['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'],
i;
function fireCallBack(){
callback(a);
if(a.params.queueEndCallbacks) a._queueEndCallbacks=false;
if(!permanent){
for (i=0; i0){
returnWidth=el.offsetWidth - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-left')) - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-right'));
}
if(outer) returnWidth +=parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-right'))
return returnWidth;
},
getHeight: function(el, outer){
if(outer) return el.offsetHeight;
var height=window.getComputedStyle(el, null).getPropertyValue('height')
var returnHeight=parseFloat(height);
if(isNaN(returnHeight)||height.indexOf('%')>0){
returnHeight=el.offsetHeight - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-top')) - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-bottom'));
}
if(outer) returnHeight +=parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-bottom'))
return returnHeight;
},
getOffset: function(el){
var box=el.getBoundingClientRect();
var body=document.body;
var clientTop=el.clientTop||body.clientTop||0;
var clientLeft=el.clientLeft||body.clientLeft||0;
var scrollTop=window.pageYOffset||el.scrollTop;
var scrollLeft=window.pageXOffset||el.scrollLeft;
if(document.documentElement&&!window.pageYOffset){
scrollTop=document.documentElement.scrollTop;
scrollLeft=document.documentElement.scrollLeft;
}
return {
top: box.top + scrollTop - clientTop,
left: box.left + scrollLeft - clientLeft
};},
windowWidth:function(){
if(window.innerWidth) return window.innerWidth
else if(document.documentElement&&document.documentElement.clientWidth) return document.documentElement.clientWidth;
},
windowHeight:function(){
if(window.innerHeight) return window.innerHeight
else if(document.documentElement&&document.documentElement.clientHeight) return document.documentElement.clientHeight;
},
windowScroll:function(){
var left=0, top=0;
if(typeof pageYOffset!='undefined'){
return {
left: window.pageXOffset,
top: window.pageYOffset
}}
else if(document.documentElement){
return {
left: document.documentElement.scrollLeft,
top: document.documentElement.scrollTop
}}
},
addEventListener:function (el, event, listener, useCapture){
if(typeof useCapture=='undefined'){
useCapture=false;
}
if(el.addEventListener){
el.addEventListener(event, listener, useCapture);
}
else if(el.attachEvent){
el.attachEvent('on' + event, listener);
}},
removeEventListener:function (el, event, listener, useCapture){
if(typeof useCapture=='undefined'){
useCapture=false;
}
if(el.removeEventListener){
el.removeEventListener(event, listener, useCapture);
}
else if(el.detachEvent){
el.detachEvent('on' + event, listener);
}}
},
setTransform:function (el, transform){
var es=el.style
es.webkitTransform=es.MsTransform=es.msTransform=es.MozTransform=es.OTransform=es.transform=transform
},
setTranslate:function (el, translate){
var es=el.style
var pos={
x:translate.x||0,
y:translate.y||0,
z:translate.z||0
};
var transformString=this.support.transforms3d ? 'translate3d('+(pos.x)+'px,'+(pos.y)+'px,'+(pos.z)+'px)':'translate('+(pos.x)+'px,'+(pos.y)+'px)';
es.webkitTransform=es.MsTransform=es.msTransform=es.MozTransform=es.OTransform=es.transform=transformString;
if(!this.support.transforms){
es.left=pos.x+'px'
es.top=pos.y+'px'
}},
setTransition:function (el, duration){
var es=el.style
es.webkitTransitionDuration=es.MsTransitionDuration=es.msTransitionDuration=es.MozTransitionDuration=es.OTransitionDuration=es.transitionDuration=duration+'ms';
},
support: {
touch:(window.Modernizr&&Modernizr.touch===true)||(function(){
return !!(("ontouchstart" in window)||window.DocumentTouch&&document instanceof DocumentTouch);
})(),
transforms3d:(window.Modernizr&&Modernizr.csstransforms3d===true)||(function(){
var div=document.createElement('div').style;
return ("webkitPerspective" in div||"MozPerspective" in div||"OPerspective" in div||"MsPerspective" in div||"perspective" in div);
})(),
transforms:(window.Modernizr&&Modernizr.csstransforms===true)||(function(){
var div=document.createElement('div').style;
return ('transform' in div||'WebkitTransform' in div||'MozTransform' in div||'msTransform' in div||'MsTransform' in div||'OTransform' in div);
})(),
transitions:(window.Modernizr&&Modernizr.csstransitions===true)||(function(){
var div=document.createElement('div').style;
return ('transition' in div||'WebkitTransition' in div||'MozTransition' in div||'msTransition' in div||'MsTransition' in div||'OTransition' in div);
})()
},
browser:{
ie8:(function(){
var rv=-1;
if(navigator.appName=='Microsoft Internet Explorer'){
var ua=navigator.userAgent;
var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if(re.exec(ua)!=null)
rv=parseFloat(RegExp.$1);
}
return rv!=-1&&rv < 9;
})(),
ie10:window.navigator.msPointerEnabled
}}
if(window.jQuery||window.Zepto){
(function($){
if(!jQuery().swiper){
$.fn.swiper=function(params){
var s=new Swiper($(this)[0], params)
$(this).data('swiper',s);
return s;
}}
})(window.jQuery||window.Zepto)
}
if(typeof(module)!=='undefined'){
module.exports=Swiper;
}}
Swiper.prototype.plugins.progress=function(a){function b(){for(var b=0;b 0){
if($('#page-header-bg').length==0){
$('.nectar-slider-wrap.first-section .swiper-container .swiper-wrapper .swiper-slide').addClass('not-loaded');
if($('.container-wrap .main-content > .row > div').find('.nectar-slider-wrap.first-section').length > 0){
$('.container-wrap .main-content > .row > div').first().css('padding-top','0');
}
$('body #header-outer[data-transparent-header="true"] .ns-loading-cover').show();
if($('#header-outer[data-remove-border="true"]').length==0){
if($('.first-section .nectar-slider-wrap[data-flexible-height="true"]').length==0&&$('.first-section .nectar-slider-wrap[data-fullscreen="true"]').length==0){
$('.first-section .nectar-slider-loading').css({
'top': $('#header-space').height(),
'background-position':'center ' + ((($('.first-section .swiper-container').height()/2) + 15) - $('#header-space').height()) +'px'
});
$('.first-section .nectar-slider-wrap .nectar-slider-loading .loading-icon').css({
'opacity':'1',
'height':$('.first-section .swiper-container').height() - $('#header-space').height() + 'px'
});
}else{
var $loading_bg_storage=$('.first-section .nectar-slider-loading').css('background-image');
$('.first-section .nectar-slider-loading').css({
'top': $('#header-space').height(),
'background-image': 'none'
});
}}
}}
}
transparentheaderLoadingCalcs();
var parallaxSlider=$('.parallax_slider_outer.first-section');
$(window).on("pronto.request", function(){
$(window).off('resize.nsSliderContent');
$(window).off('resize.dynamicHeights');
$(window).off('resize.nsHeightUpdate');
$('.nectar-slider-wrap').each(function(){
if($(this).attr('data-autorotate')&&$(this).attr('data-autorotate').length > 1){
var $autoplayVal=$('#'+$(this).attr('id')).attr('data-autorotate');
if(typeof $autoplayVal!='undefined'&&$autoplayVal.length!='0'&&parseInt($autoplayVal)){
clearInterval(autoplay[$('#'+$(this).attr('id')).attr('autoplay-id')]);
}}
});
});
$(window).on("pronto.render", function(){
if($('.nectar-slider-wrap').length > 0){
$(window).on('resize.nsSliderContent', nsSliderContentResize);
parallaxSlider=$('.parallax_slider_outer.first-section');
$(window).unbind('resize.nsHeightUpdate');
transparentheaderLoadingCalcs();
if($('body.single #page-header-bg').length > 0) $('.parallax_slider_outer').removeClass('parallax_slider_outer').addClass('no-left-margin');
parallaxSliderPos();
nectarSliderMainInit();
setTimeout(function(){
initialSlideLoad();
dynamicHeightSliders();
$(window).on('resize.dynamicHeights', dynamicHeightSliders);
sliderSize();
resizeToCover();
parallaxCheck();
sliderbuttonHoverEffect();
},150);
}});
function parallaxSliderPos(){
if(parallaxSlider.parent().attr('class')=='wpb_wrapper'){
if(parallaxSlider.parents('.wpb_row').length > 0){
if(parallaxSlider.parents('.wpb_row').not('[id^="fws_"]').length > 0) parallaxSlider.attr('id',parallaxSlider.parents('.wpb_row').attr('id'));
}
parallaxSlider.parents('.wpb_row').remove();
}
parallaxSlider.insertBefore('.container-wrap');
}
if($('body.single #page-header-bg').length > 0) $('.parallax_slider_outer').removeClass('parallax_slider_outer').addClass('no-left-margin');
parallaxSliderPos();
var $smoothSrollWidth=($('body').attr('data-smooth-scrolling')=='1') ? 0:0;
var $nectarSliders=[];
function nectarSliderMainInit(){
$nectarSliders=[];
$('.nectar-slider-wrap[data-full-width="boxed-full-width"]').each(function(){ if($(this).parents('.wpb_column').length > 0&&$(this).parents('.full-width-content').length > 0) $(this).attr('data-full-width','false') });
if($('body > #boxed').length==0&&$('.nectar-slider-wrap[data-full-width="true"]').parent().attr('id')!='portfolio-extra'&&$('.nectar-slider-wrap[data-full-width="true"]').parents('#post-area:not(".span_12")').length==0){
$('.nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer.first-section .nectar-slider-wrap').css('left', -(($(window).width()-$smoothSrollWidth)/2 - $('.main-content').width()/2))+'px';
$('.nectar-slider-wrap[data-full-width="true"] .swiper-container, .nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer.first-section .swiper-container, .parallax_slider_outer.first-section .nectar-slider-wrap').css('width',$(window).width());
}
else if($('.nectar-slider-wrap[data-full-width="true"]').parent().attr('id')=='portfolio-extra'&&$('#full_width_portfolio').length!=0){
$('.nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer.first-section .nectar-slider-wrap').css('left', -(($(window).width()-$smoothSrollWidth)/2 - $('.main-content').width()/2))+'px';
$('.nectar-slider-wrap[data-full-width="true"] .swiper-container, .nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer.first-section .swiper-container, .parallax_slider_outer.first-section .nectar-slider-wrap').css('width',$(window).width());
}else{
var $container=($('body > #boxed').length==0) ? '#post-area':'.container-wrap';
if($($container).width()=='0'&&$('body > #boxed').length > 0) $container='#boxed';
$('.nectar-slider-wrap[data-full-width="true"] .swiper-container, .nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer.first-section .swiper-container, .parallax_slider_outer.first-section .nectar-slider-wrap').css('width',$($container).width());
}
$('.nectar-slider-wrap').show();
$('.swiper-container, .swiper-slide').css('background-color','#000');
$('.video-texture').css('opacity','1');
$('.nectar-slider-wrap').each(function(i){
var $arrows=$(this).find('.swiper-container').attr('data-arrows');
var $bullets=$(this).find('.swiper-container').attr('data-bullets');
var $swipe=$(this).find('.swiper-container').attr('data-desktop-swipe');
var $loop=$(this).find('.swiper-container').attr('data-loop');
if($swipe=='true'&&$('#'+$(this).attr('id') +' .swiper-wrapper > div').length > 1&&$(this).attr('data-overall_style')!='directional'){
var $grab=1;
var $desktopSwipe=1;
}else{
var $grab=0;
var $desktopSwipe=0;
}
if($('body').hasClass('mobile')&&$(this).attr('data-overall_style')!='directional') $desktopSwipe=1;
if($bullets=='true'&&$(this).find('.swiper-wrapper > div').length > 1&&$(this).attr('data-overall_style')!='directional'){
$bullets='#'+$(this).attr('id')+' .slider-pagination';
}else{
$bullets=null;
}
$useLoop=($loop=='true'&&$(this).find('.swiper-wrapper > div').length > 1&&!$('html').hasClass('no-video')||$(this).attr('data-overall_style')=='directional'&&$(this).find('.swiper-wrapper > div').length > 1&&!$('html').hasClass('no-video')) ? true:false;
if($useLoop==false) $(this).find('.swiper-container').attr('data-loop','false');
if($(this).attr('data-transition')=='fade'&&$(this).attr('data-overall_style')!='directional'&&$(this).attr('data-button-styling')!='btn_with_preview'){
var progressVar=true;
var touchRatio=1.3;
$sliderOptions={
loop: $useLoop,
grabCursor: $grab,
touchRatio: touchRatio,
speed: 900,
pagination:$bullets,
simulateTouch: $desktopSwipe,
onSlideChangeEnd: captionTransition,
onTouchEnd: captionTransition,
onSlideChangeStart: onChangeStart,
onTouchMove: clearAutoplay,
onFirstInit: nectarInit,
progress: progressVar,
onProgressChange: function(swiper){
if($(swiper.container).parents('.nectar-slider-wrap').hasClass('loaded')){
for (var i=0; i < swiper.slides.length; i++){
var slide=swiper.slides[i];
var progress=slide.progress;
var translate=progress*swiper.width;
var opacity=1 - Math.min(Math.abs(progress),1);
slide.style.opacity=opacity;
swiper.setTransform(slide,'translate3d('+translate+'px,0,0)');
}}
},
onTouchStart: function(swiper){
for (var i=0; i < swiper.slides.length; i++){
swiper.setTransition(swiper.slides[i], 0);
}},
onSetWrapperTransition: function(swiper, speed){
for (var i=0; i < swiper.slides.length; i++){
swiper.setTransition(swiper.slides[i], speed);
}}
}}else{
var touchRatio=0.6;
var css3Trans=($('#'+$(this).attr('id') + '.nectar-slider-wrap[data-overall_style="directional"]').length==1) ? false: true;
$sliderOptions={
loop: $useLoop,
grabCursor: $grab,
touchRatio: touchRatio,
speed: 550,
useCSS3Transforms: css3Trans,
pagination:$bullets,
simulateTouch: $desktopSwipe,
onSlideChangeEnd: captionTransition,
onSlideChangeStart: onChangeStart,
onTouchMove: clearAutoplay,
onFirstInit: nectarInit
}}
$nectarSliders[i]=new Swiper('#'+$(this).attr('id')+' .swiper-container', $sliderOptions);
$nectarSliders[i].swipeReset();
if(navigator.userAgent.indexOf('Chrome') > 0&&!/Edge\/12./i.test(navigator.userAgent)&&!/Edge\/13./i.test(navigator.userAgent)){
if(jQuery(this).find('.swiper-slide:nth-child(2) video source[type="video/webm"]').length > 0&&jQuery(this).find('.swiper-container').attr('data-loop')=='true'){
var webmSource=jQuery(this).find('.swiper-slide:nth-child(2) video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
var firstVideo=jQuery(this).find('.swiper-slide:nth-child(2) video').get(0);
firstVideo.src=webmSource;
firstVideo.load();
var webmSource2=jQuery(this).find('.swiper-slide:last-child video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
var lastVideo=jQuery(this).find('.swiper-slide:last-child video').get(0);
lastVideo.src=webmSource2;
lastVideo.load();
}
if(jQuery(this).find('.swiper-slide:eq(-2) video source[type="video/webm"]').length > 0&&jQuery(this).find('.swiper-container').attr('data-loop')=='true'){
var webmSource=jQuery(this).find('.swiper-slide:eq(-2) video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
var firstVideo=jQuery(this).find('.swiper-slide:eq(-2) video').get(0);
firstVideo.src=webmSource;
firstVideo.load();
var webmSource2=jQuery(this).find('.swiper-slide:nth-child(1) video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
var lastVideo=jQuery(this).find('.swiper-slide:nth-child(1) video').get(0);
lastVideo.src=webmSource2;
lastVideo.load();
}}
if($arrows=='true'&&$('#'+$(this).attr('id') +' .swiper-wrapper > div').length > 1&&$('#'+$(this).attr('id') + '.nectar-slider-wrap[data-button-styling="btn_with_preview"]').length==0&&$('#'+$(this).attr('id') + '.nectar-slider-wrap[data-overall_style="directional"]').length==0){
$('.slide-count i').transition({ scale: 0.5, opacity: 0 });
$('body').on('mouseenter','.nectar-slider-wrap[data-button-styling="btn_with_count"][data-overall_style="classic"] .swiper-container .slider-prev, .nectar-slider-wrap[data-button-styling="btn_with_count"] .swiper-container .slider-next',function(){
$(this).find('.slide-count i').clearQueue().stop(true,true).delay(110).transition({ scale: 1, opacity: 1 },200);
$(this).stop(true,true).animate({
'width':'100px'
},300,'easeOutCubic');
$(this).find('.slide-count span').clearQueue().stop().delay(100).animate({
'opacity':'1'
},225,'easeOutCubic');
});
$('body').on('mouseleave','.nectar-slider-wrap[data-button-styling="btn_with_count"][data-overall_style="classic"] .swiper-container .slider-prev, .nectar-slider-wrap[data-button-styling="btn_with_count"] .swiper-container .slider-next',function(){
$('.slide-count i').stop(true,true).transition({ scale: 0, opacity: 0 },200);
$(this).stop().delay(150).animate({
'width':'50px'
},300,'easeOutCubic');
$(this).find('.slide-count span').stop(true,true).animate({
'opacity':'0'
},200,'easeOutCubic');
});
var $slideCount=($(this).find('.swiper-container').attr('data-loop')!='true') ? $('#'+$(this).attr('id') + ' .swiper-wrapper > div').length:$('#'+$(this).attr('id') + ' .swiper-wrapper > div').length - 2;
if($('html').hasClass('no-video')) $slideCount=$('#'+$(this).attr('id') + ' .swiper-wrapper > div').length;
$('#'+$(this).attr('id')+' .slider-prev .slide-count .slide-total').html($slideCount);
$('#'+$(this).attr('id')+' .slider-next .slide-count .slide-total').html($slideCount);
function prevArrowAnimation(e){
if($(this).hasClass('inactive')) return false;
var $that=$(this);
if($(this).parents('.swiper-container').attr('data-loop')!='true'){
if($(this).parents('.swiper-container').find('.swiper-slide-active').index()+1==1&&!$('html').hasClass('no-video')){
var $timeout;
clearTimeout($timeout);
$timeout=setTimeout(function(){ $that.removeClass('inactive'); } ,700);
if($(this).parents('.nectar-slider-wrap ').attr('data-transition')!='fade'){
var $that=$(this);
$(this).parents('.swiper-container').animate({
'left':25+'px'
},250,function(){
$that.parents('.swiper-container').stop().animate({
'left':0+'px'
},250);
});
}
$(this).addClass('inactive');
}}
e.preventDefault();
$nectarSliders[i].swipePrev();
if($(this).parents('.nectar-slider-wrap ').attr('data-transition')=='fade'){
var $timeout;
clearTimeout($timeout);
$timeout=setTimeout(function(){ $that.removeClass('inactive'); } ,800);
$(this).addClass('inactive');
}}
$('body').off('click','#'+$(this).attr('id')+' .slider-prev',prevArrowAnimation);
$('body').on('click','#'+$(this).attr('id')+' .slider-prev',prevArrowAnimation);
function nextArrowAnimation(e){
if($(this).hasClass('inactive')) return false;
var $that=$(this);
var $slideNum=$(this).parents('.swiper-container').find('.swiper-wrapper > div').length;
if($(this).parents('.swiper-container').attr('data-loop')!='true'){
if($(this).parents('.swiper-container').find('.swiper-slide-active').index()+1==$slideNum&&!$('html').hasClass('no-video')){
var $timeout;
clearTimeout($timeout);
$timeout=setTimeout(function(){ $that.removeClass('inactive'); } ,700);
if($(this).parents('.nectar-slider-wrap ').attr('data-transition')!='fade'){
var $that=$(this);
$(this).parents('.swiper-container').animate({
'left':-25+'px'
},250,function(){
$that.parents('.swiper-container').stop().animate({
'left':0+'px'
},250);
});
}
$(this).addClass('inactive');
}}
e.preventDefault();
$nectarSliders[i].swipeNext();
if($(this).parents('.nectar-slider-wrap ').attr('data-transition')=='fade'){
var $timeout;
clearTimeout($timeout);
$timeout=setTimeout(function(){ $that.removeClass('inactive'); } ,800);
$(this).addClass('inactive');
}}
$('body').off('click','#'+$(this).attr('id')+' .slider-next', nextArrowAnimation);
$('body').on('click','#'+$(this).attr('id')+' .slider-next', nextArrowAnimation);
}
else if($arrows=='true'&&$('#'+$(this).attr('id') +' .swiper-wrapper > div').length > 1&&$('#'+$(this).attr('id') + '.nectar-slider-wrap[data-button-styling="btn_with_preview"]').length==1&&$('#'+$(this).attr('id') + '.nectar-slider-wrap[data-overall_style="directional"]').length==0){
function prevArrowAnimationWithPreview(e){
if($(this).hasClass('inactive')) return false;
var $that=$(this);
var $timeout;
clearTimeout($timeout);
$timeout=setTimeout(function(){ $that.removeClass('inactive'); } ,1000);
var $timeout2;
clearTimeout($timeout2);
$timeout2=setTimeout(function(){ $that.removeClass('stophover'); } ,500);
$(this).addClass('inactive').addClass('stophover');
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').prev('.swiper-slide').removeClass('prev-high-z-index');
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').stop().removeClass('prev-move');
e.preventDefault();
$nectarSliders[i].swipePrev();
}
function nextArrowAnimationWithPreview(e){
if($(this).hasClass('inactive')) return false;
var $that=$(this);
var $timeout;
clearTimeout($timeout);
$timeout=setTimeout(function(){ $that.removeClass('inactive'); } ,1000);
var $timeout2;
clearTimeout($timeout2);
$timeout2=setTimeout(function(){ $that.removeClass('stophover'); } ,500);
$(this).addClass('inactive').addClass('stophover');
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').next('.swiper-slide').removeClass('high-z-index');
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').stop().removeClass('next-move');
e.preventDefault();
$nectarSliders[i].swipeNext();
}
function darkSlideNextMouseOver(currentSlider, activeIndex){
var $indexAdd=($(currentSlider).find('.swiper-container').attr('data-loop')=='true') ? 2:2;
if($(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex + 1) +')').attr('data-color-scheme')=='dark'){
if($(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex + $indexAdd) +')').attr('data-color-scheme')=='dark'){
$(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex + $indexAdd) +') .video-texture').addClass('half-light-overlay').addClass('no-trans');
}else{
$(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex + $indexAdd) +') .video-texture').addClass('light-overlay').addClass('no-trans');
}}else{
if($(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex + $indexAdd) +')').attr('data-color-scheme')=='light'){
$(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex + $indexAdd) +') .video-texture').addClass('half-dark-overlay').addClass('no-trans');
}else{
$(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex + $indexAdd) +') .video-texture').addClass('dark-overlay').addClass('no-trans');
}}
}
function darkSlidePrevMouseOver(currentSlider, activeIndex){
var $indexAdd=($(currentSlider).find('.swiper-container').attr('data-loop')=='true') ? 0:0;
if($(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex + 1) +')').attr('data-color-scheme')=='dark'){
if($(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex - $indexAdd) +')').attr('data-color-scheme')=='dark'){
$(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex - $indexAdd) +') .video-texture').addClass('half-light-overlay').addClass('no-trans');
}else{
$(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex - $indexAdd) +') .video-texture').addClass('light-overlay').addClass('no-trans');
}}else{
if($(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex - $indexAdd) +')').attr('data-color-scheme')=='light'){
$(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex - $indexAdd) +') .video-texture').addClass('half-dark-overlay').addClass('no-trans');
}else{
$(currentSlider).find('.swiper-slide:nth-child('+ (activeIndex - $indexAdd) +') .video-texture').addClass('dark-overlay').addClass('no-trans');
}}
}
$('body').off('click','#'+$(this).attr('id')+' .slider-prev',prevArrowAnimationWithPreview);
$('body').on('click','#'+$(this).attr('id')+' .slider-prev',prevArrowAnimationWithPreview);
$('body').off('click','#'+$(this).attr('id')+' .slider-next', nextArrowAnimationWithPreview);
$('body').on('click','#'+$(this).attr('id')+' .slider-next', nextArrowAnimationWithPreview);
$('body').on('mouseenter','.nectar-slider-wrap[data-button-styling="btn_with_preview"] .swiper-container .slider-next:not(.stophover)',function(){
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').next('.swiper-slide').addClass('high-z-index');
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').stop().addClass('next-move');
$(this).stop().addClass('next-arrow-move');
darkSlideNextMouseOver($(this).parents('.nectar-slider-wrap'), $(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').index());
});
$('body').on('mouseleave','.nectar-slider-wrap[data-button-styling="btn_with_preview"] .swiper-container .slider-next',function(){
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').next('.swiper-slide').removeClass('high-z-index');
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').stop().removeClass('next-move');
$(this).stop().removeClass('next-arrow-move');
});
$('body').on('mouseenter','.nectar-slider-wrap[data-button-styling="btn_with_preview"] .swiper-container .slider-prev:not(.stophover)',function(){
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').prev('.swiper-slide').addClass('prev-high-z-index');
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').stop().addClass('prev-move');
$(this).stop().addClass('prev-arrow-move');
darkSlidePrevMouseOver($(this).parents('.nectar-slider-wrap'), $(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').index());
});
$('body').on('mouseleave','.nectar-slider-wrap[data-button-styling="btn_with_preview"] .swiper-container .slider-prev',function(){
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').prev('.swiper-slide').removeClass('prev-high-z-index');
$(this).parents('.nectar-slider-wrap').find('.swiper-slide-active').stop().removeClass('prev-move');
$(this).stop().removeClass('prev-arrow-move');
});
}else if($('#'+$(this).attr('id') + '.nectar-slider-wrap[data-overall_style="directional"]').length==1){
function prevArrowAnimationDirectional(e){
if($(this).hasClass('inactive')||$(this).parents('.swiper-container').find('.slider-next').hasClass('inactive')) return false;
var $that=$(this);
if($('#header-outer.transparent').length > 0){
$('#header-outer nav > ul.sf-menu > li > a, #header-outer nav > ul.buttons > li#search-btn a, #header-outer nav > ul.buttons > li.slide-out-widget-area-toggle a > span, #header-outer .cart-icon-wrap, header#top #logo').each(function(){
var $extraWidth=($(this).find('.original .sf-sub-indicator').length > 0) ? 14: 1;
$(this).find('.original').attr('data-w',$(this).find('span.original').width()+$extraWidth);
});
}
var $timeout;
clearTimeout($timeout);
$timeout=setTimeout(function(){
$that.parents('.swiper-container').removeClass('directional-trans-prev');
$that.parents('.swiper-container').find('.swiper-wrapper').transition({ 'x': 0, 'left': parseInt($that.parents('.swiper-container').find('.swiper-wrapper').css('left')) + $that.parents('.swiper-container').width() },0);
setTimeout(function(){
$nectarSliders[i].updateActiveSlide();
$nectarSliders[i].fixLoop();
$that.removeClass('inactive');
},50);
resetContentPos();
} ,1100);
var $timeout2;
clearTimeout($timeout2);
$timeout2=setTimeout(function(){
if($that.parents('.swiper-container').attr('data-loop')!='true'){
if($that.parents('.swiper-container').find('.swiper-slide-active').index()+1!=1){
onChangeStart($nectarSliders[i]);
}}else{
onChangeStart($nectarSliders[i]);
}} ,100);
if($(this).parents('.swiper-container').attr('data-loop')!='true'){
/* if($(this).parents('.swiper-container').find('.swiper-slide-active').index()+1==1&&!$('html').hasClass('no-video')){
if($(this).parents('.nectar-slider-wrap ').attr('data-transition')!='fade'){
$(this).parents('.swiper-container').find('.swiper-wrapper').stop(true,false).css('transition','none').animate({
'left':parseInt($(this).parents('.swiper-container').find('.swiper-wrapper').css('left')) + 20
},200,function(){
$(this).parents('.swiper-container').find('.swiper-wrapper').stop(true,false).css('transition','left,top');
$nectarSliders[i].swipeReset();
});
}}else{ */
$(this).parents('.swiper-container').find('.swiper-wrapper').find('.swiper-slide-active .content').children().each(function(i){
$(this).stop().delay(i*50).transition({
'x': $that.parents('.swiper-container').width()/2.5 + "px"
}, 950,'easeInOutQuart');
});
}
$(this).addClass('inactive');
$(this).parents('.swiper-container').find('.swiper-wrapper').transition({ 'x': $(this).parents('.swiper-container').width() + "px"},1100,'easeInOutQuart');
if($(this).parents('.swiper-container').attr('data-loop')=='true'){
$(this).parents('.swiper-container').find('.swiper-wrapper').find('.swiper-slide-active .content > *').each(function(i){
$(this).stop().delay(i*50).transition({
'x': $that.parents('.swiper-container').width()/2.5 + "px"
}, 950,'easeInOutQuart');
});
}
$that.parents('.swiper-container').find('.swiper-wrapper').find('.swiper-slide-active').prev('.swiper-slide').find('.content > *').transition({
'x': '-' + $that.parents('.swiper-container').width() + "px"
}, 0);
setTimeout(function(){
$that.parents('.swiper-container').find('.swiper-wrapper').find('.swiper-slide-active').prev('.swiper-slide').find('.content > *').each(function(i){
$(this).stop().delay(i*50).transition({
'x': "0px"
}, 750,'easeInOutQuart');
});
},200);
$that.parents('.swiper-container').addClass('directional-trans-prev');
e.preventDefault();
}
function nextArrowAnimationDirectional(e){
if($(this).hasClass('inactive')||$(this).parents('.swiper-container').find('.slider-prev').hasClass('inactive')) return false;
var $that=$(this);
if($('#header-outer.transparent').length > 0){
$('#header-outer nav > ul.sf-menu > li > a, #header-outer nav > ul.buttons > li#search-btn a, #header-outer nav > ul.buttons > li.slide-out-widget-area-toggle a > span, #header-outer .cart-icon-wrap, header#top #logo').each(function(){
var $extraWidth=($(this).find('.original .sf-sub-indicator').length > 0) ? 14: 1;
$(this).find('.original').attr('data-w',$(this).find('span.original').width()+$extraWidth);
});
}
var $timeout;
clearTimeout($timeout);
$timeout=setTimeout(function(){
$that.parents('.swiper-container').removeClass('directional-trans-next');
$that.parents('.swiper-container').find('.swiper-wrapper').transition({ 'x': 0, 'left': parseInt($that.parents('.swiper-container').find('.swiper-wrapper').css('left')) - $that.parents('.swiper-container').width() },0);
setTimeout(function(){
$nectarSliders[i].updateActiveSlide();
$nectarSliders[i].fixLoop();
$that.removeClass('inactive');
},50);
resetContentPos();
} ,1100);
var $timeout2;
clearTimeout($timeout2);
$timeout2=setTimeout(function(){
if($that.parents('.swiper-container').attr('data-loop')!='true'){
if($that.parents('.swiper-container').find('.swiper-slide-active').index()+1!=$slideNum){
onChangeStart($nectarSliders[i]);
}}else{
onChangeStart($nectarSliders[i]);
}} ,100);
var $slideNum=$(this).parents('.swiper-container').find('.swiper-wrapper > div').length;
if($(this).parents('.swiper-container').attr('data-loop')!='true'){
if($(this).parents('.swiper-container').find('.swiper-slide-active').index()+1==$slideNum&&!$('html').hasClass('no-video')){
if($(this).parents('.nectar-slider-wrap ').attr('data-transition')!='fade'){
$(this).parents('.swiper-container').find('.swiper-wrapper').stop(true,false).css('transition','none').animate({
'left':parseInt($(this).parents('.swiper-container').find('.swiper-wrapper').css('left')) - 20
},200,function(){
$(this).parents('.swiper-container').find('.swiper-wrapper').stop(true,false).css('transition','left,top');
$nectarSliders[i].swipeReset();
});
}}else{
$(this).parents('.swiper-container').find('.swiper-wrapper').find('.swiper-slide-active .content > *').each(function(i){
$(this).stop().delay(i*50).transition({
'x': '-' + $that.parents('.swiper-container').width()/2.5 + "px"
}, 950,'easeInOutQuart');
});
}}
$(this).addClass('inactive');
$(this).parents('.swiper-container').find('.swiper-wrapper').transition({ 'x': - $(this).parents('.swiper-container').width() + "px"},1100,'easeInOutQuart');
if($(this).parents('.swiper-container').attr('data-loop')=='true'){
$(this).parents('.swiper-container').find('.swiper-wrapper').find('.swiper-slide-active .content > *').each(function(i){
$(this).stop().delay(i*50).transition({
'x': '-' + $that.parents('.swiper-container').width()/2.5 + "px"
}, 950,'easeInOutQuart');
});
}
$that.parents('.swiper-container').find('.swiper-wrapper').find('.swiper-slide-active').next('.swiper-slide').find('.content > *').transition({
'x': $that.parents('.swiper-container').width() + "px"
}, 0);
setTimeout(function(){
$that.parents('.swiper-container').find('.swiper-wrapper').find('.swiper-slide-active').next('.swiper-slide').find('.content > *').each(function(i){
$(this).stop().delay(i*50).transition({
'x': "0px"
}, 750,'easeInOutQuart');
});
},200);
$that.parents('.swiper-container').addClass('directional-trans-next');
e.preventDefault();
}
$('body').off('click','#'+$(this).attr('id')+' .slider-prev', prevArrowAnimationDirectional);
$('body').on('click','#'+$(this).attr('id')+' .slider-prev', prevArrowAnimationDirectional);
$('body').off('click','#'+$(this).attr('id')+' .slider-next', nextArrowAnimationDirectional);
$('body').on('click','#'+$(this).attr('id')+' .slider-next', nextArrowAnimationDirectional);
function resetContentPos(){
$($nectarSliders[i].container).find('.swiper-slide .content > *').transition({ 'x': '0px' }, 0);
}}
if($('#'+$(this).attr('id') +' .swiper-container').attr('data-bullet_style')=='scale'){
$('#'+$(this).attr('id')+' .slider-pagination .swiper-pagination-switch').append(' ');
}
if($bullets!=null&&$('#'+$(this).attr('id') +' .swiper-wrapper > div').length > 1){
$('#'+$(this).attr('id')+' .slider-pagination .swiper-pagination-switch').click(function(){
$nectarSliders[i].swipeTo($(this).index());
});
}});
}
nectarSliderMainInit();
function darkFirstSlide(slider){
if(slider.parents('.parallax_slider_outer').length > 0&&slider.find('.swiper-slide-active[data-color-scheme="dark"]').length > 0){
$('#header-outer').addClass('dark-slide');
}else{
$('#header-outer').removeClass('dark-slide');
}}
function directionalNavColorInit(slider){
if(slider.attr('data-overall_style')=='directional'&&slider.find('.swiper-slide[data-color-scheme="dark"]').length > 0&&$('#header-outer[data-transparent-header="true"]').length > 0){
if(slider.parents('.parallax_slider_outer').length > 0||slider.parents('.first-section').length > 0){
$('#header-outer').addClass('directional-nav-effect');
$selector=($('#header-outer[data-permanent-transparent="1"]').length==0) ? '#header-outer':'#header-outer .midnightHeader.nectar-slider';
$($selector+' nav > ul.sf-menu > li > a, '+$selector+' nav > ul.buttons > li.slide-out-widget-area-toggle a span, '+$selector+' nav > ul.buttons > li#search-btn a').each(function(){
var $text=$(this).html();
$(this).html(' ');
$(this).append(''+ $text + ' ');
$(this).append(''+ $text + ' ');
$(this).append(''+ $text + ' ');
});
$($selector+' .cart-outer .cart-icon-wrap').each(function(){
$(this).find('> i').remove();
$(this).append(' ');
$(this).append(' ');
$(this).append(' ');
});
setTimeout(function(){
$($selector+' .cart-outer .cart-icon-wrap').each(function(){
$(this).find('> i, > span').remove();
$(this).append(' ');
$(this).append(' ');
$(this).append(' ');
});
},1000);
if($($selector+' header#top #logo img').length > 0){
$($selector+' header#top #logo').append(' ');
$($selector+' header#top #logo').append(' ');
$($selector+ ' header#top #logo').append(' ');
$($selector+ ' header#top #logo img:first').clone().appendTo($($selector+ ' header#top #logo .original span'));
if($($selector+' header#top #logo img.starting-logo').length > 0) $($selector+ ' header#top #logo img.starting-logo:not(.dark-version)').clone().appendTo($($selector+ ' header#top #logo .light span'));
if($($selector+' header#top #logo img.starting-logo.retina.logo').length > 0) $($selector+ ' header#top #logo img.starting-logo.retina-logo:not(.dark-version)').clone().appendTo($($selector+ ' header#top #logo .light span'));
if($($selector+' header#top #logo img.starting-logo.dark-version').length > 0) $($selector+ ' header#top #logo img.starting-logo.dark-version').clone().appendTo($($selector+ ' header#top #logo .dark span'));
if($($selector+' header#top #logo img.starting-logo.dark-version.retina.logo').length > 0) $($selector+ ' header#top #logo img.starting-logo.dark-version.retina-logo').clone().appendTo($($selector+ ' header#top #logo .dark span'));
$($selector+ ' header#top #logo > img').remove();
}else{
var $logoText=$('header#top #logo').text();
$($selector+' header#top #logo').html(' ');
$($selector+' header#top #logo').append(''+$logoText+' ');
$($selector+' header#top #logo').append(''+$logoText+' ');
$($selector+' header#top #logo').append(''+$logoText+' ');
}
if($('.retina-logo:visible').length > 0) $($selector+' header#top #logo').css('width',$('.retina-logo').width());
$($selector+' nav > ul.sf-menu > li > a, '+$selector+' nav > ul.buttons > li#search-btn a, '+$selector+' nav > ul.buttons > li.slide-out-widget-area-toggle a > span, '+$selector+' .cart-icon-wrap, '+$selector+' header#top #logo').each(function(){
var $extraWidth=($(this).find('.original .sf-sub-indicator').length > 0) ? 14: 1;
$(this).find('.original').attr('data-w',$(this).find('span.original').width()+$extraWidth);
});
}}
}
var $animating=false;
var $sliderHeights=[];
var $existingSliders=[];
function initialSlideLoad(){
$animating=false;
$sliderHeights=[];
$existingSliders=[];
$('.swiper-wrapper').each(function(){
if($(this).find('.swiper-slide:nth-child(2) video').length > 0) $(this).find('.swiper-slide:nth-child(2)').addClass('first_video_slide');
});
$('.nectar-slider-wrap').each(function(i){
var $sliderWrapCount=$('.nectar-slider-wrap').length;
var $that=$(this);
if($(this).find('.swiper-slide-active video').length > 0){
if(!$('html').hasClass('no-video')&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
var videoReady=setInterval(function(){
if($that.find('.swiper-slide-active:first video').get(0).readyState > 3){
showSliderControls();
resizeToCover();
slideContentPos();
sliderLoadIn($that,i);
var $timeout=0;
if($('#ajax-loading-screen[data-effect="center_mask_reveal"]').length > 0&&$that.parents('.parallax_slider_outer').length > 0 ||
$('#ajax-loading-screen[data-effect="center_mask_reveal"]').length > 0&&$that.hasClass('first-nectar-slider')){
$timeout=450;
}
setTimeout(function(){ captionTransition($nectarSliders[i]); },$timeout);
darkFirstSlide($that);
clearInterval(videoReady);
$that.addClass('loaded');
if($that.parents('.parallax_slider_outer').length > 0||$that.hasClass('first-nectar-slider')){
$('#ajax-loading-screen').addClass('loaded');
setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
}}
},60);
}else{
showSliderControls();
resizeToCover();
slideContentPos();
sliderLoadIn($that,i);
captionTransition($nectarSliders[i]);
darkFirstSlide($that);
}}else{
var $firstBg=$(this).find('.swiper-slide-active .image-bg').attr('style');
var pattern=/url\(["']?([^'")]+)['"]?\)/;
var match=pattern.exec($firstBg);
if(match){
var slideImg=new Image();
slideImg.src=match[1];
$(slideImg).load(function(){
showSliderControls();
resizeToCover();
slideContentPos();
sliderLoadIn($that,i);
var $timeout=0;
if($('#ajax-loading-screen[data-effect="center_mask_reveal"]').length > 0&&$that.parents('.parallax_slider_outer').length > 0 ||
$('#ajax-loading-screen[data-effect="center_mask_reveal"]').length > 0&&$that.hasClass('first-nectar-slider')){
$timeout=450;
}
setTimeout(function(){ captionTransition($nectarSliders[i]); },$timeout);
darkFirstSlide($that);
$that.addClass('loaded');
if($that.parents('.parallax_slider_outer').length > 0||$that.hasClass('first-nectar-slider')){
$('#ajax-loading-screen').addClass('loaded');
setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
}});
}}
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
captionTransition($nectarSliders[i]);
showSliderControls();
resizeToCover();
slideContentPos();
darkFirstSlide($that);
setTimeout(function(){ resizeToCover(); slideContentPos(); },400);
$('.nectar-slider-wrap').find('.nectar-slider-loading').fadeOut(800,'easeInOutExpo');
$('body #header-outer[data-transparent-header="true"] .ns-loading-cover').fadeOut(800,'easeInOutExpo',function(){
$(this).remove();
$('.nectar-slider-wrap.first-section .swiper-container .swiper-wrapper .swiper-slide').removeClass('not-loaded');
});
$('.nectar-slider-wrap .mobile-video-image').show();
$('.nectar-slider-wrap .video-wrap').remove();
$(this).addClass('loaded');
if($that.parents('.parallax_slider_outer').length > 0||$that.hasClass('first-nectar-slider')){
$('#ajax-loading-screen').addClass('loaded');
setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
}
autorotateInit($(this),i);
}
if($('header#top #logo img').length > 0){
var logoImg=new Image();
logoImg.src=$('header#top #logo img:first').attr('src');
$(logoImg).load(function(){
directionalNavColorInit($that);
if($that.attr('data-overall_style')=='directional'){
$that.find('.swiper-container').addClass('directional-trans-current');
onChangeStart($nectarSliders[i]);
}});
}else{
directionalNavColorInit($that);
if($that.attr('data-overall_style')=='directional'){
$that.find('.swiper-container').addClass('directional-trans-current');
onChangeStart($nectarSliders[i]);
}}
});
$('.swiper-container').each(function(i){
$sliderHeights[i]=parseInt($(this).attr('data-height'));
$existingSliders[i]=$(this).parent().attr('id');
});
}
function nectarInit(){
if(doneVideoInit==true) return;
if($().prettyPhoto) prettyPhotoInit();
$('.swiper-slide iframe[data-aspectRatio]').each(function(){
var newWidth=$(this).parent().width();
var $el=$(this);
if($(this).parents('.swiper-slide').length > 0){
if($(this).is(':visible')) $el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
}else{
$el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
}});
doneVideoInit=true;
}
var autoplay=[];
var sliderAutoplayCount=-1;
initialSlideLoad();
var headerPadding=parseInt($('#header-outer').attr('data-padding'));
var shrinkNum=8;
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
dynamicHeightSliders();
function dynamicHeightSliders(){
var $adminBarHeight=($('#wpadminbar').length > 0) ? 28:0 ;
$('.nectar-slider-wrap').each(function(){
var $heightCalc;
var $minHeight=$('.swiper-container').attr('data-min-height');
if($(this).attr('data-fullscreen')=='true'&&$(this).attr('data-full-width')=='true'||$(this).attr('data-fullscreen')=='true'&&$(this).attr('data-full-width')=='boxed-full-width'){
if($(this).hasClass('first-section')&&$(this).index()==0||$(this).parents('.wpb_row').length > 0&&$(this).parents('.wpb_row').hasClass('first-section')&&$(this).index()==0&&$(this).parents('.parallax_slider_outer').length==0){
$heightCal=(($(window).height() - $(this).offset().top + 2) <=$minHeight) ? $minHeight:$(window).height() - $(this).offset().top + 2;
$(this).find('.swiper-container').attr('data-height',$heightCal);
}
else if($(this).parents('.parallax_slider_outer').length > 0&&$(this).parents('#full_width_portfolio').length==0){
$heightCal=(($(window).height() - $(this).parent().offset().top + 2) <=$minHeight) ? $minHeight:$(window).height() - $(this).parent().offset().top + 2;
$(this).find('.swiper-container').attr('data-height',$heightCal);
}
else if($(this).parents('#full_width_portfolio').length > 0&&$(this).attr('data-parallax')!='true'&&$(this).index()==0){
$heightCal=(($(window).height() - $(this).offset().top + 2) <=$minHeight) ? $minHeight:$(window).height() - $(this).offset().top + 2;
$(this).find('.swiper-container').attr('data-height',$heightCal);
}
else if($(this).parents('#full_width_portfolio').length > 0&&$(this).attr('data-parallax')=='true'){
$heightCal=(($(window).height() - $(this).offset().top + 2) <=$minHeight) ? $minHeight:$(window).height() - $(this).offset().top + 2;
$(this).find('.swiper-container').attr('data-height',$heightCal);
}else{
$resize=($('#header-outer[data-header-resize="0"]').length > 0) ? 0:parseInt(shrinkNum) + headerPadding*2;
$headerSize=($('#header-outer[data-permanent-transparent="false"]').length > 0) ? $('#header-space').height() - $resize-3:-3;
$heightCal=($(window).height() - $headerSize <=$minHeight) ? $minHeight:$(window).height() - $headerSize;
$(this).find('.swiper-container').attr('data-height',$heightCal);
}
if($('#header-outer[data-remove-border="true"]').length==0){
if($('body #header-outer[data-transparent-header="true"]').length > 0
&& $('.first-section .nectar-slider-wrap[data-fullscreen="true"]').length > 0
&& $('#page-header-bg').length==0){
$('.first-section .nectar-slider-loading').css({
'background-image': $loading_bg_storage,
'background-position':'center ' + ((($(window).height() /2) + 15) - $('#header-space').height()) +'px'
});
$('.first-section .nectar-slider-wrap .nectar-slider-loading .loading-icon').css({
'opacity':'1',
'height':$(window).height() - $('#header-space').height() + 'px'
});
}}
}
if($(this).attr('data-flexible-height')=='true'&&$(this).attr('data-fullscreen')!='true'){
if($(this).parents('.wpb_row.full-width-content').length==0&&$(this).attr('data-full-width')=='false'){ $(this).attr('data-flexible-height','false'); return false; }
var $minHeight=$('.swiper-container').attr('data-min-height');
var currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
var $windowWidth=$(window).width();
var $definedHeight=$sliderHeights[currentKey];
var dif=$(window).width() / 1600;
if(window.innerWidth > 1000&&$('#boxed').length==0){
$(this).find('.swiper-container').attr('data-height',Math.ceil($definedHeight*dif));
}else{
var $parentCol=($(this).parents('.wpb_column').length > 0) ? $(this).parents('.wpb_column'):$(this).parents('.col') ;
if($parentCol.length==0) $parentCol=$('.main-content');
if(!$parentCol.hasClass('vc_span12')&&!$parentCol.hasClass('main-content')&&!$parentCol.hasClass('span_12')&&!$parentCol.hasClass('vc_col-sm-12')){
var $parentColWidth=sliderColumnDesktopWidth($parentCol);
var $parentColRatio=1100/$parentColWidth;
if($definedHeight*dif <=$minHeight){
$(this).find('.swiper-container').attr('data-height',$minHeight);
}else{
$(this).find('.swiper-container').attr('data-height',Math.ceil($parentColRatio*$definedHeight*dif));
}}
else if($('#boxed').length > 0){
var dif=$('#boxed').width() / 1600;
if(window.innerWidth > 1300){
if($('body[data-ext-responsive="true"]').length > 0){
if($(this).has('[data-full-width="boxed-full-width"]')){
($('#boxed').width() < 1400) ? $(this).find('.swiper-container').attr('data-height',Math.ceil($definedHeight*dif)):$(this).find('.swiper-container').attr('data-height',$definedHeight*(1400/1600));
}}else{
if($(this).has('[data-full-width="boxed-full-width"]')) $(this).find('.swiper-container').attr('data-height',Math.ceil($definedHeight*(1200/1600)));
}}else if(window.innerWidth <=1300&&window.innerWidth >=1000){
if($('body[data-ext-responsive="true"]').length > 0){
$(this).find('.swiper-container').attr('data-height',Math.ceil($definedHeight*dif));
}else{
if($(this).has('[data-full-width="boxed-full-width"]')) $(this).find('.swiper-container').attr('data-height',Math.ceil($definedHeight*(980/1600)));
}}else if(window.innerWidth < 1000&&window.innerWidth > 690){
var $heightCalc=($definedHeight*(679/1600) <=$minHeight) ? $minHeight:$definedHeight*(679/1600);
if($(this).has('[data-full-width="boxed-full-width"]')) $(this).find('.swiper-container').attr('data-height',$minHeight);
}else if(window.innerWidth <=690&&window.innerWidth >=470){
var $heightCalc=($definedHeight*(410/1600) <=$minHeight) ? $minHeight:$definedHeight*(410/1600);
if($(this).has('[data-full-width="boxed-full-width"]')) $(this).find('.swiper-container').attr('data-height', $heightCalc);
}else if(window.innerWidth < 470){
var $heightCalc=($definedHeight*(318/1600) <=$minHeight) ? $minHeight:$definedHeight*(318/1600);
if($(this).has('[data-full-width="boxed-full-width"]')) $(this).find('.swiper-container').attr('data-height', $heightCalc);
}}else{
if($definedHeight*dif <=$minHeight){
$(this).find('.swiper-container').attr('data-height',$minHeight);
}else{
$(this).find('.swiper-container').attr('data-height',Math.ceil($definedHeight*dif));
}}
}
if($('body #header-outer[data-transparent-header="true"]').length > 0 &&
$('.first-section .nectar-slider-wrap[data-flexible-height="true"]').length > 0){
$('.first-section .nectar-slider-loading').css({
'background-image': $loading_bg_storage,
'background-position':'center ' + (((($definedHeight*dif)/2) + 15) - $('#header-space').height()) +'px'
});
$('.first-section .nectar-slider-wrap .nectar-slider-loading .loading-icon').css({
'opacity':'1',
'height':$definedHeight*dif - $('#header-space').height() + 'px'
});
}}
});
}
if(window.innerWidth > 690){
$(window).on('resize.dynamicHeights',dynamicHeightSliders);
}else{
var $windowWidth=$(window).width(), $windowHeight=$(window).height();
var $orientationChange=0;
window.addEventListener("orientationchange", function(){
$orientationChange=1;
});
$(window).resize(function(){
if(($(window).width()!=$windowWidth&&$(window).height!=$windowHeight)||$orientationChange==1){
dynamicHeightSliders();
$orientationChange=0;
}});
}
function sliderColumnDesktopWidth(parentCol){
var $parentColWidth=1100;
var $columnNumberParsed=$(parentCol).attr('class').match(/\d+/);
if($columnNumberParsed=='2'){ $parentColWidth=170 }
else if($columnNumberParsed=='3'){ $parentColWidth=260 }
else if($columnNumberParsed=='4'){ $parentColWidth=340 }
else if($columnNumberParsed=='6'){ $parentColWidth=530 }
else if($columnNumberParsed=='8'){ $parentColWidth=700 }
else if($columnNumberParsed=='9'){ $parentColWidth=805 }
else if($columnNumberParsed=='10'){ $parentColWidth=916.3 }
else if($columnNumberParsed=='12'){ $parentColWidth=1100 }
return $parentColWidth;
}
sliderSize();
$(window).resize(sliderSize);
function sliderSize(){
if(window.innerWidth < 1000&&window.innerWidth > 690){
$('.nectar-slider-wrap[data-full-width="true"]:not([data-fullscreen="true"],[data-flexible-height="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
$(this).find('.swiper-container').attr('data-height',$sliderHeights[currentKey]/1.4)
});
$('.nectar-slider-wrap[data-full-width="false"]:not([data-flexible-height="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
var $currentSliderHeight=$sliderHeights[currentKey];
var $parentCol=($(this).parents('.wpb_column').length > 0) ? $(this).parents('.wpb_column'):$(this).parents('.col');
if($(this).parents('#post-area').length > 0&&$(this).parents('.vc_span12').length > 0) $parentCol=$(this).parents('#post-area');
if($parentCol.length==0) $parentCol=$('.main-content');
var $parentColWidth=sliderColumnDesktopWidth($parentCol);
var $aspectRatio=$currentSliderHeight/$parentColWidth;
$(this).find('.swiper-container').attr('data-height',$aspectRatio*$parentCol.width());
});
$('.nectar-slider-wrap[data-full-width="boxed-full-width"]:not([data-flexible-height="true"]):not([data-fullscreen="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
$(this).find('.swiper-container').attr('data-height',$sliderHeights[currentKey]/1.9)
});
}
else if(window.innerWidth <=690){
$('.nectar-slider-wrap[data-full-width="true"]:not([data-fullscreen="true"],[data-flexible-height="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
$(this).find('.swiper-container').attr('data-height',$sliderHeights[currentKey]/2.7)
});
$('.nectar-slider-wrap[data-full-width="false"]:not([data-flexible-height="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
var $currentSliderHeight=$sliderHeights[currentKey];
var $parentCol=($(this).parents('.wpb_column').length > 0) ? $(this).parents('.wpb_column'):$(this).parents('.col');
if($(this).parents('#post-area').length > 0&&$(this).parents('.vc_span12').length > 0) $parentCol=$(this).parents('#post-area');
if($parentCol.length==0) $parentCol=$('.main-content');
var $parentColWidth=sliderColumnDesktopWidth($parentCol);
var $aspectRatio=$currentSliderHeight/$parentColWidth;
$(this).find('.swiper-container').attr('data-height',$aspectRatio*$parentCol.width());
});
$('.nectar-slider-wrap[data-full-width="boxed-full-width"]:not([data-flexible-height="true"]):not([data-fullscreen="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
$(this).find('.swiper-container').attr('data-height',$sliderHeights[currentKey]/2.9)
});
}
else if(window.innerWidth < 1300&&window.innerWidth >=1000){
$('.nectar-slider-wrap[data-full-width="true"]:not([data-fullscreen="true"],[data-flexible-height="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
$(this).find('.swiper-container').attr('data-height',$sliderHeights[currentKey]/1.2)
});
$('.nectar-slider-wrap[data-full-width="false"]:not([data-flexible-height="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
var $currentSliderHeight=$sliderHeights[currentKey];
var $parentCol=($(this).parents('.wpb_column').length > 0) ? $(this).parents('.wpb_column'):$(this).parents('.col') ;
if($(this).parents('#post-area').length > 0&&$(this).parents('.vc_span12').length > 0) $parentCol=$(this).parents('#post-area');
if($parentCol.length==0) $parentCol=$('.main-content');
var $parentColWidth=sliderColumnDesktopWidth($parentCol);
var $aspectRatio=$currentSliderHeight/$parentColWidth;
$(this).find('.swiper-container').attr('data-height',$aspectRatio*$parentCol.width());
});
$('.nectar-slider-wrap[data-full-width="boxed-full-width"]:not([data-flexible-height="true"]):not([data-fullscreen="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
$(this).find('.swiper-container').attr('data-height',$sliderHeights[currentKey]/1.2)
});
}else{
$('.nectar-slider-wrap[data-full-width="true"]:not([data-fullscreen="true"],[data-flexible-height="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
if($(this).attr('data-flexible-height')!='true') $(this).find('.swiper-container').attr('data-height',$sliderHeights[currentKey])
});
$('.nectar-slider-wrap[data-full-width="false"], .nectar-slider-wrap[data-full-width="boxed-full-width"]:not([data-flexible-height="true"]):not([data-fullscreen="true"])').each(function(i){
currentKey=$existingSliders.getKeyByValue($(this).attr('id'));
if($(this).attr('data-flexible-height')!='true') $(this).find('.swiper-container').attr('data-height',$sliderHeights[currentKey])
});
}}
$('.nectar-slider-wrap').each(function(){
if($(this).find('.swiper-wrapper .swiper-slide').length==1){
$(this).find('.swiper-slide').addClass('no-transform');
$(this).find('.swiper-wrapper').addClass('no-transform');
}});
var min_w=1500;
var vid_w_orig;
var vid_h_orig;
vid_w_orig=1280;
vid_h_orig=720;
var $headerHeight=$('header').height()-1;
function nsSliderContentResize(e){
resizeToCover(); slideContentPos();
for(var i=0; i < $nectarSliders.length; i++){
if($($nectarSliders[i].container).parent().attr('data-transition')&&$($nectarSliders[i].container).parent().attr('data-transition')=='fade'){
for(var k=0; k < $nectarSliders[i].slides.length; k++){
$nectarSliders[i].setTransition($nectarSliders[i].slides[k], 0);
}
$('.swiper-wrapper').stop(true,true).css('transition-duration','0s');
if($('.nectar-slider-loading').css('display')=='none'){
$('.swiper-wrapper .swiper-slide.swiper-slide-active .content > *').css({
'opacity': 1,
'padding-top':0
});
}}
$nectarSliders[i].reInit();
$nectarSliders[i].resizeFix();
}}
$(window).on('resize.nsSliderContent',nsSliderContentResize);
function resizeToCover(){
$('.nectar-slider-wrap').each(function(i){
if($(this).css('visibility')!='hidden'){
if($('body > #boxed').length==0&&$('.nectar-slider-wrap[data-full-width="true"]').parent().attr('id')!='portfolio-extra'&&$(this).parents('#post-area:not(".span_12")').length==0){
$('.nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer.first-section .nectar-slider-wrap').css('left', -(($(window).width()-$smoothSrollWidth)/2 - $('.main-content').width()/2))+'px';
$('.nectar-slider-wrap[data-full-width="true"] .swiper-container, .nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer.first-section .swiper-container, .parallax_slider_outer.first-section .nectar-slider-wrap').css('width',$(window).width());
}
else if($('.nectar-slider-wrap[data-full-width="true"]').parent().attr('id')=='portfolio-extra'&&$('#full_width_portfolio').length!=0){
$('.nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer.first-section .nectar-slider-wrap').css('left', -(($(window).width()-$smoothSrollWidth)/2 - $('.main-content').width()/2))+'px';
$('.nectar-slider-wrap[data-full-width="true"] .swiper-container, .nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer.first-section .swiper-container, .parallax_slider_outer.first-section .nectar-slider-wrap').css('width',$(window).width());
}else{
var $container=($('body > #boxed').length==0) ? '#post-area':'.container-wrap';
if($($container).width()=='0'&&$('body > #boxed').length > 0) $container='#boxed';
$('.nectar-slider-wrap[data-full-width="true"] .swiper-container, .nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer.first-section .swiper-container, .parallax_slider_outer.first-section .nectar-slider-wrap').css('width',$($container).width());
}
var $sliderHeight=parseInt($(this).find('.swiper-container').attr('data-height'));
var isFullWidthCompatible=($(this).attr('data-full-width')=='true') ? 'true':'false';
if($(this).parent().attr('id')=='portfolio-extra'&&$('#full_width_portfolio').length==0||$(this).parents('#post-area').length > 0){ isFullWidthCompatible='false'; };
var $sliderWidth=(isFullWidthCompatible=='true') ? $(window).width()-$smoothSrollWidth:$(this).width();
$(this).parents('.parallax_slider_outer').css('height',$sliderHeight);
$(this).css('height',$sliderHeight);
$(this).find('.swiper-container, .swiper-slide').css({'height':$sliderHeight+2, 'top':'-1px'});
$(this).find('.swiper-container').css('width', $sliderWidth);
$(this).find('.video-wrap').width($sliderWidth+2);
$(this).find('.video-wrap').height($sliderHeight+2);
var scale_h=$sliderWidth / vid_w_orig;
var scale_v=($sliderHeight - $headerHeight) / vid_h_orig;
var scale=scale_h > scale_v ? scale_h:scale_v;
min_w=1280/720 * ($sliderHeight+20);
if(scale * vid_w_orig < min_w){scale=min_w / vid_w_orig;}
$(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * vid_w_orig +2));
$(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * vid_h_orig +2));
$(this).find('.video-wrap').scrollLeft(($(this).find('video').width() - $sliderWidth) / 2);
$(this).find('.swiper-slide').each(function(){
if($(this).find('.video-wrap').length > 0){
if($(this).attr('data-bg-alignment')=='center'){
$(this).find('.video-wrap, .mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($sliderHeight)) / 2);
}
else if($(this).attr('data-bg-alignment')=='bottom'){
$(this).find('.video-wrap').scrollTop(($(this).find('video').height() - ($sliderHeight+2)));
}else{
$(this).find('.video-wrap').scrollTop(0);
}}
});
}});
};
resizeToCover();
function captionTransition(obj){
resizeToCover();
var $containerClass;
(typeof obj=='undefined') ? $containerClass='div[id^=ns-id-]':$containerClass='#'+$(obj.container).parents('.nectar-slider-wrap').attr('id'); ;
var fromLeft=Math.abs(parseInt($($containerClass+' .swiper-wrapper').css('left')));
var currentSlide=Math.round(fromLeft/$($containerClass+' .swiper-slide').width());
var $slideNum=$($containerClass+':first .swiper-wrapper > div').length;
currentSlide=$($containerClass + ' .swiper-slide-active').index();
if($($containerClass+' .swiper-slide:nth-child('+ (currentSlide + 1) +')').find('.content *').length > 0){
if($($containerClass+' .swiper-slide:nth-child('+ (currentSlide + 1) +')').find('.content *').css('opacity')!='0'&&!$('html').hasClass('no-video')){
playVideoBG(currentSlide + 1, $containerClass);
if(!$($containerClass+' .swiper-slide:nth-child('+ (currentSlide + 1) +')').hasClass('autorotate-shown')){
return false;
}else{
$($containerClass+' .swiper-slide').removeClass('autorotate-shown');
}}
}
if(!$('html').hasClass('no-video')){
$($containerClass+' .swiper-slide .content p, '+$containerClass+' .swiper-slide .content h2, '+$containerClass+' .swiper-slide .content .buttons').stop(true,true).css({'opacity':0, 'padding-top': 55});
}
$($containerClass+' .swiper-slide').each(function(){
if($(this).find('.video-wrap video').length > 0&&!$('html').hasClass('no-video')){ $(this).find('.video-wrap video').get(0).pause(); }});
$($containerClass+' .swiper-slide:not(".swiper-slide-active")').each(function(){
if($(this).find('.video-wrap video').length > 0){
if($(this).find('.video-wrap video').get(0).currentTime!=0) $(this).find('.video-wrap video').get(0).currentTime=0;
}});
if($($containerClass +' .swiper-container').attr('data-loop')=='true'){
if($($containerClass+' .swiper-slide-active').index()+1==2&&$($containerClass+' .swiper-slide-active video').length > 0&&!$('html').hasClass('no-video')){
$($containerClass+' .swiper-slide:last-child').find('.video-wrap video').get(0).play();
$($containerClass+' .swiper-slide:last-child').find('.video-wrap video').get(0).pause();
}
if($($containerClass+' .swiper-slide-active').index()+1==$slideNum-1&&$($containerClass+' .swiper-slide-active video').length > 0&&!$('html').hasClass('no-video')){
$($containerClass+' .swiper-slide:first-child').find('.video-wrap video').get(0).play();
$($containerClass+' .swiper-slide:first-child').find('.video-wrap video').get(0).pause();
}
if($($containerClass+' .swiper-slide-active').index()+1!=2&&$($containerClass+' .swiper-slide:nth-child(2) video').length > 0&&!$('html').hasClass('no-video')){
$($containerClass+' .swiper-slide:last-child').find('.video-wrap video').get(0).play();
$($containerClass+' .swiper-slide:last-child').find('.video-wrap video').get(0).pause();
$($containerClass+' .swiper-slide:nth-child(2) video').get(0).pause();
if($($containerClass+' .swiper-slide:nth-child(2) video').get(0).currentTime!=0) $($containerClass+' .swiper-slide:nth-child(2) video').get(0).currentTime=0;
}
if($($containerClass).attr('data-overall_style')!='directional'){
if($($containerClass+' .swiper-slide-active').index()+1==$slideNum-1){
$($containerClass+' .swiper-slide:nth-child(1)').find('.content').children().each(function(i){
$(this).stop().delay(i*95).transition({
'opacity':1,
'padding-top':0
},600,'easeOutQuart');
});
}
if($($containerClass+' .swiper-slide-active').index()+1==2){
$($containerClass+' .swiper-slide:nth-child('+ ($slideNum) + ')').find('.content').children().each(function(i){
$(this).stop().delay(i*95).transition({
'opacity':1,
'padding-top':0
},600,'easeOutQuart');
});
}
if($($containerClass+' .swiper-slide-active').index()+1==$slideNum){
$($containerClass+' .swiper-slide:nth-child(2)').find('.content').children().each(function(i){
$(this).stop().delay(i*95).transition({
'opacity':1,
'padding-top':0
},600,'easeOutQuart');
});
}
if($($containerClass+' .swiper-slide-active').index()+1==1){
$($containerClass+' .swiper-slide:eq(-2)').find('.content').children().each(function(i){
$(this).stop().delay(i*95).transition({
'opacity':1,
'padding-top':0
},600,'easeOutQuart');
});
}}
}
setTimeout(function(){
playVideoBG($($containerClass + ' .swiper-slide-active').index() + 1, $containerClass);
},50);
if($($containerClass).attr('data-overall_style')!='directional'){
$($containerClass+' .swiper-slide:nth-child('+ (currentSlide + 1) +')').find('.content').children().each(function(i){
$(this).stop().delay(i*95).transition({
'opacity':1,
'padding-top':0
},600,'easeOutQuart');
});
}
$captionTrans++;
if($captionTrans==$('.swiper-wrapper').length){ $('div.first_video_slide').addClass('nulled') }
setTimeout(function(){
if($('.slider-next').hasClass('next-arrow-move')){
$('.nectar-slider-wrap[data-button-styling="btn_with_preview"] .swiper-container .slider-next').trigger('mouseenter');
}else if($('.slider-prev').hasClass('prev-arrow-move')){
$('.nectar-slider-wrap[data-button-styling="btn_with_preview"] .swiper-container .slider-prev').trigger('mouseenter');
}
if($($containerClass).attr('data-button-styling')=='btn_with_preview'){
$($containerClass+' .swiper-slide').addClass('prev-high-z-index-static');
$($containerClass+' .swiper-slide.swiper-slide-active').removeClass('prev-high-z-index-static');
}},175);
}
function playVideoBG(nthChild, containerClass){
if($(containerClass+' .swiper-slide:nth-child('+ (nthChild) +')').find('.video-wrap video').length > 0){
if(!$('html').hasClass('no-video')) $(containerClass+' .swiper-slide:nth-child('+ (nthChild) +')').find('.video-wrap video').get(0).play();
if(!$(containerClass+' .swiper-slide:nth-child('+ (nthChild) +')').find('.mejs-overlay.mejs-overlay-play').hasClass('playing')&&$(containerClass+' .swiper-slide:nth-child('+ (nthChild) +')').find('.mejs-overlay.mejs-overlay-play').hasClass('mobile-played')){ $(containerClass+' .swiper-slide:nth-child('+ (nthChild) +')').find('.mejs-overlay.mejs-overlay-play').addClass('playing'); }
if(!$(containerClass+' .swiper-slide:nth-child('+ (nthChild) +')').find('.mejs-poster').hasClass('playing')&&$(containerClass+' .swiper-slide:nth-child('+ (nthChild) +')').find('.mejs-poster').hasClass('mobile-played')) $(containerClass+' .swiper-slide:nth-child('+ (nthChild) +')').find('.mejs-poster').addClass('playing');
var $that=$(containerClass+' .swiper-slide:nth-child('+ (nthChild) +')').find('.mejs-overlay.mejs-overlay-play');
var $that2=$(containerClass+' .swiper-slide:nth-child('+ (nthChild) +')').find('.mejs-poster');
if($that.hasClass('playing')&&$that.hasClass('mobile-played')){
setTimeout(function(){ $that.addClass('behind-buttons'); $that2.addClass('behind-buttons');},200);
}else{
$that.removeClass('behind-buttons'); $that2.removeClass('behind-buttons');
}}
}
var $startingSlide=null;
function slideContentPos(){
$('.swiper-wrapper').each(function(){
var $extraHeight=($(this).parents('.nectar-slider-wrap').hasClass('first-section')||$(this).parents('.parallax_slider_outer').hasClass('first-section')) ? 30:0;
var $sliderHeight=parseInt($(this).parents('.swiper-container').attr('data-height'));
var $transparentHeader=($('#header-outer[data-transparent-header="true"]').length > 0) ? $('#header-space').height():0 ;
if($(this).parents('.first-section').length==0||window.innerWidth < 1000){
$transparentHeader=null;
}else if($transparentHeader!=0&&$('#header-outer[data-remove-border="true"]').length > 0){
$transparentHeader=$transparentHeader/2
}
$(this).find('.swiper-slide').each(function(){
var $contentHeight=$(this).find('.content').height();
var $contentItems=$(this).find('.content > *').length;
$contentHeight2=0;
$(this).find('.content > *').each(function(){
$contentHeight2 +=$(this).height() + parseInt($(this).css('margin-bottom')) + parseInt($(this).css('padding-bottom'));
});
if($(this).find('.content > *').css('padding-top')=='25px') $contentHeight=$contentHeight - 25*$contentItems;
if($(this).attr('data-y-pos')=='top'){
var $topHeight=($contentHeight2/2) < ((($sliderHeight+ $transparentHeader)/4) - 30) ? ((($sliderHeight+ $transparentHeader)/4) - ($contentHeight2/2)) + 20:($sliderHeight+ $transparentHeader)/8;
$(this).find('.content').css('top', $topHeight + 'px');
}
else if($(this).attr('data-y-pos')=='middle'){
$(this).find('.content').css('top', ((($sliderHeight + $transparentHeader)/2) - ($contentHeight2/2)) + 'px');
}else{
if($contentHeight2 > 180){
$(this).find('.content').css('top', ((($sliderHeight + $transparentHeader)/2) - ($contentHeight2/10)) +'px');
}else{
$(this).find('.content').css('top', ((($sliderHeight + $transparentHeader)/2) + ($contentHeight2/9)) + 'px');
}}
});
});
}
function showSliderControls(){
$('.swiper-container .slider-prev, .swiper-container .slider-next, .slider-pagination').animate({'opacity':1},550,'easeOutSine');
}
var sliderLength=$('.swiper-container').length;
var sliderLoadedLength=0;
function sliderLoadIn(slider,index){
slider.find('.nectar-slider-loading').fadeOut(800,'easeInOutExpo');
$('body #header-outer[data-transparent-header="true"] .ns-loading-cover').fadeOut(800,'easeInOutExpo',function(){
$(this).remove();
$('.nectar-slider-wrap.first-section .swiper-container .swiper-wrapper .swiper-slide').removeClass('not-loaded');
});
slider.find('span.ie-fix').remove();
var $smoothActive=$('body').attr('data-smooth-scrolling');
if($smoothActive==1&&$(window).width() > 690&&$('body').outerHeight(true) > $(window).height()&&$('#ascrail2000').length==0&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ niceScrollInit(); resizeToCover(); }
sliderLoadedLength++;
if($('.tabbed').find('.swiper-container').length > 0&&sliderLoadedLength==sliderLength){
setTimeout(function(){ $('.tabbed > ul li:first-child a').click(); }, 200);
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)) autorotateInit(slider,index);
}
$('body').on('mouseover','.swiper-slide', function(){
if($(this).find('video').length > 0&&$(this).find('video').get(0).paused==true&&$animating==false){
$(this).find('video').get(0).play();
}});
$('body').on('click', '.mejs-overlay.mejs-overlay-play',function(){
$(this).toggleClass('playing');
$(this).addClass('mobile-played');
$(this).parent().find('.mejs-poster').toggleClass('playing');
$(this).parent().find('.mejs-poster').addClass('mobile-played');
var $that=$(this);
var $that2=$(this).parent().find('.mejs-poster');
if($(this).hasClass('playing')&&$(this).hasClass('mobile-played')){
setTimeout(function(){ $that.addClass('behind-buttons'); $that2.addClass('behind-buttons'); },200);
}else{
setTimeout(function(){ $that.removeClass('behind-buttons'); $that2.removeClass('behind-buttons'); },1);
}});
var $sliderHeight=parseInt($(this).find('.swiper-container').attr('data-height'));
var portfolioHeaderHeight=($('.project-title.parallax-effect').length > 0) ? 100:0;
function autorotateInit(slider,num){
var $autoplayVal=slider.attr('data-autorotate');
var $that=slider;
var $sliderNum=num;
if(typeof $autoplayVal!='undefined'&&$autoplayVal.length!='0'&&parseInt($autoplayVal)){
nectarSlideRotateInit(slider,$autoplayVal,$sliderNum);
}}
function nectarSlideRotateInit(slider,interval,sliderNum){
autoplay[sliderAutoplayCount]=setInterval(function(){ nectarSlideRotate(slider, sliderNum); } ,interval);
$('#'+slider.attr('id')).attr('autoplay-id',sliderAutoplayCount);
$('#'+slider.attr('id') + ' a.slider-prev, #'+slider.attr('id') + ' a.slider-next, #' + slider.attr('id') + ' .slider-pagination span').click(function(e){
if(typeof e.clientY!='undefined'){
clearInterval(autoplay[$('#'+slider.attr('id')).attr('autoplay-id')]);
if($('#'+slider.attr('id')).parent().hasClass('parallax_slider_outer')&&$('#'+slider.attr('id')).attr('data-overall_style')=='directional'){
$('#'+slider.attr('id')).parent().addClass('user-stopped');
}}
});
sliderAutoplayCount++;
}
function nectarSlideRotate(slider, sliderNum){
if($nectarSliders[sliderNum].activeIndex + 1 < $(slider).find('.swiper-wrapper > div.swiper-slide').length){
if($(slider).attr('data-button-styling')=='btn_with_preview'){
$(slider).find('.swiper-slide').removeClass('high-z-index').removeClass('prev-high-z-index');
$(slider).find('.swiper-slide').removeClass('next-move').removeClass('prev-move');
}
if($(slider).attr('data-overall_style')!='directional'){
$nectarSliders[sliderNum].swipeNext();
}else{
$($nectarSliders[sliderNum].container).find('.slider-next').trigger('click');
}}else{
if($(slider).find('.swiper-container').is("[data-loop]")&&$(slider).find('.swiper-container').attr('data-loop')=='true'){
if($(slider).attr('data-overall_style')!='directional'){
$nectarSliders[sliderNum].swipeNext();
}else{
$($nectarSliders[sliderNum].container).find('.slider-next').trigger('click');
}}else{
if($(slider).attr('data-overall_style')!='directional'){
$nectarSliders[sliderNum].swipeTo(0,800);
}else{
$(slider).find('.swiper-container').addClass('directional-trans-prev');
$nectarSliders[sliderNum].swipeTo(0,800);
var $timeout2;
clearTimeout($timeout2);
$timeout2=setTimeout(function(){ onChangeStart($nectarSliders[sliderNum]); } ,100);
}}
}}
function clearAutoplay(e){
var $autoplayVal=$('#'+$(e.container).parent().attr('id')).attr('data-autorotate');
if(typeof $autoplayVal!='undefined'&&$autoplayVal.length!='0'&&parseInt($autoplayVal)){
clearInterval(autoplay[$('#'+$(e.container).parent().attr('id')).attr('autoplay-id')]);
}}
var animationQueue=null;
function onChangeStart(e){
var $obj=e;
$animating=true;
var $slideNum=$($obj.container).find('.swiper-wrapper > div').length;
$activeIndex=($($obj.container).attr('data-loop')=='true') ? $obj.activeIndex + 1: $obj.activeIndex+1;
$activeIndex2=($($obj.container).attr('data-loop')=='true') ? $obj.activeIndex: $obj.activeIndex+1;
if($($obj.container).parent().attr('data-overall_style')!='directional'){
if($($obj.container).parents('.parallax_slider_outer').length > 0&&$($obj.container).find('.swiper-slide-active[data-color-scheme="dark"]').length > 0 ||
$($obj.container).parents('.first-section').length > 0&&$($obj.container).find('.swiper-slide-active[data-color-scheme="dark"]').length > 0){
$('#header-outer').addClass('dark-slide');
}else{
$('#header-outer').removeClass('dark-slide');
}}else{
if($($obj.container).hasClass('directional-trans-next')){
if($($obj.container).parents('.parallax_slider_outer').length > 0&&$($obj.container).find('.swiper-slide-active').next('.swiper-slide').is('[data-color-scheme="dark"]') ||
$($obj.container).parents('.first-section').length > 0&&$($obj.container).find('.swiper-slide-active').next('.swiper-slide').is('[data-color-scheme="dark"]')){
$('#header-outer').addClass('dark-slide');
if($('body.mobile').length==0){
$('#header-outer nav > ul.sf-menu > li > a, #header-outer nav > ul.buttons > li#search-btn a, #header-outer nav > ul.buttons > li.slide-out-widget-area-toggle a > span, #header-outer .cart-icon-wrap, header#top #logo').each(function(){
var $itemWidth=parseInt($(this).find('span.original').attr('data-w'));
$(this).find('span.dark').css('display','inline').transition({'margin-left': '0'},0).transition({ 'width':$itemWidth }, 325, 'easeInOutQuart');
$(this).find('span.dark > span').transition({'margin-left': '0'},0);
$(this).find('span.light').css('display','inline-block').transition({'margin-left': $itemWidth, 'width':'0' }, 325, 'easeInOutQuart');
$(this).find('span.light > span').transition({'margin-left': '-' + ($itemWidth) + 'px', 'width':$itemWidth }, 325, 'easeInOutQuart');
});
}}else{
$('#header-outer').removeClass('dark-slide');
if($('body.mobile').length==0){
$('#header-outer nav > ul.sf-menu > li > a, #header-outer nav > ul.buttons > li#search-btn a, #header-outer nav > ul.buttons > li.slide-out-widget-area-toggle a > span, #header-outer .cart-icon-wrap, header#top #logo').each(function(){
var $itemWidth=parseInt($(this).find('span.original').attr('data-w'));
$(this).find('span.light').css('display','inline').transition({'margin-left': '0'},0).css('display','inline').transition({'width':$itemWidth }, 325, 'easeInOutQuart');
$(this).find('span.light > span').transition({'margin-left': '0'},0);
$(this).find('span.dark').css('display','inline-block').transition({'margin-left': $itemWidth, 'width':'0' }, 325, 'easeInOutQuart');
$(this).find('span.dark > span').transition({'margin-left': '-' + ($itemWidth) + 'px', 'width':$itemWidth }, 325, 'easeInOutQuart');
});
}}
}
else if($($obj.container).hasClass('directional-trans-prev')){
if($($obj.container).parents('.parallax_slider_outer').length > 0&&$($obj.container).find('.swiper-slide-active').prev('.swiper-slide').is('[data-color-scheme="dark"]') ||
$($obj.container).parents('.first-section').length > 0&&$($obj.container).find('.swiper-slide-active').prev('.swiper-slide').is('[data-color-scheme="dark"]')){
$('#header-outer').addClass('dark-slide');
if($('body.mobile').length==0){
$('#header-outer nav > ul.sf-menu > li > a, #header-outer nav > ul.buttons > li#search-btn a, #header-outer nav > ul.buttons > li.slide-out-widget-area-toggle a > span, #header-outer .cart-icon-wrap, header#top #logo').each(function(){
var $itemWidth=parseInt($(this).find('span.original').attr('data-w'));
$(this).find('span.dark').css('display','inline').transition({'margin-left': '0'},0).transition({ 'width':$itemWidth }, 325, 'easeInOutQuart');
$(this).find('span.dark > span').transition({'margin-left': '0'},0);
$(this).find('span.light').css('display','inline-block').transition({'margin-left': $itemWidth, 'width':'0' }, 325, 'easeInOutQuart');
$(this).find('span.light > span').transition({'margin-left': '-' + ($itemWidth) + 'px', 'width':$itemWidth }, 325, 'easeInOutQuart');
});
}}else{
$('#header-outer').removeClass('dark-slide');
if($('body.mobile').length==0){
$('#header-outer nav > ul.sf-menu > li > a, #header-outer nav > ul.buttons > li#search-btn a, #header-outer nav > ul.buttons > li.slide-out-widget-area-toggle a > span, #header-outer .cart-icon-wrap, header#top #logo').each(function(){
var $itemWidth=parseInt($(this).find('span.original').attr('data-w'));
$(this).find('span.light').css('display','inline').transition({'margin-left': '0'},0).transition({'width':$itemWidth }, 325, 'easeInOutQuart');
$(this).find('span.light > span').transition({'margin-left': '0'},0);
$(this).find('span.dark').css('display','inline-block').transition({'margin-left': $itemWidth, 'width':'0' }, 325, 'easeInOutQuart');
$(this).find('span.dark > span').transition({'margin-left': '-' + ($itemWidth) + 'px', 'width':$itemWidth }, 325, 'easeInOutQuart');
});
}}
}
else if($($obj.container).hasClass('directional-trans-current')){
if($($obj.container).parents('.parallax_slider_outer').length > 0&&$($obj.container).find('.swiper-slide-active').is('[data-color-scheme="dark"]') ||
$($obj.container).parents('.first-section').length > 0&&$($obj.container).find('.swiper-slide-active').is('[data-color-scheme="dark"]')){
$('#header-outer').addClass('dark-slide');
if($('body.mobile').length==0){
$('#header-outer nav > ul.sf-menu > li > a, #header-outer nav > ul.buttons > li#search-btn a, #header-outer nav > ul.buttons > li.slide-out-widget-area-toggle a > span, #header-outer .cart-icon-wrap, header#top #logo').each(function(){
var $itemWidth=parseInt($(this).find('span.original').attr('data-w'));
$(this).find('span.dark').css('display','inline').transition({'margin-left': '0'},0).transition({ 'width':$itemWidth }, 325, 'easeInOutQuart');
$(this).find('span.dark > span').transition({'margin-left': '0'},0);
$(this).find('span.light').css('display','inline-block').transition({'margin-left': $itemWidth, 'width':'0' }, 325, 'easeInOutQuart');
$(this).find('span.light > span').transition({'margin-left': '-' + ($itemWidth) + 'px', 'width':$itemWidth }, 325, 'easeInOutQuart');
});
}}else{
$('#header-outer').removeClass('dark-slide');
if($('body.mobile').length==0){
$('#header-outer nav > ul.sf-menu > li > a, #header-outer nav > ul.buttons > li#search-btn a, #header-outer nav > ul.buttons > li.slide-out-widget-area-toggle a > span, #header-outer .cart-icon-wrap, header#top #logo').each(function(){
var $itemWidth=parseInt($(this).find('span.original').attr('data-w'));
$(this).find('span.light').css('display','inline').transition({'margin-left': '0'},0).transition({'width':$itemWidth }, 325, 'easeInOutQuart');
$(this).find('span.light > span').transition({'margin-left': '0'},0);
$(this).find('span.dark').css('display','inline-block').transition({'margin-left': $itemWidth, 'width':'0' }, 325, 'easeInOutQuart');
$(this).find('span.dark > span').transition({'margin-left': '-' + ($itemWidth) + 'px', 'width':$itemWidth }, 325, 'easeInOutQuart');
});
}}
}}
if($($obj.container).parent().attr('data-overall_style')!='directional'){
if($($obj.container).find('.swiper-slide:nth-child('+ ($activeIndex) +')').attr('data-color-scheme')=='dark'){
$($obj.container).find('.slider-pagination').addClass('dark-cs');
$($obj.container).find('.slider-prev, .slider-next').addClass('dark-cs');
}else{
$($obj.container).find('.slider-pagination').removeClass('dark-cs');
$($obj.container).find('.slider-prev, .slider-next').removeClass('dark-cs');
}}else{
if($($obj.container).hasClass('directional-trans-next')){
if($($obj.container).find('.swiper-slide:nth-child('+ ($activeIndex+1) +')').attr('data-color-scheme')=='dark'){
$($obj.container).find('.slider-pagination').addClass('dark-cs');
$($obj.container).find('.slider-prev, .slider-next').addClass('dark-cs');
}else{
$($obj.container).find('.slider-pagination').removeClass('dark-cs');
$($obj.container).find('.slider-prev, .slider-next').removeClass('dark-cs');
}}else if($($obj.container).hasClass('directional-trans-prev')){
if($($obj.container).find('.swiper-slide:nth-child('+ ($activeIndex-1) +')').attr('data-color-scheme')=='dark'){
$($obj.container).find('.slider-pagination').addClass('dark-cs');
$($obj.container).find('.slider-prev, .slider-next').addClass('dark-cs');
}else{
$($obj.container).find('.slider-pagination').removeClass('dark-cs');
$($obj.container).find('.slider-prev, .slider-next').removeClass('dark-cs');
}}else if($($obj.container).hasClass('directional-trans-current')){
if($($obj.container).find('.swiper-slide:nth-child('+ ($activeIndex) +')').attr('data-color-scheme')=='dark'){
$($obj.container).find('.slider-pagination').addClass('dark-cs');
$($obj.container).find('.slider-prev, .slider-next').addClass('dark-cs');
}else{
$($obj.container).find('.slider-pagination').removeClass('dark-cs');
$($obj.container).find('.slider-prev, .slider-next').removeClass('dark-cs');
}}
}
$($obj.container).find('.swiper-slide .video-texture').removeClass('no-trans').removeClass('light-overlay').removeClass('dark-overlay').removeClass('half-dark-overlay').removeClass('half-light-overlay');
$($obj.container).find('.slider-prev .slide-count .slide-current').html($activeIndex2);
$($obj.container).find('.slider-next .slide-count .slide-current').html($activeIndex2);
if($($obj.container).attr('data-loop')=='true'){
if($($obj.container).find('.swiper-slide-active').index()+1==1){
$($obj.container).find('.slider-next .slide-count .slide-current, .slider-prev .slide-count .slide-current').html($slideNum - 2);
}
else if($($obj.container).find('.swiper-slide-active').index()+1==$slideNum){
$($obj.container).find('.slider-next .slide-count .slide-current, .slider-prev .slide-count .slide-current').html(1);
}}
if($obj.activeIndex >=10){ $($obj.container).find('.slider-next .slide-count .slide-current').addClass('double-digits'); }else{
$($obj.container).find('.slider-next .slide-count .slide-current').removeClass('double-digits');
}
$($obj.container).find('.swiper-slide:not(".swiper-slide-active")').each(function(){
if($(this).find('.video-wrap video').length > 0){
}});
if($($obj.container).attr('data-loop')=='true'){
if($obj.previousIndex==1&&$obj.activeIndex==0||$obj.previousIndex==$slideNum - 2&&$obj.activeIndex==$slideNum - 1){
$('.swiper-slide').addClass('duplicate-transition');
}}
clearTimeout(animationQueue);
animationQueue=setTimeout(function(){ $animating=false; $('.swiper-slide').removeClass('duplicate-transition'); },800);
}
function hideSlider(){
if($(window).scrollTop()/($sliderHeight + portfolioHeaderHeight + 125) >=1){
$('.parallax_slider_outer .nectar-slider-wrap, .project-title.parallax-effect').css('visibility','hidden').hide();
$('.parallax_slider_outer').removeClass('element-in-view').addClass('element-out-of-view');
if($('.parallax_slider_outer .nectar-slider-wrap[data-overall_style="directional"]').length > 0){
var $autoplayVal=$('.parallax_slider_outer .nectar-slider-wrap[data-overall_style="directional"]').attr('data-autorotate');
if(typeof $autoplayVal!='undefined'&&$autoplayVal.length!='0'&&parseInt($autoplayVal)){
clearInterval(autoplay[$('.parallax_slider_outer .nectar-slider-wrap').attr('autoplay-id')]);
}}
$(window).on('scroll',showSlider);
$(window).off('scroll',hideSlider);
}}
function showSlider(){
if($(window).scrollTop()/($sliderHeight + portfolioHeaderHeight + 125) <=1){
$('.parallax_slider_outer .nectar-slider-wrap, .project-title.parallax-effect').css('visibility','visible').show();
$('.parallax_slider_outer').addClass('element-in-view');
if($('.parallax_slider_outer .nectar-slider-wrap[data-overall_style="directional"]').length > 0&&$('.parallax_slider_outer.element-out-of-view').length > 0&&$('.parallax_slider_outer.user-stopped').length==0){
var $autoplayVal=$('.parallax_slider_outer .nectar-slider-wrap[data-overall_style="directional"]').attr('data-autorotate');
if(typeof $autoplayVal!='undefined'&&$autoplayVal.length!='0'&&parseInt($autoplayVal)){
nectarSlideRotateInit($('.parallax_slider_outer .nectar-slider-wrap'),$autoplayVal,0);
}}
$('.parallax_slider_outer').removeClass('element-out-of-view');
$('.swiper-slide iframe[data-aspectRatio]').each(function(){
var newWidth=$(this).parent().width();
var $el=$(this);
if($(this).is(':visible')) $el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
});
nsSliderContentResize();
if($('.parallax_slider_outer').length > 0){
var fromLeft=Math.abs(parseInt($('.parallax_slider_outer .nectar-slider-wrap .swiper-wrapper').css('left')));
var currentSlide=Math.round(fromLeft/$('.parallax_slider_outer .nectar-slider-wrap .swiper-slide').width());
$('.parallax_slider_outer .swiper-wrapper .swiper-slide:eq(' + currentSlide + ')').find('.content').children().each(function(i){
$(this).stop(true,true).css({ 'opacity':1, 'padding-top':0 });
});
$('.parallax_slider_outer .swiper-wrapper .swiper-slide:eq(' + currentSlide + ')').addClass('autorotate-shown');
}
$(window).on('scroll',hideSlider);
$(window).off('scroll',showSlider);
}}
function sliderCorrectDisplayCheck(){
if($(window).scrollTop()/($sliderHeight + portfolioHeaderHeight + 125) >=1){
hideSlider();
}
$(window).unbind('scroll',sliderCorrectDisplayCheck);
}
var $smoothActive=$('body').attr('data-smooth-scrolling');
window.requestAnimationFrame=window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(f){setTimeout(f, 1000/60)}
var lastPosition=-1;
var $multiplier1=($('body[data-hhun="1"]').length > 0) ? 0.40: 0.2;
var $multiplier2=($('body[data-hhun="1"]').length > 0) ? 0.09: 0.14;
var $parallaxHeaderHUN=($('#header-outer[data-transparency-option="1"]').length > 0) ? 0.49: 0.4;
function parallaxScroll(){
var $scrollTop=$(window).scrollTop();
if(lastPosition==$scrollTop||$('.parallax_slider_outer.element-in-view').length==0){
return false;
} else lastPosition=$scrollTop;
if($smoothActive==1&&navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1){ return false; }
if($('body[data-hhun="1"]').length > 0&&!$('#header-outer').hasClass('side-widget-open')&&!$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')){
$('#header-outer.parallax-contained').css({ 'transform': 'translateY('+$scrollTop*-$parallaxHeaderHUN+'px)' });
}
$('.parallax_slider_outer.first-section .nectar-slider-wrap[data-parallax="true"]').css({ 'transform': 'translateY('+$scrollTop*-$multiplier1+'px)' });
$('.parallax_slider_outer.first-section .swiper-slide:not(".static"):not(".caption-no-fade") .content, .parallax_slider_outer.first-section .nectar-slider-wrap[data-parallax="true"] .swiper-container .slider-next, .parallax_slider_outer.first-section .nectar-slider-wrap[data-parallax="true"] .swiper-container .slider-prev, .swiper-wrapper .slider-down-arrow').css({ 'transform': 'translateY('+$scrollTop*-$multiplier2+'px)', 'opacity': 1-($scrollTop/($sliderHeight-120)) });
$('#full_width_portfolio .project-title.parallax-effect').css({ 'transform': 'translateY('+ $scrollTop*-$multiplier1+'px)' });
}
function sliderParallaxUpdateHeight(){
$sliderHeight=parseInt($('.parallax_slider_outer.first-section .swiper-container').attr('data-height'));
$('.project-title').css({
'top': $('#header-space').outerHeight() + $adminBarHeight + 'px'
});
}
var $sliderHeight=parseInt($('.parallax_slider_outer.first-section .swiper-container').attr('data-height'));
var $adminBarHeight=($('#wpadminbar').length > 0) ? 28:0;
function sliderParallaxInit(){
if($('#portfolio-extra').length > 0&&$('#full_width_portfolio').length==0){ return false; }
$('.parallax_slider_outer').addClass('element-in-view');
window.addEventListener('scroll', function(){
window.requestAnimationFrame(parallaxScroll);
}, false);
parallaxScroll();
var portfolioHeaderHeight=($('.project-title.parallax-effect').length > 0) ? 100:0;
function displayParallaxSliderInit(){
if($(window).scrollTop()/($sliderHeight + portfolioHeaderHeight + 90) >=1){
$(window).off('scroll.nsVisibilityHide');
$(window).on('scroll.nsVisibilityHide', hideSlider);
$(window).on('scroll',showSlider);
}else{
$(window).off('scroll.nsVisibilityShow');
$(window).on('scroll.nsVisibilityShow', showSlider);
$(window).off('scroll', hideSlider);
}}
displayParallaxSliderInit();
$(window).off('scroll.nsCorrectDisplayCheck');
$(window).on('scroll.nsCorrectDisplayCheck',sliderCorrectDisplayCheck);
$('body:not(".single") .page-header-no-bg, body:not(".single") #page-header-wrap, body:not(".single") #page-header-bg').remove();
$('.project-title').addClass('parallax-effect').css({
'top': $('#header-space').outerHeight() + $adminBarHeight + 'px'
});
if($('.project-title.parallax-effect').length > 0){
$('.parallax_slider_outer.first-section .swiper-slide .content, .nectar-slider-wrap.first-section .swiper-slide .content').css('margin-top','0px');
$('.swiper-container .slider-prev, .swiper-container .slider-next').css('margin-top','-28px');
}
if($('.demo_store').length > 0) $('.project-title.parallax-effect').css('margin-top','-25px');
if($('#full_width_portfolio').length > 0){
$('.parallax_slider_outer.first-section').css('margin-top','93px');
}
$(window).off('resize.nsHeightUpdate');
$(window).on('resize.nsHeightUpdate',sliderParallaxUpdateHeight);
}
function parallaxCheck(){
$(window).off('scroll.nsParallaxScroll');
if($('.parallax_slider_outer').length > 0&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
sliderParallaxInit();
if($('body[data-hhun="1"]').length > 0) $('#header-outer').addClass('parallax-contained');
}else if($('.parallax_slider_outer').length > 0&&navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
$('.project-title').addClass('parallax-effect').css({
'top': $('#header-space').outerHeight() + $adminBarHeight + 'px'
});
$('body:not(".single") .page-header-no-bg, body:not(".single") #page-header-wrap, body:not(".single") #page-header-bg').remove();
}else{
$('.project-title').css({'top':'0'});
}}
parallaxCheck();
function niceScrollInit(){
$("html").niceScroll({
scrollspeed: 60,
mousescrollstep: 40,
cursorwidth: 15,
cursorborder: 0,
cursorcolor: '#303030',
cursorborderradius: 6,
autohidemode: false,
horizrailenabled: false
});
if($('#boxed').length==0){
$('body, body #header-outer, body #header-secondary-outer, body #search-outer').css('padding-right','16px');
}
$('html').addClass('no-overflow-y');
}
$('.portfolio-items a.pp:contains(Video), .swiper-container .buttons a.pp').click(function(){
$('.swiper-slide').each(function(){
if($(this).find('.video-wrap video').length > 0){
$(this).find('.video-wrap video').get(0).pause();
}});
});
$.cssHooks.backgroundColor={
get: function(elem){
if(elem.currentStyle)
var bg=elem.currentStyle["backgroundColor"];
else if(window.getComputedStyle)
var bg=document.defaultView.getComputedStyle(elem,
null).getPropertyValue("background-color");
if(bg.search("rgb")==-1)
return bg;
else {
bg=bg.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
function hex(x){
return ("0" + parseInt(x).toString(16)).slice(-2);
}
if(bg){
return "#" + hex(bg[1]) + hex(bg[2]) + hex(bg[3]);
}}
}}
function shadeColor(color, shade){
var colorInt=parseInt(color.substring(1),16);
var R=(colorInt & 0xFF0000) >> 16;
var G=(colorInt & 0x00FF00) >> 8;
var B=(colorInt & 0x0000FF) >> 0;
R=R + Math.floor((shade/255)*R);
G=G + Math.floor((shade/255)*G);
B=B + Math.floor((shade/255)*B);
var newColorInt=(R<<16) + (G<<8) + (B);
var newColorStr="#"+newColorInt.toString(16);
return newColorStr;
}
function sliderbuttonHoverEffect(){
$('.swiper-slide').each(function(){
$(this).find('.solid_color').each(function(){
var $currentColor=$(this).find('a').css('background-color');
var $hoverColor=shadeColor($currentColor, -16);
$(this).find('a').hover(function(){
$(this).attr('style','background-color:'+$hoverColor+'!important;');
},function(){
$(this).attr('style','');
});
});
});
}
sliderbuttonHoverEffect();
function sliderFontOverrides(){
var $overrideCSS='';
$('.nectar-slider-wrap').each(function(i){
if($(this).find('.swiper-container[data-tho]').length > 0){
$tho=$(this).find('.swiper-container').attr('data-tho');
$tco=$(this).find('.swiper-container').attr('data-tco');
$pho=$(this).find('.swiper-container').attr('data-pho');
$pco=$(this).find('.swiper-container').attr('data-pco');
if($tho!='auto'||$tco!='auto'){
$overrideCSS +='@media only screen and (max-width: 1000px) and (min-width: 690px){';
if($tho!='auto')
$overrideCSS +='#'+$(this).attr('id')+ '.nectar-slider-wrap[data-full-width="false"] .swiper-slide .content h2, #boxed .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content h2, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="true"] .swiper-slide .content h2, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="boxed-full-width"] .swiper-slide .content h2, body .full-width-content .vc_span12 .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content h2 { font-size:' + $tho + 'px!important; line-height:' + (parseInt($tho) + 10) + 'px!important; }';
if($pho!='auto')
$overrideCSS +='#'+$(this).attr('id')+ '.nectar-slider-wrap[data-full-width="false"] .swiper-slide .content p, #boxed .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content p, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="true"] .swiper-slide .content p, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="boxed-full-width"] .swiper-slide .content p, body .full-width-content .vc_span12 .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content p { font-size:' + $tco + 'px!important; line-height:' + (parseInt($tco) + 10) + 'px!important; }';
$overrideCSS +='}';
}
if($pho!='auto'||$pco!='auto'){
$overrideCSS +='@media only screen and (max-width: 690px){';
if($pho!='auto')
$overrideCSS +='#'+$(this).attr('id')+ '.nectar-slider-wrap[data-full-width="false"] .swiper-slide .content h2, #boxed .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content h2, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="true"] .swiper-slide .content h2, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="boxed-full-width"] .swiper-slide .content h2, body .full-width-content .vc_span12 .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content h2 { font-size:' + $pho + 'px!important; line-height:' + (parseInt($pho) + 10) + 'px!important; }';
if($pho!='auto')
$overrideCSS +='#'+$(this).attr('id')+ '.nectar-slider-wrap[data-full-width="false"] .swiper-slide .content p, #boxed .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content p, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="true"] .swiper-slide .content p, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="boxed-full-width"] .swiper-slide .content p, body .full-width-content .vc_span12 .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content p { font-size:' + $pco + 'px!important; line-height:' + (parseInt($pco) + 10) + 'px!important; }';
$overrideCSS +='}';
}}
});
if($overrideCSS.length > 1){
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=$overrideCSS;
}else{
style.appendChild(document.createTextNode($overrideCSS));
}
head.appendChild(style);
}}
sliderFontOverrides();
var logoHeight=parseInt($('#header-outer').attr('data-logo-height'));
headerPadding=headerPadding - headerPadding/1.8;
$('body').on('click','.slider-down-arrow',function(){
var $currentSlider=$(this).parents('.swiper-container');
var $topDistance=$currentSlider.attr('data-height');
var $offset=($currentSlider.parents('.first-section').length==0||$('body[data-transparent-header="false"]').length > 0) ? $currentSlider.offset().top:0;
if($('body[data-permanent-transparent="1"]').length==0){
if(!$('body').hasClass('mobile')){
if($('body[data-hhun="1"]').length > 0){
$('body,html').stop().animate({
scrollTop: parseInt($topDistance) + $offset + 2
},1000,'easeInOutCubic')
}else{
$('body,html').stop().animate({
scrollTop: parseInt($topDistance - $('#header-space').height()) + parseInt(shrinkNum) + headerPadding*2 + $offset + 2
},1000,'easeInOutCubic')
}}else{
$scrollPos=($('#header-outer[data-mobile-fixed="1"]').length > 0) ? parseInt($topDistance) - $('#header-space').height() + parseInt($currentSlider.offset().top) + 2:parseInt($topDistance) + parseInt($currentSlider.offset().top) + 2;
$('body,html').stop().animate({
scrollTop: $scrollPos
},1000,'easeInOutCubic')
}}else{
$('body,html').stop().animate({
scrollTop: parseInt($topDistance) + parseInt($currentSlider.offset().top) + 2
},1000,'easeInOutCubic')
}
return false;
});
function prettyPhotoInit(){
var loading_animation=($('body[data-loading-animation]').attr('data-loading-animation')!='none') ? $('body').attr('data-loading-animation'):null ;
var ascend_loader=($('body').hasClass('ascend')) ? ' ':'';
var ascend_loader_class=($('body').hasClass('ascend')) ? 'default_loader ':'';
$(".nectar-slider-wrap a[rel^='prettyPhoto']").prettyPhoto({
theme: 'dark_rounded',
allow_resize: true,
default_width: 690,
opacity: 0.85,
animation_speed: 'normal',
default_height: 388,
social_tools: '',
markup: ' \
'+ascend_loader+'
\
'
});
}});
!function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(b){for(var c=a([0]),d=-1,e=this.length;++dc;c+=1)if(g(a,b[c]))return c;return-1}function f(){var b=a(N);b.appendTo(document.body);var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function g(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function h(a,b,c){var d,e,f;if(null===a||a.length<1)return[];for(d=a.split(b),e=0,f=d.length;f>e;e+=1)d[e]=c(d[e]);return d}function i(a){return a.outerWidth(!1)-a.width()}function j(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function k(c){c.on("mousemove",function(c){var d=L;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function l(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function m(a,b){var c=l(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){e(a.target,b.get())>=0&&c(a)})}function n(a){a[0]!==document.activeElement&&window.setTimeout(function(){var b,c=a[0],d=a.val().length;a.focus();var e=c.offsetWidth>0||c.offsetHeight>0;e&&c===document.activeElement&&(c.setSelectionRange?c.setSelectionRange(d,d):c.createTextRange&&(b=c.createTextRange(),b.collapse(!1),b.select()))},0)}function o(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function p(a){a.preventDefault(),a.stopPropagation()}function q(a){a.preventDefault(),a.stopImmediatePropagation()}function r(b){if(!I){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);I=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),I.attr("class","select2-sizer"),a(document.body).append(I)}return I.text(b.val()),I.width()}function s(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(f=d(this),f&&g.push(f))})),b.attr("class",g.join(" "))}function t(a,b,c,e){var f=d(a.toUpperCase()).indexOf(d(b.toUpperCase())),g=b.length;return 0>f?void c.push(e(a)):(c.push(e(a.substring(0,f))),c.push(""),c.push(e(a.substring(f,f+g))),c.push(" "),void c.push(e(a.substring(f+g,a.length))))}function u(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function v(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&"function"==typeof e.abort&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{url:f,dataType:c.dataType,data:d,success:function(a){var b=c.results(a,i.page,i);i.callback(b)},error:function(a,b,c){var d={hasError:!0,jqXHR:a,textStatus:b,errorThrown:c};i.callback(d)}}),e=j.call(h,l)},f)}}function w(b){var c,d,e=b,f=function(a){return""+a.text};a.isArray(e)&&(d=e,e={results:d}),a.isFunction(e)===!1&&(d=e,e=function(){return d});var g=e();return g.text&&(f=g.text,a.isFunction(f)||(c=g.text,f=function(a){return a[c]})),function(b){var c,d=b.term,g={results:[]};return""===d?void b.callback(e()):(c=function(e,g){var h,i;if(e=e[0],e.children){h={};for(i in e)e.hasOwnProperty(i)&&(h[i]=e[i]);h.children=[],a(e.children).each2(function(a,b){c(b,h.children)}),(h.children.length||b.matcher(d,f(h),e))&&g.push(h)}else b.matcher(d,f(e),e)&&g.push(e)},a(e().results).each2(function(a,b){c(b,g.results)}),void b.callback(g))}}function x(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]},h=d?c(e):c;a.isArray(h)&&(a(h).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g))}}function y(b,c){if(a.isFunction(b))return!0;if(!b)return!1;if("string"==typeof b)return!0;throw new Error(c+" must be a string, function, or falsy value")}function z(b,c){if(a.isFunction(b)){var d=Array.prototype.slice.call(arguments,2);return b.apply(c,d)}return b}function A(b){var c=0;return a.each(b,function(a,b){b.children?c+=A(b.children):c++}),c}function B(a,c,d,e){var f,h,i,j,k,l=a,m=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(h=-1,i=0,j=e.tokenSeparators.length;j>i&&(k=e.tokenSeparators[i],h=a.indexOf(k),!(h>=0));i++);if(0>h)break;if(f=a.substring(0,h),a=a.substring(h+k.length),f.length>0&&(f=e.createSearchChoice.call(this,f,c),f!==b&&null!==f&&e.id(f)!==b&&null!==e.id(f))){for(m=!1,i=0,j=c.length;j>i;i++)if(g(e.id(f),e.id(c[i]))){m=!0;break}m||d(f)}}return l!==a?a:void 0}function C(){var b=this;a.each(arguments,function(a,c){b[c].remove(),b[c]=null})}function D(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var E,F,G,H,I,J,K,L={x:0,y:0},M={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case M.LEFT:case M.RIGHT:case M.UP:case M.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case M.SHIFT:case M.CTRL:case M.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},N="
",O={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};J=a(document),H=function(){var a=1;return function(){return a++}}(),E=D(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,g=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=a(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=a("",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+H()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",c.element.attr("title")),this.body=a(document.body),s(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(z(c.containerCss,this.opts.element)),this.container.addClass(z(c.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",p),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),s(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(z(c.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",p),this.results=d=this.container.find(g),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",p),k(this.results),this.dropdown.on("mousemove-filtered",g,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",g,this.bind(function(a){this._touchEvent=!0,this.highlightUnderEvent(a)})),this.dropdown.on("touchmove",g,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",g,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(a){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),m(80,this.results),this.dropdown.on("scroll-debounced",g,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),p(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),p(a))}),j(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",g,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(a){a.stopPropagation()}),this.nextSearchTerm=b,a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),K=K||f(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",c.searchInputPlaceholder)},destroy:function(){var a=this.opts.element,c=a.data("select2"),d=this;this.close(),a.length&&a[0].detachEvent&&d._sync&&a.each(function(){d._sync&&this.detachEvent("onpropertychange",d._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,c!==b&&(c.container.remove(),c.liveRegion.remove(),c.dropdown.remove(),a.show().removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show()),C.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:g(a.attr("locked"),"locked")||g(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:void 0},prepareOpts:function(c){var d,e,f,i,j=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a element.")}),c=a.extend({},{populateResults:function(d,e,f){var g,h=this.opts.id,i=this.liveRegion;(g=function(d,e,k){var l,m,n,o,p,q,r,s,t,u;d=c.sortResults(d,e,f);var v=[];for(l=0,m=d.length;m>l;l+=1)n=d[l],p=n.disabled===!0,o=!p&&h(n)!==b,q=n.children&&n.children.length>0,r=a(" "),r.addClass("select2-results-dept-"+k),r.addClass("select2-result"),r.addClass(o?"select2-result-selectable":"select2-result-unselectable"),p&&r.addClass("select2-disabled"),q&&r.addClass("select2-result-with-children"),r.addClass(j.opts.formatResultCssClass(n)),r.attr("role","presentation"),s=a(document.createElement("div")),s.addClass("select2-result-label"),s.attr("id","select2-result-label-"+H()),s.attr("role","option"),u=c.formatResult(n,s,f,j.opts.escapeMarkup),u!==b&&(s.html(u),r.append(s)),q&&(t=a(""),t.addClass("select2-result-sub"),g(n.children,t,k+1),r.append(t)),r.data("select2-data",n),v.push(r[0]);e.append(v),i.text(c.formatMatches(d.length))})(e,d,0)}},a.fn.select2.defaults,c),"function"!=typeof c.id&&(f=c.id,c.id=function(a){return a[f]}),a.isArray(c.element.data("select2Tags"))){if("tags"in c)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+c.element.attr("id");c.tags=c.element.data("select2Tags")}if(e?(c.query=this.bind(function(a){var c,e,f,g={results:[],more:!1},h=a.term;f=function(b,c){var d;b.is("option")?a.matcher(h,b.text(),b)&&c.push(j.optionToData(b)):b.is("optgroup")&&(d=j.optionToData(b),b.children().each2(function(a,b){f(b,d.children)}),d.children.length>0&&c.push(d))},c=d.children(),this.getPlaceholder()!==b&&c.length>0&&(e=this.getPlaceholderOption(),e&&(c=c.not(e))),c.each2(function(a,b){f(b,g.results)}),a.callback(g)}),c.id=function(a){return a.id}):"query"in c||("ajax"in c?(i=c.element.data("ajax-url"),i&&i.length>0&&(c.ajax.url=i),c.query=v.call(c.element,c.ajax)):"data"in c?c.query=w(c.data):"tags"in c&&(c.query=x(c.tags),c.createSearchChoice===b&&(c.createSearchChoice=function(b){return{id:a.trim(b),text:a.trim(b)}}),c.initSelection===b&&(c.initSelection=function(b,d){var e=[];a(h(b.val(),c.separator,c.transformVal)).each(function(){var b={id:this,text:this},d=c.tags;a.isFunction(d)&&(d=d()),a(d).each(function(){return g(this.id,b.id)?(b=this,!1):void 0}),e.push(b)}),d(e)}))),"function"!=typeof c.query)throw"query function not defined for Select2 "+c.element.attr("id");if("top"===c.createSearchChoicePosition)c.createSearchChoicePosition=function(a,b){a.unshift(b)};else if("bottom"===c.createSearchChoicePosition)c.createSearchChoicePosition=function(a,b){a.push(b)};else if("function"!=typeof c.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return c},monitorSource:function(){var c,d=this.opts.element,e=this;d.on("change.select2",this.bind(function(a){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),this._sync=this.bind(function(){var a=d.prop("disabled");a===b&&(a=!1),this.enable(!a);var c=d.prop("readonly");c===b&&(c=!1),this.readonly(c),this.container&&(s(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(z(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(s(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(z(this.opts.dropdownCssClass,this.opts.element)))}),d.length&&d[0].attachEvent&&d.each(function(){this.attachEvent("onpropertychange",e._sync)}),c=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,c!==b&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new c(function(b){a.each(b,e._sync)}),this.propertyObserver.observe(d.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(b){var c=a.Event("select2-selecting",{val:this.id(b),object:b,choice:b});return this.opts.element.trigger(c),!c.isDefaultPrevented()},triggerChange:function(b){b=b||{},b=a.extend({},b,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(b),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var a=this._enabled&&!this._readonly,b=!a;return a===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",b),this.close(),this.enabledInterface=a,!0)},enable:function(a){a===b&&(a=!0),this._enabled!==a&&(this._enabled=a,this.opts.element.prop("disabled",!a),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(a){a===b&&(a=!1),this._readonly!==a&&(this._readonly=a,this.opts.element.prop("readonly",a),this.enableInterface())},opened:function(){return this.container?this.container.hasClass("select2-dropdown-open"):!1},positionDropdown:function(){var b,c,d,e,f,g=this.dropdown,h=this.container,i=h.offset(),j=h.outerHeight(!1),k=h.outerWidth(!1),l=g.outerHeight(!1),m=a(window),n=m.width(),o=m.height(),p=m.scrollLeft()+n,q=m.scrollTop()+o,r=i.top+j,s=i.left,t=q>=r+l,u=i.top-l>=m.scrollTop(),v=g.outerWidth(!1),w=function(){return p>=s+v},x=function(){return i.left+p+h.outerWidth(!1)>v},y=g.hasClass("select2-drop-above");y?(c=!0,!u&&t&&(d=!0,c=!1)):(c=!1,!t&&u&&(d=!0,c=!0)),d&&(g.hide(),i=this.container.offset(),j=this.container.outerHeight(!1),k=this.container.outerWidth(!1),l=g.outerHeight(!1),p=m.scrollLeft()+n,q=m.scrollTop()+o,r=i.top+j,s=i.left,v=g.outerWidth(!1),g.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(f=a(".select2-results",g)[0],g.addClass("select2-drop-auto-width"),g.css("width",""),v=g.outerWidth(!1)+(f.scrollHeight===f.clientHeight?0:K.width),v>k?k=v:v=k,l=g.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(b=this.body.offset(),r-=b.top,s-=b.left),!w()&&x()&&(s=i.left+this.container.outerWidth(!1)-v),e={left:s,width:k},c?(e.top=i.top-l,e.bottom="auto",this.container.addClass("select2-drop-above"),g.addClass("select2-drop-above")):(e.top=r,e.bottom="auto",this.container.removeClass("select2-drop-above"),g.removeClass("select2-drop-above")),e=a.extend(e,z(this.opts.dropdownCss,this.opts.element)),g.css(e)},shouldOpen:function(){var b;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(b=a.Event("select2-opening"),this.opts.element.trigger(b),!b.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),J.on("mousemove.select2Event",function(a){L.x=a.pageX,L.y=a.pageY}),!0):!1},opening:function(){var b,d=this.containerEventName,e="scroll."+d,f="resize."+d,g="orientationchange."+d;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),b=a("#select2-drop-mask"),0===b.length&&(b=a(document.createElement("div")),b.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),b.hide(),b.appendTo(this.body),b.on("mousedown touchstart click",function(d){c(b);var e,f=a("#select2-drop");f.length>0&&(e=f.data("select2"),e.opts.selectOnBlur&&e.selectHighlighted({noFocus:!0}),e.close(),d.preventDefault(),d.stopPropagation())})),this.dropdown.prev()[0]!==b[0]&&this.dropdown.before(b),a("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),b.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var h=this;this.container.parents().add(window).each(function(){a(this).on(f+" "+e+" "+g,function(a){h.opened()&&h.positionDropdown()})})},close:function(){if(this.opened()){var b=this.containerEventName,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.parents().add(window).each(function(){a(this).off(c).off(d).off(e)}),this.clearDropdownAlignmentPreference(),a("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),J.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(a.Event("select2-close"))}},externalSearch:function(a){this.open(),this.search.val(a),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return z(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var b,c,d,e,f,g,h,i,j=this.results;if(c=this.highlight(),!(0>c)){if(0==c)return void j.scrollTop(0);b=this.findHighlightableChoices().find(".select2-result-label"),d=a(b[c]),i=(d.offset()||{}).top||0,e=i+d.outerHeight(!0),c===b.length-1&&(h=j.find("li.select2-more-results"),h.length>0&&(e=h.offset().top+h.outerHeight(!0))),f=j.offset().top+j.outerHeight(!1),e>f&&j.scrollTop(j.scrollTop()+(e-f)),g=i-j.offset().top,0>g&&"none"!=d.css("display")&&j.scrollTop(j.scrollTop()+g)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(b){for(var c=this.findHighlightableChoices(),d=this.highlight();d>-1&&d=f.length&&(b=f.length-1),0>b&&(b=0),this.removeHighlight(),c=a(f[b]),c.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",c.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(c.text()),d=c.data("select2-data"),void(d&&this.opts.element.trigger({type:"select2-highlight",val:this.id(d),choice:d})))},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(b){var c=a(b.target).closest(".select2-result-selectable");if(c.length>0&&!c.is(".select2-highlighted")){var d=this.findHighlightableChoices();this.highlight(d.index(c))}else 0==c.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var a,b=this.results,c=b.find("li.select2-more-results"),d=this.resultsPage+1,e=this,f=this.search.val(),g=this.context;0!==c.length&&(a=c.offset().top-b.offset().top-b.height(),a<=this.opts.loadMorePadding&&(c.addClass("select2-active"),this.opts.query({element:this.opts.element,term:f,page:d,context:g,matcher:this.opts.matcher,callback:this.bind(function(a){e.opened()&&(e.opts.populateResults.call(this,b,a.results,{term:f,page:d,context:g}),e.postprocessResults(a,!1,!1),a.more===!0?(c.detach().appendTo(b).html(e.opts.escapeMarkup(z(e.opts.formatLoadMore,e.opts.element,d+1))),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):c.remove(),e.positionDropdown(),e.resultsPage=d,e.context=a.context,this.opts.element.trigger({type:"select2-loaded",items:a}))})})))},tokenize:function(){},updateResults:function(c){function d(){j.removeClass("select2-active"),m.positionDropdown(),k.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?m.liveRegion.text(k.text()):m.liveRegion.text(m.opts.formatMatches(k.find('.select2-result-selectable:not(".select2-selected")').length))}function e(a){k.html(a),d()}var f,h,i,j=this.search,k=this.results,l=this.opts,m=this,n=j.val(),o=a.data(this.container,"select2-last-term");if((c===!0||!o||!g(n,o))&&(a.data(this.container,"select2-last-term",n),c===!0||this.showSearchInput!==!1&&this.opened())){i=++this.queryCount;var p=this.getMaximumSelectionSize();if(p>=1&&(f=this.data(),a.isArray(f)&&f.length>=p&&y(l.formatSelectionTooBig,"formatSelectionTooBig")))return void e(""+z(l.formatSelectionTooBig,l.element,p)+" ");if(j.val().length"+z(l.formatInputTooShort,l.element,j.val(),l.minimumInputLength)+"":""),void(c&&this.showSearch&&this.showSearch(!0));if(l.maximumInputLength&&j.val().length>l.maximumInputLength)return void e(y(l.formatInputTooLong,"formatInputTooLong")?""+z(l.formatInputTooLong,l.element,j.val(),l.maximumInputLength)+" ":"");l.formatSearching&&0===this.findHighlightableChoices().length&&e(""+z(l.formatSearching,l.element)+" "),j.addClass("select2-active"),this.removeHighlight(),h=this.tokenize(),h!=b&&null!=h&&j.val(h),this.resultsPage=1,l.query({element:l.element,term:j.val(),page:this.resultsPage,context:null,matcher:l.matcher,callback:this.bind(function(f){var h;if(i==this.queryCount){if(!this.opened())return void this.search.removeClass("select2-active");if(f.hasError!==b&&y(l.formatAjaxError,"formatAjaxError"))return void e(""+z(l.formatAjaxError,l.element,f.jqXHR,f.textStatus,f.errorThrown)+" ");if(this.context=f.context===b?null:f.context,this.opts.createSearchChoice&&""!==j.val()&&(h=this.opts.createSearchChoice.call(m,j.val(),f.results),h!==b&&null!==h&&m.id(h)!==b&&null!==m.id(h)&&0===a(f.results).filter(function(){
return g(m.id(this),m.id(h))}).length&&this.opts.createSearchChoicePosition(f.results,h)),0===f.results.length&&y(l.formatNoMatches,"formatNoMatches"))return void e(""+z(l.formatNoMatches,l.element,j.val())+" ");k.empty(),m.opts.populateResults.call(this,k,f.results,{term:j.val(),page:this.resultsPage,context:null}),f.more===!0&&y(l.formatLoadMore,"formatLoadMore")&&(k.append(""+l.escapeMarkup(z(l.formatLoadMore,l.element,this.resultsPage))+" "),window.setTimeout(function(){m.loadMoreIfNeeded()},10)),this.postprocessResults(f,c),d(),this.opts.element.trigger({type:"select2-loaded",items:f})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){n(this.search)},selectHighlighted:function(a){if(this._touchMoved)return void this.clearTouchMoved();var b=this.highlight(),c=this.results.find(".select2-highlighted"),d=c.closest(".select2-result").data("select2-data");d?(this.highlight(b),this.onSelect(d,a)):a&&a.noFocus&&this.close()},getPlaceholder:function(){var a;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((a=this.getPlaceholderOption())!==b?a.text():b)},getPlaceholderOption:function(){if(this.select){var c=this.select.children("option").first();if(this.opts.placeholderOption!==b)return"first"===this.opts.placeholderOption&&c||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===a.trim(c.text())&&""===c.val())return c}},initContainerWidth:function(){function c(){var c,d,e,f,g,h;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(c=this.opts.element.attr("style"),c!==b)for(d=c.split(";"),f=0,g=d.length;g>f;f+=1)if(h=d[f].replace(/\s/g,""),e=h.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==e&&e.length>=1)return e[1];return"resolve"===this.opts.width?(c=this.opts.element.css("width"),c.indexOf("%")>0?c:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return a.isFunction(this.opts.width)?this.opts.width():this.opts.width}var d=c.call(this);null!==d&&this.container.css("width",d)}}),F=D(E,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container"}).html([""," "," "," "," "," ",""].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var c,d,e;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),c=this.search.get(0),c.createTextRange?(d=c.createTextRange(),d.collapse(!1),d.select()):c.setSelectionRange&&(e=this.search.val().length,c.setSelectionRange(e,e))),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),C.call(this,"selection","focusser")},initContainer:function(){var b,d,e=this.container,f=this.dropdown,g=H();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=b=e.find(".select2-choice"),this.focusser=e.find(".select2-focusser"),b.find(".select2-chosen").attr("id","select2-chosen-"+g),this.focusser.attr("aria-labelledby","select2-chosen-"+g),this.results.attr("id","select2-results-"+g),this.search.attr("aria-owns","select2-results-"+g),this.focusser.attr("id","s2id_autogen"+g),d=a("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.focus(this.bind(function(){this.focus()})),this.focusser.prev().text(d.text()).attr("for",this.focusser.attr("id"));var h=this.opts.element.attr("title");this.opts.element.attr("title",h||d.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(a("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&229!=a.keyCode){if(a.which===M.PAGE_UP||a.which===M.PAGE_DOWN)return void p(a);switch(a.which){case M.UP:case M.DOWN:return this.moveHighlight(a.which===M.UP?-1:1),void p(a);case M.ENTER:return this.selectHighlighted(),void p(a);case M.TAB:return void this.selectHighlighted({noFocus:!0});case M.ESC:return this.cancel(a),void p(a)}}})),this.search.on("blur",this.bind(function(a){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==M.TAB&&!M.isControl(a)&&!M.isFunctionKey(a)&&a.which!==M.ESC){if(this.opts.openOnEnter===!1&&a.which===M.ENTER)return void p(a);if(a.which==M.DOWN||a.which==M.UP||a.which==M.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),void p(a)}return a.which==M.DELETE||a.which==M.BACKSPACE?(this.opts.allowClear&&this.clear(),void p(a)):void 0}})),j(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown touchstart","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),q(a),this.close(),this.selection&&this.selection.focus())})),b.on("mousedown touchstart",this.bind(function(d){c(b),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),p(d)})),f.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),b.on("focus",this.bind(function(a){p(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var a=this;this.opts.initSelection.call(null,this.opts.element,function(c){c!==b&&null!==c&&(a.updateSelection(c),a.close(),a.setPlaceholder(),a.nextSearchTerm=a.opts.nextSearchTerm(c,a.search.val()))})}},isPlaceholderOptionSelected:function(){var a;return this.getPlaceholder()===b?!1:(a=this.getPlaceholderOption())!==b&&a.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val()},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find("option").filter(function(){return this.selected&&!this.disabled});b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var h=g(e,b.id(d));return h&&(f=d),h},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return g(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&(b===!0&&d>=0?this.highlight(d):this.highlight(0)),b===!0){var f=this.opts.minimumResultsForSearch;f>=0&&this.showSearch(A(a.results)>=f)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.close(),b&&b.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),g(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var c,d,e=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),e.empty(),null!==a&&(c=this.opts.formatSelection(a,e,this.opts.escapeMarkup)),c!==b&&e.append(c),d=this.opts.formatSelectionCssClass(a,e),d!==b&&e.addClass(d),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find("option").filter(function(){return this.selected}).each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({added:d,removed:f});else{if(!a&&0!==a)return void this.clear(c);if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({added:a,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(a){var c,d=!1;return 0===arguments.length?(c=this.selection.data("select2-data"),c==b&&(c=null),c):(arguments.length>1&&(d=arguments[1]),void(a?(c=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),d&&this.triggerChange({added:a,removed:c})):this.clear(d)))}}),G=D(E,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["",""].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=h(c.val(),b.separator,b.transformVal),f=[];b.query({matcher:function(c,d,h){var i=a.grep(e,function(a){return g(a,b.id(h))}).length;return i&&f.push(h),i},callback:a.isFunction(d)?function(){for(var a=[],c=0;c0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",c,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var a=this;this.opts.initSelection.call(null,this.opts.element,function(c){c!==b&&null!==c&&(a.updateSelection(c),a.close(),a.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c=[],d=[],f=this;a(b).each(function(){e(f.id(this),c)<0&&(c.push(f.id(this)),d.push(this))}),b=d,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){f.addSelectedChoice(this)}),f.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,c){this.triggerSelect(a)&&""!==a.text&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),c&&c.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(c){var d,e,f=!c.locked,g=a("
"),h=a("
"),i=f?g:h,j=this.id(c),k=this.getVal();d=this.opts.formatSelection(c,i.find("div"),this.opts.escapeMarkup),d!=b&&i.find("div").replaceWith(a("
").html(d)),e=this.opts.formatSelectionCssClass(c,i.find("div")),e!=b&&i.addClass(e),f&&i.find(".select2-search-choice-close").on("mousedown",p).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),p(b),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),i.data("select2-data",c),i.insertBefore(this.searchContainer),k.push(j),this.setVal(k)},unselect:function(b){var c,d,f=this.getVal();if(b=b.closest(".select2-search-choice"),0===b.length)throw"Invalid argument: "+b+". Must be .select2-search-choice";if(c=b.data("select2-data")){var g=a.Event("select2-removing");if(g.val=this.id(c),g.choice=c,this.opts.element.trigger(g),g.isDefaultPrevented())return!1;for(;(d=e(this.id(c),f))>=0;)f.splice(d,1),this.setVal(f),this.select&&this.postprocessResults();return b.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}),!0}},postprocessResults:function(a,b,c){var d=this.getVal(),f=this.results.find(".select2-result"),g=this.results.find(".select2-result-with-children"),h=this;f.each2(function(a,b){var c=h.id(b.data("select2-data"));e(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),g.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&this.opts.closeOnSelect===!0&&h.highlight(0),!this.opts.createSearchChoice&&!f.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&y(h.opts.formatNoMatches,"formatNoMatches")&&this.results.append(""+z(h.opts.formatNoMatches,h.opts.element,h.search.val())+" ")},getMaxSearchWidth:function(){return this.selection.width()-i(this.search)},resizeSearch:function(){var a,b,c,d,e,f=i(this.search);a=r(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),h(a,this.opts.separator,this.opts.transformVal))},setVal:function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){e(this,c)<0&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c0&&c--,a.splice(d,1),d--);return{added:b,removed:a}},val:function(c,d){var e,f=this;if(0===arguments.length)return this.getVal();if(e=this.data(),e.length||(e=[]),!c&&0!==c)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(d&&this.triggerChange({added:this.data(),removed:e}));if(this.setVal(c),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),d&&this.triggerChange(this.buildChangeDetails(e,this.data()));else{if(this.opts.initSelection===b)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(b){var c=a.map(b,f.id);f.setVal(c),f.updateSelection(b),f.clearSearch(),d&&f.triggerChange(f.buildChangeDetails(e,f.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to . Attach to instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(b,c){var d,e,f=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(e=this.data(),b||(b=[]),d=a.map(b,function(a){return f.opts.id(a)}),this.setVal(d),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(e,this.data())),void 0)}}),a.fn.select2=function(){var c,d,f,g,h,i=Array.prototype.slice.call(arguments,0),j=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],k=["opened","isFocused","container","dropdown"],l=["val","data"],m={search:"externalSearch"};return this.each(function(){if(0===i.length||"object"==typeof i[0])c=0===i.length?{}:a.extend({},i[0]),c.element=a(this),"select"===c.element.get(0).tagName.toLowerCase()?h=c.element.prop("multiple"):(h=c.multiple||!1,"tags"in c&&(c.multiple=h=!0)),d=h?new window.Select2["class"].multi:new window.Select2["class"].single,d.init(c);else{if("string"!=typeof i[0])throw"Invalid arguments to select2 plugin: "+i;if(e(i[0],j)<0)throw"Unknown method: "+i[0];if(g=b,d=a(this).data("select2"),d===b)return;if(f=i[0],"container"===f?g=d.container:"dropdown"===f?g=d.dropdown:(m[f]&&(f=m[f]),g=d[f].apply(d,i.slice(1))),e(i[0],k)>=0||e(i[0],l)>=0&&1==i.length)return!1}}),g===b?this:g},a.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return t(this.text(a),c.term,e,d),e.join("")},transformVal:function(b){return a.trim(b)},formatSelection:function(a,c,d){return a?d(this.text(a)):b},sortResults:function(a,b,c){return a},formatResultCssClass:function(a){return a.css},formatSelectionCssClass:function(a,c){return b},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a==b?null:a.id},text:function(b){return b&&this.data&&this.data.text?a.isFunction(this.data.text)?this.data.text(b):b[this.data.text]:b.text},matcher:function(a,b){return d(""+b).toUpperCase().indexOf(d(""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:B,escapeMarkup:u,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(a){return null},nextSearchTerm:function(a,c){return b},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(a){var b="ontouchstart"in window||navigator.msMaxTouchPoints>0;return b&&a.opts.minimumResultsForSearch<0?!1:!0}},a.fn.select2.locales=[],a.fn.select2.locales.en={formatMatches:function(a){return 1===a?"One result is available, press enter to select it.":a+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(a,b,c){return"Loading failed"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" or more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(a){return"Loading more results…"},formatSearching:function(){return"Searching…"}},a.extend(a.fn.select2.defaults,a.fn.select2.locales.en),a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:v,local:w,tags:x},util:{debounce:l,markMatch:t,escapeMarkup:u,stripDiacritics:d},"class":{"abstract":E,single:F,multi:G}}}}(jQuery);
!function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);
function vc_js(){
vc_toggleBehaviour(),
vc_tabsBehaviour(),
vc_accordionBehaviour(),
vc_teaserGrid(),
vc_carouselBehaviour(),
vc_slidersBehaviour(),
vc_prettyPhoto(),
vc_googleplus(),
vc_pinterest(),
vc_progress_bar(),
vc_plugin_flexslider(),
vc_google_fonts(),
vc_gridBehaviour(),
vc_rowBehaviour(),
vc_ttaActivation();
}
function getSizeName(){
var screen_w=jQuery(window).width();
return screen_w > 1170 ? "desktop_wide":screen_w > 960&&1169 > screen_w ? "desktop":screen_w > 768&&959 > screen_w ? "tablet":screen_w > 300&&767 > screen_w ? "mobile":300 > screen_w ? "mobile_portrait":""
}
function loadScript(url, $obj, callback){
var script=document.createElement("script");
script.type="text/javascript", script.readyState&&(script.onreadystatechange=function(){
("loaded"===script.readyState||"complete"===script.readyState)&&(script.onreadystatechange=null, callback())
}), script.src=url, $obj.get(0).appendChild(script)
}
function vc_ttaActivation(){
jQuery("[data-vc-accordion]").on("show.vc.accordion", function(e){
var $=window.jQuery,
ui={};
ui.newPanel=$(this).data("vc.accordion").getTarget(), window.wpb_prepare_tab_content(e, ui)
})
}
function vc_accordionActivate(event, ui){
if(ui.newPanel.length&&ui.newHeader.length){
var $pie_charts=ui.newPanel.find(".vc_pie_chart:not(.vc_ready)"),
$round_charts=ui.newPanel.find(".vc_round-chart"),
$line_charts=ui.newPanel.find(".vc_line-chart"),
$carousel=ui.newPanel.find('[data-ride="vc_carousel"]');
"undefined"!=typeof jQuery.fn.isotope&&ui.newPanel.find(".isotope, .wpb_image_grid_ul").isotope("layout"), ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){
var grid=jQuery(this).data("vcGrid");
grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()
}), vc_carouselBehaviour(ui.newPanel), vc_plugin_flexslider(ui.newPanel), $pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(), $round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({
reload: !1
}), $line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({
reload: !1
}), $carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"), ui.newPanel.parents(".isotope").length&&ui.newPanel.parents(".isotope").each(function(){
jQuery(this).isotope("layout")
})
}}
function initVideoBackgrounds(){
return window.console&&window.console.warn&&window.console.warn("this function is deprecated use vc_initVideoBackgrounds"), vc_initVideoBackgrounds()
}
function vc_initVideoBackgrounds(){
jQuery(".vc_row").each(function(){
var youtubeUrl, youtubeId, $row=jQuery(this);
$row.data("vcVideoBg") ? (youtubeUrl=$row.data("vcVideoBg"), youtubeId=vcExtractYoutubeId(youtubeUrl), youtubeId&&($row.find(".vc_video-bg").remove(), insertYoutubeVideoAsBackground($row, youtubeId)), jQuery(window).on("grid:items:added", function(event, $grid){
$row.has($grid).length&&vcResizeVideoBackground($row)
})):$row.find(".vc_video-bg").remove()
})
}
function insertYoutubeVideoAsBackground($element, youtubeId, counter){
if("undefined"==typeof YT.Player) return counter="undefined"==typeof counter ? 0:counter, counter > 100 ? void console.warn("Too many attempts to load YouTube api"):void setTimeout(function(){
insertYoutubeVideoAsBackground($element, youtubeId, counter++)
}, 100);
var $container=$element.prepend('').find(".inner");
new YT.Player($container[0], {
width: "100%",
height: "100%",
videoId: youtubeId,
playerVars: {
playlist: youtubeId,
iv_load_policy: 3,
enablejsapi: 1,
disablekb: 1,
autoplay: 1,
controls: 0,
showinfo: 0,
rel: 0,
loop: 1
},
events: {
onReady: function(event){
event.target.mute().setLoop(!0)
}}
}), vcResizeVideoBackground($element), jQuery(window).bind("resize", function(){
vcResizeVideoBackground($element)
})
}
function vcResizeVideoBackground($element){
var iframeW, iframeH, marginLeft, marginTop, containerW=$element.innerWidth(),
containerH=$element.innerHeight(),
ratio1=16,
ratio2=9;
ratio1 / ratio2 > containerW / containerH ? (iframeW=containerH * (ratio1 / ratio2), iframeH=containerH, marginLeft=-Math.round((iframeW - containerW) / 2) + "px", marginTop=-Math.round((iframeH - containerH) / 2) + "px", iframeW +="px", iframeH +="px"):(iframeW=containerW, iframeH=containerW * (ratio2 / ratio1), marginTop=-Math.round((iframeH - containerH) / 2) + "px", marginLeft=-Math.round((iframeW - containerW) / 2) + "px", iframeW +="px", iframeH +="px"), $element.find(".vc_video-bg iframe").css({
maxWidth: "1000%",
marginLeft: marginLeft,
marginTop: marginTop,
width: iframeW,
height: iframeH
})
}
function vcExtractYoutubeId(url){
if("undefined"==typeof url) return !1;
var id=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);
return null!==id ? id[1]:!1
}
document.documentElement.className +=" js_active ", document.documentElement.className +="ontouchstart" in document.documentElement ? " vc_mobile ":" vc_desktop ",
function(){
for (var prefix=["-webkit-", "-moz-", "-ms-", "-o-", ""], i=0; i < prefix.length; i++) prefix[i] + "transform" in document.documentElement.style&&(document.documentElement.className +=" vc_transform ")
}(), "function"!=typeof window.vc_plugin_flexslider&&(window.vc_plugin_flexslider=function($parent){
var $slider=$parent ? $parent.find(".wpb_flexslider"):jQuery(".wpb_flexslider");
$slider.each(function(){
var this_element=jQuery(this),
sliderSpeed=800,
sliderTimeout=1e3 * parseInt(this_element.attr("data-interval")),
sliderFx=this_element.attr("data-flex_fx"),
slideshow = !0;
0===sliderTimeout&&(slideshow = !1), this_element.is(":visible")&&this_element.flexslider({
animation: sliderFx,
slideshow: slideshow,
slideshowSpeed: sliderTimeout,
sliderSpeed: sliderSpeed,
smoothHeight: !0
})
})
}), "function"!=typeof window.vc_googleplus&&(window.vc_googleplus=function(){
0 < jQuery(".wpb_googleplus").length&&! function(){
var po=document.createElement("script");
po.type="text/javascript", po.async = !0, po.src="//apis.google.com/js/plusone.js";
var s=document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(po, s)
}()
}), "function"!=typeof window.vc_pinterest&&(window.vc_pinterest=function(){
0 < jQuery(".wpb_pinterest").length&&! function(){
var po=document.createElement("script");
po.type="text/javascript", po.async = !0, po.src="//assets.pinterest.com/js/pinit.js";
var s=document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(po, s)
}()
}), "function"!=typeof window.vc_progress_bar&&(window.vc_progress_bar=function(){
"undefined"!=typeof jQuery.fn.waypoint&&jQuery(".vc_progress_bar").waypoint(function(){
jQuery(this).find(".vc_single_bar").each(function(index){
var $this=jQuery(this),
bar=$this.find(".vc_bar"),
val=bar.data("percentage-value");
setTimeout(function(){
bar.css({
width: val + "%"
})
}, 200 * index)
})
}, {
offset: "85%"
})
}), "function"!=typeof window.vc_waypoints&&(window.vc_waypoints=function(){
"undefined"!=typeof jQuery.fn.waypoint&&jQuery(".wpb_animate_when_almost_visible:not(.wpb_start_animation)").waypoint(function(){
jQuery(this).addClass("wpb_start_animation")
}, {
offset: "85%"
})
}), "function"!=typeof window.vc_toggleBehaviour&&(window.vc_toggleBehaviour=function($el){
function event(e){
e&&e.preventDefault&&e.preventDefault();
var title=jQuery(this),
element=title.closest(".vc_toggle"),
content=element.find(".vc_toggle_content");
element.hasClass("vc_toggle_active") ? content.slideUp({
duration: 300,
complete: function(){
element.removeClass("vc_toggle_active")
}}):content.slideDown({
duration: 300,
complete: function(){
element.addClass("vc_toggle_active")
}})
}
$el ? $el.hasClass("vc_toggle_title") ? $el.unbind("click").click(event):$el.find(".vc_toggle_title").unbind("click").click(event):jQuery(".vc_toggle_title").unbind("click").on("click", event)
}), "function"!=typeof window.vc_tabsBehaviour&&(window.vc_tabsBehaviour=function($tab){
if(jQuery.ui){
var $call=$tab||jQuery(".wpb_tabs, .wpb_tour"),
ver=jQuery.ui&&jQuery.ui.version ? jQuery.ui.version.split("."):"1.10",
old_version=1===parseInt(ver[0])&&9 > parseInt(ver[1]);
$call.each(function(index){
var $tabs, interval=jQuery(this).attr("data-interval"),
tabs_array=[];
if($tabs=jQuery(this).find(".wpb_tour_tabs_wrapper").tabs({
show: function(event, ui){
wpb_prepare_tab_content(event, ui)
},
beforeActivate: function(event, ui){
1!==ui.newPanel.index()&&ui.newPanel.find(".vc_pie_chart:not(.vc_ready)")
},
activate: function(event, ui){
wpb_prepare_tab_content(event, ui)
}}), interval&&interval > 0) try {
$tabs.tabs("rotate", 1e3 * interval)
} catch (e){
window.console&&window.console.log&&console.log(e)
}
jQuery(this).find(".wpb_tab").each(function(){
tabs_array.push(this.id)
}), jQuery(this).find(".wpb_tabs_nav li").click(function(e){
return e.preventDefault(), old_version ? $tabs.tabs("select", jQuery("a", this).attr("href")):$tabs.tabs("option", "active", jQuery(this).index()), !1
}), jQuery(this).find(".wpb_prev_slide a, .wpb_next_slide a").click(function(e){
if(e.preventDefault(), old_version){
var index=$tabs.tabs("option", "selected");
jQuery(this).parent().hasClass("wpb_next_slide") ? index++:index--, 0 > index ? index=$tabs.tabs("length") - 1:index >=$tabs.tabs("length")&&(index=0), $tabs.tabs("select", index)
}else{
var index=$tabs.tabs("option", "active"),
length=$tabs.find(".wpb_tab").length;
index=jQuery(this).parent().hasClass("wpb_next_slide") ? index + 1 >=length ? 0:index + 1:0 > index - 1 ? length - 1:index - 1, $tabs.tabs("option", "active", index)
}})
})
}}), "function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){
jQuery(".wpb_accordion").each(function(index){
var $tabs, $this=jQuery(this),
active_tab=($this.attr("data-interval"), !isNaN(jQuery(this).data("active-tab"))&&0 < parseInt($this.data("active-tab")) ? parseInt($this.data("active-tab")) - 1:!1),
collapsible = !1===active_tab||"yes"===$this.data("collapsible");
$tabs=$this.find(".wpb_accordion_wrapper").accordion({
header: "> div > h3",
autoHeight: !1,
heightStyle: "content",
active: active_tab,
collapsible: collapsible,
navigation: !0,
activate: vc_accordionActivate,
change: function(event, ui){
"undefined"!=typeof jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"), vc_carouselBehaviour(ui.newPanel)
}}), !0===$this.data("vcDisableKeydown")&&($tabs.data("uiAccordion")._keydown=function(){})
})
}), "function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){
var layout_modes={
fitrows: "fitRows",
masonry: "masonry"
};
jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){
var $container=jQuery(this),
$thumbs=$container.find(".wpb_thumbnails"),
layout_mode=$thumbs.attr("data-layout-mode");
$thumbs.isotope({
itemSelector: ".isotope-item",
layoutMode: "undefined"==typeof layout_modes[layout_mode] ? "fitRows":layout_modes[layout_mode]
}), $container.find(".categories_filter a").data("isotope", $thumbs).click(function(e){
e.preventDefault();
var $thumbs=jQuery(this).data("isotope");
jQuery(this).parent().parent().find(".active").removeClass("active"), jQuery(this).parent().addClass("active"), $thumbs.isotope({
filter: jQuery(this).attr("data-filter")
})
}), jQuery(window).bind("load resize", function(){
$thumbs.isotope("layout")
})
})
}), "function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){
var $carousel=$parent ? $parent.find(".wpb_carousel"):jQuery(".wpb_carousel");
$carousel.each(function(){
var $this=jQuery(this);
if(!0!==$this.data("carousel_enabled")&&$this.is(":visible")){
$this.data("carousel_enabled", !0);
var carousel_speed=(getColumnsCount(jQuery(this)), 500);
jQuery(this).hasClass("columns_count_1")&&(carousel_speed=900);
var carousele_li=jQuery(this).find(".wpb_thumbnails-fluid li");
carousele_li.css({
"margin-right": carousele_li.css("margin-left"),
"margin-left": 0
});
var fluid_ul=jQuery(this).find("ul.wpb_thumbnails-fluid");
fluid_ul.width(fluid_ul.width() + 300), jQuery(window).resize(function(){
var before_resize=screen_size;
screen_size=getSizeName(), before_resize!=screen_size&&window.setTimeout("location.reload()", 20)
})
}})
}), "function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){
jQuery(".wpb_gallery_slides").each(function(index){
var $imagesGrid, this_element=jQuery(this);
if(this_element.hasClass("wpb_slider_nivo")){
var sliderSpeed=800,
sliderTimeout=1e3 * this_element.attr("data-interval");
0===sliderTimeout&&(sliderTimeout=9999999999), this_element.find(".nivoSlider").nivoSlider({
effect: "boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",
slices: 15,
boxCols: 8,
boxRows: 4,
animSpeed: sliderSpeed,
pauseTime: sliderTimeout,
startSlide: 0,
directionNav: !0,
directionNavHide: !0,
controlNav: !0,
keyboardNav: !1,
pauseOnHover: !0,
manualAdvance: !1,
prevText: "Prev",
nextText: "Next"
})
} else this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded ? $imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){
$imagesGrid.isotope({
itemSelector: ".isotope-item",
layoutMode: "fitRows"
})
}):this_element.find(".wpb_image_grid_ul").isotope({
itemSelector: ".isotope-item",
layoutMode: "fitRows"
}))
})
}), "function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){
try {
jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({
animationSpeed: "normal",
padding: 15,
opacity: .7,
showTitle: !0,
allowresize: !0,
counter_separator_label: "/",
hideflash: !1,
deeplinking: !1,
modal: !1,
callback: function(){
var url=location.href,
hashtag=url.indexOf("#!prettyPhoto") ? !0:!1;
hashtag&&(location.hash="!")
},
social_tools: ""
})
} catch (err){
window.console&&window.console.log&&console.log(err)
}}), "function"!=typeof window.vc_google_fonts&&(window.vc_google_fonts=function(){
return !1
}), window.vcParallaxSkroll = !1, "function"!=typeof window.vc_rowBehaviour&&(window.vc_rowBehaviour=function(){
function fullWidthRow(){
var $elements=$('[data-vc-full-width="true"]');
$.each($elements, function(key, item){
var $el=$(this);
$el.addClass("vc_hidden");
var $el_full=$el.next(".vc_row-full-width");
$el_full.length||($el_full=$el.parent().next(".vc_row-full-width"));
var el_margin_left=parseInt($el.css("margin-left"), 10),
el_margin_right=parseInt($el.css("margin-right"), 10),
offset=0 - $el_full.offset().left - el_margin_left,
width=$(window).width();
if($el.css({
position: "relative",
left: offset,
"box-sizing": "border-box",
width: $(window).width()
}), !$el.data("vcStretchContent")){
var padding=-1 * offset;
0 > padding&&(padding=0);
var paddingRight=width - padding - $el_full.width() + el_margin_left + el_margin_right;
0 > paddingRight&&(paddingRight=0), $el.css({
"padding-left": padding + "px",
"padding-right": paddingRight + "px"
})
}
$el.attr("data-vc-full-width-init", "true"), $el.removeClass("vc_hidden")
})
}
function parallaxRow(){
var vcSkrollrOptions, callSkrollInit = !1;
return window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(), $(".vc_parallax-inner").remove(), $("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"), $("[data-vc-parallax]").each(function(){
var skrollrSpeed, skrollrSize, skrollrStart, skrollrEnd, $parallaxElement, parallaxImage, youtubeId;
callSkrollInit = !0, "on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom", "opacity:0;").attr("data-30p-top-bottom", "opacity:1;"), skrollrSize=100 * $(this).data("vcParallax"), $parallaxElement=$("
").addClass("vc_parallax-inner").appendTo($(this)), $parallaxElement.height(skrollrSize + "%"), parallaxImage=$(this).data("vcParallaxImage"), youtubeId=vcExtractYoutubeId(parallaxImage), youtubeId ? insertYoutubeVideoAsBackground($parallaxElement, youtubeId):"undefined"!=typeof parallaxImage&&$parallaxElement.css("background-image", "url(" + parallaxImage + ")"), skrollrSpeed=skrollrSize - 100, skrollrStart=-skrollrSpeed, skrollrEnd=0, $parallaxElement.attr("data-bottom-top", "top: " + skrollrStart + "%;").attr("data-top-bottom", "top: " + skrollrEnd + "%;")
}), callSkrollInit&&window.skrollr ? (vcSkrollrOptions={
forceHeight: !1,
smoothScrolling: !1,
mobileCheck: function(){
return !1
}}, window.vcParallaxSkroll=skrollr.init(vcSkrollrOptions), window.vcParallaxSkroll):!1
}
function fullHeightRow(){
$(".vc_row-o-full-height:first").each(function(){
var $window, windowHeight, offsetTop, fullHeight;
$window=$(window), windowHeight=$window.height(), offsetTop=$(this).offset().top, windowHeight > offsetTop&&(fullHeight=100 - offsetTop / (windowHeight / 100), $(this).css("min-height", fullHeight + "vh"))
})
}
function fixIeFlexbox(){
var ua=window.navigator.userAgent,
msie=ua.indexOf("MSIE ");
(msie > 0||navigator.userAgent.match(/Trident.*rv\:11\./))&&$(".vc_row-o-full-height").each(function(){
"flex"===$(this).css("display")&&$(this).wrap('
')
})
}
var $=window.jQuery;
$(window).off("resize.vcRowBehaviour").on("resize.vcRowBehaviour", fullWidthRow).on("resize.vcRowBehaviour", fullHeightRow), fullWidthRow(), fullHeightRow(), fixIeFlexbox(), vc_initVideoBackgrounds(), parallaxRow()
}), "function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){
jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()
}), "function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(el){
for (var find = !1, i=1; !1===find;){
if(el.hasClass("columns_count_" + i)) return find = !0, i;
i++
}});
var screen_size=getSizeName();
"function"!=typeof window.wpb_prepare_tab_content&&(window.wpb_prepare_tab_content=function(event, ui){
var $ui_panel, $google_maps, panel=ui.panel||ui.newPanel,
$pie_charts=panel.find(".vc_pie_chart:not(.vc_ready)"),
$round_charts=panel.find(".vc_round-chart"),
$line_charts=panel.find(".vc_line-chart"),
$carousel=panel.find('[data-ride="vc_carousel"]');
if(vc_carouselBehaviour(), vc_plugin_flexslider(panel), ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){
var grid=jQuery(this).data("vcGrid");
grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()
}), panel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&panel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){
var grid=jQuery(this).data("vcGrid");
grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()
}), $pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(), $round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({
reload: !1
}), $line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({
reload: !1
}), $carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"), $ui_panel=panel.find(".isotope, .wpb_image_grid_ul"), $google_maps=panel.find(".wpb_gmaps_widget"), 0 < $ui_panel.length&&$ui_panel.isotope("layout"), $google_maps.length&&!$google_maps.is(".map_ready")){
var $frame=$google_maps.find("iframe");
$frame.attr("src", $frame.attr("src")), $google_maps.addClass("map_ready")
}
panel.parents(".isotope").length&&panel.parents(".isotope").each(function(){
jQuery(this).isotope("layout")
})
}), jQuery(document).ready(function($){
window.vc_js()
});
;(function($, window, document, undefined){
'use strict';
var NAME='parallax';
var MAGIC_NUMBER=30;
var DEFAULTS={
relativeInput: false,
clipRelativeInput: false,
calibrationThreshold: 100,
calibrationDelay: 500,
supportDelay: 500,
calibrateX: false,
calibrateY: true,
invertX: true,
invertY: true,
limitX: false,
limitY: false,
scalarX: 10.0,
scalarY: 10.0,
frictionX: 0.1,
frictionY: 0.1,
originX: 0.5,
originY: 0.5
};
function Plugin(element, options){
this.element=element;
this.$context=$(element).data('api', this);
this.$layers=this.$context.find('.layer');
var data={
calibrateX: this.$context.data('calibrate-x')||null,
calibrateY: this.$context.data('calibrate-y')||null,
invertX: this.$context.data('invert-x')||null,
invertY: this.$context.data('invert-y')||null,
limitX: parseFloat(this.$context.data('limit-x'))||null,
limitY: parseFloat(this.$context.data('limit-y'))||null,
scalarX: parseFloat(this.$context.data('scalar-x'))||null,
scalarY: parseFloat(this.$context.data('scalar-y'))||null,
frictionX: parseFloat(this.$context.data('friction-x'))||null,
frictionY: parseFloat(this.$context.data('friction-y'))||null,
originX: parseFloat(this.$context.data('origin-x'))||null,
originY: parseFloat(this.$context.data('origin-y'))||null
};
for (var key in data){
if(data[key]===null) delete data[key];
}
$.extend(this, DEFAULTS, options, data);
this.calibrationTimer=null;
this.calibrationFlag=true;
this.enabled=false;
this.depths=[];
this.raf=null;
this.bounds=null;
this.ex=0;
this.ey=0;
this.ew=0;
this.eh=0;
this.ecx=0;
this.ecy=0;
this.erx=0;
this.ery=0;
this.cx=0;
this.cy=0;
this.ix=0;
this.iy=0;
this.mx=0;
this.my=0;
this.vx=0;
this.vy=0;
this.onMouseMove=this.onMouseMove.bind(this);
this.onDeviceOrientation=this.onDeviceOrientation.bind(this);
this.onOrientationTimer=this.onOrientationTimer.bind(this);
this.onCalibrationTimer=this.onCalibrationTimer.bind(this);
this.onAnimationFrame=this.onAnimationFrame.bind(this);
this.onWindowResize=this.onWindowResize.bind(this);
this.initialise();
}
Plugin.prototype.transformSupport=function(value){
var element=document.createElement('div');
var propertySupport=false;
var propertyValue=null;
var featureSupport=false;
var cssProperty=null;
var jsProperty=null;
for (var i=0, l=this.vendors.length; i < l; i++){
if(this.vendors[i]!==null){
cssProperty=this.vendors[i][0] + 'transform';
jsProperty=this.vendors[i][1] + 'Transform';
}else{
cssProperty='transform';
jsProperty='transform';
}
if(element.style[jsProperty]!==undefined){
propertySupport=true;
break;
}}
switch(value){
case '2D':
featureSupport=propertySupport;
break;
case '3D':
if(propertySupport){
var body=document.body||document.createElement('body');
var documentElement=document.documentElement;
var documentOverflow=documentElement.style.overflow;
if(!document.body){
documentElement.style.overflow='hidden';
documentElement.appendChild(body);
body.style.overflow='hidden';
body.style.background='';
}
body.appendChild(element);
element.style[jsProperty]='translate3d(1px,1px,1px)';
propertyValue=window.getComputedStyle(element).getPropertyValue(cssProperty);
featureSupport=propertyValue!==undefined&&propertyValue.length > 0&&propertyValue!=="none";
documentElement.style.overflow=documentOverflow;
body.removeChild(element);
}
break;
}
return featureSupport;
};
Plugin.prototype.ww=null;
Plugin.prototype.wh=null;
Plugin.prototype.wcx=null;
Plugin.prototype.wcy=null;
Plugin.prototype.wrx=null;
Plugin.prototype.wry=null;
Plugin.prototype.portrait=null;
Plugin.prototype.desktop = !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i);
Plugin.prototype.vendors=[null,['-webkit-','webkit'],['-moz-','Moz'],['-o-','O'],['-ms-','ms']];
Plugin.prototype.motionSupport = !!window.DeviceMotionEvent;
Plugin.prototype.orientationSupport = !!window.DeviceOrientationEvent;
Plugin.prototype.orientationStatus=0;
Plugin.prototype.transform2DSupport=Plugin.prototype.transformSupport('2D');
Plugin.prototype.transform3DSupport=Plugin.prototype.transformSupport('3D');
Plugin.prototype.propertyCache={};
Plugin.prototype.initialise=function(){
if(this.$context.css('position')==='static'){
this.$context.css({
position:'relative'
});
}
this.accelerate(this.$context);
this.updateLayers();
this.updateDimensions();
this.enable();
this.queueCalibration(this.calibrationDelay);
};
Plugin.prototype.updateLayers=function(){
this.$layers=this.$context.find('.layer');
this.depths=[];
this.$layers.css({
position:'absolute',
display:'block',
left: 0,
top: 0
});
this.$layers.first().css({
position:'relative'
});
this.accelerate(this.$layers);
this.$layers.each($.proxy(function(index, element){
this.depths.push($(element).data('depth')||0);
}, this));
};
Plugin.prototype.updateDimensions=function(){
this.ww=window.innerWidth;
this.wh=window.innerHeight;
this.wcx=this.ww * this.originX;
this.wcy=this.wh * this.originY;
this.wrx=Math.max(this.wcx, this.ww - this.wcx);
this.wry=Math.max(this.wcy, this.wh - this.wcy);
};
Plugin.prototype.updateBounds=function(){
this.bounds=this.element.getBoundingClientRect();
this.ex=this.bounds.left;
this.ey=this.bounds.top;
this.ew=this.bounds.width;
this.eh=this.bounds.height;
this.ecx=this.ew * this.originX;
this.ecy=this.eh * this.originY;
this.erx=Math.max(this.ecx, this.ew - this.ecx);
this.ery=Math.max(this.ecy, this.eh - this.ecy);
};
Plugin.prototype.queueCalibration=function(delay){
clearTimeout(this.calibrationTimer);
this.calibrationTimer=setTimeout(this.onCalibrationTimer, delay);
};
Plugin.prototype.enable=function(){
if(!this.enabled){
this.enabled=true;
if(this.orientationSupport){
this.portrait=null;
window.addEventListener('deviceorientation', this.onDeviceOrientation);
setTimeout(this.onOrientationTimer, this.supportDelay);
}else{
this.cx=0;
this.cy=0;
this.portrait=false;
window.addEventListener('mousemove', this.onMouseMove);
}
window.addEventListener('resize', this.onWindowResize);
this.raf=requestAnimationFrame(this.onAnimationFrame);
}};
Plugin.prototype.disable=function(){
if(this.enabled){
this.enabled=false;
if(this.orientationSupport){
window.removeEventListener('deviceorientation', this.onDeviceOrientation);
}else{
window.removeEventListener('mousemove', this.onMouseMove);
}
window.removeEventListener('resize', this.onWindowResize);
cancelAnimationFrame(this.raf);
}};
Plugin.prototype.calibrate=function(x, y){
this.calibrateX=x===undefined ? this.calibrateX:x;
this.calibrateY=y===undefined ? this.calibrateY:y;
};
Plugin.prototype.invert=function(x, y){
this.invertX=x===undefined ? this.invertX:x;
this.invertY=y===undefined ? this.invertY:y;
};
Plugin.prototype.friction=function(x, y){
this.frictionX=x===undefined ? this.frictionX:x;
this.frictionY=y===undefined ? this.frictionY:y;
};
Plugin.prototype.scalar=function(x, y){
this.scalarX=x===undefined ? this.scalarX:x;
this.scalarY=y===undefined ? this.scalarY:y;
};
Plugin.prototype.limit=function(x, y){
this.limitX=x===undefined ? this.limitX:x;
this.limitY=y===undefined ? this.limitY:y;
};
Plugin.prototype.origin=function(x, y){
this.originX=x===undefined ? this.originX:x;
this.originY=y===undefined ? this.originY:y;
};
Plugin.prototype.clamp=function(value, min, max){
value=Math.max(value, min);
value=Math.min(value, max);
return value;
};
Plugin.prototype.css=function(element, property, value){
var jsProperty=this.propertyCache[property];
if(!jsProperty){
for (var i=0, l=this.vendors.length; i < l; i++){
if(this.vendors[i]!==null){
jsProperty=$.camelCase(this.vendors[i][1] + '-' + property);
}else{
jsProperty=property;
}
if(element.style[jsProperty]!==undefined){
this.propertyCache[property]=jsProperty;
break;
}}
}
element.style[jsProperty]=value;
};
Plugin.prototype.accelerate=function($element){
for (var i=0, l=$element.length; i < l; i++){
var element=$element[i];
this.css(element, 'transform', 'translate3d(0,0,0)');
this.css(element, 'transform-style', 'preserve-3d');
this.css(element, 'backface-visibility', 'hidden');
}};
Plugin.prototype.setPosition=function(element, x, y){
x +='px';
y +='px';
if(this.transform3DSupport){
this.css(element, 'transform', 'translate3d('+x+','+y+',0)');
}else if(this.transform2DSupport){
this.css(element, 'transform', 'translate('+x+','+y+')');
}else{
element.style.left=x;
element.style.top=y;
}};
Plugin.prototype.onOrientationTimer=function(event){
if(this.orientationSupport&&this.orientationStatus===0){
this.disable();
this.orientationSupport=false;
this.enable();
}};
Plugin.prototype.onCalibrationTimer=function(event){
this.calibrationFlag=true;
};
Plugin.prototype.onWindowResize=function(event){
this.updateDimensions();
};
Plugin.prototype.onAnimationFrame=function(){
this.updateBounds();
var dx=this.ix - this.cx;
var dy=this.iy - this.cy;
if((Math.abs(dx) > this.calibrationThreshold)||(Math.abs(dy) > this.calibrationThreshold)){
this.queueCalibration(0);
}
if(this.portrait){
this.mx=this.calibrateX ? dy:this.iy;
this.my=this.calibrateY ? dx:this.ix;
}else{
this.mx=this.calibrateX ? dx:this.ix;
this.my=this.calibrateY ? dy:this.iy;
}
this.mx *=this.ew * (this.scalarX / 100);
this.my *=this.eh * (this.scalarY / 100);
if(!isNaN(parseFloat(this.limitX))){
this.mx=this.clamp(this.mx, -this.limitX, this.limitX);
}
if(!isNaN(parseFloat(this.limitY))){
this.my=this.clamp(this.my, -this.limitY, this.limitY);
}
this.vx +=(this.mx - this.vx) * this.frictionX;
this.vy +=(this.my - this.vy) * this.frictionY;
for (var i=0, l=this.$layers.length; i < l; i++){
var depth=this.depths[i];
var layer=this.$layers[i];
var xOffset=this.vx * depth * (this.invertX ? -1:1);
var yOffset=this.vy * depth * (this.invertY ? -1:1);
this.setPosition(layer, xOffset, yOffset);
}
this.raf=requestAnimationFrame(this.onAnimationFrame);
};
Plugin.prototype.onDeviceOrientation=function(event){
if(!this.desktop&&event.beta!==null&&event.gamma!==null){
this.orientationStatus=1;
var x=(event.beta||0) / MAGIC_NUMBER;
var y=(event.gamma||0) / MAGIC_NUMBER;
var portrait=window.innerHeight > window.innerWidth;
if(this.portrait!==portrait){
this.portrait=portrait;
this.calibrationFlag=true;
}
if(this.calibrationFlag){
this.calibrationFlag=false;
this.cx=x;
this.cy=y;
}
this.ix=x;
this.iy=y;
}};
Plugin.prototype.onMouseMove=function(event){
var clientX=event.clientX;
var clientY=event.clientY;
if(!this.orientationSupport&&this.relativeInput){
if(this.clipRelativeInput){
clientX=Math.max(clientX, this.ex);
clientX=Math.min(clientX, this.ex + this.ew);
clientY=Math.max(clientY, this.ey);
clientY=Math.min(clientY, this.ey + this.eh);
}
this.ix=(clientX - this.ex - this.ecx) / this.erx;
this.iy=(clientY - this.ey - this.ecy) / this.ery;
}else{
this.ix=(clientX - this.wcx) / this.wrx;
this.iy=(clientY - this.wcy) / this.wry;
}};
var API={
enable: Plugin.prototype.enable,
disable: Plugin.prototype.disable,
updateLayers: Plugin.prototype.updateLayers,
calibrate: Plugin.prototype.calibrate,
friction: Plugin.prototype.friction,
invert: Plugin.prototype.invert,
scalar: Plugin.prototype.scalar,
limit: Plugin.prototype.limit,
origin: Plugin.prototype.origin
};
$.fn[NAME]=function (value){
var args=arguments;
return this.each(function (){
var $this=$(this);
var plugin=$this.data(NAME);
if(!plugin){
plugin=new Plugin(this, value);
$this.data(NAME, plugin);
}
if(API[value]){
plugin[value].apply(plugin, Array.prototype.slice.call(args, 1));
}});
};})(window.jQuery||window.Zepto, window, document);
;(function(){
var lastTime=0;
var vendors=['ms', 'moz', 'webkit', 'o'];
for(var x=0; x < vendors.length&&!window.requestAnimationFrame; ++x){
window.requestAnimationFrame=window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame=window[vendors[x]+'CancelAnimationFrame']||window[vendors[x]+'CancelRequestAnimationFrame'];
}
if(!window.requestAnimationFrame){
window.requestAnimationFrame=function(callback, element){
var currTime=new Date().getTime();
var timeToCall=Math.max(0, 16 - (currTime - lastTime));
var id=window.setTimeout(function(){ callback(currTime + timeToCall); },
timeToCall);
lastTime=currTime + timeToCall;
return id;
};}
if(!window.cancelAnimationFrame){
window.cancelAnimationFrame=function(id){
clearTimeout(id);
};}}());