PageSourceSearch

https://transparencia.infraero.gov.br/wp-content/themes/salient/js/init.js?ver=10.0

js infraero.gov.br collected 2026-09-24 09:26:13 UTC 673,781 bytes, 17,368 lines download raw bytes

vendor: 9,402 bytes, lines 1-27
1/*-------------------------------------------------------------------------
2
3	1.	Plugin Init
4	2.	Helper Functions
5	3.	Shortcode Stuff
6	4.	Header + Search
7	5.	Page Specific
8	6.  Scroll to top 
9	7.	Cross Browser Fixes
10
11
12-------------------------------------------------------------------------*/
13
14
15
16/*-------------------------------------------------------------------------*/
17/*	1.	Plugin Init
18/*-------------------------------------------------------------------------*/
19
20
21/*!
22Waypoints - 4.0.1
23*/
24!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.Context.refreshAll();for(var e in i)i[e].enabled=!0;return this},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,n.windowContext||(n.windowContext=!0,n.windowContext=new e(window)),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),i=this.element==this.element.window;t&&e&&!i&&(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];if(null!==a.triggerPoint){var l=o.oldScroll<a.triggerPoint,h=o.newScroll>=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=Math.floor(y+l-f),h=w<s.oldScroll,p=d.triggerPoint>=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))}();
25
26//visible
27!function(t){var i=t(window);
27t.fn.visible=function(t,e,o){if(!(this.length<1)){var r=this.length>1?this.eq(0):this,n=r.get(0),f=i.width(),h=i.height(),o=o?o:"both",l=e===!0?n.offsetWidth*n.offsetHeight:!0;if("function"==typeof n.getBoundingClientRect){var g=n.getBoundingClientRect(),u=g.top>=0&&g.top<h,s=g.bottom>0&&g.bottom<=h,c=g.left>=0&&g.left<f,a=g.right>0&&g.right<=f,v=t?u||s:u&&s,b=t?c||a:c&&a;if("both"===o)return l&&v&&b;if("vertical"===o)return l&&v;if("horizontal"===o)return l&&b}else{var d=i.scrollTop(),p=d+h,w=i.scrollLeft(),m=w+f,y=r.offset(),z=y.top,B=z+r.height(),C=y.left,R=C+r.width(),j=t===!0?B:z,q=t===!0?z:B,H=t===!0?R:C,L=t===!0?C:R;if("both"===o)return!!l&&p>=q&&j>=d&&m>=L&&H>=w;if("vertical"===o)return!!l&&p>=q&&j>=d;if("horizontal"===o)return!!l&&m>=L&&H>=w}}}}(jQuery);
28
29
30/*
31* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
32*/
33jQuery.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(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic: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(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;if(!g)g=e*.3*1.5;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;return d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;return d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;if((b/=e/2)<1)return d/2*b*b*(((f*=1.525)+1)*b-f)+c;return d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){if((b/=e)<1/2.75){return d*7.5625*b*b+c}else if(b<2/2.75){return d*(7.5625*(b-=1.5/2.75)*b+.75)+c}else if(b<2.5/2.75){return d*(7.5625*(b-=2.25/2.75)*b+.9375)+c}else{return d*(7.5625*(b-=2.625/2.75)*b+.984375)+c}},easeInOutBounce:function(a,b,c,d,e){if(b<e/2)return jQuery.easing.easeInBounce(a,b*2,0,d,e)*.5+c;return jQuery.easing.easeOutBounce(a,b*2-e,0,d,e)*.5+d*.5+c}})
34
35
36/*anime*/
37/*
38 2017 Julian Garnier
39 Released under the MIT license
40*/
41var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,r,p){if(p.get||p.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[r]=p.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
42$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++};
43$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var r=0;return $jscomp.iteratorPrototype(function(){return r<e.length?{done:!1,value:e[r++]}:{done:!0}})};
44$jscomp.iteratorPrototype=function(e){$jscomp.initSymbolIterator();e={next:e};e[$jscomp.global.Symbol.iterator]=function(){return this};return e};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(e,r){$jscomp.initSymbolIterator();e instanceof String&&(e+="");var p=0,m={next:function(){if(p<e.length){var u=p++;return{value:r(u,e[u]),done:!1}}m.next=function(){return{done:!0,value:void 0}};return m.next()}};m[Symbol.iterator]=function(){return m};return m};
45$jscomp.polyfill=function(e,r,p,m){if(r){p=$jscomp.global;e=e.split(".");for(m=0;m<e.length-1;m++){var u=e[m];u in p||(p[u]={});p=p[u]}e=e[e.length-1];m=p[e];r=r(m);r!=m&&null!=r&&$jscomp.defineProperty(p,e,{configurable:!0,writable:!0,value:r})}};$jscomp.polyfill("Array.prototype.keys",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e){return e})}},"es6-impl","es3");var $jscomp$this=this;
46(function(e,r){"function"===typeof define&&define.amd?define([],r):"object"===typeof module&&module.exports?module.exports=r():e.anime=r()})(this,function(){function e(a){if(!h.col(a))try{return document.querySelectorAll(a)}catch(c){}}function r(a,c){for(var d=a.length,b=2<=arguments.length?arguments[1]:void 0,f=[],n=0;n<d;n++)if(n in a){var k=a[n];c.call(b,k,n,a)&&f.push(k)}return f}function p(a){return a.reduce(function(a,d){return a.concat(h.arr(d)?p(d):d)},[])}function m(a){if(h.arr(a))return a;
47h.str(a)&&(a=e(a)||a);return a instanceof NodeList||a instanceof HTMLCollection?[].slice.call(a):[a]}function u(a,c){return a.some(function(a){return a===c})}function C(a){var c={},d;for(d in a)c[d]=a[d];return c}function D(a,c){var d=C(a),b;for(b in a)d[b]=c.hasOwnProperty(b)?c[b]:a[b];return d}function z(a,c){var d=C(a),b;for(b in c)d[b]=h.und(a[b])?c[b]:a[b];return d}function T(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,c,d,k){return c+c+d+d+k+k});var c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);
48a=parseInt(c[1],16);var d=parseInt(c[2],16),c=parseInt(c[3],16);return"rgba("+a+","+d+","+c+",1)"}function U(a){function c(a,c,b){0>b&&(b+=1);1<b&&--b;return b<1/6?a+6*(c-a)*b:.5>b?c:b<2/3?a+(c-a)*(2/3-b)*6:a}var d=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);a=parseInt(d[1])/360;var b=parseInt(d[2])/100,f=parseInt(d[3])/100,d=d[4]||1;if(0==b)f=b=a=f;else{var n=.5>f?f*(1+b):f+b-f*b,k=2*f-n,f=c(k,n,a+1/3),b=c(k,n,a);a=c(k,n,a-1/3)}return"rgba("+
49255*f+","+255*b+","+255*a+","+d+")"}function y(a){if(a=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a))return a[2]}function V(a){if(-1<a.indexOf("translate")||"perspective"===a)return"px";if(-1<a.indexOf("rotate")||-1<a.indexOf("skew"))return"deg"}function I(a,c){return h.fnc(a)?a(c.target,c.id,c.total):a}function E(a,c){if(c in a.style)return getComputedStyle(a).getPropertyValue(c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())||"0"}function J(a,c){if(h.dom(a)&&
50u(W,c))return"transform";if(h.dom(a)&&(a.getAttribute(c)||h.svg(a)&&a[c]))return"attribute";if(h.dom(a)&&"transform"!==c&&E(a,c))return"css";if(null!=a[c])return"object"}function X(a,c){var d=V(c),d=-1<c.indexOf("scale")?1:0+d;a=a.style.transform;if(!a)return d;for(var b=[],f=[],n=[],k=/(\w+)\((.+?)\)/g;b=k.exec(a);)f.push(b[1]),n.push(b[2]);a=r(n,function(a,b){return f[b]===c});return a.length?a[0]:d}function K(a,c){switch(J(a,c)){case "transform":return X(a,c);case "css":return E(a,c);case "attribute":return a.getAttribute(c)}return a[c]||
510}function L(a,c){var d=/^(\*=|\+=|-=)/.exec(a);if(!d)return a;var b=y(a)||0;c=parseFloat(c);a=parseFloat(a.replace(d[0],""));switch(d[0][0]){case "+":return c+a+b;case "-":return c-a+b;case "*":return c*a+b}}function F(a,c){return Math.sqrt(Math.pow(c.x-a.x,2)+Math.pow(c.y-a.y,2))}function M(a){a=a.points;for(var c=0,d,b=0;b<a.numberOfItems;b++){var f=a.getItem(b);0<b&&(c+=F(d,f));d=f}return c}function N(a){if(a.getTotalLength)return a.getTotalLength();switch(a.tagName.toLowerCase()){case "circle":return 2*
52Math.PI*a.getAttribute("r");case "rect":return 2*a.getAttribute("width")+2*a.getAttribute("height");case "line":return F({x:a.getAttribute("x1"),y:a.getAttribute("y1")},{x:a.getAttribute("x2"),y:a.getAttribute("y2")});case "polyline":return M(a);case "polygon":var c=a.points;return M(a)+F(c.getItem(c.numberOfItems-1),c.getItem(0))}}function Y(a,c){function d(b){b=void 0===b?0:b;return a.el.getPointAtLength(1<=c+b?c+b:0)}var b=d(),f=d(-1),n=d(1);switch(a.property){case "x":return b.x;case "y":return b.y;
53case "angle":return 180*Math.atan2(n.y-f.y,n.x-f.x)/Math.PI}}function O(a,c){var d=/-?\d*\.?\d+/g,b;b=h.pth(a)?a.totalLength:a;if(h.col(b))if(h.rgb(b)){var f=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(b);b=f?"rgba("+f[1]+",1)":b}else b=h.hex(b)?T(b):h.hsl(b)?U(b):void 0;else f=(f=y(b))?b.substr(0,b.length-f.length):b,b=c&&!/\s/g.test(b)?f+c:f;b+="";return{original:b,numbers:b.match(d)?b.match(d).map(Number):[0],strings:h.str(a)||c?b.split(d):[]}}function P(a){a=a?p(h.arr(a)?a.map(m):m(a)):[];return r(a,
54function(a,d,b){return b.indexOf(a)===d})}function Z(a){var c=P(a);return c.map(function(a,b){return{target:a,id:b,total:c.length}})}function aa(a,c){var d=C(c);if(h.arr(a)){var b=a.length;2!==b||h.obj(a[0])?h.fnc(c.duration)||(d.duration=c.duration/b):a={value:a}}return m(a).map(function(a,b){b=b?0:c.delay;a=h.obj(a)&&!h.pth(a)?a:{value:a};h.und(a.delay)&&(a.delay=b);return a}).map(function(a){return z(a,d)})}function ba(a,c){var d={},b;for(b in a){var f=I(a[b],c);h.arr(f)&&(f=f.map(function(a){return I(a,
55c)}),1===f.length&&(f=f[0]));d[b]=f}d.duration=parseFloat(d.duration);d.delay=parseFloat(d.delay);return d}function ca(a){return h.arr(a)?A.apply(this,a):Q[a]}function da(a,c){var d;return a.tweens.map(function(b){b=ba(b,c);var f=b.value,e=K(c.target,a.name),k=d?d.to.original:e,k=h.arr(f)?f[0]:k,w=L(h.arr(f)?f[1]:f,k),e=y(w)||y(k)||y(e);b.from=O(k,e);b.to=O(w,e);b.start=d?d.end:a.offset;b.end=b.start+b.delay+b.duration;b.easing=ca(b.easing);b.elasticity=(1E3-Math.min(Math.max(b.elasticity,1),999))/
561E3;b.isPath=h.pth(f);b.isColor=h.col(b.from.original);b.isColor&&(b.round=1);return d=b})}function ea(a,c){return r(p(a.map(function(a){return c.map(function(b){var c=J(a.target,b.name);if(c){var d=da(b,a);b={type:c,property:b.name,animatable:a,tweens:d,duration:d[d.length-1].end,delay:d[0].delay}}else b=void 0;return b})})),function(a){return!h.und(a)})}function R(a,c,d,b){var f="delay"===a;return c.length?(f?Math.min:Math.max).apply(Math,c.map(function(b){return b[a]}
56)):f?b.delay:d.offset+b.delay+
57b.duration}function fa(a){var c=D(ga,a),d=D(S,a),b=Z(a.targets),f=[],e=z(c,d),k;for(k in a)e.hasOwnProperty(k)||"targets"===k||f.push({name:k,offset:e.offset,tweens:aa(a[k],d)});a=ea(b,f);return z(c,{children:[],animatables:b,animations:a,duration:R("duration",a,c,d),delay:R("delay",a,c,d)})}function q(a){function c(){return window.Promise&&new Promise(function(a){return p=a})}function d(a){return g.reversed?g.duration-a:a}function b(a){for(var b=0,c={},d=g.animations,f=d.length;b<f;){var e=d[b],
58k=e.animatable,h=e.tweens,n=h.length-1,l=h[n];n&&(l=r(h,function(b){return a<b.end})[0]||l);for(var h=Math.min(Math.max(a-l.start-l.delay,0),l.duration)/l.duration,w=isNaN(h)?1:l.easing(h,l.elasticity),h=l.to.strings,p=l.round,n=[],m=void 0,m=l.to.numbers.length,t=0;t<m;t++){var x=void 0,x=l.to.numbers[t],q=l.from.numbers[t],x=l.isPath?Y(l.value,w*x):q+w*(x-q);p&&(l.isColor&&2<t||(x=Math.round(x*p)/p));n.push(x)}if(l=h.length)for(m=h[0],w=0;w<l;w++)p=h[w+1],t=n[w],isNaN(t)||(m=p?m+(t+p):m+(t+" "));
59else m=n[0];ha[e.type](k.target,e.property,m,c,k.id);e.currentValue=m;b++}if(b=Object.keys(c).length)for(d=0;d<b;d++)H||(H=E(document.body,"transform")?"transform":"-webkit-transform"),g.animatables[d].target.style[H]=c[d].join(" ");g.currentTime=a;g.progress=a/g.duration*100}function f(a){if(g[a])g[a](g)}function e(){g.remaining&&!0!==g.remaining&&g.remaining--}function k(a){var k=g.duration,n=g.offset,w=n+g.delay,r=g.currentTime,x=g.reversed,q=d(a);if(g.children.length){var u=g.children,v=u.length;
60if(q>=g.currentTime)for(var G=0;G<v;G++)u[G].seek(q);else for(;v--;)u[v].seek(q)}if(q>=w||!k)g.began||(g.began=!0,f("begin")),f("run");if(q>n&&q<k)b(q);else if(q<=n&&0!==r&&(b(0),x&&e()),q>=k&&r!==k||!k)b(k),x||e();f("update");a>=k&&(g.remaining?(t=h,"alternate"===g.direction&&(g.reversed=!g.reversed)):(g.pause(),g.completed||(g.completed=!0,f("complete"),"Promise"in window&&(p(),m=c()))),l=0)}a=void 0===a?{}:a;var h,t,l=0,p=null,m=c(),g=fa(a);g.reset=function(){var a=g.direction,c=g.loop;g.currentTime=
610;g.progress=0;g.paused=!0;g.began=!1;g.completed=!1;g.reversed="reverse"===a;g.remaining="alternate"===a&&1===c?2:c;b(0);for(a=g.children.length;a--;)g.children[a].reset()};g.tick=function(a){h=a;t||(t=h);k((l+h-t)*q.speed)};g.seek=function(a){k(d(a))};g.pause=function(){var a=v.indexOf(g);-1<a&&v.splice(a,1);g.paused=!0};g.play=function(){g.paused&&(g.paused=!1,t=0,l=d(g.currentTime),v.push(g),B||ia())};g.reverse=function(){g.reversed=!g.reversed;t=0;l=d(g.currentTime)};g.restart=function(){g.pause();
62g.reset();g.play()};g.finished=m;g.reset();g.autoplay&&g.play();return g}var ga={update:void 0,begin:void 0,run:void 0,complete:void 0,loop:1,direction:"normal",autoplay:!0,offset:0},S={duration:1E3,delay:0,easing:"easeOutElastic",elasticity:500,round:0},W="translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "),H,h={arr:function(a){return Array.isArray(a)},obj:function(a){return-1<Object.prototype.toString.call(a).indexOf("Object")},
63pth:function(a){return h.obj(a)&&a.hasOwnProperty("totalLength")},svg:function(a){return a instanceof SVGElement},dom:function(a){return a.nodeType||h.svg(a)},str:function(a){return"string"===typeof a},fnc:function(a){return"function"===typeof a},und:function(a){return"undefined"===typeof a},hex:function(a){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a)},rgb:function(a){return/^rgb/.test(a)},hsl:function(a){return/^hsl/.test(a)},col:function(a){return h.hex(a)||h.rgb(a)||h.hsl(a)}},A=function(){function a(a,
64d,b){return(((1-3*b+3*d)*a+(3*b-6*d))*a+3*d)*a}return function(c,d,b,f){if(0<=c&&1>=c&&0<=b&&1>=b){var e=new Float32Array(11);if(c!==d||b!==f)for(var k=0;11>k;++k)e[k]=a(.1*k,c,b);return function(k){if(c===d&&b===f)return k;if(0===k)return 0;if(1===k)return 1;for(var h=0,l=1;10!==l&&e[l]<=k;++l)h+=.1;--l;var l=h+(k-e[l])/(e[l+1]-e[l])*.1,n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(.001<=n){for(h=0;4>h;++h){n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(0===n)break;var m=a(l,c,b)-k,l=l-m/n}k=l}else if(0===
65n)k=l;else{var l=h,h=h+.1,g=0;
65do m=l+(h-l)/2,n=a(m,c,b)-k,0<n?h=m:l=m;while(1e-7<Math.abs(n)&&10>++g);k=m}return a(k,d,f)}}}}(),Q=function(){function a(a,b){return 0===a||1===a?a:-Math.pow(2,10*(a-1))*Math.sin(2*(a-1-b/(2*Math.PI)*Math.asin(1))*Math.PI/b)}var c="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),d={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],a],Out:[[.25,
66.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(b,c){return 1-a(1-b,c)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(b,c){return.5>b?a(2*b,c)/2:1-a(-2*b+2,c)/2}]},b={linear:A(.25,.25,.75,.75)},f={},e;for(e in d)f.type=e,d[f.type].forEach(function(a){return function(d,f){b["ease"+a.type+c[f]]=h.fnc(d)?
67d:A.apply($jscomp$this,d)}}(f)),f={type:f.type};return b}(),ha={css:function(a,c,d){return a.style[c]=d},attribute:function(a,c,d){return a.setAttribute(c,d)},object:function(a,c,d){return a[c]=d},transform:function(a,c,d,b,f){b[f]||(b[f]=[]);b[f].push(c+"("+d+")")}},v=[],B=0,ia=function(){function a(){B=requestAnimationFrame(c)}function c(c){var b=v.length;if(b){for(var d=0;d<b;)v[d]&&v[d].tick(c),d++;a()}else cancelAnimationFrame(B),B=0}return a}();q.version="2.2.0";q.speed=1;q.running=v;q.remove=
68function(a){a=P(a);for(var c=v.length;c--;)for(var d=v[c],b=d.animations,f=b.length;f--;)u(a,b[f].animatable.target)&&(b.splice(f,1),b.length||d.pause())};q.getValue=K;q.path=function(a,c){var d=h.str(a)?e(a)[0]:a,b=c||100;return function(a){return{el:d,property:a,totalLength:N(d)*(b/100)}}};q.setDashoffset=function(a){var c=N(a);a.setAttribute("stroke-dasharray",c);return c};q.bezier=A;q.easings=Q;q.timeline=function(a){var c=q(a);c.pause();c.duration=0;c.add=function(d){c.children.forEach(function(a){a.began=
69!0;a.completed=!0});m(d).forEach(function(b){var d=z(b,D(S,a||{}));d.targets=d.targets||a.targets;b=c.duration;var e=d.offset;d.autoplay=!1;d.direction=c.direction;d.offset=h.und(e)?b:L(e,b);c.began=!0;c.completed=!0;c.seek(d.offset);d=q(d);d.began=!0;d.completed=!0;d.duration>b&&(c.duration=d.duration);c.children.push(d)});c.seek(0);c.reset();c.autoplay&&c.restart();return c};return c};q.random=function(a,c){return Math.floor(Math.random()*(c-a+1))+a};return q});
70
71
72/*! Mousewheel by Brandon Aaron (http://brandon.aaron.sh) */
73!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(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)}})});
74
75(function($, window, document) {
76
77
78
79jQuery(document).ready(function($){
80	
81	
82	
83  // ========================= smartresize ===============================
84
85  /*
86   * smartresize: debounced resize event for jQuery
87   *
88   * latest version and complete README available on Github:
89   * https://github.com/louisremi/jquery.smartresize.js
90   *
91   * Copyright 2011 @louis_remi
92   * Licensed under the MIT license.
93   */
94
95  var $event = $.event,
96      dispatchMethod = $.event.handle ? 'handle' : 'dispatch',
97      resizeTimeout;
98
99  $event.special.smartresize = {
100    setup: function() {
101      $(this).on( "resize", $event.special.smartresize.handler );
102    },
103    teardown: function() {
104      $(this).off( "resize", $event.special.smartresize.handler );
105    },
106    handler: function( event, execAsap ) {
107      // Save the context
108      var context = this,
109          args = arguments;
110
111      // set correct event type
112      event.type = "smartresize";
113
114      if ( resizeTimeout ) { clearTimeout( resizeTimeout ); }
115      resizeTimeout = setTimeout(function() {
116        $event[ dispatchMethod ].apply( context, args );
117      }, execAsap === "execAsap"? 0 : 100 );
118    }
119  };
120
121  $.fn.smartresize = function( fn ) {
122    return fn ? this.on( "smartresize", fn ) : this.trigger( "smartresize", ["execAsap"] );
123  };
124
125
126
127	
128/****************** Nectar ******************/	
129
130// Create cross browser requestAnimationFrame method:
131window.requestAnimationFrame = window.requestAnimationFrame
132|| window.mozRequestAnimationFrame
133|| window.webkitRequestAnimationFrame
134|| window.msRequestAnimationFrame
135|| function(f){setTimeout(f, 1000/60)}
136	 
137var nectarDOMInfo = {
138	
139	usingMobileBrowser: (navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) ? true : false,
140	
141	usingFrontEndEditor: (typeof window.vc_iframe === 'undefined') ? false : true,
142	
143	getWindowSize: function() {
144		nectarDOMInfo.windowHeight = window.innerHeight;
145		nectarDOMInfo.windowWidth = window.innerWidth;
146		
147		nectarDOMInfo.adminBarHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0;
148		nectarDOMInfo.secondaryHeaderHeight = ($('#header-secondary-outer').length > 0) ? $('#header-secondary-outer').height() : 0;
149	},
150
151	scrollPosMouse: function() {
152		return $(window).scrollTop();
153	},
154	
155	scrollPosRAF: function() {
156		nectarDOMInfo.scrollTop = $(window).scrollTop();
157		requestAnimationFrame(nectarDOMInfo.scrollPosRAF);
158	},
159	
160
161	bindEvents: function() {
162		
163		if(!nectarDOMInfo.usingMobileBrowser) {
164			$(window).on('scroll',function(){ nectarDOMInfo.scrollTop = nectarDOMInfo.scrollPosMouse(); });
165		}
166		
167		$(window).on('resize',nectarDOMInfo.getWindowSize);
168		
169	}
170
171}
172
173nectarDOMInfo.getWindowSize();
174nectarDOMInfo.scrollTop = nectarDOMInfo.scrollPosMouse();
175
176if(nectarDOMInfo.usingMobileBrowser) { requestAnimationFrame(nectarDOMInfo.scrollPosRAF); } 
177
178nectarDOMInfo.bindEvents();
179
180
181//set row sizes
182fullWidthSections();
183fwsClasses();
184
185
186
187
188
189
190
191
192/***************** VC FRONTEND  ******************/
193
194function addRowCtrls() {
195
196
197		//remove padding for rows with only fullwidth ns
198		$('.wpb_row').removeClass('only-ns');
199		$('.nectar-slider-wrap[data-full-width="true"], .page-submenu, .portfolio-items[data-col-num="elastic"]:not(.fullwidth-constrained), .blog-fullwidth-wrap').parents('.wpb_row').addClass('only-ns');
200		
201		//padding when column contains item that could get lost under column controls 
202		$('body.vc_editor.compose-mode .wpb_row .vc_vc_column > .wpb_column > .vc_column-inner').each(function(){
203			
204			if($(this).find('> .vc_element-container > div').length > 0) {
205				
206				if( $(this).find('> .vc_element-container > div:first-child').is('.vc_vc_row_inner') ) {
207					$(this).find('> .vc_element-container > div:first-child').addClass('first-inner-row-el');
208				} else {
209					$(this).find('> .vc_element-container > div:first-child').removeClass('first-inner-row-el');
210				}
211				
212			}
213			
214		}); 
215		
216	} //addRowCtrl end
217	
218	
219	function convertFrontEndPadding() {
220		 $('.vc_element > .wpb_column[class*="padding-"][class*="-percent"]').each(function(){
221			 
222				var $elPaddingPercent = 4;
223
224				var elclassName = this.className.match(/padding-\d+/); 
225				if (elclassName) {
226						$elPaddingPercent = elclassName[0].match(/\d+/); 
227						if($elPaddingPercent) {
228							$elPaddingPercent = $elPaddingPercent[0]/100;
229						} else {
230							$elPaddingPercent = 0;
231						}
232				}
233				
234				if($elPaddingPercent) {
235					 var $parentRowWidth = $(this).parents('.span_12').width();
236					 
237					 if($(this).is('[data-padding-pos="all"]')){
238							$(this).css('padding', $parentRowWidth * $elPaddingPercent );
239					 } else if($(this).is('[data-padding-pos="top"]')) {
240						 $(this).css('padding-top', $parentRowWidth * $elPaddingPercent );
241					 } else if($(this).is('[data-padding-pos="bottom"]')) {
242						 $(this).css('padding-bottom', $parentRowWidth * $elPaddingPercent );
243					 } else if($(this).is('[data-padding-pos="left"]')) {
244						 $(this).css('padding-left', $parentRowWidth * $elPaddingPercent );
245					 } else if($(this).is('[data-padding-pos="right"]')) {
246						 $(this).css('padding-right', $parentRowWidth * $elPaddingPercent );
247					 } else if($(this).is('[data-padding-pos="top-bottom"]')) {
248						 $(this).css({
249							 'padding-top': $parentRowWidth * $elPaddingPercent,
250							 'padding-bottom': $parentRowWidth * $elPaddingPercent,
251						 });
252					 } else if($(this).is('[data-padding-pos="top-right"]')) {
253						 $(this).css({
254							 'padding-top': $parentRowWidth * $elPaddingPercent,
255							 'padding-right': $parentRowWidth * $elPaddingPercent,
256						 });
257					 } else if($(this).is('[data-padding-pos="bottom-right"]')) {
258						 $(this).css({
259							 'padding-right': $parentRowWidth * $elPaddingPercent,
260							 'padding-bottom': $parentRowWidth * $elPaddingPercent,
261						 });
262					 } else if($(this).is('[data-padding-pos="bottom-left"]')) {
263						 $(this).css({
264							 'padding-left': $parentRowWidth * $elPaddingPercent,
265							 'padding-bottom': $parentRowWidth * $elPaddingPercent,
266						 });
267					 } else if($(this).is('[data-padding-pos="left-right"]')) {
268						 $(this).css({
269							 'padding-left': $parentRowWidth * $elPaddingPercent,
270							 'padding-right': $parentRowWidth * $elPaddingPercent,
271						 });
272					 }
273			 }
274
275		 }); //each
276		 
277		 //remove margins on element wrappers that are setting custom margin
278		 $('.wpb_row[class*="vc_custom_"]').each(function(){
279			 
280				$(this).parent().addClass('no-bottom-margin');
281		
282		 });
283		 
284	} //convertFrontEndPadding end
285 
286 
287 setTimeout(function(){
288	 
289	if($('body.compose-mode').length > 0) {
290		$('.container-wrap').addClass('visible-editor-controls');
291  }
292	
293	if(nectarDOMInfo.usingFrontEndEditor) {
294		addRowCtrls();
295		convertFrontEndPadding();
296		
297		$(window).smartresize(convertFrontEndPadding);
298	}
299
300},200);
301 
302 
303
304 
305 var $fp_section_length = 0, $fp_section_prev_length = 0;
306 
307 
308 $(window).on( 'vc_reload', function() {
309	 
310	 addRowCtrls();
311	 
312	 columnBGColors();
313	 coloredButtons();
314	 twentytwentyInit();
315	 parallaxRowsBGCals();
316	 
317	 if($('.carousel').length > 0) {
318		standardCarouselInit();
319		clientsCarouselInit();
320		carouselHeightCalcs();
321	}
322	
323	
324	if($('.owl-carousel').length > 0) { 
325		$('.owl-carousel').each(function(){
326			$(this).trigger('destroy.owl.carousel').removeClass('owl-loaded');
327			$(this).find('.owl-stage-outer .owl-stage > *').unwrap();
328			$(this).find('.owl-stage-outer > *').unwrap();
329			$(this).find('.owl-item > *').unwrap();
330			$(this).find('.owl-dots').remove();
331			$(this).find('.owl-nav').remove();
332		});
333		owlCarouselInit();
334	}
335	
336	flexsliderInit();
337	accordionInit();
338	ulChecks();
339	oneFourthClasses();
340	carouselfGrabbingClass();
341	if($('.nectar_cascading_images').length > 0) {
342		imagesLoaded($('.nectar_cascading_images'),function(instance){
343			cascadingImageBGSizing();
344		});
345	}
346	fullWidthSections();
347	fwsClasses();
348	fullwidthImgOnlySizingInit();
349	fullwidthImgOnlySizing();
350	fullWidthRowPaddingAdjustInit();
351	recentPostsFlickityInit();
352	if(nectarDOMInfo.usingMobileBrowser) {
353		fullWidthRowPaddingAdjustCalc();
354	}
355	if($('.nectar-box-roll').length == 0) { boxRollInit(); }
356	
357  /*flickity carousels*/
358	if($flickitySliders.length > 0) {
359		for(var i=0; i<$flickitySliders.length; i++) {
360			
361			$flickitySliders[i].reloadCells();
362			$flickitySliders[i].off( 'scroll.flickity'); 
363			$flickitySliders[i].off( 'dragStart.flickity'); 
364			$flickitySliders[i].off( 'dragEnd.flickity'); 
365
366		 }
367	}
368
369	setTimeout(function(){ 
370		
371		flickityInit();
372		if($flickitySliders.length > 0) { 
373			for(var i=0; i<$flickitySliders.length; i++) {
374				$flickitySliders[i].reloadCells();
375				$flickitySliders[i].resize();
376			 }
377		}
378	
379	},100);
380	
381	/*flickity product carousels*/
382	if($wooFlickityCarousels.length > 0) {
383		for(var i=0; i<$wooFlickityCarousels.length; i++) {
384			
385			$wooFlickityCarousels[i].flickity('reloadCells');
386			$wooFlickityCarousels[i].off( 'scroll.flickity'); 
387			$wooFlickityCarousels[i].off( 'dragStart.flickity'); 
388			$wooFlickityCarousels[i].off( 'dragEnd.flickity'); 
389
390		 }
391	}
392
393	setTimeout(function(){ 
394		
395		if( $('.nectar-woo-flickity').length > 0) { productCarouselInit(); }
396		if($wooFlickityCarousels.length > 0) { 
397			for(var i=0; i<$wooFlickityCarousels.length; i++) {
398				$wooFlickityCarousels[i].flickity('reloadCells');
399				$wooFlickityCarousels[i].flickity('resize');
400			 }
401		}
402	
403	},100);
404	
405	
406	socialSharingInit();
407	hotSpotHoverBind();
408	pricingTableHeight();
409	nectarIconMatchColoring();
410	
411	if($testimonialSlider.length > 0) {
412		for(var i=0; i<$testimonialSlider.length; i++) {
413			var testimonialflkty = $testimonialSlider[i].data('flickity');
414			$testimonialSlider[i].flickity('reloadCells');
415			$testimonialSlider[i].off( 'select.flickity');
416		}
417	} 
418
419	createTestimonialControls();
420	
421	lightBoxInit();
422	
423	imageWithHotspotClickEvents();
424	testimonialSliderHeight(); 
425	largeIconHover();
426	if($('.nectar-box-roll').length == 0) boxRollMouseWheelInit();
427	midnightInit();
428	responsiveVideoIframesInit();
429	responsiveVideoIframes();
430	fullWidthContentColumns();
431	setTimeout(fullWidthContentColumns,1000);
432	videoBGInit();
433	$(window).off('scroll.parallaxSections').off('resize.parallaxSections');
434	parallaxScrollInit();
435	
436	//update blog arr
437	$('.posts-container').each(function(i){
438		$blog_containers[i] = $(this);
439	});
440	masonryBlogInit();
441	masonryPortfolioInit();
442	portfolioAccentColor();
443	portfolioHoverEffects();
444	portfolioFiltersInit();
445	style6Img();
446	
447	fsProjectSliderInit();
448	
449	setTimeout(function(){
450		if($('.nectar_fullscreen_zoom_recent_projects').length > 0){
451			portfolioFullScreenSliderCalcs();
452			splitLineText();
453			$(window).resize(splitLineText);
454			$(window).resize(portfolioFullScreenSliderCalcs);
455		}
456	},300);
457	
458	isotopeCatSelection();
459	$(window).unbind('.infscr');
460	infiniteScrollInit();
461	postNextButtonEffect();
462	mouseParallaxInit();
463	
464	//play video BGs
465	$('.nectar-video-wrap').each(function(i){
466		if($(this).find('video').length > 0) {
467			  $(this).find('video').css('visibility','visible');
468		}
469	});
470	
471	//tablet inherits small desktop
472	$('.wpb_column[data-t-w-inherits]').each(function(){
473		if( $(this).is('[data-t-w-inherits="small_desktop"]') ) {
474			$(this).parent().addClass('inherits-s-desktop-col');
475		} else {
476			$(this).parent().removeClass('inherits-s-desktop-col');
477		}
478	});
479	
480	//full screen page rows
481	if($('#nectar_fullscreen_rows').length > 0) {
482		
483		$fp_section_length = $('#nectar_fullscreen_rows > .vc_element').length;
484		
485		
486		if( $('#nectar_fullscreen_rows > .vc_element').length == 0 ) {
487			$('#nectar_fullscreen_rows').prepend('<div class="vc_element empty_placeholder" />');
488		} 
489		
490		
491		if( $('#nectar_fullscreen_rows > .vc_element:not(.empty_placeholder)').length > 0 ) {
492			$('#nectar_fullscreen_rows >.vc_element.empty_placeholder').remove();
493		}
494		
495		setFPNames();
496
497		
498		//first load	
499		if($('#fp-nav').length == 0) {
500			initNectarFP();
501			
502			var currentFPSectionIndex = ($('#nectar_fullscreen_rows > .vc_element.active').length > 0) ? $('#nectar_fullscreen_rows > .vc_element.active').index() + 1 : 1;
503			setFPNavColoring(currentFPSectionIndex,'na');
504		} 
505		//after
506		////reinit if sections have been added/removed
507		else if($fp_section_length != $fp_section_prev_length) {
508
509			$.fn.fullpage.destroy('all');
510			initNectarFP();
511
512			var currentFPSectionIndex = ($('#nectar_fullscreen_rows > .vc_element.active').length > 0) ? $('#nectar_fullscreen_rows > .vc_element.active').index() + 1 : 1;
513			setFPNavColoring(currentFPSectionIndex,'na');
514
515		}
516		
517
518		//keep tooltip active status
519		var $nectarFPindex = 0;
520		var nectarFPOffsets = [{el: '', offset: 0}]; 
521		
522		////create list of offsets
523		$('#nectar_fullscreen_rows > div.vc_element').each(function(i){
524			nectarFPOffsets[i] = {
525				el: $(this),
526				offset: $(this).offset().top
527			}
528		});
529		
530		////loop to find lowest
531		for(var x in nectarFPOffsets) {
532			
533			if(nectarFPOffsets[x].offset < $(window).height()){
534				$nectarFPindex = x;
535			} 
536			
537		} 
538		////start active on that index
539		//$('#fp-nav ul > li:nth-child(' + (parseInt($nectarFPindex)+1) + ')').find('> a').trigger('click');
540		
541		//move back to first section when all have been deleted but one
542		if($('#nectar_fullscreen_rows > div.vc_element').length === 1) {
543			$('#nectar_fullscreen_rows').css({'transform' : 'translate3d(0,0,0)'});
544		}
545		
546		$('body').scrollTo(0,0);
547			
548		//update prev section length
549		$fp_section_prev_length = $fp_section_length;
550		
551	} else {
552		
553		//remove container wrap padding/margin when needded
554		if($('body .main-content > .row > .vc_element:first > .wpb_row[class*="full-width-"]').length > 0 || $('body .main-content > .row > .vc_element:first .nectar-slider-wrap[data-full-width="true"]').length > 0 ) {
555				$('.container-wrap').css({ 'padding-top': '0', 'margin-top' : '0'});
556		} else {
557			$('.container-wrap').css({ 'padding-top': '40px'});
558		}
559		
560	}
561	
562	
563	//reset svg icon arr
564	$svg_icons = [];
565	$('.svg-icon-holder').removeClass('animated-in').removeClass('bound');
566
567	
568	//gmap
569	if($('.vc_nectar_gmap').length > 0) {
570		
571		setTimeout(function(){
572			
573			if(typeof google === 'object' && typeof google.maps === 'object') {
574				mapAPI_Loaded();
575			} else {
576
577				if(nectarLove.mapApiKey.length > 0) {
578					$.getScript('https://maps.google.com/maps/api/js?sensor=false&key='+nectarLove.mapApiKey+'&callback=mapAPI_Loaded');
579				}
580			}
581			
582		},100);
583}
584	
585	if( $().theiaStickySidebar ) {
586		blogStickySS();
587	}
588	
589	
590	 if(typeof window.Waypoint != 'undefined') {
591		 Waypoint.destroyAll();
592		 waypoints();
593	 }
594	 
595 });
596
597
598
599
600
601/***************** Lightbox Init ******************/
602	
603	function fancyBoxInit() {
604		//convert old pp links
605		$('a.pp').removeClass('pp').attr('data-fancybox','');
606		$("a[rel^='prettyPhoto']:not([rel*='_gal']):not([rel*='product-gallery']):not([rel*='prettyPhoto['])").removeAttr('rel').attr('data-fancybox','');
607		
608		//image gallery nectar
609		$('.wpb_gallery .wpb_gallery_slidesnectarslider_style').each(function(){
610			var $unique_id = Math.floor(Math.random()*10000);
611			$(this).find('.swiper-slide a:not(.ext-url-link)').attr('data-fancybox','group_'+$unique_id);
612		});
613		
614		//flex
615		$('.wpb_gallery_slides.wpb_flexslider').each(function(){
616			var $unique_id = Math.floor(Math.random()*10000);
617			$(this).find('.slides > li > a').attr('data-fancybox','group_'+$unique_id);
618		});
619		
620		//touch enabled gal
621		$('.wpb_gallery_slidesflickity_style').each(function(){
622			var $unique_id = Math.floor(Math.random()*10000);
623			$(this).find('.cell > a:not(.ext-url-link)').attr('data-fancybox','group_'+$unique_id);
624		});
625		
626		//add galleries to portfolios
627		$('.portfolio-items, .wpb_gallery .parallax-grid-item').each(function(){
628			var $unique_id = Math.floor(Math.random()*10000);
629			if($(this).find('.pretty_photo').length > 0) {
630				$(this).find('.pretty_photo').removeClass('pretty_photo').attr('data-fancybox','group_'+$unique_id);
631			} else if($(this).find('a[rel*="prettyPhoto["]').length > 0){
632				$(this).find('a[rel*="prettyPhoto["]').removeAttr('rel').attr('data-fancybox','group_'+$unique_id);
633			}
634
635		});
636		
637		//nectar auto lightbox
638		if($('body').hasClass('nectar-auto-lightbox')){
639			$('.gallery').each(function(){
640				if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length == 0) {
641					var $unique_id = Math.floor(Math.random()*10000);
642					$(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('data-fancybox','group_'+$unique_id).removeClass('pretty_photo');
643				}
644			});
645			$('.main-content img').each(function(){
646				if($(this).parent().is("[href]") && !$(this).parent().is(".magnific-popup") && $(this).parents('.tiled-gallery').length == 0 && $(this).parents('.product-image').length == 0 && $(this).parents('.iosSlider.product-slider').length == 0) {
647					var match = $(this).parent().attr('href').match(/\.(jpg|png|gif)\b/);
648					if(match) $(this).parent().attr('data-fancybox','');
649				} 
650			});
651		}
652		
653		//regular
654		fbMarginArr = ($('body.admin-bar').length > 0) ? [60,100] : [60,100];
655		if(window.innerWidth < 1000) {
656			fbMarginArr = [0,0];
657		}
658		$("[data-fancybox]").fancybox({
659			animationEffect : "zoom-in-out",
660			animationDuration : 350,
661			buttons : [
662        //'slideShow',
663        'fullScreen',
664        //'thumbs',
665        //'share',
666        //'download',
667        'zoom',
668        'close'
669    	],
670			margin : fbMarginArr,
671			loop     : true,
672			caption : function( instance, item ) {
673				return $(this).attr('title');
674			},
675			beforeLoad: function(instance,current) {
676				//when there's nothing to load
677				if(typeof instance.current.src !== 'string') {  $.fancybox.close(true);  }
678			},
679			mobile : {
680				margin   : 0
681			}
682		});
683	}
684	
685	
686	function magnificInit() {
687		
688		//convert old pp links
689		$('a.pp').removeClass('pp').addClass('magnific-popup');
690		$("a[rel^='prettyPhoto']:not([rel*='_gal']):not([rel*='product-gallery']):not([rel*='prettyPhoto['])").removeAttr('rel').addClass('magnific-popup');
691
692
693		//image gallery nectar
694		$('.wpb_gallery .wpb_gallery_slidesnectarslider_style').each(function(){
695			var $unique_id = Math.floor(Math.random()*10000);
696			$(this).find('.swiper-slide a:not(.ext-url-link)').addClass('pretty_photo');
697		});
698
699		//flex
700		$('.wpb_gallery_slides.wpb_flexslider').each(function(){
701			var $unique_id = Math.floor(Math.random()*10000);
702			$(this).find('.slides > li > a').addClass('pretty_photo');
703		});
704		//touch enabled gal
705		$('.wpb_gallery_slidesflickity_style').each(function(){
706			var $unique_id = Math.floor(Math.random()*10000);
707			$(this).find('.cell > a:not(.ext-url-link)').addClass('pretty_photo');
708		});
709
710		//add galleries to portfolios
711		$('.portfolio-items, .wpb_gallery .swiper-slide, .wpb_gallery_slidesflickity_style .cell, .wpb_gallery_slides.wpb_flexslider ul > li,  .wpb_gallery .parallax-grid-item').each(function(){
712			if($(this).find('.pretty_photo').length > 0) {
713				$(this).find('.pretty_photo').removeClass('pretty_photo').addClass('gallery').addClass('magnific');
714			} else if($(this).find('a[rel*="prettyPhoto["]').length > 0){
715				$(this).find('a[rel*="prettyPhoto["]').removeAttr('rel').addClass('gallery').addClass('magnific');
716			}
717
718		});
719		
720		$("a[data-rel='prettyPhoto[product-gallery]']").each(function(){
721			$(this).removeAttr('data-rel').addClass('magnific').addClass('gallery');
722		});
723		
724		//nectar auto lightbox
725		if($('body').hasClass('nectar-auto-lightbox')){
726			$('.gallery').each(function(){
727				if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length == 0) {
728					var $unique_id = Math.floor(Math.random()*10000);
729					$(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');
730				}
731			});
732			$('.main-content img').each(function(){
733				if($(this).parent().is("[href]") && !$(this).parent().is(".magnific-popup") && $(this).parents('.tiled-gallery').length == 0 && $(this).parents('.product-image').length == 0 && $(this).parents('.iosSlider.product-slider').length == 0) {
734					var match = $(this).parent().attr('href').match(/\.(jpg|png|gif)\b/);
735					if(match) $(this).parent().addClass('magnific-popup').addClass('image-link');
736				} 
737			});
738		}
739		
740
741		//regular
742		$('a.magnific-popup:not(.gallery):not(.nectar_video_lightbox)').magnificPopup({ 
743			type: 'image', 
744			callbacks: {
745				
746				imageLoadComplete: function()  {	
747					var $that = this;
748					setTimeout( function() { $that.wrap.addClass('mfp-image-loaded'); }, 10);
749				},
750				beforeOpen: function() {
751				    this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
752			    },
753			    open: function() {
754					    	
755					$.magnificPopup.instance.next = function() {
756						var $that = this;
757
758						this.wrap.removeClass('mfp-image-loaded');
759						setTimeout( function() { $.magnificPopup.proto.next.call($that); }, 100);
760					}
761
762					$.magnificPopup.instance.prev = function() {
763						var $that = this;
764
765						this.wrap.removeClass('mfp-image-loaded');
766						setTimeout( function() { $.magnificPopup.proto.prev.call($that); }, 100);
767					}
768					
769				}
770			},
771			fixedContentPos: false,
772		    mainClass: 'mfp-zoom-in', 
773		    removalDelay: 400 
774		});
775
776		//video
777		$('a.magnific-popup.nectar_video_lightbox, .magnific_nectar_video_lightbox a.link_text, .swiper-slide a[href*=youtube], .swiper-slide a[href*=vimeo], .nectar-video-box a.full-link.magnific-popup').magnificPopup({ 
778			type: 'iframe', 
779			fixedContentPos: false,
780		    mainClass: 'mfp-zoom-in', 
781		    removalDelay: 400 
782		});
783
784
785		//galleries
786		$('a.magnific.gallery').each(function(){
787
788			var $parentRow = ($(this).closest('.wpb_column').length > 0) ? $(this).closest('.wpb_column') : $(this).parents('.row');
789			if($parentRow.length > 0 && !$parentRow.hasClass('lightbox-col')) {
790
791				$parentRow.magnificPopup({
792					type: 'image',
793					delegate: 'a.magnific',
794					mainClass: 'mfp-zoom-in',
795					fixedContentPos: false,
796					callbacks: {
797
798						elementParse: function(item) {
799			
800							 if($(item.el.context).is('[href]') && $(item.el.context).attr('href').indexOf('iframe=true') != -1 || $(item.el.context).is('[href]') && $(item.el.context).attr('href').indexOf('https://www.youtube.com/watch') != -1 ) {
801						         item.type = 'iframe';
802						      } else if ($(item.el.context).is('[href]') && $(item.el.context).attr('href').indexOf('video-popup-') != -1) {
803						      	item.type = 'inline';
804						      } else {
805						         item.type = 'image';
806						      }
807						},
808
809						imageLoadComplete: function()  {	
810							var $that = this;
811							setTimeout( function() { $that.wrap.addClass('mfp-image-loaded'); }, 10);
812						},
813
814						beforeOpen: function() {
815					       this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
816					    },
817
818					    open: function() {
819					    	
820
821					    	//self hosted video
822					    	if($(this.content).find('.mejs-video video').length > 0 && $().mediaelementplayer ) {
823	            				$(this.content).find('.mejs-video video')[0].player.remove();
824	            				
825	            				var $that = this;
826	            				setTimeout(function(){
827	            					$($that.content).find('video').mediaelementplayer();
828	            					$($that.content).find('.mejs-video video')[0].player.play();
829	            				},50);
830	            				
831	            			}
832
833							$.magnificPopup.instance.next = function() {
834								var $that = this;
835
836								this.wrap.removeClass('mfp-image-loaded');
837								setTimeout( function() { 
838									$.magnificPopup.proto.next.call($that); 
839
840									//self hosted video
841									if($($that.content).find('.mejs-video video').length > 0) {
842			            				$($that.content).find('.mejs-video video')[0].play();
843			            			}
844
845								}, 100);
846							}
847
848							$.magnificPopup.instance.prev = function() {
849								var $that = this;
850
851								this.wrap.removeClass('mfp-image-loaded');
852								setTimeout( function() { 
853									$.magnificPopup.proto.prev.call($that); 
854
855									//self hosted video
856									if($($that.content).find('.mejs-video video').length > 0) {
857			            				$($that.content).find('.mejs-video video')[0].play();
858			            			}
859								}, 100);
860							}
861							
862						},
863
864						close: function() {
865							//self hosted video
866					    	if($(this.content).find('.mejs-video video').length > 0) {
867	            				 $(this.content).find('.mejs-video video')[0].load();
868	            			}
869						}
870					},
871					removalDelay: 400, 
872					gallery: {
873			          enabled:true
874			        }
875				});
876
877				$parentRow.addClass('lightbox-col');
878			}
879			
880		});
881
882	}
883
884	function lightBoxInit() {
885		if($('body[data-ls="magnific"]').length > 0 || $('body[data-ls="pretty_photo"]').length > 0 ) {
886			magnificInit();
887		} else if($('body[data-ls="fancybox"]').length > 0) {
888			fancyBoxInit();
889		}
890	}
891
892	lightBoxInit();
893	//check for late links
894	setTimeout(lightBoxInit,500);
895	
896/*!
897 * jQuery Transit - CSS3 transitions and transformations
898 * (c) 2011-2012 Rico Sta. Cruz <[email protected]>
899 * MIT Licensed.
900 *
901 * http://ricostacruz.com/jquery.transit
902 * http://github.com/rstacruz/jquery.transit
903 */
904(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<u.length;++t){var s=u[t]+r;if(s in d.style){return s}}}function e(){d.style[q.transform]="";d.style[q.transform]="rotateY(90deg)";return d.style[q.transform]!==""}var a=navigator.userAgent.toLowerCase().indexOf("chrome")>-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
904)",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")}
904this.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);
905
906
907
908
909/*nectar liquid*/
910
911function NectarLiquid(bgIMG, type, el_type) {
912	this.canvasContainer = bgIMG[0];
913	this.rowBG = bgIMG;
914	this.animationType = type;
915	this.elType = el_type;
916	
917	this.bgDivWidth = $(this.rowBG).width();
918	this.bgDivHeight = $(this.rowBG).height();
919	this.bgDivRatio = this.bgDivHeight / this.bgDivWidth;
920	
921	
922	this.app = new PIXI.Application({
923		width: this.bgDivWidth, 
924		height: this.bgDivHeight,
925		transparent: true,
926		sharedTicker: true
927	});
928	
929	this.app.stage = new window.PIXI.Container();
930	this.imgContainer = new window.PIXI.Container();
931	
932
933	//grab displacement filter from css
934	$(this.canvasContainer).remove('.nectar-displacement');
935	$(this.canvasContainer).append('<div class="nectar-displacement"></div>');
936	this.displacementIMG_URL = $(this.canvasContainer).find('.nectar-displacement').css('background-image');			
937	this.displacementIMG_URL = this.displacementIMG_URL.replace(/(url\(|\)|")/g, '');
938				
939	//get row BG img
940	this.bgIMG_SRC = bgIMG.css('background-image');
941	this.bgIMG_SRC = this.bgIMG_SRC.replace(/(url\(|\)|")/g, '');
942	
943	
944	//init everything once loaded
945	this.loader = new PIXI.loaders.Loader();
946	this.loader.add('rowBG',this.bgIMG_SRC);
947	this.loader.add('displaceBG', this.displacementIMG_URL);
948	this.loader.load(this.initialize.bind(this));
949
950}
951
952NectarLiquid.prototype.initialize = function() {
953	
954  this.settings = {
955      animationStrength: 1,
956			animationStrengthSpeed: 1,
957		  displacementScaleX: 30,
958			displacementScaleY: 90,
959      time: Math.random()*20,
960			filterMultX: 200,
961			filterMultY: 350,
962			shouldAnimate: true
963  };
964	if(this.animationType == 'displace-filter-fade') {
965		
966		if(this.elType == 'row') {
967			this.settings.filterMultX = 150;
968			this.settings.filterMultY = 375;
969			this.settings.displacementScaleX = 80;
970			this.settings.displacementScaleY = 170;
971			this.settings.animationStrengthSpeed = 2;
972		} else {
973			this.settings.filterMultX = 55;
974			this.settings.filterMultY = 150;
975			this.settings.displacementScaleX = 50;
976			this.settings.displacementScaleY = 160;
977			this.settings.animationStrengthSpeed = 1;
978		}
979	} else {
980		
981		if(this.elType != 'row') {
982			this.settings.displacementScaleY = 70;
983		}
984		
985	}
986	
987
988	//displacement
989	this.filterSprite = new window.PIXI.Sprite( this.loader.resources.displaceBG.texture );
990	this.filterSprite.texture.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT;
991	this.filter = new window.PIXI.filters.DisplacementFilter( this.filterSprite );
992
993	//bg	
994	this.bg = new PIXI.Sprite( this.loader.resources.rowBG.texture );
995
996	////store actual img height/ratio
997	this.imgHeight = this.loader.resources.rowBG.texture.orig.height;
998	this.imgWidth = this.loader.resources.rowBG.texture.orig.width;
999	this.imgRatio = this.imgWidth/this.imgHeight;
1000	
1001	// Set image anchor to the center of the image
1002  this.bg.anchor.x = 0.5;
1003  this.bg.anchor.y = 0.5;
1004	
1005	//sim background-size cover
1006	this.bg.height = $(this.rowBG).height();
1007	this.bg.width = this.imgRatio * this.bg.height;
1008	
1009	if( this.bg.width <= $(this.rowBG).width() ) {
1010		
1011		this.bg.width = $(this.rowBG).width() + 100;
1012		this.bg.height = this.bg.width / this.imgRatio;
1013		
1014	} else {
1015		this.bg.height = $(this.rowBG).height() + 100;
1016		this.bg.width = this.imgRatio * this.bg.height;
1017	}
1018
1019	//reset the dimensions for the renderer incase the row height has changed inbetween loading the bg resouce
1020	this.app.renderer.resize( $(this.rowBG).width(), $(this.rowBG).height() ); 
1021
1022  this.buildStage();
1023  this.createFilters();
1024	
1025	this.app.view.setAttribute( "class", "nectar-liquid-bg" );
1026  this.canvasContainer.appendChild( this.app.view );
1027	
1028	
1029	if(this.animationType == 'displace-filter-loop') {
1030		
1031		if($('#nectar_fullscreen_rows').length == 0) {
1032			
1033			this.animateFilters();
1034			
1035			$liquidBGOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '105%';
1036			
1037			var self = this;
1038			var $parentSelector = (self.elType == 'row') ? '.row-bg-wrap' : '.column-image-bg-wrap';
1039			
1040			var waypoint = new Waypoint({
1041				element: $(this.canvasContainer).parents($parentSelector),
1042				handler: function(direction) {
1043					//add bg to container
1044					self.imgContainer.addChild( self.bg );
1045				},
1046				offset: $liquidBGOffsetPos
1047			});
1048			
1049		} else {
1050			
1051			this.animateFilters();
1052			this.imgContainer.addChild( this.bg );
1053			
1054		}
1055
1056		
1057	}
1057 //end displace loop
1058	
1059	else if(this.animationType == 'displace-filter-fade') {
1060		
1061		this.animateFilters();
1062		this.settings.shouldAnimate = false;
1063		
1064		$liquidBGOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '85%';
1065		
1066		var self = this;
1067		var $parentSelector = (self.elType == 'row') ? '.row-bg-wrap' : '.column-image-bg-wrap';
1068			
1069		if($('#nectar_fullscreen_rows').length == 0 || $('#nectar_fullscreen_rows').length > 0 && $(this.canvasContainer).parents('.wpb_row.fp-section').index() == 0 || $disableFPonMobile == 'on') {
1070			
1071			var waypoint = new Waypoint({
1072				 element: $(this.canvasContainer).parents($parentSelector),
1073				 handler: function(direction) {
1074
1075					if($(self.canvasContainer).parents('.wpb_tab').length > 0 && $(self.canvasContainer).parents('.wpb_tab').css('visibility') == 'hidden' || $(self.canvasContainer).hasClass('animated-in')) { 
1076							 waypoint.destroy();
1077							 return;
1078					}
1079				
1080
1081					//add bg to container
1082					self.imgContainer.addChild( self.bg );
1083					
1084					//animate down
1085					self.animateProps(self);
1086					
1087					waypoint.destroy();
1088				},
1089				offset: $liquidBGOffsetPos
1090
1091			}); //waypoint end
1092		}
1093		
1094		
1095	} // end fade in displace
1096	
1097	//resize logic
1098 	$(window).resize(this.resize.bind(this));
1099  $(window).smartresize(this.resize.bind(this));
1100}
1101
1102NectarLiquid.prototype.animateProps = function(self) {
1103	
1104	setTimeout(function(){
1105
1106		$(self.canvasContainer).find('.nectar-liquid-bg').addClass('animated-in');
1107		
1108		self.settings.shouldAnimate = true;
1109		self.settings.animationStrength = 1;
1110		self.settings.animationStrengthSpeed = 2.5;
1111		self.animateFilters();
1112		
1113		//animate displacement down
1114		anime({
1115			targets: self.settings,
1116			animationStrength: 0,
1117			duration: 1900,
1118			easing: [.36,.42,.3,1],
1119			complete: function(anim) {
1120				self.settings.shouldAnimate = false
1121			}
1122		});
1123		
1124		anime({
1125			targets: self.settings,
1126			animationStrengthSpeed: 0.8,
1127			duration: 1900,
1128			easing: [.36,.42,.3,1],
1129			complete: function(anim) {
1130				self.settings.shouldAnimate = false
1131			}
1132		});
1133	
1134	},100);
1135	
1136}
1137
1138NectarLiquid.prototype.resize = function(){
1139	var self = this;
1140
1141  self.bgDivRatio = $(self.rowBG).height() / $(self.rowBG).width();
1142	 
1143	 self.imgContainer.position.x = $(self.rowBG).width() / 2;
1144   self.imgContainer.position.y = $(self.rowBG).height() / 2;
1145	 
1146	 //sim background-size cover
1147	 self.bg.height = $(self.rowBG).height();
1148	 self.bg.width = self.imgRatio * self.bg.height;
1149	 
1150	 if( self.bg.width <= $(self.rowBG).width() ) {
1151		 self.bg.width = $(self.rowBG).width() + 100;
1152		 self.bg.height = self.bg.width / self.imgRatio;
1153		 
1154	 } else {
1155		 self.bg.height = $(self.rowBG).height() + 100;
1156		 self.bg.width = self.imgRatio * self.bg.height;
1157	 }
1158	 
1159	 self.app.stage.scale.x = self.app.stage.scale.y = 1;
1160
1161	 self.app.renderer.resize( $(self.rowBG).width(), $(self.rowBG).height() ); 
1162
1163}
1164
1165NectarLiquid.prototype.createFilters = function() {
1166  this.app.stage.addChild( this.filterSprite );
1167  this.filter.scale.x = this.filter.scale.y = 1;
1168  this.imgContainer.filters = [
1169      this.filter
1170  ];
1171}
1172
1173	
1174NectarLiquid.prototype.buildStage = function() {
1175  this.imgContainer.position.x = $(this.rowBG).width() / 2;
1176  this.imgContainer.position.y = $(this.rowBG).height() / 2;
1177  this.app.stage.scale.x = this.app.stage.scale.y = 1;
1178  this.app.stage.addChild( this.imgContainer );
1179}
1180
1181
1182NectarLiquid.prototype.animateFilters = function() {
1183	this.filterSprite.rotation = this.settings.time * 0.01;
1184	this.filterSprite.x = Math.sin(this.settings.time * 0.1) * this.settings.filterMultX;
1185  this.filterSprite.y = Math.cos(this.settings.time * 0.1) * this.settings.filterMultY;
1186  this.filter.scale.x = this.settings.displacementScaleX * this.settings.animationStrength;
1187  this.filter.scale.y = this.settings.displacementScaleY * this.settings.animationStrength;
1188  
1189	
1190	this.settings.time += 0.05 * this.settings.animationStrengthSpeed;
1191	
1192	if(this.animationType == 'displace-filter-loop') {
1193		requestAnimationFrame(function(){
1194	    this.animateFilters();
1195	  }.bind(this));
1196	}
1197	else if(this.animationType == 'displace-filter-fade' && this.settings.shouldAnimate) {
1198		requestAnimationFrame(function(){
1199	    this.animateFilters();
1200	  }.bind(this));
1201	}
1202	
1203} 
1204
1205function nectarLiquidBGs() {
1206	$liquidBG_EL = [];
1207
1208	$('.row-bg-wrap[data-bg-animation*="displace-filter"] .row-bg.using-image, .column-image-bg-wrap[data-bg-animation*="displace-filter"] .column-image-bg').each(function(i){
1209		
1210		var $that_el = $(this);
1211		
1212		if( $(this).is('.row-bg') ) {
1213			
1214			var $type = $(this).parents('.row-bg-wrap').attr('data-bg-animation');
1215			var $el_type = 'row';
1216			
1217		} else if(  $(this).is('.column-image-bg') ) {
1218			
1219			var $type = $(this).parents('.column-image-bg-wrap').attr('data-bg-animation');
1220			var $el_type = 'col';
1221		}
1222		
1223		$liquidBG_EL[i] = new NectarLiquid($that_el, $type, $el_type);
1224		
1225	});
1226}
1227
1228
1229
1230
1231
1232/***************** Global vars ******************/
1233var $standAnimatedColTimeout = [];
1234var $animatedSVGIconTimeout = [];
1235var $svg_icons = [];
1236var $nectarCustomSliderRotate = [];
1237var $flickitySliders = [];
1238var $wooFlickityCarousels = [];
1239var $liquidBG_EL = [];
1240
1241/***************** Smooth Scrolling ******************/
1242
1243	function niceScrollInit(){
1244		//removed since 9.0.
1245	}
1246
1247	var $smoothActive = 0; 
1248	var $smoothCache = false;
1249	
1250	
1251	//chrome ss
1252	if($smoothCache == false && $('body.material').length == 0 && navigator.platform.toUpperCase().indexOf('MAC') === -1 && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/) && $(window).width() > 690 && $('#nectar_fullscreen_rows').length == 0) {
1253		!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(a<v.accelerationDelta){var i=(1+30/a)/2;i>1&&(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<M.length;c++){var s=M[c],d=r-s.start,f=d>=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+10<n)return i(t,document.body)}else if(e.clientHeight+10<e.scrollHeight&&(overflow=getComputedStyle(e,"").getPropertyValue("overflow-y"),"scroll"===overflow||"auto"===overflow))return i(t,e)}while(e=e.parentNode)}function u(e,t,n){window.addEventListener(e,t,n||!1)}function c(e,t,n){window.removeEventListener(e,t,n||!1)}function s(e,t){return(e.nodeName||"").toLowerCase()===t.toLowerCase()}function d(e,t){e=e>0?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))}();
1254	}
1255
1256
1257/***************** Sliders ******************/
1258
1259	//gallery
1260	function flexsliderInit(){
1261		$('.flex-gallery').each(function(){
1262			
1263			var $that = $(this);
1264			
1265			imagesLoaded($(this),function(instance){
1266			
1267				 $that.flexslider({
1268			        animation: 'fade',
1269			        smoothHeight: false, 
1270			        animationSpeed: 500,
1271			        useCSS: false, 
1272			        touch: true
1273			    });
1274				
1275				////gallery slider add arrows
1276				$('.flex-gallery .flex-direction-nav li a.flex-next').html('<i class="fa fa-angle-right"></i>');
1277				$('.flex-gallery .flex-direction-nav li a.flex-prev').html('<i class="fa fa-angle-left"></i>');
1278			
1279			});
1280			
1281		});
1282	}
1283	flexsliderInit();
1284
1285  
1286
1287
1288	function flickityInit() {
1289		if($('.nectar-flickity:not(.masonry)').length == 0) return false;
1290		$flickitySliders = [];
1291		$('.nectar-flickity:not(.masonry)').each(function(i){
1292			
1293			$(this).removeClass(function (index, className) {
1294			    return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
1295			});
1296			$(this).addClass('instance-'+i);
1297			
1298			var $freeScrollBool = ($(this).is('[data-free-scroll]') && $(this).attr('data-free-scroll') == 'true') ? true : false;
1299			var $groupCellsBool = true;
1300			var $flickContainBool = true;
1301			var $flcikAttr = 0.025;
1302			
1303			var $flickCellAlign = 'center';
1304			if( $(this).is('[data-format="fixed_text_content_fullwidth"]') ) {
1305					$flickCellAlign = 'left';
1306					$groupCellsBool = false;
1307					$flickContainBool = false;
1308					$flcikAttr = 0.02;
1309			}
1310
1311			if($freeScrollBool == true) {
1312				 $groupCellsBool = false;
1313			}
1314
1315			if($(this).attr('data-controls').length > 0 && $(this).attr('data-controls') == 'next_prev_arrows') {
1316				var $paginationBool = false;
1317				var $nextPrevArrowBool = true;
1318			} else {
1319				var $paginationBool = true;
1320				var $nextPrevArrowBool = false;
1321			}
1322
1323			if($(this).attr('data-controls').length > 0 && $(this).attr('data-controls') == 'none') {
1324				var $paginationBool = false;
1325				var $nextPrevArrowBool = false;
1326			}
1327
1328			var $flickity_autoplay = false;
1329			var $selectedAttraction = 0.025;
1330
1331			if($(this).is('[data-autoplay]') && $(this).attr('data-autoplay') == 'true') {
1332				
1333				$flickity_autoplay = true;
1334				$selectedAttraction = 0.019;
1335
1336				if($(this).is('[data-autoplay-dur]') && $(this).attr('data-autoplay-dur').length > 0) {
1337
1338					if(parseInt($(this).attr('data-autoplay-dur')) > 100 && parseInt($(this).attr('data-autoplay-dur')) < 30000) {
1339						$flickity_autoplay = parseInt($(this).attr('data-autoplay-dur'));
1340					}
1341					
1342				}
1343
1344			}
1345
1346			var $that = $(this);
1347			var $frontEndEditorDrag =  ($('body.vc_editor').length > 0) ? false: true;
1348			var $frontEndEditorPause =  ($('body.vc_editor').length > 0) ? true: false;
1349			
1350			$flickitySliders[i] = new Flickity('.nectar-flickity.instance-'+i, {
1351			  contain: $flickContainBool,
1352			  draggable:$frontEndEditorDrag,
1353			  lazyLoad: false,
1354			  imagesLoaded: true,
1355			  percentPosition: true,
1356				cellAlign: $flickCellAlign,
1357			  selectedAttraction: $selectedAttraction,
1358			  groupCells: $groupCellsBool,
1359			  prevNextButtons: $nextPrevArrowBool,
1360			  freeScroll: $freeScrollBool,
1361			  pageDots: $paginationBool,
1362			  resize: true,
1363				selectedAttraction: $flcikAttr,
1364			  autoPlay: $flickity_autoplay,
1365				pauseAutoPlayOnHover: $frontEndEditorPause,
1366			  setGallerySize: true,
1367			  wrapAround: true,
1368			  accessibility: false,
1369			  arrowShape: { 
1370				     x0: 20,
1371					  x1: 70, y1: 30,
1372					  x2: 70, y2: 25,
1373					  x3: 70
1374				}
1375			});
1376			
1377
1378			if($(this).is('[data-format="fixed_text_content_fullwidth"]') && !nectarDOMInfo.usingFrontEndEditor) {
1379				
1380				var $onMobileBrowser = navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/);
1381				
1382				$flickitySliders[i].on( 'scroll', function() {
1383					
1384					if($onMobileBrowser) { return; }
1385					
1386					var $curFlkSlid = $flickitySliders[i];
1387					var $flkSlideWidth = $that.find('.cell').outerWidth() + 25;
1388					var $leftHeaderSize = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 275 : 0;
1389					var $extraWindowSpace = ( ($(window).width() + $leftHeaderSize) - $that.parents('.main-content').width())/2;
1390					$extraWindowSpace += parseInt($that.css('margin-left')) + 2;
1391					$flickitySliders[i].slides.forEach( function( slide, j ) {
1392
1393							var $scaleAmt = 1;
1394							var $translateXAmt = 0;
1395							var $rotateAmt = 0;
1396							var $slideZIndex = 10;
1397							var $opacityAmt = 1;
1398							
1399							var $slideOffset = $(slide.cells[0].element).offset().left;
1400							
1401							var flkInstanceSlide = $('.nectar-flickity.instance-'+i+' .cell:nth-child('+ (j+1) +')');
1402							
1403							if($slideOffset - $extraWindowSpace < 0 && $slideOffset  - $extraWindowSpace > $flkSlideWidth*-1 ) {
1404								$scaleAmt = 1 + ( ($slideOffset - $extraWindowSpace) / 1500);
1405								$opacityAmt = 1 + ( ($slideOffset - $extraWindowSpace + 70) / 550);
1406								$translateXAmt = ( ($slideOffset - $extraWindowSpace)) * -1;
1407								$rotateAmt = ( ($slideOffset  - $extraWindowSpace) / 25) * -1;
1408							} else {
1409								$scaleAmt = 1;
1410								$opacityAmt = 1;
1411								$translateXAmt = 0;
1412								$rotateAmt = 0;
1413							}
1414							
1415							//handle z separately for an extra cushion of 5px in case
1416							if($slideOffset + 5 - $extraWindowSpace < 0 && $slideOffset  - $extraWindowSpace > $flkSlideWidth*-1 ) {
1417								$slideZIndex = 5;
1418							} else {
1419								$slideZIndex = 10;
1420							}
1421							
1422							flkInstanceSlide.css({
1423								'z-index' : $slideZIndex
1424							});
1425							
1426							flkInstanceSlide.find('.inner-wrap-outer').css({
1427								'transform': 'perspective(800px) translateX('+ $translateXAmt +'px) rotateY('+$rotateAmt+'deg) translateZ(0)',
1428								'opacity' : $opacityAmt
1429							});
1430							
1431							flkInstanceSlide.find('.inner-wrap').css({
1432								'transform': 'scale('+ $scaleAmt +') translateZ(0)'
1433							}); 
1434							
1435						  
1436					
1437					});
1438				});
1439				
1440				
1441			}
1442
1443			var $removeHiddenTimeout;
1444
1445			$flickitySliders[i].on( 'dragStart', function() {
1446			   clearTimeout($removeHiddenTimeout);
1447				 $that.addClass('is-dragging');
1448			   $that.find('.flickity-prev-next-button').addClass('hidden');
1449			});
1450			$flickitySliders[i].on( 'dragEnd', function() {
1451				$that.removeClass('is-dragging');
1452				$removeHiddenTimeout = setTimeout(function(){
1453					$that.find('.flickity-prev-next-button').removeClass('hidden');
1454				},600);
1455			 
1456			});
1457
1458			$('.flickity-prev-next-button').on( 'click', function() {
1459			   clearTimeout($removeHiddenTimeout);
1460			   $(this).parents('.nectar-flickity').find('.flickity-prev-next-button').addClass('hidden');
1461			   $removeHiddenTimeout = setTimeout(function(){
1462					$that.find('.flickity-prev-next-button').removeClass('hidden');
1463				},600);
1464			});
1465			
1466			
1467			//imgs loaded
1468			if($that.hasClass('nectar-carousel')) {
1469				imagesLoaded($that,function(instance){
1470					nectarCarouselFlkEH($that);
1471				});
1472			}
1473			
1474
1475		});
1476		
1477
1478	}
1479	
1480	
1481	setTimeout(flickityInit,100);
1482	
1483	
1484	//nectar carousel flickity equal height
1485	
1486	////loop
1487	function setNectarCarouselFlkEH() {
1488			$('.nectar-carousel.nectar-flickity:not(.masonry)').each(function(){
1489				  nectarCarouselFlkEH($(this));
1490			});
1491	}
1492	
1493	function nectarCarouselFlkEH($slider_instance) {
1494			
1495			var $tallestSlideCol = 0;
1496			
1497			$slider_instance.find('.flickity-slider > .cell').css('height','auto');
1498			
1499			$slider_instance.find('.flickity-slider > .cell').each(function(){
1500				($(this).height() > $tallestSlideCol) ? $tallestSlideCol = $(this).height() : $tallestSlideCol = $tallestSlideCol;
1501			});	
1502			
1503			//safety net incase height couldn't be determined
1504			if($tallestSlideCol < 10) $tallestSlideCol = 'auto';
1505
1506			//set even height
1507			$slider_instance.find('.flickity-slider > .cell').css('height',$tallestSlideCol+'px');
1508
1509	}
1510	
1511	
1512
1513
1514	function flickityBlogInit() {
1515		if($('.nectar-flickity.masonry.not-initialized').length == 0) return false;
1516
1517		$('.nectar-flickity.masonry.not-initialized').each(function(){
1518
1519			//move pos for large_featured
1520			if($(this).parents('article').hasClass('large_featured')) 
1521				$(this).insertBefore( $(this).parents('article').find('.content-inner') );
1522			
1523		});
1524
1525
1526		$('.nectar-flickity.masonry.not-initialized').flickity({
1527		  contain: true,
1528		  draggable: false,
1529		  lazyLoad: false,
1530		  imagesLoaded: true,
1531		  percentPosition: true,
1532		  prevNextButtons: true,
1533		  pageDots: false,
1534		  resize: true,
1535		  setGallerySize: true,
1536		  wrapAround: true,
1537		  accessibility: false
1538		});
1539
1540		$('.nectar-flickity.masonry').removeClass('not-initialized');
1541
1542		//add count
1543		$('.nectar-flickity.masonry:not(.not-initialized)').each(function(){
1544
1545			if($(this).find('.item-count').length == 0) {
1546				
1547				$('<div class="item-count"/>').insertBefore($(this).find('.flickity-prev-next-button.next'));
1548				$(this).find('.item-count').html('<span class="current">1</span>/<span class="total">' + $(this).find('.flickity-slider .cell').length + '</span>');
1549
1550				$(this).find('.flickity-prev-next-button, .item-count').wrapAll('<div class="control-wrap" />');
1551
1552				//move pos for wide_tall
1553				if($(this).parents('article').hasClass('wide_tall') && $(this).parents('.masonry.material').length == 0) 
1554					$(this).find('.control-wrap').insertBefore( $(this) );
1555			}
1556		});
1557
1558		//update count
1559		$('.masonry .flickity-prev-next-button.previous,  .masonry .flickity-prev-next-button.next').on('click',function(){
1560			if($(this).parents('.wide_tall').length > 0) 
1561				$(this).parent().find('.item-count .current').html($(this).parents('article').find('.nectar-flickity .cell.is-selected').index()+1);
1562			else 
1563				$(this).parent().find('.item-count .current').html($(this).parents('.nectar-flickity').find('.cell.is-selected').index()+1);
1564		});
1565
1566		$('body').on('mouseover','.flickity-prev-next-button.next',function(){
1567			$(this).parent().find('.flickity-prev-next-button.previous, .item-count').addClass('next-hovered');
1568		});
1569		$('body').on('mouseleave','.flickity-prev-next-button.next',function(){
1570			$(this).parent().find('.flickity-prev-next-button.previous, .item-count').removeClass('next-hovered');
1571		});
1572	
1573	}
1574/****************twenty twenty******************/
1575function twentytwentyInit() {
1576	$('.twentytwenty-container').each(function(){
1577		var $that = $(this);
1578		
1579		if($that.find('.twentytwenty-handle').length == 0) {
1580			$(this).imagesLoaded(function(){
1581				$that.twentytwenty();
1582			});
1583		}
1584		
1585	});
1586}
1587twentytwentyInit();
1588
1589/****************split line text******************/
1590if($('.nectar-recent-posts-single_featured.multiple_featured').length > 0) {
1591  splitLineText();
1592}
1593	
1594/****************full page******************/
1595var $frontEndEditorFPRDiv = '';
1596var $usingFullScreenRows = false;
1597var $fullscreenSelector = '';
1598var $disableFPonMobile = ($('#nectar_fullscreen_rows[data-mobile-disable]').length > 0) ? $('#nectar_fullscreen_rows').attr('data-mobile-disable') : 'off';
1599var $onMobileBrowser = navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/);
1600
1601if(!$onMobileBrowser) {
1602	$disableFPonMobile = 'off';
1603}
1604
1605//change anchor link IDs for when disabled on mobile
1606if($disableFPonMobile == 'on' && $('#nectar_fullscreen_rows').length > 0) {
1607	$('#nectar_fullscreen_rows > .wpb_row[data-fullscreen-anchor-id]').each(function(){
1608		if($(this).attr('data-fullscreen-anchor-id').length > 0)
1609			$(this).attr('id',$(this).attr('data-fullscreen-anchor-id'));
1610	});
1611
1612
1613	//remove main content row padding
1614	$('.container-wrap .main-content > .row').css({'padding-bottom':'0'});
1615
1616	//extra padding for first row is using transparent header
1617	if( $('#nectar_fullscreen_rows > .wpb_row:nth-child(1)').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && !$('#nectar_fullscreen_rows > .wpb_row:nth-child(1)').hasClass('full-width-content') ) {
1618		$('#nectar_fullscreen_rows > .wpb_row:nth-child(1)').addClass('extra-top-padding');
1619	}
1620}
1621
1622if($('#nectar_fullscreen_rows').length > 0 && $disableFPonMobile != 'on' || $().fullpage && $disableFPonMobile != 'on') {
1623
1624	function setFPNavColoring(index,direction) {
1625			
1626		  if($('#boxed').length > 0 && overallWidth > 750) return;
1627		
1628		  if($('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv+':nth-child('+index+')').find('.span_12.light').length > 0) {
1629    		$('#fp-nav').addClass('light-controls');
1630
1631    		  if(direction == 'up')
1632    			  $('#header-outer.dark-slide').removeClass('dark-slide');
1633    		  else
1634    		  	setTimeout(function(){ $('#header-outer.dark-slide').removeClass('dark-slide'); },520);
1635    	} else {
1636    		  $('#fp-nav.light-controls').removeClass('light-controls');
1637
1638    		  if(direction == 'up')
1639    		  	$('#header-outer').addClass('dark-slide');
1640    		  else
1641    			  setTimeout(function(){ $('#header-outer').addClass('dark-slide'); },520);
1642    	}
1643			
1644			//handle n slider coloring
1645			if($('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv+':nth-child('+index+')').find('.nectar-slider-wrap[data-fullscreen="true"]').length > 0) {
1646			 var $currentSlider = $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv+':nth-child('+index+')').find('.nectar-slider-wrap[data-fullscreen="true"]');
1647		
1648				if( $currentSlider.is('[data-overall_style="directional"]') && $('#header-outer #logo span.dark').length > 0 ){
1649					$('#header-outer').addClass('directional-nav-effect').removeClass('dne-disabled');
1650				}
1651				
1652				if($currentSlider.find('.swiper-slide-active[data-color-scheme="light"]').length > 0) {
1653					$('#header-outer').removeClass('dark-slide');
1654				} else if($currentSlider.find('.swiper-slide-active[data-color-scheme="dark"]').length > 0) {
1655					$('#header-outer').addClass('dark-slide');
1656				}
1657				
1658			} else {
1659				
1660					$('#header-outer').removeClass('directional-nav-effect').addClass('dne-disabled');
1661				
1662			}
1663			
1664	}
1665	
1666	
1667
1668	var $anchors = [];
1669	var $names = [];
1670	
1671	function setFPNames() {
1672		$anchors = [];
1673		$names = [];
1674		$frontEndEditorFPRDiv =  (window.vc_iframe) ? '> .vc_element': '> .wpb_row';
1675		
1676		$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv).each(function(i){
1677			var $id = ($(this).is('[data-fullscreen-anchor-id]')) ? $(this).attr('data-fullscreen-anchor-id') : '';
1678
1679			//anchor checks
1680			if($('#nectar_fullscreen_rows[data-anchors="on"]').length > 0) {
1681				if($id.indexOf('fws_') == -1) $anchors.push($id);
1682				else $anchors.push('section-'+(i+1));
1683			}
1684
1685			//name checks
1686			if($(this).find('.full-page-inner-wrap[data-name]').length > 0) 
1687				$names.push($(this).find('.full-page-inner-wrap').attr('data-name'));
1688			else 
1689				$names.push(' ');
1690		});
1691	}
1692	setFPNames();
1693
1694	function initFullPageFooter() {
1695		var $footerPos = $('#nectar_fullscreen_rows').attr('data-footer');
1696
1697		if($footerPos == 'default') {
1698			$('#footer-outer').appendTo('#nectar_fullscreen_rows').addClass('fp-auto-height').addClass('fp-section').addClass('wpb_row').attr('data-anchor',' ').wrapInner('<div class="span_12" />').wrapInner('<div class="container" />').wrapInner('<div class="full-page-inner" />').wrapInner('<div class="full-page-inner-wrap" />').wrapInner('<div class="full-page-inner-wrap-outer" />');
1699		}
1700		else if($footerPos == 'last_row') {
1701			$('#footer-outer').remove();
1702			$('#nectar_fullscreen_rows > .wpb_row:last-child').attr('id','footer-outer').addClass('fp-auto-height');
1703		} else {
1704			$('#footer-outer').remove();
1705		}
1706		
1707	}	
1708
1709	if($('#nectar_fullscreen_rows').length > 0)
1710		initFullPageFooter();
1711
1712	//fullscreen row logic
1713	function fullscreenRowLogic() {
1714		$('.full-page-inner-wrap .full-page-inner > .span_12 > .wpb_column').each(function(){
1715			if($(this).find('> .vc_column-inner > .wpb_wrapper').find('> .wpb_row').length > 0) {
1716
1717				//add class for css
1718				$(this).find('> .vc_column-inner > .wpb_wrapper').addClass('only_rows');
1719
1720				//set number of rows for css
1721				var $rowNum = $(this).find('> .vc_column-inner > .wpb_wrapper').find('> .wpb_row').length;
1722				$(this).find('> .vc_column-inner > .wpb_wrapper').attr('data-inner-row-num',$rowNum);
1723			} 
1724
1725			else if($(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').find('> .wpb_row').length > 0) {
1726
1727				//add class for css
1728				$(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').addClass('only_rows');
1729
1730				//set number of rows for css
1731				var $rowNum = $(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').find('> .wpb_row').length;
1732				$(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').attr('data-inner-row-num',$rowNum);
1733			}
1734		});
1735	}
1736
1737	fullscreenRowLogic();
1738
1739	function fullHeightRowOverflow() {
1740		//handle rows with full height that are larger than viewport
1741		if($(window).width() >= 1000) {
1742
1743	    	$('#nectar_fullscreen_rows > .wpb_row .full-page-inner-wrap[data-content-pos="full_height"]').each(function(){
1744
1745	    		//reset mobile calcs incase user plays with window resize
1746	    		$(this).find('> .full-page-inner').css('height','100%');
1747
1748	    		var maxHeight = overallHeight;
1749	    		var columnPaddingTop = 0;
1750	    		var columnPaddingBottom = 0;
1751
1752	    		
1753	    		if($('#nectar_fullscreen_rows').attr('data-animation') == 'none')
1754	    			$(this).find('> .full-page-inner > .span_12 ').css('height','100%');
1755	    		else
1756	    			$(this).find('> .full-page-inner > .span_12 ').css('height',overallHeight);
1757
1758	    		$(this).find('> .full-page-inner > .span_12 > .wpb_column > .vc_column-inner > .wpb_wrapper').each(function(){
1759	    			 columnPaddingTop = parseInt($(this).parents('.wpb_column').css('padding-top'));
1760	    			 columnPaddingBottom = parseInt($(this).parents('.wpb_column').css('padding-bottom'));
1761
1762	    			 maxHeight = maxHeight > $(this).height() + columnPaddingTop + columnPaddingBottom ? maxHeight : $(this).height() + columnPaddingTop + columnPaddingBottom;
1763	    		});
1764	    		
1765	    	
1766	    		if(maxHeight > overallHeight)
1767	    			$(this).find('> .full-page-inner > .span_12').height(maxHeight).css('float','none');
1768	    		
1769	    	});
1770
1771	    }
1772
1773	    else {
1774	    	//mobile min height set
1775	    	$('#nectar_fullscreen_rows > .wpb_row').each(function(){
1776	    		$totalColHeight = 0;
1777	    		$(this).find('.fp-scrollable > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap[data-content-pos="full_height"] > .full-page-inner > .span_12 > .wpb_column').each(function(){
1778	    			$totalColHeight += $(this).outerHeight(true);
1779	    		});
1780
1781	    		$(this).find('.fp-scrollable > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner').css('height','100%');
1782	    		if($totalColHeight > $(this).find('.fp-scrollable > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner').height())
1783	    			$(this).find('.fp-scrollable  > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner').height($totalColHeight);
1784	    	});
1785	    }
1786
1787	}
1788
1789	function fullscreenElementSizing() {
1790		//nectar slider
1791		var $nsSelector = '.nectar-slider-wrap[data-fullscreen="true"][data-full-width="true"], .nectar-slider-wrap[data-fullscreen="true"][data-full-width="boxed-full-width"]';
1792		if($('.nectar-slider-wrap[data-fullscreen="true"][data-full-width="true"]').length > 0 || $('.nectar-slider-wrap[data-fullscreen="true"][data-full-width="boxed-full-width"]').length > 0) {
1793			if($('#nectar_fullscreen_rows .wpb_row').length > 0) 
1794				$($nsSelector).find('.swiper-container').attr('data-height',$('#nectar_fullscreen_rows .wpb_row').height()+1);
1795	        
1796	        $(window).trigger('resize.nsSliderContent');
1797
1798	        $($nsSelector).parents('.full-page-inner').addClass('only-nectar-slider');
1799	    }
1800	}
1801
1802
1803	//kenburns first slide fix
1804	$('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"] > .wpb_row:first-child .row-bg.using-image').addClass('kenburns');
1805	setTimeout(function(){
1806		//ken burns first slide fix
1807		$('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"] > .wpb_row:first-child .row-bg.using-image').removeClass('kenburns');
1808	},500);
1809
1810	//remove kenburns from safari
1811	if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) $('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"]').attr('data-row-bg-animation','none');
1812
1813	var overallHeight = $(window).height();
1814	var overallWidth = $(window).width();
1815	var $fpAnimation = $('#nectar_fullscreen_rows').attr('data-animation');
1816	var $fpAnimationSpeed;
1817	var $svgResizeTimeout;
1818	
1819	switch($('#nectar_fullscreen_rows').attr('data-animation-speed')) {
1820		case 'slow':
1821			$fpAnimationSpeed = 1150;
1822			break;
1823		case 'medium':
1824			$fpAnimationSpeed = 850;
1825			break;
1826		case 'fast':
1827			$fpAnimationSpeed = 650;
1828			break;
1829		default:
1830			$fpAnimationSpeed = 850;
1831	}
1832	
1833	function heyFirefoxDrawTheEl(){
1834			var $drawTheEl = $('#nectar_fullscreen_rows > div:first-child').height();
1835			if($('#nectar_fullscreen_rows.trans-animation-active').length > 0){
1836				requestAnimationFrame(heyFirefoxDrawTheEl);
1837			}
1838	}
1839
1840	
1841	function initNectarFP() {
1842		
1843		$frontEndEditorFPRDiv =  (window.vc_iframe) ? '> .vc_element': '> .wpb_row';
1844		
1845		if(window.vc_iframe) {
1846			setTimeout(function(){
1847				$('html,body').css({
1848					'height':'100%',
1849				  'overflow-y':'hidden'
1850			  });
1851			},100);
1852			
1853			//remove scrolling to help performance of FE editor
1854			$('body,html').on("mousewheel.removeScroll", function() {
1855			    return false;
1856			});
1857			
1858		}
1859		
1860		//move row IDs onto parents for front end editor
1861		if($('body.vc_editor').length > 0) {
1862			$('#nectar_fullscreen_rows > .vc_empty-placeholder').remove();
1863			
1864			$('#nectar_fullscreen_rows > .vc_element').each(function(){
1865				var innerRowID = $(this).find('> .wpb_row').attr('id');
1866				$(this).attr('id',innerRowID);
1867			});
1868		}
1869		
1870		$usingFullScreenRows = true;
1871		$fullscreenSelector = (window.vc_iframe) ? '.vc_element.vc_vc_row.active ' : '.wpb_row.active ';
1872
1873		$('.container-wrap, .container-wrap .main-content > .row').css({'padding-bottom':'0', 'margin-bottom': '0'});
1874		$('#nectar_fullscreen_rows').fullpage({
1875			sectionSelector: '#nectar_fullscreen_rows '+$frontEndEditorFPRDiv,
1876			navigation: true,
1877			css3: true,
1878			scrollingSpeed: $fpAnimationSpeed,
1879			anchors: $anchors,
1880			scrollOverflow: true,
1881			navigationPosition: 'right',
1882			navigationTooltips: $names,
1883			afterLoad: function(anchorLink, index, slideAnchor, slideIndex){ 
1884
1885				if($('#nectar_fullscreen_rows').hasClass('afterLoaded')) {
1886				 	
1887					//ensure no scrolling body occurs
1888					if(nectarDOMInfo.scrollTop != 0) {
1889						window.scrollTo(0,0);
1890					}
1891					
1892					//reset slim scroll to top
1893					$('.wpb_row:not(.last-before-footer):not(:nth-child('+index+')) .fp-scrollable').each(function(){
1894						var $scrollable = $(this).data('iscrollInstance');
1895						$scrollable.scrollTo(0,0);
1896					});
1897
1898					//reset carousel
1899					$('.wpb_row:not(:nth-child('+index+')) .owl-carousel').trigger('to.owl.carousel',[0]);
1900
1901					var $row_id = $('#nectar_fullscreen_rows > .wpb_row:nth-child('+index+')').attr('id');
1902
1903					$('#nectar_fullscreen_rows '+$frontEndEditorFPRDiv).removeClass('transition-out').removeClass('trans');
1904					
1905
1906					$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':nth-child('+index+')').removeClass('next-current');
1907					$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':nth-child('+index+') .full-page-inner-wrap-outer').css({'height': '100%'});
1908					$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +' .full-page-inner-wrap-outer').css({'transform':'none'});
1909					//take care of nav/control coloring
1910					//setFPNavColoring(index,'na');
1911					
1912					//handle waypoints
1913					if($row_id != 'footer-outer' && $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':nth-child('+index+').last-before-footer').length == 0) {
1914						waypoints();
1915						if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) && !nectarDOMInfo.usingFrontEndEditor) {
1916							resetWaypoints();
1917							Waypoint.destroyAll();
1918							startMouseParallax();
1919						}
1920						if(!nectarDOMInfo.usingFrontEndEditor) {
1921							nectarLiquidBGFP();
1922						}
1923						responsiveTooltips();
1924					}
1925					
1926					if($row_id !='footer-outer') {
1927						$('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv).removeClass('last-before-footer').css('transform','initial');
1928
1929						//reset animation attrs
1930						if(!window.vc_iframe) {
1931
1932							$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(.active):not(#footer-outer)').css({'transform':'translateY(0)','left':'-9999px', 'transition': 'none', 'opacity':'1', 'will-change':'auto'});
1933							$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(#footer-outer)').find('.full-page-inner-wrap-outer').css({'transition': 'none',  'transform':'none', 'will-change':'auto'});
1934							$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(#footer-outer)').find('.fp-tableCell').css({'transition': 'none', 'transform':'none', 'will-change':'auto'});
1935						}
1936						
1937						//stacking fix
1938						$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(#footer-outer)').find('.full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner > .container').css({'backface-visibility':'visible', 'z-index':'auto'});
1939					}
1940				} else {
1941					fullHeightRowOverflow();
1942					overallHeight = $('#nectar_fullscreen_rows').height();
1943					$('#nectar_fullscreen_rows').addClass('afterLoaded');
1944
1945					//for users that have scrolled down prior to turning on full page
1946					setTimeout(function(){ window.scrollTo(0,0); },1800);
1947
1948					//ken burns first slide fix
1949					$('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"] '+ $frontEndEditorFPRDiv +':first-child .row-bg.using-image').removeClass('kenburns');
1950
1951					//handle fullscreen elements
1952	        fullscreenElementSizing();
1953
1954						
1955				}
1956
1957				
1958				$('#nectar_fullscreen_rows').removeClass('nextSectionAllowed');
1959
1960				
1961			 },
1962	        onLeave: function(index, nextIndex, direction){ 
1963	        	
1964						$('#nectar_fullscreen_rows').addClass('trans-animation-active');
1965						
1966						var $row_id = $('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv + ':nth-child('+nextIndex+')').attr('id');
1967	        	var $indexRow = $('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv + ':nth-child('+index+')');
1968	        	var $nextIndexRow = $('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv + ':nth-child('+nextIndex+')');
1969	        	var $nextIndexRowInner = $nextIndexRow.find('.full-page-inner-wrap-outer');
1970	        	var $nextIndexRowFpTable = $nextIndexRow.find('.fp-tableCell');
1971	        	//mobile/safari  fix
1972	        	var $transformProp = (!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) ? 'transform' : 'all'; 
1973	        	//if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) $transformProp = 'all';
1974
1975	        	if( $row_id == 'footer-outer') {
1976	        		$indexRow.addClass('last-before-footer'); 
1977	        		$('#footer-outer').css('opacity','1');
1978	        	} else {
1979	        		$('#nectar_fullscreen_rows '+$frontEndEditorFPRDiv+'.last-before-footer').css('transform','translateY(0px)');
1980	        		$('#footer-outer').css('opacity','0');
1981	        	}
1982	        	if($indexRow.attr('id') == 'footer-outer') {
1983	        		$('#footer-outer').css({'transition': $transformProp+' 460ms cubic-bezier(0.60, 0.23, 0.2, 
19830.93)', 'backface-visibility': 'hidden'});
1984	        		$('#footer-outer').css({'transform': 'translateY(45%) translateZ(0)'});
1985	        	}
1986	 			
1987
1988	 			//stacking fix
1989	 			if($nextIndexRow.attr('id') != 'footer-outer') {
1990					$nextIndexRowFpTable.find('.full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner > .container').css({'backface-visibility':'hidden', 'z-index':'110'});
1991				}
1992
1993	        	//animation
1994	        	if($nextIndexRow.attr('id') != 'footer-outer' && $indexRow.attr('id') != 'footer-outer' && $('#nectar_fullscreen_rows[data-animation="none"]').length == 0 ) {
1995
1996	        		//scrolling down
1997	        		if(direction == 'down') {
1998
1999	        			if($fpAnimation == 'parallax') {
2000		        			$indexRow.css({'transition': $transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1)', 'will-change':'transform', 'transform':'translateZ(0)' ,'z-index': '100'});
2001		        			setTimeout(function() { 
2002		        				$indexRow.css({'transform': 'translateY(-50%) translateZ(0)'});
2003		        			}, 60);
2004
2005		        			$nextIndexRow.css({'z-index':'1000','top':'0','left':'0'});
2006		        			$nextIndexRowFpTable.css({'transform':'translateY(100%) translateZ(0)', 'will-change':'transform'});
2007		        			$nextIndexRowInner.css({'transform':'translateY(-50%) translateZ(0)', 'will-change':'transform'});
2008		        			
2009	        			} else if($fpAnimation == 'zoom-out-parallax') {
2010
2011	        				$indexRow.css({'transition': 'opacity '+$fpAnimationSpeed+'ms cubic-bezier(0.37, 0.31, 0.2, 0.85), transform '+$fpAnimationSpeed+'ms cubic-bezier(0.37, 0.31, 0.2, 0.85)', 'z-index': '100', 'will-change':'transform'});
2012		        			setTimeout(function() { 
2013		        				$indexRow.css({'transform': 'scale(0.77) translateZ(0)', 'opacity': '0'});
2014		        			}, 60);
2015
2016		        			$nextIndexRow.css({'z-index':'1000','top':'0','left':'0'});
2017		        			$nextIndexRowFpTable.css({'transform':'translateY(100%) translateZ(0)', 'will-change':'transform'});
2018		        			$nextIndexRowInner.css({'transform':'translateY(-50%) translateZ(0)',  'will-change':'transform'});
2019	        			} 
2020
2021	        		}
2022
2023	        		//scrolling up
2024	        		else {
2025
2026	        			if($fpAnimation == 'parallax') {
2027		        			$indexRow.css({'transition': $transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1)', 'z-index': '100', 'will-change':'transform'});
2028		        			setTimeout(function() { 
2029		        				$indexRow.css({'transform': 'translateY(50%) translateZ(0)'});
2030		        			}, 60);
2031
2032		        			$nextIndexRow.css({'z-index':'1000','top':'0','left':'0'});
2033		        			$nextIndexRowFpTable.css({'transform':'translateY(-100%) translateZ(0)','will-change':'transform'});
2034		        			$nextIndexRowInner.css({'transform':'translateY(50%) translateZ(0)','will-change':'transform'});
2035	        			}
2036
2037	        			else if($fpAnimation == 'zoom-out-parallax') {
2038		        			$indexRow.css({'transition': 'opacity '+$fpAnimationSpeed+'ms cubic-bezier(0.37, 0.31, 0.2, 0.85), transform '+$fpAnimationSpeed+'ms cubic-bezier(0.37, 0.31, 0.2, 0.85)', 'z-index': '100', 'will-change':'transform'});
2039		        			setTimeout(function() { 
2040		        				$indexRow.css({'transform': 'scale(0.77) translateZ(0)', 'opacity': '0'});
2041		        			}, 60);
2042
2043		        			$nextIndexRow.css({'z-index':'1000','top':'0','left':'0'});
2044		        			$nextIndexRowFpTable.css({'transform':'translateY(-100%) translateZ(0)', 'will-change':'transform'});
2045		        			$nextIndexRowInner.css({'transform':'translateY(50%) translateZ(0)', 'will-change':'transform'});
2046	        			} 
2047
2048	        		}
2049	        		
2050	        		setTimeout(function() { 
2051	    				$nextIndexRowFpTable.css({'transition':$transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1) 0ms', 'transform':'translateY(0%) translateZ(0)'});
2052	    				if($fpAnimation != 'none') { 
2053									$nextIndexRowInner.css({'transition':$transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1) 0ms', 'transform':'translateY(0%) translateZ(0)'});
2054									if(navigator.userAgent.indexOf('Firefox') != -1) {
2055										requestAnimationFrame(heyFirefoxDrawTheEl);
2056									}
2057							}
2058							
2059							
2060
2061							
2062	    			},60);
2063
2064	        	}
2065
2066	        	//adjust transform if larger than row height for parallax
2067	        	if($('#nectar_fullscreen_rows[data-animation="none"]').length == 0 && $nextIndexRow.find('.fp-scrollable').length > 0) {
2068	        		$nextIndexRow.find('.full-page-inner-wrap-outer').css('height',overallHeight);
2069						}
2070
2071	        	setTimeout(function() { 
2072	        		
2073	        		if( $row_id == 'footer-outer') {
2074
2075		        		$indexRow.css('transform','translateY(-'+($('#footer-outer').height()-1)+'px)');
2076
2077		        		$('#footer-outer').css({'transform': 'translateY(45%) translateZ(0)'});
2078		        		$('#footer-outer').css({'transition-duration': '0s', 'backface-visibility': 'hidden'});
2079		        		setTimeout(function() { 
2080		        			$('#footer-outer').css({'transition': $transformProp+' 500ms cubic-bezier(0.60, 0.23, 0.2, 
20800.93)', 'backface-visibility': 'hidden'});
2081	        				$('#footer-outer').css({'transform': 'translateY(0%) translateZ(0)'});
2082	        			},30);
2083		        	}
2084	        	},30);
2085
2086	        	if($row_id!='footer-outer') {
2087	        		
2088	        		stopMouseParallax();
2089
2090	        		//take care of nav/control coloring
2091	        		setFPNavColoring(nextIndex,direction);
2092							
2093							//handle main nav link highlight
2094							setTimeout(function(){
2095								FPActiveMenuItems(nextIndex);
2096							},50);
2097							
2098							
2099	        	}
2100	        		
2101	        },
2102
2103	        afterResize: function(){
2104	        	overallHeight = $('#nectar_fullscreen_rows').height();
2105	        	overallWidth = $(window).width();
2106	        	fullHeightRowOverflow();
2107	        	fullscreenElementSizing();
2108	        	fullscreenFooterCalcs();
2109
2110	        	if( $('#footer-outer.active').length > 0) {
2111	        		setTimeout(function(){
2112	        			$('.last-before-footer').css('transform','translateY(-'+$('#footer-outer').height()+'px)');
2113	        		},200);
2114		        } 
2115
2116		        //fix for svg animations when resizing and iscroll wraps/unwraps
2117		        clearTimeout($svgResizeTimeout);
2118		        $svgResizeTimeout = setTimeout(function(){ 
2119
2120		        	if($svg_icons.length > 0) {
2121			        	$('.svg-icon-holder.animated-in').each(function(i){
2122									$(this).css('opacity','1');
2123									$svg_icons[$(this).find('svg').attr('id').slice(-1)].finish();
2124								});
2125			        }
2126
2127		         },300);
2128	        }
2129
2130		});
2131	}
2132	
2133	if(window.vc_iframe) {
2134		
2135		//do nothing
2136	
2137	}	 else {
2138		if($('#nectar_fullscreen_rows').length > 0)
2139			initNectarFP();
2140	}
2141
2142
2143	$(window).smartresize(function(){
2144		
2145		if($('#nectar_fullscreen_rows').length > 0) {
2146			setTimeout(function(){
2147				$('.wpb_row:not(.last-before-footer) .fp-scrollable').each(function(){
2148					var $scrollable = $(this).data('iscrollInstance');
2149					$scrollable.refresh();
2150				});
2151			},200);
2152
2153			fullHeightRowOverflow();
2154
2155		}
2156	});
2157
2158	function fullscreenFooterCalcs() {
2159		if($('#footer-outer.active').length > 0) {
2160	    		$('.last-before-footer').addClass('fp-notransition').css('transform','translateY(-'+$('#footer-outer').height()+'px)');
2161	    		setTimeout(function(){
2162	    			$('.last-before-footer').removeClass('fp-notransition');
2163	    		},10);
2164	    	}
2165	}
2166
2167
2168
2169	function stopMouseParallax(){
2170		$.each($mouseParallaxScenes,function(k,v){
2171			v.parallax('disable');
2172		});
2173	}
2174
2175	function startMouseParallax(){
2176		if($('#nectar_fullscreen_rows > .wpb_row.active .nectar-parallax-scene').length > 0) {
2177			$.each($mouseParallaxScenes,function(k,v){
2178				v.parallax('enable');
2179			});
2180		}
2181	}
2182
2183	if($('#nectar_fullscreen_rows').length > 0) {
2184		
2185		if(window.vc_iframe) { 
2186			setTimeout(function(){
2187				setFPNavColoring(1,'na'); 
2188			},500);
2189		}
2190		else {
2191			setFPNavColoring(1,'na');
2192		}
2193		
2194		fullscreenElementSizing();
2195		
2196		//slide out right OCM material nav compat
2197		if($('body[data-slide-out-widget-area-style="slide-out-from-right"].material').length > 0) {
2198			$('#slide-out-widget-area .off-canvas-menu-container').find("a[href*='#']").on('click',function(e){
2199					
2200					var $link_hash = $(this).prop("hash");	
2201
2202					if($link_hash != '#' && $link_hash.indexOf("#") != -1 && $('div[data-fullscreen-anchor-id="'+$link_hash.substr($link_hash.indexOf("#")+1)+'"]').length > 0) {
2203						
2204							if($('body.material-ocm-open').length > 0) {
2205									
2206									$('body > .slide_out_area_close').addClass('non-human-allowed').trigger('click');
2207
2208									setTimeout(function(){
2209										$('body > .slide_out_area_close').removeClass('non-human-allowed');
2210									},100);
2211
2212							} 
2213							
2214					} // if a section has been found
2215					
2216			}); //click
2217		}
2218		
2219		
2220	}
2221	
2222	function FPActiveMenuItems(index) {
2223		
2224		if(!$('#nectar_fullscreen_rows[data-anchors="on"]').length > 0 || !index) return;
2225		
2226		var $hash = window.location.hash;
2227		var $hashSubstrng = ($hash && $hash.length > 0) ? $hash.substring(1,$hash.length) : '';
2228
2229		 if($('body:not(.mobile) #header-outer[data-has-menu="true"]').length > 0 && $('#nectar_fullscreen_rows > .wpb_row:nth-child('+index+')[data-fullscreen-anchor-id]').length > 0 && $('header#top nav > ul.sf-menu > li').find('> a[href$="#'+$hashSubstrng+'"]').length > 0 ) {
2230			  $('header#top nav > ul.sf-menu > li').removeClass('current-menu-item');
2231				$('header#top nav > ul.sf-menu > li').find('> a[href$="'+$hashSubstrng+'"]').parent().addClass('current-menu-item');
2232		 } 
2233	}
2234
2235	function resetWaypoints() {
2236		//animated columns / imgs
2237		$('img.img-with-animation.animated-in:not([data-animation="none"])').css({'transition':'none'});
2238		$('img.img-with-animation.animated-in:not([data-animation="none"])').css({'opacity':'0','transform':'none'}).removeClass('animated-in');
2239		$('.col.has-animation.animated-in:not([data-animation*="reveal"]), .wpb_column.has-animation.animated-in:not([data-animation*="reveal"])').css({'transition':'none'});
2240		$('.col.has-animation.animated-in:not([data-animation*="reveal"]), .wpb_column.has-animation.animated-in:not([data-animation*="reveal"]), .nectar_cascading_images .cascading-image:not([data-animation="none"]) .inner-wrap').css({'opacity':'0','transform':'none','left':'auto','right':'auto'}).removeClass('animated-in');	
2241		$('.col.has-animation.boxed:not([data-animation*="reveal"]), .wpb_column.has-animation.boxed:not([data-animation*="reveal"])').addClass('no-pointer-events');
2242		
2243		//row BG animations
2244		$('.row-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]):not([data-bg-animation*="displace-filter"]) .inner-wrap.using-image').removeClass('animated-in');
2245		$('.column-image-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]):not([data-bg-animation*="displace-filter"]) .inner-wrap').removeClass('animated-in');
2246		
2247		//reveal columns
2248		$('.wpb_column.has-animation[data-animation*="reveal"], .nectar_cascading_images').removeClass('animated-in');
2249		if(overallWidth > 1000 && $('.using-mobile-browser').length == 0) {
2250			$('.wpb_column.has-animation[data-animation="reveal-from-bottom"] > .column-inner-wrap').css({'transition':'none','transform':'translate(0, 100%)'});
2251			$('.wpb_column.has-animation[data-animation="reveal-from-bottom"] > .column-inner-wrap > .column-inner').css({'transition':'none','transform':'translate(0, -90%)'});
2252			$('.wpb_column.has-animation[data-animation="reveal-from-top"] > .column-inner-wrap').css({'transition':'none','transform':'translate(0, -100%)'});
2253			$('.wpb_column.has-animation[data-animation="reveal-from-top"] > .column-inner-wrap > .column-inner').css({'transition':'none','transform':'translate(0, 90%)'});
2254			$('.wpb_column.has-animation[data-animation="reveal-from-left"] > .column-inner-wrap').css({'transition-duration':'0s','transform':'translate(-100%, 0)'});
2255			$('.wpb_column.has-animation[data-animation="reveal-from-left"] > .column-inner-wrap > .column-inner').css({'transition-duration':'0s','transform':'translate(90%, 0)'});
2256			$('.wpb_column.has-animation[data-animation="reveal-from-right"] > .column-inner-wrap').css({'transition-duration':'0s','transform':'translate(100%, 0)'});
2257			$('.wpb_column.has-animation[data-animation="reveal-from-right"] > .column-inner-wrap > .column-inner').css({'transition-duration':'0s','transform':'translate(-90%, 0)'});
2258		}
2259		$('.wpb_column.has-animation[data-animation*="reveal"] > .column-inner-wrap, .wpb_column.has-animation[data-animation*="reveal"] > .column-inner-wrap > .column-inner').removeClass('no-transform');
2260
2261		//vcwaypoints
2262		$('.wpb_animate_when_almost_visible.animated').removeClass('wpb_start_animation').removeClass('animated');
2263
2264		//column borders
2265		$('.wpb_column[data-border-animation="true"] .border-wrap.animation').removeClass('animation').removeClass('completed');
2266
2267		//milestone
2268		$('.nectar-milestone.animated-in').removeClass('animated-in').removeClass('in-sight');
2269		$('.nectar-milestone .symbol').removeClass('in-sight');
2270
2271		//fancy ul
2272		$('.nectar-fancy-ul[data-animation="true"]').removeClass('animated-in');
2273		$('.nectar-fancy-ul[data-animation="true"] ul li').css({'opacity':'0','left':'-20px'});
2274
2275		//progress bars
2276		$('.nectar-progress-bar').parent().removeClass('completed');
2277		$('.nectar-progress-bar .bar-wrap > span').css({'width':'0px'});
2278		$('.nectar-progress-bar .bar-wrap > span > strong').css({'opacity':'0'});
2279		//$('.nectar-progress-bar .bar-wrap').css({'opacity':'0'});
2280
2281		//clients
2282		$('.clients.fade-in-animation').removeClass('animated-in');
2283		$('.clients.fade-in-animation > div').css('opacity','0');
2284
2285		//carousel
2286		$('.owl-carousel[data-enable-animation="true"]').removeClass('animated-in');
2287		$('.owl-carousel[data-enable-animation="true"] .owl-stage > .owl-item').css({'transition':'none','opacity':'0','transform':'translate(0, 70px)'});
2288		//dividers
2289		$('.divider-small-border[data-animate="yes"], .divider-border[data-animate="yes"]').removeClass('completed').css({'transition':'none','transform':'scale(0,1)'});
2290
2291		//icon list
2292		$('.nectar-icon-list').removeClass('completed');
2293		$('.nectar-icon-list-item').removeClass('animated');
2294
2295		//portfolio
2296		$('.portfolio-items .col').removeClass('animated-in');
2297
2298		//split line
2299		$('.nectar-split-heading').removeClass('animated-in');
2300		$('.nectar-split-heading .heading-line > div').transit({'y':'200%'},0);
2301
2302		//image with hotspots
2303		$('.nectar_image_with_hotspots[data-animation="true"]').removeClass('completed');
2304		$('.nectar_image_with_hotspots[data-animation="true"] .nectar_hotspot_wrap').removeClass('animated-in');
2305
2306		//animated titles
2307		$('.nectar-animated-title').removeClass('completed');
2308		
2309		//highlighted text
2310		$('.nectar-highlighted-text em').removeClass('animated');
2311
2312		if($('.vc_pie_chart').length > 0) {
2313			vc_pieChart();
2314		}
2315
2316		$('.col.has-animation:not([data-animation*="reveal"]), .wpb_column.has-animation:not([data-animation*="reveal"])').each(function(i) {
2317		   	//clear previous timeout (needed for fullscreen rows)
2318			clearTimeout($standAnimatedColTimeout[i]); 
2319		});
2320
2321	}
2322
2323	
2324
2325} else if($('#nectar_fullscreen_rows').length > 0 && $disableFPonMobile == 'on' || $().fullpage && $disableFPonMobile == 'on') {
2326
2327	//remove markup
2328	$('html,body').css({'height':'auto','overflow-y':'auto'});
2329}
2330
2331
2332function nectarLiquidBGFP(){
2333	
2334	$('.nectar-liquid-bg').removeClass('animated-in');
2335	
2336	for(var k=0; k<$liquidBG_EL.length;k++) {
2337		if($liquidBG_EL[k].animationType == 'displace-filter-fade' && $($liquidBG_EL[k].canvasContainer).parents('.fp-section.active').length > 0) {
2338			
2339			//add bg to container
2340			if($($liquidBG_EL[k].canvasContainer).find('.image-added-to-stage').length == 0) {
2341				$liquidBG_EL[k].imgContainer.addChild( $liquidBG_EL[k].bg );
2342			}
2343			$($liquidBG_EL[k].canvasContainer).find('.nectar-liquid-bg').addClass('image-added-to-stage');
2344			
2345			$liquidBG_EL[k].animateProps($liquidBG_EL[k]);
2346
2347		}
2348	}
2349}
2350
2351
2352/***************** Superfish ******************/
2353	
2354	function initSF(){
2355
2356		if($('body[data-header-format="left-header"]').length == 0) {
2357
2358
2359			var $disableHI = ($('body[data-dropdown-style="minimal"]').length > 0 && !($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0) ) ? true : false;
2360
2361			$(".sf-menu").superfish({
2362				 delay: 650,
2363				 speed: 'fast',
2364				 disableHI: $disableHI,
2365				 speedOut:      'fast',             
2366				 animation:   {opacity:'show'}
2367			}); 
2368
2369			//handle initial show on left class for minimal styling
2370			$('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function(){
2371				
2372				if($(this).offset().left + $(this).outerWidth() > $(window).width()) {
2373					$(this).addClass('on-left-side');
2374					$(this).find('ul').addClass('on-left-side');
2375				} 
2376				
2377			});
2378			
2379
2380			//megamenu multi section per column title support
2381			$('body:not([data-header-format="left-header"]) header#top nav > ul > li.megamenu > ul > li > ul > li:has("> ul")').addClass('has-ul'); 
2382
2383			//fullwidth megamenu
2384			if($('body[data-megamenu-width="full-width"]').length > 0 && $('ul.sub-menu').length > 0) {
2385				megamenuFullwidth();
2386				$(window).on('smartresize',megamenuFullwidth);
2387				$('header#top nav > ul > li.megamenu > .sub-menu').css('box-sizing','content-box');
2388			}
2389
2390			//extra hover class for megamenu check
2391			$('header#top nav > ul.sf-menu > li').on('mouseenter',function(){
2392				$(this).addClass('menu-item-over');
2393			});
2394			$('header#top nav > ul.sf-menu > li').on('mouseleave',function(){
2395				$(this).removeClass('menu-item-over');
2396			});
2397
2398			//remove arrows on mega menu item
2399			$('header#top nav .megamenu .sub-menu a.sf-with-ul .sf-sub-indicator, header#top .megamenu .sub-menu a .sf-sub-indicator').remove();
2400
2401			//blank title megamenu columns
2402			////desktop
2403			$('header#top nav > ul > li.megamenu > ul.sub-menu > li > a').each(function(){
2404				if( $(this).text() == '–' ) {
2405					$(this).remove();
2406				}
2407			});
2408
2409		
2410		}
2411		
2412	}
2413
2414	
2415	function megamenuFullwidth() {
2416		var $windowWidth = $(window).width();
2417		var $headerContainerWidth = $('header#top > .container').width();
2418		$('header#top nav > ul > li.megamenu > .sub-menu').css({
2419			'padding-left' : ($windowWidth - $headerContainerWidth)/2 + 'px',
2420			'padding-right' : ($windowWidth+2 - $headerContainerWidth)/2 + 'px',
2421			'width' : $headerContainerWidth,
2422			'left' : '-' + ($windowWidth - $headerContainerWidth)/2 + 'px'
2423		});
2424	}
2425	
2426	var $navLeave;
2427	
2428	function addOrRemoveSF(){
2429		
2430		if( window.innerWidth < 1000 && $('body').attr('data-responsive') == '1'){
2431			$('body').addClass('mobile');
2432			$('header#top nav').css('display','none');
2433		}
2434		
2435		else {
2436			$('body').removeClass('mobile');
2437			$('header#top nav').css('display','');
2438			$('#mobile-menu').hide();
2439			$('.slide-out-widget-area-toggle #toggle-nav .lines-button').removeClass('close');
2440			
2441			//recalc height of dropdown arrow
2442			$('.sf-sub-indicator').css('height',$('a.sf-with-ul').height());
2443		}
2444
2445		//add specific class if on device for better tablet tracking
2446		if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) { $('body').addClass('using-mobile-browser'); }
2447
2448	}
2449
2450	function showOnLeftSubMenu() {
2451		//show on left class for minimal styling
2452		$('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function(){
2453			
2454			$(this).removeClass('on-left-side');
2455
2456			if($(this).offset().left + $(this).outerWidth() > $(window).width()) {
2457				$(this).addClass('on-left-side');
2458				$(this).find('ul').addClass('on-left-side');
2459			} else {
2460				$(this).removeClass('on-left-side');
2461				$(this).find('ul').removeClass('on-left-side');
2462			}
2463			
2464		});
2465	}
2466	
2467	addOrRemoveSF();
2468	initSF();
2469	
2470	$(window).resize(addOrRemoveSF);
2471
2472	
2473	function SFArrows(){
2474
2475		//set height of dropdown arrow
2476		$('.sf-sub-indicator').css('height',$('a.sf-with-ul').height());
2477	}
2478	
2479	SFArrows();
2480	
2481
2482	//deactivate hhun on phone
2483	if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/))
2484		$('body').attr('data-hhun','0');
2485
2486
2487/***************** Caroufredsel ******************/
2488	
2489	function standardCarouselInit() {
2490		$('ul.carousel:not(".clients")').each(function(){
2491	    	var $that = $(this); 
2492	    	var maxCols = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 'auto' : 3 ;
2493	    	var scrollNum = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 'auto' : '' ;
2494	    	var colWidth = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 500 : 453 ;
2495	    	var scrollSpeed, easing;
2496	    	var $autoplayBool = ($(this).attr('data-autorotate') == 'true') ? true : false;
2497			
2498			if($('body.ascend').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true' || $('body.material').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true') {
2499				if($(this).find('li').length % 3 === 0) {
2500					var $themeSkin = true;
2501					var $themeSkin2 = true;
2502				} else {
2503					var $themeSkin = false;
2504					var $themeSkin2 = true;
2505				}
2506	
2507			} else {
2508				var $themeSkin = true;
2509				var $themeSkin2 = true;
2510			}
2511
2512			(parseInt($(this).attr('data-scroll-speed'))) ? scrollSpeed = parseInt($(this).attr('data-scroll-speed')) : scrollSpeed = 700;
2513			($(this).is('[data-easing]')) ? easing = $(this).attr('data-easing') : easing = 'linear';
2514			
2515			
2516			var $element = $that;
2517			if($that.find('img').length == 0) $element = $('body');
2518			
2519			imagesLoaded($element,function(instance){
2520	
2521				
2522		    	$that.carouFredSel({
2523		    		circular: $themeSkin,
2524		    		infinite: $themeSkin2,
2525		    		height : 'auto',
2526		    		responsive: true,
2527			        items       : {
2528						width : colWidth,
2529				        visible     : {
2530				            min         : 1,
2531				            max         : maxCols
2532				        }
2533				    },
2534				    swipe       : {
2535				        onTouch     : true,
2536				        onMouse         : true,
2537				        options      : {
2538				        	excludedElements: "button, input, select, textarea, .noSwipe",
2539				        	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'); }
2540				        },
2541				        onBefore : function(){
2542				    		//hover effect fix
2543				    		$that.find('.work-item').trigger('mouseleave');
2544				    		$that.find('.work-item .work-info a').trigger('mouseup');
2545				    	}
2546				    },
2547				    scroll: {
2548				    	items			: scrollNum,
2549				    	easing          : easing,
2550			            duration        : scrollSpeed,
2551			            onBefore	: function( data ) {
2552			            	
2553			            	 if($('body.ascend').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true' || $('body.material').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true') {
2554			            	 	$that.parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($that.find('> li').length / $that.triggerHandler("currentVisible").length));
2555
2556			            	 }	
2557						},
2558						onAfter	: function( data ) {
2559			            	 if($('body.ascend').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true' || $('body.material').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true') {
2560			            	 	$that.parents('.carousel-wrap').find('.item-count .current').html( $that.triggerHandler('currentPage') +1);
2561			            	 	$that.parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($that.find('> li').length / $that.triggerHandler("currentVisible").length));
2562
2563			            	 }	
2564						}
2565
2566				    },
2567			        prev    : {
2568				        button  : function() {
2569				           return $that.parents('.carousel-wrap').find('.carousel-prev');
2570				        }
2571			    	},
2572				    next    : {
2573			       		button  : function() {
2574				           return $that.parents('.carousel-wrap').find('.carousel-next');
2575				        }
2576				    },
2577				    auto    : {
2578				    	play: $autoplayBool
2579				    }
2580			    }, { transition: true }).animate({'opacity': 1},1300);
2581			    
2582			    $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">');
2583
2584			    if($that.parents('.carousel-wrap').attr('data-full-width') == 'true') $that.parents('.carousel-outer').css('overflow','visible');
2585
2586			    //add count for non full width ascend skin
2587			    if($('body.ascend').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true' || $('body.material').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true') {
2588					$('<div class="item-count"><span class="current">1</span>/<span class="total">'+($that.find('> li').length / $that.triggerHandler("currentVisible").length) +'</span></div>').insertAfter($that.parents('.carousel-wrap').find('.carousel-prev'));
2589				}
2590			    
2591			    $that.addClass('finished-loading');
2592
2593			    carouselHeightCalcs();
2594
2595		     });//images loaded
2596		     	     
2597	    });//each
2598
2599		
2600    }
2601    if($('.carousel').length > 0) standardCarouselInit();
2602
2603
2604    function owlCarouselInit() {
2605    	//owl
2606		$('.owl-carousel').each(function(){
2607			
2608			$(this).addClass('owl-theme'); //new version removed this
2609			
2610			var $that = $(this);
2611			var $stagePadding = ($(window).width()<1000) ? 0 : parseInt($(this).attr('data-column-p
2611adding'));
2612			var $autoRotateBool = $that.attr('data-autorotate');
2613			var $autoRotateSpeed = $that.attr('data-autorotation-speed');
2614			var $owlLoopBool = ($that.is('[data-loop="true"]')) ? true : false;
2615			
2616			$(this).owlCarousel({
2617			      responsive:{
2618				        0:{
2619				            items: $(this).attr('data-mobile-cols')
2620				        },
2621				        690:{
2622				            items: $(this).attr('data-tablet-cols')
2623				        },
2624				        1000:{
2625				          items: $(this).attr('data-desktop-small-cols')
2626				        },
2627				        1300:{
2628				            items: $(this).attr('data-desktop-cols')
2629				        }
2630				    },
2631			      /*stagePadding: $stagePadding,*/
2632			      autoplay: $autoRotateBool,
2633			      autoplayTimeout: $autoRotateSpeed,
2634						loop: $owlLoopBool,
2635						smartSpeed: 350,
2636			      onTranslate: function(){
2637			      	$that.addClass('moving');
2638			      },
2639			      onTranslated: function(){
2640			      	$that.removeClass('moving');
2641			      }
2642
2643			  });
2644
2645			$(this).on('changed.owl.carousel', function (event) {
2646			    if (event.item.count - event.page.size == event.item.index)
2647			        $(event.target).find('.owl-dots div:last')
2648			          .addClass('active').siblings().removeClass('active');
2649			});	
2650
2651		});	
2652
2653
2654    }
2655
2656
2657
2658	function owl_carousel_animate() {
2659		$($fullscreenSelector+'.owl-carousel[data-enable-animation="true"]').each(function(){
2660
2661			$owlOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
2662
2663			var $animationDelay = ($(this).is('[data-animation-delay]') && $(this).attr('data-animation-delay').length > 0 && $(this).attr('data-animation') != 'false') ? $(this).attr('data-animation-delay') : 0;
2664
2665			var $that = $(this);
2666			var waypoint = new Waypoint({
2667	 			element: $that,
2668	 			 handler: function(direction) {
2669
2670	 			 	if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
2671					     waypoint.destroy();
2672					     return;
2673					}
2674
2675					setTimeout(function(){
2676		 			 	$that.find('.owl-stage > .owl-item').each(function(i){
2677		 			 		var $that = $(this);
2678							$that.delay(i*200).transition({
2679								'opacity': '1',
2680								'y' : '0'
2681							},600,'easeOutQuart');
2682						});
2683						$that.addClass('animated-in');
2684		 			 },$animationDelay);
2685
2686					waypoint.destroy();
2687				},
2688				offset: $owlOffsetPos
2689
2690			}); 
2691
2692		});
2693	}
2694
2695
2696
2697
2698    function productCarouselInit() {
2699		$('.products-carousel').each(function(){
2700	    	var $that = $(this).find('ul'); 
2701	    	var maxCols = 'auto';
2702	    	var scrollNum = 'auto';
2703	    	var colWidth = ($(this).parents('.full-width-content ').length > 0) ? 400 : 353 ;
2704			var scrollSpeed = 800;
2705			var easing = 'easeInOutQuart';
2706			
2707			
2708			var $element = $that;
2709			if($that.find('img').length == 0) $element = $('body');
2710			
2711			//controls on hover
2712			$(this).append('<a class="carousel-prev" href="#"><i class="icon-salient-left-arrow"></i></a> <a class="carousel-next" href="#"><i class="icon-salient-right-arrow"></i></a>')
2713
2714			imagesLoaded($element,function(instance){
2715	
2716				
2717		    	$that.carouFredSel({
2718		    		circular: true,
2719		    		responsive: true,
2720			        items       : {
2721						width : colWidth,
2722				        visible     : {
2723				            min         : 1,
2724				            max         : maxCols
2725				        }
2726				    },
2727				    swipe       : {
2728				        onTouch     : true,
2729				        onMouse         : true,
2730				        options      : {
2731				        	excludedElements: "button, input, select, textarea, .noSwipe",
2732				        	tap: function(event, target){ 
2733				        		if($(target).attr('href') && !$(target).is('[target="_blank"]') && !$(target).hasClass('add_to_wishlist') && !$(target).hasClass('add_to_cart_button') && !$(target).is('[rel^="prettyPhoto"]')) 
2734				        			window.open($(target).attr('href'), '_self'); 
2735				        		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"]')) 
2736				        			window.open($(target).parent().attr('href'), '_self'); 
2737				        	}
2738				        },
2739				        onBefore : function(){
2740				    		//hover effect fix
2741				    		$that.find('.product-wrap').trigger('mouseleave');
2742				    		$that.find('.product a').trigger('mouseup');
2743				    	}
2744				    },
2745				    scroll: {
2746				    	items			: scrollNum,
2747				    	easing          : easing,
2748			            duration        : scrollSpeed
2749				    },
2750			        prev    : {
2751				        button  : function() {
2752				           return $that.parents('.carousel-wrap').find('.carousel-prev');
2753				        }
2754			    	},
2755				    next    : {
2756			       		button  : function() {
2757				           return $that.parents('.carousel-wrap').find('.carousel-next');
2758				        }
2759				    },
2760				    auto    : {
2761				    	play: false
2762				    }
2763			    }).animate({'opacity': 1},1300);
2764			    
2765			    $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">');
2766			    
2767			    $that.addClass('finished-loading');
2768			    fullWidthContentColumns();
2769			    $(window).trigger('resize');
2770
2771		     });//images loaded
2772				 
2773		     	     
2774	    });//each
2775			
2776			
2777			
2778		
2779			$wooFlickityCarousels = [];
2780			$('.nectar-woo-flickity').each(function(i){
2781				
2782				var $that = $(this);
2783
2784				$(this).find('.products > li').each(function(){
2785					$(this).wrap('<div class="flickity-cell"></div>');
2786				});
2787				
2788				fullWidthSections();
2789				
2790				var pageDotsBool = ($that.is('[data-controls="bottom-pagination"]')) ? true : false;
2791				var arrowsBool = ($that.is('[data-controls="bottom-pagination"]')) ? false : true;
2792				var $autoplay = ( $that.is('[data-autorotate-speed]') && parseInt( $that.attr('data-autorotate-speed') ) > 800) ? parseInt($that.attr('data-autorotate-speed')) : 5000;
2793				if(!$that.is('[data-autorotate="true"]')) { $autoplay = false; }
2794				
2795				$(this).find('ul').addClass('generate-markup');
2796				
2797				$wooFlickityCarousels[i] = $(this).find('ul');
2798				
2799				if(arrowsBool == true) {
2800					$wooFlickityCarousels[i].on( 'ready.flickity', function() {
2801						var flickityPrv = $that.find('.flickity-prev-next-button.previous').detach();
2802	 				  var flickityNxt = $that.find('.flickity-prev-next-button.next').detach();
2803						
2804						$that.find('.nectar-woo-carousel-top').append(flickityPrv).append(flickityNxt);
2805				  });
2806				}
2807				
2808				$wooFlickityCarousels[i].flickity({
2809					 draggable: true,
2810					 lazyLoad: false,
2811					 imagesLoaded: true,
2812					 cellAlign: 'left',
2813					 groupCells: pageDotsBool,
2814					 prevNextButtons: arrowsBool,
2815					 pageDots: pageDotsBool,
2816					 resize: true,
2817					 percentPosition: true,
2818					 setGallerySize: true,
2819					 wrapAround: true,
2820					 autoPlay: $autoplay,
2821					 accessibility: false
2822				 });
2823				 
2824				 
2825				 //mobile pagination numbers
2826				 if(arrowsBool == true) {
2827					 
2828					 	$that.find('.flickity-prev-next-button').append('<svg width="65px" height="65px" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg"><circle stroke-width="3" fill="none" stroke-linecap="round" cx="33" cy="33" r="28"></circle> <circle class="time" stroke-width="3" fill="none" stroke-linecap="round" cx="33" cy="33" r="28"></circle></svg>');
2829					 
2830						var $wooFlickityCount = $('<div class="woo-flickity-count" />');
2831						$that.append($wooFlickityCount);
2832						var $wooFlickityData = $wooFlickityCarousels[i].data('flickity');
2833						
2834						function updateWooFlickityCount() {
2835						  var slideNumber = $wooFlickityData.selectedIndex + 1;
2836						  $wooFlickityCount.text( slideNumber + '/' + $wooFlickityData.slides.length );
2837						}
2838						updateWooFlickityCount();
2839						$wooFlickityCarousels[i].on( 'select.flickity', updateWooFlickityCount );
2840				 }
2841				 
2842
2843				
2844			});
2845			
2846			
2847    }
2848		
2849    if($('.products-carousel').length > 0 || $('.nectar-woo-flickity').length > 0) { productCarouselInit(); }
2850
2851
2852
2853
2854    
2855    //fullwidth carousel swipe link fix
2856    function fwCarouselLinkFix() {
2857	    var $mousePosStart = 0;
2858	    var $mousePosEnd = 0;
2859	    $('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mousedown(function(e){
2860	    	$mousePosStart = e.clientX;
2861	    });
2862	    
2863	    $('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mouseup(function(e){
2864	    	$mousePosEnd = e.clientX;
2865	    });
2866	    
2867	    $('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').click(function(e){
2868	    	if(Math.abs($mousePosStart - $mousePosEnd) > 10)  return false;
2869	    });
2870	}
2871	fwCarouselLinkFix();
2872    
2873     
2874	function carouselHeightCalcs(){
2875		
2876		//recent work carousel
2877		$('.carousel.portfolio-items.finished-loading').each(function(){
2878
2879			var bottomSpace = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true' && $(this).find('.style-2, .style-3, .style-4').length > 0) ? 0 : 28 ;
2880			
2881			var tallestMeta = 0;
2882			
2883			$(this).find('> li').each(function(){
2884				($(this).find('.work-meta').height() > tallestMeta) ? tallestMeta = $(this).find('.work-meta').height() : tallestMeta = tallestMeta;
2885			});	
2886    	 
2887     		$(this).parents('.caroufredsel_wrapper').css({
2888     			'height' : ($(this).find('.work-item').outerHeight() + tallestMeta + bottomSpace -2) + 'px'
2889     		});
2890
2891     		 if($('body.ascend').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true' || $('body.material').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true') {
2892        	 	$(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler("currentPosition")+1)/$(this).triggerHandler("currentVisible").length));
2893        	 	$(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('> li').length / $(this).triggerHandler("currentVisible").length));
2894        	 }	
2895   	  	});
2896   	  	
2897   	  	//standard carousel
2898   	  	$('.carousel.finished-loading:not(".portfolio-items, .clients"), .caroufredsel_wrapper .products.finished-loading').each(function(){
2899			
2900			var tallestColumn = 0;
2901			
2902			$(this).find('> li').each(function(){
2903				($(this).height() > tallestColumn) ? tallestColumn = $(this).height() : tallestColumn = tallestColumn;
2904			});	
2905
2906         	$(this).css('height',tallestColumn + 5);
2907         	$(this).parents('.caroufredsel_wrapper').css('height',tallestColumn + 5);
2908
2909         	 if($('body.ascend').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true' || $('body.material').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true') {
2910        	 	$(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler("currentPosition")+1)/$(this).triggerHandler("currentVisible").length));
2911        	 	$(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('> li').length / $(this).triggerHandler("currentVisible").length));
2912        	 }	
2913			
2914   	  	});
2915   	  	
2916	}
2917
2918
2919	function clientsCarouselInit(){
2920	     $('.carousel.clients').each(function(){
2921	    	var $that = $(this);
2922	    	var columns; 
2923	    	var $autoRotate = (!$(this).hasClass('disable-autorotate')) ? true : false;
2924	    	(parseInt($(this).attr('data-max'))) ? columns = parseInt($(this).attr('data-max')) : columns = 5;
2925	    	if($(window).width() < 690 && $('body').attr('data-responsive') == '1') { columns = 2; $(this).addClass('phone') }
2926	    	
2927	    	var $element = $that;
2928			if($that.find('img').length == 0) $element = $('body');
2929			
2930			imagesLoaded($element,function(instance){
2931	    		
2932		    	$that.carouFredSel({
2933			    		circular: true,
2934			    		responsive: true, 
2935				        items       : {
2936							
2937							height : $that.find('> div:first').height(),
2938							width  : $that.find('> div:first').width(),
2939					        visible     : {
2940					            min         : 1,
2941					            max         : columns
2942					        }
2943					    },
2944					    swipe       : {
2945					        onTouch     : true,
2946					        onMouse         : true
2947					    },
2948					    scroll: {
2949					    	items           : 1,
2950					    	easing          : 'easeInOutCubic',
2951				            duration        : '800',
2952				            pauseOnHover    : true
2953					    },
2954					    auto    : {
2955					    	play            : $autoRotate,
2956					    	timeoutDuration : 2700
2957					    }
2958			    }).animate({'opacity': 1},1300);
2959			    
2960			    $that.addClass('finished-loading');
2961
2962			    $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">');
2963			     
2964
2965			    $(window).trigger('resize');
2966			    
2967		    
2968		    });
2969	
2970	    });
2971    }
2972   if($('.carousel').length > 0)  clientsCarouselInit();
2973    
2974
2975    function clientsCarouselHeightRecalc(){
2976
2977    	var tallestImage = 0;
2978		  			
2979    	 $('.carousel.clients.finished-loading').each(function(){
2980    	 	
2981    	 	$(this).find('> div').each(function(){
2982				($(this).height() > tallestImage) ? tallestImage = $(this).height() : tallestImage = tallestImage;
2983			});	
2984    	 	
2985         	$(this).css('height',tallestImage);
2986         	$(this).parent().css('height',tallestImage);
2987         });
2988    }
2989
2990
2991    //carousel grabbing class
2992    function carouselfGrabbingClass() {
2993	    $('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(){
2994	    	$(this).addClass('active');
2995	    });
2996	    
2997	    $('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(){
2998	    	$(this).removeClass('active');
2999	    });
3000	}
3001	carouselfGrabbingClass();
3002	    
3003
3004	//ascend arrow hover class
3005	$('body.ascend, body.material').on('mouseover','.carousel-next',function(){
3006		$(this).parent().find('.carousel-prev, .item-count').addClass('next-hovered');
3007	});
3008	$('body.ascend, body.material').on('mouseleave','.carousel-next',function(){
3009		$(this).parent().find('.carousel-prev, .item-count').removeClass('next-hovered');
3010	});
3011
3012	//fadein for clients / carousels
3013	function clientsFadeIn() {
3014
3015		var $clientsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? 100: 'bottom-in-view';
3016		$($fullscreenSelector+'.clients.fade-in-animation').each(function() {
3017
3018			var $that = $(this);
3019			var waypoint = new Waypoint({
3020 			element: $that,
3021 			 handler: function(direction) {
3022				
3023				if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
3024					 waypoint.destroy();
3025					return;
3026				}
3027
3028				 $that.find('> div').each(function(i){
3029					$(this).delay(i*80).transition({'opacity':"1"},450);
3030				});
3031				
3032				
3033				//add the css transition class back in after the aniamtion is done
3034				setTimeout(function(){ $that.addClass('completed'); },($that.find('> div').length*80) + 450);
3035			
3036
3037				$that.addClass('animated-in');
3038				waypoint.destroy();
3039			},
3040			offset: $clientsOffsetPos
3041
3042			}); 
3043		}); 
3044	}
3045	 
3046	//if($('.nectar-box-roll').length == 0) clientsFadeIn();
3047	
3048	
3049/*-------------------------------------------------------------------------*/
3050/*	2.	Helper Functions
3051/*-------------------------------------------------------------------------*/
3052
3053	jQuery.fn.setCursorPosition = function(position){
3054		
3055	    if(this.length == 0) { 
3056				return this; 
3057			}
3058	    return $(this).setSelection(position, position);
3059	}
3060	
3061	jQuery.fn.setSelection = function(selectionStart, selectionEnd) {
3062	    if(this.length == 0) { 
3063				return this;
3064			}
3065	    input = this[0];
3066	
3067	    if (input.createTextRange) {
3068	        var range = input.createTextRange();
3069	        range.collapse(true);
3070	        range.moveEnd('character', selectionEnd);
3071	        range.moveStart('character', selectionStart);
3072	        range.select();
3073	    } else if (input.setSelectionRange) {
3074	        input.focus();
3075	        input.setSelectionRange(selectionStart, selectionEnd);
3076	    }
3077	
3078	    return this;
3079	}
3080	
3081	
3082
3083	$.extend($.expr[':'], {
3084	    transparent: function(elem, i, attr){
3085	      return( $(elem).css("opacity") === "0" );
3086	    }
3087	});
3088	
3089
3090	function getQueryParams(qs) {
3091	    qs = qs.split("+").join(" ");
3092	    var params = {},
3093	        tokens,
3094	        re = /[?&]?([^=]+)=([^&]*)/g;
3095
3096	    while (tokens = re.exec(qs)) {
3097	        params[decodeURIComponent(tokens[1])]
3098	            = decodeURIComponent(tokens[2]);
3099	    }
3100
3101	    return params;
3102	}
3103
3104	var $_GET = getQueryParams(document.location.search);
3105
3106	
3107	//count
3108	var CountUp = function(target, startVal, endVal, decimals, duration, options) {
3109
3110    // make sure requestAnimationFrame and cancelAnimationFrame are defined
3111    // polyfill for browsers without native support
3112    // by Opera engineer Erik Möller
3113    var lastTime = 0;
3114    var vendors = ['webkit', 'moz', 'ms', 'o'];
3115    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
3116        window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
3117        window.cancelAnimationFrame =
3118          window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame'];
3119    }
3120    if (!window.requestAnimationFrame) {
3121        window.requestAnimationFrame = function(callback, element) {
3122            var currTime = new Date().getTime();
3123            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
3124            var id = window.setTimeout(function() { callback(currTime + timeToCall); },
3125              timeToCall);
3126            lastTime = currTime + timeToCall;
3127            return id;
3128        };
3129    }
3130    if (!window.cancelAnimationFrame) {
3131        window.cancelAnimationFrame = function(id) {
3132            clearTimeout(id);
3133        };
3134    }
3135
3136    var self = this;
3137
3138     // default options
3139    self.options = {
3140        useEasing : true, // toggle easing
3141        useGrouping : true, // 1,000,000 vs 1000000
3142        separator : ',', // character to use as a separator
3143        decimal : '.', // character to use as a decimal
3144        easingFn: null, // optional custom easing closure function, default is Robert Penner's easeOutExpo
vendor: 4,251 bytes, lines 3145-3261
3145        formattingFn: null // optional custom formatting function, default is self.formatNumber below
3146    };
3147    // extend default options with passed options object
3148    for (var key in options) {
3149        if (options.hasOwnProperty(key)) {
3150            self.options[key] = options[key];
3151        }
3152    }
3153    if (self.options.separator === '') { self.options.useGrouping = false; }
3154    if (!self.options.prefix) self.options.prefix = '';
3155    if (!self.options.suffix) self.options.suffix = '';
3156
3157    self.d = (typeof target === 'string') ? document.getElementById(target) : target;
3158    self.startVal = Number(startVal);
3159    self.endVal = Number(endVal);
3160    self.countDown = (self.startVal > self.endVal);
3161    self.frameVal = self.startVal;
3162    self.decimals = Math.max(0, decimals || 0);
3163    self.dec = Math.pow(10, self.decimals);
3164    self.duration = Number(duration) * 1000 || 2000;
3165
3166    self.formatNumber = function(nStr) {
3167        nStr = nStr.toFixed(self.decimals);
3168        nStr += '';
3169        var x, x1, x2, rgx;
3170        x = nStr.split('.');
3171        x1 = x[0];
3172        x2 = x.length > 1 ? self.options.decimal + x[1] : '';
3173        rgx = /(\d+)(\d{3})/;
3174        if (self.options.useGrouping) {
3175            while (rgx.test(x1)) {
3176                x1 = x1.replace(rgx, '$1' + self.options.separator + '$2');
3177            }
3178        }
3179        return self.options.prefix + x1 + x2 + self.options.suffix;
3180    };
3181    // Robert Penner's easeOutExpo
3182    self.easeOutExpo = function(t, b, c, d) {
3183        return c * (-Math.pow(2, -10 * t / d) + 1) * 1024 / 1023 + b;
3184    };
3185
3186    self.easingFn = self.options.easingFn ? self.options.easingFn : self.easeOutExpo;
3187    self.formattingFn = self.options.formattingFn ? self.options.formattingFn : self.formatNumber;
3188
3189    self.version = function () { return '1.7.1'; };
3190
3191    // Print value to target
3192    self.printValue = function(value) {
3193        var result = self.formattingFn(value);
3194
3195        if (self.d.tagName === 'INPUT') {
3196            this.d.value = result;
3197        }
3198        else if (self.d.tagName === 'text' || self.d.tagName === 'tspan') {
3199            this.d.textContent = result;
3200        }
3201        else {
3202            this.d.innerHTML = result;
3203        }
3204    };
3205
3206    self.count = function(timestamp) {
3207
3208        if (!self.startTime) { self.startTime = timestamp; }
3209
3210        self.timestamp = timestamp;
3211        var progress = timestamp - self.startTime;
3212        self.remaining = self.duration - progress;
3213
3214        // to ease or not to ease
3215        if (self.options.useEasing) {
3216            if (self.countDown) {
3217                self.frameVal = self.startVal - self.easingFn(progress, 0, self.startVal - self.endVal, self.duration);
3218            } else {
3219                self.frameVal = self.easingFn(progress, self.startVal, self.endVal - self.startVal, self.duration);
3220            }
3221        } else {
3222            if (self.countDown) {
3223                self.frameVal = self.startVal - ((self.startVal - self.endVal) * (progress / self.duration));
3224            } else {
3225                self.frameVal = self.startVal + (self.endVal - self.startVal) * (progress / self.duration);
3226            }
3227        }
3228
3229        // don't go past endVal since progress can exceed duration in the last frame
3230        if (self.countDown) {
3231            self.frameVal = (self.frameVal < self.endVal) ? self.endVal : self.frameVal;
3232        } else {
3233            self.frameVal = (self.frameVal > self.endVal) ? self.endVal : self.frameVal;
3234        }
3235
3236        // decimal
3237        self.frameVal = Math.round(self.frameVal*self.dec)/self.dec;
3238
3239        // format and print value
3240        self.printValue(self.frameVal);
3241
3242        // whether to continue
3243        if (progress < self.duration) {
3244            self.rAF = requestAnimationFrame(self.count);
3245        } else {
3246            if (self.callback) { self.callback(); }
3247        }
3248    };
3249    // start your animation
3250    self.start = function(callback) {
3251        self.callback = callback;
3252        self.rAF = requestAnimationFrame(self.count);
3253        return false;
3254    };
3255    // toggles pause/resume animation
3256    self.pauseResume = function() {
3257        if (!self.paused) {
3258            self.paused = true;
3259            cancelAnimationFrame(self.rAF);
3260        } else {
3261            self.paused = false;
3262            delete self.startTime;
3263            self.duration = self.remaining;
3264            self.startVal = self.frameVal;
3265            requestAnimationFrame(self.count);
3266        }
3267    };
3268    // reset to startVal so animation can be run again
3269    self.reset = function() {
3270        self.paused = false;
3271        delete self.startTime;
3272        self.startVal = startVal;
3273        cancelAnimationFrame(self.rAF);
3274        self.printValue(self.startVal);
3275    };
3276    // pass a new endVal and start animation
3277    self.update = function (newEndVal) {
3278        cancelAnimationFrame(self.rAF);
3279        self.paused = false;
3280        delete self.startTime;
3281        self.startVal = self.frameVal;
3282        self.endVal = Number(newEndVal);
3283        self.countDown = (self.startVal > self.endVal);
3284        self.rAF = requestAnimationFrame(self.count);
3285    };
3286
3287    // format startVal on initialization
3288    self.printValue(self.startVal);
3289};
3290	
3291var easeOutCubic = function(t, b, c, d) {
3292    return c*((t=t/d-1)*t*t + 1) + b;
3293};	
3294	
3295	
3296/*-------------------------------------------------------------------------*/
3297/*	3.	Shortcode Stuff
3298/*-------------------------------------------------------------------------*/
3299
3300
3301function vcWaypoints() {
3302	$($fullscreenSelector+' .wpb_animate_when_almost_visible').each(function() {
3303		  
3304			var $vcOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '90%';
3305
3306			var $that = $(this);
3307			var waypoint = new Waypoint({
3308	 			element: $that,
3309	 			 handler: function(direction) {
3310
3311	 			 	if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated')) { 
3312					     waypoint.destroy();
3313					     return;
3314					}
3315	 				$that.addClass("animated");
3316	 				$that.addClass("wpb_start_animation");
3317	 				waypoint.destroy();
3318					
3319					if($that.is('.nectar-button') && $('body[data-button-style*="rounded_shadow"]').length > 0) {
3320						setTimeout(function(){
3321							$that.removeClass('wpb_start_animation');
3322						},1100);
3323					}
3324				
3325				},
3326				offset: $vcOffsetPos
3327
3328			}); 
3329
3330	});
3331}
3332			 
3333
3334/***************** Milestone Counter ******************/
3335	
3336	function milestoneInit() {
3337
3338		$('.nectar-milestone').each(function() {
3339			
3340			//symbol
3341			if($(this).is('[data-symbol]')) {
3342				if($(this).find('.symbol-wrap').length == 0) {
3343					if($(this).attr('data-symbol-pos') == 'before') {
3344						$(this).find('.number').prepend('<div class="symbol-wrap"><span class="symbol">' + $(this).attr('data-symbol') + '</span></div>');
3345					} else {
3346						$(this).find('.number').append('<div class="symbol-wrap"><span class="symbol">' + $(this).attr('data-symbol') + '</span></div>');
3347					}
3348				}
3349
3350				var $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'));
3351			
3352				$(this).find('.symbol-wrap').css({'font-size': $symbol_size + 'px', 'line-height': $symbol_size + 'px'});
3353			}
3354
3355			$(this).find('.number').css({'font-size': $(this).find('.number').attr('data-number-size') +'px', 'line-height': $(this).find('.number').attr('data-number-size') + 'px'});
3356		});
3357		
3358		if(!$('body').hasClass('mobile') && $('.nectar-milestone').length > 0) {
3359			
3360
3361			//blur effect
3362			var $blurCssString = '';
3363			$($fullscreenSelector+'.nectar-milestone.motion_blur').each(function(i){
3364				
3365				$(this).removeClass(function (index, className) {
3366				    return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
3367				});	
3368					
3369				$(this).addClass('instance-'+i);
3370
3371				var $currentColor = $(this).find('.number').css('color');
3372				var colorInt = parseInt($currentColor.substring(1),16);
3373		   		var R = (colorInt & 0xFF0000) >> 16;
3374		    	var G = (colorInt & 0x00FF00) >> 8;
3375		   		var B = (colorInt & 0x0000FF) >> 0;
3376		   		
3377		   		var $rgbaColorStart = 'rgba('+R+','+G+','+B+',0.2)';
3378				var $rgbaColorEnd = 'rgba('+R+','+G+','+B+',1)';
3379				var $numberSize = parseInt($(this).find('.number').attr('data-number-size'));
3380
3381				$blurCssString += '@keyframes motion-blur-number-'+i+' { ' +
3382				   ' 0% { '+
3383				   		'opacity: 0;'+
3384						'color: '+$rgbaColorStart+'; '+
3385   						'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+'; '+
3386    					'transform: translateZ(0px) translateY(-100%); '+
3387    					'-webkit-transform: translateZ(0px) translateY(-100%); '+
3388    				'} '+
3389    				'33% { opacity: 1 }' +
3390    				'100% { '+
3391						'color: '+$rgbaColorEnd+'; '+
3392   						'text-shadow: none; '+
3393    					'transform: translateZ(0px) translateY(0px); '+
3394    					'-webkit-transform: translateZ(0px) translateY(0px); '+
3395    				'} '+
3396    			'} '+
3397    			'@-webkit-keyframes motion-blur-number-'+i+' { ' +
3398				   ' 0% { '+
3399				  	    'opacity: 0;'+
3400						'color: '+$rgbaColorStart+'; '+
3401   						'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+'; '+
3402    					'transform: translateZ(0px) translateY(-100%); '+
3403    					'-webkit-transform: translateZ(0px) translateY(-100%); '+
3404    				'} '+
3405    				'33% { opacity: 1 }' +
3406    				'100% { '+
3407						'color: '+$rgbaColorEnd+'; '+
3408   						'text-shadow: none; '+
3409    					'transform: translateZ(0px) translateY(0px); '+
3410    					'-webkit-transform: translateZ(0px) translateY(0px); '+
3411    				'} '+
3412    			'} '+
3413    			'.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+'; } ';
3414    			
3415    			//separate each character into spans
3416    			$symbol = $(this).find('.symbol-wrap').clone();
3417    			$(this).find('.symbol-wrap').remove();
3418    			var characters = $(this).find('.number').text().split("");
3419    			$this = $(this).find('.number');
3420				$this.empty();
3421    			$.each(characters, function (i, el) {
3422				    $this.append("<span>" + el + "</span");
3423				});
3424
3425				//handle symbol
3426				if($(this).has('[data-symbol]')) {
3427	    			if($(this).attr('data-symbol-pos') == 'after') {
3428	    				$this.append($symbol);
3429	    			} else {
3430	    				$this.prepend($symbol);
3431	    			}
3432	    		}
3433				
3434			});
3435
3436			var head = document.head || document.getElementsByTagName('head')[0];
3437				var style = document.createElement('style');
3438
3439				style.type = 'text/css';
3440			if (style.styleSheet){
3441			  style.styleSheet.cssText = $blurCssString;
3442			} else {
3443			  style.appendChild(document.createTextNode($blurCssString));
3444			}
3445			$(style).attr('id','milestone-blur');
3446			$('head #milestone-blur').remove();
3447			head.appendChild(style);
3448
3449
3450			//activate
3451			milestoneWaypoint();
3452
3453		}
3454
3455	}
3456
3457	function milestoneWaypoint() {
3458		$($fullscreenSelector+'.nectar-milestone').each(function() {
3459			//animation
3460			
3461			var $offset = ($('#nectar_fullscreen_rows').length > 0) ? '250%' : '98%';
3462
3463			var $that = $(this);
3464			var waypoint = new Waypoint({
3465	 			element: $that,
3466	 			 handler: function(direction) {
3467
3468	 			 	if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
3469					     waypoint.destroy();
3470					     return;
3471					}
3472
3473	 			 	var $endNum = parseInt($that.find('.number span:not(.symbol)').text().replace(/,/g , ''));
3474
3475					if(!$that.hasClass('motion_blur')) {
3476
3477						var countOptions = { easingFn: easeOutCubic };
3478						var $countEle = $that.find('.number span:not(.symbol)')[0];
3479						var numAnim = new CountUp($countEle, 0, $endNum,0,2.2,countOptions);
3480						numAnim.start();
3481
3482					} else {
3483						$that.find('span').each(function(i){
3484							var $that = $(this);
3485							setTimeout(function(){ $that.addClass('in-sight'); },200*i);
3486						});
3487					}
3488
3489
3490					$that.addClass('animated-in');
3491					waypoint.destroy();
3492				},
3493				offset: $offset
3494
3495			}); 
3496
3497		}); 
3498	}
3499
3500	var $animationOnScrollTimeOut = ($('.nectar-box-roll').length > 0) ? 850: 125;	
3501
3502	
3503/***************** Tabbed ******************/
3504	
3505	var $tabbedClickCount = 0;
3506	$('body').on('click','.tabbed > ul li:not(.cta-button) a',function(){
3507		var $id = $(this).parents('li').index()+1;
3508		
3509		var $frontEndEditorTabDiv =  ($('body.vc_editor').length > 0) ? '> .wpb_tab ': '';
3510		
3511		if(!$(this).hasClass('active-tab') && !$(this).hasClass('loading')){
3512			$(this).parents('ul').find('a').removeClass('active-tab');
3513			$(this).addClass('active-tab');
3514			
3515			$(this).parents('.tabbed').find('>
3515 div:not(.clear)' + $frontEndEditorTabDiv).css({'visibility':'hidden','position':'absolute','opacity':'0','left':'-9999px'});
3516			
3517			if($('body.vc_editor').length > 0) {
3518				//front end editor locate tab by modal id
3519				var $data_m_id = ($(this).parent().is('[data-m-id]')) ? $(this).parent().attr('data-m-id') : '';
3520				$(this).parents('.tabbed').find('> div[data-model-id="'+$data_m_id+'"]' + $frontEndEditorTabDiv).css({'visibility':'visible', 'position' : 'relative','left':'0','display':'block'}).stop().transition({'opacity':1},400);
3521				//update padding
3522				convertFrontEndPadding();
3523				
3524			} else {
3525				$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).css({'visibility':'visible', 'position' : 'relative','left':'0','display':'block'}).stop().transition({'opacity':1},400);
3526			}
3527			
3528			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); 
3529		}
3530		
3531		//waypoint checking
3532		if($tabbedClickCount != 0) {
3533			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-progress-bar').length > 0 ) 
3534				progressBars();
3535			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.divider-small-border [data-animate="yes"]').length > 0 || $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.divider-border [data-animate="yes"]').length > 0 ) 
3536				dividers();
3537			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('img.img-with-animation').length > 0 ||
3538			   $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.col.has-animation').length > 0  || 
3539			   $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar_cascading_images').length > 0  || 
3540			   $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.wpb_column.has-animation').length > 0 ) {
3541				colAndImgAnimations();
3542				cascadingImageBGSizing();
3543			}
3544			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.column-image-bg-wrap[data-bg-animation="displace-filter-fade"]').length > 0){
3545				for(var k=0; k<$liquidBG_EL.length;k++) {
3546					if($($liquidBG_EL[k].canvasContainer).parents('.wpb_tab').length > 0 && $($liquidBG_EL[k].canvasContainer).parents('.wpb_tab').css('visibility') != 'hidden') {
3547						
3548						//add bg to container
3549						if($($liquidBG_EL[k].canvasContainer).find('.image-added-to-stage').length == 0) {
3550							$liquidBG_EL[k].imgContainer.addChild( $liquidBG_EL[k].bg );
3551						}
3552						$($liquidBG_EL[k].canvasContainer).find('.nectar-liquid-bg').addClass('image-added-to-stage');
3553						
3554						//resize calcs
3555						$liquidBG_EL[k].resize();
3556						
3557						//animate
3558						if($($liquidBG_EL[k].canvasContainer).find('.nectar-liquid-bg.animated-in').length == 0) {
3559							$liquidBG_EL[k].animateProps($liquidBG_EL[k]);
3560						}
3561			
3562					}
3563				}
3564			}
3565			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-milestone').length > 0 ) 
3566				milestoneWaypoint();
3567			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar_image_with_hotspots[data-animation="true"]').length > 0 ) 
3568				imageWithHotspots();
3569			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-fancy-ul').length > 0 ) 
3570				nectar_fancy_ul_init();
3571			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-split-heading').length > 0 ) 
3572				splitLineHeadings();
3573			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.wpb_column[data-border-animation="true"]').length > 0) {
3574				animatedColBorders();
3575			}
3576			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.wpb_animate_when_almost_visible').length > 0) {
3577				vcWaypoints();
3578			}
3579			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-animated-title').length > 0) {
3580				animated_titles();
3581			}
3582			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-highlighted-text').length > 0) {
3583				highlighted_text();
3584			}
3585			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar_food_menu_item').length > 0) {
3586				foodMenuItems();
3587			}
3588			if($(this).parents('.wpb_row').length > 0) {
3589				if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.vc_pie_chart').length > 0  ||
3590				   $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.wp-video-shortcode').length > 0 ||
3591					 $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.post-area.masonry .posts-container').length > 0 ||
3592				   $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.twentytwenty-container').length > 0 ||
3593					 $(this).parents('#nectar_fullscreen_rows[data-content-overflow="scrollbar"]').length > 0 ||
3594					 $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.wpb_gallery').length > 0 ||
3595				   $(this).parents('.wpb_row').next().hasClass('parallax_section'))
3596					$(window).trigger('resize');
3597					
3598					
3599				if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-flickity').length > 0 && typeof Flickity != 'undefined' ) {
3600					var tabbedFlkty = Flickity.data( $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-flickity')[0] );
3601					tabbedFlkty.resize();
3602				}
3603				
3604				if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-woo-flickity').length > 0 && typeof Flickity != 'undefined' ) {
3605					var wootabbedFlkty = Flickity.data( $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-woo-flickity > ul')[0] );
3606					wootabbedFlkty.resize();
3607				}
3608				
3609			}
3610
3611			//svg icons
3612		
3613			$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.svg-icon-holder').each(function(i){
3614				var $that = $(this);
3615
3616				setTimeout(function(){
3617
3618					var $animationDelay = ($(this).is('[data-animation-delay]') && $(this).attr('data-animation-delay').length > 0 && $(this).attr('data-animation') != 'false') ? $(this).attr('data-animation-delay') : 0;
3619
3620					clearTimeout($animatedSVGIconTimeout[i]);
3621
3622					if($that.attr('data-animation') == 'false') { 
3623						$animationSpeed = 1;
3624						$that.css('opacity','1');
3625						$svg_icons[$that.find('svg').attr('id').slice(-1)].finish();
3626					} else {
3627						
3628						$svg_icons[$that.find('svg').attr('id').slice(-1)].reset();
3629						$animatedSVGIconTimeout[i] = setTimeout(function(){ $svg_icons[$that.find('svg').attr('id').slice(-1)].play(); },$animationDelay);
3630						
3631					}
3632				},150);
3633			});
3634
3635		}
3636
3637		//fix columns inside tabs
3638		$(this).parents('.tabbed').find('.wpb_row').each(function(){
3639			if( typeof $(this).find('[class*="vc_col-"]').first().offset() != 'undefined') {
3640				
3641				var $firstChildOffset = $(this).find('[class*="vc_col-"]').first().offset().left;
3642				$(this).find('[class*="vc_col-"]').each(function(){
3643					$(this).removeClass('no-left-margin');
3644					if($(this).offset().left < $firstChildOffset + 15) { 
3645						$(this).addClass('no-left-margin');
3646					} else {
3647						$(this).removeClass('no-left-margin');
3648					}
3649				});
3650			}
3651		});
3652
3653		$tabbedClickCount++;
3654
3655		//magic line
3656		if($(this).parent().parent().find('.magic-line').length > 0) {
3657			magicLineCalc($(this));
3658	     }
3659
3660		return false;
3661	});
3662
3663
3664	function magicLineCalc($ele) {
3665		var el, leftPos, ratio;
3666	    el = $ele.parent();
3667	    if (el.length) {
3668	        leftPos = el.position().left;
3669	        ratio = el.width();
3670	    } else {
3671	        leftPos = ratio = 0;
3672	    }
3673
3674	    $ele.parent().parent().find('.magic-line').css('transform', 'translateX(' + leftPos + 'px) scaleX(' + ratio + ')');
3675	}
3676	
3677	
3678	function tabbedInit(){ 
3679		$('.tabbed').each(function(){
3680			
3681			//handle icons
3682			$(this).find('.wpb_tab').each(function(i){
3683				
3684				if($(this).is('[data-tab-icon]') && $(this).attr('data-tab-icon').length > 0) {
3685					$(this).parents('.tabbed').addClass('using-icons');
3686					$(this).parents('.tabbed').find('.wpb_tabs_nav li:nth-child('+ (i+1) +') > a').prepend('<i class="'+$(this).attr("data-tab-icon")+'"></i>');
3687				}
3688			});
3689			
3690			//make sure the tabs don't have a nectar slider - we'll init this after the sliders load in that case
3691			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){
3692				$(this).find('> ul li:first-child a').click();
3693			}	
3694			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 ){
3695				var $that = $(this);
3696				
3697				$(this).find('.wpb_tab').show().css({'opacity':0,'height':'1px'});
3698				$(this).find('> ul li a').addClass('loading');
3699				
3700				setTimeout(function(){ 
3701					$that.find('.wpb_tab').hide().css({'opacity':1,'height':'auto'}); 
3702					$that.find('> ul li a').removeClass('loading');
3703					$that.find('> ul li:first-child a').click(); 
3704				},900);
3705			}
3706
3707			var $that = $(this);
3708			//minimal alt effect
3709			setTimeout(function(){
3710				if($that.is('[data-style="minimal_alt"]')) {
3711					$that.find('> ul').append('<li class="magic-line" />');
3712					 magicLineCalc($that.find('> ul > li:first-child > a'));
3713				}
3714			},100);
3715
3716
3717		});
3718	}
3719	setTimeout(tabbedInit,60);
3720
3721	//deep linking
3722	function tabbbedDeepLinking(){
3723		if(typeof $_GET['tab'] != 'undefined'){
3724			$('.wpb_tabs_nav').each(function(){
3725
3726				$(this).find('li').each(function(){
3727					var $currentText = $(this).find('a').text();
3728					var $getText = $_GET['tab'];
3729					var $that = $(this);
3730
3731					$currentText = $currentText.replace(/\s+/g, '-').toLowerCase();
3732					$getText = $getText.replace(/\s+/g, '-').replace(/</g, '&lt;').replace(/"/g, '&quot;').toLowerCase();
3733
3734					if($currentText == $getText)  { 
3735
3736			          $(this).find('a').click(); 
3737			           setTimeout(function(){ 
3738			              $that.find('a').click(); 
3739			           },901);
3740			        }
3741				})
3742			});
3743		}
3744	}
3745	tabbbedDeepLinking();
3746
3747/***************** Toggle ******************/
3748	
3749	//toggles
3750	$('body').on('click','.toggle h3 a', function(){
3751	
3752		if(!$(this).parents('.toggles').hasClass('accordion')) { 
3753			$(this).parents('.toggle').find('> div').slideToggle(300);
3754			$(this).parents('.toggle').toggleClass('open');
3755			
3756			//switch icon
3757			if( $(this).parents('.toggle').hasClass('open') ){
3758				$(this).find('i').attr('class','icon-minus-sign');
3759			} else {
3760				$(this).find('i').attr('class','icon-plus-sign');
3761			}
3762
3763			if($(this).parents('.toggle').find('> div .iframe-embed').length > 0 && $(this).parents('.toggle').find('> div iframe.iframe-embed').height() == '0') responsiveVideoIframes();
3764			if($(this).parents('.full-width-content').length > 0) setTimeout(function(){ fullWidthContentColumns(); },300);
3765			if($('#nectar_fullscreen_rows').length > 0) setTimeout(function(){ $(window).trigger('smartresize'); },300);
3766			return false;
3767		}
3768	});
3769	
3770	//accordion
3771	$('body').on('click','.accordion .toggle h3 a', function(){
3772		
3773		if($(this).parents('.toggle').hasClass('open')) return false;
3774		
3775		$(this).parents('.toggles').find('.toggle > div').slideUp(300);
3776		$(this).parents('.toggles').find('.toggle h3 a i').attr('class','icon-plus-sign');
3777		$(this).parents('.toggles').find('.toggle').removeClass('open');
3778		
3779		$(this).parents('.toggle').find('> div').slideDown(300);
3780		$(this).parents('.toggle').addClass('open');
3781		
3782		//switch icon
3783		if( $(this).parents('.toggle').hasClass('open') ){
3784			$(this).find('i').attr('class','icon-minus-sign');
3785		} else {
3786			$(this).find('i').attr('class','icon-plus-sign');
3787		}
3788
3789		if($(this).parents('.full-width-content').length > 0) { 
3790			clearTimeout($t);
3791			var $t = setTimeout(function(){ fullWidthContentColumns(); },400);
3792		}
3793		if($('#nectar_fullscreen_rows').length > 0) {
3794			clearTimeout($t);
3795			var $t = setTimeout(function(){ $(window).trigger('smartresize'); },400);
3796		}
3797		
3798		return false;
3799	});
3800	
3801	//accordion start open
3802	function accordionInit(){ 
3803		$('.accordion').each(function(){
3804			$(this).find('> .toggle').first().addClass('open').find('> div').show();
3805			$(this).find('> .toggle').first().find('a i').attr('class','icon-minus-sign');
3806		});
3807		
3808		
3809		$('.toggles').each(function(){
3810			
3811			var $isAccordion = ($(this).hasClass('accordion')) ? true : false;
3812			
3813			$(this).find('.toggle').each(function(){
3814				if($(this).find('> div .testimonial_slider').length > 0 || $(this).find('> div iframe').length > 0) {
3815					var $that = $(this);
3816					$(this).find('> div').show().css({'opacity':0,'height':'1px', 'padding':'0'});
3817					
3818					testimonialHeightResize();
3819					
3820					setTimeout(function(){
3821						$that.find('> div').hide().css({'opacity':1,'height':'auto', 'padding':'10px 14px'}); 
3822						if($isAccordion == true && $that.index() == 0) $that.find('> div').slideDown(300);
3823					},900);
3824				} 
3825			});
3826		})
3827	}
3828	accordionInit();
3829
3830	//deep linking
3831	function accordionDeepLinking(){
3832		if(typeof $_GET['toggle'] != 'undefined'){
3833			$('.toggles').each(function(){
3834
3835				$(this).find('.toggle').each(function(){
3836					var $currentText = $(this).find('h3 a').clone();
3837					var $getText = $_GET['toggle'];
3838
3839					$($currentText).find('i').remove();
3840					$currentText = $currentText.text();
3841					$currentText = $currentText.replace(/\s+/g, '-').toLowerCase();
3842					$getText = $getText.replace(/\s+/g, '-').replace(/</g, '&lt;').replace(/"/g, '&quot;').toLowerCase();
3843
3844					if($currentText == $getText) $(this).find('h3 a').click();
3845				});
3846			});
3847		}
3848	}
3849	accordionDeepLinking();
3850
3851/***************** Button ******************/
3852	
3853	$.cssHooks.color = {
3854	    get: function(elem) {
3855	        if (elem.currentStyle)
3856	            var color = elem.currentStyle["color"];
3857	        else if (window.getComputedStyle)
3858	            var color = document.defaultView.getComputedStyle(elem,
3859	                null).getPropertyValue("color");
3860	        if (color.search("rgb") == -1)
3861	            return color;
3862	        else {
3863	            color = color.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
3864	            function hex(x) {
3865	                return ("0" + parseInt(x).toString(16)).slice(-2);
3866	            }
3867	            if(color) {
3868	            	return "#" + hex(color[1]) + hex(color[2]) + hex(color[3]);
3869	            }
3870	        }
3871	    }
3872	}
3873
3874	$.cssHooks.backgroundColor = {
3875	    get: function(elem) {
3876	        if (elem.currentStyle)
3877	            var bg = elem.currentStyle["backgroundColor"];
3878	        else if (window.getComputedStyle)
3879	            var bg = document.defaultView.getComputedStyle(elem,
3880	                null).getPropertyValue("background-color");
3881	        if (bg.search("rgb") == -1)
3882	            return bg;
3883	        else {
3884	            bg = bg.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
3885	            function hex(x) {
3886	                return ("0" + parseInt(x).toString(16)).slice(-2);
3887	            }
3888	            if(bg) {
3889	            	return "#" + hex(bg[1]) + hex(bg[2]) + hex(bg[3]);
3890	            }
3891	        }
3892	    }
3893	}
3894	
3895	function shadeColor(hex, lum) {
3896
3897	  // validate hex string
3898		hex = String(hex).replace(/[^0-9a-f]/gi, '');
3899		if (hex.length < 6) {
3900			hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];
3901		}
3902		lum = lum || 0;
3903
3904		// convert to decimal and change luminosity
3905		var rgb = "#", c, i;
3906		for (i = 0; i < 3; i++) {
3907			c = parseInt(hex.substr(i*2,2), 16);
3908			c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16);
3909			rgb += ("00"+c).substr(c.length);
3910		}
3911
3912		return rgb;
3913	}
3914
3915	//color
3916	function coloredButtons() {
3917		$('.nectar-button.see-through[data-color-override], .nectar-button.see-through-2[data-color-override], .nectar-button.see-through-3[data-color-override]').each(function(){
3918			
3919			var $usingMaterialSkin = ($('body.material[data-button-style^="rounded"]').length > 0) ? true : false;
3920			$(this).css('visibility','visible');
3921			
3922			if($(this).hasClass('see-through-3') && $(this).attr('data-color-override') == 'false') {
3923				return true;
3924			}
3925			//if($(this).attr('data-color-override') != 'false'){
3926
3927				if($(this).attr('data-color-override') != 'false') {
3928					var $color = $(this).attr('data-color-override') ;
3929				} else {
3930					if($(this).parents('.dark').length > 0) 
3931						var $color = '#000000';
3932					else 
3933						var $color = '#ffffff';
3934				}
3935
3936				if(!$(this).hasClass('see-through-3')) $(this).css('color',$color);
3937				$(this).find('i').css('color',$color);
3938				
3939				var colorInt = parseInt($color.substring(1),16);
3940				var $hoverColor = ($(this).has('[data-hover-color-override]')) ? $(this).attr('data-hover-color-override') : 'no-override';
3941				var $hoverTextColor = ($(this).has('[data-hover-text-color-override]')) ? $(this).attr('data-hover-text-color-override') : '#fff';
3942				
3943	   		var R = (colorInt & 0xFF0000) >> 16;
3944	    	var G = (colorInt & 0x00FF00) >> 8;
3945	   		var B = (colorInt & 0x0000FF) >> 0;
3946	   		
3947	   		var $opacityStr = ($(this).hasClass('see-through-3')) ? '1': '0.75';
3948
3949				$(this).css('border-color','rgba('+R+','+G+','+B+','+$opacityStr+')');
3950				
3951				//material buttons w/ icons starting
3952				if($usingMaterialSkin) {
3953					$(this).find('i').css({'background-color': 'rgba('+R+','+G+','+B+',1)', 'box-shadow': '0px 8px 15px rgba('+R+','+G+','+B+',0.24)'});
3954				}
3955				
3956				if($(this).hasClass('see-through')) {
3957					
3958					var $that = $(this);
3959					
3960					$(this).on('mouseenter touchstart', function(){
3961						$that.css('border-color','rgba('+R+','+G+','+B+',1)');
3962					});
3963					
3964					$(this).on('mouseleave touchtouchend', function(){
3965						$that.css('border-color','rgba('+R+','+G+','+B+',1)');
3966						$opacityStr = ($(this).hasClass('see-through-3')) ? '1': '0.75';
3967						$that.css('border-color','rgba('+R+','+G+','+B+','+$opacityStr+')');
3968					});
3969					
3970					
3971				} else {
3972					
3973					$(this).find('i').css('color', $hoverTextColor);
3974					
3975					if($hoverColor != 'no-override'){
3976						
3977						var $that = $(this);
3978						
3979						$(this).on('mouseenter touchstart', function(){
3980							
3981							$that.css({
3982								'border-color': $hoverColor,
3983								'background-color': $hoverColor,
3984								'color': $hoverTextColor
3985							});
3986							
3987							//material buttons w/ icons over
3988							if($usingMaterialSkin) {
3989								$that.find('i').css({'background-color': '', 'box-shadow': ''});
3990							}
3991							
3992						});
3993						
3994						$(this).on('mouseleave touchtouchend', function(){
3995								
3996								$opacityStr = ($(this).hasClass('see-through-3')) ? '1': '0.75';
3997								
3998								//material buttons w/ icons leave
3999								if($usingMaterialSkin) {
4000									$that.find('i').css({'background-color': 'rgba('+R+','+G+','+B+',1)', 'box-shadow': '0px 8px 15px rgba('+R+','+G+','+B+',0.24)'});
4001								}
4002								
4003								if(!$that.hasClass('see-through-3')) {
4004									$that.css({
4005										'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
4006										'background-color': 'transparent',
4007										'color': $color
4008									});
4009								} else {
4010									$that.css({
4011										'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
4012										'background-color': 'transparent'
4013									});
4014								}
4015							
4016						});
4017							
4018
4019					
4020					} else {
4021						
4022						var $that = $(this);
4023						
4024						$(this).on('mouseenter touchstart', function(){
4025							
4026								$that.css({
4027									'border-color': $hoverColor,
4028									'color': $hoverTextColor
4029								});
4030								
4031						});
4032						
4033						$(this).on('mouseleave touchtouchend', function(){
4034							
4035								$opacityStr = ($that.hasClass('see-through-3')) ? '1': '0.75';
4036								$that.css({
4037									'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
4038									'color':  $hoverTextColor
4039								});
4040								
4041						});
4042							
4043
4044					
4045					}
4046			//	}
4047			
4048			}
4049		});
4050		
4051		$('.nectar-button:not(.see-through):not(.see-through-2):not(.see-through-3)[data-color-override]').each(function(){
4052			
4053			$(this).css('visibility','visible');
4054			
4055			if($(this).attr('data-color-override') != 'false'){
4056				
4057				var $color = $(this).attr('data-color-override');
4058				$(this).removeClass('accent-color').removeClass('extra-color-1').removeClass('extra-color-2').removeClass('extra-color-3');
4059				$(this).css('background-color',$color);
4060				
4061			}
4062			
4063		});
4064
4065
4066		//solid color tilt 
4067		if($('.swiper-slide .solid_color_2').length > 0 || $('.tilt-button-inner').length > 0) {
4068
4069			var $tiltButtonCssString = '';
4070
4071			$('.swiper-slide .solid_color_2 a').each(function(i){
4072				
4073				$(this).addClass('instance-'+i);
4074
4075				if($(this).attr('data-color-override') != 'false') {
4076					var $color = $(this).attr('data-color-override');
4077				} else {
4078					if($(this).parents('.dark').length > 0) 
4079						var $color = '#000000';
4080					else 
4081						var $color = '#ffffff';
4082				}
4083
4084				$(this).css('color',$color);
4085				$(this).find('i').css('color',$color);
4086				
4087				var $currentColor = $(this).css('background-color');
4088				var $topColor = shadeColor($currentColor, 0.13);
4089				var $bottomColor = shadeColor($currentColor, -0.15);
4090	
4091				$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+'; } ';
4092
4093			});
4094
4095
4096			$('.tilt-button-wrap a').each(function(i){
4097				
4098				$(this).addClass('instance-'+i);
4099
4100				var $currentColor = $(this).css('background-color');
4101
4102				if($(this).attr('data-color-override') != 'false') {
4103					var $color = $(this).attr('data-color-override');
4104					$(this).css('background-color',$color);
4105					$currentColor = $color;
4106				} 
4107			
4108				var $topColor = shadeColor($currentColor, 0.13);
4109				var $bottomColor = shadeColor($currentColor, -0.15);
4110	
4111				$tiltButtonCssString += '.tilt-button-wrap a.instance-'+i + ':after { background-color: '+$topColor+';  }' + ' .tilt-button-wrap a.instance-'+i + ':before { background-color: '+$bottomColor+'; } ';
4112
4113			});
4114
4115			var head = document.head || document.getElementsByTagName('head')[0];
4116   			var style = document.createElement('style');
4117
4118   			style.type = 'text/css';
4119			if (style.styleSheet){
4120			  style.styleSheet.cssText = $tiltButtonCssString;
4121			} else {
4122			  style.appendChild(document.createTextNode($tiltButtonCssString));
4123			}
4124
4125			head.appendChild(style);
4126		}
4127
4128
4129		//transparent 3d
4130		if($('.nectar-3d-transparent-button').length > 0) {
4131
4132			var $3dTransButtonCssString = '';
4133			$('.nectar-3d-transparent-button').each(function(i){
4134
4135				var $that = $(this);
4136				var $size = $that.attr('data-size');
4137				var $padding = 0;
4138				var $font_size;
4139		
4140
4141				//size
4142
4143				if($size == 'large') {
4144					$padding = 46;
4145					$font_size = 16;
4146				} else if($size == 'medium') {
4147					$padding = 30;
4148					$font_size = 16;
4149				} else if($size == 'small') {
4150					$padding = 20;
4151					$font_size = 12;
4152				} else if($size == 'jumbo') {
4153					$padding = 54;
4154					$font_size = 24;
4155				} else if($size == 'extra_jumbo') {
4156					$padding = 100;
4157					$font_size = 64;
4158				}
4159
4160				$that.find('svg text').attr('font-size',$font_size);
4161				var $boundingRect = $(this).find('.back-3d .button-text')[0].getBoundingClientRect();
4162
4163				var $text_width = $boundingRect.width;
4164				var $text_height = $font_size*1.5;
4165
4166				var $extraMult = (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) ? 0 : 1;
4167
4168				$that.css({'width': ($text_width+$padding*1.5)+'px','height': ($text_height+$padding)+'px'});
4169				$that.find('> a').css({'height': ($text_height+$padding)+'px'});
4170
4171				$that.find('.back-3d svg, .front-3d svg').css({'width': ($text_width+$padding*1.5)+'px','height': ($text_height+$padding)+'px'}).attr('viewBox','0 0 '+ ($text_width+$padding) + ' ' + ($text_height+$padding));
4172				if($size == 'jumbo')
4173					$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.5)/2 +' ' + (($text_height+$padding) / 1.68) +')');
4174				else if($size == 'extra_jumbo')
4175					$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.6)/2 +' ' + (($text_height+$padding) / 1.6) +')');
4176				else if($size == 'large') {
4177					$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.5)/2 +' ' + (($text_height+$padding) / 1.7) +')');
4178				}
4179				else {
4180					$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.5)/2 +' ' + (($text_height+$padding) / 1.65) +')');
4181				}
4182				$that.find('.front-3d ').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
4183				$that.find('.back-3d').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
4184
4185				//mask
4186				$(this).find('.front-3d svg > rect').attr('id','masked-rect-id-'+i);
4187				$(this).find('.front-3d defs mask').attr('id','button-text-mask-'+i);
4188
4189				$that.css('visibility','visible');
4190				$3dTransButtonCssString+= '#masked-rect-id-'+i+' { mask: url(#button-text-mask-'+i+'); -webkit-mask: url(#button-text-mask-'+i+')} ';
4191
4192			});
4193
4194			//extra jumbo resize
4195			function createExtraJumboSize() {
4196				$('.nectar-3d-transparent-button').each(function(i){
4197					
4198					if($(this).css('visibility') != 'visible') return;
4199
4200					var $that = $(this);
4201					var $size = $that.attr('data-size');
4202					if($size == 'extra_jumbo') {
4203						
4204						var $font_size;
4205						
4206						var $extraMult = (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) ? 0 : 1;
4207
4208						if(window.innerWidth < 1000 && window.innerWidth > 690) {
4209							$padding = 64;
4210							$font_size = 34;
4211							$that.find('.back-3d rect').attr('stroke-width','12');
4212							$vert_height_divider = 1.7;
4213						} else if(window.innerWidth <= 690 ) {
4214							$padding = 46;
4215							$font_size = 16;
4216							$that.find('.back-3d rect').attr('stroke-width','10');
4217							$vert_height_divider = 1.7;
4218						}  else {
4219							$padding = 100;
4220							$font_size = 64;
4221							$that.find('.back-3d rect').attr('stroke-width','20');
4222							$vert_height_divider = 1.6;
4223						}
4224			
4225
4226						$that.find('svg text').attr('font-size',$font_size);
4227
4228						var $boundingRect = $(this).find('.back-3d .button-text')[0].getBoundingClientRect();
4229						var $text_width = $boundingRect.width;
4230						var $text_height = $font_size*1.5;
4231
4232						$that.css({'width': ($text_width+$padding*1.5)+'px','height': ($text_height+$padding)+'px'});
4233						$that.find('> a').css({'height': ($text_height+$padding)+'px'});
4234
4235						$that.find('.back-3d svg, .front-3d svg').css({'width': ($text_width+$padding*1.5)+'px','height': ($text_height+$padding)+'px'}).attr('viewBox','0 0 '+ ($text_width+$padding) + ' ' + ($text_height+$padding));
4236
4237						$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.6)/2 +' ' + (($text_height+$padding) / $vert_height_divider) +')');
4238
4239						$that.find('.front-3d ').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
4240						$that.find('.back-3d').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
4241
4242					}
4243				});
4244			}
4245			createExtraJumboSize();
4246			$(window).on('smartresize',createExtraJumboSize);
4247
4248			var head = document.head || document.getElementsByTagName('head')[0];
4249				var style = document.createElement('style');
4250
4251				style.type = 'text/css';
4252			if (style.styleSheet){
4253			  style.styleSheet.cssText = $3dTransButtonCssString;
4254			} else {
4255			  style.appendChild(document.createTextNode($3dTransButtonCssString));
4256			}
4257
4258			head.appendChild(style);
4259		}
4260
4261		//gradient btn init
4262		setTimeout(function(){
4263			$('.nectar-button.extra-color-gradient-1 .start, .nectar-button.extra-color-gradient-2 .start, .nectar-button.see-through-extra-color-gradient-1 .start, .nectar-button.see-through-extra-color-gradient-2 .start').removeClass('loading');
4264		},150);
4265		//no grad for ff
4266		if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1 || navigator.userAgent.indexOf("MSIE ") > -1 || navigator.userAgent.match(/Trident\/7\./)) {
4267			$('.nectar-button.extra-color-gradient-1, .nectar-button.extra-color-gradient-2, .nectar-button.see-through-extra-color-gradient-1, .nectar-button.see-through-extra-color-gradient-2').addClass('no-text-grad');
4268		}
4269	}	
4270
4271	coloredButtons();
4272
4273
4274	//large icon hover
4275	function largeIconHover(){
4276		$('.icon-3x').each(function(){
4277			
4278			$(this).closest('.col').on('mouseenter',function(){
4279				$(this).find('.icon-3x').addClass('hovered')
4280			});
4281			$(this).closest('.col').on('mouseleave',function(){
4282				$(this).find('.icon-3x').removeClass('hovered')
4283			});
4284			
4285		});
4286
4287		//remove gradient from FF
4288		if( navigator.userAgent.indexOf("MSIE ") > -1 || navigator.userAgent.match(/Trident\/7\./))
4289			$('[class^="icon-"].extra-color-gradient-1, [class^="icon-"].extra-color-gradient-2, [class^="icon-"][data-color="extra-color-gradient-1"], [class^="icon-"][data-color="extra-color-gradient-2"], .nectar_icon_wrap[data-color*="extra-color-gradient"] .nectar_icon, .nectar-gradient-text').addClass('no-grad');
4290	}
4291	largeIconHover();
4292
4293
4294/***************** Team Member ******************/
4295function teamMemberFullscreen() {
4296
4297	//open
4298	$('body').on('click','.team-member[data-style="bio_fullscreen"]',function(){
4299		
4300		if($('.nectar_team_member_overlay').length > 0) return;
4301
4302		var $usingBoxedClass = ($('body > #boxed').length > 0) ? 'in-boxed' : null;
4303
4304		$teamMemberMeta = $(this).find('.nectar_team_bio').html();
4305		$teamMemberImg = ($(this).find('.nectar_team_bio_img[data-img-src]').length > 0) ? $(this).find('.nectar_team_bio_img').attr('data-img-src') : '';
4306		$('body').append('<div class="nectar_team_member_overlay '+$usingBoxedClass+'"><div class="inner-wrap"><div class="team_member_details"><div class="bio-inner"><span class="mobile-close"></span><h2>'+$(this).find('.team-meta h3').html()+'</h2><div class="title">'+$(this).find('.team-meta p').html()+'</div><div class="team-desc">'+$teamMemberMeta+'</div></div></div><div class="team_member_picture"><div class="team_member_image_bg_cover"></div><div class="team_member_picture_wrap"><div class="team_member_image"></div></div></div></div></div><div class="nectar_team_member_close '+$usingBoxedClass+'"><div class="inner"></div></div>');
4307		if($teamMemberImg.length > 0) {
4308
4309			//fadein img on load
4310			var teamTmpImg = new Image();
4311			teamTmpImg.src = $teamMemberImg;
4312		    teamTmpImg.onload = function() {
4313		        $('.nectar_team_member_overlay .team_member_image').css('opacity','1');
4314		    };
4315			$('.nectar_team_member_overlay .team_member_image').css({ 'background-image': 'url("'+$teamMemberImg+'")'});
4316		}
4317		
4318		
4319		var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').height();
4320		$('.nectar_team_member_overlay .inner-wrap').css({ 'padding-top': $headerNavSpace });
4321		
4322		//no-scroll class - ios ready
4323		if($('.using-mobile-browser').length > 0) {
4324			$('body,html').addClass('nectar-no-scrolling');
4325		}
4326		
4327		teamFullscreenResize();
4328
4329		//transition in
4330		$('.nectar_team_member_overlay').addClass('open').addClass('animating');
4331
4332		setTimeout(function(){
4333			$('.nectar_team_member_close').addClass('visible');
4334			$('.nectar_team_member_overlay').removeClass('animating');
4335		},500);
4336
4337		//bind close mousemove
4338		$(document).on('mousemove',teamMousemoveOn);
4339
4340		//bind overflow
4341		if($('.using-mobile-browser').length == 0) {
4342			fullscreenBioScrolling();
4343		}
4344
4345		if($('.team-member[data-style="bio_fullscreen"]').length > 0 && navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) { 
4346			$('.nectar_team_member_overlay').addClass('on-mobile');
4347		}
4348
4349	});
4350
4351	//close
4352	$('body').on('click','.nectar_team_member_overlay',function(){
4353		if(!$(this).hasClass('animating')) {
4354
4355			$('.nectar_team_member_overlay').removeClass('open');
4356			$('.nectar_team_member_close').removeClass('visible');
4357			
4358			if($('.using-mobile-browser').length > 0) {
4359				$('body,html').removeClass('nectar-no-scrolling');
4360			}
4361			
4362			setTimeout(function(){
4363				
4364				//unbind close mousemove
4365				$(document).off('mousemove',teamMousemoveOn);
4366
4367				$('.nectar_team_member_overlay, .nectar_team_member_close').remove();
4368
4369			},820);
4370		}
4371	});
4372
4373	if($('.team-member[data-style="bio_fullscreen"]').length > 0) {
4374		$(window).resize(teamFullscreenResize);
4375	}
4376
4377	
4378}
4379
4380function teamFullscreenResize() {
4381	var $leftHeaderSize = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 275 : 0;
4382	$('.nectar_team_member_overlay').css({'width' : $(window).width()-$leftHeaderSize, 'left': $leftHeaderSize});
4383}
4384
4385function fullscreenBioScrolling(){ 
4386	$('.nectar_team_member_overlay .inner-wrap').mousewheel(function(event, delta) {
4387
4388	     this.scrollTop -= (delta * 30);
4389	     event.preventDefault();
4390
4391	});
4392
4393}
4394
4395function teamMousemoveOn(e) {
4396	
4397	if($('a:hover').length > 0) {
4398		$('.nectar_team_member_close .inner').removeClass('visible');
4399	} else {
4400		$('.nectar_team_member_close .inner').addClass('visible');
4401	}
4402    $('.nectar_team_member_close').css({
4403       left:  e.pageX - 26,
4404       top:   e.pageY - $(window).scrollTop() - 29
4405    });
4406}
4407
4408if($('.team-member').length > 0) {
4409	teamMemberFullscreen();
4410}
4411
4412/***************** Column Hover BG ******************/
4413
4414function columnBGColors() {	
4415	
4416	var $columnColorCSS = '';
4417
4418	$('.wpb_column').each(function(i){
4419		
4420		$(this).removeClass(function (index, className) {
4421		    return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
4422		});
4423		
4424		$(this).addClass('instance-'+i);
4425
4426		//bg color
4427		if($(this).attr('data-has-bg-color') == 'true') {
4428			if($(this).is('[data-animation*="reveal"]') && $(this).hasClass('has-animation')) {
4429				$columnColorCSS += '.wpb_column.instance-'+i+ ' > .column-bg-overlay { background-color:' + $(this).attr('data-bg-color') + ';  opacity: '+$(this).attr('data-bg-opacity')+'; }';
4430			}
4431			else {
4432				$columnColorCSS += '.wpb_column.instance-'+i+ ' > .column-bg-overlay{ background-color:' + $(this).attr('data-bg-color') + ';  opacity: '+$(this).attr('data-bg-opacity')+'; }';
4433			}
4434		}
4435
4436		//hover bg color
4437		if($(this).is('[data-hover-bg^="#"]')) {
4438			if($(this).is('[data-animation*="reveal"]') && $(this).hasClass('has-animation')) {
4439				 $columnColorCSS += '.wpb_column.instance-'+i+ ':hover > .column-bg-overlay { background-color: '+$(this).attr('data-hover-bg') + '!important; opacity: '+$(this).attr('data-hover-bg-opacity')+'!important; }';
4440			}
4441			else {
4442	   		 $columnColorCSS += '.wpb_column.instance-'+i+ ':hover > .column-bg-overlay { background-color: '+$(this).attr('data-hover-bg') + '!important; opacity: '+$(this).attr('data-hover-bg-opacity')+'!important; }';
4443			}
4444
4445		}
4446	});
4447	
4448	if($('head #column-bg-colors').length > 0) {
4449		$('head #column-bg-colors').remove();
4450	}
4451	if($columnColorCSS.length > 1) {
4452		var head = document.head || document.getElementsByTagName('head')[0];
4453		var style = document.createElement('style');
4454
4455		style.type = 'text/css';
4456		if (style.styleSheet){
4457		  style.styleSheet.cssText = $columnColorCSS;
4458		} else {
4459		  style.appendChild(document.createTextNode($columnColorCSS));
4460		}
4461		
4462		$(style).attr('id','column-bg-colors');
4463		head.appendChild(style);
4464	}
4465
4466}
4467columnBGColors();
4468
4469
4470
4471
4472
4473
4474/***************** morphing button ******************/
4475
4476function morphingOutlines() {
4477
4478	if($('.morphing-outline').length > 0) {
4479
4480		$morphingOutlineCSS = '';
4481		var $frontEndEditorMOSelector =  ($('body.vc_editor').length > 0) ? '' : '>';
4482		
4483		$('.morphing-outline').each(function(i){
4484			
4485			$(this).removeClass(function (index, className) {
4486			    return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
4487			});
4488			
4489			$(this).addClass('instance-'+i).css({'visibility':'visible'});
4490			var $width = $(this).find('.inner').width();
4491			var $height = $(this).find('.inner').height();
4492			var $border = parseInt($(this).attr("data-border-thickness"));
4493			var $hover = ($('body[data-button-style*="rounded"]').length > 0) ? ':hover': '';
4494			var $hover2 = ($('body[data-button-style*="rounded"]').length > 0) ? '': ':hover';
4495
4496			$morphingOutlineCSS += 'body .morphing-outline.instance-'+i+' .inner > * { color: '+$(this).attr("data-starting-color")+'; } ';
4497			$morphingOutlineCSS += 'body .morphing-outline.instance-'+i+' .inner:after  { border-width:'+$(this).attr("data-border-thickness")+'px ; border-color: '+$(this).attr("data-starting-color")+'; } ';
4498			
4499			$morphingOutlineCSS += 'body .wpb_column:hover > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner > *, body .wpb_column:hover > .vc_column-inner > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner > * { color: '+$(this).attr("data-hover-color")+'; } ';
4500			$morphingOutlineCSS += 'body .wpb_column:hover > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after, body .wpb_column:hover > .vc_column-inner > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after  { border-color: '+$(this).attr("data-hover-color")+'; } ';
4501			//padding calcs
4502			$morphingOutlineCSS += 'body .wpb_column'+$hover2+' > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after, body .wpb_column'+$hover2+' > .vc_column-inner > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after { padding: '+(($width+100 + $border*2 - $height)/2 - $border) +'px 50px}';
4503			$morphingOutlineCSS += '.morphing-outline.instance-'+i+' { padding: '+(30+($width+80 + $border*2 - $height)/2 - $border) +'px 50px}'; //extra space on the outer for mobile/close elements
4504			$morphingOutlineCSS += 'body .wpb_column'+$hover2+' > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after, body .wpb_column'+$hover2+' > .vc_column-inner > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after { top: -'+ parseInt((($width+100 + $border*2 - $height)/2 - $border) + $border)+ 'px }';
4505
4506			$morphingOutlineCSS += 'body .wpb_column > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after, body .wpb_column > .vc_column-inner > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after { left: -' + parseInt(50+$border) + 'px }';
4507			////hover
4508			$morphingOutlineCSS += 'body .wpb_column'+$hover+' > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after, body .wpb_column'+$hover+' > .vc_column-inner > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after { padding: 50px 50px}';
4509			$morphingOutlineCSS += 'body .wpb_column'+$hover+' > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after, body .wpb_column'+$hover+' > .vc_column-inner > .wpb_wrapper ' + $frontEndEditorMOSelector + ' .morphing-outline.instance-'+i+' .inner:after { top: -'+parseInt(50+$border) +'px }';
4510
4511		});
4512
4513		var head = document.head || document.getElementsByTagName('head')[0];
4514		var style = document.createElement('style');
4515
4516		style.type = 'text/css';
4517		style.id = 'morphing-outlines';
4518		if (style.styleSheet){
4519		  style.styleSheet.cssText = $morphingOutlineCSS;
4520		} else {
4521		  style.appendChild(document.createTextNode($morphingOutlineCSS));
4522		}
4523
4524		$('#morphing-outlines').remove();
4525		head.appendChild(style);
4526	}
4527}
4528
4529setTimeout(morphingOutlines,100); 
4530setTimeout(fullWidthContentColumns,126);
4531
4532
4533/***************** svg icons *******************/
4534
4535var $svg_icons = [];
4536function svgAnimations() {
4537	
4538	var $svgOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
4539
4540	if($svg_icons.length == 0) {
4541
4542		$('.svg-icon-holder:not(.animated-in)').has('svg').each(function(i){
4543			var $that = $(this);
4544
4545			if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) $that.attr('data-animation','false');
4546
4547			//size
4548			$that.find('svg').css({'height': parseInt($that.attr('data-size')) +'px', 'width': parseInt($that.attr('data-size')) +'px'});
4549
4550			//animation
4551			$(this).find('svg').attr('id','nectar-svg-animation-instance-'+i);
4552			var $animationSpeed = ($that.is('[data-animation-speed]') && $that.attr('data-animation-speed').length > 0) ? $that.attr('data-animation-speed') : 200;
4553			if($that.attr('data-animation') == 'false') { 
4554				$animationSpeed = 1;
4555				$that.css('opacity','1');
4556			}
4557
4558			if(!$that.hasClass('bound')) {
4559				$svg_icons[i] = new Vivus($that.find('svg').attr('id'), {type: 'delayed', pathTimingFunction: Vivus.EASE_OUT, animTimingFunction: Vivus.LINEAR, duration: $animationSpeed, onReady: svgInit });
4560			}
4561
4562			if($animationSpeed !== 1) {
4563
4564				var $that = $(this);
4565				var waypoint = new Waypoint({
4566		 			element: $that,
4567		 			 handler: function(direction) {
4568		 			 	if( $that.hasClass('animated-in')) { 
4569						     waypoint.destroy();
4570						     return;
4571						}
4572
4573		 			 	checkIfReady();
4574						$that.addClass('animated-in');
4575						waypoint.destroy();
4576					},
4577					offset: $svgOffsetPos
4578
4579				}); 
4580
4581			} else {
4582				checkIfReady();
4583			}
4584
4585			function checkIfReady() {
4586				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;
4587				
4588				var $iconID = $that.find('svg').attr('id').replace(/[^0-9]/g,'');
4589
4590				if($svg_icons[$iconID].isReady == true) {
4591					 setTimeout(function(){ $that.css('opacity','1'); $svg_icons[$iconID].reset().play(); },$animationDelay);
4592				} else {
4593					setTimeout(checkIfReady,50);
4594				}
4595			}
4596
4597			function svgInit() {
4598
4599				//set size
4600				$that.css({'height': parseInt($that.attr('data-size')) +'px', 'width': parseInt($that.attr('data-size')) +'px'});
4601
4602
4603			}
4604
4605			$that.addClass('bound');
4606
4607		});	
4608	} else {
4609		$('.svg-icon-holder').addClass('animated-in').css('opacity','1');
4610	}
4611	
4612	//full vc row support
4613	$('#nectar_fullscreen_rows .svg-icon-holder.animated-in').has('svg').each(function(i){
4614		
4615		var $animationDelay = ($(this).is('[data-animation-delay]') && $(this).attr('data-animation-delay').length > 0 && $(this).attr('data-animation') != 'false') ? $(this).attr('data-animation-delay') : 0;
4616		var $that = $(this);
4617
4618		var $iconID = $that.find('svg').attr('id').replace(/[^0-9]/g,'');
4619
4620		clearTimeout($animatedSVGIconTimeout[i]);
4621
4622		if($that.attr('data-animation') == 'false') { 
4623			$animationSpeed = 1;
4624			$that.css('opacity','1');
4625			$svg_icons[$iconID].finish();
4626		} else {
4627			if($(this).parents('.active').length > 0 || $(this).parents('#footer-outer').length > 0 || $('body.mobile').length > 0) {
4628				$svg_icons[$iconID].reset();
4629				$animatedSVGIconTimeout[i] = setTimeout(function(){ $svg_icons[$iconID].play(); },$animationDelay);
4630			}
4631
4632			else {
4633				$svg_icons[$iconID].reset().stop();
4634			}
4635		}
4636	});
4637}
4638//svg in equal height column resize
4639if($('.vc_row-o-equal-height .svg-icon-holder[data-animation="true"]').length > 0 && $('#nectar_fullscreen_rows').length == 0) {
4640	 $(window).on('smartresize', function(){
4641	    clearTimeout($svgResizeTimeout);
4642	    $svgResizeTimeout = setTimeout(function(){ 
4643
4644	    	if($svg_icons.length > 0) {
4645	        	$('.svg-icon-holder.animated-in').each(function(i){
4646					$(this).css('opacity','1');
4647					var $iconID = $(this).attr('id').replace(/[^0-9]/g,'');
4648					$svg_icons[$iconID].finish();
4649				});
4650	        }
4651
4652	     },300);
4653	});
4654}
4655
4656
4657/***************** fancy ul ******************/
4658
4659	function nectar_fancy_ul_init() {
4660		$($fullscreenSelector+'.nectar-fancy-ul').each(function(){
4661
4662
4663			var $icon = $(this).attr('data-list-icon');
4664			var $color = $(this).attr('data-color');
4665			var $animation = $(this).attr('data-animation');
4666			var $animationDelay = ($(this).is('[data-animation-delay]') && $(this).attr('data-animation-delay').length > 0 && $(this).attr('data-animation') != 'false') ? $(this).attr('data-animation-delay') : 0;
4667			
4668			$(this).find('li').each(function(){
4669				
4670				if($(this).find('> i').length == 0) 
4671					$(this).prepend('<i class="icon-default-style '+$icon+ ' ' + $color +'"></i> ');
4672			});
4673
4674			
4675			if($animation == 'true') {
4676
4677
4678				var $that = $(this);
4679				var waypoint = new Waypoint({
4680		 			element: $that,
4681		 			 handler: function(direction) {
4682
4683		 			 	if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
4684						     waypoint.destroy();
4685						     return;
4686						}
4687
4688						setTimeout(function(){
4689			 			 	$that.find('li').each(function(i){
4690			 			 		var $that = $(this);
4691								$that.delay(i*220).transition({
4692									'opacity': '1',
4693									'left' : '0'
4694								},220,'easeOutCubic');
4695							});
4696			 			 },$animationDelay);
4697
4698						$that.addClass('animated-in');
4699						waypoint.destroy();
4700					},
4701					offset: 'bottom-in-view'
4702
4703				}); 
4704
4705			} 
4706			
4707			
4708			
4709		});
4710	}
4711
4712
4713	
4714
4715/***************** flip box min heights ******************/
4716//if content height exceeds min height change it
4717function flipBoxHeights() {
4718	$('.nectar-flip-box').each(function(){
4719		
4720		var $flipBoxMinHeight = parseInt($(this).attr('data-min-height'));
4721		var $flipBoxHeight = ( $(this).find('.flip-box-back .inner').height() > $(this).find('.flip-box-front .inner').height() ) ? $(this).find('.flip-box-back .inner').height() : $(this).find('.flip-box-front .inner').height();
4722
4723		if($flipBoxHeight >= $flipBoxMinHeight - 80) {
4724			$(this).find('> div').css('height', $flipBoxHeight + 80);
4725		} else 
4726			$(this).find('> div').css('height','auto');
4727
4728	});
4729}
4730flipBoxHeights();
4731
4732if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
4733	$('body').on('click','.nectar-flip-box', function(){
4734		$(this).toggleClass('flipped');
4735	});
4736}
4737
4738/***************** PARALLAX SECTIONS ******************/
4739	
4740	var $window = $(window);
4741	var windowHeight = $window.height();
4742
4743		
4744	$window.off('scroll.parallaxSections').off('resize.parallaxSections');
4745	$window.unbind('resize.parallaxSectionsUpdateHeight');
4746	$window.unbind('load.parallaxSectionsOffsetL');
4747	$window.unbind('resize.parallaxSectionsOffsetR');
4748
4749	$window.on('resize.parallaxSectionsUpdateHeight',psUpdateWindowHeight);
4750
4751	function psUpdateWindowHeight() {
4752		windowHeight = $window.height();
4753	}
4754
4755	function psUpdateOffset($this) {
4756		$this.each(function(){
4757	  	    firstTop = $this.offset().top;
4758		});
4759	}
4760	
4761	var firstTop;
4762	
4763	$.fn.parallaxScroll = function(xpos, speedFactor, outerHeight) {
4764		var $this = $(this);
4765		var getHeight;
4766		var paddingTop = 0;
4767		
4768		var $windowDOMWidth = window.innerWidth, $windowDOMHeight = window.innerHeight;
4769		var $orientationChange = 0;
4770		
4771		//get the starting position of each element to have parallax applied to it		
4772		$this.each(function(){
4773		    firstTop = $this.offset().top;
4774		});
4775
4776		
4777		$window.on('resize.parallaxSectionsOffsetR',psUpdateOffset($this));
4778		$window.on('load.parallaxSectionsOffsetL',psUpdateOffset($this));
4779	
4780		getHeight = function(jqo) {
4781			return jqo.outerHeight(true);
4782		};
4783		 
4784			
4785		// setup defaults if arguments aren't specified
4786		if (arguments.length < 1 || xpos === null) xpos = "50%";
4787		if (arguments.length < 2 || speedFactor === null) speedFactor = 0.25;
4788		if (arguments.length < 3 || outerHeight === null) outerHeight = true;
4789		
4790		// function to be called whenever the window is scrolled or resized
4791
4792		var $element, top, height;
4793		
4794		var ua = window.navigator.userAgent;
4795		var msie = ua.indexOf("MSIE ");
4796		var $onMobileBrowser = navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/);		
4797		
4798		var $toTransformOrNot = ($smoothCache == true) ? true : false;
4799		
4800		if(!$toTransformOrNot) {
4801			$this.find('.row-bg.using-image, .page-header-bg-image, .image-bg, .video-wrap').addClass('translate');
4802		}
4803		
4804		var $ifFast = 0;
4805		$element = $this;
4806		
4807		height = getHeight($element);
4808		
4809		var classic_mobile_menu_open = false;
4810		
4811		setInterval(function(){
4812			height = getHeight($element);
4813			
4814			classic_mobile_menu_open = ( $('body.classic_mobile_menu_open.mobile').length > 0 ) ? true : false;
4815			
4816		},600);
4817		
4818		var firstSection = ( ($element.parents('.top-level').length > 0 && $element.parents('.parallax_slider_outer').length > 0) || ($element.parents('.top-level').length > 0 && $element.is('.nectar-recent-posts-single_featured') ) || $element.is('.wpb_row.top-level') || $('.wpb_row').length == 0) ? true : false;
4819		
4820		//for first nectar slider shortcode without page builder or portfolio first
4821		if( $('.wpb_row').length == 0 && $element.parents('.parallax_slider_outer').length > 0 && $element.is('[data-full-width="true"]') ||
4822	      ($('#portfolio-extra').length > 0 && $element.parents('.parallax_slider_outer').length > 0 && $element.parents('.wpb_row').length > 0 && $element.parents('.wpb_row').index() == '0') ) {
4823			firstSection = true;
4824		}
4825		
4826		if(nectarDOMInfo.usingFrontEndEditor) {
4827			firstSection = false;
4828		}
4829		
4830		var nectarSliderElBool = $this.is('.nectar-slider-wrap');
4831		var pageHeaderBool = ($this.find('.page-header-bg-image').length > 0) ? true : false;
4832		
4833		var $elToParallax = false;
4834		
4835		if(nectarSliderElBool) {
4836			
4837				if($this.find('.video-wrap').length > 0 || $this.find('.image-bg').length > 0) {
4838					$elToParallax = $this.find('.video-wrap, .image-bg');
4839				} 
4840		}
4841		else {
4842			
4843				if($this.find('.row-bg.using-image').length > 0) {
4844					
4845					$elToParallax = $this.find('.row-bg.using-image');
4846					
4847				} else if($this.find('.page-header-bg-image').length > 0) {
4848					
4849					$elToParallax = $this.find('.page-header-bg-image');
4850				}
4851				
4852		}
4853		
4854
4855		function update(){
4856				
4857				firstTop = $element.offset().top;
4858				
4859				// Check if totally above or totally below viewport
4860				if ($elToParallax == false || firstTop + height < nectarDOMInfo.scrollTop || firstTop > nectarDOMInfo.scrollTop + windowHeight || $('body.material-ocm-open').length > 0) {
4861					
4862				} else {
4863
4864		        //for IE, Safari or any setup using the styled scrollbar default to animating the BG pos
4865		        if ($toTransformOrNot) {
4866		        	$this.find('.row-bg.using-image').css('backgroundPosition', xpos + " " + Math.round((firstTop - nectarDOMInfo.scrollTop) * speedFactor) + "px");
4867		        }
4868		       	//for Firefox/Chrome use a higher performing method
4869		        else  {
4870							
4871							//nectar slider
4872							if(nectarSliderElBool) {
4873									
4874								 if(firstSection) {
4875									 //top level row
4876 										if(!classic_mobile_menu_open) {
4877									 		$this.find('.video-wrap, .image-bg').css({ 'transform':  'translate3d(0, ' + parseFloat(nectarDOMInfo.scrollTop * speedFactor)  + 'px, 0)' }); 
4878									  }
4879								 } else {
4880									 	$this.find('.video-wrap, .image-bg').css({ 'transform':  'translate3d(0, ' + parseFloat((($windowDOMHeight + nectarDOMInfo.scrollTop -  firstTop) * speedFactor) ) + 'px, 0)' }); 
4881								 }
4882								
4883							} else {
4884								
4885								//rows
4886								if(firstSection) {
4887									//top level row
4888									if(!classic_mobile_menu_open) {
4889		        				$elToParallax.css({ 'transform':  'translate3d(0, ' + parseFloat(nectarDOMInfo.scrollTop * speedFactor)  + 'px, 0)' });
4890									}
4891								} else {
4892									//regular rows
4893									$elToParallax.css({ 'transform':  'translate3d(0, ' + parseFloat((($windowDOMHeight + nectarDOMInfo.scrollTop -  firstTop) * speedFactor) ) + 'px, 0), scale(1.005)' });
4894								}
4895								
4896								//page header
4897								if(pageHeaderBool && !classic_mobile_menu_open) {
4898									$elToParallax.css({ 'transform':  'translate3d(0, ' + parseFloat(nectarDOMInfo.scrollTop * speedFactor) + 'px, 0)' });
4899								}
4900							
4901							}
4902							
4903						} 
4904				
4905				}
4906				
4907
4908			//if on mobile, auto RAF
4909			if($onMobileBrowser){
4910				requestAnimationFrame(update); 
4911			}
4912			
4913		}		
4914
4915		if (window.addEventListener) {
4916			
4917			if(nectarDOMInfo.usingFrontEndEditor) {
4918				$(window).on('scroll.parallaxSections', update);
4919				
4920				$(window).resize(function(){
4921					$windowDOMWidth = window.innerWidth;
4922					$windowDOMHeight = window.innerHeight;
4923				});
4924				
4925			}
4926			else if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
4927					 window.addEventListener('scroll', function(){ 
4928			          requestAnimationFrame(update); 
4929			     }, false);
4930					 
4931					 $(window).resize(function(){
4932						 $windowDOMWidth = window.innerWidth;
4933						 $windowDOMHeight = window.innerHeight;
4934					 });
4935					 
4936			 } else {
4937				 	//if on mobile, auto RAF
4938					requestAnimationFrame(update); 
4939					
4940
4941					window.addEventListener("orientationchange", function() {
4942						 $orientationChange = 1;
4943					});
4944					
4945					$(window).resize(function(){
4946							if( ($(window).width() != $windowDOMWidth && $(window).height != $windowDOMHeight) || $orientationChange == 1){
4947
4948									//store the current window dimensions
4949									$windowDOMWidth = window.innerWidth;
4950									$windowDOMHeight = window.innerHeight;
4951									
4952									$orientationChange = 0;
4953							}
4954					});
4955					 
4956			 }
4957			 
4958		}
4959
4960		$window.on('resize.parallaxSections',update);
4961
4962		update();
4963	};
4964
4965 
4966
4967	
4968/***************** Full Width Section ******************/
4969
4970	//nectar slider in container but fullwidth fix
4971	$('.wpb_row .vc_col-sm-12 .nectar-slider-wrap[data-full-width="true"]').each(function(){
4972		if($(this).parents('.wpb_row.full-width-section').length == 0 && $(this).parents('.wpb_row.full-width-content').length == 0) {
4973			$(this).parents('.wpb_row').addClass('full-width-section');
4974		}
4975	});
4976
4977	function fullWidthSections(){
4978
4979		var $windowInnerWidth = window.innerWidth;
4980		var $scrollBar = ($('#ascrail2000').length > 0 && $windowInnerWidth > 1000) ? -13 : 0;
4981		var $bodyBorderWidth = ($('.body-border-right').length > 0 && $windowInnerWidth > 1000) ? parseInt($('.body-border-right').width())*2 : 0;
4982		var $justOutOfSight;
4983		
4984		if($('#boxed').length == 1){
4985			$justOutOfSight = ((parseInt($('.container-wrap').width()) - parseInt($('.main-content').width())) / 2) + 4;
4986		} else {
4987			
4988			//if the ext responsive mode is on - add the extra padding into the calcs
4989			var $extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && $windowInnerWidth >= 1000) ? 180 : 0;
4990			var $leftHeaderSize = ($('#header-outer[data-format="left-header"]').length > 0 && $windowInnerWidth >= 1000) ? parseInt($('#header-outer[data-format="left-header"]').width()) : 0;
4991			if($(window).width() - $leftHeaderSize - $bodyBorderWidth  <= parseInt($('.main-content').css('max-width'))) { 
4992				var $windowWidth = parseInt($('.main-content').css('max-width'));
4993
4994				//no need for the scrollbar calcs with ext responsive on desktop views
4995				if($extResponsivePadding == 180) $windowWidth = $windowWidth - $scrollBar;
4996
4997			} else { 
4998				var $windowWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth;
4999			}
5000
5001			
5002			var $contentWidth = parseInt($('.main-content').css('max-width'));
5003
5004			//single post fullwidth
5005			if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 ) {
5006				$contentWidth = $('.post-area').width();
5007				$extResponsivePadding = 0;
5008			}
5009			
5010			$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
5011		}
5012		
5013	
5014	    //full width content sections
5015	    $('.carousel-outer').has('.carousel-wrap[data-full-width="true"]').css('overflow','visible');
5016	    
5017	    $('.carousel-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"]:not(.fullwidth-constrained), .full-width-content').each(function(){
5018			
5019			var $leftHeaderSize = ($('#header-outer[data-format="left-header"]').length > 0 && $windowInnerWidth >= 1000) ? parseInt($('#header-outer[data-format="left-header"]').width()) : 0;
5020			var $bodyBorderWidth = ($('.body-border-right').length > 0 && $windowInnerWidth > 1000) ? (parseInt($('.body-border-right').width())*2) - 2 : 0;
5021
5022			//single post fullwidth
5023			if($('#boxed').length == 1){
5024
5025				var $mainContentWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').width()) : parseInt($(this).parents('.container').width());
5026
5027				if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 && $(this).parents('.post-area').length > 0) {
5028					$contentWidth = $('.post-area').width();
5029					$extResponsivePadding = 0;
5030					$windowWidth = $(window).width() - $bodyBorderWidth;
5031					$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
5032				} else {
5033					if($(this).parents('.page-submenu').length > 0)
5034						$justOutOfSight = ((parseInt($('.container-wrap').width()) - $mainContentWidth) / 2);
5035					else 
5036						$justOutOfSight = ((parseInt($('.container-wrap').width()) - $mainContentWidth) / 2) + 4;
5037				}
5038			} else {
5039				if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 && $(this).parents('.post-area').length > 0) {
5040					$contentWidth = $('.post-area').width();
5041					$extResponsivePadding = 0;
5042					$windowWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth;
5043				} else {
5044
5045					var $mainContentMaxWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').css('max-width')) : parseInt($(this).parents('.container').css('max-width'));
5046
5047					//when using gutter on portfolio don't add extra space for scroll bar
5048			    	if($('#boxed').length == 0 && $(this).hasClass('portfolio-items') && $(this).is('[data-gutter*="px"]') && $(this).attr('data-gutter').length > 0 && $(this).attr('data-gutter') != 'none') {
5049			    		$scrollBar = ($('#ascrail2000').length > 0 && $windowInnerWidth > 1000) ? -13 : 0;
5050			    	}
5051
5052					if($(window).width() - $leftHeaderSize - $bodyBorderWidth <= $mainContentMaxWidth) { 
5053						$windowWidth = $mainContentMaxWidth;
5054						//no need for the scrollbar calcs with ext responsive on desktop views
5055						if($extResponsivePadding == 180) $windowWidth = $windowWidth - $scrollBar;
5056					}
5057					$contentWidth = $mainContentMaxWidth;
5058					$extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1000) ? 180 : 0;
5059					if($leftHeaderSize > 0) $extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1000) ? 120 : 0;
5060				}
5061
5062				$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
5063			}
5064
5065			var $extraSpace = 0;
5066			if( $(this).hasClass('carousel-wrap')) $extraSpace = 1;
5067			if( $(this).hasClass('portfolio-items')) $extraSpace = 5;
5068			
5069	    	var $carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : $(window).width() - $leftHeaderSize - $bodyBorderWidth +$extraSpace  + $scrollBar ;
5070
5071	    	//when using gutter on portfolio don't add extra space
5072	    	if($('#boxed').length == 0 && $(this).hasClass('portfolio-items') && $(this).is('[data-gutter*="px"]') && $(this).attr('data-gutter').length > 0 && $(this).attr('data-gutter') != 'none') {
5073	    		if($(window).width() > 1000)
5074	    			$carouselWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth + $scrollBar + 3
5075	    		else 
5076	    			$carouselWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth + $scrollBar 
5077	    	}
5078
5079	    	if($(this).parent().hasClass('default-style')) { 
5080
5081	    		var $mainContentWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').width()) : parseInt($(this).parents('.container').width());
5082	    		
5083	    		if($('#boxed').length != 0) {
5084	    			$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : $(window).width() - $leftHeaderSize + $extraSpace + $scrollBar ;
5085				}
5086				else {
5087					$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : ($(window).width() - $leftHeaderSize - $bodyBorderWidth) - (($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.025) + $extraSpace + $scrollBar ;
5088					$windowWidth = ($(window).width() - $leftHeaderSize - $bodyBorderWidth <= $mainContentWidth) ? $mainContentWidth : ($(window).width() - $leftHeaderSize - $bodyBorderWidth) - (($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.025);
5089					$justOutOfSight = Math.ceil( (($windowWidth + $scrollBar - $mainContentWidth) / 2) )
5090				}
5091			}
5092
5093			else if($(this).parent().hasClass('spaced')) { 
5094
5095				var $mainContentWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').width()) : parseInt($(this).parents('.container').width());
5096
5097				if($('#boxed').length != 0) {
5098	    			$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) - ($(window).width()*.02) : $(window).width() + $extraSpace + $scrollBar ;
5099				} else {
5100					$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : ($(window).width()- $leftHeaderSize - $bodyBorderWidth)  - Math.ceil(($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.02) + $extraSpace + $scrollBar ;
5101					var $windowWidth2 = ($(window).width() - $leftHeaderSize - $bodyBorderWidth <= $mainContentWidth) ? $mainContentWidth : ($(window).width() - $leftHeaderSize - $bodyBorderWidth) - (($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.02);
5102					$justOutOfSight = Math.ceil( (($windowWidth2 + $scrollBar - $mainContentWidth) / 2) +2)
5103				}
5104			}
5105	    	
5106	    	if(!$(this).parents('.span_9').length > 0 && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner' && $(this).parent().attr('id') != 'portfolio-extra' 
5107	      && !$(this).find('.carousel-wrap[data-full-width="true"]').length > 0
5108				&& !$(this).find('.nectar-carousel-flickity-fixed-content').length > 0
5109	    	&& !$(this).find('.portfolio-items:not(".carousel")[data-col-num="elastic"]').length > 0){
5110
5111	    		//escape if inside woocoommerce page and not using applicable layout
5112	    		if($('.single-product').length > 0 && $(this).parents('#tab-description').length > 0 && $(this).parents('.full-width-tabs').length == 0) {
5113	    			$(this).css({
5114						'visibility': 'visible'
5115					});	
5116	    		} else {
5117	    			if($(this).hasClass('portfolio-items')) {
5118		    				$(this).css({
5119								'transform': 'translateX(-'+ $justOutOfSight + 'px)',
5120								'margin-left': 0,
5121								'left': 0,
5122								'width': $carouselWidth,
5123								'visibility': 'visible'
5124							});	
5125	    			} else {
5126							
5127							//fullscreen page rows left fix
5128							if($('#nectar_fullscreen_rows').length > 0 && $(this).hasClass('wpb_row')) {
5129								$(this).css({
5130									'margin-left': - $justOutOfSight,
5131									'width': $carouselWidth,
5132									'visibility': 'visible'
5133								});	
5134							} else {
5135								$(this).css({
5136									'left': 0,
5137									'margin-left': - $justOutOfSight,
5138									'width': $carouselWidth,
5139									'visibility': 'visible'
5140								});	
5141							}
5142							
5143	    			}
5144					
5145				}
5146			}  else if($(this).parent().attr('id') == 'portfolio-extra' && $('#full_width_portfolio').length != 0) {
5147				$(this).css({
5148					'left': 0,
5149					'margin-left': - $justOutOfSight,
5150					'width': $carouselWidth,
5151					'visibility': 'visible'
5152				});	
5153			}
5154			
5155			else {
5156
5157				$(this).css({
5158					'margin-left': 0,
5159					'width': 'auto',
5160					'left': '0',
5161					'visibility': 'visible'
5162				});	
5163			}
5164	    	
5165	    });
5166			
5167	}
5168	
5169	var $contentElementsNum = ($('#portfolio-extra').length == 0) ? $('.main-content > .row > *').length : $('.main-content > .row #portfolio-extra > *').length ;
5170
5171	function parallaxSrollSpeed(speedString) {
5172
5173		var ua = window.navigator.userAgent;	
5174		var msie = ua.indexOf("MSIE ");
5175		var speed;
5176
5177		 //not as modern browsers
5178		 if ($smoothCache == true) {
5179			 switch(speedString) {
5180			   	  case 'slow':
5181			   	      speed = 0.2;
5182			   	      break;
5183			   	  case 'medium': 
5184			   	  	  speed = 0.4;
5185			   	      break;
5186			   	  case 'fast': 
5187			    	  speed = 0.6;
5188			   	       break;
5189			   }
5190		}
5191		 //chrome/ff
5192		 else {
5193		 	 switch(speedString) {
5194			   	  case 'slow':
5195			   	      speed = 0.6;
5196			   	      break;
5197			   	  case 'medium': 
5198			   	  	  speed = 0.4;
5199			   	      break;
5200			   	  case 'fast': 
5201			    	  speed = 0.25;
5202			   	       break;
5203			   }
5204		}
5205
5206		   return speed;
5207	}
5208
5209	function parallaxScrollInit(){
5210		
5211		if(nectarDOMInfo.usingMobileBrowser && $('body[data-remove-m-parallax="1"]').length > 0) {
5212			return;
5213		}
5214		
5215		parallaxRowsBGCals();
5216		
5217		$('.nectar-recent-posts-single_featured, .wpb_row.parallax_section, #page-header-bg[data-parallax="1"] .page-header-bg-image-wrap, .parallax_slider_outer .nectar-slider-wrap').each(function(){
5218		   var $id = $(this).attr('id');	
5219
5220		    var ua = window.navigator.userAgent;	
5221		    var msie = ua.indexOf("MSIE ");
5222
5223			if ($smoothCache == true)  {
5224				
5225		   		if($(this).find('[data-parallax-speed="fixed"]').length == 0) { 
5226						
5227							if($(this).find('.row-bg').length == 0) {
5228								$('#'+$id).parallaxScroll("50%", 0.25);
5229							} else {
5230								$('#'+$id + ".parallax_section").parallaxScroll("50%", parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')) );
5231							}
5232					}
5233					
5234		  } else if($(this).find('[data-parallax-speed="fixed"]').length == 0) {
5235				
5236					if($(this).find('.row-bg').length == 0) {
5237							//set default scroll speed if not defined
5238							$('#'+$id).parallaxScroll("50%", 0.25);
5239					} else {
5240							$('#'+$id + ".parallax_section").parallaxScroll("50%", parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')) );
5241					}
5242		  }
5243			
5244			$(this).addClass('nectar-parallax-enabled');
5245			
5246		});
5247		
5248	}
5249	
5250	
5251	
5252	//add first class for rows for page header trans effect (zoom only as of now)
5253	$('.full-width-section.wpb_row, .full-width-content.wpb_row').each(function(){
5254		
5255		if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){
5256			
5257			
5258			if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false;
5259				
5260			if($(this).index() == '0' && $('#page-header-bg').length == 0 && $('.page-header-no-bg').length == 0 
5261							 && $('.project-title').length == 0 && $('body.single').length == 0 
5262							 && $('.project-title').length == 0 ) {
5263
5264				$(this).addClass('first-section');
5265				var $that = $(this);
5266				setTimeout( function() { $that.addClass('loaded'); },50);
5267				
5268			} 
5269				
5270
5271		}
5272	});	
5273	
5274	
5275	
5276
5277	parallaxScrollInit();
5278	parallaxRowsBGCals();
5279
5280	function parallaxRowsBGCals(){
5281		
5282		if(nectarDOMInfo.usingMobileBrowser && $('body[data-remove-m-parallax="1"]').length > 0) {
5283			return;
5284		}
5285
5286		$('.nectar-recent-posts-single_featured, .wpb_row.parallax_section, #page-header-bg[data-parallax="1"] .page-header-bg-image-wrap, .parallax_slider_outer .nectar-slider-wrap .slide-bg-wrap').each(function(){
5287			
5288			 var ua = window.navigator.userAgent;
5289		   var msie = ua.indexOf("MSIE ");
5290
5291			 if ($smoothCache == true) {
5292			 	 $(this).find('.row-bg').css({'height': $(this).outerHeight(true)*2.8, 'margin-top': '-' + ($(this).outerHeight(true)*2.8)/2 + 'px' });
5293			 } else {
5294				 
5295				 if($(this).find('.row-bg').length == 0 && $(this).find('.page-header-bg-image').length > 0 ) {
5296					 	//$(this).find('.page-header-bg-image').css({'height': $(this).outerHeight(true)   });
5297				 } 
5298				 else if($(this).find('.row-bg').length == 0 && $(this).find('.image-bg').length > 0 ) {
5299					 	
5300						var $non_page_builder_slider = false;
5301						//for first nectar slider shortcode without page builder
5302				 		if( $('.wpb_row').length == 0 && $(this).parents('.nectar-slider-wrap[data-full-width="true"]').length > 0 && $(this).parents('.parallax_slider_outer').length > 0 && $(this).parents('.parallax_slider_outer').index() == '0' ) {
5303				 			$non_page_builder_slider = true;
5304				 		}
5305						//portfolio first
5306						if($('#portfolio-extra').length > 0 && $(this).parents('.wpb_row').length > 0 && $(this).parents('.parallax_slider_outer').length > 0 && $(this).parents('.wpb_row').index() == '0' ) {
5307								$non_page_builder_slider = true;
5308						}
5309					 
5310					 if($(this).parents('.top-level').length > 0 && !nectarDOMInfo.usingFrontEndEditor || $non_page_builder_slider && !nectarDOMInfo.usingFrontEndEditor) {
5311						 $(this).find('.image-bg').css({'height':  Math.ceil( $(this).parent().offset().top * 0.25 ) + $(this).outerHeight(true) });
5312					 } else {
5313						 	$(this).find('.image-bg').css({'height': Math.ceil( $(window).height() * 0.25 ) + $(this).outerHeight(true)   });
5314					 }
5315					 
5316				 }
5317				 else if($(this).find('.row-bg').length == 0 && $(this).find('.video-wrap').length > 0 ) {
5318					 
5319					 
5320					 var $non_page_builder_slider = false;
5321					 //for first nectar slider shortcode without page builder
5322					 if( $('.wpb_row').length == 0 && $(this).parents('.nectar-slider-wrap[data-full-width="true"]').length > 0 && $(this).parents('.parallax_slider_outer').length > 0 && $(this).parents('.parallax_slider_outer').index() == '0' ) {
5323						 $non_page_builder_slider = true;
5324					 } 
5325					 //portfolio first
5326					 if($('#portfolio-extra').length > 0 && $(this).parents('.wpb_row').length > 0 && $(this).parents('.parallax_slider_outer').length > 0 && $(this).parents('.wpb_row').index() == '0' ) {
5327							 $non_page_builder_slider = true;
5328					 }
5329					 
5330					 if($(this).parents('.top-level').length > 0 && !nectarDOMInfo.usingFrontEndEditor || $non_page_builder_slider && !nectarDOMInfo.usingFrontEndEditor) {
5331						 $(this).find('.video-wrap').css({'height': Math.ceil( $(this).parent().offset().top * 0.25 ) + $(this).outerHeight(true) });
5332					 } else {
5333						 	$(this).find('.video-wrap').css({'height': Math.ceil( $(window).height() * 0.25 ) + $(this).outerHeight(true)   });
5334					 }
5335					 
5336					 var vid = $(this).find('.video-wrap video');
5337					 var vid_w_orig = 1280;
5338					 var vid_h_orig = 720;
5339
5340					 // get the parent element size
5341					 var container_w = vid.parent().width();
5342					 var container_h = vid.parent().height();	 
5343					 var scale_w = container_w / vid_w_orig;
5344					 var scale_h = container_h / vid_h_orig;
5345					 var scale = scale_w > scale_h ? scale_w : scale_h;
5346					 
5347					 // scale the video
5348					 vid.width(scale * vid_w_orig);
5349					 vid.height(scale * vid_h_orig);
5350
5351				 }  
5352				 else {
5353					  
5354					 	if($(this).is('.nectar-recent-posts-single_featured') && $(this).parents('.top-level').length > 0 && !nectarDOMInfo.usingFrontEndEditor ) {
5355							
5356						}
5357					 	else if( !$(this).hasClass('top-level') || nectarDOMInfo.usingFrontEndEditor) {
5358							var $ifFast = ($(this).find('.row-bg[data-parallax-speed="fast"]').length > 0) ? 60 : 0;
5359						 	$(this).find('.row-bg').css({'height': Math.ceil( $(window).height() * parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')) ) + $(this).outerHeight(true) + $ifFast  });
5360						} 
5361						
5362				 }
5363			 
5364			 }
5365			 
5366		});
5367	}
5368	
5369	//if fullwidth section is first or last, remove the margins so it fits flush against header/footer
5370	function fwsClasses() {
5371		
5372		$('.wpb_wrapper > .nectar-slider-wrap[data-full-width="true"]').each(function(){
5373			if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){
5374				if($(this).parents('.wpb_row').index() == '0'){
5375					$(this).addClass('first-nectar-slider');
5376				} 
5377			}
5378		});
5379
5380		if($('#portfolio-extra').length == 0) {
5381			$contentElementsNum = ($('.main-content > .row > .wpb_row').length > 0) ? $('.main-content > .row > .wpb_row').length : $('.main-content > .row > *').length;
5382		} else {
5383			$contentElementsNum = $('.main-content > .row #portfolio-extra > *').length;
5384		}
5385
5386		$('.full-width-section, .full-width-content:not(.page-submenu .full-width-content):not(.blog-fullwidth-wrap), .row > .nectar-slider-wrap[data-full-width="true"], .wpb_wrapper > .nectar-slider-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"]').each(function(){
5387			
5388			if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){
5389				
5390				if($(this).parents('.wpb_row').length > 0){ 
5391				
5392					if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false;
5393					
5394					////first
5395					if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length != 0 ){
5396						//$(this).css('margin-top','-2.1em').addClass('first-section nder-page-header');
5397					} 
5398					else if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length == 0 && $('.page-header-no-bg').length == 0 
5399					         && $('.project-title').length == 0 && $(this).parents('.wpb_row').index() == '0' 
5400					         && $('.project-title').length == 0 
5401					         && $('body[data-bg-header="true"]').length == 0) {
5402
5403					     if($('.single').length == 0) {
5404					     	$('.container-wrap').css('padding-top','0px');
5405					     } else {
5406					     	$(this).addClass('first-section');
5407					     } 	
5408						
5409					} 
5410					
5411					//check if it's also last (i.e. the only fws)
5412					if($(this).parents('.wpb_row').index() == $contentElementsNum-1 && $('#respond').length == 0 ) { 
5413						if($(this).attr('id') != 'portfolio-filters-inline') {
5414							$('.container-wrap').css('padding-bottom','0px');
5415							$('#call-to-action .triangle').remove();
5416						}
5417					} 
5418				
5419				} else {
5420
5421					if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false;
5422					
5423					if( $(this).find('.portfolio-filters-inline').length == 0 && $(this).attr('id') != 'post-area' ) {
5424						
5425						////first
5426						if($(this).index() == '0' && $('#page-header-bg').length != 0 ){
5427							//$(this).css('margin-top','-2.1em').addClass('first-section nder-page-header');
5428			
5429						} 
5430						else if($(this).index() == '0' && $('#page-header-bg').length == 0 && $(this).index() == '0' && $('.page-header-no-bg').length == 0 && 
5431						        $(this).index() == '0' && !$(this).hasClass('blog_next_prev_buttons') && !$(this).hasClass('nectar-shop-outer') && $(this).parents('.pum-container').length == 0 ) {
5432						     
5433						      if($('body[data-header-resize="0"]').length == 1 && $('.single').length == 0 || $('body.material').length > 0 && $('.single').length == 0) { 
5434											
5435											if(!$('body.blog .blog-fullwidth-wrap > .masonry:not(.meta-overlaid)').length > 0) {
5436						          	$('.container-wrap').css('padding-top','0px');
5437											}
5438											
5439						      } else {
5440						      	  $(this).addClass('first-section');
5441						      }   	
5442							
5443						} 
5444						
5445						//check if it's also last (i.e. the only fws)
5446						if($(this).index() == $contentElementsNum-1 && $('#respond').length == 0 && $('body.woocommerce-checkout').length == 0) { 
5447							$('.container-wrap').css('padding-bottom','0px');
5448							$('.bottom_controls').css('margin-top','0px');
5449							$('#call-to-action .triangle').remove();
5450						} 
5451					}
5452					
5453				}
5454			}
5455		});
5456
5457
5458		$('#portfolio-extra > .nectar-slider-wrap[data-full-width="true"], .portfolio-wrap').each(function(){
5459			//check if it's last 
5460			if($(this).index() == $contentElementsNum-1 && $('#commentform').length == 0 && $('#pagination').length == 0) { 
5461				if(parseInt($('.container-wrap').css('padding-bottom')) > 0) $(this).css('margin-bottom','-40px');
5462				$('#call-to-action .triangle').remove();
5463			}
5464		});
5465		
5466
5467		$('.portfolio-filters').each(function(){
5468			////first
5469			if($(this).index() == '0' && $('#page-header-bg').length != 0 || $(this).index() == '0' ){
5470				$(this).addClass('first-section nder-page-header');
5471			}  else if($(this).index() == '0' && $('#page-header-bg').length == 0 || $(this).index() == '0'){
5472				$(this).css({'margin-top':'0px'}).addClass('first-section');
5473			}
5474		});
5475		
5476		$('.portfolio-filters-inline').each(function(){
5477			////first
5478			if($(this).parents('.wpb_row').length > 0){ 
5479				
5480				if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length != 0 || $(this).parents('.wpb_row').index() == '0' ){
5481					if($('body[data-header-resize="0"]').length == 0) { 
5482						//$(this).css({'margin-top':'-2.1em', 'padding-top' : '19px'}).addClass('first-section nder-page-header');
5483					}
5484				}  
5485				
5486			} else {
5487				if($(this).index() == '0' && $('#page-header-bg').length != 0 || $(this).index() == '0' ){
5488					$(this).css({'margin-top':'-2.1em', 'padding-top' : '19px'}).addClass('first-section nder-page-header');
5489				}  else if($(this).index() == '0' && $('#page-header-bg').length == 0 || $(this).index() == '0'){
5490					
5491					//if($('body[data-header-resize="0"]').length == 1 || $('body.material').length > 0) { 
5492				          $(this).css({'margin-top':'-30px', 'padding-top' : '50px'}).addClass('first-section');
5493				      //} else {
5494				      //	  $(this).css({'margin-top':'-70px', 'padding-top' : '50px'}).addClass('first-section');
5495				      //} 
5496
5497				
5498				}
5499			}
5500			
5501		});
5502		
5503
5504	}
5505	
5506
5507	//sizing for fullwidth sections that are image only
5508
5509	function fullwidthImgOnlySizingInit(){
5510		////set inital sizes
5511		$('.full-width-section:not(.custom-skip)').each(function(){
5512			
5513			var $fwsHeight = $(this).outerHeight(true);
5514
5515			//make sure it's empty and also not being used as a small dvider
5516			if($(this).find('.span_12 *').length == 0 && $.trim( $(this).find('.span_12').text() ).length == 0  && $fwsHeight > 40){
5517				$(this).addClass('bg-only');
5518				$(this).css({'height': $fwsHeight, 'padding-top': '0px', 'padding-bottom': '0px'});
5519				$(this).attr('data-image-height',$fwsHeight);
5520			}
5521
5522		});
5523	}
5524
5525	function fullwidthImgOnlySizing(){
5526
5527		$('.full-width-section.bg-only').each(function(){
5528			var $initialHeight = $(this).attr('data-image-height');
5529			
5530			if( window.innerWidth < 1000 && window.innerWidth > 690 ) {
5531				$(this).css('height', $initialHeight - $initialHeight*.60);
5532			} 
5533			
5534			else if( window.innerWidth <= 690 ) {
5535				$(this).css('height', $initialHeight - $initialHeight*.78);
5536			} 
5537			
5538			else if( window.innerWidth < 1300 && window.innerWidth >= 1000  ) {
5539				$(this).css('height', $initialHeight - $initialHeight*.33);
5540			} 
5541			
5542			else {
5543				$(this).css('height', $initialHeight);
5544			}
5545			
5546		});
5547		
5548	}
5549
5550	fullwidthImgOnlySizingInit();
5551	fullwidthImgOnlySizing();
5552	
5553	
5554	
5555	//change % padding on rows to be relative to screen
5556	function fullWidthRowPaddingAdjustInit(){
5557		if($('#boxed').length == 0){
5558			$('.full-width-section, .full-width-content').each(function(){
5559				var $topPadding = $(this)[0].style.paddingTop;
5560				var $bottomPadding = $(this)[0].style.paddingBottom;
5561
5562				if($topPadding.indexOf("%") >= 0) $(this).attr('data-top-percent',$topPadding);
5563				if($bottomPadding.indexOf("%") >= 0) $(this).attr('data-bottom-percent',$bottomPadding);
5564				
5565
5566			});
5567		}
5568	}
5569
5570	function fullWidthRowPaddingAdjustCalc(){
5571		if($('#boxed').length == 0){
5572			$('.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(){
5573
5574				var $windowHeight = $(window).width();
5575				var $topPadding = ($(this).attr('data-top-percent')) ? $(this).attr('data-top-percent') : 'skip';
5576				var $bottomPadding = ($(this).attr('data-bottom-percent')) ? $(this).attr('data-bottom-percent') : 'skip';
5577
5578				//top
5579				if($topPadding != 'skip') {
5580					$(this).css('padding-top',$windowHeight*(parseInt($topPadding)/100));
5581				}
5582
5583				//bottom
5584				if($bottomPadding != 'skip'){
5585					$(this).css('padding-bottom',$windowHeight*(parseInt($bottomPadding)/100));
5586				}
5587				
5588
5589			});
5590		}
5591	}
5592	if(nectarDOMInfo.usingMobileBrowser) {
5593		fullWidthRowPaddingAdjustCalc();
5594	}
5595
5596	
5597	//full width content column sizing
5598	function fullWidthContentColumns(){
5599		
5600		var $frontEndEditorElDiv = ($('body.vc_editor').length > 0) ? '.vc_element > ': '';
5601		
5602		//standard carousel
5603		$('.main-content > .row > '+$frontEndEditorElDiv+' .full-width-content, #portfolio-extra > '+$frontEndEditorElDiv+' .full-width-content, .woocommerce-tabs #tab-description > .full-width-content, .post-area.span_12 article .content-inner > .full-width-content').each(function(){
5604			
5605			//only set the height if more than one column
5606			if($(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').length > 1){
5607				
5608				var tallestColumn = 0;
5609				var $columnInnerHeight = 0;
5610				var $column_inner_selector; 
5611				
5612				$(this).find('> .span_12 > '+$frontEndEditorElDiv+'  .col').each(function(){
5613
5614					$column_inner_selector = ($(this).find('> .vc_column-inner > .wpb_wrapper').length > 0) ? '.vc_column-inner' : '.column-inner-wrap > .column-inner';
5615					
5616					var $padding = parseInt($(this).css('padding-top'));
5617					var $frontEndEditorElPadding = ($frontEndEditorElDiv.length > 2 && $(this).find('> .vc_column-inner').length > 0) ? parseInt($(this).find('> .vc_column-inner').css('padding-top')) : 0;
5618
5619					($(this).find('> '+$column_inner_selector+' > .wpb_wrapper').height() + ($padding*2) + $frontEndEditorElPadding > tallestColumn) ? tallestColumn = $(this).find('> '+$column_inner_selector+' > .wpb_wrapper').height() + ($padding*2) + $frontEndEditorElPadding : tallestColumn = tallestColumn;
5620				});	
5621	    	 	
5622	    	 	$(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').each(function(){
5623
5624	    	 		$column_inner_selector = ($(this).find('> .vc_column-inner > .wpb_wrapper').length > 0) ? '.vc_column-inner' : '.column-inner-wrap > .column-inner';
5625					
5626	    	 		//columns with content
5627		    	 	if($(this).find('> '+$column_inner_selector+' > .wpb_wrapper > *').length > 0){
5628		    	 		//added in 7.6 to fix equal height columns 
5629							if($frontEndEditorElDiv.length < 2 && !$(this).parent().parent().hasClass('vc_row-o-equal-height')) { $(this).css('height',tallestColumn); }
5630							else if($frontEndEditorElDiv.length > 2 && !$(this).parent().parent().parent().hasClass('vc_row-o-equal-height')) { $(this).css('height',tallestColumn); }
5631		    	 	} 
5632		    	 	//empty columns
5633		    	 	else {
5634		    	 		$(this).css('min-height',tallestColumn);
5635		    	 		if($(this).is('[data-animation*="reveal"]')) $(this).find('.column-inner').css('min-height',tallestColumn);
5636		    	 	}
5637	    	 	});
5638	         	
5639	         	//nested column height
5640						var $childRows = $(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col .wpb_row').length;
5641	         	if(window.innerWidth > 1000) { 
5642	         		
5643	         		var $padding = parseInt($(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').css('padding-top'));
5644	         		
5645	         		//$(this).find('> .span_12 > .col .wpb_row .col').css('min-height',(tallestColumn-($padding*2))/$childRows + 'px'); 
5646	         	} else {
5647	         		$(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col .wpb_row .col').css('min-height','0px'); 
5648	         	}
5649	         	
5650	         	
5651	         	//vertically center
5652	         	if($(this).hasClass('vertically-align-columns') && window.innerWidth > 1000 && !$(this).hasClass('vc_row-o-equal-height')){
5653	         		
5654	         		//parent columns
5655		         	$(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').each(function(){
5656
5657		         		$column_inner_selector = ($(this).find('> .vc_column-inner > .wpb_wrapper').length > 0) ? '.vc_column-inner' : '.column-inner-wrap > .column-inner';
5658						
5659						$columnInnerHeight = $(this).find('> '+$column_inner_selector+' > .wpb_wrapper').height();
5660						var $marginCalc = ($(this).height()/2)-($columnInnerHeight/2);
5661						if($marginCalc <= 0) $marginCalc = 0;
5662						
5663						$(this).find('> '+$column_inner_selector+' > .wpb_wrapper').css('margin-top',$marginCalc);
5664						$(this).find('> '+$column_inner_selector+' > .wpb_wrapper').css('margin-bottom',$marginCalc);
5665						
5666					});	
5667	
5668					
5669				}
5670			
5671			}
5672			
5673   	  	});
5674
5675		//equal height columns in container type with reveal columns
5676		$('.main-content > .row > .wpb_row:not(.full-width-content).vc_row-o-equal-height').each(function(){
5677			if($(this).find('>.span_12 > '+$frontEndEditorElDiv+' .wpb_column[data-animation*="reveal"]').length >0) {
5678				var tallestColumn = 0;
5679				var $columnInnerHeight = 0;
5680				
5681			$(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').each(function(){
5682					
5683					var $padding = parseInt($(this).find('> .column-inner-wrap > .column-inner').css('padding-top'));
5684					($(this).find('> .column-inner-wrap > .column-inner').height() + ($padding*2) > tallestColumn) ? tallestColumn = $(this).find('> .column-inner-wrap > .column-inner').height() + ($padding*2)  : tallestColumn = tallestColumn;
5685				});	
5686	    	 	
5687	    	 	$(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').each(function(){
5688					
5689	    	 		//columns with content
5690		    	 	if($(this).find('> .column-inner-wrap > .column-inner .wpb_wrapper > *').length > 0){
5691		    	 		$(this).find('> .column-inner-wrap').css('height',tallestColumn);
5692		    	 	} 
5693		    	 	//empty columns
5694		    	 	else {
5695		    	 		$(this).css('min-height',tallestColumn);
5696		    	 		if($(this).is('[data-animation*="reveal"]')) $(this).find('.column-inner').css('min-height',tallestColumn);
5697		    	 	}
5698	    	 	});
5699
5700			}	
5701		});
5702
5703		//using equal height option, top/bottom padding % needs to be convered into px for cross browser (flex bug)
5704		$('.wpb_row.vc_row-o-equal-height>.span_12> '+$frontEndEditorElDiv+'.wpb_column[class*="padding-"][data-padding-pos="all"]').each(function(){
5705			if($(this).parents('.tabbed').length == 0) {
5706				$(this).css({ 'padding-top': $(this).css('padding-left'), 'padding-bottom': $(this).css('padding-left')});
5707			}
5708		});
5709		
5710	}
5711	
5712	fullWidthContentColumns();
5713	if($('.owl-carousel').length > 0) owlCarouselInit();
5714
5715
5716var $mouseParallaxScenes = [];
5717function mouseParallaxInit(){
5718	$('.wpb_row:has(.nectar-parallax-scene)').each(function(i){
5719
5720		var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-space').height();
5721		
5722		var $strength = parseInt($(this).find('.nectar-parallax-scene').attr('data-scene-strength'));
5723
5724		$mouseParallaxScenes[i] = $(this).find('.nectar-parallax-scene').parallax({
5725			scalarX: $strength,
5726	  		scalarY: $strength
5727		});
5728
5729		//wait until the images in the scene have loaded
5730		var images = $(this).find('.nectar-parallax-scene li');
5731		
5732		$.each(images, function(){
5733			if($(this).find('div').length > 0) {
5734			    var el = $(this).find('div'),
5735			    image = el.css('background-image').replace(/"/g, '').replace(/url\(|\)$/ig, '');
5736			    if(image && image !== '' && image !== 'none')
5737			        images = images.add($('<img>').attr('src', image));
5738			}
5739		});
5740
5741		var $that = $(this);
5742
5743
5744	});
5745}
5746mouseParallaxInit();
5747
5748
5749	
5750/***************** Checkmarks ******************/
5751
5752function ulChecks() {
5753	$('ul.checks li').each(function(){
5754		if( $(this).find('i.icon-ok-sign').length == 0 ) {
5755			$(this).prepend('<i class="icon-ok-sign"></i>');
5756		}
5757	});
5758}
5759ulChecks();
5760
5761
5762
5763function rowBGAnimations() {
5764	var $rowBGAnimationsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '93%';
5765	
5766	$($fullscreenSelector+'.row-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]):not([data-bg-animation*="displace-filter"]) .row-bg.using-image').each(function() {
5767		
5768		var $that = $(this);
5769		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
5770		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
5771		
5772		var waypoint = new Waypoint({
5773			 element: $that.parents('.row-bg-wrap'),
5774			 handler: function(direction) {
5775				 
5776				 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
5777						waypoint.destroy();
5778					 return;
5779				 }
5780				 
5781					$that.parents('.inner-wrap').addClass('animated-in');
5782				 
5783				 waypoint.destroy();
5784			 },
5785			 offset: $rowBGAnimationsOffsetPos
5786		});
5787		
5788	});
5789	
5790}
5791
5792function columnBGAnimations() {
5793	var $rowBGAnimationsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '93%';
5794	
5795	$($fullscreenSelector+'.column-image-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]):not([data-bg-animation*="displace-filter"]) .column-image-bg').each(function() {
5796		
5797		var $that = $(this);
5798		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
5799		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
5800		
5801		var waypoint = new Waypoint({
5802			 element: $that.parents('.column-image-bg-wrap'),
5803			 handler: function(direction) {
5804				 
5805				 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
5806						waypoint.destroy();
5807					 return;
5808				 }
5809				 
5810					$that.parents('.inner-wrap').addClass('animated-in');
5811				 
5812				 waypoint.destroy();
5813			 },
5814			 offset: $rowBGAnimationsOffsetPos
5815		});
5816		
5817	});
5818	
5819}
5820
5821/***************** Image with Animation / Col Animation *******************/
5822
5823
5824	
5825function colAndImgAnimations(){
5826
5827	var $colAndImgOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '88%';
5828	var $colAndImgOffsetPos2 = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '70%';
5829
5830	$($fullscreenSelector+'img.img-with-animation').each(function() {
5831		
5832		var $that = $(this);
5833		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
5834		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
5835
5836		var waypoint = new Waypoint({
5837 			element: $that,
5838 			 handler: function(direction) {
5839			   
5840					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
5841						 waypoint.destroy();
5842						return;
5843					}
5844
5845					if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) {
5846				
5847						if($that.attr('data-animation') == 'fade-in-from-left'){
5848							$that.delay($that.attr('data-delay')).transition({
5849								'opacity' : 1,
5850								'x' : '0px'
5851							},$animationDuration, $animationEasing);
5852						} else if($that.attr('data-animation') == 'fade-in-from-right'){
5853							$that.delay($that.attr('data-delay')).transition({
5854								'opacity' : 1,
5855								'x' : '0px'
5856							},$animationDuration, $animationEasing);
5857						} else if($that.attr('data-animation') == 'fade-in-from-bottom'){
5858							$that.delay($that.attr('data-delay')).transition({
5859								'opacity' : 1,
5860								'y' : '0px'
5861							},$animationDuration, $animationEasing);
5862						} else if($that.attr('data-animation') == 'fade-in') {
5863							$that.delay($that.attr('data-delay')).transition({
5864								'opacity' : 1
5865							},$animationDuration, $animationEasing);	
5866						} else if($that.attr('data-animation') == 'grow-in') {
5867							setTimeout(function(){ 
5868								$that.transition({ scale: 1, 'opacity':1 },$animationDuration,$animationEasing);
5869							},$that.attr('data-delay'));
5870						}
5871						else if($that.attr('data-animation') == 'flip-in') {
5872							setTimeout(function(){ 
5873								$that.transition({  rotateY: 0, 'opacity':1 },$animationDuration, $animationEasing);
5874							},$that.attr('data-delay'));
5875						}
5876						else if($that.attr('data-animation') == 'flip-in-vertical') {
5877							setTimeout(function(){ 
5878								$that.transition({  rotateX: 0, 'opacity':1 },$animationDuration, $animationEasing);
5879							},$that.attr('data-delay'));
5880						}
5881
5882						$that.addClass('animated-in');
5883						
5884					}
5885
5886					waypoint.destroy();
5887
5888			  },
5889			  offset: $colAndImgOffsetPos
5890		});
5891
5892		
5893	
5894	});
5895
5896
5897	$($fullscreenSelector+'.nectar_cascading_images').each(function() {
5898		
5899		var $that = $(this);
5900		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
5901		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
5902		var $animationDelay = ($(this).is('[data-animation-timing]')) ? $(this).attr('data-animation-timing') : 175;
5903		$animationDelay = parseInt($animationDelay);
5904
5905		var waypoint = new Waypoint({
5906 			element: $that,
5907 			 handler: function(direction) {
5908			   
5909					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
5910						 waypoint.destroy();
5911						return;
5912					}
5913
5914					if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) {
5915					
5916						$that.find('.cascading-image').each(function(i){
5917
5918							var $that2 = $(this);
5919
5920							if($that2.attr('data-animation') == 'flip-in' || $that2.attr('data-animation') == 'flip-in-vertical') {
5921								setTimeout(function(){
5922									$that2.find('.inner-wrap').css({
5923										'opacity' : 1,
5924										'transform' : 'rotate(0deg) translateZ(0px)'
5925									});
5926								}, i* $animationDelay);
5927							} else {
5928								setTimeout(function(){
5929									$that2.find('.inner-wrap').css({
5930										'opacity' : 1,
5931										'transform' : 'translateX(0px) translateY(0px) scale(1,1) translateZ(0px)'
5932									});
5933								}, i* $animationDelay);
5934							}
5935					
5936
5937						});
5938
5939						$that.addClass('animated-in');
5940						
5941					}
5942
5943					waypoint.destroy();
5944
5945			  },
5946			  offset: $colAndImgOffsetPos
5947		});
5948
5949		
5950	
5951	});
5952	
5953
5954	
5955	$($fullscreenSelector+'.col.has-animation:not([data-animation*="reveal"]), '+$fullscreenSelector+'.wpb_column.has-animation:not([data-animation*="reveal"]), '+$fullscreenSelector+'.nectar-fancy-box.has-animation').each(function(i) {
5956	    
5957		var $that = $(this);
5958		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
5959		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
5960
5961		//set perspective for vertical flip
5962		if($that.is('[data-animation="flip-in-vertical"]')) {
5963			$that.parents('.col.span_12').addClass('flip-in-vertical-wrap');
5964		}
5965
5966		var waypoint = new Waypoint({
5967 			element: $that,
5968 			 handler: function(direction) {
5969				
5970				if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
5971					 waypoint.destroy();
5972					return;
5973				}
5974
5975				if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) {
5976				 	
5977				 	
5978					if($that.attr('data-animation') == 'fade-in-from-left'){
5979						$standAnimatedColTimeout[i] = setTimeout(function(){ 
5980							$that.transition({
5981								'opacity' : 1,
5982								'x' : '0px'
5983							},$animationDuration,$animationEasing);
5984						},$that.attr('data-delay'));
5985					} else if($that.attr('data-animation') == 'fade-in-from-right'){
5986						$standAnimatedColTimeout[i] = setTimeout(function(){ 
5987							$that.transition({
5988								'opacity' : 1,
5989								'x' : '0px'
5990							},$animationDuration,$animationEasing);
5991						},$that.attr('data-delay'));
5992					} else if($that.attr('data-animation') == 'fade-in-from-bottom'){
5993						$standAnimatedColTimeout[i] = setTimeout(function(){ 
5994							$that.transition({
5995								'opacity' : 1,
5996								'y' : '0px'
5997							},$animationDuration,$animationEasing);
5998						},$that.attr('data-delay'));
5999					} else if($that.attr('data-animation') == 'fade-in') {
6000						$standAnimatedColTimeout[i] = setTimeout(function(){ 
6001							$that.transition({
6002								'opacity' : 1
6003							},$animationDuration,$animationEasing);	
6004						},$that.attr('data-delay'));
6005					} else if($that.attr('data-animation') == 'grow-in' || $that.attr('data-animation') == 'zoom-out') {
6006						$standAnimatedColTimeout[i] = setTimeout(function(){ 
6007							$that.transition({ scale: 1, 'opacity':1 },$animationDuration,$animationEasing);
6008						},$that.attr('data-delay'));
6009					} else if($that.attr('data-animation') == 'flip-in') {
6010						$standAnimatedColTimeout[i] = setTimeout(function(){ 
6011							$that.transition({  rotateY: 0, 'opacity':1 },$animationDuration, $animationEasing);
6012						},$that.attr('data-delay'));
6013					} else if($that.attr('data-animation') == 'flip-in-vertical') {
6014						$standAnimatedColTimeout[i] = setTimeout(function(){ 
6015							$that.transition({  rotateX: 0, y: 0, 'opacity':1 },$animationDuration, $animationEasing);
6016						},$that.attr('data-delay'));
6017					}
6018
6019					//boxed column hover fix
6020					if($that.hasClass('boxed')) {
6021						$that.addClass('no-pointer-events');
6022						setTimeout(function(){
6023							$that.removeClass('no-pointer-events');
6024						},parseInt($animationDuration) + parseInt($that.attr('data-delay')) + 30 );
6025					}
6026
6027					$that.addClass('animated-in');
6028				
6029				}
6030
6031				waypoint.destroy();
6032			},
6033			offset: $colAndImgOffsetPos
6034		});
6035	
6036	});
6037
6038	
6039	$($fullscreenSelector+'.wpb_column.has-animation[data-animation*="reveal"]').each(function() {
6040	    
6041		var $that = $(this);
6042		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
6043		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
6044
6045		var waypoint = new Waypoint({
6046 			element: $that,
6047 			 handler: function(direction) {
6048				
6049				if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
6050					 waypoint.destroy();
6051					return;
6052				}
6053
6054				if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) {
6055					
6056					if($that.attr('data-animation') == 'reveal-from-bottom' || $that.attr('data-animation') == 'reveal-from-top') {
6057						setTimeout(function(){ 
6058							if($that.hasClass('animated-in')) $that.find('.column-inner-wrap, .column-inner').transition({  'y': 0 },$animationDuration, $animationEasing,function(){ if($that.hasClass('animated-in')) $that.find('.column-inner-wrap, .column-inner').addClass('no-transform'); });
6059						},$that.attr('data-delay'));
6060					} else if($that.attr('data-animation') == 'reveal-from-right' || $that.attr('data-animation') == 'reveal-from-left') {
6061						setTimeout(function(){ 
6062							if($that.hasClass('animated-in'))  $that.find('.column-inner-wrap, .column-inner').transition({  'x': 0 },$animationDuration, $animationEasing,function(){ if($that.hasClass('animated-in')) $that.find('.column-inner-wrap, .column-inner').addClass('no-transform'); });
6063						},$that.attr('data-delay'));
6064					} 
6065
6066					$that.addClass('animated-in');
6067				
6068				}
6069
6070				waypoint.destroy();
6071			},
6072			offset: $colAndImgOffsetPos2
6073		});
6074	
6075	}); 	
6076
6077	
6078}
6079
6080
6081
6082function cascadingImageBGSizing() {
6083	$('.nectar_cascading_images').each(function(){
6084
6085		//handle max width for cascading images in equal height columns
6086		if($(this).parents('.vc_row-o-equal-height').length > 0 && $(this).parents('.wpb_column').length > 0) 
6087			$(this).css('max-width',$(this).parents('.wpb_column').width());
6088
6089		//set size for layers with no images
6090		$(this).find('.bg-color').each(function(){
6091			var $bgColorHeight = 0;
6092			var $bgColorWidth = 0;
6093			if($(this).parent().find('.img-wrap').length == 0) {
6094				var $firstSibling = $(this).parents('.cascading-image').siblings('.cascading-image[data-has-img="true"]').first();
6095
6096				$firstSibling.css({'position':'relative', 'visiblity':'hidden'});
6097				$bgColorHeight = $firstSibling.find('.img-wrap').height();
6098				$bgColorWidth = $firstSibling.find('.img-wrap').width();
6099				if($firstSibling.index() == 0) {
6100					$firstSibling.css({'visiblity':'visible'});
6101				} else {
6102					$firstSibling.css({'position':'absolute', 'visiblity':'visible'});
6103				}
6104			} else {
6105				$bgColorHeight = $(this).parent().find('.img-wrap').height();
6106				$bgColorWidth = $(this).parent().find('.img-wrap').width();
6107			}
6108
6109			$(this).css({'height': $bgColorHeight,'width': $bgColorWidth});
6110		});
6111	});
6112}
6113
6114if($('.nectar_cascading_images').length > 0) {
6115	imagesLoaded($('.nectar_cascading_images'),function(instance){
6116		cascadingImageBGSizing();
6117	});
6118}
6119
6120function splitLineHeadings() {
6121
6122	var $splitLineOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
6123	$($fullscreenSelector+'.nectar-split-heading').each(function() {
6124
6125		var $that = $(this);
6126		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
6127		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
6128
6129		var waypoint = new Waypoint({
6130				element: $that,
6131				 handler: function(direction) {
6132				
6133				if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
6134					 waypoint.destroy();
6135					return;
6136				}
6137
6138				if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) {
6139				 	
6140					
6141					$that.find('.heading-line').each(function(i){
6142						//if($that.parents('.first-section').length > 0 && $('body[data-aie="zoom-out"]').length > 0) i = i+4;
6143						$(this).find('> div').delay(i*70).transition({
6144							'y' : '0px'
6145						},$animationDuration,$animationEasing);
6146
6147					});
6148					
6149
6150					$that.addClass('animated-in');
6151				
6152				}
6153
6154				waypoint.destroy();
6155			},
6156			offset: $splitLineOffsetPos
6157		});
6158
6159	});
6160}
6161
6162	
6163/***************** Custom tablet default column widths  ******************/
6164	
6165	//add one-fourth class
6166	function oneFourthClasses() {
6167		$('.col.span_3, .vc_span3, .vc_col-sm-3').each(function(){
6168			if( !$(this).is('[data-t-w-inherits="small_desktop"]') ) {
6169				var $currentDiv = $(this);
6170				var $nextDiv = $(this).next('div');
6171				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') ) {
6172					$currentDiv.addClass('one-fourths clear-both');
6173					$nextDiv.addClass('one-fourths right-edge');
6174				}
6175			}
6176		});
6177		
6178		//make empty second 1/2 half columsn display right on iPad
6179		$('.span_12 .col.span_6').each(function(){
6180			if($(this).next('div').hasClass('span_6') && $.trim( $(this).next('div').html() ).length == 0 ) {
6181				$(this).addClass('empty-second')
6182			}
6183		}); 
6184		
6185	}
6186	oneFourthClasses();
6187	
6188/***************** Bar Graph ******************/
6189function progressBars(){
6190	var $progressBarsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
6191	$($fullscreenSelector+'.nectar-progress-bar').parent().each(function(i){
6192		
6193		var $that = $(this);
6194		var waypoint = new Waypoint({
6195 			element: $that,
6196 			 handler: function(direction) {
6197			   
6198					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6199						 waypoint.destroy();
6200						return;
6201					}
6202
6203					if($progressBarsOffsetPos == '100%') $that.find('.nectar-progress-bar .bar-wrap').css('opacity','1');
6204
6205					$that.find('.nectar-progress-bar').each(function(i){
6206
6207
6208						var percent = $(this).find('span').attr('data-width');
6209						var $endNum = parseInt($(this).find('span strong i').text());
6210						var $that = $(this);
6211						
6212						$that.find('span').delay(i*90).transition({
6213							'width' : percent + '%'
6214						},1050, 'easeInOutQuint',function(){
6215						});
6216	
6217						setTimeout(function(){
6218
6219							var countOptions = { useEasing : false };
6220							var $countEle = $that.find('span strong i')[0];
6221							var numAnim = new CountUp($countEle, 0, $endNum,0,1,countOptions);
6222							numAnim.start();
6223
6224							$that.find('span strong').transition({
6225								'opacity' : 1
6226							},550, 'easeInCirc');
6227						}, (i*90) );
6228					
6229						////100% progress bar 
6230						if(percent == '100'){
6231							$that.find('span strong').addClass('full');
6232						}
6233					});
6234
6235					$that.addClass('completed');
6236
6237					waypoint.destroy();
6238
6239			  },
6240			  offset: $progressBarsOffsetPos
6241		});
6242
6243	});
6244}
6245
6246
6247/***************** Column Borders ******************/
6248function animatedColBorders(){
6249	var $progressBarsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '75%';
6250	$($fullscreenSelector+'.wpb_column[data-border-animation="true"]').each(function(i){
6251
6252		var $that = $(this);
6253		var waypoint = new Waypoint({
6254 			element: $that,
6255 			 handler: function(direction) {
6256			   
6257					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6258						 waypoint.destroy();
6259						return;
6260					}
6261
6262					var $borderDelay = ($that.attr('data-border-animation-delay').length > 0) ? parseInt($that.attr('data-border-animation-delay')) : 0;
6263					setTimeout(function(){
6264						$that.find('.border-wrap').addClass('animation');
6265						$that.find('.border-wrap').addClass('completed');
6266					},$borderDelay)
6267					
6268
6269					waypoint.destroy();
6270
6271			  },
6272			  offset: $progressBarsOffsetPos
6273		});
6274
6275	});
6276}
6277
6278/***************** Food Menu Item ******************/
6279function foodMenuItems() {
6280	var $foodItemOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '80%';
6281	$($fullscreenSelector+'.nectar_food_menu_item').parent().each(function(i){
6282
6283		var $that = $(this);
6284		var waypoint = new Waypoint({
6285 			element: $that,
6286 			 handler: function(direction) {
6287			   
6288					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6289						 waypoint.destroy();
6290						return;
6291					}
6292
6293					$that.find('.nectar_food_menu_item').each(function(i){
6294
6295						var $that = $(this);
6296
6297						setTimeout(function(){
6298							$that.addClass('animated-in');
6299						},i*150);
6300						
6301					});
6302					
6303					waypoint.destroy();
6304
6305			  },
6306			  offset: $foodItemOffsetPos
6307		});
6308
6309	});
6310}
6311
6312
6313/***************** Dividers ******************/
6314function dividers() {
6315	var $dividerOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
6316
6317	$($fullscreenSelector+'.divider-small-border[data-animate="yes"], '+$fullscreenSelector+'.divider-border[data-animate="yes"]').each(function(i){
6318
6319		var $lineDur = ($(this).hasClass('divider-small-border')) ? 1300 : 1500;
6320		var $that = $(this);
6321		var waypoint = new Waypoint({
6322 			element: $that,
6323 			 handler: function(direction) {
6324			   
6325					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6326						 waypoint.destroy();
6327						return;
6328					}
6329				
6330					$that.each(function(i){
6331
6332						$(this).css({'transform':'scale(0,1)', 'visibility': 'visible'});
6333						var $that = $(this);
6334						
6335						$that.delay($that.attr('data-animation-delay')).transition({
6336							'transform' : 'scale(1, 1)'
6337						},$lineDur, 'cubic-bezier(.18,1,.22,1)');
6338						
6339					});
6340
6341					$that.addClass('completed');
6342
6343					waypoint.destroy();
6344
6345			  },
6346			  offset: $dividerOffsetPos
6347		});
6348
6349	});
6350}
6351
6352
6353
6354/***************** Icon List ******************/
6355function iconList() {
6356	var $iconListOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '250%' : '75%';
6357
6358	$($fullscreenSelector+'.nectar-icon-list[data-animate="true"]').each(function(i){
6359
6360		var $that = $(this);
6361		var waypoint = new Waypoint({
6362 			element: $that,
6363 			 handler: function(direction) {
6364			   
6365					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6366						 waypoint.destroy();
6367						return;
6368					}
6369				
6370					$that.each(function(i){
6371						
6372						var $listItemAnimationDelay = ( $that.is('[data-direction="horizontal"]') ) ? 100 : 300;
6373						
6374						$(this).find('.nectar-icon-list-item').each(function(i){
6375							var $thatt = $(this);
6376							setTimeout(function(){ $thatt.addClass('animated') },i*$listItemAnimationDelay);
6377						});
6378						
6379					});
6380
6381					$that.addClass('completed');
6382
6383					waypoint.destroy();
6384
6385			  },
6386			  offset: $iconListOffsetPos
6387		});
6388
6389	});
6390}
6391
6392//bg color match 
6393
6394function narrowParentBGC(element) {
6395	
6396	var narrowedBGC;
6397	
6398	if(element.parents('.wpb_column[data-bg-color*="#"]').length > 0 && element.parents('.wpb_column[data-bg-opacity="1"]').length > 0) {
6399		var narrowedBGC = element.parents('.wpb_column').attr('data-bg-color');
6400	}
6401	else if(element.parents('.wpb_row').length > 0 && element.parents('.wpb_row').find('.row-bg.using-bg-color').length > 0) {
6402		var narrowedBGC = element.parents('.wpb_row').find('.row-bg.using-bg-color').css('background-color');
6403	}
6404	else {
6405		if($('#nectar_fullscreen_rows').length > 0)
6406			var narrowedBGC = $('#nectar_fullscreen_rows > .wpb_row .full-page-inner-wrap').css('background-color');
6407		else 
6408			var narrowedBGC = $('.container-wrap').css('background-color');
6409	}
6410	
6411	return narrowedBGC;
6412	
6413}
6414
6415var nectarMatchingBGCss = '';
6416
6417function nectarIconMatchColoring() {
6418	
6419	//icon list
6420	$('.nectar-icon-list[data-icon-style="border"], .nectar_icon_wrap[data-style="border-animation"][data-color*="extra-color-gradient-"]').each(function(i){
6421		
6422		var $bgColorToSet = narrowParentBGC($(this));
6423		
6424		if($(this).hasClass('nectar-icon-list')) 
6425			$(this).find('.list-icon-holder').css('background-color',$bgColorToSet);
6426		else {
6427			//must be set in css, can't manip pseudo
6428			$(this).removeClass(function (index, className) {
6429			    return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
6430			});
6431			$(this).addClass('instance-'+i);
6432			nectarMatchingBGCss += '.nectar_icon_wrap.instance-'+i+' .nectar_icon:before { background-color: '+$bgColorToSet+'!important; }';
6433		}
6434			
6435	});
6436
6437	//material gradient btns
6438	$('body.material .nectar-button.see-through[class*="m-extra-color-gradient"]').each(function(i){
6439		
6440		var $bgColorToSet = narrowParentBGC($(this));
6441		
6442		$(this).removeClass(function (index, className) {
6443				return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
6444		});
6445		$(this).addClass('instance-'+i);
6446		nectarMatchingBGCss += '.nectar-button.see-through.instance-'+i+':after { background-color: '+$bgColorToSet+'!important; }';
6447		
6448	});
6449
6450	if(nectarMatchingBGCss.length > 0) {
6451		var head = document.head || document.getElementsByTagName('head')[0];
6452		var style = document.createElement('style');
6453
6454		style.type = 'text/css';
6455		if (style.styleSheet){
6456		  style.styleSheet.cssText = nectarMatchingBGCss;
6457		} else {
6458		  style.appendChild(document.createTextNode(nectarMatchingBGCss));
6459		}
6460		
6461		$(style).attr('id','nectaricon-color-match');
6462		$('head #nectaricon-color-match').remove();
6463		head.appendChild(style);
6464	}
6465	
6466}
6467nectarIconMatchColoring();
6468
6469
6470/***************** Hotspot ******************/
6471//add pulse animation
6472$('.nectar_image_with_hotspots[data-hotspot-icon="numerical"]').each(function(){
6473	$(this).find('.nectar_hotspot_wrap').each(function(i){
6474		var $that = $(this);
6475		setTimeout(function(){
6476			$that.find('.nectar_hotspot').addClass('pulse');
6477		},i*300);	
6478	});
6479});
6480
6481
6482
6483function hotSpotHoverBind() {
6484
6485	var hotSpotHoverTimeout = [];
6486
6487	$('.nectar_image_with_hotspots:not([data-tooltip-func="click"]) .nectar_hotspot').each(function(i){
6488		
6489		hotSpotHoverTimeout[i] = '';
6490
6491		$(this).on('mouseover', function(){
6492			clearTimeout(hotSpotHoverTimeout[i]);
6493			$(this).parent().css({'z-index':'400', 'height':'auto','width':'auto'});
6494		});
6495
6496		$(this).on('mouseleave', function(){
6497
6498			var $that = $(this);
6499			$that.parent().css({'z-index':'auto'});
6500
6501			hotSpotHoverTimeout[i] = setTimeout(function(){
6502				$that.parent().css({'height':'30px','width':'30px'});
6503			},300);
6504
6505		});
6506
6507	});
6508
6509}
6510
6511hotSpotHoverBind();
6512
6513function responsiveTooltips() {
6514
6515	$('.nectar_image_with_hotspots').each(function(){
6516		$(this).find('.nectar_hotspot_wrap').each(function(i){
6517			
6518			if(  window.innerWidth > 690) {
6519
6520				//remove click if applicable
6521				if($(this).parents('.nectar_image_with_hotspots[data-tooltip-func="hover"]').length > 0) {
6522					$(this).find('.nectar_hotspot').removeClass('click');
6523					$(this).find('.nttip').removeClass('open');
6524				}
6525				$(this).find('.nttip .inner a.tipclose').remove();
6526				$('.nttip').css('height','auto');
6527
6528				//reset for positioning
6529				$(this).css({'width': 'auto','height': 'auto'});
6530				$(this).find('.nttip').removeClass('force-right').removeClass('force-left').removeClass('force-top').css('width','auto');
6531
6532				var $tipOffset = $(this).find('.nttip').offset();
6533
6534				//against right side fix
6535				if($tipOffset.left > $(this).parents('.nectar_image_with_hotspots').width() - 200)
6536					$(this).find('.nttip').css('width','250px');
6537				else 
6538					$(this).find('.nttip').css('width','auto');
6539
6540				//responsive
6541				if($tipOffset.left < 0)
6542					$(this).find('.nttip').addClass('force-right');
6543				else if($tipOffset.left + $(this).find('.nttip').outerWidth(true) >  window.innerWidth )
6544					$(this).find('.nttip').addClass('force-left').css('width','250px');
6545				else if($tipOffset.top + $(this).find('.nttip').height() + 35 > $(window).height() && $('#nectar_fullscreen_rows').length > 0)
6546					$(this).find('.nttip').addClass('force-top');
6547
6548				if($(this).find('> .open').length == 0)
6549					$(this).css({'width': '30px','height': '30px'});
6550
6551			} else {
6552				//fixed position
6553				$(this).find('.nttip').removeClass('force-left').removeClass('force-right').removeClass('force-top');
6554				$(this).find('.nectar_hotspot').addClass('click');
6555			
6556				if($(this).find('.nttip a.tipclose').length == 0)
6557					$(this).find('.nttip .inner').append('<a href="#" class="tipclose"><span></span></a>');
6558
6559				//change height of fixed
6560				$('.nttip').css('height',$(window).height());
6561			}
6562		});
6563	});
6564
6565
6566}
6567responsiveTooltips();
6568
6569function imageWithHotspotClickEvents() {
6570	//click
6571	$('body').on('click','.nectar_hotspot.click',function(){
6572		$(this).parents('.nectar_image_with_hotspots').find('.nttip').removeClass('open');
6573		$(this).parent().find('.nttip').addClass('open');
6574
6575		$(this).parents('.nectar_image_with_hotspots').find('.nectar_hotspot').removeClass('open');
6576		$(this).parent().find('.nectar_hotspot').addClass('open');
6577
6578		if( window.innerWidth > 690) {
6579			$(this).parent().css({'z-index':'120', 'height':'auto','width':'auto'});
6580
6581			var $that = $(this);
6582
6583			setTimeout(function(){
6584				$that.parents('.nectar_image_with_hotspots').find('.nectar_hotspot_wrap').each(function(){
6585					if($(this).find('> .open').length == 0)
6586						$(this).css({'height':'30px','width':'30px', 'z-index':'auto'});
6587				});
6588			},300);
6589		}
6590
6591		if(  window.innerWidth <= 690) $(this).parents('.wpb_row, [class*="vc_col-"]').css('z-index','200');
6592
6593		return false;
6594	});
6595
6596	$('body').on('click','.nectar_hotspot.open',function(){
6597		$(this).parent().find('.nttip').removeClass('open');
6598		$(this).parent().find('.nectar_hotspot').removeClass('open');
6599
6600		$(this).parents('.wpb_row').css('z-index','auto');
6601
6602		return false;
6603	});
6604
6605	$('body').on('click','.nttip.open',function(){
6606		if(  window.innerWidth < 690) {
6607			$(this).parents('.nectar_image_with_hotspots').find('.nttip').removeClass('open');
6608			$(this).parents('.wpb_row').css('z-index','auto');
6609			return false;
6610		}
6611	});
6612}
6613imageWithHotspotClickEvents();
6614
6615function imageWithHotspots() {
6616
6617	var $imageWithHotspotsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '50%';
6618
6619	$($fullscreenSelector+'.nectar_image_with_hotspots[data-animation="true"]').each(function(i){
6620
6621		var $that = $(this);
6622		var waypoint = new Waypoint({
6623 			element: $that,
6624 			 handler: function(direction) {
6625			   
6626					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6627						 waypoint.destroy();
6628						return;
6629					}
6630
6631					$that.addClass('completed');
6632					$that.find('.nectar_hotspot_wrap').each(function(i){
6633						var $that2 = $(this);
6634						var $extrai = ($that2.parents('.col.has-animation').length > 0) ? 1 : 0;
6635						setTimeout(function(){
6636							$that2.addClass('animated-in');
6637						},175*(i+$extrai));
6638					});
6639
6640					waypoint.destroy();
6641
6642			  },
6643			  offset: $imageWithHotspotsOffsetPos
6644		});
6645
6646	});
6647}
6648
6649
6650/***************** Animated Title ******************/
6651function animated_titles() {
6652	var $animatedTitlesOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
6653
6654	$($fullscreenSelector+'.nectar-animated-title').each(function(i){
6655
6656		var $that = $(this);
6657		var waypoint = new Waypoint({
6658 			element: $that,
6659 			 handler: function(direction) {
6660			   
6661					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6662						 waypoint.destroy();
6663						return;
6664					}
6665
6666					$that.addClass('completed');
6667
6668					waypoint.destroy();
6669
6670			  },
6671			  offset: $animatedTitlesOffsetPos
6672		});
6673
6674	});
6675}
6676
6677
6678/***************** Highlighted Text ******************/
6679function highlighted_text() {
6680	var $highlightedTextOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
6681
6682	$($fullscreenSelector+'.nectar-highlighted-text').each(function(i){
6683		
6684		/*custom color*/
6685		if($(this).is('[data-using-custom-color="true"]')) {
6686			
6687				var highlightedColorCss = '';
6688				var $custom_highlight_color = $(this).attr('data-color');
6689			
6690				$(this).addClass('instance-'+i);
6691			
6692				highlightedColorCss += '.nectar-highlighted-text.instance-' + i + ' em:before { background-color: ' + $custom_highlight_color + '; }';
6693			
6694				if(highlightedColorCss.length > 1) {
6695		
6696					var head = document.head || document.getElementsByTagName('head')[0];
6697					var style = document.createElement('style');
6698		
6699						style.type = 'text/css';
6700					if (style.styleSheet){
6701					  style.styleSheet.cssText = highlightedColorCss;
6702					} else {
6703					  style.appendChild(document.createTextNode(highlightedColorCss));
6704					}
6705		
6706					head.appendChild(style);
6707				}
6708			
6709		}
6710		
6711		if(nectarDOMInfo.usingMobileBrowser) {
6712			$(this).find('em').addClass('animated');
6713		}
6714		
6715		/*waypoint*/
6716		var $that = $(this);
6717		var waypoint = new Waypoint({
6718 			element: $that,
6719 			 handler: function(direction) {
6720			   
6721					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated')) { 
6722						 waypoint.destroy();
6723						return;
6724					}
6725					
6726					$that.find('em').each(function(i){
6727						var $highlighted_em = $(this);
6728						setTimeout(function(){
6729							$highlighted_em.addClass('animated');
6730						},i*300);
6731
6732					});
6733
6734					waypoint.destroy();
6735
6736			  },
6737			  offset: $highlightedTextOffsetPos
6738		});
6739
6740	});
6741}
6742
6743
6744
6745/***************** Pricing Tables ******************/
6746
6747
6748var $tallestCol;
6749
6750function pricingTableHeight(){
6751	$('.pricing-table[data-style="default"]').each(function(){
6752		$tallestCol = 0;
6753		
6754		$(this).find('> div ul').each(function(){
6755			($(this).height() > $tallestCol) ? $tallestCol = $(this).height() : $tallestCol = $tallestCol;
6756		});	
6757		
6758		//safety net incase pricing tables height couldn't be determined
6759		if($tallestCol == 0) $tallestCol = 'auto';
6760		
6761		//set even height
6762		$(this).find('> div ul').css('height',$tallestCol);
6763
6764	});
6765}
6766
6767pricingTableHeight();
6768
6769 
6770/***************** Testimonial Slider ******************/
6771
6772//testimonial slider controls
6773
6774//non minimal
6775$('body').on('click','.testimonial_slider:not([data-style*="multiple_visible"]):not([data-style="minimal"]) .controls li', function(){
6776	
6777	if($(this).find('span').hasClass('active')) return false;
6778	
6779	var $frontEndEditorTestimonialDiv =  ($('body.vc_editor').length > 0) ? '> div': 'blockquote';
6780	var $index = $(this).index();
6781	var currentHeight = $(this).parents('.testimonial_slider').find('.slides blockquote').eq($index).height();
6782	
6783	$(this).parents('.testimonial_slider').find('li span').removeClass('active');
6784	$(this).find('span').addClass('active');
6785	
6786	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).addClass('no-trans');
6787	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).css({'opacity':'0', 'transform': 'translateX(-25px)', 'z-index': '1'});
6788	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($index).removeClass('no-trans').css({'opacity':'1', 'transform': 'translateX(0px)'}).css('z-index','20');
6789	$(this).parents('.testimonial_slider:not(.disable-height-animation)').find('.slides').stop(true,true).animate({'height' : currentHeight + 40 + 'px' },450,'easeOutCubic');
6790	
6791	resizeVideoToCover();
6792});
6793
6794//minimal
6795$('body').on('click','.testimonial_slider[data-style="minimal"] .testimonial-next-prev a', function(){
6796	
6797	var $frontEndEditorTestimonialDiv =  ($('body.vc_editor').length > 0) ? '> div': 'blockquote';
6798	var $index = $(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv+'.active').index();
6799	var $actualIndex = $index;
6800
6801	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).addClass('no-trans');
6802	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).css({'opacity':'0', 'transform': 'translateX(-25px)', 'z-index': '1'});
6803
6804
6805	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($index).removeClass('active');
6806
6807	if($(this).hasClass('next')) {
6808		if($index+1 >= $(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).length) { 
6809			$actualIndex = 0; 
6810		} else {
6811			$actualIndex = $index+1; 
6812		}
6813		var currentHeight = $(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($actualIndex).height();
6814		//show slide
6815		$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($actualIndex).addClass('active').removeClass('no-trans').css({'opacity':'1', 'transform': 'translateX(0px)'}).css('z-index','20');
6816		//change pag #
6817		$(this).parents('.testimonial_slider').find('.control-wrap ul').css({'transform':'translateX(-'+(20*$actualIndex)+'px)'});
6818	} else {
6819		if($index-1 == -1) { 
6820			$actualIndex = $(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).length-1; 
6821		} else {
6822			$actualIndex = $index-1; 
6823		}
6824		var currentHeight = $(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($index-1).height();
6825		//show slide
6826		$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($index-1).addClass('active').removeClass('no-trans').css({'opacity':'1', 'transform': 'translateX(0px)'}).css('z-index','20');
6827		//change pag #
6828		$(this).parents('.testimonial_slider').find('.control-wrap ul').css({'transform':'translateX(-'+(20*$actualIndex)+'px)'});
6829	}
6830	
6831	
6832	$(this).parents('.testimonial_slider:not(.disable-height-animation)').find('.slides').stop(true,true).animate({'height' : currentHeight + 40 + 'px' },450,'easeOutCubic');
6833	
6834	resizeVideoToCover();
6835
6836	return false;
6837});
6838
6839
6840var $tallestQuote;
6841
6842var $testimonialSlider = [];
6843
6844//create controls
6845function createTestimonialControls() {
6846	
6847	var $frontEndEditorTestimonialDiv =  ($('body.vc_editor').length > 0) ? '> div': 'blockquote';
6848	
6849	//fadeIn
6850	$('.testimonial_slider:not([data-style*="multiple_visible"])').animate({'opacity':'1'},800);
6851
6852	$('.testimonial_slider:not([data-style*="multiple_visible"])').each(function(i){
6853		
6854		if($(this).find('blockquote').length > 1) {
6855			$(this).find('.controls, .testimonial-next-prev').remove();
6856			$(this).append('<div class="controls"><ul></ul></div>');
6857			
6858			var slideNum = $(this).find('blockquote').length;
6859			var $that = $(this);
6860			
6861			for(var i=0;i<slideNum;i++) {
6862
6863				if( !$(this).is('[data-style="minimal"]') ) {
6864					$that.find('.controls ul').append('<li><span class="pagination-switch"></span></li>');
6865				} else {
6866					$that.find('.controls ul').append('<li>'+(i+1)+'</li>');
6867				}
6868			}
6869			
6870			//minimal
6871			if( $(this).is('[data-style="minimal"]') ) {
6872
6873				//add next/prev
6874				$(this).append('<div class="testimonial-next-prev"><a href="#" class="prev fa fa-angle-left"></a><a href="#" class="next fa fa-angle-right"></a></div>');
6875
6876				//start on first
6877				if($(this).find('.active').length == 0) {
6878					$(this).find('.slides '+$frontEndEditorTestimonialDiv +':first-child').addClass('active').css({'opacity':'1', 'transform': 'translateX(0px)'}).css('z-index','20');
6879					if(	!$(this).hasClass('disable-height-animation') ) {
6880						$(this).find('.slides').css({'height' : $(this).find('.slides '+$frontEndEditorTestimonialDiv +':first-child').height() + 40 + 'px' });
6881					}
6882				}
6883
6884				//autorotate
6885				if($(this).attr('data-autorotate').length > 0) {
6886					var slide_interval = (parseInt($(this).attr('data-autorotate')) < 100) ? 4000 : parseInt($(this).attr('data-autorotate'));
6887					var $that = $(this);
6888					var $rotate = setInterval(function(){ testimonialRotate($that) },slide_interval);
6889				}
6890				$(this).find('.testimonial-next-prev a').on('click',function(e){
6891					if(typeof e.clientX != 'undefined') clearInterval($rotate);
6892				});
6893
6894				//wrap bullets
6895				$(this).find('.controls ul').wrap('<div class="control-wrap" />');
6896				$(this).find('.controls ul').css('width', (($(this).find('.controls ul li').length * 20) +1) + 'px');
6897				$(this).find('.controls').append('<span class="out-of">/</span><span class="total">'+$(this).find('blockquote').length+'</span>');
6898
6899				////swipe for testimonials
6900				$(this).swipe({
6901				
6902					swipeLeft : function(e) {
6903						$(this).find('.testimonial-next-prev .next').trigger('click');
6904						e.stopImmediatePropagation();
6905						clearInterval($rotate);
6906						return false;
6907					 },
6908					 swipeRight : function(e) {
6909						$(this).find('.testimonial-next-prev .prev').trigger('click');
6910						e.stopImmediatePropagation();
6911						clearInterval($rotate);
6912						return false;
6913					 }    
6914				});
6915
6916
6917			}
6918
6919			//non minimal
6920			if( !$(this).is('[data-style="minimal"]') ) {
6921
6922				//activate first slide
6923				$(this).find('.controls ul li').first().click();
6924
6925				//autorotate
6926				if($(this).attr('data-autorotate').length > 0) {
6927					var slide_interval = (parseInt($(this).attr('data-autorotate')) < 100) ? 4000 : parseInt($(this).attr('data-autorotate'));
6928					var $that = $(this);
6929					var $rotate = setInterval(function(){ testimonialRotate($that) },slide_interval);
6930				}
6931				
6932				$(this).find('.controls li').on('click',function(e){
6933					if(typeof e.clientX != 'undefined') clearInterval($rotate);
6934				});
6935				
6936				////swipe for testimonials
6937				$(this).swipe({
6938				
6939					swipeLeft : function(e) {
6940						$(this).find('.controls ul li span.active').parent().next('li').find('span').trigger('click');
6941						e.stopImmediatePropagation();
6942						clearInterval($rotate);
6943						return false;
6944					 },
6945					 swipeRight : function(e) {
6946						$(this).find('.controls ul li span.active').parent().prev('li').find('span').trigger('click');
6947						e.stopImmediatePropagation();
6948						clearInterval($rotate);
6949						return false;
6950					 }    
6951				});
6952
6953		}
6954		} 
6955		//only one testimonial
6956		else if($(this).find('.controls').length == 0) {
6957			var currentHeight = $(this).find('.slides blockquote').height();
6958			$(this).find('.slides blockquote').css({'opacity':'0', 'transform': 'translateX(-25px)', 'z-index': '1'});
6959			$(this).find('.slides blockquote').css({'opacity':'1', 'transform': 'translateX(0px)'}).css('z-index','20');
6960			$(this).find('.slides').stop(true,true).animate({'height' : currentHeight + 20 + 'px' },450,'easeOutCubic');
6961		}
6962	});
6963
6964
6965  $testimonialSlider = [];
6966		
6967	$('.testimonial_slider[data-style*="multiple_visible"] .slides').each(function(i){
6968	    	var $that = $(this); 
6969	    	var $element = $that;
6970	    	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')) : false;
6971			if($that.find('img').length == 0) $element = $('body');
6972
6973			//move img pos
6974			if( $(this).parents('.testimonial_slider').attr('data-style') != 'multiple_visible_minimal') {
6975				$(this).find('blockquote').each(function(){
6976					$(this).find('.image-icon').insertAfter($(this).find('p'));
6977				});
6978			} else {
6979				//has alf class
6980				if($(this).find('blockquote').length > 4) {
6981					$(this).parents('.testimonial_slider').addClass('has-alf');
6982				}
6983			}
6984			
6985			var $testimonialGroupCells = ($(this).parents('.testimonial_slider').attr('data-style') == 'multiple_visible_minimal') ? true : false;
6986
6987			imagesLoaded($element,function(instance){
6988				
6989				var $frontEndEditorDrag =  ($('body.vc_editor').length > 0) ? false: true;
6990				var $frontEndEditorPause =  ($('body.vc_editor').length > 0) ? true: false;
6991
6992		    	$testimonialSlider[i] = $that.flickity({
6993		    		contain: true,
6994					  draggable: $frontEndEditorDrag,
6995					  groupCells: $testimonialGroupCells,
6996					  lazyLoad: false,
6997					  imagesLoaded: true,
6998					  percentPosition: true,
6999					  prevNextButtons: false,
7000					  pageDots: true,
7001					  resize: true,
7002					  setGallerySize: true,
7003					  wrapAround: true,
7004					  autoPlay: $autoplay,
7005						pauseAutoPlayOnHover: $frontEndEditorPause,
7006					  accessibility: false
7007		    	});
7008					
7009					if($testimonialSlider[i].find('.vc_element.is-selected > blockquote').length > 0) {
7010						
7011						//starting
7012						$testimonialSlider[i].find('.vc_element.is-selected > blockquote').addClass('is-selected');
7013						
7014						//changed
7015						$testimonialSlider[i].on( 'select.flickity', function() {
7016							$testimonialSlider[i].find('.vc_element > blockquote').removeClass('is-selected');
7017							$testimonialSlider[i].find('.vc_element.is-selected > blockquote').addClass('is-selected');
7018						});
7019					}
7020					
7021
7022			    $that.parents('.testimonial_slider').css('opacity','1');
7023			    
7024
7025		     });//images loaded
7026		     	     
7027	    });//each	
7028
7029
7030}
7031createTestimonialControls();
7032
7033function testimonialRotate(slider){
7034	
7035	var $testimonialLength = slider.find('li').length;
7036	var $currentTestimonial = slider.find('.pagination-switch.active').parent().index();
7037	
7038	//stop the rotation when toggles are closed
7039	if( slider.parents('.toggle').length > 0 && slider.parents('.toggle').hasClass('open') ) {
7040
7041		if( !slider.is('[data-style="minimal"]') ) {
7042			if( $currentTestimonial+1 == $testimonialLength) {
7043				slider.find('ul li:first-child').click();
7044			} else {
7045				slider.find('.pagination-switch.active').parent().next('li').click();
7046			}
7047		} else {
7048			slider.find('.testimonial-next-prev .next').click();
7049		}
7050			
7051	} else {
7052		
7053		if( !slider.is('[data-style="minimal"]') ) {
7054			if( $currentTestimonial+1 == $testimonialLength) {
7055				slider.find('ul li:first-child').click();
7056			} else {
7057				slider.find('.pagination-switch.active').parent().next('li').click();
7058			}
7059		} else {
7060			slider.find('.testimonial-next-prev .next').click();
7061		}
7062	
7063	}
7064
7065}
7066
7067function testimonialHeightResize(){
7068	$('.testimonial_slider:not(.disable-height-animation):not([data-style*="multiple_visible"])').each(function(){
7069		
7070		var $frontEndEditorTestimonialDiv =  ($('body.vc_editor').length > 0) ? '> div': 'blockquote';
7071		
7072		var $index = $(this).find('.controls ul li span.active').parent().index();
7073		var currentHeight = $(this).find('.slides '+$frontEndEditorTestimonialDiv).eq($index).height();
7074		$(this).find('.slides').stop(true,true).css({'height' : currentHeight + 40 + 'px' });
7075		
7076	});
7077}
7078
7079
7080function testimonialSliderHeight() {
7081		
7082	$('.testimonial_slider.disable-height-animation:not([data-style*="multiple_visible"])').each(function(){
7083		$tallestQuote = 0;
7084			
7085		$(this).find('blockquote').each(function(){
7086			($(this).height() > $tallestQuote) ? $tallestQuote = $(this).height() : $tallestQuote = $tallestQuote;
7087		});	
7088		
7089		//safety net incase height couldn't be determined
7090		if($tallestQuote == 0) $tallestQuote = 100;
7091		
7092		//set even height
7093		$(this).find('.slides').css('height',$tallestQuote+40+'px');
7094		
7095		//show the slider once height is set
7096		$(this).animate({'opacity':'1'});
7097
7098		fullWidthContentColumns();
7099
7100	});
7101
7102
7103}
7104
7105function testimonialSliderHeightMinimalMult() {
7106		
7107	$('.testimonial_slider[data-style="multiple_visible_minimal"]').each(function(){
7108		$tallestQuote = 0;
7109		
7110		$(this).find('blockquote > .inner p').css('height','auto');
7111		
7112		$(this).find('blockquote > .inner p').each(function(){
7113			($(this).height() > $tallestQuote) ? $tallestQuote = $(this).height() : $tallestQuote = $tallestQuote;
7114		});	
7115		
7116		//safety net incase height couldn't be determined
7117		if($tallestQuote == 0) $tallestQuote = 200;
7118		
7119		//set even height
7120		$(this).find('blockquote > .inner p').css('height',$tallestQuote+'px');
7121		
7122	});
7123
7124}
7125
7126if($('.testimonial_slider.disable-height-animation:not([data-style*="multiple_visible"])').length > 0) {
7127	testimonialSliderHeight(); 
7128	setTimeout(testimonialSliderHeight,500);
7129}
7130
7131if($('.testimonial_slider[data-style="multiple_visible_minimal"]').length > 0) {
7132	testimonialSliderHeightMinimalMult();
7133	setTimeout(testimonialSliderHeightMinimalMult,500);
7134}
7135
7136
7137/***************** WP Media Embed / External Embed ******************/
7138
7139//this isn't the for the video shortcode* This is to help any external iframe embed fit & resize correctly 
7140function responsiveVideoIframesInit(){
7141	$('iframe').each(function(){
7142		
7143		//make sure the iframe has a src (things like adsense don't)
7144		if(typeof $(this).attr('src') != 'undefined' && !$(this).hasClass('iframe-embed') && $(this).parents('.ult_modal').length == 0 && $(this).parents('.ls-slide').length == 0 && $(this).parents('.esg-entry-media').length == 0 && $(this).parents('.wpb_video_widget.wpb_content_element').length == 0){
7145			
7146			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) {
7147				
7148				$(this).addClass('iframe-embed');	
7149
7150				$(this).attr('data-aspectRatio', $(this).height() / $(this).width()).removeAttr('height').removeAttr('width');
7151				
7152				if($(this).parents('.post-area.masonry.classic').length > 0) {
7153						$(this).attr('data-aspectRatio', '0.56').removeAttr('height').removeAttr('width');
7154				}
7155
7156			}
7157			 
7158		}
7159		
7160	});
7161
7162
7163}
7164
7165function responsiveVideoIframes(){
7166	 $('iframe[data-aspectRatio]').each(function() {
7167	 	var newWidth = $(this).parent().width();
7168	 	 
7169		var $el = $(this);
7170		
7171		//in nectar slider
7172		if($(this).parents('.swiper-slide').length > 0) {
7173			if($(this).is(':visible')) $el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
7174		} 
7175		//all others
7176		else {
7177			$el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
7178		}
7179		
7180		
7181	});
7182}
7183
7184
7185function videoshortcodeSize(){
7186	//removed in 9.0.
7187}
7188
7189responsiveVideoIframesInit();
7190responsiveVideoIframes();
7191
7192
7193//unwrap post and protfolio videos
7194$('.video-wrap iframe').unwrap();
7195$('#sidebar iframe[src]').unwrap();
7196
7197$('audio').attr('width','100%');
7198$('audio').attr('height','100%');
7199
7200$('audio').css('visibility','visible');
7201
7202if($('body').hasClass('mobile')){
7203	$('video').css('visibility','hidden');
7204} else {
7205	$('video').css('visibility','visible');
7206}
7207
7208
7209$('.wp-video').each(function(){
7210	 var video = $(this).find('video').get(0);
7211	 video.addEventListener('loadeddata', function() {
7212	   $(window).trigger('resize');
7213	 }, false);
7214});
7215
7216//webkit video back button fix 
7217$('.main-content iframe[src]').each(function(){
7218	$(this).css({'opacity':'1', 'visibility':'visible'});
7219});
7220
7221
7222/***************** Nectar Video BG ******************/
7223
7224	$('.wpb_row:has(".nectar-video-wrap"):not(.fp-section)').each(function(i){
7225		$(this).css('z-index',100 + i);
7226	});
7227
7228	var min_w = 1200; // minimum video width allowed
7229	var vid_w_orig;  // original video dimensions
7230	var vid_h_orig;
7231	
7232    vid_w_orig = 1280;
7233    vid_h_orig = 720;
7234 
7235	function resizeVideoToCover() {
7236		$('.nectar-video-wrap').each(function(i){
7237			if($(this).find('video').length == 0 ) return;
7238
7239			if($(this).parents('#page-header-bg').length > 0) {
7240				if($('.container-wrap.auto-height').length > 0) return false;
7241				var $containerHeight = $(this).parents('#page-header-bg').outerHeight();			
7242				var $containerWidth = $(this).parents('#page-header-bg').outerWidth();
7243			} else {
7244				
7245				if($(this).hasClass('column-video')) {
7246					var $containerHeight = $(this).parents('.wpb_column').outerHeight();			
7247					var $containerWidth = $(this).parents('.wpb_column').outerWidth();			
7248				} else {
7249					var $containerHeight = $(this).parents('.wpb_row').outerHeight();			
7250					var $containerWidth = ($(this).parents('.full-width-section').length > 0) ? window.innerWidth : $(this).parents('.wpb_row').outerWidth();			
7251				}	
7252			}
7253			
7254		    // set the video viewport to the window size
7255		    $(this).width($containerWidth);
7256				if($(this).parents('#page-header-bg').length > 0) {
7257			    $(this).height($containerHeight);
7258				}
7259		
7260		    // use largest scale factor of horizontal/vertical
7261		    var scale_h = $containerWidth / vid_w_orig;
7262		    var scale_v = ($containerHeight - $containerHeight) / vid_h_orig; 
7263		    var scale = scale_h > scale_v ? scale_h : scale_v;
7264			
7265			//update minium width to never allow excess space
7266		    min_w = 1280/720 * ($containerHeight+40);
7267		    
7268		    // don't allow scaled width < minimum video width
7269		    if (scale * vid_w_orig < min_w) {scale = min_w / vid_w_orig;}
7270		        
7271		    // now scale the video
7272		    $(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * vid_w_orig +0));
7273		    $(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * vid_h_orig +0));
7274		    
7275		    // and center it by scrolling the video viewport
7276		    $(this).scrollLeft(($(this).find('video').width() - $containerWidth) / 2);
7277		    $(this).scrollTop(($(this).find('video').height() - ($containerHeight)) / 2);
7278		    $(this).find('.mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($containerHeight)) / 2);
7279
7280
7281		    //align bottom
7282		    if($(this).attr('data-bg-alignment') == 'center bottom' || $(this).attr('data-bg-alignment') == 'bottom'){
7283		    	$(this).scrollTop(($(this).find('video').height() - ($containerHeight+6)));
7284		    }
7285		    //align top
7286		    else if($(this).attr('data-bg-alignment') == 'center top' || $(this).attr('data-bg-alignment') == 'top') {
7287		    	$(this).scrollTop(0);
7288		    } 
7289				
7290				//add loaded class
7291				$(this).addClass('position-loaded');
7292		});
7293	}
7294    
7295    //init
7296    function videoBGInit(){
7297	    setTimeout(function(){
7298	    	resizeVideoToCover();
7299	    	$('.video-color-overlay').each(function(){
7300	    		$(this).css('background-color',$(this).attr('data-color'));
7301	    	});
7302	    	$('.nectar-video-wrap').each(function(i){
7303
7304	    		if($(this).find('video').length == 0) return;
7305
7306	    		var $headerVideo = ($(this).parents('#page-header-bg').length > 0) ? true : false;
7307	    		var $that = $(this);
7308
7309	    		 var videoReady = setInterval(function(){
7310
7311	        		if($that.find('video').get(0).readyState > 3) {
7312								
7313								if(!nectarDOMInfo.usingMobileBrowser) {
7314		        			$that.transition({'opacity':'1'},400);
7315				    			$that.find('video').transition({'opacity':'1'},400);
7316				    			$that.parent().find('.video-color-overlay').transition({'opacity':'0.7'},400);
7317									if($headerVideo == true) {
7318					    			pageHeaderTextEffect();
7319								  }
7320								}
7321
7322							//remove page loading screen
7323							$('#ajax-loading-screen').addClass('loaded');
7324							setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
7325					
7326
7327							clearInterval(videoReady);
7328						}
7329						
7330	    		},60);
7331					
7332					if(nectarDOMInfo.usingMobileBrowser) {
7333						if($that.parents('.full-width-section').length > 0 && $that.parents('#nectar_fullscreen_rows').length == 0) {
7334							$that.css('left','50%');
7335						} else {
7336							$that.css('left','0px');
7337						}
7338						
7339						if($headerVideo == true) {
7340							pageHeaderTextEffect();
7341						}
7342						$that.find('video')[0].onplay = function(){
7343							$that.transition({'opacity':'1'},400);
7344							$that.find('video').transition({'opacity':'1'},400);
7345							$that.parent().find('.video-color-overlay').transition({'opacity':'0.7'},400);
7346						};
7347					}
7348	    		
7349	    	});
7350	    },300);
7351
7352		if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
7353
7354				
7355				$('.nectar-video-wrap').each(function(){
7356					
7357						if(!$(this).find('video').is('[muted]')) {
7358
7359								//autoplay not supported unless muted
7360								$(this).parent().find('.mobile-video-image').show();
7361								$(this).remove();
7362						}
7363						
7364				});
7365		
7366		
7367		}
7368
7369		
7370		 if(navigator.userAgent.indexOf('Chrome') > 0 && !/Edge\/12./i.test(navigator.userAgent) && !/Edge\/\d./i.test(navigator.userAgent)) { 
7371		 	
7372		 	$('.nectar-video-wrap').each(function(i){
7373		 		if(jQuery(this).find('video source[type="video/webm"]').length > 0 ) {
7374				  	var webmSource = jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
7375		          	var firstVideo = jQuery(this).find('video').get(0);
7376		          	firstVideo.src = webmSource;
7377		          	firstVideo.load();
7378		         }
7379            });
7380	    }
7381
7382
7383
7384
7385	    jQuery(".vc_row").each(function() {
7386	        var youtubeUrl, youtubeId, $row = jQuery(this);
7387	        $row.find('.nectar-youtube-bg').length > 0 ? (youtubeUrl = $row.find('.nectar-youtube-bg span').text(), youtubeId = nectarExtractYoutubeId(youtubeUrl), youtubeId && ($row.find(".vc_video-bg").remove(), nectarInsertYoutubeVideoAsBackgroun
7387d($row.find('.nectar-youtube-bg'), youtubeId))) : $row.find(".nectar-youtube-bg").remove()
7388
7389	        //remove yt url
7390	        $row.find('.nectar-youtube-bg span').remove();
7391					
7392					if(!nectarDOMInfo.usingMobileBrowser) {
7393		        $row.find('.nectar-video-wrap, .nectar-youtube-bg').css({'opacity':'1','width':'100%', 'height':'100%'});
7394					}
7395	         $row.find('.video-color-overlay').transition({'opacity':'0.7'},400);
7396	    });
7397		
7398
7399		function nectarInsertYoutubeVideoAsBackground($element, youtubeId, counter) {
7400		    if ("undefined" == typeof YT || void 0 === YT.Player) return 100 < (counter = void 0 === counter ? 0 : counter) ? void console.warn("Too many attempts to load YouTube api") : void setTimeout(function() {
7401		        nectarInsertYoutubeVideoAsBackground($element, youtubeId, counter++)
7402		    }, 100);
7403		    var $container = $element.prepend('<div class="vc_video-bg"><div class="inner"></div></div>').find(".inner");
7404		    new YT.Player($container[0], {
7405		        width: "100%",
7406		        height: "100%",
7407		        videoId: youtubeId,
7408		        playerVars: {
7409		            playlist: youtubeId,
7410		            iv_load_policy: 3,
7411		            enablejsapi: 1,
7412		            disablekb: 1,
7413		            autoplay: 1,
7414		            controls: 0,
7415		            showinfo: 0,
7416		            rel: 0,
7417		            loop: 1
7418		        },
7419		        events: {
7420		            onReady: function(event) {
7421		                event.target.mute().setLoop(!0);
7422										nectarResizeVideoBackground($element);
7423		            }
7424		        }
7425		    }), nectarResizeVideoBackground($element), jQuery(window).on("resize", function() {
7426		        nectarResizeVideoBackground($element);
7427		    });
7428				
7429				setTimeout(function(){
7430					 nectarResizeVideoBackground($element);
7431				},100);
7432		}
7433
7434		function nectarResizeVideoBackground($element) {
7435		    var iframeW, iframeH, marginLeft, marginTop, containerW = $element.innerWidth(),
7436		        containerH = $element.innerHeight(),
7437		        ratio1 = 16,
7438		        ratio2 = 9;
7439		    ratio1 / ratio2 > containerW / containerH ? (iframeW = containerH * (ratio1 / ratio2), 
7440		    	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", 
7441		    	marginLeft = -Math.round((iframeW - containerW) / 2) + "px", iframeW += "px", iframeH += "px"), 
7442		    	$element.find(".vc_video-bg iframe").css({
7443			        maxWidth: "1000%",
7444			        marginLeft: marginLeft,
7445			        marginTop: marginTop,
7446			        width: iframeW,
7447			        height: iframeH
7448			    })
7449		}
7450
7451		function nectarExtractYoutubeId(url) {
7452		    if ("undefined" == typeof url) return !1;
7453		    var id = url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);
7454		    return null !== id ? id[1] : !1
7455		}
7456
7457
7458	}
7459
7460	if($('.nectar-video-wrap').length > 0 || $('.nectar-youtube-bg').length > 0) {
7461		videoBGInit();
7462	}
7463
7464
7465/*-------------------------------------------------------------------------*/
7466/*	4.	Header + Search
7467/*-------------------------------------------------------------------------*/	 
7468
7469////mobile megamenus without titles / nested groupings
7470var $mobileNavSelector = ($('.off-canvas-menu-container.mobile-only').length > 0) ? '.off-canvas-menu-container.mobile-only ': '#mobile-menu .container ';
7471$($mobileNavSelector+'.megamenu > ul > li > a').each(function(){
7472	if( $(this).text() == '–' ) {
7473		$navLIs = $(this).parent().find('> ul > li').clone();
7474		$(this).parent().find('ul').remove();
7475		$(this).parent().parent().append($navLIs);
7476		$(this).parent().remove();
7477	}
7478});
7479
7480/***************** Slide Out Widget Area **********/
7481
7482var $bodyBorderHeaderColorMatch = ($('.body-border-top').css('background-color') == '#ffffff' && $('body').attr('data-header-color') == 'light' || $('.body-border-top').css('background-color') == $('#header-outer').attr('data-user-set-bg')) ? true : false;
7483var $bodyBorderWidth = ($('.body-border-right').length > 0) ? $('.body-border-right').width() : 0;
7484var $resetHeader;
7485
7486
7487function mobileBreakPointCheck() {
7488	var $mobileBreakpoint = ( $('body[data-header-breakpoint]').length > 0 && $('body').attr('data-header-breakpoint') != '1000' ) ? parseInt($('body').attr('data-header-breakpoint')) : 1000;
7489	var $withinCustomBreakpoint = false;
7490
7491	if($mobileBreakpoint != 1000) {
7492		if( $('body[data-user-set-ocm="1"][data-slide-out-widget-area-style="slide-out-from-right-hover"]').length == 0 && window.innerWidth > 1000 && window.innerWidth <= $mobileBreakpoint ) {
7493			$withinCustomBreakpoint = true;
7494		}
7495	}
7496
7497	return $withinCustomBreakpoint;
7498}
7499
7500//icon effect html creation
7501if($('#slide-out-widget-area.slide-out-from-right-hover').length > 0) {
7502
7503	if($('#ajax-content-wrap > .slide-out-widget-area-toggle').length == 0) {
7504		$('<div class="slide-out-widget-area-toggle slide-out-hover-icon-effect" data-icon-animation="simple-transform"><div> <a href="#sidewidgetarea" class="closed"> <span> <i class="lines-button x2"> <i class="lines"></i> </i> </span> </a> </div> </div>').insertAfter('#slide-out-widget-area');
7505		if($('#header-outer[data-has-menu="true"]').length > 0 || $('body[data-header-search="true"]').length > 0) $('#ajax-content-wrap > .slide-out-widget-area-toggle').addClass('small');
7506	}
7507
7508
7509	function calculateHoverNavMinHeight() {
7510		$widgetHeights = 0;
7511		$('#slide-out-widget-area > .widget').each(function(){
7512			$widgetHeights += $(this).height();
7513		});
7514		$menuHeight = ( ($('#slide-out-widget-area').height() - 25 - $('.bottom-meta-wrap').outerHeight(true) -$widgetHeights) > $('#slide-out-widget-area .off-canvas-menu-container:last-child').height() ) ? $('#slide-out-widget-area').height() - 25 - $('.bottom-meta-wrap').outerHeight(true) -$widgetHeights : $('#slide-out-widget-area .off-canvas-menu-container:last-child').height();
7515
7516		$('#slide-out-widget-area .inner').css({'height':'auto', 'min-height': $menuHeight  });
7517
7518		$('#slide-out-widget-area.slide-out-from-right-hover > .inner .off-canvas-menu-container').transition({ y : '-' + ($('#slide-out-widget-area.slide-out-from-right-hover > .inner .off-canvas-menu-container:last-child').height()/2) + 'px' },0);
7519	
7520	}
7521
7522	function openRightHoverNav() {
7523
7524		
7525
7526			calculateHoverNavMinHeight();
7527
7528			if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) && $('#slide-out-widget-area.open').length > 0) {
7529				mobileCloseNavCheck();
7530				return;
7531			}
7532			
7533
7534			$('#slide-out-widget-area').css({ 'transform': 'translate3d(0,0,0)' }).addClass('open');
7535
7536			var $bodyBorderHeaderColorMatch = ($('.body-border-top').length > 0 && $('.body-border-top').css('background-color') == '#ffffff' && $('body').attr('data-header-color') == 'light' || $('.body-border-top').length > 0 && $('.body-border-top').css('background-color') == $('#header-outer').attr('data-user-set-bg')) ? true : false;
7537
7538			//icon effect
7539			////set pos 
7540			if($('header#top .container .span_9 > .slide-out-widget-area-toggle').length > 0) {
7541				
7542				var secondaryBarHeight = ($('#header-secondary-outer').length > 0) ? $('#header-secondary-outer').height() : 0; 
7543				
7544
7545				if($('body.mobile').length > 0) {
7546
7547					$('.slide-out-hover-icon-effect').css({'top': $('header#top .span_9 > .slide-out-widget-area-toggle a').offset().top - $(window).scrollTop(), 'right': parseInt($('#header-outer header > .container').css('padding-right')) + 1 });
7548				} else {
7549
7550					if($bodyBorderHeaderColorMatch) {
7551
7552						var $extraCushion = ($('#header-outer[data-has-menu="false"]').length > 0) ? 2 : 1;
7553						$('.slide-out-hover-icon-effect').css({
7554							'top': nectarDOMInfo.adminBarHeight + secondaryBarHeight + parseInt($('header#top nav >ul .slide-out-widget-area-toggle a').css('padding-top')), 
7555							'right': 29 + $extraCushion });
7556
7557					} else {
7558
7559						var $withinCustomBreakpoint = mobileBreakPointCheck();
7560
7561						if($('body.ascend').length > 0 && $withinCustomBreakpoint != true) {
7562							var $extraCushion = ($('#header-outer[data-has-menu="false"]').length > 0) ? 2 : 1;
7563							$('.slide-out-hover-icon-effect').css({'top': nectarDOMInfo.adminBarHeight + secondaryBarHeight + parseInt($('header#top nav >ul .slide-out-widget-area-toggle a').css('padding-top')), 'right': parseInt($('#header-outer header >.container').css('padding-right')) + $extraCushion });
7564						} else {
7565
7566							if($('body.material').length > 0) {
7567								if($('#header-outer[data-format="centered-menu-bottom-bar"]').length > 0) {
7568									var $nectarHamMenuPos = ($('header#top .span_9 > .slide-out-widget-area-toggle').css('display') == 'block') ? $('#header-outer header#top > .container .span_9 > .slide-out-widget-area-toggle.mobile-icon').position() : $('header#top .span_3 .right-side .slide-out-widget-area-toggle > div').offset();
7569									if($('#header-secondary-outer.hide-up').length > 0) { secondaryBarHeight = 0; }
7570									$('.slide-out-hover-icon-effect').css({'top': secondaryBarHeight + parseInt($nectarHamMenuPos.top) - nectarDOMInfo.scrollTop , 'right': parseInt($('#header-outer header >.container').css('padding-right')) + 2  });
7571								} else {
7572									var $nectarHamMenuPos = ($('header#top .span_9 > .slide-out-widget-area-toggle').css('display') == 'block') ? $('#header-outer header#top > .container .span_9 > .slide-out-widget-area-toggle.mobile-icon').position() : $('header#top nav .buttons .slide-out-widget-area-toggle > div').position();
7573									if($('#header-secondary-outer.hide-up').length > 0) { secondaryBarHeight = 0; }
7574									$('.slide-out-hover-icon-effect').css({'top': nectarDOMInfo.adminBarHeight + secondaryBarHeight + parseInt($nectarHamMenuPos.top) , 'right': parseInt($('#header-outer header >.container').css('padding-right')) + 2  });
7575								}
7576								
7577								
7578							} else {
7579								$menuToggleSelector = ($('header#top nav > ul .slide-out-widget-area-toggle').length > 0 && $('header#top nav > ul .slide-out-widget-area-toggle').css('display') != 'none') ? $('header#top nav > ul .slide-out-widget-area-toggle') : $('body header#top .span_9 >.slide-out-widget-area-toggle');
7580								$('.slide-out-hover-icon-effect').css({'top': nectarDOMInfo.adminBarHeight + secondaryBarHeight + parseInt($menuToggleSelector.css('padding-top')) + parseInt($('#header-outer').css('padding-top')), 'right': parseInt($('#header-outer header >.container').css('padding-right')) + 1 + parseInt($menuToggleSelector.css('margin-right')) });
7581							}
7582						}
7583					}
7584					
7585				}
7586			}
7587
7588			////open
7589
7590			$('.slide-out-hover-icon-effect .lines-button').removeClass('no-delay').addClass('unhidden-line');
7591			
7592
7593			if($('#header-outer[data-permanent-transparent="1"]').length == 0 && $('#nectar_fullscreen_rows').length == 0 && !nectarDOMInfo.usingFrontEndEditor) {
7594
7595				if(!($(window).scrollTop() == 0 && $('#header-outer.transparent').length > 0)) {
7596
7597					if($('body.mobile').length == 0 && $bodyBorderHeaderColorMatch) {
7598
7599						$('#header-outer').attr('data-transparent','true').addClass('no-bg-color').addClass('slide-out-hover');
7600						$('#header-outer header, #header-outer > .cart-outer').addClass('all-hidden');
7601					}
7602
7603				}
7604
7605				if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('body.mobile').length == 0 && $bodyBorderHeaderColorMatch) {
7606					var headerResize = $('#header-outer').attr('data-header-resize');
7607					if(headerResize == 1) {
7608
7609						$(window).off('scroll',bigNav);
7610						$(window).off('scroll',smallNav);
7611
7612
7613					} else {
7614						
7615						$(window).off('scroll',opaqueCheck);
7616						$(window).off('scroll',transparentCheck);
7617					}
7618				}
7619
7620			}
7621
7622			if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
7623				$(window).on('mousemove.rightOffsetCheck',closeNavCheck);
7624			}
7625
7626	}
7627
7628	function closeNavCheck(e) {
7629		var $windowWidth = $(window).width();
7630		if(e.clientX < $windowWidth - 340 - $bodyBorderWidth) {
7631
7632				$(window).off('mousemove.rightOffsetCheck',closeNavCheck);
7633
7634				$('#slide-out-widget-area').css({ 'transform': 'translate3d(341px,0,0)' }).removeClass('open');
7635
7636				$('#header-outer').removeClass('style-slide-out-from-right');
7637
7638				$('.slide-out-hover-icon-effect .lines-button').removeClass('unhidden-line').addClass('no-delay');
7639
7640				var $bodyBorderHeaderColorMatch = ($('.body-border-top').length > 0 && $('.body-border-top').css('background-color') == '#ffffff' && $('body').attr('data-header-color') == 'light' || $('.body-border-top').length > 0 && $('.body-border-top').css('background-color') == $('#header-outer').attr('data-user-set-bg')) ? true : false;
7641
7642				if($('#header-outer[data-permanent-transparent="1"]').length == 0) {
7643
7644					if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('body.mobile').length == 0 && $bodyBorderHeaderColorMatch) {
7645
7646						if($('body.mobile').length == 0) {
7647							$('#header-outer').removeClass('no-bg-color');
7648							$('#header-outer header, #header-outer > .cart-outer').removeClass('all-hidden');
7649						}
7650					}
7651
7652					if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('body.mobile').length == 0 && $bodyBorderHeaderColorMatch) {
7653						var headerResize = $('#header-outer').attr('data-header-resize');
7654						if(headerResize == 1) {
7655						
7656							$(window).off('scroll.headerResizeEffect');
7657							if($(window).scrollTop() == 0) {
7658								$(window).on('scroll.headerResizeEffect',smallNav); 
7659
7660								if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0 && $('.body-border-top').length > 0 && $bodyBorderHeaderColorMatch == true && $('#header-outer.pseudo-data-transparent').length > 0) {
7661									$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
7662										'padding' : '0'			
7663									},{queue:false, duration:250, easing: 'easeOutCubic'});	
7664								}
7665							}
7666							else {
7667								$(window).on('scroll.headerResizeEffect',bigNav);
7668							}
7669							
7670				
7671						} else {
7672							
7673							$(window).off('scroll.headerResizeEffectOpaque');
7674							$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
7675						}
7676					}
7677				}
7678
7679			}
7680
7681	}
7682
7683	function mobileCloseNavCheck(e) {
7684		
7685
7686				$('#slide-out-widget-area').css({ 'transform': 'translate3d(341px,0,0)' }).removeClass('open');
7687
7688				$('#header-outer').removeClass('style-slide-out-from-right');
7689
7690				$('.slide-out-hover-icon-effect .lines-button').removeClass('unhidden-line').addClass('no-delay');
7691
7692				if($('#header-outer[data-permanent-transparent="1"]').length == 0) {
7693
7694					$('#header-outer').removeClass('no-bg-color');
7695					$('#header-outer header').removeClass('all-hidden');
7696
7697				}
7698
7699				var $bodyBorderHeaderColorMatch = ($('.body-border-top').length > 0 && $('.body-border-top').css('background-color') == '#ffffff' && $('body').attr('data-header-color') == 'light' || $('.body-border-top').length > 0 && $('.body-border-top').css('background-color') == $('#header-outer').attr('data-user-set-bg')) ? true : false;
7700
7701				if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('body.mobile').length == 0 && $bodyBorderHeaderColorMatch) {
7702					
7703					var headerResize = $('#header-outer').attr('data-header-resize');
7704					if(headerResize == 1) {
7705					
7706						$(window).off('scroll.headerResizeEffect');
7707						if($(window).scrollTop() == 0) {
7708							$(window).on('scroll.headerResizeEffect',smallNav); 
7709
7710							if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0 && $('.body-border-top').length > 0 && $bodyBorderHeaderColorMatch == true && $('#header-outer.pseudo-data-transparent').length > 0) {
7711								$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
7712									'padding' : '0'			
7713								},{queue:false, duration:250, easing: 'easeOutCubic'});	
7714							}
7715						}
7716						else {
7717							$(window).on('scroll.headerResizeEffect',bigNav);
7718						}
7719						
7720			
7721					} else {
7722						
7723						$(window).off('scroll.headerResizeEffectOpaque');
7724						$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
7725					}
7726			}
7727
7728			
7729
7730	}
7731
7732	//hover triggered
7733	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
7734		$('body').on('mouseenter','#header-outer .slide-out-widget-area-toggle:not(.std-menu) a',openRightHoverNav);
7735	}
7736	else {
7737		$('body').on('click','.slide-out-widget-area-toggle:not(.std-menu) a',openRightHoverNav);
7738	}
7739
7740	$(window).on('smartresize',calculateHoverNavMinHeight);
7741
7742}
7743
7744
7745
7746function setMaterialWidth() {
7747	
7748	
7749	$('#slide-out-widget-area.slide-out-from-right').css({
7750		'padding-top' : $(window).height()*0.1,
7751		'padding-bottom' : $(window).height()*0.1
7752	});
7753
7754	slideOutWidgetOverflowState();
7755}
7756
7757if($('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length > 0) {
7758	setMaterialWidth();
7759}
7760
7761//icon hover effect
7762if($('body.material').length > 0 && $('body[data-slide-out-widget-area-style="slide-out-from-right-hover"]').length == 0) {
7763
7764	if($('body[data-slide-out-widget-area-style*="fullscreen"]').length == 0) {
7765		var $menuIconClone = $('header#top nav ul .slide-out-widget-area-toggle a > span > i').clone();
7766		$menuIconClone.addClass('hover-effect');
7767		$('header#top nav ul .slide-out-widget-area-toggle a > span').append($menuIconClone);
7768
7769		var $menuIconClone2 = $('header#top .slide-out-widget-area-toggle.mobile-icon a > span > i').clone();
7770		$menuIconClone2.addClass('hover-effect');
7771		$('header#top .slide-out-widget-area-toggle.mobile-icon a > span').append($menuIconClone2);
7772	}
7773
7774	$('body:not([data-slide-out-widget-area-style="slide-out-from-right"]) header#top .slide-out-widget-area-toggle a > span').append($('<span class="close-wrap"> <span class="close-line close-line1"></span> <span class="close-line close-line2"></span> </span>'));
7775}
7776
7777if($('body.material #boxed').length > 0 && $('body[data-slide-out-widget-area-style="slide-out-from-right-hover"]').length > 0) {
7778	$('#ajax-content-wrap > .slide-out-widget-area-toggle.slide-out-hover-icon-effect.small').insertAfter('.ocm-effect-wrap');
7779}
7780
7781//move material skin default ocm
7782if($('body.material').length > 0 && $('body[data-slide-out-widget-area-style*="fullscreen"]').length == 0) {
7783	$('body.material #slide-out-widget-area.slide-out-from-right .slide_out_area_close').insertAfter('.ocm-effect-wrap');
7784	$('#slide-out-widget-area-bg').insertAfter('.ocm-effect-wrap');
7785	$('#slide-out-widget-area').insertAfter('.ocm-effect-wrap');
7786	
7787}
7788
7789//remove trans on material search/ocm when resizing 
7790if($('body.material[data-header-search="true"]').length > 0 || $('body.material .ocm-effect-wrap').length > 0 ) {
7791		
7792	var materialTransTO;
7793
7794	$(window).resize(function(){
7795
7796		clearTimeout(materialTransTO);
7797
7798		$('body[data-slide-out-widget-area-style="slide-out-from-right"] > a.slide_out_area_close, .material #header-outer, .ocm-effect-wrap, .ocm-effect-wrap-shadow').addClass('no-material-transition');
7799
7800		materialTransTO = setTimeout(function(){
7801			$('body[data-slide-out-widget-area-style="slide-out-from-right"] > a.slide_out_area_close, .material #header-outer, .ocm-effect-wrap, .ocm-effect-wrap-shadow').removeClass('no-material-transition');
7802		},250);
7803
7804		setMaterialWidth();
7805
7806	});
7807}
7808
7809
7810function materialOCM_Size() {
7811	if($('.ocm-effect-wrap.material-ocm-open').length > 0 ) {
7812
7813		//$('#ajax-content-wrap').css({'position' : 'relative', 'top' : '-' + $(window).scrollTop() + 'px' });
7814		$('.ocm-effect-wrap').css({'height': $(window).height() });
7815		$('.ocm-effect-wrap-inner').css({'padding-top': nectarDOMInfo.adminBarHeight });
7816		
7817		
7818	}
7819}
7820$(window).resize(materialOCM_Size);
7821
7822
7823function OCM_dropdown_function() {
7824	var $nectar_ocm_dropdown_func = ($('#slide-out-widget-area[data-dropdown-func]').length > 0) ? $('#slide-out-widget-area').attr('data-dropdown-func') : 'default';
7825	if($nectar_ocm_dropdown_func == 'separate-dropdown-parent-link') {
7826		$('#slide-out-widget-area .off-canvas-menu-container li.menu-item-has-children').append('<span class="ocm-dropdown-arrow"><i class="fa-angle-down"></i></span>');
7827	}
7828}
7829
7830OCM_dropdown_function();
7831
7832//click triggered
7833$('body').on('click','.slide-out-widget-area-toggle:not(.std-menu) a.closed:not(.animating)',function(){
7834	if(animating == 'true' || $('.slide-out-from-right-hover').length > 0) return false;
7835	var $that = $(this);
7836
7837	$('#header-outer').removeClass('no-transition');
7838
7839	//slide out from right
7840	if($('#slide-out-widget-area').hasClass('slide-out-from-right')) {
7841
7842		var $slideOutAmount = ($('.body-border-top').length > 0 && $('body.mobile').length == 0) ? $('.body-border-top').height() : 0;
7843
7844
7845		if($('body.material').length == 0) {
7846
7847				//calc height if used bottom meta
7848				$('#slide-out-widget-area .inner').css({'height':'auto', 'min-height': $('#slide-out-widget-area').height() - 25 - $('.bottom-meta-wrap').height() });
7849
7850				if($('#boxed').length == 0) {
7851					$('.container-wrap, .home-wrap, #header-secondary-outer, #footer-outer:not(#nectar_fullscreen_rows #footer-outer), .nectar-box-roll,   #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');
7852
7853					var $withinCustomBreakpoint = mobileBreakPointCheck();
7854
7855					if($('#header-outer[data-format="centered-logo-between-menu"]').length == 0 || $withinCustomBreakpoint) {
7856						if($('#header-outer[data-transparency-option="1"]').length == 0 || ($('#header-outer[data-transparency-option="1"]').length > 0 && $('#header-outer[data-full-width="true"]').length == 0) || $('body.mobile').length > 0) {
7857							$('#header-outer').stop(true).css('transform','translateY(0)').transition({ x: '-' + (300+$slideOutAmount) +'px'},700,'easeInOutCubic');
7858						} else {
7859							$('#header-outer').stop(true).css('transform','translateY(0)').transition({ x: '-' + (300+$slideOutAmount) +'px', 'background-color':'transparent', 'border-bottom': '1px solid rgba(255,255,255,0.22)' },700,'easeInOutCubic');
7860						}
7861					} else {
7862						$('#header-outer header#top nav > ul.buttons, body:not(.material) #header-outer .cart-outer .cart-menu-wrap').transition({ x: '-300px'},700,'easeInOutCubic');
7863					}
7864
7865					$('#ascrail2000').transition({ 'x': '-' + (300+$slideOutAmount) +'px' },700,'easeInOutCubic');
7866					$('body:not(.ascend):not(.material) #header-outer .cart-menu').stop(true).transition({ 'x': '300px' },700,'easeInOutCubic');
7867				}
7868
7869				$('#slide-out-widget-area').stop(true).transition({ x: '-' + $slideOutAmount +'px' },700,'easeInOutCubic').addClass('open');
7870
7871
7872				if($('#boxed').length == 0) {
7873					//full width menu adjustments
7874					if($('#header-outer[data-full-width="true"]').length > 0 && !$('body').hasClass('mobile')) { 
7875						$('#header-outer').addClass('highzI'); 
7876						$('#ascrail2000').addClass('z-index-adj');
7877
7878						if($('#header-outer[data-format="centered-logo-between-menu"]').length == 0) {
7879							if($bodyBorderWidth == 0)
7880								$('header#top #logo').stop(true).transition({ x: (300+$slideOutAmount) +'px' },700,'easeInOutCubic'); 
7881							
7882						}
7883
7884						$('header#top .slide-out-widget-area-toggle .lines-button').addClass('close');
7885
7886						if($('#header-outer[data-remove-border="true"]').length > 0) {
7887							$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '64px' },700,'easeInOutCubic');
7888						} else {
7889							$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '89px' },700,'easeInOutCubic'); 
7890						}
7891
7892						$('body #header-outer nav > ul > li > a').css({'margin-bottom':'0'});
7893						
7894					}
7895				}
7896
7897				$('#header-outer').addClass('style-slide-out-from-right');
7898
7899				//fade In BG Overlay
7900				$('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).stop(true).transition({
7901					'opacity' : 1
7902				},700,'easeInOutCubic',function(){
7903					$('.slide-out-widget-area-toggle:not(.std-menu) > div > a').removeClass('animating');
7904				});
7905				
7906				//hide menu if no space
7907				if($('#header-outer[data-format="centered-logo-between-menu"]').length == 0) {
7908					$logoWidth = ($('#logo img:visible').length > 0) ? $('#logo img:visible').width() : $('#logo').width();
7909					if($('header#top nav > .sf-menu').offset().left - $logoWidth - 300 < 20) $('#header-outer').addClass('hidden-menu');
7910				} else {
7911					$('#header-outer').addClass('hidden-menu-items');
7912				}
7913
7914				var headerResize = $('#header-outer').attr('data-header-resize');
7915
7916				if($('#header-outer[data-remove-fixed="1"]').length == 0) {
7917					if($bodyBorderHeaderColorMatch == true && headerResize == 1) {
7918						
7919						$('#header-outer').stop(true).transition({ y: '0' },0).addClass('transparent').css('transition','transform');
7920						if($('#header-outer').attr('data-transparent-header') != 'true') {
7921							$('#header-outer').attr('data-transparent-header','true').addClass('pseudo-data-transparent');
7922						}
7923
7924						$(window).off('scroll',bigNav);
7925						$(window).off('scroll',smallNav);
7926
7927					} else if ($bodyBorderHeaderColorMatch == true) {
7928						$('#header-outer').addClass('transparent');
7929						$(window).off('scroll',opaqueCheck);
7930						$(window).off('scroll',transparentCheck);
7931
7932						if($('#header-outer').attr('data-transparent-header') != 'true') {
7933							$('#header-outer').attr('data-transparent-header','true').addClass('pseudo-data-transparent');
7934						}
7935					}
7936				}
7937
7938		} else if ( $('body.material').length > 0 ) {
7939
7940			//material
7941			
7942			//move ajax loading outside
7943			if($('#ajax-loading-screen').length > 0 && $('.ocm-effect-wrap #ajax-loading-screen').length > 0) {
7944				$('#ajax-loading-screen').insertBefore('.ocm-effect-wrap');
7945			}
7946			
7947			////hide secondary header when not at top with hhun
7948			if($(window).scrollTop() > 40) {
7949				
7950				$('body[data-hhun="1"] #header-secondary-outer').addClass('hidden');
7951			}
7952
7953
7954			setTimeout(function(){ $('.slide-out-widget-area-toggle:not(.std-menu) > div > a').removeClass('animating'); },300);
7955			$('#slide-out-widget-area, #slide-out-widget-area-bg, #header-outer .slide-out-widget-area-toggle').addClass('material-open');
7956
7957
7958			//handle bottom bar nav
7959			if($('body:not(.mobile) #header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length > 0  && $('#header-outer[data-format="centered-menu-bottom-bar"] .span_9').css('display') != 'none') {
7960				$('#header-outer:not(.fixed-menu)').css('top', nectarDOMInfo.adminBarHeight - $(window).scrollTop() + 'px' );
7961				
7962				if($('#header-secondary-outer').length > 0  && $('#header-outer.fixed-menu').length > 0) {
7963					$('#header-secondary-outer').css('visibility','hidden');
7964				}
7965				
7966			}
7967			
7968			$('#ajax-content-wrap').css({'position' : 'relative', 'top' : '-' + $(window).scrollTop() + 'px' });
7969			$('.ocm-effect-wrap-inner').css({'padding-top': nectarDOMInfo.adminBarHeight });
7970			$('#fp-nav').addClass('material-ocm-open');
7971			$('body').addClass('material-ocm-open');
7972			$('.ocm-effect-wrap').css({'height': window.innerHeight });
7973
7974			setTimeout(function(){
7975				$('.ocm-effect-wrap').addClass('material-ocm-open');
7976			},40);
7977			
7978			
7979			$('body > .slide_out_area_close').addClass('follow-body');
7980
7981			//icon effect
7982			$('#header-outer:not([data-format="left-header"]) header#top .slide-out-widget-area-toggle a').addClass('effect-shown');
7983
7984			//handle hhun when at top
7985			$('body[data-hhun="1"]:not(.no-scroll):not(.mobile) #header-outer[data-permanent-transparent="false"]:not(.detached):not(.parallax-contained):not(.at-top-before-box)').css({'transition':'none', 'transform':'translateY('+ nectarDOMInfo.adminBarHeight +'px)'});
7986
7987			setTimeout(function(){
7988				$('body > .slide_out_area_close').addClass('material-ocm-open');
7989			},350);
7990
7991
7992		}
7993
7994
7995	}
7996     else if($('#slide-out-widget-area').hasClass('fullscreen')) {
7997
7998     	if ( $('body.material').length > 0 ) {
7999     		$('header#top .slide-out-widget-area-toggle a').addClass('menu-push-out');
8000     	}
8001
8002		//scroll away from fixed reveal footer if shown (firefox bug with bluring over it)
8003		var $scrollDelay = 0;
8004		var $scrollDelay2 = 0;
8005
8006		if($(window).scrollTop() + $(window).height() > $('.blurred-wrap').height() && $('#nectar_fullscreen_rows').length == 0) {
8007			$('body,html').stop().animate({
8008				scrollTop: $('.blurred-wrap').height() - $(window).height()
8009			},600,'easeInOutCubic');
8010			$scrollDelay = 550;
8011			$scrollDelay2 = 200;
8012		}
8013
8014		$('header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button').addClass('close');
8015		setTimeout(function(){ $('.blurred-wrap').addClass('blurred'); },$scrollDelay);
8016		$('#slide-out-widget-area.fullscreen').show().addClass('open');
8017
8018		if($('.nectar-social-sharing-fixed').length == 0) {
8019			hideToTop();
8020		}
8021
8022		//remove box shadow incase at the top of the page with nectar box roll above
8023		$('.container-wrap').addClass('no-shadow');
8024		$('#header-outer').stop(true).css('transform','translateY(0)');
8025
8026		setTimeout(function(){
8027
8028			$('.off-canvas-menu-container .menu > li').each(function(i){
8029				$(this).delay(i*50).transition({y: 0, 'opacity': 1},800,'easeOutExpo');
8030			});
8031
8032			$('#slide-out-widget-area.fullscreen .widget').each(function(i){
8033				$(this).delay(i*100).transition({y: 0, 'opacity': 1},800,'easeOutExpo');
8034			});
8035		},370+$scrollDelay2);
8036
8037		setTimeout(function(){
8038			$('#slide-out-widget-area .off-canvas-social-links').addClass('line-shown');
8039
8040			$('#slide-out-widget-area .off-canvas-social-links li').each(function(i){
8041				$(this).delay(i*50).transition({'scale':1},400,'easeOutCubic');
8042			});
8043			$('#slide-out-widget-area .bottom-text').transition({'opacity':0.7},400,'easeOutCubic');
8044		},750+$scrollDelay2);
8045		
8046		//fade In BG Overlay
8047		setTimeout(function(){
8048			$easing = ($('body.mobile').length > 0) ? 'easeOutCubic' : 'easeInOutQuint';
8049			$('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).show().stop(true).transition({
8050				'y' : '0%'
8051			},920,$easing,function(){
8052				$('.slide-out-widget-area-toggle > div > a').removeClass('animating');
8053			});
8054		},50+$scrollDelay2);
8055
8056		//overflow state 
8057		slideOutWidgetOverflowState();
8058		if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').addClass('at-content');
8059		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());
8060	} 
8061
8062	else if($('#slide-out-widget-area').hasClass('fullscreen-alt')) {
8063
8064		if ( $('body.material').length > 0 ) {
8065     		$('header#top .slide-out-widget-area-toggle a').addClass('menu-push-out');
8066     	}
8067
8068		$('header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button').addClass('close');
8069		$('#slide-out-widget-area.fullscreen-alt').show().addClass('open');
8070		$('#slide-out-widget-area-bg').addClass('open');
8071
8072		$('body > div[class*="body-border"]').css('z-index','9995');
8073
8074		$('.off-canvas-menu-container .menu').transition({y: '0px', 'opacity': 1},0);	
8075
8076		if($('.nectar-social-sharing-fixed').length == 0) {
8077			hideToTop();
8078		}
8079
8080		if($('#header-outer.transparent').length == 0) {
8081
8082
8083		}
8084		else { 
8085
8086			if($('.body-border-top').length > 0) {
8087				$('.admin-bar #slide-out-widget-area-bg.fullscreen-alt').css({'padding-top': ($('.body-border-top').outerHeight(true)+32) + 'px'});
8088				$('body:not(.admin-bar) #slide-out-widget-area-bg.fullscreen-alt').css({'padding-top': ($('.body-border-top').outerHeight(true))+ 'px'});
8089			}
8090		}
8091		
8092		//set translateY to 0 in all cases
8093		$('#header-outer').stop(true).css('transform','translateY(0)');
8094
8095		if($('#logo .starting-logo').length > 0 && $(window).width() > 1000 && $('#header-outer[data-format="centered-menu-bottom-bar"].fixed-menu').length == 0 && $('body.material #header-outer[data-condense="true"]').length == 0 && !nectarDOMInfo.usingFrontEndEditor) {
8096
8097			$('#header-outer').stop(true).css('transform','translateY(0)').addClass('transparent');
8098			if($('#header-outer').attr('data-transparent-header') != 'true') {
8099				$('#header-outer').attr('data-transparent-header','true').addClass('pseudo-data-transparent');
8100			}
8101		}
8102
8103		$('.off-canvas-menu-container .clip-wrap').css('transition-duration','0s');
8104
8105		setTimeout(function(){
8106
8107			$('.off-canvas-menu-container .menu > li').each(function(i){
8108				$(this).delay(i*50).transition({y: 0, 'opacity': 1},750,'easeOutCubic').addClass('no-pointer-events');
8109			});
8110
8111			setTimeout(function(){
8112				$('.off-canvas-menu-container .menu > li').removeClass('no-pointer-events');
8113				$('.off-canvas-menu-container .clip-wrap').css('transition-duration','.45s');
8114			},500);
8115
8116			$('#slide-out-widget-area.fullscreen-alt .widget').each(function(i){
8117				$(this).delay(i*100).transition({y: 0, 'opacity': 1},650,'easeOutCubic');
8118			});
8119		},200);
8120
8121		setTimeout(function(){
8122			$('#slide-out-widget-area .off-canvas-social-links').addClass('line-shown');
8123
8124			$('#slide-out-widget-area .off-canvas-social-links li').css('opacity','1').each(function(i){
8125				$(this).delay(i*50).transition({'scale':1},400,'easeOutCubic');
8126			});
8127			$('#slide-out-widget-area .bottom-text').transition({'opacity':1},600,'easeOutCubic');
8128		},200);
8129		
8130		//fade In BG Overlay
8131		if($('#slide-out-widget-area-bg').hasClass('solid')) $opacity = 1;
8132		if($('#slide-out-widget-area-bg').hasClass('dark')) $opacity = 0.97;
8133		if($('#slide-out-widget-area-bg').hasClass('medium')) $opacity = 0.6;
8134		if($('#slide-out-widget-area-bg').hasClass('light')) $opacity = 0.4;
8135		$('#slide-out-widget-area-bg').removeClass('no-transition');
8136		
8137
8138		$('#slide-out-widget-area-bg').addClass('padding-removed').css({'height':'100%','width':'100%', 'left':'0','opacity': $opacity});
8139		
8140
8141		setTimeout(function(){
8142			$('.slide-out-widget-area-toggle > div > a').removeClass('animating');
8143		},600);
8144			
8145
8146		//overflow state 
8147		slideOutWidgetOverflowState();
8148		if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').addClass('at-content');
8149		if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 || $('.mobile').length == 0 && $('#header-outer.transparent').length == 0) $('#slide-out-widget-area.fullscreen-alt .inner-wrap').css('padding-top', $('#header-outer').height());
8150	}
8151
8152
8153
8154	//add open class
8155	$('#header-outer').removeClass('side-widget-closed').addClass('side-widget-open');
8156
8157	//give header transparent state
8158	if($('#header-outer[data-transparency-option="1"]').length > 0 && $('#boxed').length == 0 && $('#header-outer[data-full-width="true"]').length > 0 && !nectarDOMInfo.usingFrontEndEditor) {
8159			if($('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length == 0 && $('body.material #header-outer[data-condense="true"]').length == 0) {
8160				$('#header-outer').addClass('transparent');
8161			}
8162	}
8163
8164	//dark slide transparent nav
8165	if($('#header-outer.dark-slide.transparent').length > 0  && $('#boxed').length == 0 && $('body.material-ocm-open').length == 0) $('#header-outer').removeClass('dark-slide').addClass('temp-removed-dark-slide');
8166	
8167	$('.slide-out-widget-area-toggle > div > a').removeClass('closed').addClass('open');
8168	$('.slide-out-widget-area-toggle > div > a').addClass('animating');
8169
8170	return false;
8171});
8172
8173$('body').on('click','.slide-out-widget-area-toggle:not(.std-menu) a.open:not(.animating), #slide-out-widget-area .slide_out_area_close,  > .slide_out_area_close, #slide-out-widget-area-bg.slide-out-from-right, .material-ocm-open #ajax-content-wrap',function(e){
8174
8175	if (e.originalEvent == undefined && $('.slide_out_area_close.non-human-allowed').length == 0 ) { return; }
8176
8177	if($('.slide-out-widget-area-toggle:not(.std-menu) a.animating').length > 0) return;
8178
8179	$('#header-outer').removeClass('no-transition');
8180
8181
8182	var $that = $(this);
8183
8184	$('.slide-out-widget-area-toggle:not(.std-menu) a').removeClass('open').addClass('closed');
8185	$('.slide-out-widget-area-toggle:not(.std-menu) a').addClass('animating');
8186
8187	//slide out from right
8188	if($('#slide-out-widget-area').hasClass('slide-out-from-right')) {
8189
8190			if($('body.material').length == 0) {
8191
8192				$('.container-wrap, .home-wrap, #header-secondary-outer, #footer-outer:not(#nectar_fullscreen_rows #footer-outer), .nectar-box-roll, #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');
8193
8194				if($('#header-outer[data-transparency-option="1"]').length > 0  && $('#boxed').length == 0) {
8195					$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');
8196					$('#header-outer').stop(true).transition({ x: '0px', 'background-color': $currentRowBG },700,'easeInOutCubic');
8197				} else {
8198					$('#header-outer').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
8199				}
8200
8201				$('#ascrail2000').stop(true).transition({ 'x': '0px' },700,'easeInOutCubic');
8202				$('body:not(.ascend):not(.material) #header-outer .cart-menu').stop(true).transition({ 'x': '0px' },700,'easeInOutCubic');
8203
8204				$('#slide-out-widget-area').stop(true).transition({ x: '301px' },700,'easeInOutCubic').removeClass('open');
8205
8206
8207				if($('#boxed').length == 0) {
8208					if($('#header-outer[data-full-width="true"]').length > 0) {  
8209						$('#header-outer').removeClass('highzI'); 
8210						$('header#top #logo').stop(true).transition({ x: '0px' },700,'easeInOutCubic'); 
8211						$('.lines-button').removeClass('close');
8212
8213						$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
8214
8215					}
8216				}
8217
8218				if($('#header-outer[data-format="centered-logo-between-menu"]').length > 0) {
8219					$('#header-outer header#top nav > ul.buttons, #header-outer .cart-outer .cart-menu-wrap').stop(true).transition({ x: '0px' },700,'easeInOutCubic'); 
8220				}
8221
8222				//fade out overlay
8223				$('#slide-out-widget-area-bg').stop(true).transition({
8224					'opacity' : 0
8225				},700,'easeInOutCubic',function(){
8226					$('.slide-out-widget-area-toggle a').removeClass('animating');
8227					$(this).css({'height':'1px','width':'1px'});
8228
8229					if($('#header-outer[data-remove-fixed="1"]').length == 0) {
8230						//hide menu if transparent, user has scrolled down and hhun is on
8231						if($('#header-outer').hasClass('parallax-contained') && $(window).scrollTop() > 0 && $('#header-outer[data-permanent-transparent="1"]').length == 0) {
8232							$('#header-outer').removeClass('parallax-contained').addClass('detached').removeClass('transparent');
8233						}
8234						else if($(window).scrollTop() == 0 && $('body[data-hhun="1"]').length >
8234 0 && $('#page-header-bg[data-parallax="1"]').length > 0 ||
8235							$(window).scrollTop() == 0 && $('body[data-hhun="1"]').length > 0 && $('.parallax_slider_outer').length > 0) {
8236
8237							if($('#header-outer[data-transparency-option="1"]').length > 0) $('#header-outer').addClass('transparent');
8238							$('#header-outer').addClass('parallax-contained').removeClass('detached');
8239						}
8240					}
8241
8242					//fix for fixed subpage menu
8243					$('.container-wrap').css('transform','none');
8244				});
8245
8246
8247				$('#header-outer').removeClass('style-slide-out-from-right');
8248
8249
8250				var headerResize = $('#header-outer').attr('data-header-resize');
8251				if($('#header-outer[data-remove-fixed="1"]').length == 0) {
8252
8253					if($bodyBorderHeaderColorMatch == true && headerResize == 1) {
8254					
8255						$(window).off('scroll.headerResizeEffect');
8256						if($(window).scrollTop() == 0) {
8257							$(window).on('scroll.headerResizeEffect',smallNav); 
8258
8259							if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0 && $('.body-border-top').length > 0 && $bodyBorderHeaderColorMatch == true && $('#header-outer.pseudo-data-transparent').length > 0) {
8260								$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
8261									'padding' : '0'			
8262								},{queue:false, duration:250, easing: 'easeOutCubic'});	
8263							}
8264						}
8265						else
8266							$(window).on('scroll.headerResizeEffect',bigNav); 
8267							//smallNav();
8268
8269						if($('#header-outer').hasClass('pseudo-data-transparent')) {
8270							$('#header-outer').attr('data-transparent-header','false').removeClass('pseudo-data-transparent').removeClass('transparent');
8271						}
8272
8273						$('#header-outer').css('transition','transform');
8274
8275					} else if ($bodyBorderHeaderColorMatch == true) {
8276						
8277						$(window).off('scroll.headerResizeEffectOpaque');
8278						$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
8279
8280						$('#header-outer').css('transition','transform');
8281
8282						if($('#header-outer').hasClass('pseudo-data-transparent')) {
8283							$('#header-outer').attr('data-transparent-header','false').removeClass('pseudo-data-transparent').removeClass('transparent');
8284						}
8285					}
8286				}
8287		}
8288
8289		else if ( $('body.material').length > 0 ) {
8290
8291			//material
8292			$('#slide-out-widget-area').removeClass('open');
8293
8294			$('#slide-out-widget-area, #slide-out-widget-area-bg, #header-outer .slide-out-widget-area-toggle').removeClass('material-open');
8295			$('.ocm-effect-wrap, .ocm-effect-wrap-shadow, body > .slide_out_area_close, #fp-nav').removeClass('material-ocm-open');
8296
8297			$('body > .slide_out_area_close').removeClass('follow-body');
8298
8299			setTimeout(function(){
8300				$('.slide-out-widget-area-toggle a').removeClass('animating');
8301				$('body').removeClass('material-ocm-open');
8302				$('.ocm-effect-wrap').css({'height': '100%'});
8303				$('.ocm-effect-wrap-inner').css({'padding-top': '0' });
8304				$(window).scrollTop(Math.abs( parseInt($('#ajax-content-wrap').css('top')) ) );
8305				$('#ajax-content-wrap').css({'position' : '', 'top' : '' });
8306				
8307
8308				//handle bottom bar nav
8309				if($('#header-outer[data-format="centered-menu-bottom-bar"]').length > 0 && $('#header-outer[data-format="centered-menu-bottom-bar"] .span_9').css('display') != 'none' && $('body.mobile').length == 0) {
8310					$('#header-outer:not(.fixed-menu)').css('top', '');
8311					$('#header-secondary-outer').css('visibility','');
8312				}
8313				
8314				//handle hhun when at top
8315				$('body[data-hhun="1"]:not(.no-scroll) #header-outer[data-permanent-transparent="false"]:not(.detached):not(.parallax-contained):not(.at-top-before-box)').css({'transform':''});
8316				setTimeout(function(){
8317					$('body[data-hhun="1"]:not(.no-scroll) #header-outer[data-permanent-transparent="false"]:not(.detached):not(.parallax-contained):not(.at-top-before-box)').css({'transition':''});
8318				},30);
8319				
8320
8321				$('body[data-hhun="1"] #header-secondary-outer.hidden').removeClass('hidden');
8322
8323			},900);
8324
8325			setTimeout(function(){
8326				//icon effect
8327				$('#header-outer:not([data-format="left-header"]) header#top .slide-out-widget-area-toggle a').addClass('no-trans').removeClass('effect-shown');
8328			},200);
8329
8330			setTimeout(function(){
8331				//icon
8332				$('#header-outer:not([data-format="left-header"]) header#top .slide-out-widget-area-toggle a').removeClass('no-trans')
8333			},500);
8334			
8335		}
8336
8337
8338	} 
8339
8340	else if($('#slide-out-widget-area').hasClass('fullscreen')) {
8341
8342
8343		if ( $('body.material').length > 0 ) {
8344			setTimeout(function(){
8345				$('header#top .slide-out-widget-area-toggle a').removeClass('menu-push-out');
8346			},350);
8347     	}
8348
8349		$('.slide-out-widget-area-toggle:not(.std-menu) .lines-button').removeClass('close');
8350		$('.blurred-wrap').removeClass('blurred');
8351		$('#slide-out-widget-area.fullscreen').transition({'opacity': 0 },700,'easeOutQuad',function(){ $('#slide-out-widget-area.fullscreen').hide().css('opacity','1'); }).removeClass('open');
8352		$('#slide-out-widget-area.fullscreen .widget').transition({'opacity': 0},700,'easeOutQuad',function(){
8353			$(this).transition({y: '110px'},0);
8354		});
8355
8356		setTimeout(function(){
8357			$('.off-canvas-menu-container .menu > li').transition({y: '80px', 'opacity': 0},0);		
8358			$('#slide-out-widget-area .off-canvas-social-links li').transition({'scale':0},0);
8359			$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');
8360			$('#slide-out-widget-area .bottom-text').transition({'opacity':0},0);	
8361
8362			//close submenu items
8363			$('#slide-out-widget-area .menuwrapper .menu').removeClass( 'subview' );
8364			$('#slide-out-widget-area .menuwrapper .menu li').removeClass( 'subview subviewopen' );
8365			$('#slide-out-widget-area.fullscreen .inner .off-canvas-menu-container').css('height','auto');
8366		},800);
8367
8368		setTimeout(function(){
8369			if($('.nectar-social-sharing-fixed').length == 0) {
8370				showToTop();
8371			}
8372			$('.container-wrap').removeClass('no-shadow');
8373		},500);
8374
8375		//fade out overlay
8376		$('#slide-out-widget-area-bg').stop(true).transition({'opacity': 0},900,'easeOutQuad',function(){
8377			if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').removeClass('at-content');
8378			if($('.mobile #header-outer[data-permanent-transparent="false"]').length == 0) $('#slide-out-widget-area.fullscreen .inner-wrap').css('padding-top', '0');
8379			$('.slide-out-widget-area-toggle a').removeClass('animating');
8380			if($('#slide-out-widget-area-bg').hasClass('solid')) $opacity = 1;
8381			if($('#slide-out-widget-area-bg').hasClass('dark')) $opacity = 0.93;
8382			if($('#slide-out-widget-area-bg').hasClass('medium')) $opacity = 0.6;
8383			if($('#slide-out-widget-area-bg').hasClass('light')) $opacity = 0.4;
8384			$(this).css({'height':'1px','width':'1px', 'opacity': $opacity}).transition({ y : '-100%'},0);
8385		});
8386
8387		
8388	}
8389
8390	else if($('#slide-out-widget-area').hasClass('fullscreen-alt')) {
8391
8392
8393		if ( $('body.material').length > 0 ) {
8394			setTimeout(function(){
8395				$('header#top .slide-out-widget-area-toggle a').removeClass('menu-push-out');
8396			},350);
8397     	}
8398
8399		$('.slide-out-widget-area-toggle:not(.std-menu) .lines-button').removeClass('close');
8400		$('.blurred-wrap').removeClass('blurred');
8401		$('#slide-out-widget-area-bg').removeClass('open');
8402		
8403		$('#slide-out-widget-area.fullscreen-alt .widget').transition({'opacity': 0},500,'easeOutQuad',function(){
8404			$(this).transition({y: '40px'},0);
8405		});
8406		$('#slide-out-widget-area .bottom-text, #slide-out-widget-area .off-canvas-social-links li').transition({'opacity': 0},250,'easeOutQuad');
8407		$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');
8408
8409		$('.off-canvas-menu-container .menu').transition({y: '-13px', 'opacity': 0},400);	
8410
8411
8412		setTimeout(function(){
8413			$('.off-canvas-menu-container .menu > li').stop(true,true).transition({y: '40px', 'opacity': 0},0);		
8414			$('#slide-out-widget-area .off-canvas-social-links li').transition({'scale':0},0);
8415			$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');	
8416
8417			//close submenu items
8418			$('#slide-out-widget-area .menuwrapper .menu').removeClass( 'subview' );
8419			$('#slide-out-widget-area .menuwrapper .menu li').removeClass( 'subview subviewopen' );
8420			$('#slide-out-widget-area.fullscreen-alt .inner .off-canvas-menu-container').css('height','auto');
8421
8422			if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').removeClass('at-content');
8423			if($('.mobile #header-outer[data-permanent-transparent="false"]').length == 0) $('#slide-out-widget-area.fullscreen-alt .inner-wrap').css('padding-top', '0');
8424			$('.slide-out-widget-area-toggle a').removeClass('animating');
8425			$('#slide-out-widget-area-bg').css({'height':'1px','width':'1px','left':'-100%'});
8426			$('#slide-out-widget-area.fullscreen-alt').hide().removeClass('open');
8427		},550);
8428
8429		setTimeout(function(){
8430			if($('.nectar-social-sharing-fixed').length == 0) {
8431				showToTop();
8432			}
8433		},600);
8434
8435		//fade out overlay
8436		setTimeout(function(){
8437			$('#slide-out-widget-area-bg').removeClass('padding-removed');
8438		},50);	
8439
8440		
8441		var borderDelay = ($bodyBorderHeaderColorMatch == true) ? 150: 50;
8442
8443		setTimeout(function(){
8444			$('#slide-out-widget-area-bg').stop(true).css({'opacity': 0});
8445			if($('[data-transparent-header="true"]').length > 0) $('body > div[class*="body-border"]').css('z-index','10000');
8446		},borderDelay);
8447
8448		setTimeout(function(){
8449			$('#header-outer.transparent.small-nav, #header-outer.transparent.detached, #header-outer:not([data-permanent-transparent="1"]).transparent.scrolled-down').removeClass('transparent');
8450			
8451			if($('#header-outer').hasClass('pseudo-data-transparent')) {
8452				$('#header-outer').attr('data-transparent-header','false').removeClass('pseudo-data-transparent').removeClass('transparent');
8453			}
8454
8455		},100);
8456		
8457	}
8458
8459
8460	//dark slide transparent nav
8461	if($('#header-outer.temp-removed-dark-slide.transparent').length > 0  && $('#boxed').length == 0) $('#header-outer').removeClass('temp-removed-dark-slide').addClass('dark-slide');
8462
8463	//remove header transparent state
8464	if($('#header-outer[data-permanent-transparent="1"]').length == 0 && $('#slide-out-widget-area.fullscreen-alt').length == 0) {
8465
8466		if($('.nectar-box-roll').length == 0) {
8467			if($('#header-outer.small-nav').length > 0 || $('#header-outer.scrolled-down').length > 0 || $('#header-outer.detached').length > 0) $('#header-outer').removeClass('transparent');
8468		} else {
8469			if($('#header-outer.small-nav').length > 0 || $('#header-outer.scrolled-down').length > 0 || $('.container-wrap.auto-height').length > 0) $('#header-outer').removeClass('transparent');
8470		}
8471	} 
8472
8473
8474
8475	//remove hidden menu
8476	$('#header-outer').removeClass('hidden-menu');
8477
8478	$('#header-outer').removeClass('side-widget-open').addClass('side-widget-closed');
8479
8480	return false;
8481});
8482
8483function slideOutWidgetOverflowState() {
8484
8485	//switch position of social media/extra info based on screen size
8486	if(window.innerWidth < 1000 || $('body > #boxed').length > 0 || $('.ocm-effect-wrap-inner > #boxed').length > 0) {
8487
8488		$('#slide-out-widget-area.fullscreen .off-canvas-social-links, #slide-out-widget-area.fullscreen-alt .off-canvas-social-links').appendTo('#slide-out-widget-area .inner');
8489		$('#slide-out-widget-area.fullscreen .bottom-text, #slide-out-widget-area.fullscreen-alt .bottom-text').appendTo('#slide-out-widget-area .inner');
8490	} else {
8491		$('#slide-out-widget-area.fullscreen .off-canvas-social-links,#slide-out-widget-area.fullscreen-alt .off-canvas-social-links').appendTo('#slide-out-widget-area .inner-wrap');
8492		$('#slide-out-widget-area.fullscreen .bottom-text, #slide-out-widget-area.fullscreen-alt .bottom-text').appendTo('#slide-out-widget-area .inner-wrap');
8493	}
8494
8495	//add overflow
8496	if( $('#slide-out-widget-area[class*="fullscreen"] .inner').height() >= $(window).height()-100) { $('#slide-out-widget-area[class*="fullscreen"] .inner, #slide-out-widget-area[class*="fullscreen"]').addClass('overflow-state'); }
8497	else { $('#slide-out-widget-area[class*="fullscreen"] .inner, #slide-out-widget-area[class*="fullscreen"]').removeClass('overflow-state'); }
8498
8499	$('#slide-out-widget-area[class*="fullscreen"] .inner').transition({ y : '-' + ($('#slide-out-widget-area[class*="fullscreen"] .inner').height()/2) + 'px' },0);
8500
8501	//close mobile only slide out widget area if switching back to desktop
8502	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'); }
8503
8504	//sizing for dropdown
8505	OCM_Dropdown_Icon_Pos();
8506
8507
8508}
8509
8510
8511function OCM_Dropdown_Icon_Pos() {
8512	$('#slide-out-widget-area[class*="slide-out-from-right"] .off-canvas-menu-container li.menu-item-has-children').each(function(){
8513		$(this).find('.ocm-dropdown-arrow').css({'top': $(this).find('a').height()/2 });
8514	});
8515}
8516OCM_Dropdown_Icon_Pos();
8517
8518
8519function fullWidthHeaderSlidingWidgetMenuCalc() {
8520	$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': $(window).width() - 360, 'left': '300px' },700,'easeInOutCubic');
8521}
8522
8523//slide out widget area scrolling 
8524function slideOutWidgetAreaScrolling(){ 
8525	$('#slide-out-widget-area').mousewheel(function(event, delta) {
8526
8527	     this.scrollTop -= (delta * 30);
8528	    
8529	     event.preventDefault();
8530
8531	});
8532}
8533setTimeout(slideOutWidgetAreaScrolling,500);
8534
8535
8536//handle mobile scrolling
8537if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
8538	$('#slide-out-widget-area').addClass('mobile');
8539}
8540
8541
8542function closeOCM(item) {
8543    if($('#slide-out-widget-area.open').length > 0) {
8544
8545    	var $windowCurrentLocation = window.location.href.split("#")[0];
8546		  var $windowClickedLocation = item.find('> a').attr('href').split("#")[0];
8547
8548    	if($windowCurrentLocation == $windowClickedLocation || item.find('a[href^="#"]').length > 0) {
8549				if(item.parents('.slide-out-from-right-hover').length > 0) {
8550					$('.slide-out-widget-area-toggle.slide-out-hover-icon-effect a').trigger('click');
8551				} else {
8552					$('.slide-out-widget-area-toggle a').trigger('click');
8553				}
8554        
8555			}
8556    } 
8557		
8558}
8559
8560
8561//left header
8562function leftHeaderSubmenus() {
8563
8564	//remove megamenu class
8565	$('#header-outer[data-format="left-header"] nav li.megamenu').removeClass('megamenu');
8566
8567	var $ocm_link_selector = ($('#slide-out-widget-area[data-dropdown-func="separate-dropdown-parent-link"]').length > 0) ? '#slide-out-widget-area .off-canvas-menu-container li.menu-item-has-children > .ocm-dropdown-arrow' : 'body.material #slide-out-widget-area[class*="slide-out-from-right"] .off-canvas-menu-container li.menu-item-has-children > a';
8568	//click
8569	$('#header-outer[data-format="left-header"]  li.menu-item-has-children > a, '+$ocm_link_selector).on('click',function(e){
8570		
8571		if($(this).parent().hasClass('open-submenu')) {
8572			$(this).parent().find('.sub-menu').css({
8573				'max-height' : '0'
8574			});
8575			$(this).parent().removeClass('open-submenu');
8576		}
8577		else {
8578
8579			//get max height
8580			var $that = $(this);
8581			var $maxSubMenuHeight;
8582
8583			$that.parent().find('> .sub-menu').addClass('no-trans');
8584
8585			setTimeout(function(){
8586
8587				$that.parent().find('> .sub-menu').css({
8588					'max-height' : 'none',
8589					'position' : 'absolute',
8590					'visibility' : 'hidden'
8591				});
8592				
8593				$maxSubMenuHeight =  $that.parent().find('> .sub-menu').height();
8594
8595				$that.parent().find('> .sub-menu').removeClass('no-trans');
8596				$that.parent().find('> .sub-menu').css({
8597					'max-height' : '0',
8598					'position' : 'relative',
8599					'visibility' : 'visible'
8600				});
8601
8602			},25);
8603
8604			setTimeout(function(){
8605				
8606				//reset
8607				$that.closest('ul').find('li.menu-item-has-children').removeClass('open-submenu');
8608				$that.closest('ul').find('li.menu-item-has-children > .sub-menu').css({
8609					'max-height' : '0'
8610				});
8611
8612				$that.parent().addClass('open-submenu');
8613
8614				$that.parent().find('> .sub-menu').css('max-height', $maxSubMenuHeight);
8615
8616				//add height to open parents
8617				if($that.parents('ul').length > 0) {
8618
8619					$that.parents('ul:not(.sf-menu)').each(function(){
8620						$(this).css('max-height');
8621						$(this).css('max-height', parseInt($(this).height() + parseInt($(this).css('padding-top'))*2 + $maxSubMenuHeight)+'px');
8622					});
8623				} 
8624					
8625
8626			},50);
8627		}
8628		
8629		return false;
8630	});
8631	
8632	//start open for current page items
8633	var $maxSubMenuHeightArr = [];
8634
8635	$('#header-outer[data-format="left-header"] .current-menu-ancestor').find('.current-menu-item').parents('ul.sub-menu').each(function(i){
8636
8637		
8638
8639		$maxSubMenuHeightArr[i] =  $(this).parent().find('> .sub-menu').height();
8640
8641
8642		var $that = $(this);
8643		setTimeout(function(){
8644
8645			var $totalSubMenuHeight = 0;
8646
8647			for(var $i=0; $i < $maxSubMenuHeightArr.length; $i++) {
8648				$totalSubMenuHeight += parseInt($maxSubMenuHeightArr[i]);
8649			}
8650	
8651			$that.parent().addClass('open-submenu');
8652			$that.css('max-height', $totalSubMenuHeight);
8653
8654		},40);
8655	});
8656}
8657
8658if($('#header-outer[data-format="left-header"]').length > 0 || $('body.material[data-slide-out-widget-area-style*="slide-out-from-right"]').length > 0 || $('#slide-out-widget-area[data-dropdown-func="separate-dropdown-parent-link"]').length > 0) {
8659	leftHeaderSubmenus();
8660}
8661
8662
8663//fullscreen submenu
8664;( function( $, window, undefined ) {
8665
8666	'use strict';
8667
8668	// global
8669	var Modernizr = window.Modernizr, $body = $( 'body' );
8670
8671	$.DLMenu = function( options, element ) {
8672		this.$el = $( element );
8673		this._init( options );
8674	};
8675
8676	// the options
8677	$.DLMenu.defaults = {
8678		// classes for the animation effects
8679		animationClasses : { classin : 'dl-animate-in-1', classout : 'dl-animate-out-1' },
8680		onLevelClick : function( el, name ) { return false; },
8681		onLinkClick : function( el, ev ) { return false; }
8682	};
8683
8684	$.DLMenu.prototype = {
8685		_init : function( options ) {
8686
8687			// options
8688			this.options = $.extend( true, {}, $.DLMenu.defaults, options );
8689			this._config();
8690			
8691			var animEndEventNames = {
8692					'WebkitAnimation' : 'webkitAnimationEnd',
8693					'OAnimation' : 'oAnimationEnd',
8694					'msAnimation' : 'MSAnimationEnd',
8695					'animation' : 'animationend'
8696				},
8697				transEndEventNames = {
8698					'WebkitTransition' : 'webkitTransitionEnd',
8699					'MozTransition' : 'transitionend',
8700					'OTransition' : 'oTransitionEnd',
8701					'msTransition' : 'MSTransitionEnd',
8702					'transition' : 'transitionend'
8703				};
8704			// animation end event name
8705			this.animEndEventName = animEndEventNames[ Modernizr.prefixed( 'animation' ) ] + '.menu';
8706			// transition end event name
8707			this.transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ] + '.menu',
8708			// support for css animations and css transitions
8709			this.supportAnimations = Modernizr.cssanimations,
8710			this.supportTransitions = Modernizr.csstransitions;
8711
8712			this._initEvents();
8713
8714		},
8715		_config : function() {
8716			this.open = false;
8717			this.$trigger = this.$el.children( '.trigger' );
8718			this.$menu = this.$el.children( 'ul.menu' );
8719			this.$menuitems = this.$menu.find( 'li:not(.back) > a' );
8720			this.$el.find( 'ul.sub-menu' ).prepend( '<li class="back"><a href="#"> '+$('#slide-out-widget-area').attr('data-back-txt')+' </a></li>' );
8721			this.$back = this.$menu.find( 'li.back' );
8722		},
8723		_initEvents : function() {
8724
8725			var self = this;
8726
8727			this.$trigger.on( 'click.menu', function() {
8728				
8729				if( self.open ) {
8730					self._closeMenu();
8731				} 
8732				else {
8733					self._openMenu();
8734				}
8735				return false;
8736
8737			} );
8738			
8739			this.$menuitems.on( 'click.menu', function( event ) {
8740
8741
8742				var $item = $(this).parent('li'),
8743					$submenu = $item.children( 'ul.sub-menu' );
8744
8745				$('.fullscreen-alt .off-canvas-menu-container .clip-wrap, .fullscreen-alt .off-canvas-menu-container .clip-wrap span').css('transition-duration','0s');	
8746	
8747				if( $submenu.length > 0 ) {
8748
8749					var $flyin = $submenu.clone().css( 'opacity', 0 ).insertAfter( self.$menu ),
8750						onAnimationEndFn = function() {
8751							self.$menu.off( self.animEndEventName ).removeClass( self.options.animationClasses.classout ).addClass( 'subview' );
8752							$item.addClass( 'subviewopen' ).parents( '.subviewopen:first' ).removeClass( 'subviewopen' ).addClass( 'subview' );
8753							$flyin.remove();
8754							setTimeout(function(){
8755								$('.off-canvas-menu-container .menu > li').removeClass('no-pointer-events');
8756								$('.off-canvas-menu-container .clip-wrap, .off-canvas-menu-container .clip-wrap span').css('transition-duration','.45s');
8757							},300);
8758							
8759			
8760						};
8761
8762					setTimeout( function() {
8763						$flyin.addClass( self.options.animationClasses.classin );
8764						self.$menu.addClass( self.options.animationClasses.classout );
8765						if( self.supportAnimations ) {
8766							self.$menu.on( self.animEndEventName, onAnimationEndFn );
8767						}
8768						else {
8769							onAnimationEndFn.call();
8770						}
8771
8772						self.options.onLevelClick( $item, $item.children( 'a:first' ).text() );
8773					} );
8774
8775
8776					$item.parents('.off-canvas-menu-container').css('height',$item.parents('.off-canvas-menu-container').find('.menuwrapper .menu').height()).transition({ 'height': $flyin.height() },500,'easeInOutQuad' );
8777
8778
8779					return false;
8780
8781				}
8782				else {
8783		
8784					self.options.onLinkClick( $item.find('> a'), event );
8785				}
8786
8787				closeOCM($item);
8788
8789			});
8790
8791			
8792
8793
8794			this.$back.on( 'click.menu', function( event ) {
8795				
8796				var $this = $( this ),
8797					$submenu = $this.parents( 'ul.sub-menu:first' ),
8798					$item = $submenu.parent(),
8799
8800					$flyin = $submenu.clone().insertAfter( self.$menu );
8801
8802				var onAnimationEndFn = function() {
8803					self.$menu.off( self.animEndEventName ).removeClass( self.options.animationClasses.classin );
8804					$flyin.remove();
8805				};
8806
8807				setTimeout( function() {
8808					$flyin.addClass( self.options.animationClasses.classout );
8809					self.$menu.addClass( self.options.animationClasses.classin );
8810					if( self.supportAnimations ) {
8811						self.$menu.on( self.animEndEventName, onAnimationEndFn );
8812					}
8813					else {
8814						onAnimationEndFn.call();
8815					}
8816
8817					$item.removeClass( 'subviewopen' );
8818					
8819					var $subview = $this.parents( '.subview:first' );
8820					if( $subview.is( 'li' ) ) {
8821						$subview.addClass( 'subviewopen' );
8822					}
8823					$subview.removeClass( 'subview' );
8824				} );
8825
8826		
8827				$item.parents('.off-canvas-menu-container').css('height', $item.parents('.off-canvas-menu-container').find('.menuwrapper .menu').height())
8828				setTimeout(function() { 
8829					$item.parents('.off-canvas-menu-container').transition({ 'height': $item.parent().height() },500,'easeInOutQuad');
8830				},50);
8831
8832
8833				return false;
8834
8835			} );
8836			
8837		},
8838		closeMenu : function() {
8839			if( this.open ) {
8840				this._closeMenu();
8841			}
8842		},
8843		_closeMenu : function() {
8844			var self = this,
8845				onTransitionEndFn = function() {
8846					self.$menu.off( self.transEndEventName );
8847					self._resetMenu();
8848				};
8849			
8850			this.$menu.removeClass( 'menuopen' );
8851			this.$menu.addClass( 'menu-toggle' );
8852			this.$trigger.removeClass( 'active' );
8853			
8854			if( this.supportTransitions ) {
8855				this.$menu.on( this.transEndEventName, onTransitionEndFn );
8856			}
8857			else {
8858				onTransitionEndFn.call();
8859			}
8860
8861			this.open = false;
8862		},
8863		openMenu : function() {
8864			if( !this.open ) {
8865				this._openMenu();
8866			}
8867		},
8868		_openMenu : function() {
8869			var self = this;
8870			$body.off( 'click' ).on( 'click.menu', function() {
8871				self._closeMenu() ;
8872			} );
8873			this.$menu.addClass( 'menuopen menu-toggle' ).on( this.transEndEventName, function() {
8874				$( this ).removeClass( 'menu-toggle' );
8875			} );
8876			this.$trigger.addClass( 'active' );
8877			this.open = true;
8878		},
8879		_resetMenu : function() {
8880			this.$menu.removeClass( 'subview' );
8881			this.$menuitems.removeClass( 'subview subviewopen' );
8882		}
8883	};
8884
8885	var logError = function( message ) {
8886		if ( window.console ) {
8887			window.console.error( message );
8888		}
8889	};
8890
8891	$.fn.dlmenu = function( options ) {
8892		if ( typeof options === 'string' ) {
8893			var args = Array.prototype.slice.call( arguments, 1 );
8894			this.each(function() {
8895				var instance = $.data( this, 'menu' );
8896				if ( !instance ) {
8897					logError( "cannot call methods on menu prior to initialization; " +
8898					"attempted to call method '" + options + "'" );
8899					return;
8900				}
8901				if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
8902					logError( "no such method '" + options + "' for menu instance" );
8903					return;
8904				}
8905				instance[ options ].apply( instance, args );
8906			});
8907		} 
8908		else {
8909			this.each(function() {	
8910				var instance = $.data( this, 'menu' );
8911				if ( instance ) {
8912					instance._init();
8913				}
8914				else {
8915					instance = $.data( this, 'menu', new $.DLMenu( options, this ) );
8916				}
8917			});
8918		}
8919		return this;
8920	};
8921
8922} )( jQuery, window );
8923
8924function fullscreenMenuInit() {
8925	$('#slide-out-widget-area .off-canvas-menu-container .menu').wrap('<div class="menu-wrap menuwrapper" />');
8926	$('#slide-out-widget-area .off-canvas-menu-container .menu').addClass('menuopen');
8927	$ocmAnimationClassNum = ($('#slide-out-widget-area.fullscreen-alt').length > 0) ? '4' : '5';
8928	$('#slide-out-widget-area .off-canvas-menu-container .menu-wrap').dlmenu({ animationClasses : { classin : 'dl-animate-in-'+$ocmAnimationClassNum, classout : 'dl-animate-out-'+$ocmAnimationClassNum } });
8929	
8930}
8931
8932if($('body.material[data-slide-out-widget-area-style*="slide-out-from-right"]').length == 0 && $('#slide-out-widget-area[data-dropdown-func="separate-dropdown-parent-link"]').length == 0 ) {
8933	fullscreenMenuInit();
8934} else if($('body.using-mobile-browser[data-slide-out-widget-area-style="slide-out-from-right-hover"]').length > 0){
8935	
8936	//close OCM on mobile when clicking anchor on same page 
8937	$('body #slide-out-widget-area .inner .off-canvas-menu-container li a[href]').on('click',function(){
8938
8939		  if($(this).attr('href') != '#') {
8940				closeOCM($(this).parent());	
8941			}
8942
8943	});
8944	
8945} 
8946
8947
8948
8949//submenu link hover fix
8950$('body').on('mouseover','#slide-out-widget-area .off-canvas-menu-container .menuwrapper > .sub-menu li > a',function(){
8951	var $currentTxt = $(this).text();
8952	$('.off-canvas-menu-container .menuwrapper .menu li > a').removeClass('hovered');
8953	$('.off-canvas-menu-container .menuwrapper .menu li > a:contains('+$currentTxt+')').addClass('hovered');
8954});
8955$('body').on('mouseover','.off-canvas-menu-container .menuwrapper .menu li > a',function(){
8956	$('.off-canvas-menu-container .menuwrapper .menu li > a').removeClass('hovered');
8957});
8958
8959
8960
8961/***************** Page Headers ******************/
8962
8963var pageHeaderHeight;
8964var pageHeaderHeightCopy;
8965var pageHeadingHeight;
8966var extraSpaceFromResize = ($('#header-outer[data-header-resize="1"]').length > 0 && $('.nectar-box-roll').length == 0) ? 0 : 1;
8967var $headerRemoveStickyness = ($('body[data-hhun="1"]').length > 0 && $('#header-outer[data-remove-fixed="1"]').length > 0) ? 1 : 0;
8968
8969if($('body.material').length > 0 ) { extraSpaceFromResize = 0; }
8970
8971//full screen header
8972function fullScreenHeaderInit(){
8973	
8974	pageHeaderHeight = parseInt($('#page-header-bg').height());
8975	
8976	return;
8977	
8978	pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height'));
8979	pageHeaderHeightCopy = parseInt($('#page-header-bg').attr('data-height'));
8980
8981	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && window.innerWidth > 1000) ? 0 : $('#header-outer').height();
8982
8983	if($('.fullscreen-header').length > 0) {
8984
8985		if($('#header-outer[data-transparency-option]').length > 0 && $('#header-outer').attr('data-transparency-option') != '0'){
8986			var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height() : $(window).height() - parseInt($headerNavSpace) ;
8987		} else {
8988			var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height() - parseInt($headerNavSpace) + extraSpaceFromResize : $(window).height() - parseInt($headerNavSpace) ;
8989		}
8990		var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
8991		if($('.nectar-box-roll').length > 0) extraHeight = 0;
8992		pageHeaderHeight =   calculatedNum  - extraHeight; 
8993		pageHeaderHeightCopy = calculatedNum - extraHeight; 
8994	}
8995
8996	$('#page-header-bg').css('height',pageHeaderHeight+'px').removeClass('not-loaded');
8997	setTimeout(function(){ $('#page-header-bg').css('overflow','visible') },800);
8998
8999}
9000
9001fullScreenHeaderInit();
9002
9003function pageHeader(){
9004	
9005	pageHeaderHeight = parseInt($('#page-header-bg').height());
9006	
9007	//handle slide down effect
9008	$('body[data-aie="slide-down"] #page-header-wrap:not(.fullscreen-header)').css('height',pageHeaderHeight +'px');
9009  
9010  //as of 9.0
9011	return;
9012	
9013	
9014	var $scrollTop = 0;
9015	var $windowInnerWidth = window.innerWidth;
9016	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $windowInnerWidth > 1000) ? 0 : $('#header-outer').height();
9017	var $windowHeight = $(window).height();
9018
9019	//full screen header
9020	if($('.fullscreen-header').length > 0) {
9021		if($('#header-outer[data-transparency-option]').length > 0 && $('#header-outer').attr('data-transparency-option') != '0'){
9022			var calculatedNum = (!$('body').hasClass('mobile')) ? $windowHeight : $windowHeight - parseInt($headerNavSpace) ;
9023			if($('body[data-permanent-transparent="1"]').length > 0) calculatedNum = $windowHeight;
9024		} else {
9025			var calculatedNum = (!$('body').hasClass('mobile')) ? $windowHeight - parseInt($headerNavSpace) + extraSpaceFromResize : $windowHeight - parseInt($headerNavSpace);
9026		}
9027		var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
9028		if($('.nectar-box-roll').length > 0) extraHeight = 0;
9029		pageHeaderHeight =   calculatedNum  - extraHeight; 
9030		pageHeaderHeightCopy = calculatedNum - extraHeight; 
9031	}
9032
9033	if( $windowInnerWidth < 1000 && $windowInnerWidth > 690 && !$('body').hasClass('salient_non_responsive') ) {
9034		var $multiplier = ($('.fullscreen-header').length > 0) ? 1 : 1.6;
9035		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
9036		$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
9037		
9038	} else if( $windowInnerWidth <= 690 && $windowInnerWidth > 480 && !$('body').hasClass('salient_non_responsive')) {
9039		var $multiplier = ($('.fullscreen-header').length > 0) ? 1 : 2.1;
9040		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
9041		$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
9042		
9043	} else if( $windowInnerWidth <= 480 && !$('body').hasClass('salient_non_responsive')) {
9044		var $multiplier = ($('.fullscreen-header').length > 0) ? 1 : 2.5;
9045		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
9046		$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
9047		
9048	} else {
9049		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy).css('height',pageHeaderHeightCopy +'px');
9050		if($('.fullscreen-header').length > 0){
9051			$('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
9052		} else {
9053			$('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
9054		}
9055
9056		if($('#page-header-bg[data-parallax="1"]').length == 0) { $('#page-header-wrap').css('height',pageHeaderHeightCopy +'px'); }
9057	}
9058
9059
9060	//handle left header 
9061	if($('body[data-header-format="left-header"]').length > 0 ) { $('#page-header-bg[data-parallax="1"]').css('width',$('#ajax-content-wrap').width()) }
9062	
9063	
9064	if(!$('body').hasClass('mobile')){
9065		
9066		//recalc
9067		pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height'));
9068		$('#page-header-bg .container > .row').css('top',0);
9069		var $divisionMultipler = ($('#header-outer[data-remove-border="true"]').length > 0 && $('#header-outer[data-format="centered-menu-under-logo"]').length == 0) ? 2 : 1;
9070
9071		//center the heading
9072		pageHeadingHeight = $('#page-header-bg .col.span_6').height();
9073		
9074		
9075		if($('#header-outer[data-transparent-header="true"]').length > 0 && $('.fullscreen-header').length == 0) {
9076
9077		} else {
9078			var $extraResizeHeight = ($('#header-outer[data-header-resize="1"]').length > 0) ? 22: 0;
9079		}
9080		
9081		//center portfolio filters
9082		$('#page-header-bg:not("[data-parallax=1]") .portfolio-filters').css('top', (pageHeaderHeight/2) + 2);	
9083		
9084		if($('#page-header-bg[data-parallax="1"]').length > 0) {
9085			$scrollTop = $(window).scrollTop();
9086		}
9087
9088		if($('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap').css('opacity') > 0) {
9089			
9090			if($('#header-outer[data-transparent-header="true"]').length > 0 && $('body.single-post .fullscreen-header').length == 0) {
9091				//center the parallax heading
9092
9093				if($headerRemoveStickyness) {
9094					
9095				    //center parllax portfolio filters
9096				    $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 
9097						'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
9098				    });
9099
9100				} else {
9101
9102				    //center parllax portfolio filters
9103				    $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 
9104						'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
9105						'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
9106				    });
9107				}
9108			    
9109		  } else {
9110
9111		  		if($headerRemoveStickyness) {
9112			  		//center the parallax heading
9113
9114				    //center parllax portfolio filters
9115				    $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 
9116						'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
9117				    });
9118				} else {
9119 
9120				    //center parllax portfolio filters
9121				    $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 
9122						'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
9123						'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
9124				    });
9125				}
9126		  }
9127	   }
9128	}
9129	
9130	else {
9131		//recalc
9132		pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height'));
9133		
9134		//center the heading
9135		var pageHeadingHeight = $('#page-header-bg .container > .row').height();
9136		$('#page-header-bg .container > .row').css('top', (pageHeaderHeight/2) - (pageHeadingHeight/2) + 5);
9137		
9138	}
9139
9140
9141	$('#page-header-bg .container > .row').css('visibility','visible');
9142}
9143
9144var $pt_timeout = ($('body[data-ajax-transitions="true"]').length > 0 && $('#page-header-bg[data-animate-in-effect="slide-down"]').length > 0) ? 350 : 0; 
9145
9146if($('#page-header-bg').length > 0) { 
9147	setTimeout(function(){ pageHeader(); },$pt_timeout);
9148}
9149
9150
9151if($('#header-outer').attr('data-header-resize') == '' || $('#header-outer').attr('data-header-resize') == '0'){
9152	$('#page-header-wrap').css('margin-top','0');
9153}
9154
9155
9156function extractUrl(input) {
9157	return input.replace(/"/g,"").replace(/url\(|\)$/ig, "");
9158}
9159 
9160/***************** Parallax Page Headers ******************/
9161if($('#page-header-bg[data-parallax="1"]').length > 0) {
9162
9163	//fadeIn
9164
9165	var img = new Image();
9166	
9167	var imgX, imgY, aspectRatio;
9168	var diffX, diffY;
9169	var pageHeadingHeight = $('#page-header-bg .col.span_6').height();
9170	var pageHeaderHeight = parseInt($('#page-header-bg').height());
9171	var headerPadding2 = parseInt($('#header-outer').attr('data-padding'))*2;
9172	var wooCommerceHeader = ($('.demo_store').length > 0) ? 32 : 0 ;
9173	
9174	
9175	var $initialImgCheck = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
9176	
9177	if ($initialImgCheck && $initialImgCheck.indexOf('.') !== -1) {    
9178		img.onload = function() {
9179		   pageHeaderInit(); 
9180		}
9181		
9182		img.src = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
9183		
9184	} else {
9185		 pageHeaderInit();
9186	}
9187
9188	
9189	
9190	var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
9191
9192
9193	 if($('body[data-hhun="1"]').length > 0 && !$('#header-outer[data-remove-fixed="1"]').length > 0)  $('#header-outer').addClass('parallax-contained');
9194
9195	 window.addEventListener('scroll', function(){ 
9196        window.requestAnimationFrame(bindHeaderParallax);
9197    }, false);
9198
9199}
9200
9201					
9202function bindHeaderParallax(){
9203
9204	var $scrollTop = $(window).scrollTop();
9205	var pageHeadingHeight = $('#page-header-bg .col.span_6').height();
9206	
9207	if(!$('body').hasClass('mobile') && navigator.userAgent.match(/iPad/i) == null && $('body.material-ocm-open').length == 0 ){
9208
9209
9210		//material needs to set top for when effect wrap sets transform
9211		if(window.innerWidth > 1000) {
9212        $('body:not("[data-header-format=\'left-header\']") #page-header-bg[data-
9212parallax="1"]').css('top',$('#ajax-content-wrap').offset().top);
9213    } else {
9214        $('body:not("[data-header-format=\'left-header\']") #page-header-bg[data-parallax="1"]').css('top','0');
9215    }
9216
9217		var $multiplier1 =  ($('body[data-hhun="1"]').length > 0 || $('#header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length > 0) ? 0.40: 0.4;
9218    var $multiplier2 = ($('body[data-hhun="1"]').length > 0 || $('#header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length > 0) ? 0.09: 0.09;
9219    var $parallaxHeaderHUN = ($('#header-outer[data-transparency-option="1"]').length > 0) ? 0.49: 0.4;
9220
9221		//calc bg pos
9222		if($('#page-header-bg.out-of-sight').length == 0) {
9223
9224			if($headerRemoveStickyness) {
9225				$('#page-header-bg[data-parallax="1"]').css({ 'transform': 'translateY('+ $scrollTop*-0.55 +'px)' });	
9226			} else {
9227				$('#page-header-bg[data-parallax="1"]').css({ 'transform': 'translateY('+ $scrollTop*-$multiplier1 +'px)' });
9228			}
9229
9230			var multipler = ($('body').hasClass('single')) ? 1 : 2;
9231			if(!$headerRemoveStickyness) {
9232				$('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap,  #page-header-bg[data-parallax="1"][data-post-hs="default_minimal"] .author-section').css({ 
9233					'opacity' : 1-($scrollTop/(pageHeaderHeight-60))
9234				});
9235			}
9236			
9237			if($headerRemoveStickyness) {
9238				$('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap, body[data-button-style="rounded"] #page-header-bg[data-parallax="1"] .scroll-down-wrap, #page-header-bg[data-parallax="1"][data-post-hs="default_minimal"] .author-section').css({ 'transform': 'translateY('+ $scrollTop*- 0.45+'px)' });
9239			} else {
9240				$('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap, 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)' });
9241			}
9242			
9243			if($('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap').css('opacity') == 0){
9244				$('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap, #page-header-bg[data-parallax="1"] .portfolio-filters').hide();
9245			} else {
9246				$('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap, #page-header-bg[data-parallax="1"] .portfolio-filters').show();
9247			}
9248
9249			if($('body[data-hhun="1"]').length > 0  && !$('#header-outer').hasClass('side-widget-open') && !$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')) { 
9250          $('#header-outer.parallax-contained').css({ 'transform': 'translateY('+$scrollTop*-$parallaxHeaderHUN+'px)' });
9251      }
9252			
9253		
9254		}
9255		else if($('#page-header-bg.out-of-sight').length == 0) {
9256			//alt parallax effect
9257			var multipler = ($('body').hasClass('single')) ? 1 : 2;
9258			$('#page-header-wrap .nectar-particles .fade-out').css({ 
9259				'opacity' : 0+($scrollTop/(pageHeaderHeight+pageHeaderHeight*$multiplier))
9260			});
9261		}
9262
9263
9264		//hide elements to allow other parallax sections to work in webkit browsers
9265		if( ($scrollTop / (pageHeaderHeight + $('#header-space').height() + extraHeight)) > 1 ) {
9266			$('#page-header-bg, .nectar-particles, #page-header-bg .fade-out').css('visibility','hidden').hide().addClass('out-of-sight');
9267		}
9268		else {
9269		 	$('#page-header-bg, .nectar-particles, #page-header-bg .fade-out').css('visibility','visible').show().removeClass('out-of-sight');
9270
9271		 		//ensure header is centered
9272		 		pageHeaderHeight = parseInt($('#page-header-bg').height());
9273				$('#page-header-bg .container > .row').css('top',0);
9274				var $divisionMultipler = ($('#header-outer[data-remove-border="true"]').length > 0 && $('#header-outer[data-format="centered-menu-under-logo"]').length == 0) ? 2 : 1;
9275				pageHeadingHeight = $('#page-header-bg .col.span_6').height();
9276
9277	    }
9278		
9279
9280	}
9281
9282
9283
9284}
9285
9286if($('#page-header-bg').length > 0) {
9287	var $initialImgCheckAscend = extractUrl($('#page-header-bg').css('background-image'));
9288	if ($initialImgCheckAscend && $initialImgCheckAscend.indexOf('.') !== -1) {    
9289		   $('#page-header-bg').addClass('has-bg');
9290	}
9291}
9292
9293
9294function pageHeaderInit(){
9295
9296	 var wooCommerceHeader = ($('.demo_store').length > 0) ? 32 : 0 ;
9297	 var centeredNavAltSpace = ($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) ? $('header#top nav > .sf-menu').height() -20 : null;
9298	 //transparent
9299	  if($('#header-outer[data-transparent-header="true"]').length > 0) {	
9300	     $('#page-header-bg[data-parallax="1"]').css({'top': extraHeight+wooCommerceHeader });
9301	  } else {
9302
9303	   var logoHeight = parseInt($('#header-outer').attr('data-logo-height'));
9304		 var headerPadding = parseInt($('#header-outer').attr('data-padding'));
9305		 var headerPadding2 = parseInt($('#header-outer').attr('data-padding'));
9306		 var extraDef = 10;
9307		 var headerResize = ($('body').hasClass('pp-video-function')) ? '1' : $('#header-outer').attr('data-header-resize');
9308		 var headerResizeOffExtra = 0;
9309		 var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
9310		 var usingLogoImage = true;
9311	     var mediaElement = ($('.wp-video-shortcode').length > 0) ? 36 : 0;
9312	     var secondaryHeader = ($('#header-outer').attr('data-using-secondary') == '1') ? 32 : 0 ;
9313	  	 if($('body[data-header-resize="0"]').length == 0 && $('body.material').length == 0) {
9314				 $('#page-header-bg[data-parallax="1"]').css({'top': ($('#page-header-wrap').offset().top)  + 'px' });
9315			 }
9316	  }
9317	  
9318	  //fade in header
9319	  if($('#ajax-content-wrap').length == 0 || !$('body').hasClass('ajax-loaded')){
9320	  	$('#page-header-bg[data-parallax="1"]').animate({ 'opacity' : 1},350,'easeInCubic');
9321	  } else if($('#ajax-content-wrap').length == 1) {
9322	  	$('#page-header-bg[data-parallax="1"]').css({ 'opacity' : 1});
9323	  }
9324
9325	  //verify smooth scorlling
9326	  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') } 
9327	  
9328
9329	  $('#page-header-bg[data-parallax="1"] .nectar-particles').append('<div class="fade-out" />');
9330}
9331
9332
9333
9334
9335function nectarPageHeader() {
9336
9337	if($('#page-header-bg').length > 0) {
9338		fullScreenHeaderInit();
9339		pageHeader();
9340	}
9341
9342
9343	if($('#page-header-bg[data-parallax="1"]').length > 0) {
9344
9345		var img = new Image();
9346		var $initialImgCheck = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
9347			
9348		if ($initialImgCheck && $initialImgCheck.indexOf('.') !== -1) {    
9349			img.onload = function() {
9350			   pageHeaderInit();    
9351					
9352			}
9353			
9354			img.src = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
9355			
9356		} else {
9357			 pageHeaderInit();
9358		}
9359
9360		//bindHeaderParallax();
9361		$('#page-header-bg[data-parallax="1"] .span_6').css({ 
9362			'opacity' : 1
9363		});
9364
9365		
9366
9367		if (window.addEventListener) {
9368			 window.addEventListener('scroll', function(){ 
9369	          requestAnimationFrame(bindHeaderParallax); 
9370	        }, false);
9371		}
9372
9373	} 
9374
9375	if($('#page-header-bg').length > 0) {
9376		var $initialImgCheckAscend = extractUrl($('#page-header-bg').css('background-image'));
9377		if ($initialImgCheckAscend && $initialImgCheckAscend.indexOf('.') !== -1) {    
9378			   $('#page-header-bg').addClass('has-bg');
9379		}
9380	}
9381}
9382
9383if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
9384	window.onunload = function(){ nectarPageHeader(); };
9385}
9386
9387
9388/***************** header text effects *****************/
9389
9390// rotate in
9391function pageHeaderTextEffectInit() {
9392	$('#page-header-bg').each(function(){
9393		if($(this).attr('data-text-effect') == 'rotate_in') {
9394			var $topHeading = 'none';
9395
9396			if($(this).find('.span_6 h1').length > 0) {
9397				$topHeading = 'h1';
9398			} 
9399
9400
9401			if($topHeading != 'none') {
9402
9403				var $selector = ($(this).find('.nectar-particles').length > 0) ? '.inner-wrap.shape-1' : '.span_6';
9404
9405				$(this).find($selector).find($topHeading).addClass('top-heading').contents().filter(function () {
9406			        return this.nodeType === 3 && typeof this.data != 'undefined' && this.data.replace(/\s+/, "");
9407			    }).wrap('<span class="wraped"></span>');
9408
9409			    $(this).find($selector).find('.wraped').each(function () {
9410
9411				    textNode = $(this);
9412
9413				    text = textNode.text().split(' ');
9414				    replace = '';
9415
9416				    $.each(text, function (index, value) {
9417				        if (value.replace(/\s+/, "")) {
9418				            replace += '<span class="wraped"><span>' + value + '</span></span> ';
9419				        }
9420				    });
9421				    textNode.replaceWith($(replace));
9422				    
9423				});
9424			}//make sure suitable heading was found
9425
9426		}//tilt
9427	});
9428	
9429}
9430function pageHeaderTextEffect() {
9431
9432	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) {
9433
9434		var $selector = ($('.nectar-box-roll').length == 0) ? '#page-header-bg .span_6' : '.nectar-box-roll .overlaid-content .span_6';
9435
9436		$($selector).find('.wraped').each(function(i){
9437			$(this).find('span').delay(i*370).transition({ rotateX: '0', 'opacity' : 1, y: 0},400,'easeOutQuad');
9438		});
9439
9440		setTimeout(function(){
9441
9442			$($selector).find('.inner-wrap > *:not(.top-heading)').each(function(i){
9443				$(this).delay(i*370).transition({ rotateX: '0', 'opacity' : 1, y: 0 },650,'easeOutQuad');
9444			});
9445
9446			$('.scroll-down-wrap').removeClass('hidden');
9447
9448		}, $($selector).find('.wraped').length * 370);
9449	}
9450
9451}
9452var $effectTimeout = ($('#ajax-loading-screen').length > 0) ? 800 : 0;
9453
9454pageHeaderTextEffectInit();
9455
9456if($('#page-header-bg .nectar-video-wrap video').length == 0) { setTimeout(pageHeaderTextEffect,$effectTimeout); }
9457
9458
9459
9460
9461 //submenu fix
9462  if($('header#top nav > ul.sf-menu ul').length > 0) {
9463
9464  	var $midnightSubmenuTimeout;
9465  	$('body').on('mouseover','#header-outer .midnightHeader .sf-with-ul, #header-outer .midnightHeader .cart-menu',function(){
9466
9467  		if($(this).parents('.midnightHeader').offset().top - $(window).scrollTop() < 50){
9468  		
9469  			$(this).parents('.midnightHeader').css({'z-index': '9999'}).addClass('overflow');
9470  			$(this).parents('.midnightInner').css('overflow','visible');
9471  		}
9472  	});
9473  	$('body').on('mouseleave','#header-outer .midnightHeader',function(){
9474  		var $that = $(this);
9475  		clearTimeout($midnightSubmenuTimeout);
9476  		$midnightSubmenuTimeout = setTimeout(function(){
9477  			if(!$that.is(':hover')) {
9478  				$that.css({'z-index': 'auto'}).removeClass('overflow');
9479  				$that.find('.midnightInner').css('overflow','hidden');
9480  		
9481  			}
9482
9483  		},900);
9484  	});
9485  }
9486
9487  function midnightInit() {
9488
9489  	if( $('#header-outer[data-permanent-transparent="1"]').length > 0 && $('body[data-bg-header="true"]').length > 0) {
9490
9491			//perma trans
9492			
9493			////fix pages that set no midnight coloring
9494			if($('.container-wrap div[data-midnight]').length == 0) {
9495				$('.container-wrap').attr('data-midnight','dark');
9496			}
9497
9498			////cache midnighgt compat divs
9499			var $midnightCompatArr = [];
9500			$('div[data-midnight]').each(function(){
9501
9502				if($(this).attr('data-midnight') == 'light' || $(this).attr('data-midnight') == 'dark') {
9503					$midnightCompatArr.push($(this));
9504				}
9505
9506			});
9507
9508
9509			if($midnightCompatArr.length > 0) {
9510
9511				$.each($midnightCompatArr,function(k,v){
9512
9513						if(v.attr('data-midnight') == 'light' || v.attr('data-midnight') == 'dark') {
9514
9515							var $that = v;
9516							var waypoint = new Waypoint({
9517				 				element: $that,
9518					 			handler: function(direction) {
9519				
9520					 				if($('body.material-ocm-open').length > 0) return;
9521
9522									if(direction == 'down') {
9523										var $textColor = ($that.attr('data-midnight') == 'light') ? '' : 'dark-slide';
9524										$('#header-outer').removeClass('dark-slide').addClass($textColor);
9525								
9526									} else {
9527
9528										if(k-1 >= 0) { 
9529											var $prevMidItem = k-1;
9530										} else {
9531											var $prevMidItem = k;
9532										}
9533
9534										var $textColor = ($midnightCompatArr[$prevMidItem].attr('data-midnight') == 'light') ? '' : 'dark-slide';
9535										$('#header-outer').removeClass('dark-slide').addClass($textColor);
9536
9537									} 
9538
9539							
9540								},
9541								offset: $('#header-outer').height()
9542
9543							}); 
9544
9545						}
9546
9547				}); //each
9548
9549			} //if rows with color set are found
9550
9551  	} //if page is using trans effect
9552
9553  
9554  } 
9555
9556
9557
9558//box roll
9559function getScrollbarWidth() {
9560    var outer = document.createElement("div");
9561    outer.style.visibility = "hidden";
9562    outer.style.width = "100px";
9563    outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
9564
9565    document.body.appendChild(outer);
9566
9567    var widthNoScroll = outer.offsetWidth;
9568    // force scrollbars
9569    outer.style.overflow = "scroll";
9570
9571    // add innerdiv
9572    var inner = document.createElement("div");
9573    inner.style.width = "100%";
9574    outer.appendChild(inner);        
9575
9576    var widthWithScroll = inner.offsetWidth;
9577
9578    // remove divs
9579    outer.parentNode.removeChild(outer);
9580
9581    return widthNoScroll - widthWithScroll;
9582}
9583
9584
9585function boxRollInit() {
9586	if($('.nectar-box-roll').length > 0) { 
9587
9588		$('body').attr('data-scrollbar-width',getScrollbarWidth());
9589		
9590		$('body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap').addClass('no-scroll');
9591		$('body,html').stop().animate({ scrollTop:0 },0);
9592		$('.container-wrap').css('opacity',0).addClass('no-transform-animation-bottom-out').addClass('bottomBoxOut');
9593		//keep loading icon centered if scrollbar is going away
9594		if($('.mobile').length == 0) $('#ajax-loading-screen .loading-icon > span').css({ 'left' : '-'+getScrollbarWidth()/2 +'px'});
9595
9596		//change content pos
9597		var $overlaid = $('#page-header-bg .overlaid-content').clone();
9598		var $scrollDownOverlaid = $('.scroll-down-wrap').clone();
9599		$('#page-header-bg').removeAttr('data-midnight');
9600		$('#page-header-bg .overlaid-content, #page-header-bg .scroll-down-wrap').remove();
9601		$('.nectar-box-roll').append($overlaid);
9602		if($('#header-outer.dark-slide').length == 0) {
9603			$('.nectar-box-roll').attr('data-midnight','light');
9604		} else {
9605			$('.nectar-box-roll').attr('data-midnight','dark');
9606		}
9607		$('.overlaid-content').append($scrollDownOverlaid);
9608
9609		if($('.page-submenu[data-sticky="true"]').length > 0) {
9610			$('.container-wrap').addClass('no-trans');
9611		}
9612		
9613		nectarBoxRollContentHeight();
9614		
9615		$('html').addClass('nectar-box-roll-loaded');
9616		
9617		setTimeout(function() { pageLoadHash(); },700);
9618	} else {
9619		$('#ajax-content-wrap, .blurred-wrap').addClass('at-content');
9620		$('body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap').removeClass('no-scroll');
9621		$('.container-wrap').css('opacity',1).removeClass('no-transform-animation-bottom-out').removeClass('bottomBoxOut').removeClass('bottomBoxIn');
9622		perspect = 'not-rolled';
9623	}
9624}
9625if($('.nectar-box-roll').length > 0) { 
9626	boxRollInit();
9627}
9628
9629function nectarBoxRollContentHeight() {
9630
9631	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-space').height();
9632
9633	if($('#header-outer[data-transparent-header="true"]').length == 0) {
9634			$('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css({'height':window.innerHeight - $headerNavSpace, 'min-height':window.innerHeight - $headerNavSpace });
9635			if($('.mobile').length == 0 && $('body[data-header-format="left-header"]').length == 0) { 
9636				$('#ajax-content-wrap').css('margin-top',$headerNavSpace); 
9637				$('#slide-out-widget-area.fullscreen').css('margin-top','-'+$headerNavSpace+'px'); 
9638			}
9639			else { 
9640				$('#ajax-content-wrap, #slide-out-widget-area.fullscreen').css('margin-top','0'); 
9641			}
9642	} else {
9643		
9644		if($('.mobile').length > 0 && $('body[data-permanent-transparent="1"]').length == 0 ) {
9645			$('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css('height',window.innerHeight - $headerNavSpace);
9646		} else {
9647			$('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css('height',window.innerHeight);
9648		}
9649		
9650	}
9651}
9652
9653if($('.nectar-box-roll').length > 0) $(window).on('resize',nectarBoxRollContentHeight);
9654
9655
9656var perspect = 'not-rolled';
9657var animating = 'false';
9658function boxRoll(e,d) {
9659	
9660	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-space').height();
9661
9662	if($('#slide-out-widget-area.open').length > 0) return false;
9663	if( $('.nectar-box-roll canvas').length > 0 && $('.nectar-box-roll canvas[data-loaded="true"]').length == 0) return false;
9664
9665	if(perspect == 'not-rolled' && animating == 'false' && d == -1) {
9666		perspect = 'rolled';
9667		animating = 'true';
9668		$('body').addClass('box-animating').addClass('box-perspective-rolled').addClass('box-rolling');
9669
9670		$('.nectar-box-roll #page-header-bg').removeClass('topBoxIn').addClass('topBoxOut').css('will-change','transform');
9671		
9672		$('.nectar-box-roll .overlaid-content').removeClass('topBoxIn2').removeClass('topBoxIn').addClass('topBoxOut2').css('will-change','transform');
9673		
9674		$('.container-wrap').removeClass('bottomBoxOut').addClass('bottomBoxIn').removeClass('no-transform-animation-bottom-out').addClass('nectar-box-roll-class').css('will-change','transform');
9675		if($('#header-outer[data-transparent-header="true"]').length == 0) {
9676			$('.container-wrap').css({'height':$(window).height() - $headerNavSpace, 'opacity': 1});
9677			$('#slide-out-widget-area.fullscreen').css('margin-top','0px');
9678		} else {
9679			$('.container-wrap').css({'height':$(window).height(), 'opacity': 1});
9680		}
9681		
9682
9683		$('.nectar-slider-wrap').css({'opacity':0});
9684
9685		updateRowRightPadding(d);
9686		pauseVideoBG();
9687
9688		//old browser workaround
9689		var timeout1 = 1220;
9690		var timeout2 = 1650;
9691		var timeout3 = 1700;
9692		var timeout4 = 1350;
9693		if( $('html.no-cssanimations').length > 0) {
9694			timeout1 = 1;
9695			timeout2 = 1;
9696			timeout3 = 1;
9697			timeout4 = 1;
9698		}
9699
9700		$('.container-wrap').css('padding-right',$('body').attr('data-scrollbar-width') + 'px');
9701		setTimeout(function(){
9702			$('#header-outer, #wpadminbar, body:not(.material) .cart-outer .cart-menu, .midnightHeader .midnightInner').animate({'padding-right': $('body').attr('data-scrollbar-width')},250);
9703			$('.nectar-box-roll .canvas-bg').addClass('out-of-sight');
9704			if($('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').removeClass('transparent');
9705
9706			if($('body.mobile').length > 0) $('.nectar-box-roll').css({'z-index':'1'});
9707			
9708			//perma trans coloring
9709			$first_row_coloring = ($('.container-wrap > .main-content > .row > .wpb_row').length > 0) ? $('.container-wrap > .main-content > .row > .wpb_row:first-child').attr('data-midnight') : 'dark';
9710			if($('#header-outer[data-permanent-transparent="1"]').length > 0) {
9711				
9712				if($first_row_coloring == 'dark') {
9713					$('#header-outer').addClass('dark-slide');
9714				} else {
9715					$('#header-outer').removeClass('dark-slide');
9716				}
9717				
9718			}
9719			
9720		},timeout1);
9721		setTimeout(function(){ 
9722			updateRowRightPadding(1);
9723			$('body,html,#ajax-content-wrap, .container-wrap, .blurred-wrap').removeClass('no-scroll'); 
9724			$('#ajax-content-wrap, .blurred-wrap').addClass('at-content');
9725			$('.container-wrap, #footer-outer').removeClass('bottomBoxIn').removeClass('nectar-box-roll-class').addClass('auto-height');
9726			$('#header-outer, #wpadminbar, .container-wrap, .cart-outer .cart-menu, .midnightHeader .midnightInner').stop().css('padding-right',0);
9727
9728			if( $smoothActive == 1 && $(window).width() > 690  && Modernizr.csstransforms3d && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ 
9729				niceScrollInit();
9730			}
9731			
9732			$('.nectar-box-roll').css({'z-index':'-1000'}).transition({'y': '-200%'},0);
9733			$('.nectar-box-roll canvas').hide();
9734			$('body').removeClass('box-rolling');
9735			$('.nectar-slider-wrap').transition({'opacity':1},600,'easeOutCubic');
9736
9737			$('.nectar-box-roll #page-header-bg, .nectar-box-roll .overlaid-content, .container-wrap').css('will-change','auto');
9738			if($waypointsBound == false) { 
9739				waypoints();	
9740				midnightInit();
9741			}
9742			
9743		},timeout2);
9744		
9745		//fadeIn
9746		setTimeout(function(){ 
9747			$('.container-wrap .main-content > .row > div > div[class*="col"]').css({'opacity':1});
9748		},timeout4);
9749
9750		setTimeout(function(){ 
9751					animating ='false'; 
9752					$('body').removeClass('box-animating');		
9753		},timeout3);
9754
9755		//header position when transparent nav was used
9756		if($('#header-outer[data-permanent-transparent="1"]').length == 0 && $('.mobile').length == 0 && $('#header-outer[data-transparent-header="true"]').length != 0) { 
9757			$('#ajax-content-wrap').transition({'margin-top':$('#header-outer').outerHeight(true) + $('#header-outer').offset().top},2000,'easeInOutQuad');
9758		}
9759
9760		//remove header if not fixed
9761		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');
9762
9763	}
9764
9765	else if(perspect == 'rolled' && animating == 'false' && d == 1 && $(window).scrollTop() < 100) {
9766
9767		$('.container-wrap').removeClass('auto-height');
9768		if($('#header-outer[data-transparent-header="true"]').length == 0) {
9769			$('.container-wrap').css({'height':$(window).height() - $headerNavSpace, 'opacity': 1});
9770		} else {
9771			$('.container-wrap').css({'height':$(window).height(), 'opacity': 1});
9772		}
9773		
9774		$('#footer-outer').removeClass('auto-height');
9775		$('body').addClass('box-rolling');
9776
9777		perspect = 'not-rolled';
9778		animating = 'true';
9779		$('body').addClass('box-animating').addClass('box-perspective-not-rolled');
9780
9781		$('#header-outer, #wpadminbar, .container-wrap, .cart-outer .cart-menu, .midnightHeader .midnightInner').css('padding-right',$('body').attr('data-scrollbar-width') + 'px');
9782		$('.nectar-slider-wrap').transition({'opacity':0},600,'easeOutCubic');
9783		$('.container-wrap .main-content > .row > div > div[class*="col"]').stop(true).css({'opacity':0});
9784		setTimeout(function(){
9785			$('#header-outer, #wpadminbar, .cart-outer .cart-menu, .midnightHeader .midnightInner').animate({'padding-right': 0},250);
9786			$('.nectar-box-roll .canvas-bg').removeClass('out-of-sight');
9787			resizeVideoToCover();
9788			//header position when transparent nav was used
9789			if($('#header-outer[data-transparent-header="true"]').length != 0) { 
9790				$('#ajax-content-wrap').stop(true,true).transition({'margin-top':0},2000,'easeInOutCubic');
9791			} else {
9792				if($('.mobile').length == 0) $('#slide-out-widget-area.fullscreen').css('margin-top','-'+$headerNavSpace+'px');
9793			}
9794
9795		},30);
9796
9797		//old browser workaround
9798		var timeout1 = 1700;
9799		var timeout2 = 1600;
9800		var timeout3 = 1300;
9801		if( $('html.no-cssanimations').length > 0) {
9802			timeout1 = 1;
9803			timeout2 = 1;
9804			timeout3 = 1;
9805		}
9806
9807		if($('body.mobile').length > 0) {
9808			setTimeout(function(){
9809				$('.nectar-box-roll').css('z-index','1000');
9810			},timeout3);
9811		} else {
9812			$('.nectar-box-roll').css('z-index','1000');
9813		}
9814
9815		updateRowRightPadding(d);
9816		removeNiceScroll();
9817		$('.nectar-box-roll').transition({'y': '0'},0);
9818		$('.nectar-box-roll canvas').show();
9819		setTimeout(function(){ 
9820			updateRowRightPadding(1);
9821			animating ='false'; 
9822			$('body').removeClass('box-animating');
9823			$('#page-header-bg').removeClass('topBoxIn');
9824			$('.overlaid-content').removeClass('topBoxIn2');	
9825			$('body').removeClass('box-rolling');
9826			resumeVideoBG();
9827			$('.nectar-box-roll #page-header-bg, .nectar-box-roll .overlaid-content, .container-wrap').css('will-change','auto');
9828			
9829			
9830			//perma trans coloring
9831			if($('#header-outer[data-permanent-transparent="1"]').length > 0) {
9832				
9833				if( $('.nectar-box-roll[data-midnight="dark"]').length > 0 ) {
9834					$('#header-outer').addClass('dark-slide');
9835				} else {
9836					$('#header-outer').removeClass('dark-slide');
9837				}
9838				
9839			}
9840			
9841		},timeout1);
9842
9843		setTimeout(function(){
9844			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');
9845		},timeout2);
9846
9847		$('body,html,#ajax-content-wrap, .container-wrap, .blurred-wrap').addClass('no-scroll');
9848		$('#ajax-content-wrap, .blurred-wrap').removeClass('at-content');
9849		$('.container-wrap').addClass('nectar-box-roll-class');
9850		$('.nectar-box-roll #page-header-bg').removeClass('topBoxOut').addClass('topBoxIn').css('will-change','transform');
9851		
9852		$('.container-wrap').removeClass('bottomBoxIn').addClass('bottomBoxOut').css('will-change','transform');
9853
9854		if($('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').addClass('transparent');
9855
9856		$('.nectar-box-roll .overlaid-content').removeClass('topBoxOut2').removeClass('topBoxOut').addClass('topBoxIn2').css('will-change','transform');
9857	
9858		if($('#header-outer[data-header-resize="1"]').length > 0) { bigNav(); }
9859
9860		$('.nectar-box-roll .trigger-scroll-down').removeClass('hovered');
9861	}
9862
9863	
9864}
9865
9866function boxScrollEvent(event, delta) {
9867	if($('#slide-out-widget-area.open.fullscreen').length > 0 || $('.material-ocm-open').length > 0 ||  $('#search-outer.material-open').length > 0 ) return false;
9868	boxRoll(event,delta);
9869}
9870
9871function boxRollMouseWheelInit() {
9872	if($('.nectar-box-roll').length > 0) {
9873		$('body').on("mousewheel", boxScrollEvent);
9874	} else {
9875		$('body').off("mousewheel", boxScrollEvent);
9876	}
9877}
9878
9879if($('.nectar-box-roll').length > 0) {
9880	boxRollMouseWheelInit();
9881}
9882
9883$('body').on('click','.nectar-box-roll .section-down-arrow',function(){
9884	boxRoll(null,-1);
9885	$(this).addClass('hovered');
9886	setTimeout(function(){ $('.nectar-box-roll .section-down-arrow').removeClass('hovered'); },2000);
9887	return false;
9888});
9889
9890
9891
9892function updateRowRightPadding(d){
9893	$('.wpb_row.full-width-section').each(function(){
9894		if($(this).hasClass('extraPadding') && d == 1) {
9895			$(this).css('padding-right',parseInt($(this).css('padding-right')) - parseInt($('body').attr('data-scrollbar-width')) + 'px' ).removeClass('extraPadding');
9896		} else {
9897			$(this).css('padding-right',parseInt($('body').attr('data-scrollbar-width')) + parseInt($(this).css('padding-right')) + 'px' ).addClass('extraPadding');
9898		}	
9899	});
9900	$('.wpb_row.full-width-content').each(function(){
9901		if($(this).find('.row-bg.using-image').length == 0) {
9902			if($(this).hasClass('extraPadding') && d == 1) {
9903				$(this).find('.row-bg').css('width',parseInt($(this).width()) - parseInt($('body').attr('data-scrollbar-width')) + 'px' ).removeClass('extraPadding');
9904			} else {
9905				$(this).find('.row-bg').css('width',parseInt($('body').attr('data-scrollbar-width')) + $(this).width() + 'px' ).addClass('extraPadding');
9906			}	
9907		}
9908	});
9909}
9910
9911function pauseVideoBG() {
9912	if($('.nectar-box-roll video').length > 0 && !nectarDOMInfo.usingMobileBrowser) { $('.nectar-box-roll video')[0].pause(); }
9913}
9914function resumeVideoBG() {
9915	if($('.nectar-box-roll video').length > 0 && !nectarDOMInfo.usingMobileBrowser) { $('.nectar-box-roll video')[0].play(); }
9916}
9917
9918//touch 
9919if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) && $('.nectar-box-roll').length > 0) {
9920	$('body').swipe({
9921		tap: function(event,target) {
9922			if($(target).parents('.nectar-flip-box').length > 0)
9923				$(target).parents('.nectar-flip-box').trigger('click');
9924			if($(target).is('.nectar-flip-box'))
9925				$(target).trigger('click');
9926		},
9927		swipeStatus: function(event, phase, direction, distance, duration, fingers) {
9928			if($('#slide-out-widget-area.open').length > 0) return false;
9929			if(direction == 'up') {
9930				boxRoll(null,-1);
9931				if($('#ajax-content-wrap.no-scroll').length == 0) $('body').swipe("option", "allowPageScroll", 'vertical');
9932			} else if(direction == "down" && $(window).scrollTop() == 0) {
9933				boxRoll(null,1);
9934				$('body').swipe("option", "allowPageScroll", 'auto');
9935			}
9936		}
9937	});
9938
9939}
9940
9941function removeNiceScroll() {
9942		if($().niceScroll && $("html").getNiceScroll()){
9943			var nice = $("html").getNiceScroll();
9944			nice.stop();
9945			
9946			$('html').removeClass('no-overflow-y');
9947			$('.nicescroll-rails').hide();
9948			if($('#boxed').length == 0){
9949				$('body, body #header-outer, body #header-secondary-outer, body #search-outer, .midnightHeader .midnightInner').css('padding-right','0px');
9950			} else if($('body[data-ext-responsive="true"]').length == 0 ) {
9951				$('body').css('padding-right','0px');
9952			}
9953
9954			$('body').attr('data-smooth-scrolling','0');
9955		}
9956	}
9957//called after box roll
9958var $waypointsBound = false;
9959function waypoints() {
9960	rowBGAnimations();
9961	columnBGAnimations();
9962	colAndImgAnimations(); 
9963	progressBars(); 
9964	dividers();
9965	iconList();
9966	animated_titles();
9967	highlighted_text();
9968	imageWithHotspots();
9969	clientsFadeIn(); 
9970	splitLineHeadings();
9971	svgAnimations(); 
9972	milestoneInit();
9973	nectar_fancy_ul_init();
9974	owl_carousel_animate();
9975	headerRowColorInheritInit();
9976	morphingOutlines(); 
9977	portfolioLoadIn();
9978	animatedColBorders();
9979	foodMenuItems();
9980	vcWaypoints();
9981	$waypointsBound = true;
9982}
9983
9984
9985
9986/***************** WooCommerce Cart *****************/
9987var timeout;
9988var productToAdd;
9989var $dropdownStyle = ($('body[data-dropdown-style="minimal"]').length > 0)  ? 'minimal' : 'default';
9990//notification
9991$('body').on('click','.product .add_to_cart_button', function(){
9992
9993	var $productHeading = ($(this).parents('li').find('h2').length > 0) ? 'h2' : 'h3';
9994
9995	productToAdd = $(this).parents('li').find($productHeading).text();
9996	$('#header-outer .cart-notification span.item-name').html(productToAdd);
9997	
9998});
9999
10000//notification hover
10001$('body').on('mouseenter','#header-outer .cart-notification',function(){
10002	if($dropdownStyle == 'minimal') {
10003		$(this).hide();
10004		$('#header-outer .widget_shopping_cart').addClass('open').stop(true,true).show();
10005		$('#header-outer .cart_list').stop(true,true).show();
10006	} else {
10007		$(this).fadeOut(400);
10008		$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(300);
10009		$('#header-outer .cart_list').stop(true,true).fadeIn(300);
10010	}
10011	
10012	clearTimeout(timeout);
10013});
10014
10015//cart dropdown
10016var $headerCartSelector = ($('body.material').length > 0) ? '#header-outer .nectar-woo-cart' : '#header-outer  div.cart-outer';
10017
10018if($($headerCartSelector).length > 0) {
10019	$($headerCartSelector).hoverIntent(function(){
10020
10021		if($dropdownStyle == 'minimal') { 
10022			$('#header-outer .widget_shopping_cart').addClass('open').stop(true,true).show()
10023			$('#header-outer .cart_list').stop(true,true).show();
10024			clearTimeout(timeout);
10025			$('#header-outer .cart-notification').hide();
10026		} else {
10027			$('#header-outer .widget_shopping_cart').addClass('open').stop(true,true).fadeIn(300);
10028			$('#header-outer .cart_list').stop(true,true).fadeIn(300);
10029			clearTimeout(timeout);
10030			$('#header-outer .cart-notification').fadeOut(300);
10031		}
10032		
10033	});
10034}
10035
10036
10037$('body').on('mouseleave',$headerCartSelector,function(){
10038	var $that = $(this);
10039	setTimeout(function(){
10040		if(!$that.is(':hover')){
10041			$('#header-outer .widget_shopping_cart').removeClass('open').stop(true,true).fadeOut(300);
10042			$('#header-outer .cart_list').stop(true,true).fadeOut(300);
10043		}
10044	},200);
10045});
10046
10047if($('#header-outer[data-cart="false"]').length == 0) {
10048	$('body').on('added_to_cart', shopping_cart_dropdown_show);
10049	$('body').on('added_to_cart', shopping_cart_dropdown);
10050	
10051	//update header cart markup after ajax remove
10052	$('body').on('removed_from_cart', wooCartImgPos);
10053}
10054
10055function shopping_cart_dropdown() {
10056		
10057		if(!$('.widget_shopping_cart .widget_shopping_cart_content .cart_list .empty').length && $('.widget_shopping_cart .widget_shopping_cart_content .cart_list').length > 0 ) {
10058			$('.cart-menu-wrap').addClass('has_products');
10059			$('header#top nav > ul, #search-outer #search #close a, header#top .span_9 >.slide-out-widget-area-toggle').addClass('product_added');
10060
10061			if(!$('.cart-menu-wrap').hasClass('static')) $('.cart-menu-wrap, #mobile-cart-link').addClass('first-load');
10062			
10063			//change position of img in cart nav dropdown
10064			wooCartImgPos();
10065			
10066			//nectar slider nav directional effect
10067			if($('#header-outer').hasClass('directional-nav-effect') && $('#header-outer .cart-icon-wrap .dark').length == 0 && $('body.ascend').length > 0){
10068				$('#header-outer .cart-outer .cart-icon-wrap').each(function(){
10069                    $(this).find('> i, > span.light, > span.dark, > span.original').remove();
10070                    $(this).append('<span class="dark"><span><i class="icon-salient-cart"></i></span></span><span class="light"><span><i class="icon-salient-cart"></i></span></span><span class="original"><span><i class="icon-salient-cart"></i></span></span>');
10071                	$(this).find('.original').attr('data-w',$(this).find('span.original').width()+1);
10072                });
10073			}
10074		}
10075
10076}
10077
10078
10079function shopping_cart_dropdown_show(e) {
10080		
10081		clearTimeout(timeout);
10082		
10083		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' ) {
10084			
10085			//fix for standalone woocommerce add to cart buttons
10086			if( $('#header-outer .cart-notification .item-name').length > 0 && $('#header-outer .cart-notification .item-name').text().length == 0 ) { return; }
10087			
10088			//before cart has slide in
10089			if(!$('#header-outer .cart-menu-wrap').hasClass('has_products')) {
10090				setTimeout(function(){ $('#header-outer .cart-notification').fadeIn(400); },400);
10091			}
10092			else if(!$('#header-outer .cart-notification').is(':visible')) {
10093				$('#header-outer .cart-notification').fadeIn(400);
10094			} else {
10095				$('#header-outer .cart-notification').show();
10096			}
10097			timeout = setTimeout(hideCart,2700);
10098
10099			$('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy');
10100		}
10101}
10102
10103function hideCart() {
10104	$('#header-outer .cart-notification').stop(true,true).fadeOut();
10105}
10106
10107function checkForWooItems(){ 
10108	
10109	var checkForCartItems = setInterval(shopping_cart_dropdown,250);
10110	setTimeout(function(){ clearInterval(checkForCartItems); },4500);
10111	
10112}
10113
10114function wooCartImgPos() {
10115	$('#header-outer .widget_shopping_cart .cart_list li').each(function(){
10116		
10117		if( $(this).find('> img').length == 0 && $(this).find('.product-meta').length == 0 ) {
10118			
10119			var productCartImgLinkSrc = ($(this).find('> a[href]:not(.remove)').length > 0) ? $(this).find('> a[href]:not(.remove)').attr('href') : '';
10120			var productCartImg = $(this).find('> a > img').clone();
10121			
10122			$(this).wrapInner('<div class="product-meta" />');
10123			
10124			$(this).prepend(productCartImg);
10125			
10126			if(productCartImgLinkSrc.length > 0) {
10127			   productCartImg.wrap('<a href="'+productCartImgLinkSrc+'"></a>');
10128			}
10129			
10130		}
10131		
10132	});
10133}
10134
10135if($('#header-outer[data-cart="false"]').length == 0) {
10136	checkForWooItems();
10137}
10138
10139function nectarAccountPageTabs() {
10140	
10141	//if not on account page
10142	if($('body.woocommerce-account #customer_login').length == 0) return;
10143	
10144	//create HTML
10145	$('.woocommerce-account .woocommerce > #customer_login').prepend('<div class="nectar-form-controls" />');
10146	
10147	$('.woocommerce-account .woocommerce > #customer_login > div:not(.nectar-form-controls)').each(function(){
10148			var $title = $(this).find('> h2').text();
10149			$('#customer_login .nectar-form-controls').append('<div class="control">' + $title + '</div>');
10150	});
10151	
10152	//event
10153	$('.woocommerce-account .woocommerce > #customer_login .nectar-form-controls .control').on('click',function(){
10154		
10155		$('.woocommerce-account .woocommerce >
10155 #customer_login .nectar-form-controls .control').removeClass('active');
10156		$(this).addClass('active');
10157		
10158		var formIndex = $(this).index() + 1;
10159		$('#customer_login div[class*="u-column"]').hide();
10160		$('#customer_login div[class*="u-column"].col-'+formIndex).show();
10161		
10162		setTimeout(function(){
10163			$('#customer_login div[class*="u-column"]').removeClass('visible');
10164			$('#customer_login div[class*="u-column"].col-'+formIndex).addClass('visible');
10165		},30);
10166		
10167	});
10168	
10169	//starting
10170	$('.woocommerce-account .woocommerce > #customer_login .nectar-form-controls .control:nth-child(1)').trigger('click');
10171	
10172}
10173
10174nectarAccountPageTabs();
10175
10176var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
10177var secondaryHeader = ($('#header-outer').attr('data-using-secondary') == '1') ? 32 : 0 ;
10178function searchFieldCenter(){
10179	var $headerHeightSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').outerHeight();
10180	$('#search-outer').css('top', $headerHeightSpace + extraHeight + secondaryHeader);
10181	$('#search-outer > #search #search-box').css('top',($(window).height()/2) - ($('#search-outer > #search input').height()/2) - $headerHeightSpace );
10182}
10183
10184
10185
10186//text on hover effect
10187$('body').on('mouseover','.text_on_hover .product-wrap',function(){
10188	$(this).parent().addClass('hovered');
10189});
10190$('body').on('mouseover','.text_on_hover > a:first-child',function(){
10191	$(this).parent().addClass('hovered');
10192});
10193
10194$('body').on('mouseout','.text_on_hover .product-wrap',function(){
10195	$(this).parent().removeClass('hovered');
10196});
10197$('body').on('mouseout','.text_on_hover > a:first-child',function(){
10198	$(this).parent().removeClass('hovered');
10199});
10200
10201
10202//material/fancy parallax hover effect zindex
10203if($('.material.product').length > 0 || $('.minimal.product').length > 0 || $('.nectar-fancy-box[data-style="parallax_hover"]').length > 0 || $('.nectar-category-grid[data-shadow-hover="yes"]').length > 0){
10204
10205	var $productZindex = 101;
10206	
10207	$('body').on('mouseenter','.material.product, .minimal.product, .nectar-fancy-box[data-style="parallax_hover"], .nectar-category-grid[data-shadow-hover="yes"] .nectar-category-grid-item',function(){
10208		
10209		$productZindex++;
10210
10211		$(this).css('z-index',$productZindex+1);
10212		
10213	});
10214	$('body').on('mouseleave','.material.product, .minimal.product, .nectar-fancy-box[data-style="parallax_hover"], .nectar-category-grid[data-shadow-hover="yes"] .nectar-category-grid-item',function(){
10215		
10216		var $that = $(this);
10217		setTimeout(function(){ if(!$that.is(':hover')) $that.css('z-index',100); },350);
10218	});
10219
10220	//reset to stop zindex from getting too high
10221	setInterval(function(){ 
10222		if($('.nectar-fancy-box[data-style="parallax_hover"]:hover').length > 0 || $('.minimal.product:hover').length > 0) {
10223			 return;
10224		}
10225
10226		$('.material.product:not(:hover), .minimal.product:not(:hover), .nectar-fancy-box[data-style="parallax_hover"]:not(:hover), .nectar-category-grid[data-shadow-hover="yes"] .nectar-category-grid-item:not(:hover)').css('z-index',100);
10227		$productZindex = 101; 
10228	},10000);
10229
10230}
10231
10232function minimalProductHover() {
10233	
10234	//add icons
10235	$('.products .classic .product-wrap .add_to_cart_button').wrapInner('<span />');
10236	$('.products .classic .product-wrap .add_to_cart_button').prepend('<i class="normal icon-salient-cart"></i>');
10237	
10238	//bind hover
10239	$('body').on('mouseover', '.products .minimal.product',function(){
10240		minimalProductCalc($(this));
10241	});
10242	
10243	$('body').on('mouseleave', '.products .minimal.product',function(){
10244		
10245		$(this).find('.background-color-expand').css({
10246			'transform': 'scale(1)'
10247		});
10248		
10249	});
10250	
10251	//starting trigger mouse over
10252	$('.products .minimal.product').each(function(){
10253		if($(this).is(':hover')) {
10254			$(this).trigger('mouseover');
10255		}
10256	});
10257}
10258
10259function minimalProductCalc(el) {
10260	var $item = el;
10261	var $itemWidth = $item.width();
10262	var $itemHeight = $item.height();
10263	
10264	var $wChange = (parseInt($itemWidth) + 40) / parseInt($itemWidth);
10265	var $hChange = (parseInt($itemHeight) + 40) / parseInt($itemHeight);
10266	
10267	$item.addClass('hover-bound');
10268	
10269	$item.find('.background-color-expand').css({
10270		'transform': 'scale('+ $wChange + ',' + $hChange  +') translateY(0px)'
10271	});
10272}
10273
10274minimalProductHover();
10275
10276
10277
10278
10279//mobile widget filters
10280////skip widgets without any titles
10281$('.woocommerce #sidebar .widget.woocommerce').each(function(){
10282	if($(this).find('> h4').length == 0) {
10283		$(this).addClass('no-widget-title');
10284	}
10285});
10286
10287$('body').on('click','#sidebar .widget.woocommerce:not(.widget_price_filter) h4',function(){
10288	if($(window).width() < 1000) {
10289		$(this).parent().find('> ul').slideToggle();
10290		$(this).parent().toggleClass('open-filter');
10291	}
10292});
10293
10294	//slide in cart
10295	$('body').on('mouseenter','#header-outer [data-cart-style="slide_in"] .cart-menu-wrap',openRightCart);
10296
10297	function openRightCart() {
10298
10299		if($('.nectar-slide-in-cart ul.cart_list li:not(.empty)').length > 0) {
10300			$('.nectar-slide-in-cart').addClass('open');
10301
10302			$(window).on('mousemove.rightCartOffsetCheck',closeCartCheck);
10303		}
10304	}
10305
10306	function closeCartCheck(e) {
10307		var $windowWidth = $(window).width();
10308		if(e.clientX < $windowWidth - 370 - $bodyBorderWidth) {
10309
10310			$(window).off('mousemove.rightCartOffsetCheck',closeNavCheck);
10311
10312			$('.nectar-slide-in-cart').removeClass('open');
10313
10314		}
10315
10316	}
10317
10318
10319
10320
10321
10322/***************** Search ******************/
10323	var $placeholder = ($('#search-outer #search input[type=text][data-placeholder]').length > 0) ? $('#search-outer #search input[type=text]').attr('data-placeholder') : '';
10324	var logoHeight = parseInt($('#header-outer').attr('data-logo-height'));
10325	
10326
10327	if($('body').hasClass('material') && $('#header-outer .bg-color-stripe').length == 0) {
10328		$('#header-outer').append('<div class="bg-color-stripe" />');
10329	} 
10330
10331	////search box event
10332	$('body').on('click', '#search-btn a', function(){ return false; });
10333	$('body').on('mouseup', '#search-btn a:not(.inactive), #header-outer .mobile-search', function(){
10334
10335		if($(this).hasClass('open-search')) { return false; } 
10336
10337
10338		if($('body').hasClass('ascend') || $('body[data-header-format="left-header"]').length > 0 && $('body.material').length == 0 ){ 
10339			$('#search-outer > #search form, #search-outer #search .span_12 span').css('opacity',0);
10340			$('#search-outer > #search form').css('bottom','10px');
10341			$('#search-outer #search .span_12 span').css('top','10px');
10342			$('#search-outer').show();
10343			$('#search-outer').stop().transition({scale: '1,0', 'opacity': 1},0).transition({ scale: '1,1'},400,'easeInOutCubic');
10344
10345			$('#search-outer > #search form').delay(400).animate({'opacity':1, 'bottom':0},'easeOutCirc');
10346			$('#search-outer #search .span_12 span').delay(470).animate({'opacity':1, 'top':0},'easeOutCirc');
10347			
10348		} else if( !$('body').hasClass('material') ) {
10349			$('#search-outer').stop(true).fadeIn(600,'easeOutExpo');
10350		} else {
10351
10352			/*material*/
10353			$('#header-outer[data-transparent-header="true"] .bg-color-stripe').css('transition',''); 
10354
10355			$('#search-outer').addClass('material-open');
10356			$('#ajax-content-wrap').addClass('material-open');
10357			$('#header-outer').addClass('material-search-open');
10358			$('#fp-nav').addClass('material-ocm-open');
10359
10360
10361		}
10362
10363
10364		if($('body[data-header-format="left-header"]').length == 0) {
10365			$('body.original #search-outer > #search input[type="text"]').css({
10366				'top' : $('#search-outer').height()/2 - $('#search-outer > #search input[type="text"]').height()/2
10367			});
10368		}
10369		
10370		setTimeout(function(){
10371
10372			$('#search input[type=text]').focus();
10373			
10374			if($('#search input[type=text]').attr('value') == $placeholder){
10375				$('#search input[type=text]').setCursorPosition(0);	
10376			}
10377
10378		},300);
10379
10380		//ascend
10381		if($('body').hasClass('ascend') || $('body[data-header-format="left-header"]').length > 0 && $('body.material').length == 0){ 
10382			searchFieldCenter();
10383		}
10384
10385		$(this).toggleClass('open-search');
10386
10387		//close slide out widget area
10388		$('.slide-out-widget-area-toggle a:not(#toggle-nav).open:not(.animating)').trigger('click');
10389
10390		return false;
10391	});
10392	
10393	$('body:not(.material)').on('keydown','#search input[type=text]',function(){
10394		if($(this).attr('value') == $placeholder){
10395			$(this).attr('value', '');
10396		}
10397	});
10398	
10399	$('body:not(.material)').on('keyup','#search input[type=text]',function(){
10400		if($(this).attr('value') == ''){
10401			$(this).attr('value', $placeholder);
10402			$(this).setCursorPosition(0);
10403		}
10404	});
10405	
10406	
10407	////close search btn event
10408	$('body').on('click','#close',function(){
10409		closeSearch();
10410		$('#search-btn a, #header-outer .mobile-search').removeClass('open-search');
10411		return false;
10412	});
10413
10414	//close material when clicking off the search
10415	$('body.material').on('click', '#ajax-content-wrap', function(e){
10416		if (e.originalEvent !== undefined) {
10417			closeSearch();
10418			$('#search-btn a, #header-outer .mobile-search').removeClass('open-search');
10419		}
10420	});
10421
10422	//material gets esc
10423	if($('body.material').length > 0) {
10424		$(document).keyup(function(e) {
10425
10426	     if (e.keyCode == 27) { 
10427	     	closeSearch();  
10428	     	$('#search-btn a').removeClass('open-search'); 
10429
10430	     	//close ocm material
10431	     	if($('.ocm-effect-wrap.material-ocm-open').length > 0) {
10432	     		$('.slide-out-widget-area-toggle.material-open a').trigger('click');
10433	     	}
10434	     }
10435
10436		});
10437	}
10438
10439	//if user clicks away from the search close it
10440	$('body:not(.material)').on('blur','#search-box input[type=text]',function(e){
10441		closeSearch();
10442		$('#search-btn a, #header-outer .mobile-search').removeClass('open-search');
10443	});
10444
10445	
10446	function closeSearch(){
10447		if($('body').hasClass('ascend') || $('body[data-header-format="left-header"]').length > 0 && $('body.material').length == 0){ 
10448			$('#search-outer').stop().transition({'opacity' :0},300,'easeOutCubic');
10449			$('#search-btn a').addClass('inactive');
10450			setTimeout(function(){ $('#search-outer').hide(); $('#search-btn a').removeClass('inactive'); },300);
10451		} else if($('body.material').length == 0) {
10452			$('#search-outer').stop(true).fadeOut(450,'easeOutExpo');
10453		}
10454
10455		if($('body').hasClass('material')) {
10456			$('#ajax-content-wrap').removeClass('material-open');
10457			$('#header-outer').removeClass('material-search-open');
10458			$('#search-outer').removeClass('material-open');
10459			$('#fp-nav').removeClass('material-ocm-open');
10460		}
10461	}
10462	
10463	
10464	//mobile search
10465	$('body').on('click', '#mobile-menu #mobile-search .container a#show-search',function(){
10466		$('#mobile-menu .container > ul').slideUp(500);
10467		return false;
10468	});
10469	
10470/***************** Nav ******************/
10471	
10472
10473	function centeredNavBottomBarReposition() {
10474		
10475		var $headerOuter = $('#header-outer');
10476		var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
10477		var $headerSpan3 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_3');
10478		var $secondaryHeader = $('#header-secondary-outer');
10479		var $headerBtns = $headerSpan3.find('nav >ul.buttons');
10480		var $bodyBorderSize = ($('.body-border-top').length > 0 && $(window).width() > 1000) ? $('.body-border-top').height(): 0;
10481		var override_remove_check = false;
10482		
10483		function centeredNavBottomBarSecondary() {
10484			if($('body.mobile').length > 0) {
10485				$('#header-outer').css('margin-top','');
10486			} else {
10487				if($('#header-outer').css('top') == '0px') {
10488						
10489						$(window).off('scroll', centeredNavBottomFixed_Add);
10490						$(window).off('scroll', centeredNavBottomFixed_Remove);
10491						
10492						$navLogoMargin = parseInt($('body.material #header-outer #logo').css('margin-top'));
10493						if($headerSpan9.offset().top - $navLogoMargin - nectarDOMInfo.scrollTop <= $headerOuter.offset().top - parseInt($secondaryHeader.height()) ) {
10494								$(window).on('scroll', centeredNavBottomFixed_Add);
10495						} else {
10496								$(window).on('scroll', centeredNavBottomFixed_Remove);
10497						}
10498					
10499				}
10500
10501				
10502				$('#header-outer').css('margin-top',nectarDOMInfo.secondaryHeaderHeight);
10503				
10504				// custom mobile breakpoint
10505				if($('#header-outer .span_9').css('display') == 'none') {
10506					 $('#header-outer').css('margin-top','');
10507				} else if($('#header-outer .span_9').css('display') != 'none' && parseInt($('#header-outer').css('top')) > 0) {
10508					 $('#header-outer').css('top','');
10509				}
10510				
10511				
10512			}
10513			
10514		}
10515		
10516		if($secondaryHeader.length > 0) {
10517			
10518			if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
10519				setTimeout(function(){
10520					nectarDOMInfo.secondaryHeaderHeight = $('#header-secondary-outer').height();
10521					centeredNavBottomBarSecondary();
10522				},50);
10523				$(window).smartresize(centeredNavBottomBarSecondary);
10524			}
10525		
10526		} 
10527		
10528
10529		var $navLogoMargin = parseInt($('body.material #header-outer #logo').css('margin-top'));
10530		
10531
10532		if($('#header-outer[data-condense="true"]').length > 0) {
10533			
10534				$(window).on('scroll',centeredNavBottomFixed_Add);
10535				$(window).trigger('scroll');
10536				
10537				
10538				$(window).smartresize(function(){
10539					
10540					condenseCustomBreakPointHelper();
10541					
10542					//trigger condense if switching from mobile to desktop and user has scrolled down
10543					if(nectarDOMInfo.windowWidth > 1000 && $('#header-outer').css('position') == 'fixed' && $('#header-outer').css('top') == '0px' && override_remove_check == false) {
10544						setTimeout(function(){
10545							$(window).off('scroll', centeredNavBottomFixed_Add);
10546							$(window).off('scroll', centeredNavBottomFixed_Remove);
10547							override_remove_check = true;
10548							centeredNavBottomFixed_Remove();
10549						},100);
10550							
10551					}
10552				});
10553				
10554				function condenseCustomBreakPointHelper() {
10555					var $withinCustomBreakpoint = mobileBreakPointCheck();
10556					
10557					//adding class to prevent logo from hiding when opening OCM
10558					if($withinCustomBreakpoint) {
10559						$('#header-outer').addClass('within-custom-breakpoint');
10560					} else {
10561						$('#header-outer').removeClass('within-custom-breakpoint');
10562					}
10563				}
10564				
10565				condenseCustomBreakPointHelper();
10566
10567		}
10568
10569		
10570		
10571		
10572		function centeredNavBottomFixed_Add() {
10573				
10574				if(nectarDOMInfo.windowWidth < 1000 || $('body.material-ocm-open').length > 0 || $('#header-outer[data-has-menu="true"][data-format="centered-menu-bottom-bar"] .span_9').css('display') == 'none') { return; }
10575				
10576				$navLogoMargin = parseInt($('body.material #header-outer #logo').css('margin-top'));
10577				
10578				var $bodyBorderTop = ($('.body-border-top').length > 0 && nectarDOMInfo.secondaryHeaderHeight > 0) ? $('.body-border-top').height() : 0;
10579				
10580				if($headerSpan9.offset().top - $navLogoMargin - nectarDOMInfo.scrollTop <= $headerOuter.offset().top - parseInt(nectarDOMInfo.secondaryHeaderHeight) + $bodyBorderTop ) {
10581						
10582						var amountToMove = (parseInt($headerSpan9.position().top) - $navLogoMargin - parseInt(nectarDOMInfo.adminBarHeight)) + parseInt(nectarDOMInfo.secondaryHeaderHeight) - $bodyBorderTop;
10583						
10584						//megamenu RT
10585						if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer .megamenu').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0) {
10586							$('#header-outer').removeClass('no-transition');	
10587						}
10588						
10589						$headerOuter.addClass('fixed-menu').removeClass('transparent').css({
10590							'top' : '-' + amountToMove + 'px',
10591							'position': 'fixed'
10592						});
10593						
10594						var $headerNavBarOffset = $('header#top .span_9 nav >ul').offset().top;
10595						var $headerButtonsOffset = $headerBtns.offset().top;
10596						
10597						if($('#boxed > #header-outer').length > 0) {
10598							$headerButtonsOffset = $headerButtonsOffset + 20;
10599						}
10600
10601						var $headerButtonsHeight = ($headerSpan9.find('.sf-menu > li > a').length > 0) ? (20 - parseInt($headerSpan9.find('.sf-menu > li > a').height())) / 2 : 2;
10602						$headerBtns.css('transform','translateY('+ (parseInt($headerNavBarOffset) - parseInt($headerButtonsOffset) - $headerButtonsHeight - 1) +'px)');
10603						
10604						$headerBtns.find('.nectar-woo-cart').css('height',$headerOuter.height() + parseInt($headerOuter.css('top')) - parseInt(nectarDOMInfo.adminBarHeight) + parseInt(nectarDOMInfo.secondaryHeaderHeight) );
10605
10606						//search
10607
10608						$(window).off('scroll', centeredNavBottomFixed_Add);
10609						$(window).on('scroll', centeredNavBottomFixed_Remove);
10610				}
10611		}
10612		
10613		function centeredNavBottomFixed_Remove() {
10614			
10615			if(nectarDOMInfo.windowWidth < 1000 || $('body.material-ocm-open').length > 0 || $('#header-outer[data-has-menu="true"][data-format="centered-menu-bottom-bar"] .span_9').css('display') == 'none') { return; }
10616			
10617			$navLogoMargin = parseInt($('body.material #header-outer #logo').css('margin-top'));
10618			
10619			if($headerSpan9.offset().top - $navLogoMargin - nectarDOMInfo.scrollTop > $headerOuter.offset().top - parseInt(nectarDOMInfo.secondaryHeaderHeight) || override_remove_check ) {
10620						$headerOuter.removeClass('fixed-menu').css({
10621							'top' : '0',
10622							'position': 'absolute'
10623						});
10624						
10625						//reset override_remove_check
10626						override_remove_check = false;
10627						
10628						//search
10629						//$('#search-outer .container').css('transform','translateY(0px)');
10630						
10631						$headerBtns.css('transform','translateY(0px)');
10632						
10633						$headerBtns.find('.nectar-woo-cart').css('height','');
10634						
10635						if($('#header-outer.transparent').length == 0) {
10636							
10637							if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer .megamenu').length > 0) {
10638								$('#header-outer').removeClass('no-transition');	
10639							}
10640							
10641							if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer .megamenu').length > 0) {
10642								
10643								if($('#header-outer').attr('data-transparent-header') == 'true' && $('.nectar-box-roll').length == 0 && $('.megamenu.sfHover').length == 0) {
10644									$('#header-outer').addClass('transparent');
10645									$('#header-outer').removeClass('no-transition');	
10646								}
10647								
10648								else if($('#header-outer').attr('data-transparent-header') == 'true' && $('.nectar-box-roll').length == 0 && $('.megamenu.sfHover').length > 0) {
10649									$('#header-outer').addClass('no-transition');	
10650								}
10651								
10652							} else {
10653								if($('#header-outer').attr('data-transparent-header') == 'true'  && $('.nectar-box-roll').length == 0) $('#header-outer').addClass('transparent');
10654							}
10655						}
10656						
10657						$(window).off('scroll', centeredNavBottomFixed_Remove);
10658						$(window).on('scroll', centeredNavBottomFixed_Add);
10659							
10660			}
10661			
10662		}
10663		
10664		
10665		
10666}
10667	
10668	
10669
10670function condenseHeaderMobileOverride() {
10671	var $transCondenseHeader = $('#header-outer[data-has-menu="true"][data-format="centered-menu-bottom-bar"][data-condense="true"][data-transparent-header="true"] .span_9');
10672	
10673	if($transCondenseHeader.length > 0 && nectarDOMInfo.windowWidth > 1000 && $transCondenseHeader.css('display') == 'none') {
10674		$('#header-outer').removeClass('transparent').addClass('no-transition');
10675	} else if($transCondenseHeader.length > 0 && nectarDOMInfo.scrollTop < 20 && nectarDOMInfo.windowWidth > 1000 && $transCondenseHeader.css('display') != 'none') {
10676		$('#header-outer:not(.transparent)').addClass('transparent');
10677	}
10678
10679	
10680}
10681
10682
10683	
10684	if($('#header-outer[data-format="centered-menu-bottom-bar"]').length > 0) {
10685		centeredNavBottomBarReposition();
10686		
10687		condenseHeaderMobileOverride();
10688		$(window).smartresize(condenseHeaderMobileOverride);
10689	}
10690	
10691	
10692	function centeredLogoMargins() {
10693
10694		if($('#header-outer[data-format="centered-logo-between-menu"]').length > 0 && $(window).width() > 1000) {
10695			$midnightSelector = ($('#header-outer .midnightHeader').length > 0) ? '> .midnightHeader:first-child' : '';
10696			var $navItemLength = $('#header-outer[data-format="centered-logo-between-menu"] '+$midnightSelector+' nav > .sf-menu > li').length;
10697			if($('#header-outer #social-in-menu').length > 0) { $navItemLength--; }
10698
10699			$centerLogoWidth = ($('#header-outer .row .col.span_3 #logo img:visible').length == 0) ? parseInt($('#header-outer .row .col.span_3').width()) : parseInt($('#header-outer .row .col.span_3 img:visible').width());
10700
10701			$extraMenuSpace = ($('#header-outer[data-lhe="animated_underline"]').length > 0) ? parseInt($('#header-outer header#top nav > ul > li:first-child > a').css('margin-right')) : parseInt($('#header-outer header#top nav > ul > li:first-child > a').css('padding-right'));
10702			
10703			if($extraMenuSpace > 30) {
10704				$extraMenuSpace += 45;
10705			} else if($extraMenuSpace > 20) {
10706				$extraMenuSpace += 40;
10707			} else {
10708				$extraMenuSpace += 30;
10709			}
10710
10711			$('#header-outer[data-format="centered-logo-between-menu"] nav > .sf-menu > li:nth-child('+Math.floor($navItemLength/2)+')').css({'margin-right': ($centerLogoWidth+$extraMenuSpace) + 'px'}).addClass('menu-item-with-margin');
10712			$leftMenuWidth = 0;
10713			$rightMenuWidth = 0;
10714			$('#header-outer[data-format="centered-logo-between-menu"] '+$midnightSelector+' nav > .sf-menu > li:not(#social-in-menu)').each(function(i){
10715				if(i+1 <= Math.floor($navItemLength/2)) {
10716					$leftMenuWidth += $(this).width();
10717				} else {
10718					$rightMenuWidth += $(this).width();
10719				}
10720
10721			});
10722
10723			var $menuDiff = Math.abs($rightMenuWidth - $leftMenuWidth);
10724
10725			if($leftMenuWidth > $rightMenuWidth)  {
10726				$('#header-outer .row > .col.span_9').css('padding-right',$menuDiff);
10727			}
10728			else {
10729				$('#header-outer .row > .col.span_9').css('padding-left',$menuDiff);
10730			}
10731
10732			$('#header-outer[data-format="centered-logo-between-menu"] nav').css('visibility','visible');
10733		}
10734	}
10735	
10736	var logoHeight = parseInt($('#header-outer').attr('data-logo-height'));
10737	var headerPadding = parseInt($('#header-outer').attr('data-padding'));
10738	var usingLogoImage = $('#header-outer').attr('data-using-logo');
10739	
10740	if( isNaN(headerPadding) || headerPadding.length == 0 ) { headerPadding = 28; }
10741	if( isNaN(logoHeight) || usingLogoImage.length == 0 ) { usingLogoImage = false; logoHeight = 30;}
10742	
10743	if($('header#top nav > ul li#search-btn a').length > 0) {
10744		var $searchBtnHeight = $('header#top nav > ul li#search-btn a').height();
10745	} else {
10746		var $searchBtnHeight = 24;
10747	}
10748
10749	//inital calculations
10750	function headerInit() {
10751		
10752		if($('#header-outer[data-format="left-header"]').length > 0) return;
10753
10754
10755		if($('body.material').length == 0) {
10756
10757			$('#header-outer #logo img').css({
10758				'height' : logoHeight				
10759			});	
10760
10761			$('body:not(.material) #header-outer, .ascend #header-outer[data-full-width="true"][data-using-pr-menu="true"] header#top nav ul.buttons li.menu-item, .ascend #header-outer[data-full-width="true"][data-format="centered-menu"] header#top nav ul.buttons li#social-in-menu').css({
10762				'padding-top' : headerPadding
10763			});	
10764			
10765			if($('body.mobile').length == 0) {
10766				$('header#top nav > ul > li:not(#social-in-menu) > a').css({
10767					'padding-bottom' : Math.floor( ((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding),
10768					'padding-top' : Math.floor( (logoHeight/2) - ($('header#top nav > ul > li > a').height()/2))
10769				});	
10770				
10771				var $socialInMenuHeight = ($('header#top nav > .sf-menu > li:not(#social-in-menu) a').length > 0 && $('header#top nav > .sf-menu > li:not(#social-in-menu) a').height() > 22) ? $('header#top nav > .sf-menu > li:not(#social-in-menu) a').height() : $('header#top nav > ul > li#social-in-menu > a i').height();
10772				
10773				$('header#top nav > ul > li#social-in-menu > a').css({
10774					'margin-top' : Math.ceil(logoHeight/2) - Math.ceil($socialInMenuHeight/2)
10775				});	
10776			}
10777			
10778			if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
10779				$('#header-outer .cart-menu').css({  
10780					'padding-bottom' : Math.ceil(((logoHeight/2) - ($searchBtnHeight/2)) + headerPadding),
10781					'padding-top' : Math.ceil(((logoHeight/2) - ($searchBtnHeight/2)) + headerPadding)
10782				});	
10783			} 
10784			
10785			
10786			$('header#top nav > ul li#search-btn, header#top nav > ul li#nectar-user-account, header#top nav > ul li.slide-out-widget-area-toggle').css({
10787				'padding-bottom' : (logoHeight/2) - ($searchBtnHeight/2),
10788				'padding-top' : (logoHeight/2) - ($searchBtnHeight/2)
10789			});	
10790			
10791
10792			
10793			if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) {
10794				$('header#top nav > ul li#search-btn, header#top nav > ul li#nectar-user-account, header#top nav > ul li.slide-out-widget-area-toggle').css({
10795					'padding-top': 0,
10796					'padding-bottom': 0
10797				});
10798
10799				$('header#top nav > ul.buttons').css({
10800					'margin-top' : - headerPadding,
10801					'height' : Math.floor(logoHeight + headerPadding*2) -1
10802				});
10803
10804				$('header#top nav > ul li#search-btn a, header#top nav > ul li#nectar-user-account a, header#top nav > ul li.slide-out-widget-area-toggle a').css({
10805					'visibility' : 'visible',
10806					'padding-top': Math.floor((logoHeight/2) - ($searchBtnHeight/2) + headerPadding),
10807					'padding-bottom': Math.floor((logoHeight/2) - ($searchBtnHeight/2) + headerPadding)
10808				});
10809			}
10810			
10811			$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').css({
10812				'top' : $('header#top nav > ul.sf-menu > li > a').outerHeight() 
10813			});	
10814			
10815			
10816			setTimeout(function(){ 
10817				$('body:not(.ascend):not(.material) #search-outer #search-box .ui-autocomplete').css({
10818					'top': parseInt($('#header-outer').outerHeight())+'px'
10819				}); 
10820			},1000);
10821			
10822			$('body:not(.ascend):not(.material) #search-outer #search-box .ui-autocomplete').css({
10823				'top': parseInt($('#header-outer').outerHeight())+'px'
10824			});
10825
10826		}//not material skin
10827
10828		//header space
10829		if($('.nectar-parallax-scene.first-section').length == 0) {
10830
10831			if($('#header-outer').attr('data-using-secondary') == '1'){
10832				if($('#header-outer[data-mobile-fixed="false"]').length > 0  || $('body.mobile').length == 0 ) {
10833					$('#header-space').css('height', parseInt($('#header-outer').outerHeight()) + $('#header-secondary-outer').height());
10834					
10835				} else {
10836					$('#header-space').css('height', parseInt($('#header-outer').outerHeight()));
10837					
10838				}
10839				
10840			} else {
10841
10842				$('#header-space').css('height', $('#header-outer').outerHeight() );
10843			} 
10844		}
10845		
10846		$('#header-outer .container, #header-outer .cart-menu').css('visibility','visible');
10847		
10848
10849		if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
10850			$('body:not(.ascend):not(.material) #search-outer, #search .container').css({
10851				'height' : logoHeight + headerPadding*2
10852			});	
10853			
10854			$('body:not(.ascend):not(.material) #search-outer > #search input[type="text"]').css({
10855				'font-size'  : 43,
10856				'height' : '59px',
10857				'top' : ((logoHeight + headerPadding*2)/2) - $('#search-outer > #search input[type="text"]').height()/2
10858			});
10859			
10860			$('body:not(.ascend):not(.material) #search-outer > #search #close a').css({
10861				'top' : ((logoHeight + headerPadding*2)/2) - 8
10862			});	
10863		} else {
10864			$('body:not(.ascend):not(.material) #search-outer, #search .container').css({
10865				'height' : logoHeight + headerPadding*2 + logoHeight + 17
10866			});	
10867			
10868			$('body:not(.ascend):not(.material) #search-outer > #search input[type="text"]').css({
10869				'font-size'  : 43,
10870				'height' : '59px',
10871				'top' : ((logoHeight + headerPadding*2)/2) - ($('#search-outer > #search input[type="text"]').height()/2) + logoHeight/2 + 17
10872			});
10873			
10874			$('body:not(.ascend):not(.material) #search-outer > #search #close a').css({
10875				'top' : ((logoHeight + headerPadding*2)/2) - 8 + logoHeight/2 + 17
10876			});	
10877		}
10878		
10879
10880	}
10881
10882	
10883	//is header resize on scroll enabled?
10884	var headerResize = $('#header-outer').attr('data-header-resize');
10885	var headerHideUntilNeeded = $('body').attr('data-hhun');
10886
10887	//transparent fix
10888
10889	if($('#header-outer[data-remove-fixed="1"]').length == 0) {
10890		if($(window).scrollTop() != 0 && $('#header-outer.transparent[data-permanent-transparent="false"]').length == 1) $('#header-outer').removeClass('transparent');
10891	}
10892
10893	if( headerResize == 1 && headerHideUntilNeeded != '1'){
10894		
10895		headerInit();
10896
10897		$(window).off('scroll.headerResizeEffect');
10898
10899		if($('#nectar_fullscreen_rows').length == 0) {
10900			$(window).on('scroll.headerResizeEffect',smallNav);
10901		}
10902		else if($('#nectar_fullscreen_rows[data-mobile-disable="on"]').length > 0 && navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) ) {
10903			$(window).on('scroll.headerResizeEffect',smallNav);
10904		}
10905
10906	} else if(headerHideUntilNeeded != '1') {
10907		headerInit();
10908		$(window).off('scroll.headerResizeEffectOpaque');
10909		$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
10910		
10911	} else if(headerHideUntilNeeded == '1') {
10912
10913		headerInit();
10914
10915		if($('.nectar-box-roll').length > 0) $('#header-outer').addClass('at-top-before-box');
10916
10917		var previousScroll = 0, // previous scroll position
10918        menuOffset = $('#header-space').height()*2, // height of menu (once scroll passed it, menu is hidden)
10919        detachPoint = ($('body.mobile').length > 0) ? 150 : 600, // point of detach (after scroll passed it, menu is fixed)
10920        hideShowOffset = 6; // scrolling value after which triggers hide/show menu
10921
10922	    // on scroll hide/show menu
10923	    function hhunCalcs(e) {
10924
10925	     //stop scrolling while animated anchors
10926	     if($('body.animated-scrolling').length > 0 && $('#header-outer.detached').length > 0) return false;
10927
10928	     //stop when material ocm or material search is open
10929	     if($('body.material-ocm-open').length > 0 || $('#search-outer.material-open').length > 0) { return false; }
10930
10931	     //stop on mobile if not using sticky option
10932	      if($('#header-outer[data-mobile-fixed="false"]').length > 0 && $('body.mobile').length > 0) {  $('#header-outer').removeClass('detached'); return false; }
10933
10934	      var currentScroll = $(this).scrollTop(), // gets current scroll position
10935	            scrollDifference = Math.abs(currentScroll - previousScroll); // calculates how fast user is scrolling
10936
10937	      if (!$('#header-outer').hasClass('side-widget-open') && !$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')) {
10938	       
10939	        // if scrolled past menu
10940	        if (currentScroll > menuOffset) {
10941	          // if scrolled past detach point add class to fix menu
10942	          if (currentScroll > detachPoint) {
10943	            if (!$('#header-outer').hasClass('detached'))
10944	              $('#header-outer').addClass('detached').removeClass('parallax-contained');
10945	          	   $('#header-outer').removeClass('no-transition');	
10946
10947
10948	          	  if($('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').removeClass('transparent');
10949	          }
10950
10951	          // if scrolling faster than hideShowOffset hide/show menu
10952	          if (scrollDifference >= hideShowOffset) {
10953	            if (currentScroll > previousScroll) {
10954	              // scrolling down; hide menu
10955	              if (!$('#header-outer').hasClass('invisible')) {
10956								
10957									if($('#header-outer.at-top').length > 0) {
10958									
10959										//prevent header from transitioning when first hiding
10960										$('#header-outer').addClass('no-trans-hidden');
10961										setTimeout(function(){
10962											$('#header-outer').addClass('invisible').removeClass('at-top');
10963											$('#header-outer').removeClass('no-trans-hidden');
10964										},30);
10965										
10966									} else {
10967										
10968										$('#header-outer').addClass('invisible').removeClass('at-top');
10969									}
10970								
10971	                
10972									
10973	                 //close submenus
10974	                 if( $(".sf-menu").length > 0 && $().superfish ) {
10975		          		 $(".sf-menu").superfish('hide');
10976		          		 $('header#top nav > ul.sf-menu > li.menu-item-over').removeClass('menu-item-over');
10977		          	 }
10978
10979	              }
10980	                $('.page-submenu.stuck').css('transform','translateY(0px)').addClass('header-not-visible');
10981
10982	            	
10983	            } else {
10984	              // scrolling up; show menu
10985	              if ($('#header-outer').hasClass('invisible'))
10986	                $('#header-outer').removeClass('invisible');
10987
10988	            	if($('.body-border-top').length > 0 && $('body.mobile').length == 0) {
10989
10990	            		var $bodyBorderHeaderColorMatch = ($('.body-border-top').css('background-color') == '#ffffff' && $('body').attr('data-header-color') == 'light' || $('.body-border-top').css('background-color') == $('#header-outer').attr('data-user-set-bg')) ? true : false;
10991	            		var $bodyBorderSizeToRemove = ($bodyBorderHeaderColorMatch) ? $('.body-border-top').height() : 0;
10992	          	    	$('.page-submenu.stuck').css('transform','translateY('+ ($('#header-outer').outerHeight()-$bodyBorderSizeToRemove) +'px)').removeClass('header-not-visible');
10993
10994	            	} else {
10995	            		$('.page-submenu.stuck').css('transform','translateY('+$('#header-outer').outerHeight()+'px)').removeClass('header-not-visible');
10996	            	}
10997	            }
10998	          }
10999	        } else {
11000	          // only remove "detached" class if user is at the top of document (menu jump fix)
11001	          $topDetachNum = ($('#header-outer[data-using-secondary="1"]').length > 0) ? 32 : 0;
11002	          if($('.body-border-top').length > 0) {
11003	          		$topDetachNum = ($('#header-outer[data-using-secondary="1"]').length > 0) ? 32 + $('.body-border-top').height() : $('.body-border-top').height();
11004	          }
11005
11006	          if (currentScroll <= $topDetachNum){
11007	            $('#header-outer').removeClass('detached').removeClass('invisible').addClass('at-top');
11008	            
11009	            if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer .megamenu').length > 0) {
11010		            if($('#header-outer[data-transparent-header="true"]').length > 0 && $('.nectar-box-roll').length == 0 && $('.megamenu.sfHover').length == 0) { 
11011		            	$('#header-outer').addClass('transparent').css('transform','translateY(0)');
11012		            	$('#header-outer').removeClass('no-transition');	
11013		            }
11014		            else if($('.nectar-box-roll').length > 0) $('#header-outer').css('transform','translateY(0)').addClass('at-top-before-box');
11015		          
11016		        } else {
11017		        	 if($('#header-outer[data-transparent-header="true"]').length > 0 && $('.nectar-box-roll').length == 0) $('#header-outer').addClass('transparent').css('transform','translateY(0)');
11018		            else if($('.nectar-box-roll').length > 0) $('#header-outer').css('transform','translateY(0)').addClass('at-top-before-box');
11019		        }
11020
11021	            if( $('#page-header-bg[data-parallax="1"]').length > 0) $('#header-outer').addClass('parallax-contained').css('transform','translateY(0)');
11022	          }
11023	        }
11024
11025	        // if user is at the bottom of document show menu
11026	        if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
11027	          $('#header-outer').removeClass('invisible');
11028
11029	            if($('.body-border-top').length > 0 && $('body.mobile').length == 0) {
11030
11031            		var $bodyBorderHeaderColorMatch = ($('.body-border-top').css('background-color') == '#ffffff' && $('body').attr('data-header-color') == 'light' || $('.body-border-top').css('background-color') == $('#header-outer').attr('data-user-set-bg')) ? true : false;
11032            		var $bodyBorderSizeToRemove = ($bodyBorderHeaderColorMatch) ? $('.body-border-top').height() : 0;
11033          	    	$('.page-submenu.stuck').css('transform','translateY('+ ($('#header-outer').outerHeight()-$bodyBorderSizeToRemove) +'px)').removeClass('header-not-visible');
11034	            }
11035	            else {
11036	            	$('.page-submenu.stuck').css('transform','translateY('+$('#header-outer').outerHeight()+'px)').removeClass('header-not-visible');
11037	            }
11038	          
11039	        }
11040
11041	      }
11042
11043	      // replace previous scroll position with new one
11044	      previousScroll = currentScroll;
11045
11046	    }
11047
11048	    //don't trigger for header remove stickiness
11049	    if($('#header-outer[data-remove-fixed="1"]').length == 0) {
11050		    hhunCalcs();
11051		    $(window).scroll(hhunCalcs);
11052		}
11053
11054
11055	}//end if hhun
11056	
11057	if($('#nectar_fullscreen_rows').length == 0 && $('.nectar-box-roll').length == 0) { midnightInit(); }	
11058	
11059	if($('#nectar_fullscreen_rows').length > 0 ) { ($('#header-outer').attr('data-permanent-transparent','false')) }
11060
11061	var shrinkNum = 6;
11062	var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
11063	var $bodyBorderHeaderColorMatch = ($('.body-border-top').css('background-color') == '#ffffff' && $('body').attr('data-header-color') == 'light' || $('.body-border-top').css('background-color') == $('#header-outer').attr('data-user-set-bg')) ? true : false;
11064	var $scrollTriggerOffset = ( $('body.material').length > 0 ) ? 150 : 0;
11065
11066	if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
11067
11068	function smallNav(){
11069		var $offset = $(window).scrollTop();
11070		var $windowWidth = $(window).width();
11071		
11072
11073		if($offset > $scrollTriggerOffset && $windowWidth > 1000 && $('body.material-ocm-open').length == 0) {
11074		
11075
11076			//if going to small when material search is closing, it must be closed immediately
11077			if($('body.material').length > 0) {
11078				if($('#search-outer.material-open').length == 0) {
11079					$('#header-outer[data-transparent-header="true"] .bg-color-stripe').css('transition','none');
11080				}
11081
11082				//secondary header
11083				if($('#header-secondary-outer').length > 0) {
11084					$('#header-secondary-outer').addClass('hide-up').css('transform','translateY(-100%)');
11085					$('#header-outer').css('transform', 'translateY(-' +$('#header-secondary-outer').height()+ 'px)');
11086				}
11087
11088			}
11089
11090			if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer .megamenu').length > 0) {
11091				if($('#header-outer').attr('data-transparent-header') == 'true' && $('#header-outer.side-widget-open').length == 0 && $('#header-outer[data-permanent-transparent="1"]').length == 0 && $('.megamenu.sfHover').length == 0) { 
11092					$('#header-outer').removeClass('transparent');
11093					$('#header-outer').removeClass('no-transition');	
11094				}
11095			} else {
11096				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');
11097			}
11098
11099			
11100			$('#header-outer, #search-outer').addClass('small-nav');
11101			
11102			//body border full width side padding
11103			if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0 && $('.body-border-top').length > 0 && $bodyBorderHeaderColorMatch == true) {
11104				$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
11105					'padding' : '0'			
11106				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11107			}
11108
11109			if($('body.material').length > 0) {
11110				$('header#top nav > ul > li.menu-item-with-margin').stop(true,true).animate({
11111					'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) - parseInt(shrinkNum)*3) +'px'
11112				},{queue:false, duration:310, easing: 'easeOutQuad'});	
11113			}
11114			if($('body.material').length == 0) {
11115
11116				$('#header-outer #logo img').stop(true,true).animate({
11117					'height' : logoHeight - shrinkNum
11118				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11119					
11120				$('body:not(.material) #header-outer, .ascend #header-outer[data-full-width="true"][data-using-pr-menu="true"] header#top nav ul.buttons li.menu-item, .ascend #header-outer[data-full-width="true"][data-format="centered-menu"] header#top nav ul.buttons li#social-in-menu').stop(true,true).animate({
11121					'padding-top' : Math.ceil(headerPadding / 1.8)
11122				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11123				
11124				if($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) {
11125					$('#header-outer .row > .span_3').stop(true,true).animate({
11126						'padding-bottom' : Math.ceil(headerPadding / 1.8)
11127					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11128				}
11129
11130				$('header#top nav > ul > li:not(#social-in-menu) > a').stop(true,true).animate({
11131					'padding-bottom' :  Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding / 1.8) ,
11132					'padding-top' :  Math.floor(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) 
11133				},{queue:false, duration:250, easing: 'easeOutCubic'});	 
11134
11135				
11136
11137				$('header#top nav > ul > li#social-in-menu > a').stop(true,true).animate({
11138					'margin-bottom' :  Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li#social-in-menu > a').height()/2)) + headerPadding / 1.8) ,
11139					'margin-top' :  Math.floor(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li#social-in-menu > a').height()/2)) 
11140				},{queue:false, duration:250, easing: 'easeOutCubic'});	 
11141				
11142				$('header#top nav > ul > li.menu-item-with-margin').stop(true,true).animate({
11143					'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) - parseInt(shrinkNum)*3) +'px'
11144				},{queue:false, duration:250, easing: 'easeOutCubic'});	 
11145
11146				if($bodyBorderHeaderColorMatch == true) {
11147					$('.body-border-top').stop(true,true).animate({
11148						'margin-top': '-'+$('.body-border-top').height()+'px'
11149					},{queue:false, duration:400, easing: 'easeOutCubic', complete: function() { $(this).css('margin-top',0)} });	 
11150				}
11151
11152				if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
11153					$('#header-outer .cart-menu').stop(true,true).animate({
11154						'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2) + headerPadding/ 1.7),
11155						'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2) + headerPadding/ 1.7) +1
11156					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11157				} 
11158				
11159				if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) {
11160					$('header#top nav > ul.buttons').stop(true,true).animate({
11161						'margin-top' : - Math.ceil(headerPadding/ 1.8),
11162						'height' : Math.floor((headerPadding*2)/ 1.8 + logoHeight-shrinkNum)
11163					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11164
11165					$('header#top nav > ul li#search-btn a, header#top nav > ul li#nectar-user-account a, header#top nav > ul li.slide-out-widget-area-toggle a').stop(true,true).animate({
11166						'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2) + headerPadding/ 1.7),
11167						'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2) + headerPadding/ 1.7) +1
11168					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11169
11170				} else {
11171					$('header#top nav > ul li#search-btn, header#top nav > ul li#nectar-user-account, header#top nav > ul li.slide-out-widget-area-toggle').stop(true,true).animate({
11172						'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2)),
11173						'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2))
11174					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11175				}
11176
11177				if($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) {
11178					$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
11179						'top' : Math.floor($('header#top nav > ul > li > a').outerHeight())
11180					},{queue:false, duration:250, easing: 'easeOutCubic'});		
11181				} else {
11182					$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
11183						'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),
11184					},{queue:false, duration:250, easing: 'easeOutCubic'});		
11185				}
11186				
11187				$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({
11188					'top': Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) +'px'
11189				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11190			
11191
11192				if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
11193					$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
11194						'height' : Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8)
11195					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11196
11197					$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
11198						'font-size'  : 30,
11199						'line-height' : '30px',
11200						'height' : '44px',
11201						'top' : ((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2
11202					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11203				
11204					$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
11205						'top' : ((logoHeight-shrinkNum + headerPadding+5)/2) - 10
11206					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11207
11208				} else {
11209					$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
11210						'height' : Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) + logoHeight - shrinkNum + 17
11211					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11212
11213					$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
11214						'font-size'  : 30,
11215						'line-height' : '30px',
11216						'height' : '44px',
11217						'top' : ((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2 + (logoHeight- shrinkNum)/2 + 8
11218					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11219
11220					$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
11221						'top' : ((logoHeight-shrinkNum + headerPadding+5)/2) - 10 + (logoHeight- shrinkNum)/2 + 8
11222					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11223				}
11224
11225			}//not material skin
11226		
11227			
11228
11229			//box roll
11230			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'})
11231			
11232			
11233			if($('body').hasClass('ascend')){ 
11234				$('#search-outer').stop(true,true).animate({
11235					'top' : Math.floor((logoHeight-shrinkNum) +(headerPadding*2)/ 1.8 + extraHeight + secondaryHeader)
11236				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11237			}
11238			
11239			//if no image is being used
11240			if(usingLogoImage == false) $('body:not(.material) header#top #logo').stop(true,true).animate({
11241				'margin-top' : 0
11242			},{queue:false, duration:450, easing: 'easeOutExpo'});	
11243			
11244			$(window).off('scroll',smallNav);
11245			$(window).on('scroll',bigNav);
11246
11247			//dark slider coloring border fix
11248			$('#header-outer[data-transparent-header="true"]').css('transition','transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, margin 0.25s ease-out');
11249			$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none');
11250			setTimeout(function(){ 
11251				$('#header-outer[data-transparent-header="true"]').css('transition','transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, border-color 0.30s ease, margin 0.25s ease-out'); 
11252				$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.30s ease');
11253			},300);
11254
11255		}
11256
11257	}
11258	
11259	function bigNav(){
11260		var $offset = $(window).scrollTop();
11261		var $windowWidth = $(window).width();
11262
11263		if($('body.material-ocm-open').length > 0) { return false; }
11264
11265		if($offset <= $scrollTriggerOffset && $windowWidth > 1000 || $('.small-nav').length > 0 && $('#ajax-content-wrap.no-scroll').length > 0 ) {
11266			
11267
11268			$('#header-outer, #search-outer').removeClass('small-nav');
11269			
11270			if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer .megamenu').length > 0) {
11271				if($('#header-outer').attr('data-transparent-header') == 'true'  && $('.nectar-box-roll').length == 0 && $('.megamenu.sfHover').length == 0) {
11272					$('#header-outer').addClass('transparent');
11273					$('#header-outer').removeClass('no-transition');	
11274				}
11275			} else {
11276				if($('#header-outer').attr('data-transparent-header') == 'true'  && $('.nectar-box-roll').length == 0) $('#header-outer').addClass('transparent');
11277			}
11278
11279			
11280
11281
11282			//body border full width side padding
11283			if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0 && $('.body-border-top').length > 0 && $bodyBorderHeaderColorMatch == true) {
11284				$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
11285					'padding' : '0 28px'			
11286				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11287			}
11288
11289
11290			if($('body.material').length > 0) {
11291
11292				$('header#top nav > ul > li.menu-item-with-margin').stop(true,true).animate({
11293					'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) + parseInt(shrinkNum)*3) +'px'
11294				},{queue:false, duration:140, easing: 'easeOutQuad'});
11295
11296				//secondary header
11297				if($('#header-secondary-outer').length > 0) {
11298					$('#header-secondary-outer, #header-outer').removeClass('hide-up').css('transform','translateY(0%)');
11299				}
11300		
11301			}
11302
11303			if($('body.material').length == 0) {
11304
11305				$('#header-outer #logo img').stop(true,true).animate({
11306					'height' : logoHeight,				
11307				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11308
11309				$('body:not(.material) #header-outer, .ascend #header-outer[data-full-width="true"][data-using-pr-menu="true"] header#top nav ul.buttons li.menu-item, .ascend #header-outer[data-full-width="true"][data-format="centered-menu"] header#top nav ul.buttons li#social-in-menu').stop(true,true).animate({
11310					'padding-top' : headerPadding 
11311				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11312				
11313				if($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) {
11314					$('#header-outer .row > .span_3').stop(true,true).animate({
11315						'padding-bottom' : headerPadding 
11316					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11317				}
11318
11319				$('header#top nav > ul > li:not(#social-in-menu) > a').stop(true,true).animate({
11320					'padding-bottom' : ((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding,
11321					'padding-top' : (logoHeight/2) - ($('header#top nav > ul > li > a').height()/2) 
11322				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11323				
11324				var $socialInMenuHeight = ($('header#top nav > .sf-menu > li:not(#social-in-menu) a').length > 0 && $('header#top nav > .sf-menu > li:not(#social-in-menu) a').height() > 22) ? $('header#top nav > .sf-menu > li:not(#social-in-menu) a').height() : $('header#top nav > ul > li#social-in-menu > a i').height();
11325				
11326				$('header#top nav > ul > li#social-in-menu > a').stop(true,true).animate({
11327					'margin-top' : Math.ceil(logoHeight/2) - Math.ceil($socialInMenuHeight/2)
11328				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11329					
11330				$('header#top nav > ul > li.menu-item-with-margin').stop(true,true).animate({
11331					'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) + parseInt(shrinkNum)*3) +'px'
11332				},{queue:false, duration:250, easing: 'easeOutCubic'});	 
11333
11334				if($bodyBorderHeaderColorMatch == true) {
11335					$('.body-border-top').css({ 'margin-top': '-'+$('.body-border-top').height()+'px'}).stop(true,true).animate({
11336						'margin-top': '0'
11337					},{queue:false, duration:250, easing: 'easeOutCubic'});	 
11338				}
11339
11340				if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
11341					$('#header-outer .cart-menu').stop(true,true).animate({
11342						'padding-bottom' : Math.ceil(((logoHeight/2) - ($searchBtnHeight/2)) + headerPadding),
11343						'padding-top' : Math.ceil(((logoHeight/2) - ($searchBtnHeight/2)) + headerPadding)
11344					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11345				}
11346
11347				if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) {
11348					$('header#top nav > ul.buttons').stop(true,true).animate({
11349						'margin-top' : - Math.ceil(headerPadding),
11350						'height' : Math.floor(headerPadding*2 + logoHeight) -1
11351					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11352
11353					$('header#top nav > ul li#search-btn a, header#top nav > ul li#nectar-user-account a, header#top nav > ul li.slide-out-widget-area-toggle a').stop(true,true).animate({
11354						'padding-top': Math.floor((logoHeight/2) - ($searchBtnHeight/2) + headerPadding),
11355						'padding-bottom': Math.floor((logoHeight/2) - ($searchBtnHeight/2) + headerPadding)
11356					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11357				} else {
11358					$('header#top nav > ul li#search-btn, header#top nav > ul li#nectar-user-account, header#top nav > ul li.slide-out-widget-area-toggle').stop(true,true).animate({
11359						'padding-bottom' : Math.floor((logoHeight/2) - ($searchBtnHeight/2)),
11360						'padding-top' : Math.ceil((logoHeight/2) - ($searchBtnHeight/2))
11361					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11362				}
11363				
11364				if($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) {
11365					$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
11366						'top' : Math.floor($('header#top nav > ul > li > a').outerHeight())
11367					},{queue:false, duration:250, easing: 'easeOutCubic'});		
11368				} else {
11369					$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
11370						'top' : Math.ceil($('header#top nav > ul > li > a').height() + (((logoHeight)/2) - ($('header#top nav > ul > li > a').height()/2))*2 + headerPadding),
11371					},{queue:false, duration:250, easing: 'easeOutCubic'});		
11372				}
11373				
11374				$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({
11375					'top': Math.ceil(logoHeight + headerPadding*2) +'px'
11376				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11377				
11378				
11379				if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
11380					$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
11381						'height' : Math.ceil(logoHeight + headerPadding*2)
11382					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11383					
11384					$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
11385						'font-size'  : 43,
11386						'line-height' : '43px',
11387						'height' : '59px',
11388						'top' : ((logoHeight + headerPadding*2)/2) - 30
11389					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11390					
11391					
11392					$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
11393						'top' : ((logoHeight + headerPadding*2)/2) - 8
11394					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11395					
11396				} else {
11397					$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
11398						'height' : Math.ceil(logoHeight + headerPadding*2) + logoHeight + 17
11399					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11400					
11401					$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
11402						'font-size'  : 43,
11403						'line-height' : '43px',
11404						'height' : '59px',
11405						'top' : ((logoHeight + headerPadding*2)/2) - 30 + (logoHeight)/2 + 8
11406					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11407					
11408					
11409					$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
11410						'top' : ((logoHeight + headerPadding*2)/2) - 8 + (logoHeight)/2 + 8
11411					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11412				}
11413
11414
11415				if($('body').hasClass('ascend')){ 
11416					$('#search-outer').stop(true,true).animate({
11417						'top' : (logoHeight) +(headerPadding*2) + extraHeight + secondaryHeader
11418					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11419				}
11420
11421				//if no image is being used
11422				if(usingLogoImage == false) $('header#top #logo').stop(true,true).animate({
11423					'margin-top' : 4
11424				},{queue:false, duration:450, easing: 'easeOutExpo'});	
11425				
11426
11427
11428			}//not material skin
11429
11430
11431				//box roll
11432			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'})
11433			
11434
11435			$(window).off('scroll',bigNav);
11436			$(window).on('scroll',smallNav);
11437
11438
11439			//dark slider coloring border fix
11440			$('#header-outer[data-transparent-header="true"]').css('transition','transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, margin 0.25s ease-out');
11441			$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none');
11442			setTimeout(function(){ 
11443				$('#header-outer[data-transparent-header="true"]').css('transition','transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, border-color 0.30s ease, margin 0.25s ease-out'); 
11444				$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.30s ease');
11445			},300);
11446		}
11447
11448	}
11449	
11450	
11451	function headerSpace() {
11452		if($('.mobile').length > 0) {
11453			if(window.innerHeight < window.innerWidth && window.innerWidth > 1000) {
11454				if($('#header-outer.small-nav').length == 0)
11455					$('#header-space').css('height', $('#header-outer').outerHeight() + $('#header-secondary-outer').height());
11456			} else {
11457				$('#header-space').css('height', $('#header-outer').outerHeight());
11458			}
11459			
11460		} else {
11461			if($('.nectar-parallax-scene.first-section').length == 0) {
11462
11463				var shrinkNum = 6;	
11464				var headerPadding = parseInt($('#header-outer').attr('data-padding'));
11465				if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
11466				var headerPadding2 = headerPadding - headerPadding/1.8;
11467				var $headerHeight = ($('#header-outer[data-header-resize="1"]').length > 0 && $('.small-nav').length > 0 ) ? $('#header-outer').outerHeight() + (parseInt(shrinkNum) + headerPadding2*2) : $('#header-outer').outerHeight();
11468
11469				if($('#header-outer').attr('data-using-secondary') == '1'){
11470					$('#header-space').css('height', $headerHeight + $('#header-secondary-outer').height());
11471				} else {
11472					$('#header-space').css('height', $headerHeight);
11473				} 
11474			}
11475		}
11476		
11477	}
11478
11479	//call immediately on mobile to make sure there's no gap with fixed setups
11480	if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/) && $('#header-outer[data-mobile-fixed="1"]').length > 0 && $('#header-outer[data-permanent-transparent="false"]').length > 0) {
11481		$('#header-space').css('height', $('#header-outer').outerHeight());
11482	}
11483
11484
11485	var lastPosition = -1;
11486	var $headerScrollTop = nectarDOMInfo.scrollTop;
11487
11488	function headerOffsetAdjust(){
11489		if($('body.compose-mode').length > 0) { return; }
11490		$headerScrollTop = nectarDOMInfo.scrollTop;
11491
11492		 if (lastPosition == $headerScrollTop) {
11493            requestAnimationFrame(headerOffsetAdjust);
11494            return false;
11495        } else lastPosition = $headerScrollTop;
11496		
11497		headerOffsetAdjustCalc();
11498
11499		requestAnimationFrame(headerOffsetAdjust);
11500
11501	}
11502	var condenseHeaderLayout = $('#header-outer[data-condense="true"]').length > 0 ? true : false;
11503	var headerOuterCached = $('#header-outer');
11504	
11505	function headerOffsetAdjustCalc() {
11506		if($('body.mobile').length > 0 || condenseHeaderLayout == true && $('#header-outer .span_9').css('display') == 'none') {
11507			var $eleHeight = 0;
11508
11509			var $endOffset = ($('#wpadminbar').css('position') == 'fixed') ? $('#wpadminbar').height() : 0;
11510			$eleHeight += ($('#header-secondary-outer').length > 0 && $('#header-secondary-outer').css('display') == 'block') ? nectarDOMInfo.secondaryHeaderHeight : 0;
11511			$eleHeight += nectarDOMInfo.adminBarHeight;
11512			
11513			if( $eleHeight - $headerScrollTop > $endOffset) { 
11514				headerOuterCached.css('top', $eleHeight - $headerScrollTop + 'px');
11515			}
11516			else { headerOuterCached.css('top', $endOffset); }
11517
11518		} else {
11519				if(condenseHeaderLayout == false) {
11520					var $eleHeight = 0;
11521					
11522					$eleHeight += nectarDOMInfo.secondaryHeaderHeight;
11523					$eleHeight += nectarDOMInfo.adminBarHeight;
11524					headerOuterCached.css('top',$eleHeight+'px');
11525				}
11526		}
11527	}
11528
11529	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) {
11530		if($('#nectar_fullscreen_rows').length == 0) { requestAnimationFrame(headerOffsetAdjust); }
11531		else if($('#nectar_fullscreen_rows').length > 0 && $onMobileBrowser) {
11532			requestAnimationFrame(headerOffsetAdjust);
11533		}
11534		$(window).smartresize(headerOffsetAdjustCalc);
11535	}
11536		
11537
11538	function footerRevealCalcs() {
11539		var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').outerHeight();
11540
11541		if($(window).height() - $('#wpadminbar').height() - $headerNavSpace - $('#footer-outer').height() - 1 -$('#page-header-bg').height()  - $('.page-header-no-bg').height() > 0) {
11542			var $resizeExtra = ($('body:not(.material) #header-outer[data-header-resize="1"]').length > 0) ? 55: 0;
11543			$('body[data-footer-reveal="1"] .container-wrap').css({'margin-bottom': $('#footer-outer').height()-1 });
11544			//let even non reveal footer have min height set when using material ocm
11545			$('.container-wrap').css({'min-height': $(window).height() - $('#wpadminbar').height() - $headerNavSpace - $('#footer-outer').height() -1  - $('.page-header-no-bg').height() -$('#page-header-bg').height() + $resizeExtra });
11546		} else {
11547			$('body[data-footer-reveal="1"] .container-wrap').css({'margin-bottom': $('#footer-outer').height()-1 });
11548		}
11549		
11550		if( $(window).width() < 1000) $('#footer-outer').attr('data-midnight','light');
11551		else $('#footer-outer').removeAttr('data-midnight');
11552	}
11553	if($('body[data-footer-reveal="1"]').length > 0 || $('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length > 0) { 
11554		setTimeout(function(){
11555			footerRevealCalcs();
11556		},60);
11557		footerRevealCalcs();
11558		//set shadow to match BG color if applicable
11559		if($('bodybody[data-footer-reveal="1"][data-footer-reveal-shadow="large_2"]').length > 0) $('.container-wrap').css({ boxShadow: '0 70px 110px -30px '+$('#footer-outer').css('backgroundColor') });
11560	}
11561	
11562	
11563	function opaqueCheck(){
11564		if($('#header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length > 0) { return; }
11565		
11566		var $offset = $(window).scrollTop();
11567		var $windowWidth = $(window).width();
11568
11569		if($offset > 0 && $windowWidth > 1000) {
11570			
11571			if($('body.material').length > 0) {
11572				$('#header-outer').addClass('scrolled-down');
11573
11574				//secondary header
11575				if($('#header-secondary-outer').length > 0) {
11576					$('#header-secondary-outer').addClass('hide-up').css('transform','translateY(-100%)');
11577					$('#header-outer').css('transform', 'translateY(-' +$('#header-secondary-outer').height()+ 'px)');
11578				}
11579			}
11580
11581			if($('#header-outer').attr('data-transparent-header') == 'true' && $('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').removeClass('transparent').addClass('scrolled-down');
11582			
11583			$(window).off('scroll',opaqueCheck);
11584			$(window).on('scroll',transparentCheck);
11585		}
11586	}
11587	
11588	
11589	function transparentCheck(){
11590		
11591		if($('#header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length > 0) { return; }
11592		
11593		var $offset = $(window).scrollTop();
11594		var $windowWidth = $(window).width();
11595
11596		if($offset == 0 && $windowWidth > 1000 && $('body.material-ocm-open').length == 0) {
11597			
11598			if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer .megamenu').length > 0) {
11599				
11600				if($('#header-outer').attr('data-transparent-header') == 'true' && $('.megamenu.sfHover').length == 0) { 
11601					$('#header-outer').addClass('transparent').removeClass('scrolled-down');
11602					$('#header-outer').removeClass('no-transition');	
11603				}
11604				else if($('#header-outer').attr('data-transparent-header') == 'true') { $('#header-outer').removeClass('scrolled-down'); }
11605				
11606			} else {
11607				if($('#header-outer').attr('data-transparent-header') == 'true') { $('#header-outer').addClass('transparent').removeClass('scrolled-down'); }
11608			}
11609
11610			if($('body.material').length > 0) {
11611				$('#header-outer').removeClass('scrolled-down');
11612
11613				//secondary header
11614				if($('#header-secondary-outer').length > 0) {
11615					$('#header-secondary-outer, #header-outer').removeClass('hide-up').css('transform','translateY(0%)');
11616				}
11617			}
11618
11619			
11620			$(window).off('scroll',transparentCheck);
11621			$(window).on('scroll',opaqueCheck);
11622		}
11623	}
11624	
11625
11626	
11627	
11628	//header inherit row color effect
11629	function headerRowColorInheritInit(){
11630		if($('body[data-header-inherit-rc="true"]').length > 0 && $('.mobile').length == 0){
11631			
11632			var headerOffset = ($('#header-outer[data-permanent-transparent="1"]').length == 0) ? (logoHeight - shrinkNum) + Math.
11632ceil((headerPadding*2) / 1.8) + nectarDOMInfo.adminBarHeight : logoHeight/2 + headerPadding + nectarDOMInfo.adminBarHeight;
11633			
11634			$('.main-content > .row > .wpb_row').each(function(){
11635
11636				var $that = $(this);
11637				var waypoint = new Waypoint({
11638	 				element: $that,
11639		 			handler: function(direction) {
11640
11641						if(direction == 'down') {
11642							
11643							if($that.find('.row-bg.using-bg-color').length > 0) {
11644								
11645								var $textColor = ($that.find('> .col.span_12.light').length > 0) ? 'light-text' : 'dark-text';
11646								$('#header-outer').css('background-color',$that.find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor);
11647								$('#header-outer').attr('data-current-row-bg-color',$that.find('.row-bg').css('background-color'));
11648
11649								$('body.material #header-outer .bg-color-stripe').css('background-color',$that.find('.row-bg').css('background-color'));
11650							} else {
11651								$('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text');
11652								$('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg'));
11653
11654								$('body.material #header-outer .bg-color-stripe').css('background-color', '');
11655							}
11656						
11657						} else {
11658
11659							if($that.prev('div.wpb_row').find('.row-bg.using-bg-color').length > 0) {
11660								var $textColor = ($that.prev('div.wpb_row').find('> .col.span_12.light').length > 0) ? 'light-text' : 'dark-text';
11661								$('#header-outer').css('background-color',$that.prev('div.wpb_row').find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor);
11662								$('#header-outer').attr('data-current-row-bg-color', $that.prev('div.wpb_row').find('.row-bg').css('background-color'));
11663
11664								$('body.material #header-outer .bg-color-stripe').css('background-color', $that.prev('div.wpb_row').find('.row-bg').css('background-color'));
11665							} else {
11666								$('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text');
11667								$('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg'));
11668
11669								$('body.material #header-outer .bg-color-stripe').css('background-color', '');
11670							}
11671
11672						} 
11673
11674				
11675					},
11676					offset: headerOffset
11677
11678				}); 
11679
11680
11681			});
11682		}
11683	}
11684
11685
11686
11687/****************sticky page submenu******************/
11688	if($('.page-submenu[data-sticky="true"]').length > 0 && $('#nectar_fullscreen_rows').length == 0) {
11689
11690		(function() {
11691		  'use strict'
11692
11693		  var $ = window.jQuery
11694		  var Waypoint = window.Waypoint
11695		  var $offsetHeight = 0; 
11696		  var shrinkNum = 6;	
11697		  var headerPadding = parseInt($('#header-outer').attr('data-padding'));
11698
11699		  if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
11700		  var headerPadding2 = headerPadding - headerPadding/1.8;
11701		  var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').outerHeight();
11702		  var $headerHeight = ($('#header-outer[data-header-resize="1"]').length > 0 && $('body.mobile').length == 0) ? $headerNavSpace - (parseInt(shrinkNum) + headerPadding2*2) : $headerNavSpace;
11703			
11704			if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
11705				
11706					var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
11707					var $secondaryHeader = $('#header-secondary-outer');
11708					
11709					$headerHeight = $('#header-outer').height() - (parseInt($headerSpan9.position().top) - parseInt($('#header-outer #logo').css('margin-top')) ) -  parseInt(nectarDOMInfo.secondaryHeaderHeight);
11710			}
11711			
11712		  if( $('.page-template-template-no-header-footer').length > 0 || $('.page-template-template-no-header').length > 0 ) { $headerNavSpace = 0; $headerHeight = 0; }
11713
11714		  if($('#header-secondary-outer').length > 0 && $('body.mobile').length == 0 && $('body.material').length == 0) $headerHeight += $('#header-secondary-outer').height();
11715		  
11716
11717		  $(window).on('smartresize',function(){
11718
11719		    $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').outerHeight();
11720		  	$headerHeight = ($('#header-outer[data-header-resize="1"]').length > 0 && $('.small-nav').length == 0 && $('body.mobile').length == 0) ? $headerNavSpace - (parseInt(shrinkNum) + headerPadding2*2) : $headerNavSpace;
11721		  	
11722				if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
11723					
11724						var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
11725						var $secondaryHeader = $('#header-secondary-outer');
11726						
11727						$headerHeight = $('#header-outer').height() - (parseInt($headerSpan9.position().top) - parseInt($('#header-outer #logo').css('margin-top')) ) - parseInt(nectarDOMInfo.secondaryHeaderHeight);
11728				}
11729				
11730				if($('#header-secondary-outer').length > 0  && $('body.mobile').length == 0 && $('body.material').length == 0) $headerHeight += $('#header-secondary-outer').height();
11731
11732		  	$offsetHeight = 0; 
11733		
11734		  	  if($('#wpadminbar').length > 0 && $('#wpadminbar').css('position') == 'fixed') $offsetHeight += $('#wpadminbar').height();
11735 			  if($('body[data-hhun="0"] #header-outer').length > 0 && !($('body.mobile').length > 0 && $('#header-outer[data-mobile-fixed="false"]').length > 0) ) {
11736 			  	  $offsetHeight += $headerHeight;
11737 			  }
11738
11739 			  if($('.body-border-top').length > 0 && $(window).width() > 1000 && $('body[data-hhun="1"]').length > 0) $offsetHeight += $('.body-border-top').height();
11740 	
11741 			
11742 			 //recalc for resizing (same as stuck/unstuck logic below)
11743 			 if($('.page-submenu.stuck').length > 0) {
11744
11745		        	$('.page-submenu.stuck').addClass('no-trans').css('top',$offsetHeight).css('transform','translateY(0)').addClass('stuck');
11746		        	var $that = this;
11747		        	setTimeout(function(){ $('.page-submenu.stuck').removeClass('no-trans'); },50);
11748		        	$('.page-submenu.stuck').parents('.wpb_row').css('z-index',10000);
11749
11750		        	//boxed
11751		        	if($('#boxed').length > 0) { 
11752		        		var $negMargin = ($(window).width() > 1000) ? $('.container-wrap').width()*0.04 :39;
11753		        		$('.page-submenu.stuck').css({'margin-left':'-'+$negMargin+'px', 'width' : $('.container-wrap').width()});
11754		        	}
11755
11756		        }
11757		        else { 
11758		        	$('.page-submenu.stuck').css('top','0').removeClass('stuck');
11759		       	   $('.page-submenu.stuck').parents('.wpb_row').css('z-index','auto');
11760
11761		       	    if($('#boxed').length > 0) $('.page-submenu.stuck').css({'margin-left':'0px', 'width' : '100%'});
11762		       	}
11763
11764		  });
11765
11766		  /* http://imakewebthings.com/waypoints/shortcuts/sticky-elements */
11767		  function Sticky(options) {
11768		    this.options = $.extend({}, Waypoint.defaults, Sticky.defaults, options)
11769		    this.element = this.options.element
11770		    this.$element = $(this.element)
11771		    this.createWrapper()
11772		    this.createWaypoint()
11773		  }
11774
11775		  /* Private */
11776		  Sticky.prototype.createWaypoint = function() {
11777		    var originalHandler = this.options.handler
11778
11779		    $offsetHeight = 0; 
11780		    if($('#wpadminbar').length > 0 && $('#wpadminbar').css('position') == 'fixed') $offsetHeight += $('#wpadminbar').height();
11781 			if($('body[data-hhun="0"] #header-outer').length > 0 && !($('body.mobile').length > 0 && $('#header-outer[data-mobile-fixed="false"]').length > 0) ) { 
11782 				$offsetHeight += $headerHeight;
11783 			}
11784 			 if($('.body-border-top').length > 0 && $(window).width() > 1000 && $('body[data-hhun="1"]').length > 0) $offsetHeight += $('.body-border-top').height();
11785 		
11786		    this.waypoint = new Waypoint($.extend({}, this.options, {
11787		      element: this.wrapper,
11788		      handler: $.proxy(function(direction) {
11789		        var shouldBeStuck = this.options.direction.indexOf(direction) > -1
11790		        var wrapperHeight = shouldBeStuck ? this.$element.outerHeight(true) : ''
11791
11792		        this.$wrapper.height(wrapperHeight)
11793		        if(shouldBeStuck) {
11794		        	this.$element.addClass('no-trans').css('top',$offsetHeight).css('transform','translateY(0)').addClass('stuck');
11795		        	var $that = this;
11796		        	setTimeout(function(){ $that.$element.removeClass('no-trans'); },50);
11797		        	this.$element.parents('.wpb_row').css('z-index',10000);
11798
11799		        	//boxed
11800		        	if($('#boxed').length > 0) { 
11801		        		var $negMargin = ($(window).width() > 1000) ? $('.container-wrap').width()*0.04 :39;
11802		        		this.$element.css({'margin-left':'-'+$negMargin+'px', 'width' : $('.container-wrap').width()});
11803		        	}
11804
11805		        }
11806		        else { 
11807		        	this.$element.css('top','0').removeClass('stuck');
11808
11809		       	    if($('#boxed').length > 0) this.$element.css({'margin-left':'0px', 'width' : '100%'});
11810		       	}
11811
11812		        if (originalHandler) {
11813		          originalHandler.call(this, direction)
11814		        }
11815		      }, this),
11816		      offset: $offsetHeight
11817		    }))
11818
11819		    var $that = this;
11820
11821			    setInterval(function(){ 
11822
11823			    	if($('body[data-hhun="1"] #header-outer.detached:not(.invisible)').length > 0)
11824		        		$that.waypoint.options.offset = $offsetHeight + $headerHeight;
11825		        	else 
11826		        		$that.waypoint.options.offset = $offsetHeight;
11827			    	Waypoint.refreshAll();
11828			
11829			    },100); 
11830			
11831
11832		  }
11833
11834		  /* Private */
11835		  Sticky.prototype.createWrapper = function() {
11836		    if (this.options.wrapper) {
11837		      this.$element.wrap(this.options.wrapper)
11838		    }
11839		    this.$wrapper = this.$element.parent()
11840		    this.wrapper = this.$wrapper[0]
11841		  }
11842
11843		  /* Public */
11844		  Sticky.prototype.destroy = function() {
11845		    if (this.$element.parent()[0] === this.wrapper) {
11846		      this.waypoint.destroy()
11847		      this.$element.removeClass(this.options.stuckClass)
11848		      if (this.options.wrapper) {
11849		        this.$element.unwrap()
11850		      }
11851		    }
11852		  }
11853
11854		  Sticky.defaults = {
11855		    wrapper: '<div class="sticky-wrapper" />',
11856		    stuckClass: 'stuck',
11857		    direction: 'down right'
11858		  }
11859
11860		  Waypoint.Sticky = Sticky
11861		}())
11862		;
11863
11864		//remove outside of column setups 
11865		if($('.page-submenu').parents('.span_12').find('> .wpb_column').length > 1){
11866			var pageMenu = $('.page-submenu').clone();
11867			var pageMenuParentRow = $('.page-submenu').parents('.wpb_row');
11868			$('.page-submenu').remove();
11869			pageMenuParentRow.before(pageMenu);
11870		}
11871
11872		var sticky = new Waypoint.Sticky({
11873		  element: $('.page-submenu[data-sticky="true"]')[0]
11874		});
11875
11876
11877	}
11878
11879	if($('#nectar_fullscreen_rows').length == 0)
11880		$('.page-submenu').parents('.wpb_row').css('z-index',10000);
11881
11882	$('.page-submenu .mobile-menu-link').on('click',function(){
11883		$(this).parents('.page-submenu').find('ul').stop(true).slideToggle(350);
11884		return false;
11885	});
11886
11887	$('.page-submenu ul li a').on('click',function(){
11888		if($('body.mobile').length > 0) $(this).parents('.page-submenu').find('ul').stop(true).slideToggle(350);
11889	});
11890
11891
11892	//responsive nav
11893	$('body').on('click','#toggle-nav',function(){
11894		if(window.innerWidth > 1000) {
11895			window.scrollTo(0,0);	
11896		}
11897
11898		$(this).find('.lines-button').toggleClass('close');
11899		
11900		
11901		if( $('body').hasClass('classic_mobile_menu_open') ) {
11902			
11903			$('#mobile-menu').hide();
11904			$('body').removeClass('classic_mobile_menu_open');
11905			
11906		} else {
11907			
11908			if($('#header-outer[data-transparent-header="true"][data-permanent-transparent="1"][data-mobile-fixed="false"].transparent').length > 0) {
11909				$('#mobile-menu').css({
11910					'top': parseInt($('#header-outer').outerHeight() + nectarDOMInfo.adminBarHeight) + 'px' ,
11911					'position': 'absolute',
11912					'width': '100%',
11913					'left': '0' 
11914				});
11915			}
11916			
11917			$('#mobile-menu').show();
11918			$('body').addClass('classic_mobile_menu_open');
11919			
11920		}
11921		
11922		
11923		return false;
11924	});
11925	
11926	
11927	//add wpml to mobile menu
11928	if($('header#top nav > ul > li.menu-item-language').length > 0 && $('#header-secondary-outer ul > li.menu-item-language').length == 0){
11929		var $langSelector = $('header#top nav > ul > li.menu-item-language').clone();
11930		$langSelector.insertBefore('#mobile-menu ul #mobile-search');
11931	}
11932	
11933	////append dropdown indicators / give classes
11934	$('#mobile-menu .container ul li').each(function(){
11935		if($(this).find('> ul').length > 0) {
11936			 $(this).addClass('has-ul');
11937			 $(this).find('> a').append('<span class="sf-sub-indicator"><i class="icon-angle-down"></i></span>');
11938		}
11939	});
11940	
11941	////events
11942	$('#mobile-menu .container ul li:has(">ul") > a .sf-sub-indicator').on('click',function(e){
11943		$(this).parent().parent().toggleClass('open');
11944		$(this).parent().parent().find('> ul').stop(true,true).slideToggle();
11945		return false;
11946	});
11947	
11948
11949
11950/*-------------------------------------------------------------------------*/
11951/*	5.	Page Specific
11952/*-------------------------------------------------------------------------*/	
11953	
11954	function vcFullHeightRow() {
11955        var $element = $(".vc_row-o-full-height:first");
11956        if ($element.length) {
11957            var $window, windowHeight, offsetTop, fullHeight;
11958            $window = $(window), 
11959            windowHeight = $window.height();
11960
11961            $(".vc_row-o-full-height").each(function(){
11962            	offsetTop = $(this).offset().top;
11963
11964            	var $realRowIndex = ($(this).parent().hasClass('vc_ie-flexbox-fixer')) ? $(this).parent().index() : $(this).index();
11965
11966            	if(offsetTop < windowHeight && $(this).hasClass('top-level') && !nectarDOMInfo.usingFrontEndEditor) {
11967            		fullHeight = 100 - offsetTop / (windowHeight / 100);
11968          	    	$(this).css("min-height", fullHeight + "vh");
11969          	    	$(this).find('> .col.span_12').css("min-height", fullHeight + "vh");
11970            	} else {
11971            		$(this).css("min-height", windowHeight);
11972            		$(this).find('> .col.span_12').css("min-height", windowHeight);
11973            	}
11974          	   
11975            });
11976
11977            
11978        }
11979
11980    }
11981    function fixIeFlexbox() {
11982        var ua = window.navigator.userAgent,
11983            msie = ua.indexOf("MSIE ");
11984        (msie > 0 || navigator.userAgent.match(/Trident.*rv\:11\./)) && $(".vc_row-o-full-height").each(function() {
11985            "flex" === $(this).find('> .span_12').css("display") && $(this).wrap('<div class="vc_ie-flexbox-fixer"></div>')
11986        })
11987    }
11988    fixIeFlexbox();
11989
11990    vcFullHeightRow();
11991		
11992		if(!nectarDOMInfo.usingFrontEndEditor) {
11993			nectarLiquidBGs();
11994		}
11995
11996	//recent work
11997	function piVertCenter() {
11998		$('.portfolio-items  > .col').each(function(){
11999				
12000			//style 4
12001			$(this).find('.style-4 .work-info .bottom-meta:not(.shown)').stop().animate({
12002				'bottom' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px'
12003			},420,'easeOutCubic');
12004
12005			
12006		});	 
12007	}
12008	
12009	
12010	//ie8 width fix
12011	function ie8Width(){
12012		if( $(window).width() >= 1300 ) {
12013			$('.container').css('max-width','1100px');
12014		} else {
12015			$('.container').css('max-width','880px');
12016		}
12017	}
12018	
12019	if( $(window).width() >= 1300 && $('html').hasClass('no-video')) { $('.container').css('max-width','1100px'); $(window).resize(ie8Width); };
12020	
12021
12022
12023	function smartResizeInit() {
12024		
12025		 //carousel height calcs
12026		 carouselHeightCalcs();
12027		 clientsCarouselHeightRecalc();
12028
12029		 //portfolio comment order
12030		 portfolioCommentOrder();
12031		 
12032		 //testimonial slider height
12033		 testimonialHeightResize(); //animated
12034		 testimonialSliderHeight(); //non-animated
12035		 
12036		 //full width content columns sizing
12037		 fullWidthContentColumns();
12038		 
12039		 //parallax BG Calculations
12040		 parallaxRowsBGCals();
12041		 
12042		
12043		 vcFullHeightRow();
12044		 headerSpace();
12045
12046		 centeredLogoMargins();
12047
12048		 slideOutWidgetOverflowState();
12049		 recentPostHeight();
12050
12051		 morphingOutlines();
12052
12053		 flipBoxHeights();
12054
12055		 showOnLeftSubMenu();
12056
12057		 //minimal alt effect
12058		if($('.tabbed[data-style="minimal_alt"]').length > 0) {
12059			 magicLineCalc($('.tabbed[data-style="minimal_alt"] > ul > li > a.active-tab'));
12060		}
12061		
12062	}
12063
12064  $(window).off('smartresize.srInit'); 
12065	$(window).on('smartresize.srInit', smartResizeInit); 
12066	
12067	
12068	var $usingNectarCarouselFlk = ($('.nectar-carousel.nectar-flickity:not(.masonry)').length > 0) ? true : false;
12069	
12070	function resizeInit() {
12071		 portfolioDeviceCheck();
12072
12073		 //fullwidth page section calcs
12074		 fullWidthSections(); 
12075		 fullwidthImgOnlySizing();
12076		 fullWidthContentColumns();
12077		 if(nectarDOMInfo.usingMobileBrowser) {
12078		  fullWidthRowPaddingAdjustCalc();
12079		}
12080		 
12081		 //iframe video emebeds
12082		 responsiveVideoIframes();
12083		 
12084		 //parallax BG Calculations
12085		 if(!nectarDOMInfo.usingMobileBrowser){
12086		   parallaxRowsBGCals();
12087		 }
12088		 
12089		 testimonialSliderHeightMinimalMult();
12090		 if($usingNectarCarouselFlk) {
12091			 setNectarCarouselFlkEH();
12092		 }
12093		 
12094		 if($('.nectar-social.full-width').length > 0) {
12095		 	nectarLoveFWCenter();
12096		 }
12097
12098		 if($('body').hasClass('ascend') ){ 
12099			searchFieldCenter();
12100		 }
12101
12102		 if($('body').hasClass('single-post')) { centerPostNextButtonImg(); }
12103
12104		 cascadingImageBGSizing();
12105
12106		 responsiveTooltips();
12107
12108		 //vc mobile columns
12109		 if($('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) { vcMobileColumns(); }
12110
12111		 if($('body[data-footer-reveal="1"]').length > 0 || $('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length > 0) { footerRevealCalcs(); }
12112
12113		 if($('#page-header-bg').length > 0) { pageHeader(); }
12114
12115		 if($('.nectar-video-bg').length > 0) {
12116		 	resizeVideoToCover();
12117		 }
12118	}
12119
12120	$(window).off('resize.srInit'); 
12121	$(window).on('resize.srInit', resizeInit); 
12122	
12123	
12124	$(window).load(function(){
12125		
12126		if($(window).scrollTop() == 0 ) { headerSpace(); }
12127		setTimeout(portfolioSidebarFollow,200);
12128		
12129		$('video').css('visibility','visible');
12130		
12131		if($('body[data-animated-anchors="true"]').length > 0) { 
12132				if($('.nectar-box-roll').length == 0 && $('#nectar_fullscreen_rows').length == 0) { 
12133					
12134					//inside tabs
12135					if( typeof $_GET['tab'] != 'undefined' ) {
12136							setTimeout(function(){
12137								pageLoadHash(); 
12138							},500);
12139					} 
12140					//regular
12141					else {
12142						pageLoadHash(); 
12143					}
12144					
12145				}
12146				
12147				if($('#nectar_fullscreen_rows[data-mobile-disable="on"]').length > 0 && $('.nectar-box-roll').length == 0 && nectarDOMInfo.usingMobileBrowser) {
12148					pageLoadHash();
12149				}
12150		}
12151		
12152		parallaxRowsBGCals();
12153		portfolioCommentOrder();
12154		fullWidthContentColumns();
12155		resizeVideoToCover();
12156
12157	});
12158
12159
12160	$(window).on("orientationchange",function(){
12161	  setTimeout(clientsCarouselHeightRecalc,200);
12162	});
12163	
12164	//blog next post button
12165	function postNextButtonEffect(){
12166
12167		$('.blog_next_prev_buttons').imagesLoaded(function(){
12168
12169			centerPostNextButtonImg();
12170			
12171			$('.blog_next_prev_buttons img').css('opacity','1');
12172
12173		});
12174	}
12175
12176	function centerPostNextButtonImg(){
12177		
12178		if($('.blog_next_prev_buttons').length == 0) return false;
12179
12180		if( $('.blog_next_prev_buttons img').height() >= $('.blog_next_prev_buttons').height() + 50 ) {
12181			var $height = 'auto';
12182			var $width = $('.blog_next_prev_buttons').width();
12183		} else {
12184
12185			if( $('.blog_next_prev_buttons').width() < $('.blog_next_prev_buttons img').width()) {
12186				var $height = $('.blog_next_prev_buttons').height() + 49;
12187				var $width = 'auto';
12188			} else {
12189				var $height = 'auto';
12190				var $width = '100%';
12191			}
12192			
12193		}
12194
12195		$('.blog_next_prev_buttons img').css({ 'height' : $height, 'width': $width });
12196
12197		$('.blog_next_prev_buttons img').css({
12198			'top' : ($('.blog_next_prev_buttons').height()/2) - ($('.blog_next_prev_buttons img').height()/2) + 'px',
12199			'left' : ($('.blog_next_prev_buttons').width()/2) - ($('.blog_next_prev_buttons img').width()/2) + 'px'
12200		});
12201
12202		$('.blog_next_prev_buttons .inner').each(function(){
12203			$(this).css({'top': $(this).parent().height()/2 - ($(this).height()/2), 'opacity':'1' });
12204		})
12205	}
12206	
12207	postNextButtonEffect();
12208
12209
12210	function recentPostHeight() {
12211		$('.blog-recent[data-style="title_only"]').each(function(){
12212			if($(this).find('> .col').length > 1) return false;
12213			if($(this).parent().parent().parent().hasClass('vc_col-sm-3') || 
12214				$(this).parent().parent().parent().hasClass('vc_col-sm-4') || 
12215				$(this).parent().parent().parent().hasClass('vc_col-sm-6') || 
12216				$(this).parent().parent().parent().hasClass('vc_col-sm-8') || 
12217				$(this).parent().parent().parent().hasClass('vc_col-sm-9')) {
12218				
12219				if($('body.mobile').length == 0 && $(this).next('div').length == 0) {
12220					var tallestColumn = 0;
12221					
12222					$(this).find('> .col').css('padding', '50px 20px');
12223
12224					$(this).parents('.span_12').find(' > .wpb_column').each(function(){
12225						(Math.floor($(this).height()) > tallestColumn) ? tallestColumn = Math.floor($(this).height()) : tallestColumn = tallestColumn;
12226					});	
12227			
12228					if(Math.floor($(this).find('> .col').outerHeight(true)) < Math.floor($(this).parents('.wpb_row').height()) - 1) {
12229						$(this).find('> .col').css('padding-top',(tallestColumn-$(this).find('> .col').height())/2 + 'px');
12230						$(this).find('> .col').css('padding-bottom',(tallestColumn-$(this).find('> .col').height())/2 + 'px');
12231					}
12232					
12233				}
12234				 else {
12235				 		$(this).find('> .col').css('padding', '50px 20px');
12236				}
12237			}
12238		});
12239	}
12240	recentPostHeight();
12241
12242
12243	//recent post slider
12244	function recentPostsFlickityInit() {
12245
12246		//classic enhanced specific 
12247    $('.blog-recent[data-style="classic_enhanced_alt"] .inner-wrap').each(function(){
12248        	$(this).find('.post-featured-img').each(function(){
12249				var $src = $(this).find('img').attr('src');
12250				$(this).css('background-image','url('+$src+')');
12251			});
12252        });
12253		$('.blog-recent[data-style="classic_enhanced"]').each(function(){
12254			if($(this).find('.inner-wrap.has-post-thumbnail').length == 0) {
12255				$(this).addClass('no-thumbs');
12256			}
12257		});
12258
12259		if($('.nectar-recent-posts-slider-inner').length > 0) {
12260		
12261			var $rpFGroupCells = ($('.nectar-recent-posts-slider_multiple_visible').length > 0) ? '90%' : false;
12262			
12263			var $rpF = $('.nectar-recent-posts-slider-inner').flickity({
12264				  contain: true,
12265					groupCells: $rpFGroupCells,
12266				  draggable: true,
12267				  lazyLoad: false,
12268				  imagesLoaded: true,
12269				  percentPosition: true,
12270				  prevNextButtons: false,
12271				  pageDots: true,
12272				  resize: true,
12273				  setGallerySize: true,
12274				  wrapAround: true,
12275				  accessibility: false
12276			});
12277			
12278			setTimeout(function(){
12279				$('.nectar-recent-posts-slider-inner').addClass('loaded');
12280			},1150);
12281			var flkty = $rpF.data('flickity');
12282			
12283			$rpF.on( 'dragStart.flickity', function() {
12284				$('.flickity-viewport').addClass('is-moving');
12285			});
12286			
12287			$rpF.on( 'dragEnd.flickity', function() {
12288				$('.flickity-viewport').removeClass('is-moving');
12289			});
12290			
12291			var $dragTimeout;
12292			
12293			$rpF.on( 'select.flickity', function() {
12294
12295				  $('.flickity-viewport').addClass('no-hover');
12296				  clearTimeout( $dragTimeout);
12297				   $dragTimeout = setTimeout(function(){ $('.flickity-viewport').removeClass('no-hover'); },400);
12298			 
12299			});
12300			
12301			
12302	  
12303			recentPostSliderHeight();
12304			$(window).resize(recentPostSliderHeight);
12305
12306			if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/) && ! nectarDOMInfo.usingFrontEndEditor) {
12307				$(window).resize(recentPostSliderParallaxMargins);
12308			}
12309
12310			function recentPostSliderHeight(){
12311
12312				$('.nectar-recent-posts-slider').each(function(){
12313						
12314							var $heightCalc;
12315							var $minHeight = 250;
12316							var $windowWidth = $(window).width();
12317							var $definedHeight = parseInt($(this).attr('data-height'));
12318
12319							var dif = ($('body[data-ext-responsive="true"]').length > 0) ? $(window).width() / 1400 : $(window).width() / 1100;
12320
12321							if( window.innerWidth > 1000 && $('#boxed').length == 0) {
12322
12323								if($(this).parents('.full-width-content').length == 0) {
12324									if($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1400){
12325										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight));
12326									} else if($('body[data-ext-responsive="true"]').length == 0 && window.innerWidth >= 1100) {
12327										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.
12327ceil($definedHeight));
12328									} else {
12329										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
12330									}
12331									
12332								} else {
12333									$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
12334								}
12335								
12336							} else {
12337								
12338								//column sliders
12339								var $parentCol = ($(this).parents('.wpb_column').length > 0) ? $(this).parents('.wpb_column') : $(this).parents('.col') ;
12340								if($parentCol.length == 0) $parentCol = $('.main-content');
12341									
12342								if(!$parentCol.hasClass('vc_span12') && !$parentCol.hasClass('main-content') && !$parentCol.hasClass('span_12') && !$parentCol.hasClass('vc_col-sm-12') ) {
12343								
12344									var $parentColWidth = sliderColumnDesktopWidth($parentCol);
12345									var $aspectRatio = $definedHeight/$parentColWidth;
12346
12347									
12348									//min height
12349									if( $aspectRatio*$parentCol.width() <= $minHeight ){
12350										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$minHeight);
12351									} else {
12352										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$aspectRatio*$parentCol.width());
12353									}
12354								  
12355								} 
12356								
12357								//regular
12358								else {
12359									
12360									//min height
12361									if( $definedHeight*dif <= $minHeight ){
12362										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$minHeight);
12363									} else {
12364										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
12365									}
12366									
12367								}
12368								
12369							}
12370							
12371		
12372						
12373					});
12374			
12375			}
12376
12377			////helper function
12378			function sliderColumnDesktopWidth(parentCol) {
12379				
12380				var $parentColWidth = 1100;
12381				var $columnNumberParsed = $(parentCol).attr('class').match(/\d+/);
12382				
12383				if($columnNumberParsed == '2') { $parentColWidth = 170 }
12384				else if($columnNumberParsed == '3') { $parentColWidth = 260 } 
12385				else if($columnNumberParsed == '4') { $parentColWidth = 340 } 
12386				else if($columnNumberParsed == '6') { $parentColWidth = 530 } 
12387				else if($columnNumberParsed == '8') { $parentColWidth = 700 } 
12388				else if($columnNumberParsed == '9') { $parentColWidth = 805 }
12389				else if($columnNumberParsed == '10') { $parentColWidth = 916.3 }
12390				else if($columnNumberParsed == '12') { $parentColWidth = 1100 }
12391			
12392				return $parentColWidth;
12393			}
12394		
12395		}//if using rp slider
12396		
12397		
12398		//multiple featured controls
12399		
12400		function multipleLargeFeaturedInit() {
12401			 $('.nectar-recent-posts-single_featured.multiple_featured').each(function(sliderIndex){
12402					 if($(this).find('> .normal-container').length > 0) {
12403					 	$(this).find('> .normal-container').remove();
12404					}
12405				 	$(this).append('<div class="normal-container container"> <ul class="controls" data-color="' + $(this).attr('data-button-color') + '" data-num="'+ $(this).find('.nectar-recent-post-slide').length +'"></ul> </div>');
12406					var $that = $(this);
12407					
12408					//store instance
12409					$nectarCustomSliderRotate[sliderIndex] = { autorotate: '' };
12410					
12411					var tallestFeaturedSlide = 0;
12412					$(this).find('.nectar-recent-post-slide').each(function(i){
12413						
12414						if($(this).find('.recent-post-container').height() > tallestFeaturedSlide) {
12415							$(this).siblings().removeClass('tallest');
12416							$(this).addClass('tallest');
12417							tallestFeaturedSlide = $(this).find('.recent-post-container').height();
12418						} 
12419						
12420						var $activeClass = (i == 0 && $(this).parents('.nectar-recent-posts-single_featured.multiple_featured[data-autorotate="none"]').length > 0) ? 'class="active"': '';
12421						 $that.find('.controls').append('<li '+$activeClass+'><span class="title">'+ $(this).find('h2').text() +'</span></li>');
12422					});
12423					
12424					$(this).addClass('js-loaded');
12425					
12426					var $slideClickTimeout;
12427					
12428					//click Functionality
12429					$(this).find('.controls li').on('click',function(e){
12430						
12431							if($(this).hasClass('active')) 
12432								return;
12433								
12434							if(e.originalEvent !== undefined)
12435								$(this).parent().find('.active').addClass('trans-out');
12436							
12437							var $index = $(this).index();
12438							var $oldIndex = $(this).parent().find('.active').index();
12439							var $that = $(this);
12440							
12441							clearTimeout($slideClickTimeout);
12442							
12443							$(this).siblings().removeClass('active');
12444							$(this).addClass('active');
12445							$slideClickTimeout = setTimeout( function() { 
12446								$that.parents('.multiple_featured').find('.nectar-recent-post-slide:not(:eq('+$index+'))').css('opacity','0').removeClass('active');
12447								$that.parent().find('.trans-out').removeClass('trans-out');
12448							}, 300);
12449							$that.parents('.multiple_featured').find('.nectar-recent-post-slide:not(:eq('+$index+'))').css('z-index','10');
12450							$that.parents('.multiple_featured').find('.nectar-recent-post-slide:eq('+$oldIndex+')').css('z-index','15');
12451							
12452							$(this).parents('.multiple_featured').find('.nectar-recent-post-slide').eq($index).css({'opacity':'1', 'z-index':'20'}).addClass('active');
12453							
12454							if($(this).parents('.multiple_featured').attr('data-autorotate') != 'none') {
12455								nectarCustomSliderResetRotate($that.parents('.nectar-recent-posts-single_featured.multiple_featured'),sliderIndex);
12456							}
12457					});
12458					
12459					
12460				//autorotate
12461				var $that = $(this);
12462				 if($(this).attr('data-autorotate').length > 0 && $(this).attr('data-autorotate') != 'none' && $('body.vc_editor').length == 0 ) {
12463					 
12464					 setTimeout(function(){
12465							 var slide_interval = (parseInt($that.attr('data-autorotate')) < 100) ? 4000 : parseInt($that.attr('data-autorotate'));
12466							 $nectarCustomSliderRotate[sliderIndex].autorotate = setInterval(function(){ nectarCustomSliderRotate($that) },slide_interval);
12467							 
12468							 //set first active class
12469							 $that.find('.controls > li:first-child').addClass('active');
12470
12471					 },30);
12472					 
12473				 }
12474				 
12475			 });
12476			 
12477			 splitLineText();
12478			 $(window).resize(splitLineText);
12479			 
12480
12481		}
12482		
12483		multipleLargeFeaturedInit();
12484	
12485	}
12486	
12487	recentPostsFlickityInit();
12488
12489	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) {
12490		if($('.nectar-recent-posts-slider').length > 0 && ! nectarDOMInfo.usingFrontEndEditor) {
12491			window.requestAnimationFrame(recentPostSliderParallax);
12492		}
12493	}
12494	
12495	function recentPostSliderParallax(){
12496
12497		$('.nectar-recent-posts-slider').each(function(){
12498			var $offset = parseInt($(this).find('.flickity-slider').position().left);
12499			var $slideLength = $(this).find('.nectar-recent-post-slide').length;
12500			var $lastChildIndex = $(this).find('.nectar-recent-post-slide:last-child').index();
12501			var $slideWidth = $(this).find('.nectar-recent-post-slide').width();
12502			//wrapped fix
12503
12504			////first going to first
12505			if($offset >= -3) {
12506				$(this).find('.nectar-recent-post-slide:last-child .nectar-recent-post-bg').css('margin-left',parseInt(Math.ceil($slideWidth/3.5))+'px');
12507			} else {
12508				$(this).find('.nectar-recent-post-slide:last-child .nectar-recent-post-bg').css('margin-left','-'+parseInt(Math.ceil($slideWidth/3.5*$lastChildIndex))+'px');
12509			}
12510			////last going to first
12511			if(Math.abs($offset) >= ($slideLength-1) * $slideWidth) {
12512				$(this).find('.nectar-recent-post-slide:first-child .nectar-recent-post-bg').css('margin-left','-'+parseInt(Math.ceil(($slideWidth/3.5)*$slideLength))+'px');
12513			} else {
12514				$(this).find('.nectar-recent-post-slide:first-child .nectar-recent-post-bg').css('margin-left','0px');
12515			}
12516
12517			$(this).find('.nectar-recent-post-bg').css('transform','translateX('+Math.ceil($(this).find('.flickity-slider').position().left/-3.5)+'px)');
12518			
12519			
12520		});
12521		requestAnimationFrame(recentPostSliderParallax);
12522	}
12523
12524	function recentPostSliderParallaxMargins(){
12525
12526		$('.nectar-recent-posts-slider').each(function(){		
12527			var $slideWidth = $(this).find('.nectar-recent-post-slide').width();
12528			$(this).find('.nectar-recent-post-slide').each(function(i){
12529				$(this).find('.nectar-recent-post-bg').css('margin-left','-'+  parseInt(Math.ceil($slideWidth/3.5)*i)+'px');
12530			});
12531		
12532		});
12533	}
12534
12535	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/) && ! nectarDOMInfo.usingFrontEndEditor) {
12536		recentPostSliderParallaxMargins();
12537	}
12538
12539	//portfolio item hover effect
12540	
12541	////desktop event 
12542	function portfolioHoverEffects() { 
12543
12544		if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(iPad|IEMobile)/)) {
12545			
12546			//style 1 & 2
12547			$('.portfolio-items:not([data-ps="7"]) .col .work-item:not(.style-3-alt):not(.style-3):not([data-custom-content="on"])').on('mouseenter',function(){
12548				$(this).find('.work-info .vert-center').css({'margin-top' : 0});
12549				$(this).find('.work-info, .work-info .vert-center > *, .work-info > i').css({'opacity' : 1});
12550				$(this).find('.work-info-bg').css({ 'opacity' : 0.9 });
12551			});
12552			$('.portfolio-items:not([data-ps="7"]) .col .work-item:not(.style-3-alt):not(.style-3):not([data-custom-content="on"])').on('mouseleave',function(){	
12553				$(this).find('.work-info .vert-center').css({ 'margin-top' : -20 });
12554				$(this).find('.work-info, .work-info .vert-center > *:not(.mfp-figure), .work-info > i').css({ 'opacity' : 0 });
12555				$(this).find('.work-info-bg').css({ 'opacity' : 0 });
12556			});
12557			
12558			
12559			//style 3
12560			$('.portfolio-items .col .work-item.style-3').on('mouseenter',function(){
12561				$(this).find('.work-info-bg').css({ 'opacity' : 0 });
12562			});
12563			$('.portfolio-items .col .work-item.style-3').on('mouseleave',function(){
12564				$(this).find('.work-info-bg').css({ 'opacity' : 0.45 });
12565			});
12566			
12567			
12568			//style 4
12569			$('.portfolio-items .col .work-item.style-4').on('mouseenter',function(){
12570				$(this).find('img').stop().animate({
12571					'top' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()/2+'px'
12572				},250,'easeOutCubic');
12573				
12574				$(this).find('.work-info .bottom-meta').addClass('shown').stop().animate({
12575					'bottom' : '0px'
12576				},320,'easeOutCubic');
12577
12578			});
12579			$('.portfolio-items .col .work-item.style-4').on('mouseleave',function(){
12580				$(this).find('img').stop().animate({
12581					'top' : '0px'
12582				},250,'easeOutCubic');
12583				
12584				$(this).find('.work-info .bottom-meta').removeClass('shown').stop().animate({
12585					'bottom' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px'
12586				},320,'easeOutCubic');
12587				
12588			});
12589		
12590		} 
12591		////mobile event
12592		else {
12593			portfolioDeviceCheck();
12594		}
12595
12596	}
12597
12598	portfolioHoverEffects();
12599
12600	function style6Img(){
12601  
12602		//change sizer pos
12603		$('.style-5').each(function(){
12604			$(this).find('.sizer').insertBefore($(this).find('.parallaxImg'));
12605		});
12606
12607		//set parent zindex
12608		$('.style-5').parents('.wpb_row').css('z-index','100');
12609
12610		var d = document,
12611			de = d.documentElement,
12612			bd = d.getElementsByTagName('body')[0],
12613			htm = d.getElementsByTagName('html')[0],
12614			win = window,
12615			imgs = d.querySelectorAll('.parallaxImg'),
12616			totalImgs = imgs.length,
12617			supportsTouch = 'ontouchstart' in win || navigator.msMaxTouchPoints;
12618
12619		if(totalImgs <= 0){
12620			return;
12621		}
12622
12623		// build HTML
12624		for(var l=0;l<totalImgs;l++){
12625
12626			var thisImg = imgs[l],
12627				layerElems = thisImg.querySelectorAll('.parallaxImg-layer'),
12628				totalLayerElems = layerElems.length;
12629
12630			if(totalLayerElems <= 0){
12631				continue;
12632			}
12633
12634			while(thisImg.firstChild) {
12635				thisImg.removeChild(thisImg.firstChild);
12636			}
12637			
12638			var lastMove = 0;
12639
12640			//throttle performance for all browser other than chrome
12641			var eventThrottle = $('html').hasClass('cssreflections') ? 1 : 80;
12642			if(eventThrottle == 80) $('body').addClass('cssreflections');
12643
12644			var containerHTML = d.createElement('div'),
12645				shineHTML = d.createElement('div'),
12646				shadowHTML = d.createElement('div'),
12647				layersHTML = d.createElement('div'),
12648				layers = [];
12649
12650			thisImg.id = 'parallaxImg__'+l;
12651			containerHTML.className = 'parallaxImg-container';
12652			//shineHTML.className = 'parallaxImg-shine';
12653			shadowHTML.className = 'parallaxImg-shadow';
12654			layersHTML.className = 'parallaxImg-layers';
12655
12656			for(var i=0;i<totalLayerElems;i++){
12657				var layer = d.createElement('div'),
12658					layerInner = d.createElement('div'),
12659					imgSrc = layerElems[i].getAttribute('data-img');
12660
12661				$(layer).html($(layerElems[i]).html());
12662				layer.className = 'parallaxImg-rendered-layer';
12663				layer.setAttribute('data-layer',i);
12664
12665				if(i==0 && $(thisImg).parents('.wpb_gallery').length == 0) { 
12666					layerInner.className = 'bg-img';
12667					layerInner.style.backgroundImage = 'url('+imgSrc+')';
12668					layer.appendChild(layerInner);
12669				}
12670				layersHTML.appendChild(layer);
12671
12672				layers.push(layer);
12673			}
12674
12675			containerHTML.appendChild(layersHTML);
12676			thisImg.appendChild(containerHTML);
12677			$(thisImg).wrap('<div class="parallaxImg-wrap" />');
12678			if(!(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1)) { $(thisImg).parent().append(shadowHTML); }
12679
12680			var w = thisImg.clientWidth || thisImg.offsetWidth || thisImg.scrollWidth;
12681
12682			if(supportsTouch && $('body.using-mobile-browser').length > 0 ){
12683				
12684		    } else {
12685		    	(function(_thisImg,_layers,_totalLayers,_shine) {
12686					$(thisImg).parents('.style-5').on('mousemove', function(e){
12687						
12688						var parentEl = $(this);
12689					 	var now = Date.now();
12690				        if (now > lastMove + eventThrottle) {
12691				            lastMove = now;
12692							window.requestAnimationFrame(function(){
12693								processMovement(e,false,_thisImg,_layers,_totalLayers,_shine,parentEl);		
12694							});
12695						}
12696
12697
12698					});
12699		            $(thisImg).parents('.style-5').on('mouseenter', function(e){
12700						processEnter(e,_thisImg,_layers,_totalLayers,_shine);		
12701					});
12702					$(thisImg).parents('.style-5').on('mouseleave', function(e){
12703						processExit(e,_thisImg,_layers,_totalLayers,_shine);		
12704					});
12705		        })(thisImg,layers,totalLayerElems,shineHTML);
12706		    }
12707
12708		    //set the depths
12709		    (function(_thisImg,_layers,_totalLayers,_shine) {
12710			    depths(false,_thisImg,_layers,_totalLayers,_shine);
12711			     window.addEventListener('resize', function(e){
12712			    	  depths(false,_thisImg,_layers,_totalLayers,_shine);
12713			    });
12714			 })(thisImg,layers,totalLayerElems,shineHTML);
12715		}
12716
12717		function processMovement(e, touchEnabled, elem, layers, totalLayers, shine, parentEl){
12718			
12719			//stop raf if exit already called
12720			if(!$(elem.firstChild).hasClass('over')) { processExit(e,elem,layers,totalLayers,shine); return false }
12721
12722			//set up multipliers
12723
12724			if($(elem).parents('.col.wide').length > 0 ) {
12725				var yMult = 0.03;
12726				var xMult = 0.063;
12727			} else if( $(elem).parents('.col.regular').length > 0  || $(elem).parents('.wpb_gallery').length > 0) {
12728				var yMult = 0.045;
12729				var xMult = 0.045;
12730			} else if($(elem).parents('.col.tall').length > 0 ) {
12731				var yMult = 0.05;
12732				var xMult = 0.015;
12733			} else if($(elem).parents('.col.wide_tall').length > 0) {
12734				var yMult = 0.04;
12735				var xMult = 0.04;
12736			} else if(parentEl.hasClass('nectar-fancy-box')) {
12737				var yMult = 0.045;
12738				var xMult = 0.022;
12739			} else {
12740				var yMult = 0.045;
12741				var xMult = 0.075;
12742			}
12743			
12744			var bdst = $(window).scrollTop(),
12745				bdsl = bd.scrollLeft,
12746				pageX = (touchEnabled)? e.touches[0].pageX : e.pageX,
12747				pageY = (touchEnabled)? e.touches[0].pageY : e.pageY,
12748				offsets = elem.getBoundingClientRect(),
12749				w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth, // width
12750				h = elem.clientHeight || elem.offsetHeight || elem.scrollHeight, // height
12751				wMultiple = 320/w,
12752				offsetX = 0.52 - (pageX - offsets.left - bdsl)/w, //cursor position X
12753				offsetY = 0.52 - (pageY - offsets.top - bdst)/h, //cursor position Y
12754				dy = (pageY - offsets.top - bdst) - h / 2, //@h/2 = center of container
12755				dx = (pageX - offsets.left - bdsl) - w / 2, //@w/2 = center of container
12756				yRotate = (offsetX - dx)*(yMult * wMultiple), //rotation for container Y
12757				xRotate = (dy - offsetY)*(xMult * wMultiple); //rotation for container X //old
12758
12759				if($(elem).parents('.wpb_gallery').length > 0) {
12760					var imgCSS = ' perspective('+ w*3 +'px) rotateX(' + -xRotate*1.9 + 'deg) rotateY(' + -yRotate*1.3 + 'deg)'; //img transform	
12761				} else {
12762					if($(elem).parents('.wide_tall').length == 0 && $(elem).parents('.wide').length == 0 && $(elem).parents('.tall').length == 0) {
12763						var $scaleAmount = (parentEl.hasClass('nectar-fancy-box')) ? '1.06' : '1.03';
12764						var $offsetAmount = (parentEl.hasClass('nectar-fancy-box')) ? '-2' : '-10';
12765						
12766						var imgCSS = ' perspective('+ w*3 +'px) rotateX(' + xRotate 
12766+ 'deg) rotateY(' + yRotate + 'deg)  translateY('+offsetY*$offsetAmount+'px) translateX('+offsetX*$offsetAmount+'px) scale('+$scaleAmount+')'; //img transform
12767					} else {
12768						var imgCSS = ' perspective('+ w*3 +'px) rotateX(' + xRotate + 'deg) rotateY(' + yRotate + 'deg)  translateY('+offsetY*-10+'px) translateX('+offsetX*-10+'px) scale(1.013)'; //img transform	
12769					}
12770				}
12771
12772				
12773			//container transform
12774
12775
12776			$(elem).find('.parallaxImg-container').css('transform',imgCSS);
12777
12778			if(!(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1)) {
12779				$(elem).parents('.parallaxImg-wrap').find('.parallaxImg-shadow').css('transform',imgCSS);
12780			}
12781
12782			
12783		}
12784
12785		function processShineMovement(e, touchEnabled, elem, layers, totalLayers, shine){
12786
12787		}
12788
12789		function processEnter(e, elem, layers, totalLayers, shine){
12790
12791			elem.firstChild.className += ' over';
12792			elem.className += ' over';
12793
12794
12795				$(elem).addClass('transition');
12796
12797				if($(elem).parents('.wpb_gallery').length > 0) {
12798					var $timeout = setTimeout(function(){ $(elem).removeClass('transition'); },450);
12799				} else {
12800					var $timeout = setTimeout(function(){ $(elem).removeClass('transition'); },200);
12801				}
12802
12803		}
12804
12805		function processExit(e, elem, layers, totalLayers, shine){
12806
12807			var w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth;
12808			var container = elem.firstChild;
12809
12810			container.className = container.className.replace(' over','');
12811			elem.className = elem.className.replace(' over','');
12812			$(container).css('transform', 'perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0)');
12813			$(elem).parents('.parallaxImg-wrap').find('.parallaxImg-shadow').css('transform','perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0)');
12814
12815			$(elem).addClass('transition');
12816				var $timeout = setTimeout(function(){ $(elem).removeClass('transition'); },200);
12817
12818
12819		}
12820
12821		function depths(touchEnabled, elem, layers, totalLayers, shine) {
12822			
12823			var w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth;
12824			var revNum = totalLayers;
12825			var container = elem.firstChild;
12826			
12827			//set z
12828			for(var ly=0;ly<totalLayers;ly++){
12829				if(ly == 0) $(layers[ly]).css('transform', 'translateZ(0px)');
12830				else $(layers[ly]).css('transform','translateZ(' +(w*3)/27*(ly*1.1) + 'px) ');
12831
12832				revNum--;
12833			}
12834			
12835			totalLayers = totalLayers + 3;
12836
12837			//set perspective from beginning
12838			$(container).css('transform','perspective('+ w*3 +'px)');
12839
12840		}
12841
12842		function removeDepths(touchEnabled, elem, layers, totalLayers, shine) {
12843			
12844			var w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth;
12845			var revNum = totalLayers;
12846			
12847			//set z
12848			for(var ly=0;ly<totalLayers;ly++){
12849				
12850				if(ly == 0) $(layers[ly]).css('transform', 'translateZ(' +(w*3)/45*(ly*1.1) + 'px) scale(1)');
12851				else $(layers[ly]).css('transform', 'translateZ(' +(w*3)/45*(ly*1.1) + 'px) scale(1)');
12852
12853				revNum--;
12854			}
12855			
12856			totalLayers = totalLayers + 3;
12857			
12858		}
12859	}
12860
12861	style6Img();
12862
12863	function portfolioDeviceCheck(){
12864		if($('body').hasClass('mobile') || navigator.userAgent.match(/(iPad|IEMobile)/) ){
12865			
12866			//if using more details
12867			if($('.portfolio-items .col .work-item').find('a:not(".pp")').length > 0){
12868				$('.portfolio-items .col .work-item').find('a.pp').css('display','none');
12869			} 
12870			
12871			//if only using pp
12872			else {
12873				$('.portfolio-items .col .work-item').find('a:not(".pp")').css('display','none');
12874			}
12875		
12876		} else {
12877			$('.portfolio-items .col .work-item').find('a').css('display','inline');
12878		}
12879	}
12880	
12881	
12882	//portfolio fullscreen zoom slider
12883
12884	//remove outside of column setups 
12885	$('.nectar_fullscreen_zoom_recent_projects').each(function(){
12886		if($(this).parents('.span_12').find('> .wpb_column').length > 1){
12887			var $zoomProjects = $(this).clone();
12888			var $zoomProjectsRow = $(this).parents('.span_12');
12889			$(this).remove();
12890			$zoomProjectsRow.prepend($zoomProjects);
12891		}
12892	});
12893
12894	 $.fn.lines = function (opts) {
12895        var s = $.extend({
12896            'lineClass' : 'line'
12897        },opts);
12898        return this.each(function () {
12899            var self = this,
12900                $self = $(self),
12901                $line,
12902                $prev;
12903            $self.find('.' + s.lineClass).contents().unwrap();
12904            $self.html(function (i, h) {
12905                return h.replace(/(\b[\w']+\b)/g, '<span class="' + s.lineClass + '">$1</span>');
12906            });
12907
12908            $self.find('.line + .line').each(function(i, el){
12909                $line = $(this),
12910                $prev = $line.prev('.line');
12911                if ($line.offset().top === $prev.offset().top) {
12912                    $prev.append(el.previousSibling, $line.contents());
12913                    $line.remove();
12914                }
12915            });
12916        });
12917    };
12918
12919	function splitLineText() {
12920		$('.nectar_fullscreen_zoom_recent_projects, .nectar-recent-posts-single_featured.multiple_featured').each(function(){
12921			
12922			var $slideClass = ($(this).find('.project-slides').length > 0) ? '.project-slide' : '.nectar-recent-post-slide';
12923			var $slideInfoClass = ($(this).find('.project-slides').length > 0) ? '.project-info h1' : '.inner-wrap h2 a';
12924			
12925			$(this).find($slideClass).each(function(i){
12926				
12927				$(this).find($slideInfoClass).each(function(){
12928					
12929					var textArr = $(this).text();
12930		      textArr = textArr.trim();
12931		      textArr = textArr.split(' ');
12932		
12933		      $(this)[0].innerHTML = '';
12934		      
12935		      for(var i=0;i<textArr.length;i++) {
12936		          $(this)[0].innerHTML += '<span>'+ textArr[i] + '</span> ';
12937		      }
12938					
12939				});
12940
12941				$(this).find($slideInfoClass + ' > span').wrapInner('<span class="inner" />');
12942
12943			});
12944			
12945		});
12946		
12947	}
12948
12949	function portfolioFullScreenSliderCalcs() {
12950
12951		var $bodyBorderSize = ($('.body-border-top').length > 0 && $(window).width() > 1000) ? $('.body-border-top').height(): 0;
12952
12953		$('.nectar_fullscreen_zoom_recent_projects').each(function(){
12954			
12955			//frontend editor fix
12956			if(nectarDOMInfo.usingFrontEndEditor) {
12957				if($(this).parents('.wpb_row').parent().index() > 1) { $(this).parents('.first-section').removeClass('first-section'); }
12958			}
12959			
12960			if($(this).parents('.first-section').length > 0) {
12961				$(this).css('height',$(window).height() - $(this).offset().top - $bodyBorderSize);
12962			} else {
12963				$(this).css('height',$(window).height());
12964			}
12965		});
12966
12967	}
12968
12969				
12970	function nectarCustomSliderRotate(slider){
12971		
12972		if($('body.vc_editor').length > 0) { return; }
12973		
12974		var $controlSelector = (slider.find('.project-slides').length > 0) ? '.dot-nav > span' : '.controls > li';
12975		var $controlSelectorInd = (slider.find('.project-slides').length > 0) ? 'span' : ' li';
12976		
12977		var $slideLength = slider.find($controlSelector).length;
12978		var $currentSlide = slider.find($controlSelector+'.active').index();
12979		if( $currentSlide+1 == $slideLength) {
12980			slider.find($controlSelector+':first-child').click();
12981		} else {
12982			slider.find($controlSelector+'.active').next($controlSelectorInd).click();
12983		}
12984	}
12985	
12986	function nectarCustomSliderResetRotate(slider,index){
12987		clearInterval($nectarCustomSliderRotate[index].autorotate);
12988
12989		//reinit autorotate
12990		if(slider.attr('data-autorotate').length > 0) {
12991			var slide_interval = (parseInt(slider.attr('data-autorotate')) < 100) ? 4000 : parseInt(slider.attr('data-autorotate'));
12992			$nectarCustomSliderRotate[index].autorotate = setInterval(function(){ nectarCustomSliderRotate(slider) },slide_interval);
12993		}
12994	}
12995
12996
12997	if($('.nectar_fullscreen_zoom_recent_projects').length > 0){
12998		portfolioFullScreenSliderCalcs();
12999		splitLineText();
13000		$(window).resize(splitLineText);
13001		$(window).resize(portfolioFullScreenSliderCalcs);
13002	}
13003	
13004	
13005	function fsProjectSliderInit() {
13006		
13007		$('.nectar_fullscreen_zoom_recent_projects').each(function(recentProjectSliderIndex){
13008
13009			
13010			//store instance
13011			$nectarCustomSliderRotate[recentProjectSliderIndex] = { autorotate: '' };
13012			
13013			var $projLength = $(this).find('.project-slide').length;
13014			
13015			//autorotate
13016			if($(this).attr('data-autorotate').length > 0) {
13017				var slide_interval = (parseInt($(this).attr('data-autorotate')) < 100) ? 4000 : parseInt($(this).attr('data-autorotate'));
13018				var $that = $(this);
13019				$nectarCustomSliderRotate[recentProjectSliderIndex].autorotate = setInterval(function(){ nectarCustomSliderRotate($that) },slide_interval);
13020			}
13021
13022			//next/prev
13023			$(this).find('.zoom-slider-controls .next').on('click',function(e){
13024
13025				//thres
13026				
13027				var $that = $(this);
13028				if(!$that.parent().hasClass('timeout')) {
13029					setTimeout(function(){
13030						$that.parent().removeClass('timeout');
13031					},1150);
13032				}
13033
13034				if($(this).parent().hasClass('timeout')) return false;
13035				$(this).parent().addClass('timeout');
13036				//switch logic
13037
13038				nectarCustomSliderResetRotate($that.parents('.nectar_fullscreen_zoom_recent_projects'), recentProjectSliderIndex);
13039				
13040				var $current = $(this).parents('.nectar_fullscreen_zoom_recent_projects').find('.project-slide.current');
13041				var $sliderInstance = $(this).parents('.nectar_fullscreen_zoom_recent_projects');
13042
13043				$sliderInstance.find('.project-slide').removeClass('next').removeClass('prev');
13044				$sliderInstance.find('.project-slide').each(function(i){
13045
13046					if(i < $current.index()+1 && $current.index()+1 < $projLength)
13047						$(this).addClass('prev');
13048					else
13049						$(this).addClass('next');
13050				});
13051
13052				if($current.index()+1 == $projLength) {
13053					$sliderInstance.find('.project-slide:first-child').addClass('no-trans');
13054				}
13055
13056				setTimeout(function(){
13057
13058					if($current.index()+1 == $projLength) {
13059						$sliderInstance.find('.project-slide:first-child').removeClass('no-trans').removeClass('next').removeClass('prev').addClass('current');
13060						$sliderInstance.find('.project-slide:last-child').removeClass('next').removeClass('current').addClass('prev');
13061					} else {
13062						$current.next('.project-slide').removeClass('next').removeClass('prev').addClass('current');
13063						$current.removeClass('current').addClass('prev');
13064					}
13065
13066					//update dot nav
13067					if($sliderInstance.find('.dot-nav').length > 0) {
13068						$sliderInstance.find('.dot-nav span.active').removeClass('active');
13069						$sliderInstance.find('.dot-nav span:nth-child('+ ($sliderInstance.find('.project-slide.current').index() + 1) +')').addClass('active');
13070					}
13071
13072				},30);
13073
13074				return false;
13075				
13076			});
13077
13078			$(this).find('.zoom-slider-controls .prev').on('click',function(e){
13079
13080				//thres
13081				var $that = $(this);
13082				if(!$that.parent().hasClass('timeout')) {
13083					setTimeout(function(){
13084						$that.parent().removeClass('timeout');
13085					},1150);
13086				}
13087
13088				if($(this).parent().hasClass('timeout')) return false;
13089				$(this).parent().addClass('timeout');
13090				
13091				nectarCustomSliderResetRotate($that.parents('.nectar_fullscreen_zoom_recent_projects'), recentProjectSliderIndex);
13092
13093				//switch logic
13094				var $current = $(this).parents('.nectar_fullscreen_zoom_recent_projects').find('.project-slide.current');
13095				var $sliderInstance = $(this).parents('.nectar_fullscreen_zoom_recent_projects');
13096
13097				
13098				$sliderInstance.find('.project-slide').removeClass('next').removeClass('prev');
13099				$sliderInstance.find('.project-slide').each(function(i){
13100
13101					if(i < $current.index() || $current.index() == 0)
13102						$(this).addClass('prev');
13103					else
13104						$(this).addClass('next');
13105				});
13106
13107				if($current.index() == 0)
13108					$sliderInstance.find('.project-slide:last-child').addClass('no-trans');
13109
13110				setTimeout(function(){
13111
13112					if($current.index() == 0) {
13113						$sliderInstance.find('.project-slide:last-child').removeClass('no-trans').removeClass('next').removeClass('prev').addClass('current');
13114						$sliderInstance.find('.project-slide:first-child').removeClass('next').removeClass('prev').removeClass('current').addClass('next');
13115					} else {
13116						$current.prev('.project-slide').removeClass('next').removeClass('prev').addClass('current');
13117						$current.removeClass('current').addClass('next');
13118					}
13119
13120					//update dot nav
13121					if($sliderInstance.find('.dot-nav').length > 0) {
13122						$sliderInstance.find('.dot-nav span.active').removeClass('active');
13123						$sliderInstance.find('.dot-nav span:nth-child('+ ($sliderInstance.find('.project-slide.current').index() + 1) +')').addClass('active');
13124					}
13125
13126				},30);
13127
13128
13129				return false;
13130
13131			});
13132
13133			//pagination
13134				$(this).find('> .normal-container > .dot-nav').remove();
13135				$(this).find('> .normal-container').append('<div class="dot-nav"></div>');
13136				for(var $i=0;$i < $projLength;$i++) {
13137					if($i == 0) {
13138						$(this).find('.dot-nav').append('<span class="dot active"><span></span></span>');
13139					} else {
13140						$(this).find('.dot-nav').append('<span class="dot"><span></span></span>');
13141					}
13142			
13143				}
13144	
13145
13146			var $dotIndex = 1;
13147
13148			$('.nectar_fullscreen_zoom_recent_projects .dot-nav > span').on('click',function(e){
13149
13150				if($(this).hasClass('active')) return;
13151
13152				//thres
13153				var $that = $(this);
13154				if(!$that.parent().hasClass('timeout')) {
13155					setTimeout(function(){
13156						$that.parent().removeClass('timeout');
13157					},1150);
13158				}
13159
13160				if($(this).parent().hasClass('timeout')) return;
13161				$(this).parent().addClass('timeout');
13162
13163				nectarCustomSliderResetRotate($that.parents('.nectar_fullscreen_zoom_recent_projects'), recentProjectSliderIndex);
13164
13165				//switch logic
13166				$(this).parent().find('span.active').removeClass('active');
13167				$(this).addClass('active');
13168
13169				$dotIndex = $(this).index() + 1;
13170
13171				var $current = $(this).parents('.nectar_fullscreen_zoom_recent_projects').find('.project-slide.current');
13172				var $sliderInstance = $(this).parents('.nectar_fullscreen_zoom_recent_projects');
13173
13174				var $prevIndex = $current.index() + 1;
13175
13176				$sliderInstance.find('.project-slide').removeClass('next').removeClass('prev');
13177
13178				$sliderInstance.find('.project-slide').each(function(i){
13179					if(i < $dotIndex-1)
13180						$(this).addClass('prev');
13181					else
13182						$(this).addClass('next');
13183				});
13184
13185				//going prev
13186				if($prevIndex > $dotIndex) {
13187					$sliderInstance.find('.project-slide').eq($dotIndex-1).addClass('no-trans').addClass('prev').removeClass('next');
13188					setTimeout(function(){
13189						$sliderInstance.find('.project-slide').eq($dotIndex-1).removeClass('no-trans').removeClass('next').removeClass('prev').addClass('current');
13190						$current.removeClass('current').addClass('next');
13191					},30);
13192				
13193				} 
13194
13195				//going forawrd
13196				else {
13197					$sliderInstance.find('.project-slide').eq($dotIndex-1).addClass('no-trans').addClass('next').removeClass('prev');
13198					setTimeout(function(){
13199						$sliderInstance.find('.project-slide').eq($dotIndex-1).removeClass('no-trans').removeClass('next').removeClass('prev').addClass('current');
13200						$current.removeClass('current').addClass('prev');
13201					},30);
13202
13203				}
13204				
13205			});	
13206
13207
13208		});
13209		
13210	}
13211	fsProjectSliderInit();
13212 	
13213
13214	//portfolio accent color
13215	function portfolioAccentColor() {
13216
13217		var portfolioSocialColorCss = '';
13218
13219		$('.portfolio-items .col').each(function(){
13220			if ($(this).has('[data-project-color]')) { 
13221				$(this).find('.work-info-bg, .bottom-meta').css('background-color',$(this).attr('data-project-color'));
13222
13223				//style5
13224				$(this).find('.parallaxImg-rendered-layer .bg-overlay').css('border-color',$(this).attr('data-project-color'));
13225
13226				var	$projColor = $(this).attr('data-project-color');
13227				if($(this).find('.custom-content .nectar-social').length > 0 && $('body[data-button-style="rounded"]') ) portfolioSocialColorCss += 'body[data-button-style="rounded"] .col[data-
13227project-color="'+$projColor+'"] .custom-content .nectar-social > *:hover i { color: '+ $projColor +'!important; } ';
13228
13229			}
13230		});
13231		
13232		if(portfolioSocialColorCss.length > 1) {
13233
13234			var head = document.head || document.getElementsByTagName('head')[0];
13235			var style = document.createElement('style');
13236
13237				style.type = 'text/css';
13238			if (style.styleSheet){
13239			  style.styleSheet.cssText = portfolioSocialColorCss;
13240			} else {
13241			  style.appendChild(document.createTextNode(portfolioSocialColorCss));
13242			}
13243
13244			head.appendChild(style);
13245		}
13246	}
13247	portfolioAccentColor();
13248	
13249	//portfolio sort
13250	$('body').on('mouseenter','.portfolio-filters',function(){
13251		if(!portfolioFiltersOnMobile) {
13252			$(this).find('> ul').stop(true,true).slideDown(500,'easeOutExpo');
13253		}
13254		$(this).find('a#sort-portfolio span').html($(this).find('a#sort-portfolio').attr('data-sortable-label'));
13255	});
13256
13257	$('body').on('mouseleave','.portfolio-filters',function(){
13258		var $activeCat = $(this).find('a.active').html();
13259		if( typeof $activeCat == 'undefined' || $activeCat.length == 0) $activeCat = $(this).attr('data-sortable-label');
13260		$(this).find('a#sort-portfolio span').html($activeCat);
13261		if(!portfolioFiltersOnMobile) {
13262			$(this).find('> ul').stop(true,true).slideUp(500,'easeOutExpo');
13263		}
13264	});
13265	
13266	//portfolio selected category
13267	$('body').on('click','.portfolio-filters ul li a', function(){
13268		$(this).parents('.portfolio-filters').find('#sort-portfolio span').html($(this).html());
13269	});
13270	
13271	//portfolio prevent jump on parent dropdown click
13272	$('body').on('click','.portfolio-filters > a#sort-portfolio', function(){
13273		return false;
13274	});
13275	
13276	//inline portfolio selected category
13277	$('body').on('click','.portfolio-filters-inline ul li a',function(){
13278
13279		$(this).parents('ul').find('li a').removeClass('active');
13280		$(this).addClass('active');
13281		$(this).parents('.portfolio-filters-inline').find('#current-category').html($(this).html());
13282		
13283	});
13284	
13285	var portfolioFiltersOnMobile = false;
13286	
13287	function portfolioFiltersInit() {
13288		//mobile sort menu fix
13289		if($('body').hasClass('mobile') || navigator.userAgent.match(/(iPad|IEMobile)/)){
13290			portfolioFiltersOnMobile = true;
13291			$('.portfolio-filters').unbind('mouseenter mouseleave');
13292			$('.portfolio-filters > a, .portfolio-filters ul li a').on('click',function(e){
13293				if(e.originalEvent !== undefined) $(this).parents('.portfolio-filters').find('> ul').stop(true,true).slideToggle(600,'easeOutCubic');
13294			});
13295		}
13296
13297		if($('.portfolio-filters-inline[data-alignment="left"]').length > 0 || $('.portfolio-filters-inline[data-alignment="center"]').length > 0) {
13298			$('.portfolio-filters-inline .container > ul > li:nth-child(1) a').click();
13299		} else {
13300			$('.portfolio-filters-inline .container > ul > li:nth-child(2) a').click();
13301		}
13302		
13303		//portfolio more details page menu highlight
13304		$('body.single-portfolio #header-outer nav > ul > li > a:contains("Portfolio")').parents('li').addClass('current-menu-item');
13305		
13306		//blog page highlight
13307		$('body.single-post #header-outer nav > ul > li > a:contains("Blog")').parents('li').addClass('current-menu-item');
13308	}
13309
13310	portfolioFiltersInit();
13311
13312	
13313	//blog love center
13314	function centerLove(){
13315		$('.post').each(function(){
13316			
13317			var $loveWidth = $(this).find('.post-meta .nectar-love').outerWidth();
13318			var $loveWrapWidth = $(this).find('.post-meta  .nectar-love-wrap').width();
13319			
13320			//center
13321			$(this).find('.post-meta .nectar-love').css('margin-left', $loveWrapWidth/2 - $loveWidth/2 + 'px' );
13322			$(this).find('.nectar-love-wrap').css('visibility','visible');
13323		});
13324	}
13325	
13326	$('.nectar-love').on('click',function(){
13327		centerLove();
13328	});
13329	
13330	centerLove();	
13331	
13332
13333	//portfolio single comment order
13334	function portfolioCommentOrder(){
13335	
13336		if($('body').hasClass('mobile') && $('body').hasClass('single-portfolio') && $('#respond').length > 0){
13337			$('#sidebar').insertBefore('.comments-section');
13338		}
13339		 
13340		else if($('body').hasClass('single-portfolio') && $('#respond').length > 0) {
13341			$('#sidebar').insertAfter('.post-area');
13342		}
13343		
13344	}
13345
13346	portfolioCommentOrder();
13347	 
13348	
13349	//portfolio sidebar follow
13350	var sidebarFollow = $('.single-portfolio #sidebar').attr('data-follow-on-scroll');
13351	
13352	function portfolioSidebarFollow(){
13353		
13354		if($('body.single-portfolio').length == 0 || $('#sidebar[data-follow-on-scroll]').length == 0) { return; }
13355
13356		sidebarFollow = $('.single-portfolio #sidebar').attr('data-follow-on-scroll');
13357	
13358		if( sidebarFollow == 1 && !$('body').hasClass('mobile') && parseInt($('#sidebar').height()) + 50 <= parseInt($('.post-area').height())) {
13359			
13360			 
13361			 //padding from top of screen
13362			 var $ssExtraTopSpace = 50;
13363
13364			 if($('#header-outer[data-remove-fixed="0"]').length > 0 && $('body[data-hhun="1"]').length == 0) { 
13365				 $ssExtraTopSpace += $('#header-outer').outerHeight();	
13366				 
13367				 //resize effect
13368				 if($('#header-outer[data-shrink-num][data-header-resize="1"]').length > 0 ) {
13369						var shrinkNum = 6;		
13370						var headerPadding2 = parseInt($('#header-outer').attr('data-padding')) - parseInt($('#header-outer').attr('data-padding'))/1.8;
13371						shrinkNum = $('#header-outer').attr('data-shrink-num');
13372						$ssExtraTopSpace -= shrinkNum;
13373						$ssExtraTopSpace -= headerPadding2;
13374				 }
13375				 
13376				 //condesne
13377				 if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
13378					 
13379						 var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
13380						 var $secondaryHeader = $('#header-secondary-outer');
13381						 
13382						 $ssExtraTopSpace = 50;
13383						 $ssExtraTopSpace += $('#header-outer').height() - (parseInt($headerSpan9.position().top) - parseInt($('#header-outer #logo').css('margin-top')) ) - parseInt(nectarDOMInfo.secondaryHeaderHeight);
13384				 }
13385				 
13386
13387			 }
13388
13389			 if($('#wpadminbar').length > 0) {
13390				 $ssExtraTopSpace += $('#wpadminbar').outerHeight();
13391			 }
13392
13393			if($('#header-outer').attr('data-using-secondary') == '1' && $('body.material').length == 0) {
13394				 $ssExtraTopSpace += $('#header-secondary-outer').outerHeight();
13395			 }
13396			 
13397			 $('.single-portfolio #sidebar').theiaStickySidebar({
13398				 additionalMarginTop: $ssExtraTopSpace,
13399				 updateSidebarHeight: false
13400			 });
13401
13402			 
13403		}
13403 //if sticky sidebar is active and needs to be called
13404		
13405	} // end  portfolioSidebarFollow function
13406	
13407
13408	
13409	
13410	
13411	//remove the portfolio filters that are not found in the current page
13412	function isotopeCatSelection() {
13413
13414
13415		$('.portfolio-items:not(".carousel")').each(function(){
13416			
13417			var isotopeCatArr = [];
13418			var $portfolioCatCount = 0;
13419			$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(i){
13420				if($(this).find('a').length > 0) {
13421					isotopeCatArr[$portfolioCatCount] = $(this).find('a').attr('data-filter').substring(1);	
13422					$portfolioCatCount++;
13423				}
13424			});
13425		
13426			
13427			////ice the first (all)
13428			isotopeCatArr.shift();
13429			
13430			
13431			var itemCats = '';
13432			
13433			$(this).find('> div').each(function(i){
13434				itemCats += $(this).attr('data-project-cat');
13435			});
13436			itemCats = itemCats.split(' ');
13437			
13438			////remove the extra item on the end of blank space
13439			itemCats.pop();
13440			
13441			////make sure the array has no duplicates
13442			itemCats = $.unique(itemCats);
13443			
13444			////if user has chosen a set of filters to display - only show those
13445			if($(this).is('[data-categories-to-show]') && $(this).attr('data-categories-to-show').length != 0 && $(this).attr('data-categories-to-show') != 'all') {
13446				var $userSelectedCats = $(this).attr('data-categories-to-show').replace(/,/g , ' ');
13447				$userSelectedCats = $userSelectedCats.split(' ');
13448				
13449				if(!$(this).hasClass('infinite_scroll')) $(this).removeAttr('data-categories-to-show');
13450			} else {
13451				var $userSelectedCats = itemCats;
13452			}
13453			
13454			
13455			////Find which categories are actually on the current page
13456			var notFoundCats = [];
13457			$.grep(isotopeCatArr, function(el) {
13458
13459		    	if ($.inArray(el, itemCats) == -1) notFoundCats.push(el);
13460		    	if ($.inArray(el, $userSelectedCats) == -1) notFoundCats.push(el);
13461
13462			});
13463			
13464			//manipulate the list
13465			if(notFoundCats.length != 0){
13466				$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(){
13467					if($(this).find('a').length > 0) {
13468						if( $.inArray($(this).find('a').attr('data-filter').substring(1), notFoundCats) != -1 ){ 
13469							
13470							if($(this).find('> ul.children').length > 0) {
13471								$(this).find('> a').hide(); 
13472							} else {
13473								$(this).hide(); 
13474							}
13475							
13476						} else {
13477							$(this).show();
13478						}
13479					}
13480				})
13481			}
13482		});
13483	}
13484	
13485	isotopeCatSelection();
13486	
13487	
13488	//sharing buttons
13489
13490	var completed = 0;
13491	var windowLocation = window.location.href.replace(window.location.hash, '');
13492
13493	function facebookShare(){
13494		windowLocation = window.location.href.replace(window.location.hash, '');
13495		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" ) 
13496		return false;
13497	}
13498
13499	function googlePlusShare(){
13500		windowLocation = window.location.href.replace(window.location.hash, '');
13501		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" ) 
13502		return false;
13503	}
13504
13505	function twitterShare(){
13506        windowLocation = window.location.href.replace(window.location.hash, '');		
13507		if($(".section-title h1").length > 0) {
13508			var $pageTitle = encodeURIComponent($(".section-title h1").text());
13509		} else {
13510			var $pageTitle = encodeURIComponent($(document).find("title").text());
13511		}
13512		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" ) 
13513		return false;
13514	}
13515
13516	function wooTwitterShare(){
13517		windowLocation = window.location.href.replace(window.location.hash, '');
13518		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" ) 
13519		return false;
13520	}
13521
13522	function linkedInShare(){
13523	    windowLocation = window.location.href.replace(window.location.hash, '');	
13524		if($(".section-title h1").length > 0) {
13525			var $pageTitle = encodeURIComponent($(".section-title h1").text());
13526		} else {
13527			var $pageTitle = encodeURIComponent($(document).find("title").text());
13528		}
13529		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" ) 
13530		return false;
13531	}
13532
13533	function woolinkedInShare(){
13534	    windowLocation = window.location.href.replace(window.location.hash, '');	
13535		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" ) 
13536		return false;
13537	}
13538
13539	function pinterestShare(){
13540		windowLocation = window.location.href.replace(window.location.hash, '');
13541		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'); 
13542		
13543		if($(".section-title h1").length > 0) {
13544			var $pageTitle = encodeURIComponent($(".section-title h1").text());
13545		} else {
13546			var $pageTitle = encodeURIComponent($(document).find("title").text());
13547		}
13548		
13549		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" ) 
13550		return false;
13551	}
13552	
13553	function wooPinterestShare(){
13554		$imgToShare = ($('img.attachment-shop_single').length > 0) ? $('img.attachment-shop_single').first().attr('src') : $('.single-product-main-image img').first().attr('src');
13555		windowLocation = window.location.href.replace(window.location.hash, '');
13556		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" ) 
13557		return false;
13558	}
13559
13560
13561	function socialFade(){
13562
13563			if(completed == $('a.nectar-sharing').length && $('a.nectar-sharing').parent().hasClass('in-sight')) {
13564
13565					//love fadein
13566					$('.nectar-social .nectar-love span').show(350,'easeOutSine',function(){
13567						$(this).stop().animate({'opacity':1},800);
13568					});
13569					
13570					//sharing loadin
13571					$('.nectar-social > a').each(function(i){
13572						var $that = $(this);
13573						
13574						$(this).find('> span').show(350,'easeOutSine',function(){
13575							$that.find('> span').stop().animate({'opacity':1},800);
13576						});
13577						
13578					});
13579
13580
13581				//alt blog layout total share count
13582				var $totalShares = 0;
13583				$('.nectar-social > a .count').each(function(){
13584					$totalShares += parseInt($(this).html());
13585				});
13586				
13587				if($totalShares != 1){
13588					$('.single .meta-share-count .plural').css({'opacity':'1', 'display':'inline'});
13589					$('.single .meta-share-count .singular').remove();
13590				} else {
13591					$('.single .meta-share-count .singular').css({'opacity':'1', 'position':'relative',  'display':'inline'});
13592					$('.single .meta-share-count .plural').remove();
13593				}
13594
13595				$('.meta-share-count .share-count-total').html($totalShares).css('opacity',1);
13596			}
13597		}
13598
13599	$('body').on('click','#single-below-header .nectar-social a', function(){ return false; });
13600
13601	$('body').on('click','.facebook-share:not(.inactive)', facebookShare);
13602	$('body').on('click','.google-plus-share:not(.inactive)', googlePlusShare);
13603	$('body').on('click','.nectar-social:not(".woo") .twitter-share:not(.inactive)', twitterShare);
13604	$('body').on('click','.nectar-social.woo .twitter-share', wooTwitterShare);
13605	$('body').on('click','.nectar-social:not(".woo") .linkedin-share:not(.inactive)', linkedInShare);
13606	$('body').on('click','.nectar-social.woo .linkedin-share', woolinkedInShare);
13607	$('body').on('click','.nectar-social:not(".woo") .pinterest-share:not(.inactive)', pinterestShare);
13608	$('body').on('click','.nectar-social.woo .pinterest-share', wooPinterestShare);
13609	$('body').on('click','.nectar-social-sharing-fixed > a', function(){ return false; });
13610
13611	function socialSharingInit() {
13612
13613		//mobile fullscreen blog class for click event fix
13614		if($('body').hasClass('mobile') && $('.single-post .fullscreen-header').length > 0) {
13615			$('#single-below-header .nectar-social .nectar-sharing, #single-below-header .nectar-social .nectar-sharing-alt').addClass('inactive');
13616		}
13617
13618		completed = 0;
13619
13620		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) {
13621  
13622		 
13623			////facebook
13624			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) {
13625				
13626				//load share count on load  
13627				$.getJSON("https://graph.facebook.com/?id="+ windowLocation +"&callback=?", function(data) {
13628					if( data.share != undefined && data.share.share_count != undefined && data.share.share_count != 0 && (data.share.share_count != null)) { 
13629						$('.facebook-share a span.count, a.facebook-share span.count').html( data.share.share_count );	
13630					}
13631					else {
13632						$('.facebook-share a span.count, a.facebook-share span.count').html( 0 );	
13633					}
13634					completed++;
13635					socialFade();
13636				});
13637			 
13638				
13639				
13640			} else if($('a.facebook-share').length > 0 && $('body[data-button-style="rounded"]').length > 0 || $('.sharing-default-minimal a.facebook-share').length > 0) {
13641				completed++;
13642				socialFade();
13643			}
13644			
13645			
13646			////twitter
13647			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) {
13648				//load tweet count on load 
13649			
13650					$('.twitter-share a span.count, a.twitter-share span.count').html( 0 );
13651				
13652					completed++;
13653					socialFade();
13654				
13655
13656
13657			} else if($('a.twitter-share').length > 0 && $('body[data-button-style="rounded"]').length > 0 || $('.sharing-default-minimal a.twitter-share').length > 0 ) {
13658				completed++;
13659				socialFade();
13660			}
13661			
13662			
13663			////linkedIn
13664			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) {
13665				//load share count on load 
13666			
13667						$('.linkedin-share a span.count, a.linkedin-share span.count').html( 0 );
13668			
13669					completed++;
13670					socialFade();
13671
13672				
13673			} else if($('a.linkedin-share').length > 0 && $('body[data-button-style="rounded"]').length > 0 || $('.sharing-default-minimal a.linkedin-share').length > 0) {
13674				completed++;
13675				socialFade();
13676			}
13677			
13678			
13679			////pinterest
13680			if(nectarDOMInfo.usingFrontEndEditor) {
13681				completed++;
13682				socialFade();
13683			}
13684			else {
13685				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) {
13686					//load pin count on load 
13687					$.getJSON('https://api.pinterest.com/v1/urls/count.json?url='+windowLocation+'&callback=?', function(data) {
13688						if((data.count != 0) && (data.count != undefined) && (data.count != null)) { 
13689							$('.pinterest-share a span.count, a.pinterest-share span.count').html( data.count );
13690						}
13691						else {
13692							$('.pinterest-share a span.count, a.pinterest-share span.count').html( 0 );
13693						}
13694						completed++;
13695						socialFade();
13696					});
13697
13698				} else if($('a.pinterest-share').length > 0 && $('body[data-button-style="rounded"]').length >  0 || $('.sharing-default-minimal a.pinterest-share').length > 0) {
13699					completed++;
13700					socialFade();
13701				}
13702		}
13703
13704		//fadeIn
13705		$('a.nectar-sharing > span.count, a.nectar-sharing-alt > span.count').hide().css('width','auto');
13706
13707
13708		//social light up
13709		$('.nectar-social').each(function() {
13710			if($(this).parents('.custom-content').length == 0 && $(this).parents('.nectar-social-sharing-fixed').length == 0) {
13711
13712
13713				var $that = $(this);
13714				var waypoint = new Waypoint({
13715	 			element: $that,
13716	 			 handler: function(direction) {
13717
13718					var $slide_timeout = ($('#page-header-bg[data-animate-in-effect="slide-down"] .nectar-social').length > 0 ) ? 900 : 1;
13719
13720					setTimeout(function(){
13721
13722						$that.addClass('in-sight');
13723						socialFade();
13724						
13725						if($('#page-header-bg .nectar-social').length == 0) {
13726							$that.find('> *').each(function(i){
13727								
13728								var $that = $(this);
13729								var $timeout = ($('body[data-button-style="rounded"]').length > 0) ? 0: 750;
13730
13731								setTimeout(function(){ 
13732									
13733									$that.delay(i*80).queue(function(){ 
13734										
13735										var $that = $(this); $(this).addClass('hovered'); 
13736										
13737										setTimeout(function(){ 
13738											$that.removeClass('hovered');
13739										},300); 
13740										
13741									});
13742								
13743								},$timeout);
13744							});
13745						}
13746
13747					},$slide_timeout );
13748
13749					$that.addClass('animated-in');
13750					waypoint.destroy();
13751				},
13752				offset: 'bottom-in-view'
13753
13754			}); 
13755
13756				
13757			}
13758			}); 
13759
13760		}
13761
13762	}
13763	
13764	socialSharingInit();
13765
13766
13767	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
13768
13769		var $socialTimeout;
13770		$('body').on('mouseenter','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
13771			clearTimeout($socialTimeout);
13772
13773			if($(this).parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 
13774				$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'right':'0px'},0);
13775			else 
13776				$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'left':'0px'},0);
13777
13778			$(this).parents('[id*="-meta"]').addClass('social-hovered');
13779
13780			$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':0},250);
13781			$(this).find('.nectar-social a').each(function(i){
13782				$(this).stop(true).delay(i*40).animate({'opacity': 1,  'left':'0px'}, 150);
13783			});
13784
13785		});
13786
13787	
13788		$('body').on('mouseleave','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
13789			$(this).parents('[id*="-meta"]').removeClass('social-hovered');
13790
13791			if($(this).parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 
13792				$(this).find('.nectar-social').stop(true).animate({'opacity': 0,  'right':'-20px'}, 200);
13793			else 
13794				$(this).find('.nectar-social').stop(true).animate({'opacity': 0,  'left':'-20px'}, 200);
13795
13796			$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':1},250);
13797
13798			var $that = $(this);
13799			
13800			$socialTimeout = setTimeout(function(){ 
13801				$that.find('.nectar-social').hide(); 
13802				if($that.parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 
13803					$that.find('.nectar-social a').stop(true).animate({'opacity': 0,  'left':'20px'},0);   
13804				else 
13805					$that.find('.nectar-social a').stop(true).animate({'opacity': 0,  'left':'-20px'},0);   
13806			}, 200);
13807		});
13808	} else {
13809		var $socialTimeout;
13810		$('body').on('click','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
13811			clearTimeout($socialTimeout);
13812
13813			if($(this).parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 
13814				$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'right':'0px'},0);
13815			else 
13816				$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'left':'0px'},0);
13817
13818			$(this).parents('[id*="-meta"]').addClass('social-hovered');
13819
13820			$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':0},250);
13821			$(this).find('.nectar-social a').each(function(i){
13822				$(this).stop(true).delay(i*40).animate({'opacity': 1,  'left':'0px'}, 150);
13823			});
13824
13825			return false;
13826		});
13827
13828	}
13829
13830	$('body').on('mouseenter','.fullscreen-header  .meta-share-count', function(){
13831		$(this).find('> a, > i').stop(true).animate({'opacity': 0},400);
13832		$(this).find('.nectar-social > *').each(function(i){
13833			$(this).stop(true).delay(i*50).animate({'opacity':'1', 'top': '0px'},250,'easeOutCubic');
13834		});
13835		//allow clickable on mobile
13836		setTimeout(function(){ $('.meta-share-count .nectar-sharing, .meta-share-count .nectar-sharing-alt').removeClass('inactive'); },300);
13837	});
13838
13839	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
13840		$('body').on('mouseleave','.fullscreen-header  .meta-share-count', function(){
13841			$(this).find('> a, > i').stop(true).animate({'opacity': 1},300,'easeInCubic');
13842			$(this).find('.nectar-social > *').each(function(i){
13843				$(this).stop(true).animate({'opacity':'0', 'top': '10px'},200,'easeInCubic');
13844			});
13845		});
13846	}
13847
13848	//full width love center
13849	function nectarLoveFWCenter(){
13850		$('.nectar-social.full-width').each(function(){ 
13851			$(this).find('.n-shortcode .nectar-love').css('padding-top', $(this).find('> a').css('padding-top'));
13852		});
13853	}
13854	
13855	nectarLoveFWCenter();
13856	
13857
13858	//-----------------------------------------------------------------
13859	// NectarLove
13860	//-----------------------------------------------------------------
13861	
13862	////love iwth txt
13863	$('.fullscreen-header .nectar-love').each(function(){
13864		if($(this).find('.nectar-love-count').text() == '1') {
13865			$(this).find('span.love-txt.single').css({'visibility':'visible', 'text-indent':'0'});
13866			$(this).find('span.love-txt.plural').css({'visibility':'hidden', 'text-indent':'-9999px'});
13867		} else {
13868			$(this).find('span.love-txt.single').css({'visibility':'hidden', 'text-indent':'-9999px'});
13869			$(this).find('span.love-txt.plural').css({'visibility':'visible', 'text-indent':'0'});
13870		}
13871	});
13872
13873	$('body').on('click','.nectar-love', function() {
13874			
13875
13876			var $loveLink = $(this);
13877			var $id = $(this).attr('id');
13878			var $that = $(this);
13879			
13880			if($loveLink.hasClass('loved')) return false;
13881			if($(this).hasClass('inactive')) return false;
13882			
13883			var $dataToPass = {
13884				action: 'nectar-love', 
13885				loves_id: $id,
13886				love_nonce: nectarLove.loveNonce
13887			}
13888			
13889			$.post(nectarLove.ajaxurl, $dataToPass, function(data){
13890				$loveLink.find('span:not(.love-txt)').html(data);
13891				$loveLink.addClass('loved').attr('title','You already love this!');
13892				$loveLink.find('span:not(.love-txt)').css({'opacity': 1,'width':'auto'});
13893
13894				if($(data).text() == '1') {
13895					$loveLink.find('span.love-txt.single').css({'visibility':'visible', 'text-indent':'0'});
13896					$loveLink.find('span.love-txt.plural').css({'visibility':'hidden', 'text-indent':'-9999px'});
13897				} else {
13898					$loveLink.find('span.love-txt.single').css({'visibility':'hidden', 'text-indent':'-9999px'});
13899					$loveLink.find('span.love-txt.plural').css({'visibility':'visible', 'text-indent':'0'});
13900				}
13901
13902				//ascend
13903				if($('body').hasClass('ascend') && $that.parents('.classic_enhanced').length == 0 ){
13904					$that.find('.icon-salient-heart-2').addClass('loved');
13905				} else if($that.parents('.classic_enhanced').length > 0 ) {
13906					$that.find('.icon-salient-heart-2').addClass('loved');
13907				}
13908			});
13909			
13910			$(this).addClass('inactive');
13911			
13912			return false;
13913	});
13914
13915
13916	
13917	//infinite scroll
13918	function infiniteScrollInit() {
13919
13920		if($('.infinite_scroll').length > 0) {
13921			
13922			//portfolio
13923			$('.portfolio-items.infinite_scroll').infinitescroll({
13924		    	navSelector  : "div#pagination",            
13925		   	    nextSelector : "div#pagination a:first",    
13926		   	    itemSelector : ".portfolio-items.infinite_scroll .element",
13927		   	    finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
13928		        msgText: " ",         
13929		   },function(newElements){
13930		   	
13931
13932				var $container = $('.portfolio-items.infinite_scroll:not(.carousel)');
13933				//loading effect   
13934
13935		        var $newElems = $( newElements ).css('opacity',0);
13936		        //// ensure that images load before adding to masonry layout
13937		        $newElems.imagesLoaded(function(){
13938		          
13939		          $( newElements ).css('opacity',1);
13940
13941		          $container.isotope( 'appended', $( newElements ));
13942		          
13943		          $( newElements ).find('.work-item').addClass('ajax-loaded');
13944		          $( newElements ).addClass('ajax-loaded');
13945		          ///// show elems now they're ready
13946		          
13947		          $(newElements).find('.work-meta, .nectar-love-wrap').css({'opacity':1});
13948		          
13949		          //keep filtering
13950		          if($('.portfolio-filters-inline').length > 0 || $('.portfolio-filters').length > 0) {
13951		          	
13952		          	  if($('.portfolio-filters-inline').length > 0) {
13953		          	  	 var selector = $('.portfolio-filters-inline a.active').attr('data-filter');
13954		          	  } else {
13955		          	  	 var selector = $('.portfolio-filters a.active').attr('data-filter');
13956		          	  }
13957		          	  
13958		          	  $('.portfolio-filters-inline a.active').attr('data-filter');
13959			  	 	  $container.isotope({ filter: selector });
13960		          }
13961		          
13962			  	//set width
13963			  	//portfolioItemWidths();
13964			  	reLayout();
13965
13966		        if($(newElements).find('.work-item.style-5').length > 0) style6Img();
13967
13968	          	if($(newElements).find('.inner-wrap').attr('data-animation') == 'none') {
13969					$('.portfolio-items .col .inner-wrap').removeClass('animated');
13970				} else {
13971
13972					masonryZindex();
13973					$(newElements).each(function(i){
13974						
13975						var $portfolioOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '90%';
13976						
13977						//not already visible
13978						var $that = $(this);
13979						var waypoint = new Waypoint({
13980			 			element: $that,
13981			 			 handler: function(direction) {
13982							
13983							var $portfolioAnimationDelay = ($that.is('[data-masonry-type="photography"].masonry-items')) ? 85 : 115;
13984						
13985							setTimeout(function(){
13986								$that.addClass("animated-in");
13987							},$portfolioAnimationDelay * $that.attr('data-delay-amount'));
13988						
13989							
13990							waypoint.destroy();
13991						},
13992						offset: $portfolioOffsetPos
13993
13994						}); //waypoint
13995
13996	
13997					}); //each
13998				}
13999
14000		       
14001		    portfolioHoverEffects();	
14002				portfolioAccentColor();
14003		         
14004		    //verify smooth scorlling
14005				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') } 
14006				
14007				
14008				
14009				//prettyphoto
14010				$('.portfolio-items').each(function(){
14011					var $unique_id = Math.floor(Math.random()*10000);
14012					$(this).find('a[rel^="prettyPhoto"], a.pretty_photo').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo');
14013				});
14014		
14015				lightBoxInit();
14016				
14017				piVertCenter();
14018
14019				setTimeout(function(){masonryZindex(); reLayout(); $( newElements ).removeClass('ajax-loaded'); },700);
14020		        
14021		        //recalc the filters
14022		        isotopeCatSelection();
14023
14024		        parallaxRowsBGCals();
14025	          
14026	          }); 
14027
14028				
14029		   });
14030
14031			//blog
14032			$('.post-area.infinite_scroll .posts-container').infinitescroll({
14033		    	navSelector  : "div#pagination",            
14034		   	    nextSelector : "div#pagination a:first",    
14035		   	    itemSelector : ".post-area .posts-container .post",
14036		   	    finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
14037		        msgText: " " 
14038		   },function(newElements){
14039		   	
14040		   	if($('.masonry.meta_overlaid').length == 0) { 
14041			   	//reinit js
14042			   	centerLove();
14043			   	
14044			   	//gallery
14045				$(newElements).find('.flex-gallery').each(function(){
14046					
14047					var $that = $(this);
14048					
14049					 $that.flexslider({
14050				        animation: 'fade',
14051				        smoothHeight: false, 
14052				        animationSpeed: 500,
14053				        useCSS: false, 
14054				        touch: true
14055				    });
14056					
14057					////gallery slider add arrows
14058					$('.flex-gallery .flex-direction-nav li a.flex-next').html('<i class="fa fa-angle-right"></i>');
14059					$('.flex-gallery .flex-direction-nav li a.flex-prev').html('<i class="fa fa-angle-left"></i>');
14060
14061				});
14062			   	
14063			   	
14064			   	//media players
14065			   	if($().mediaelementplayer) $(newElements).find('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer();
14066			   	
14067			   	
14068			   	//lightbox
14069			    lightBoxInit();
14070			   	
14071			   	//carousels
14072			   	if($('.carousel').length > 0) {
14073				   	standardCarouselInit();
14074			    	clientsCarouselInit();
14075			    }
14076			   	
14077
14078			   	//milestone
14079			   	$(newElements).find('.nectar-milestone').each(function() {
14080					//symbol
14081					if($(this).has('[data-symbol]')) {
14082						if($(this).attr('data-symbol-pos') == 'before') {
14083							$(this).find('.number').prepend($(this).attr('data-symbol'));
14084						} else {
14085							$(this).find('.number').append($(this).attr('data-symbol'));
14086						}
14087					}
14088				});
14089				
14090				if(!$('body').hasClass('mobile')) {
14091					
14092					$(newElements).find('.nectar-milestone').each(function() {
14093						//animation
14094
14095							var $that = $(this);
14096							var waypoint = new Waypoint({
14097				 			element: $that,
14098				 			 handler: function(direction) {
14099								if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
14100								     waypoint.destroy();
14101								     return;
14102								}
14103
14104								var $endNum = parseInt($that.find('.number span').text());
14105
14106								var countOptions = { easingFn: easeOutCubic };
14107								var $countEle = $that.find('.number span:not(.symbol)')[0];
14108								var numAnim = new CountUp($countEle, 0, $endNum,0,2.2,countOptions);
14109								numAnim.start();
14110
14111
14112								$that.addClass('animated-in');
14113								waypoint.destroy();
14114							},
14115							offset: 'bottom-in-view'
14116
14117						}); 
14118
14119						
14120					}); 
14121				}
14122				
14123				//pie chart		
14124			    if($().vcChat) $(newElements).find('.vc_pie_chart').vcChat();
14125		    	
14126		    	//fancy ul
14127		    	nectar_fancy_ul_init();
14128		    	
14129		    	//testimonial slider
14130		    	$('.testimonial_slider').animate({'opacity':'1'},800);
14131		    	createTestimonialControls();
14132				testimonialSliderHeight(); 
14133				testimonialHeightResize();
14134		    	
14135				//bar graph
14136				$(newElements).find('.nectar-progress-bar').each(function(i){
14137				
14138
14139				var $that = $(this);
14140				var waypoint = new Waypoint({
14141		 			element: $that,
14142		 			 handler: function(direction) {
14143						if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
14144						     waypoint.destroy();
14145						     return;
14146						}
14147
14148						var percent = $that.find('span').attr('data-width');
14149						var $endNum = parseInt($that.find('span strong i').text());
14150						
14151						$that.find('span').transition({
14152							'width' : percent + '%'
14153						},1600, 'easeInOutCirc',function(){
14154						});
14155						
14156						$that.find('span strong').transition({
14157							'opacity' : 1
14158						},1350);
14159						
14160						
14161						var countOptions = { useEasing : false };
14162						var $countEle = $that.find('span strong i')[0];
14163						var numAnim = new CountUp($countEle, 0, $endNum,0,1.2,countOptions);
14164						numAnim.start();
14165
14166						
14167						////100% progress bar 
14168						if(percent == '100'){
14169							$that.find('span strong').addClass('full');
14170						}
14171
14172
14173						$that.addClass('animated-in');
14174						waypoint.destroy();
14175					},
14176					offset: 'bottom-in-view'
14177
14178				}); 
14179
14180
14181			
14182				});
14183				
14184				
14185				//columns & images with animation
14186				colAndImgAnimations();
14187				splitLineHeadings();
14188
14189				setTimeout(function(){
14190					responsiveVideoIframesInit();
14191					responsiveVideoIframes();
14192					$(window).trigger('resize');
14193				},500);
14194
14195
14196				parallaxRowsBGCals();
14197
14198				$(window).trigger('resize');
14199			   	
14200		   	}//non meta overlaid style 
14201		   	else {
14202		   		parallaxRowsBGCals();
14203
14204				  $(window).trigger('resize');
14205		   	}
14206
14207		   	// trigger Masonry as a callback
14208		   	var $container = $('.posts-container');
14209		    if($container.parent().hasClass('masonry')) { 
14210		    	 
14211		    	$(newElements).addClass('masonry-blog-item');
14212				$(newElements).prepend('<span class="bottom-line"></span>');
14213				
14214				//move the meta to the bottom
14215				$(newElements).each(function(){
14216					
14217					var $metaClone = $(this).find('.post-meta').clone();
14218		
14219					$(this).find('.post-meta').remove();
14220					
14221					if($('.post-area.meta_overlaid').length > 0){
14222						$(this).find('.post-header h2').after($metaClone);
14223					} else {
14224						$(this).find('.content-inner').after($metaClone);
14225					}
14226					
14227				});
14228			
14229		    	}//if masonry
14230
14231
14232		    	//loading effect   
14233		    	
14234		        //// hide new items while they are loading
14235		        var $newElems = $( newElements );
14236		        //// ensure that images load before adding to masonry layout
14237						
14238		        if($newElems.find('img').length == 0) $newElems = $('body');
14239		        
14240		        $newElems.imagesLoaded(function(){
14241							
14242							if($container.parent().hasClass('masonry') && !$container.parent().hasClass('auto_meta_overlaid_spaced')) {
14243			          $container.isotope( 'appended', $( newElements ));
14244							}
14245
14246		          flickityBlogInit();
14247
14248		          $( newElements ).addClass('ajax-loaded');
14249		          ///// show elems now they're ready
14250
14251
14252		        //classic enhanced specific 
14253		        if($container.parent().hasClass('classic_enhanced')){
14254					$container.find('.large_featured.has-post-thumbnail.ajax-loaded .post-featured-img, .wide_tall.has-post-thumbnail.ajax-loaded .post-featured-img').each(function(){
14255						var $src = $(this).find('img').attr('src');
14256						$(this).css('background-image','url('+$src+')');
14257					});
14258
14259					$container.find('.large_featured.ajax-loaded .nectar-flickity, .wide_tall.ajax-loaded .nectar-flickity').each(function(){
14260
14261						$(this).find('.cell').each(function(){
14262							var $src = $(this).find('img').attr('src');
14263							$(this).css('background-image','url('+$src+')');
14264						});
14265						
14266					});
14267				}
14268
14269
14270		          if($(newElements).parents('.posts-container').attr('data-animation') == 'none') {
14271						$( newElements ).find('.inner-wrap').removeClass('animated');
14272					} else {
14273						blogMasonryZindex();
14274						$(newElements).each(function(i){
14275
14276							var $that = $(this);
14277							var waypoint = new Waypoint({
14278
14279					 			element: $that,
14280					 			 handler: function(direction) {
14281									
14282									setTimeout(function(){
14283									    $that.addClass("animated-in");
14284									},80*$that.attr('data-delay-amount'));
14285
14286									waypoint.destroy();
14287								},
14288								offset: '90%'
14289
14290							}); 
14291
14292		
14293						}); //each
14294					}
14295
14296					setTimeout(function(){$( newElements ).removeClass('ajax-loaded'); },700);
14297
14298		        
14299		        });
14300		        
14301		    
14302		   	
14303		   });
14304		   
14305	   }
14306
14307}
14308
14309infiniteScrollInit();
14310
14311function destroyInfiniteScroll(){
14312	$('.post-area.infinite_scroll .posts-container').infinitescroll('destroy');
14313	$('.portfolio-items.infinite_scroll').infinitescroll('destroy');
14314}
14315	
14316/*-------------------------------------------------------------------------*/
14317/*	6.	Scroll to top
14318/*-------------------------------------------------------------------------*/	
14319
14320var $scrollTop = $(window).scrollTop();
14321
14322//starting bind
14323function toTopBind() {
14324	if( $('#to-top').length > 0 && $(window).width() > 1020 || $('#to-top').length > 0 &&  $('#to-top.mobile-enabled').length > 0 ) {
14325		
14326		if($scrollTop > 350){
14327			$(window).on('scroll',hideToTop);
14328		}
14329		else {
14330			$(window).on('scroll',showToTop);
14331		}
14332	}
14333}
14334
14335if($('.nectar-social-sharing-fixed').length == 0) {
14336	toTopBind();
14337} else {
14338	if($(window).width() < 1000 && $('body.single').length > 0) {
14339		if($scrollTop > 150){
14340			$(window).on('scroll',hideFixedSharing);
14341		}
14342		else {
14343			$(window).on('scroll',showFixedSharing);
14344		}
14345	}
14346
14347	$(window).smartresize(function(){
14348		if($(window).width() > 1000) { 
14349			$('.nectar-social-sharing-fixed').addClass('visible');
14350		}	
14351		else if($scrollTop < 150) { 
14352			$(window).off('scroll',hideFixedSharing);
14353			$(window).on('scroll',showFixedSharing);
14354			$('.nectar-social-sharing-fixed').removeClass('visible');	
14355		} else {
14356			$(window).off('scroll',showFixedSharing);
14357			$(window).on('scroll',hideFixedSharing);
14358		}
14359	});
14360}
14361
14362function showFixedSharing(){
14363	
14364  $scrollTop = $(window).scrollTop();
14365	if( $scrollTop > 150){
14366
14367		$('.nectar-social-sharing-fixed').addClass('visible');	
14368		
14369		$(window).off('scroll',showFixedSharing);
14370		$(window).on('scroll',hideFixedSharing);
14371	}
14372
14373}
14374
14375function hideFixedSharing(){
14376  
14377	$scrollTop = $(window).scrollTop();
14378	if( $scrollTop < 150){
14379
14380		$('.nectar-social-sharing-fixed').removeClass('visible');	
14381		
14382		$(window).off('scroll',hideFixedSharing);
14383		$(window).on('scroll',showFixedSharing);
14384	}
14385
14386}
14387
14388
14389
14390function showToTop(){
14391
14392	if( nectarDOMInfo.scrollTop > 350 && $('#slide-out-widget-area.fullscreen.open').length == 0){
14393
14394		$('#to-top').stop().transition({
14395			'bottom' : '17px'
14396		},350,'easeInOutCubic');	
14397		
14398		$(window).off('scroll',showToTop);
14399		$(window).on('scroll',hideToTop);
14400	}
14401
14402}
14403
14404function hideToTop(){
14405	
14406	if( nectarDOMInfo.scrollTop < 350 || $('#slide-out-widget-area.fullscreen.open').length > 0){
14407
14408		var $animationTiming = ($('#slide-out-widget-area.fullscreen.open').length > 0) ? 1150 : 350;
14409
14410		$('#to-top').stop().transition({
14411			'bottom' : '-30px'
14412		},$animationTiming,'easeInOutQuint');	
14413		
14414		$(window).off('scroll',hideToTop);
14415		$(window).on('scroll',showToTop);	
14416		
14417	}
14418}
14419
14420
14421//to top color
14422if( $('#to-top').length > 0 ) {
14423	
14424	var $windowHeight, $pageHeight, $footerHeight, $ctaHeight;
14425	
14426	function calcToTopColor(){
14427		$scrollTop = $(window).scrollTop();
14428		$windowHeight = $(window).height();
14429		$pageHeight = $('body').height();
14430		$footerHeight = $('#footer-outer').height();
14431		$ctaHeight = ($('#call-to-action').length > 0) ? $('#call-to-action').height() : 0;
14432		
14433		if( ($scrollTop-35 + $windowHeight) >= ($pageHeight - $footerHeight) && $('#boxed').length == 0){
14434			$('#to-top').addClass('dark');
14435		}
14436		
14437		else {
14438			$('#to-top').removeClass('dark');
14439		}
14440	}
14441	
14442	if(!nectarDOMInfo.usingMobileBrowser) {
14443		//calc on scroll
14444		$(window).scroll(calcToTopColor);
14445		
14446		//calc on resize
14447		$(window).resize(calcToTopColor);
14448	}
14449
14450}
14451
14452//alt style
14453if($('body[data-button-style*="rounded"]').length > 0){
14454	var $clone = $('#to-top .fa-angle-up').clone();
14455	$clone.addClass('top-icon');
14456	$('#to-top').prepend($clone)
14457}
14458
14459//scroll up event
14460$('body').on('click','#to-top, a[href="#top"]',function(){
14461	$('body,html').stop().animate({
14462		scrollTop:0
14463	},800,'easeOutQuad',function(){
14464		if($('.nectar-box-roll').length > 0) {
14465			$('body').trigger('mousewheel', [1, 0, 0]);
14466		}
14467	})
14468	return false;
14469});
14470
14471
14472/* one page scrolling */
14473function scrollSpyInit(){ 
14474
14475	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').outerHeight();
14476
14477	if( $('.page-template-template-no-header-footer').length > 0 || $('.page-template-template-no-header').length > 0 ) { $headerNavSpace = 0; }
14478
14479	//prevent jump to rop on empty items
14480	$('header#top .sf-menu li a[href="#"]').on('click',function(e){
14481		e.preventDefault();
14482	});
14483	
14484	if( $('#nectar_fullscreen_rows').length == 0 || $disableFPonMobile == 'on') {
14485
14486		$('a.nectar-next-section').each(function(){
14487			
14488			if($(this).parents('.wpb_row:not(.inner_row)').length > 0) {
14489				
14490				var $parentRow = $(this).parents('.wpb_row:not(.inner_row)');
14491				var $parentRowIndex = $(this).parents('.wpb_row:not(.inner_row)').index();
14492				
14493				if($parentRow.parent().find('> .wpb_row[id]:eq('+($parentRowIndex+1)+')').length > 0) {
14494					var $nextRowID = $parentRow.parent().find('> .wpb_row:eq('+($parentRowIndex+1)+')').attr('id');
14495					$(this).attr('href', '#' + $nextRowID);
14496				} 
14497				
14498			}
14499			
14500		});
14501	} else if( $().fullpage ) {
14502			$('a.nectar-next-section').on('click',function(){
14503				$.fn.fullpage.moveSectionDown();
14504				return false;
14505			});
14506	}
14507
14508	//remove full page URLs from hash if located on same page to fix current menu class
14509	//if(location.pathname.length > 1) {
14510	
14511	  //ocm
14512		if($('#slide-out-widget-area .off-canvas-menu-container').length > 0) {
14513			$('#slide-out-widget-area .off-canvas-menu-container').find("a[href*='" + location.pathname + "']").each(function(){
14514					
14515					var $href = $(this).attr('href');
14516
14517					//regular animated anchors
14518					if($href != '#' && $href.indexOf("#") != -1 && $('div'+$href.substr($href.indexOf("#"))).length > 0 ) {
14519						$(this).attr('href',$href.substr($href.indexOf("#")));
14520						$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
14521					}
14522					
14523					//fullpage is a little different
14524					if($('div[data-fullscreen-anchor-id="'+$href.substr($href.indexOf("#")+1)+'"]').length > 0) {
14525						$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
14526					}
14527					
14528			});
14529		}
14530		
14531	  //header
14532		$("#header-outer").find("a[href*='" + location.pathname + "']").each(function(){
14533			var $href = $(this).attr('href');
14534
14535			//regular animated anchors
14536			if($href.indexOf("#") != -1 && $('div'+$href.substr($href.indexOf("#"))).length > 0 ) {
14537
14538				$(this).attr('href',$href.substr($href.indexOf("#")));
14539				$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
14540			}
14541
14542			//fullpage is a little different
14543			if($('div[data-fullscreen-anchor-id="'+$href.substr($href.indexOf("#")+1)+'"]').length > 0) {
14544				$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
14545			}
14546
14547		});
14548	//}
14549
14550	var $target = ($('.page-submenu[data-sticky="true"]').length == 0) ? '#header-outer nav': '.page-submenu';
14551	$('body').scrollspy({
14552		target: $target,
14553		offset: $headerNavSpace + nectarDOMInfo.adminBarHeight + 40
14554	});
14555
14556}
14557
14558
14559/*helper function to scroll the page in an animated manner*/
14560function nectar_scrollToY(scrollTargetY, speed, easing) {
14561
14562		var scrollY = window.scrollY || document.documentElement.scrollTop,
14563				scrollTargetY = scrollTargetY || 0,
14564				speed = speed || 2000,
14565				easing = easing || 'easeOutSine',
14566				currentTime = 0;
14567
14568		var time = Math.max(.1, Math.min(Math.abs(scrollY - scrollTargetY) / speed, .8));
14569
14570
14571		var easingEquations = {
14572						easeInOutQuint: function (pos) {
14573								if ((pos /= 0.5) < 1) {
14574										return 0.5 * Math.pow(pos, 5);
14575								}
14576								return 0.5 * (Math.pow((pos - 2), 5) + 2);
14577						}
14578				};
14579
14580
14581		function tick() {
14582				currentTime += 1 / 60;
14583
14584				var p = currentTime / time;
14585				var t = easingEquations[easing](p);
14586
14587				if (p < 1) {
14588						requestAnimationFrame(tick);
14589
14590						window.scrollTo(0, scrollY + ((scrollTargetY - scrollY) * t));
14591				} else {
14592						window.scrollTo(0, scrollTargetY);
14593				}
14594		}
14595
14596		tick();
14597}
14598
14599
14600function pageLoadHash() {
14601
14602	var $hash = window.location.hash;
14603	
14604	var $hashSubstrng = ($hash && $hash.length > 0) ? $hash.substring(1,$hash.length) : 0;
14605
14606	//if hash has slashes 
14607	var $hasSlashLength = 0;
14608	if($hashSubstrng) {
14609		$hasSlashLength = $hashSubstrng.split("/");
14610		$hasSlashLength = $hasSlashLength.length;
14611	}
14612	
14613	if($hashSubstrng && $hasSlashLength > 1 ) { 
14614		$hashSubstrng = $hashSubstrng.replace(/\//g, ""); 
14615		$hash = $hash.replace(/\//g, ""); 
14616	}
14617
14618	if($hash && $('.main-content').find($hash).length > 0 || $hash && $('.main-content').find('[data-fullscreen-anchor-id="'+$hashSubstrng+'"]').length > 0) {
14619
14620		var $hashObj = ($('.main-content').find($hash).length > 0) ? $('.main-content').find($hash) : $('.main-content').find('[data-fullscreen-anchor-id="'+$hashSubstrng+'"]');
14621
14622		var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-space').outerHeight();
14623		if( $('.page-template-template-no-header-footer').length > 0 || $('.page-template-template-no-header').length > 0 ) { $headerNavSpace = 0; }
14624
14625		$timeoutVar = 0;
14626		if($('.nectar-box-roll').length > 0 && $('.container-wrap.bottomBoxOut').length > 0) {
14627			boxRoll(null,-1);
14628			$timeoutVar = 2050;
14629		} 
14630		setTimeout(function(){
14631		
14632			if( $('body[data-permanent-transparent="1"]').length == 0 ) {
14633				
14634				if(!$('body').hasClass('mobile')){
14635					$resize = ($('#header-outer[data-header-resize="0"]').length > 0) ? 0 : parseInt(shrinkNum) + headerPadding2*2;
14636					if($('#header-outer[data-remove-fixed="1"]').length > 0) { 
14637						$headerNavSpace = 0;
14638					}
14639					var $scrollTopDistance =  $hashObj.offset().top - parseInt($headerNavSpace) +$resize + 3 - nectarDOMInfo.adminBarHeight;
14640					
14641					
14642					
14643					//condesne
14644					if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
14645						
14646							var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
14647							var $secondaryHeader = $('#header-secondary-outer');
14648							var $headerHeightStored = $('#header-outer').height();
14649							
14650							$headerHeightCondensed = $headerHeightStored - ( parseInt($headerSpan9.height()) + parseInt($('#header-outer #logo').css('margin-top')) );
14651						
14652							$scrollTopDistance =  $hashObj.offset().top - parseInt($headerNavSpace) + $headerHeightCondensed - nectarDOMInfo.adminBarHeight;
14653					}
14654						
14655					
14656					
14657				} else {
14658					var $scrollTopDistance = ($('#header-outer[data-mobile-fixed="1"]').length > 0) ? $hashObj.offset().top + 2 - $headerNavSpace + nectarDOMInfo.adminBarHeight : $hashObj.offset().top - nectarDOMInfo.adminBarHeight + 1;	
14659				}
14660
14661			} else {
14662				var $scrollTopDistance = $hashObj.offset().top - nectarDOMInfo.adminBarHeight + 1;
14663			}
14664
14665			if($('body[data-hhun="1"]').length > 0 && $('#header-outer[data-remove-fixed="1"]').length == 0) {
14666				//alter offset 
14667				if($('#header-outer.detached').length == 0) 
14668					$scrollTopDistance = $scrollTopDistance + $headerNavSpace;
14669			}
14670
14671			var $pageSubMenu = ($('.page-submenu[data-sticky="true"]').length > 0) ? $('.page-submenu').height() : 0;
14672			
14673			if($('body.material').length > 0 && 
14674				 $('#header-secondary-outer').length > 0 &&
14675				 $('body[data-hhun="1"]').length == 0 && 
14676				 $('#header-outer[data-remove-fixed="1"]').length == 0 && 
14677				 !$('body').hasClass('mobile')) { 
14678					 
14679					 var $headerSecondary = $('#header-secondary-outer').height();
14680					 
14681			 } else {
14682					 var $headerSecondary = 0;
14683			 }
14684			 
14685			nectar_scrollToY($scrollTopDistance - $pageSubMenu + $headerSecondary, 700, 'easeInOutQuint');
14686
14687		},$timeoutVar);
14688	}
14689}
14690
14691if($('body[data-animated-anchors="true"]').length > 0 || $('.single-product [data-gallery-style="left_thumb_sticky"]').length > 0) { 
14692
14693
14694+ function(t) {
14695    "use strict";
14696
14697    function s(e, i) {
14698        var r = t.proxy(this.process, this);
14699        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()
14700    }
14701
14702    function e(e) {
14703        return this.each(function() {
14704            var i = t(this),
14705                r = i.data("bs.scrollspy"),
14706                o = "object" == typeof e && e;
14707            r || i.data("bs.scrollspy", r = new s(this, o)), "string" == typeof e && r[e]()
14708        })
14709    }
14710    s.VERSION = "3.2.0", s.DEFAULTS = {
14711        offset: 10
14712    }, s.prototype.getScrollHeight = function() {
14713        return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
14714    }, s.prototype.refresh = function() {
14715        var s = "offset",
14716            e = 0;
14717        t.isWindow(this.$scrollElement[0]) || (s = "position", e = this.$scrollElement.scrollTop()), this.offsets = [], this.targets = [], this.scrollHeight = this.getScrollHeight();
14718        var i = this;
14719        this.$body.find(this.selector).map(function() {
14720            var i = t(this),
14721                r = i.data("target") || i.attr("href"),
14722                o = /^#./.test(r) && t(r);
14723            return o && o.length && o.is(":visible") && [
14724                [o[s]().top + e, r]
14725            ] || null
14726        }).sort(function(t, s) {
14727            return t[0] - s[0]
14728        }).each(function() {
14729            i.offsets.push(this[0]), i.targets.push(this[1])
14730        })
14731    }, s.prototype.process = function() {
14732    	var $pageSubMenu = ($('.page-submenu[data-sticky="true"]').length > 0 && $('body[data-hhun="1"]').length == 0 || $('.page-submenu[data-sticky="true"]').length > 0 && $('#header-outer[data-remove-fixed="1"]').length > 0 ) ? $('.page-submenu').height() : 0;
14733
14734        var t, s = this.$scrollElement.scrollTop() + this.options.offset + $pageSubMenu,
14735            e = this.getScrollHeight(),
14736            i = this.options.offset + e - this.$scrollElement.height() -$pageSubMenu,
14737            r = this.offsets,
14738            o = this.targets,
14739            l = this.activeTarget;
14740        if (this.scrollHeight != e && this.refresh(), s >= i) return l != (t = o[o.length - 1]) && this.activate(t);
14741        if (l && s <= r[0]) return l != (t = o[0]) && this.activate(t);
14742        for (t = r.length; t--;) l != o[t] && s >= r[t] && (!r[t + 1] || s <= r[t + 1]) && this.activate(o[t])
14743    }, s.prototype.activate = function(s) {
14744        this.activeTarget = s, t(this.selector).parentsUntil(this.options.target, ".current-menu-item").removeClass("current-menu-item").removeClass('sfHover');
14745        var e = this.selector + '[data-target="' + s + '"],' + this.selector + '[href="' + s + '"]',
14746            i = t(e).parents("li").addClass("current-menu-item");
14747        i.parent(".dropdown-menu").length && (i = i.closest("li.dropdown").addClass("current-menu-item")), i.trigger("activate.bs.scrollspy")
14748    };
14749    var i = t.fn.scrollspy;
14750    t.fn.scrollspy = e, t.fn.scrollspy.Constructor = s, t.fn.scrollspy.noConflict = function() {
14751        return t.fn.scrollspy = i, this
14752    }
14753}(jQuery);
14754
14755
14756var shrinkNum = 6;	
14757if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
14758headerPadding2 = headerPadding - headerPadding/1.8;
14759
14760setTimeout(scrollSpyInit,200);
14761
14762var $animatedScrollingTimeout;
14763
14764$('body').on('click','#header-outer nav .sf-menu a, #footer-outer .nectar-button, .container-wrap a:not(.wpb_tabs_nav a):not(.magnific):not([data-fancybox]):not(.woocommerce-tabs a):not(.testimonial-next-prev 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){
14765	
14766
14767
14768	var $hash = $(this).prop("hash");	
14769
14770	$('body').addClass('animated-scrolling');
14771	clearTimeout($animatedScrollingTimeout);
14772	$animatedScrollingTimeout = setTimeout(function(){ $('body').removeClass('animated-scrolling'); },850);
14773	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-space').outerHeight();
14774	if( $('.page-template-template-no-header-footer').length > 0 || $('.page-template-template-no-header').length > 0 ) { $headerNavSpace = 0; }
14775
14776	if($hash && $('body').find($hash).length > 0 && $hash != '#top' && $hash != '' && $(this).attr('href').indexOf(window.location.href.split("#")[0]) !== -1 || $(this).is('[href^="#"]') && $hash != '' && $('body').find($hash).length > 0 && $hash != '#top') {
14777
14778
14779		//update hash
14780		if(!$(this).hasClass('skip-hash')) {
14781			if(history.pushState) {
14782			    history.pushState(null, null, $hash);
14783			}
14784			else {
14785			    location.hash = $hash;
14786			}
14787		}
14788
14789		if($(this).parents('ul').length > 0) { 
14790			$(this).parents('ul').find('li').removeClass('current-menu-item');
14791		}
14792
14793		//side widget area click
14794		if($(this).parents('#slide-out-widget-area').length > 0){
14795			
14796			if($('body.material[data-slide-out-widget-area-style="slide-out-from-right"].material-ocm-open').length > 0) {
14797				$('body > .slide_out_area_close').addClass('non-human-allowed').trigger('click');
14798				//scroll
14799				var $clickedLinkStore = $(this);
14800				setTimeout(function(){
14801					$clickedLinkStore.trigger('click');
14802				},1000);
14803				
14804			} else {
14805				$('#slide-out-widget-area .slide_out_area_close').addClass('non-human-allowed').trigger('click');
14806			}
14807			
14808			setTimeout(function(){
14809				if($('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length > 0) {
14810					$('body > .slide_out_area_close').removeClass('non-human-allowed');
14811
14812				} else {
14813					$('#slide-out-widget-area .slide_out_area_close').removeClass('non-human-allowed');
14814				}
14815			},100);
14816		}
14817
14818		//mobile menu click
14819		if($(this).parents('#mobile-menu').length > 0) $('#toggle-nav').trigger('click');
14820		var $mobileMenuHeight = ($(this).parents('#mobile-menu').length > 0) ? $(this).parents('#mobile-menu').height() : null;
14821		
14822		$timeoutVar = 1;
14823		if($('.nectar-box-roll').length > 0 && $('.container-wrap.bottomBoxOut').length > 0) {
14824			boxRoll(null,-1);
14825			$timeoutVar = 2050;
14826		} 
14827
14828		var $that = $(this);
14829
14830		setTimeout(function(){
14831
14832			//scrolling
14833			var $headerSpace = ($('body[data-permanent-transparent="1"]').length > 0) ? 0 : parseInt($headerNavSpace);
14834			
14835			if( $('body[data-permanent-transparent="1"]').length == 0 ) {
14836				
14837				if(!$('body').hasClass('mobile')){
14838					$resize = ($('#header-outer[data-header-resize="0"]').length > 0) ? 0 : parseInt(shrinkNum) + headerPadding2*2;
14839					if($('#header-outer[data-remove-fixed="1"]').length > 0) { 
14840						$headerNavSpace = 0;
14841					}
14842					
14843					var $scrollTopDistance =  $($hash).offset().top - $mobileMenuHeight - parseInt($headerNavSpace) +$resize + 3 - nectarDOMInfo.adminBarHeight;
14844					
14845					
14846					//condesne
14847					if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
14848							var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
14849							var $secondaryHeader = $('#header-secondary-outer');
14850							var $headerHeightStored = $('#header-outer').height();
14851							
14852							$headerHeightCondensed = $headerHeightStored - ( parseInt($headerSpan9.height()) + parseInt($('#header-outer #logo').css('margin-top')) );
14853						
14854							$scrollTopDistance =  $($hash).offset().top - parseInt($headerNavSpace) + $headerHeightCondensed - nectarDOMInfo.adminBarHeight;
14855					}
14856					
14857					
14858				} else {
14859					var $scrollTopDistance = ($('#header-outer[data-mobile-fixed="1"]').length > 0) ? $($hash).offset().top + 2 - $headerNavSpace + nectarDOMInfo.adminBarHeight : $($hash).offset().top - $mobileMenuHeight - nectarDOMInfo.adminBarHeight + 1;	
14860				}
14861
14862			} else {
14863				var $scrollTopDistance = $($hash).offset().top - nectarDOMInfo.adminBarHeight + 1;
14864			}
14865
14866			if($('body[data-hhun="1"]').length > 0 && $('#header-outer[data-remove-fixed="1"]').length == 0) {
14867				//alter offset 
14868				if($('#header-outer.detached').length == 0 || $that.parents('.page-submenu[data-sticky="true"]').length > 0) 
14869					$scrollTopDistance = $scrollTopDistance + $headerNavSpace;
14870
14871				//hide top header
14872				if($that.parents('.page-submenu[data-sticky="true"]').length > 0) { 
14873					$('#header-outer.detached').addClass('invisible');
14874					$('.page-submenu').addClass('header-not-visible').css('transform','translateY(0px)');
14875				}
14876			} 
14877
14878			var $pageSubMenu = ($that.parents('.page-submenu[data-sticky="true"]').length > 0) ? $that.parents('.page-submenu').height() : 0;
14879			
14880			 if($('body.material').length > 0 && 
14881			 		$('#header-secondary-outer').length > 0 &&
14882			    $('body[data-hhun="1"]').length == 0 && 
14883			    $('#header-outer[data-remove-fixed="1"]').length == 0 && 
14884					!$('body').hasClass('mobile')) { 
14885						
14886						var $headerSecondary = $('#header-secondary-outer').height();
14887						
14888				} else {
14889						var $headerSecondary = 0;
14890				}
14891
14892			nectar_scrollToY($scrollTopDistance - $pageSubMenu + $headerSecondary, 700, 'easeInOutQuint');
14893			
14894
14895		},$timeoutVar);
14896		
14897
14898		e.preventDefault();
14899
14900	}
14901
14902	if($hash == '#top') {
14903		//side widget area click
14904		if($(this).parents('#slide-out-widget-area').length > 0){
14905			$('#slide-out-widget-area .slide_out_area_close').trigger('click');
14906		}
14907	}
14908
14909
14910});
14911
14912
14913
14914}
14915
14916
14917
14918
14919function searchResultMasonry() {
14920	var $searchContainer = $('#search-results');
14921	var $dividerNum = ($searchContainer.is('[data-layout="masonry-no-sidebar"]')) ? 4 : 3;
14922	
14923	$searchContainer.imagesLoaded(function(){
14924		
14925		$searchContainer.isotope({
14926			 itemSelector: '.result',
14927			 layoutMode: 'packery',
14928			 packery: { columnWidth: $('#search-results').width() / $dividerNum }
14929		});
14930		
14931		$searchContainer.find('article').css('opacity','1');
14932		
14933	});
14934				
14935
14936	$(window).resize(function(){
14937		 $searchContainer.isotope({
14938				layoutMode: 'packery',
14939				packery: { columnWidth: $('#search-results').width() / $dividerNum }
14940		 });
14941	});
14942	
14943}
14944
14945if($('body.search-results').length > 0 && $('#search-results article').length > 0 && $('#search-results[data-layout="list-no-sidebar"]').length == 0) { searchResultMasonry(); }
14946
14947
14948
14949	//portfolio colors
14950	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 ) {
14951		var portfolioColorCss = '';
14952		$('.portfolio-items .col').each(function(){
14953			var $titleColor = $(this).attr('data-title-color');
14954			var $subTitleColor = $(this).attr('data-subtitle-color');
14955
14956			 if($titleColor.length > 0 ) { 
14957			 	portfolioColorCss += '.col[data-title-color="'+$titleColor+'"] .vert-center h3, .portfolio-items[data-ps="6"] .col[data-title-color="'+$titleColor+'"] .work-meta h4 { color: '+$titleColor+'!important; } ';
14958			 	portfolioColorCss += ' .portfolio-items[data-ps="8"] .col[data-title-color="'+$titleColor+'"] .line { background-color: '+$titleColor+'; }';
14959			 	portfolioColorCss += '.portfolio-items[data-ps="8"] .col[data-title-color="'+$titleColor+'"] .next-arrow line { stroke: '+$titleColor+'; } ';
14960			 }
14961			 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+'; } ';
14962	
14963		});
14964
14965
14966		var head = document.head || document.getElementsByTagName('head')[0];
14967		var style = document.createElement('style');
14968
14969			style.type = 'text/css';
14970		if (style.styleSheet){
14971		  style.styleSheet.cssText = portfolioColorCss;
14972		} else {
14973		  style.appendChild(document.createTextNode(portfolioColorCss));
14974		}
14975
14976		head.appendChild(style);
14977	}
14978
14979	//bottom controls 2
14980	$('body').on('mouseleave','.container-wrap[data-nav-pos="after_project_2"] #portfolio-nav ul li, .blog_next_prev_buttons[data-style="fullwidth_next_prev"] ul li',function(){
14981		$(this).addClass('mouse-leaving');
14982	});	
14983
14984	// masonryPortfolio
14985
14986	var $portfolio_containers = [];
14987
14988	$('.portfolio-items:not(.carousel)').each(function(i){
14989		$portfolio_containers[i] = $(this);
14990	});
14991
14992	function masonryPortfolioInit() {
14993
14994		$portfolio_containers = [];
14995		$('.portfolio-items:not(.carousel)').each(function(i){
14996			$portfolio_containers[i] = $(this);
14997		});
14998
14999		//// cache window
15000		var $window = jQuery(window);	
15001		
15002			
15003			$.each($portfolio_containers,function(i){
15004
15005				
15006				//// start up isotope with default settings
15007				$portfolio_containers[i].imagesLoaded(function(){
15008					
15009					//verify smooth scorlling
15010					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') } 
15011					
15012					//transformns enabled logic
15013					var $isoUseTransforms = true;
15014					
15015					//Panr 
15016					if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
15017
15018						$isoUseTransforms = true;
15019						
15020					}
15021
15022					piVertCenter();
15023
15024					//initial call to setup isotope
15025					var $layoutMode = ( $portfolio_containers[i].hasClass('masonry-items')) ? 'packery' : 'fitRows';
15026					var $startingFilter = ($portfolio_containers[i].attr('data-starting-filter') != '' && $portfolio_containers[i].attr('data-starting-filter') != 'default') ? '.' + $portfolio_containers[i].attr('data-starting-filter') : '*';
15027
15028					reLayout();
15029					
15030					$portfolio_containers[i].addClass('isotope-activated');
15031					
15032					$portfolio_containers[i].isotope({
15033					  itemSelector : '.element',
15034					  filter: $startingFilter,
15035					  layoutMode: $layoutMode,
15036					  transitionDuration: '0.6s',
15037					  packery: {
15038						 gutter: 0
15039					  }
15040					}).isotope( 'layout' );
15041					
15042					
15043					if($startingFilter != '*'){
15044						$('.portfolio-filters ul a[data-filter="'+$startingFilter+'"], .portfolio-filters-inline ul a[data-filter="'+$startingFilter+'"]').click();
15045					}
15046
15047					//call the reLayout to get things rollin'
15048					masonryZindex();
15049					setTimeout(function(){masonryZindex(); },800);
15050					
15051				
15052					
15053					//inside fwc fix
15054					if($portfolio_containers[i].parents('.full-width-content').length > 0) { setTimeout(function(){ fullWidthContentColumns(); },200);  }
15055
15056					//fadeout the loading animation
15057					$('.portfolio-loading').stop(true,true).fadeOut(200);
15058					
15059					//fadeIn items one by one
15060					if($portfolio_containers[i].find('.inner-wrap').attr('data-animation') == 'none') {
15061						$portfolio_containers[i].find('.inner-wrap').removeClass('animated');
15062					} 
15063
15064			
15065				});
15066				
15067
15068
15069			});//each
15070			
15071			if($portfolio_containers.length > 0) {
15072				$window.resize( reLayout );
15073
15074				$window.smartresize( function(){
15075					setTimeout(masonryZindex,700);
15076				});
15077			}
15078			
15079		
15080
15081	}
15082
15083	masonryPortfolioInit();
15084
15085	function portfolioLoadIn() {
15086
15087		$($fullscreenSelector+'.portfolio-items').each(function(){
15088
15089			var $portfolioOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '90%';
15090
15091			if($(this).find('.inner-wrap').attr('data-animation') == 'none') return;
15092		
15093			$(this).find('.col').each(function(i){
15094
15095				var $that = $(this);
15096
15097				//loaded visible
15098				if($(this).visible(true) || $(this).parents('#nectar_fullscreen_rows').length > 0) {
15099
15100					var $portfolioAnimationDelay = ($that.is('[data-masonry-type="photography"].masonry-items')) ? 90 : 115;
15101					$(this).delay($portfolioAnimationDelay *i).queue(function(next){
15102					    $(this).addClass("animated-in");
15103					    next();
15104					});
15105
15106				} else {
15107
15108					//not already visible
15109					var waypoint = new Waypoint({
15110		 			element: $that,
15111		 			 handler: function(direction) {
15112						
15113						if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
15114						     waypoint.destroy();
15115						     return;
15116						}
15117
15118						var $portfolioAnimationDelay = ($that.is('[data-masonry-type="photography"].masonry-items')) ? 85 : 100;
15119					
15120						setTimeout(function(){
15121							$that.addClass("animated-in");
15122						},$portfolioAnimationDelay * $that.attr('data-delay-amount'));
15123					
15124						
15125						waypoint.destroy();
15126					},
15127					offset: $portfolioOffsetPos
15128
15129					}); //waypoint
15130				}
15131
15132			}); //each
15133		}); //each
15134					
15135	}
15136
15137
15138	//perspective load in
15139	if($('.portfolio-items .inner-wrap[data-animation="perspective"]').length > 0 || $('.posts-container[data-load-animation="perspective"]').length > 0) {
15140
15141		var lastScrollTop = $(window).scrollTop();
15142
15143		$('.portfolio-items, .posts-container[data-load-animation="perspective"]').css('perspective-origin','50% '+ (lastScrollTop + $(window).height()) + 'px');
15144
15145		requestAnimationFrame(updatePerspectiveOrigin);
15146		
15147		function updatePerspectiveOrigin() {
15148
15149			var scrollTop = $(window).scrollTop();
15150
15151			if (lastScrollTop === scrollTop) {
15152				requestAnimationFrame(updatePerspectiveOrigin);
15153				return;
15154			} else {
15155				lastScrollTop = scrollTop;
15156				$('.portfolio-items,.posts-container[data-load-animation="perspective"]').css('perspective-origin','50% '+ (lastScrollTop + $(window).height()) + 'px');
15157				requestAnimationFrame(updatePerspectiveOrigin);
15158			}
15159		}
15160
15161	}
15162
15163	var mediaQuerySize;
15164	function reLayout() {
15165
15166		clearTimeout(clearIsoAnimation);
15167	    $('.portfolio-items .col').addClass('no-transition');
15168	    clearIsoAnimation = setTimeout(function(){  $('.portfolio-items .col').removeClass('no-transition'); },700); 
15169
15170		var windowSize = $window.width();
15171		var masonryObj;
15172		var masonryObjHolder = [];
15173
15174
15175		//user defined cols
15176		var userDefinedColWidth;
15177
15178		$.each($portfolio_containers,function(i,v){
15179
15180			if( $portfolio_containers[i].attr('data-user-defined-cols') == 'span4') {
15181				userDefinedColWidth = 3
15182			} 
15183			
15184			else if( $portfolio_containers[i].attr('data-user-defined-cols') == 'span3') {
15185				userDefinedColWidth = 4
15186			} 
15187			
15188			var isFullWidth = $portfolio_containers[i].attr('data-col-num') == 'elastic';
15189			
15190			
15191			//chrome 33 approved method for getting column sizing
15192			if(window.innerWidth > 1600){
15193				
15194				if($portfolio_containers[i].hasClass('fullwidth-constrained')) {
15195					if($portfolio_containers[i].is('[data-masonry-type="photography"]')) {
15196						mediaQuerySize = 'three';
15197					} else {
15198						mediaQuerySize = 'four';
15199					}
15200	
15201				} else {
15202					if($portfolio_containers[i].hasClass('constrain-max-cols')) {
15203						mediaQuerySize = 'four';
15204					} else {
15205						mediaQuerySize = 'five';
15206					}
15207				}
15208				
15209			} else if(window.innerWidth <= 1600 && window.innerWidth > 1300){
15210
15211				if($portfolio_containers[i].hasClass('fullwidth-constrained')) {
15212					if($portfolio_containers[i].is('[data-masonry-type="photography"]')) {
15213						mediaQuerySize = 'three';
15214					} else {
15215						mediaQuerySize = 'four';
15216					}
15217				} else {
15218					mediaQuerySize = 'four';
15219				}
15220			} else if(window.innerWidth <= 1300 && window.innerWidth > 990){
15221				
15222				if($portfolio_containers[i].hasClass('constrain-max-cols')) {
15223					mediaQuerySize = 'four';
15224				} else {
15225					mediaQuerySize = 'three';
15226				}
15227				
15228			} else if(window.innerWidth <= 990 && window.innerWidth > 470){
15229				mediaQuerySize = 'two';
15230			} else if(window.innerWidth <= 470){
15231				mediaQuerySize = 'one';
15232			}
15233			
15234			//boxed
15235			if($('#boxed').length > 0) {
15236				if(window.innerWidth > 1300){
15237					mediaQuerySize = 'four';
15238				} else if(window.innerWidth < 1300 && window.innerWidth > 990){
15239					
15240					if($portfolio_containers[i].hasClass('constrain-max-cols')) {
15241						mediaQuerySize = 'four';
15242					} else {
15243						mediaQuerySize = 'three';
15244					}
15245
15246				} else if(window.innerWidth < 990){
15247					mediaQuerySize = 'one';
15248				}
15249				
15250			}
15251			
15252			//change masonry columns depending on screen size
15253			var colWidth;
15254			
15255			switch (mediaQuerySize) {
15256				case 'five':
15257					(isFullWidth) ? colWidth = 5 : colWidth = userDefinedColWidth;
15258					//change cols for photography
15259					if(isFullWidth && $portfolio_containers[i].is('[data-masonry-type="photography"]')) colWidth = 6;
15260
15261					masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
15262				break;
15263				
15264				case 'four':
15265					(isFullWidth) ? colWidth = 4 : colWidth = userDefinedColWidth;
15266					//change cols for photography
15267					if(isFullWidth && $portfolio_containers[i].is('[data-masonry-type="photography"]')) colWidth = 5;
15268
15269					masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
15270				break;
15271				
15272				case 'three':
15273					(isFullWidth) ? colWidth = 3 : colWidth = userDefinedColWidth;
15274					//change cols for photography
15275					if(isFullWidth && $portfolio_containers[i].is('[data-masonry-type="photography"]')) colWidth = 4;
15276					
15277					masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
15278				break;
15279				
15280				case 'two':
15281					masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / 2) };
15282				break;
15283				
15284				case 'one':
15285					masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / 1) };
15286				break;
15287			}
15288
15289
15290			 //set widths
15291			 portfolioItemWidths(i,v);
15292			
15293
15294			//sizing for large items
15295			if(!$portfolio_containers[i].is('[data-bypass-cropping="true"]')) {
15296				
15297				if( $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:visible').length > 0 || $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="wide"]:visible').length > 0 || $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"]:visible').length > 0 || $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="wide_tall"]:visible').length > 0) {
15298
15299					var $gutterSize = ($portfolio_containers[i].is('[data-gutter*="px"]') && $portfolio_containers[i].attr('data-gutter').length > 0 && $portfolio_containers[i].attr('data-gutter') != 'none') ? parseInt($portfolio_containers[i].attr('data-gutter')) : 0;
15300					var multipler = (window.innerWidth > 470) ? 2 : 1;
15301
15302					//reset height for calcs
15303					$itemClassForSizing = 'regular';
15304
15305					if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:visible').length == 0 && $portfolio_containers[i].find('.col.elastic-portfolio-item.wide:visible').length > 0) {
15306						$itemClassForSizing = 'wide';
15307					} else if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:visible').length == 0 && $portfolio_containers[i].find('.col.elastic-portfolio-item.wide_tall:visible').length > 0) {
15308						$itemClassForSizing = 'wide_tall';
15309						multipler = 1;
15310					} else if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:visible').length == 0 && $portfolio_containers[i].find('.col.elastic-portfolio-item.tall:visible').length > 0) {
15311						$itemClassForSizing = 'tall';
15312						multipler = 1;
15313					}
15314
15315				    $portfolio_containers[i].find('.col.elastic-portfolio-item.'+$itemClassForSizing+' img').css('height','auto');
15316
15317					var tallColHeight = $portfolio_containers[i].find('.col.elastic-portfolio-item.'+$itemClassForSizing+':visible img').height();
15318					
15319					 $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');
15320					 $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img:not(.custom-thumbnail)').css('height',(tallColHeight*multipler) + ($gutterSize*2));
15321
15322					 if($itemClassForSizing == 'regular' || $itemClassForSizing == 'wide') {
15323					 	$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);
15324					 } else {
15325					 	$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/2) - ($gutterSize*2));
15326					 }
15327
15328					 $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 );
15329					 
15330					 if($itemClassForSizing == 'regular' || $itemClassForSizing == 'wide') {
15331						 $portfolio_containers[i].find('.col.elastic-portfolio-item.regular .parallaxImg, .col.elastic-portfolio-item.wide .parallaxImg').css('height',tallColHeight);
15332					} else {
15333					 	 $portfolio_containers[i].find('.col.elastic-portfolio-item.regular .parallaxImg, .col.elastic-portfolio-item.wide .parallaxImg').css('height',(tallColHeight/2) - ($gutterSize*2));
15334					 }
15335
15336				} else {
15337					$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');
15338				}
15339			
15340			} //bypass cropping option
15341
15342			//non masonry
15343			if($portfolio_containers[i].hasClass('no-masonry') && $portfolio_containers[i].find('.col:first:visible').length > 0 && $portfolio_containers[i].parents('.wpb_gallery').length == 0){
15344			  
15345				//skip style 9
15346				if( !$portfolio_containers[i].is('[data-ps="9"]') && !$portfolio_containers[i].is('[data-bypass-cropping="true"]') ) {
15347
15348				   	//reset height for calcs
15349			   	   $portfolio_containers[i].find('.col img').css('height','auto');
15350			   	   var tallColHeight = $portfolio_containers[i].find('.col:first:visible img').height();
15351			   	   $portfolio_containers[i].find('.col img:not(.custom-thumbnail)').css('height',tallColHeight);
15352			   	   $portfolio_containers[i].find('.col .parallaxImg').css('height',tallColHeight);
15353				 }
15354				 
15355			}
15356	
15357
15358
15359			masonryObjHolder[i] = masonryObj;
15360			
15361			if($portfolio_containers[i].isotope()) $portfolio_containers[i].isotope( 'layout' ); 
15362				
15363			
15364
15365		}); //each
15366	
15367	}
15368
15369	function portfolioItemWidths(i,v) {
15370		// passing each index value where function is called first to avoid nested loops
15371
15372		 		var isFullWidth = $portfolio_containers[i].attr('data-col-num') == 'elastic';
15373
15374		 		if(isFullWidth) { 
15375
15376				 	var $colSize = 4;
15377				 	var $mult = (mediaQuerySize == 'one') ? 1 : 2;
15378				 	if(mediaQuerySize == 'five') $colSize = 5;
15379				 	if(mediaQuerySize == 'four') $colSize = 4;
15380				 	if(mediaQuerySize == 'three') $colSize = 3;
15381				 	if(mediaQuerySize == 'two') $colSize = 2;
15382				 	if(mediaQuerySize == 'one') $colSize = 1;
15383				 	if($(v).is('[data-ps="6"]') && $colSize == 5) $colSize = 4;
15384
15385				 	//photography
15386				 	if(isFullWidth && $portfolio_containers[i].is('[data-masonry-type="photography"]') && !$portfolio_containers[i].hasClass('no-masonry')) {
15387				 		if(mediaQuerySize == 'five') $colSize = 6;
15388				 		if(mediaQuerySize == 'four') $colSize = 5;
15389				 		if(mediaQuerySize == 'three') $colSize = 4;
15390				 	}
15391				 	
15392				 	if($(v).width() % $colSize == 0) {
15393					 	$(v).find('.elastic-portfolio-item:not(.wide):not(.wide_tall)').css('width',Math.floor($(v).width()/$colSize) +'px');
15394					 	$(v).find('.elastic-portfolio-item.wide, .elastic-portfolio-item.wide_tall').css('width',Math.floor($(v).width()/$colSize*$mult) +'px');
15395					 } else {
15396					 	var $loopEndNum = ($(window).width() > 1000) ? 6 : 3;
15397					 	if($portfolio_containers[i].hasClass('fullwidth-constrained') && $(window).width() > 1000) $loopEndNum = 4;
15398					 	//find closest number to give 0
15399					 	for(var i = 1; i<$loopEndNum; i++) {
15400
15401					 		if(($(v).width() - i) % $colSize == 0) {
15402					 			$(v).find('.elastic-portfolio-item:not(.wide):not(.wide_tall)').css('width',($(v).width()- i)/$colSize +'px');
15403					 			$(v).find('.elastic-portfolio-item.wide, .elastic-portfolio-item.wide_tall').css('width',($(v).width()-i)/$colSize*$mult +'px');
15404					 		}
15405
15406					 	}
15407					 }
15408
15409				} // isFullWidth
15410
15411	}
15412
15413	//z-index for masonry
15414	function masonryZindex(){
15415
15416		//escape if no browser support
15417		if($('body .portfolio-items:not(".carousel") > .col').length > 0 && $('body .portfolio-items:not(".carousel") > .col').offset().left) {
15418
15419			$('body .portfolio-items:not(".carousel")').each(function(){
15420
15421				var $coords = {};
15422				var $zindexRelation = {};
15423				var $that = $(this);
15424
15425				$(this).find('> .col').each(function(){
15426					var $itemOffset = $(this).offset();
15427					$itemOffset = $itemOffset.left;
15428
15429					$coords[$(this).index()] = $itemOffset;
15430					$(this).css('z-index',Math.abs(Math.floor($(this).offset().left/20)));
15431				});
15432
15433				var $corrdsArr = $.map($coords, function (value) { return value; });
15434
15435				$corrdsArr = removeDuplicates($corrdsArr);
15436				$corrdsArr.sort(function(a,b){return a-b});
15437
15438				for(var i = 0; i < $corrdsArr.length; i++){
15439					$zindexRelation[$corrdsArr[i]] = i; 
15440				}
15441		
15442				$.each($coords,function(k,v){
15443					
15444					var $zindex;
15445					var $coordCache = v;
15446					$.each($zindexRelation,function(k,v){
15447						if($coordCache == k) {
15448							$zindex = v;
15449						}
15450					});
15451				
15452					$that.find('> .col:eq('+k+')').attr('data-delay-amount',$zindex);
15453				});
15454
15455				
15456			});
15457			
15458			
15459			
15460		}
15461
15462
15463	}
15464
15465	function blogMasonryZindex(){
15466	
15467		//escape if no browser support
15468		if($('body .post-area .masonry-blog-item').length > 0 && $('body .post-area .masonry-blog-item').offset().left) {
15469		
15470			$('body .post-area.masonry').each(function(){
15471				
15472				var $coords = {};
15473				var $zindexRelation = {};
15474				var $that = $(this);
15475
15476				$(this).find('.masonry-blog-item').each(function(){
15477					var $itemOffset = $(this).offset();
15478					$itemOffset = $itemOffset.left;
15479
15480					$coords[$(this).index()] = $itemOffset;
15481					$(this).css('z-index',Math.abs(Math.floor($(this).offset().left/20)));
15482				});
15483
15484				var $corrdsArr = $.map($coords, function (value) { return value; });
15485
15486				$corrdsArr = removeDuplicates($corrdsArr);
15487				$corrdsArr.sort(function(a,b){return a-b});
15488		
15489				for(var i = 0; i < $corrdsArr.length; i++){
15490					$zindexRelation[$corrdsArr[i]] = i*1; 
15491				}
15492		
15493				$.each($coords,function(k,v){
15494					
15495					var $zindex;
15496					var $coordCache = v;
15497					$.each($zindexRelation,function(k,v){
15498						if($coordCache == k) {
15499							$zindex = v;
15500						}
15501					});
15502		
15503					$that.find('.masonry-blog-item:eq('+k+')').css('z-index',$zindex).attr('data-delay-amount',$zindex);
15504					
15505				});
15506			
15507			});
15508			
15509		}
15510		
15511	}
15512	
15513	function matrixToArray(matrix) {
15514	    return matrix.substr(7, matrix.length - 8).split(', ');
15515	}
15516	
15517	function removeDuplicates(inputArray) {
15518        var i;
15519        var len = inputArray.length;
15520        var outputArray = [];
15521        var temp = {};
15522
15523        for (i = 0; i < len; i++) {
15524            temp[inputArray[i]] = 0;
15525        }
15526        for (i in temp) {
15527            outputArray.push(i);
15528        }
15529        return outputArray;
15530    }
15531
15532    //// filter items when filter link is clicked
15533	var clearIsoAnimation = null;
15534	var $checkForScrollBar = null;
15535
15536
15537	//number portfolios so multiple sortable ones can work easily on same page
15538	$('.portfolio-items:not(".carousel")').each(function(i){
15539		$(this).attr('instance',i);
15540		$(this).parent().parent().find('div[class^=portfolio-filters]').attr('instance',i);
15541	});
15542
15543    function isoClickFilter(){
15544		 var $timeout;		 
15545		 if(window.innerWidth > 690 && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
15546		 	
15547			  
15548			 clearTimeout($timeout);
15549			 $timeout = setTimeout(function(){masonryZindex();  },600);
15550
15551			  
15552		 }
15553		  
15554		  var selector = $(this).attr('data-filter');
15555		  var $instance = $(this).parents('div[class^=portfolio-filters]').attr('instance');
15556
15557		  $.each($portfolio_containers,function(i){
15558		  	if($portfolio_containers[i].attr('instance') == $instance) { 
15559		  		$portfolio_containers[i].isotope({ filter: selector }).attr('data-current-cat',selector);
15560
15561		  		//fade in all incase user hasn't scrolled down yet
15562		  		if($portfolio_containers[i].find('.inner-wrap[data-animation="none"]').length == 0) {
15563			   		$portfolio_containers[i].find('.col').addClass('animated-in');
15564				}
15565		  	}
15566		  });
15567
15568
15569
15570
15571		  //active classes
15572		  $(this).parent().parent().find('li a').removeClass('active');
15573		  $(this).addClass('active');
15574		  
15575		  //update pp
15576		  if($('.portfolio-items a[rel^="prettyPhoto"]').length > 0) {
15577		  	setTimeout(updatePrettyPhotoGallery,170);
15578		  }
15579
15580		  else {
15581		  	setTimeout(updateMagPrettyPhotoGallery,170);
15582		  }
15583
15584		  return false;
15585	}
15586
15587	////filter event
15588	$('body').on('click','.portfolio-filters ul li a, .portfolio-filters-inline ul li a', isoClickFilter);
15589
15590
15591	function updatePrettyPhotoGallery(){
15592		$('.portfolio-items').each(function(){
15593
15594			if($(this).find('a[rel^="prettyPhoto"]').length > 0) {
15595
15596			var $unique_id = Math.floor(Math.random()*10000);
15597			var $currentCat = $(this).attr('data-current-cat');
15598			$(this).find('.col'+$currentCat).find('a[rel^="prettyPhoto"]').attr('rel','prettyPhoto['+$unique_id+'_sorted]');
15599			
15600			} 
15601			
15602		});
15603	}
15604
15605	function updateMagPrettyPhotoGallery(){
15606		$('.portfolio-items').each(function(){
15607
15608			var $currentCat = $(this).attr('data-current-cat');
15609			var $unique_id = Math.floor(Math.random()*10000);
15610			
15611			if($(this).is('[data-lightbox-only="true"]')){
15612				
15613					$(this).find('.col').each(function(){
15614		
15615						$(this).find('a.gallery').removeClass('gallery').removeClass('magnific');
15616						
15617						if($(this).is($currentCat)) {
15618							
15619							//parallax styles
15620							if($(this).find('.parallaxImg-wrap').length > 0) {
15621								
15622									if($('body[data-ls="fancybox"]').length > 0) {
15623										$(this).find('.work-item > a').attr('data-fancybox','group_'+$unique_id);
15624									} else {
15625										$(this).find('.work-item > a').addClass('gallery').addClass('magnific');
15626									}
15627									
15628							} else {
15629								//others
15630								
15631									if($('body[data-ls="fancybox"]').length > 0) {
15632										$(this).find('.work-item a').attr('data-fancybox','group_'+$unique_id);
15633									} else {
15634										$(this).find('.work-info a').addClass('gallery').addClass('magnific');
15635									}
15636									
15637							}
15638							
15639						}
15640		
15641					});
15642				
15643			}
15644			
15645			else if ($(this).find('.work-item.style-1').length > 0){
15646				
15647					$(this).find('.col').each(function(){
15648		
15649						$(this).find('a.gallery').removeClass('gallery').removeClass('magnific');
15650						
15651						if($(this).is($currentCat)) {
15652							
15653								if($('body[data-ls="fancybox"]').length > 0) {
15654									$(this).find('.work-info .vert-center a:first-of-type').attr('data-fancybox','group_'+$unique_id);
15655								} 
15656								else {
15657									$(this).find('.work-info .vert-center a:first-of-type').addClass('gallery').addClass('magnific');
15658								}
15659								
15660						}
15661		
15662					});
15663			}
15664			
15665		
15666			
15667		});
15668	}
15669
15670
15671
15672	var $blog_containers = [];
15673
15674	$('.posts-container').each(function(i){
15675		$blog_containers[i] = $(this);
15676	});
15677
15678  function masonryBlogInit() {
15679
15680		//// cache window
15681		var $window = jQuery(window);	
15682		
15683			
15684		$.each($blog_containers,function(i){
15685
15686			
15687				if($blog_containers[i].parent().hasClass('masonry') && !$blog_containers[i].parent().hasClass('auto_meta_overlaid_spaced')) { 
15688					
15689					$blog_containers[i].find('article').addClass('masonry-blog-item');
15690					
15691					if($blog_containers[i].parents('.masonry.classic').length > 0) {
15692						$blog_containers[i].find('article').prepend('<span class="bottom-line"></span>');
15693					}
15694					
15695					//move the meta to the bottom
15696					$blog_containers[i].find('article').each(function(){
15697						
15698						var $metaClone = $(this).find('.post-meta').clone();
15699
15700						$(this).find('.post-meta').remove();
15701
15702						if($blog_containers[i].parents('.post-area.meta_overlaid').length > 0){
15703							$(this).find('.post-header h2').after($metaClone);
15704						} else {
15705							$(this).find('.content-inner').after($metaClone);
15706						}
15707						
15708						$blog_containers[i].addClass('meta-moved');
15709						
15710					});
15711				
15712					
15713					if($blog_containers[i].parent().hasClass('masonry') && $blog_containers[i].parents('.blog-fullwidth-wrap').length > 0){
15714
15715						//page header animation fix
15716						if( $blog_containers[i].parents('.wpb_row').length > 0 ) $blog_containers[i].parents('.wpb_row').css('z-index',100);
15717
15718						if(!$blog_containers[i].parent().hasClass('meta_overlaid') && !$blog_containers[i].parent().hasClass('auto_meta_overlaid_spaced')) {
15719
15720							if($blog_containers[i].parent().hasClass('classic_enhanced')) {
15721								$blog_containers[i].parent().parents('.full-width-content').css({
15722									'padding' : '0px 0.2% 0px 2.4%'
15723								});
15724							} else {
15725								$blog_containers[i].parent().parents('.full-width-content').css({
15726									'padding' : '0px 0.2% 0px 3.2%'
15727								});
15728							}
15729							
15730						} else {
15731							$blog_containers[i].parent().parents('.full-width-content').addClass('meta-overlaid');
15732							$('.container-wrap').addClass('meta_overlaid_blog');
15733						}
15734
15735						fullWidthSections(); 
15736					}
15737					
15738					var $cols = 3;
15739					var $element = $blog_containers[i];
15740					
15741					if($blog_containers[i].find('img').length == 0) $element = $('<img />');
15742					
15743					imagesLoaded($element,function(instance){
15744						
15745						var $multiplier;
15746						
15747						if($('body').hasClass('mobile') || $blog_containers[i].parents('.post-area').hasClass('span_9')) {
15748							$cols = 2;
15749						}
15750
15751						//set img as BG if masonry classic enhanced
15752						if($blog_containers[i].parent().hasClass('classic_enhanced')){
15753							$blog_containers[i].find('.large_featured.has-post-thumbnail .post-featured-img, .wide_tall.has-post-thumbnail .post-featured-img').each(function(){
15754								var $src = $(this).find('img').attr('src');
15755								$(this).css('background-image','url('+$src+')');
15756							});
15757
15758							$blog_containers[i].find('.large_featured .nectar-flickity, .wide_tall .nectar-flickity').each(function(){
15759
15760								$(this).find('.cell').each(function(){
15761									var $src = $(this).find('img').attr('src');
15762									$(this).css('background-image','url('+$src+')');
15763								});
15764								
15765							});
15766						}
15767
15768						$cols = blogColumnNumbCalcs($blog_containers[i]);
15769						blogHeightCalcs($blog_containers[i], $cols);
15770
15771						if($blog_containers[i].parents('.post-area.meta_overlaid').length > 0) {
15772							$blog_containers[i].isotope({
15773							   itemSelector: 'article',
15774							   transitionDuration: '0s',
15775							   layoutMode: 'packery',
15776							   packery: { 
15777							   	 gutter: 0
15778							   	}
15779							}).isotope( 'layout' );
15780
15781						   
15782						} else if ($blog_containers[i].parents('.auto_meta_overlaid_spaced').length > 0) {
15783							
15784							$multiplier = .025;
15785							if($blog_containers[i].parents('.blog-fullwidth-wrap').length > 0) {
15786									$multiplier = .02;
15787							}
15788							
15789							$blog_containers[i].isotope({
15790								layoutMode: 'packery',
15791								transitionDuration: '0s',
15792								packery: {
15793									 gutter: 0
15794								}
15795						 });
15796						 
15797						}  else {
15798						   if($blog_containers[i].parent().hasClass('classic_enhanced')) {
15799							   	if($blog_containers[i].parents('.span_9.masonry').length == 0) {
15800							   		$multiplier = (window.innerWidth >= 1600) ? .015 : .02;
15801							   	} else {
15802							   		$multiplier = .04;
15803							    } 
15804						    }
15805							else {
15806 								 		$multiplier = ($blog_containers[i].parents('.span_9.masonry').length == 0) ? .03: .055;
15807 							 }
15808						   
15809							$blog_containers[i].isotope({
15810							   itemSelector: 'article',
15811							   transitionDuration: '0s',
15812							   layoutMode: 'packery',
15813							   packery: { 
15814							   	 gutter: $blog_containers[i].parents('.post-area').width()*$multiplier
15815							   	}
15816							}).isotope( 'layout' );
15817						}
15818
15819						blogLoadIn($blog_containers[i]);
15820						flickityBlogInit();
15821						
15822						$(window).trigger('resize');
15823
15824							
15825					});
15826					
15827					$(window).resize(function(){
15828						
15829
15830					   //size all items in grid 
15831					   //sizing for large items
15832						 if(typeof $blog_containers[i] !== 'undefined') { 
15833							  
15834								var $multiplier;
15835								
15836							  $cols = blogColumnNumbCalcs($blog_containers[i]);
15837								blogHeightCalcs($blog_containers[i], $cols);
15838								
15839								if($blog_containers[i].parents('.post-area.meta_overlaid').length > 0) {
15840								
15841								    $blog_containers[i].isotope({
15842								      layoutMode: 'packery',
15843								      packery: {
15844								      	 gutter: 0
15845								      }
15846								   });
15847								} else if ($blog_containers[i].parents('.auto_meta_overlaid_spaced').length > 0) {
15848									
15849									$multiplier = .025;
15850									if($blog_containers[i].parents('.blog-fullwidth-wrap').length > 0) {
15851											$multiplier = .02;
15852									}
15853									
15854									$blog_containers[i].isotope({
15855										layoutMode: 'packery',
15856										transitionDuration: '0s',
15857										packery: {
15858											 gutter: 0
15859										}
15860								 });
15861								} else {
15862								   
15863								   if($blog_containers[i].parent().hasClass('classic_enhanced')) {
15864								   		if($blog_containers[i].parents('.span_9.masonry').length == 0) {
15865									   		$multiplier = (window.innerWidth >= 1600) ? .015 : .02;
15866									   	} else {
15867									   		$multiplier = .04;
15868									    } 
15869								   } else {
15870										 		$multiplier = ($blog_containers[i].parents('.span_9.masonry').length == 0) ? .03: .055;
15871												if($blog_containers[i].parents('.blog-fullwidth-wrap').length > 0) {
15872														$multiplier = .02;
15873												}
15874									 } 
15875								  
15876								   $blog_containers[i].isotope({
15877								   	layoutMode: 'packery',
15878								      packery: { 
15879								      	gutter: $blog_containers[i].parents('.post-area').width()*$multiplier
15880								      }
15881								   });
15882								}
15883								
15884							} // if $blog_containers[i]
15885
15886					});
15887					
15888					
15889			    } else {
15890			    	blogLoadIn($blog_containers[i]);
15891			    }
15892
15893		});
15894		
15895		//set z-index / animation order only once
15896		setTimeout(blogMasonryZindex,700);
15897		$window.smartresize( function(){
15898			setTimeout(blogMasonryZindex,700);
15899		});
15900		
15901	}
15902	
15903	masonryBlogInit();
15904
15905	function blogLoadIn(post_container){
15906
15907
15908		if(post_container.attr('data-load-animation') == 'none') {
15909		
15910			post_container.find('.inner-wrap').removeClass('animated');
15911
15912		} else {
15913
15914			post_container.find('article').each(function(i){
15915
15916				//loaded visible
15917				if($(this).visible(true)) {
15918
15919					$(this).delay(110*i).queue(function(next){
15920					    $(this).addClass("animated-in");
15921					    next();
15922					});
15923
15924
15925				} else {
15926					//not already visible
15927					var $that = $(this);
15928					var waypoint = new Waypoint({
15929
15930			 			element: $that,
15931			 			 handler: function(direction) {
15932							
15933							setTimeout(function(){
15934							    $that.addClass("animated-in");
15935							},80*$that.attr('data-delay-amount'));
15936
15937							waypoint.destroy();
15938						},
15939						offset: '90%'
15940
15941					}); 
15942				}
15943
15944
15945			});
15946	
15947			
15948		}
15949
15950	}
15951
15952	function blogHeightCalcs($posts_container, cols) {
15953		if( $posts_container.parent().hasClass('meta_overlaid') && $posts_container.find('article[class*="regular"]').length > 0) {
15954
15955			//widths
15956			$.each($posts_container,function(i,v){
15957			 	var $colSize = 4;
15958			 	var $mult = (cols == 1) ? 1 : 2;
15959
15960			 	//check if higher than IE9 -- bugs out with width calc
15961			 	if($('html.no-csstransitions').length == 0) {
15962			 		$(v).find('article[class*="regular"]').css('width',Math.floor($(v).width()/cols) +'px');
15963			 		$(v).find('article[class*="tall"]').css('width',Math.floor($(v).width()/cols*$mult) +'px');
15964			 	} else {
15965			 		$('.post-area.masonry').css('width','100%');
15966			 	}
15967			 	
15968			 	
15969			 });
15970
15971			   //reset height for calcs
15972			   $posts_container.find('article[class*="regular"] img').css('height','auto');
15973
15974			   var tallColHeight = Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote") img').first().height());
15975			   var multipler = (window.innerWidth > 690) ? 2 : 1 ;
15976			   $posts_container.find('article[class*="tall"] img, .article.wide img, article.regular img').removeClass('auto-height');
15977			   $posts_container.find('article[class*="tall"] img').css('height',(tallColHeight*multipler));
15978			   $posts_container.find('article[class*="regular"] img').css('height',(tallColHeight));
15979			   //quote/links
15980			   $posts_container.find('article.regular.format-link,article.regular.format-quote').each(function(){
15981
15982			   		if(window.innerWidth > 690) {
15983			   			$(this).css({
15984			  	 			'height': tallColHeight
15985			   			});
15986			   		} else {
15987			   			$(this).css({
15988			  	 			'height': 'auto'
15989			   			});			 		
15990			   		}
15991			  	 	
15992			   	});
15993
15994
15995		} else {
15996			$posts_container.find('article[class*="tall"] img, article.regular img').addClass('auto-height');
15997		}
15998
15999
16000		if( $posts_container.parent().hasClass('classic_enhanced') && $posts_container.find('article[class*="regular"]').length > 0) {
16001			
16002			if($(window).width() > 690 ) {
16003				classicEnhancedSizing($posts_container.find('article:not(.large_featured):not(.wide_tall)'));
16004			}
16005			else { 
16006				classicEnhancedSizing($posts_container.find('article:not(.wide_tall)'));
16007			}
16008
16009			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;
16010
16011			if($(window).width() > 690 ) {
16012				$posts_container.find('article.large_featured, article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
16013			}
16014			else {
16015				$posts_container.find('article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
16016			}
16017
16018		//for when no regular articles exist	
16019		} else if( $posts_container.parent().hasClass('classic_enhanced') && $posts_container.find('article[class*="regular"]').length == 0) {
16020			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;
16021
16022			if($(window).width() > 690 ) {
16023				$posts_container.find('article.large_featured, article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
16024			}
16025			else {
16026				$posts_container.find('article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
16027			}
16028		}
16029
16030		//IE9 fix
16031		if($('html.no-csstransitions').length > 0) 		
16032			$('.post-area.masonry').css('width','100%');
16033			 	
16034			 	
16035	}
16036
16037	function classicEnhancedSizing(elements) {
16038
16039		var tallestCol = 0;
16040		elements.find('.article-content-wrap').css('height','auto');
16041		elements.filter('.has-post-thumbnail').each(function(){
16042			($(this).find('.article-content-wrap').outerHeight(true) > tallestCol) ? tallestCol = $(this).find('.article-content-wrap').outerHeight(true) : tallestCol = tallestCol;
16043		});	
16044		
16045		elements.filter('.has-post-thumbnail').find('.article-content-wrap').css('height',(tallestCol));
16046
16047	}
16048
16049
16050	function blogStickySS() {
16051		$('#sidebar[data-nectar-ss="true"], #sidebar[data-nectar-ss="1"]').each(function(){
16052
16053			//padding from top of screen
16054			var $ssExtraTopSpace = 50;
16055
16056			if($('#header-outer[data-remove-fixed="0"]').length > 0 && $('body[data-hhun="1"]').length == 0 && $('#header-outer[data-format="left-header"]').length == 0) { 
16057			 	$ssExtraTopSpace += $('#header-outer').outerHeight();	
16058				
16059				//resize effect
16060				if($('#header-outer[data-shrink-num][data-header-resize="1"]').length > 0 ) {
16061					 var shrinkNum = 6;		
16062					 var headerPadding2 = parseInt($('#header-outer').attr('data-padding')) - parseInt($('#header-outer').attr('data-padding'))/1.8;
16063					 shrinkNum = $('#header-outer').attr('data-shrink-num');
16064					 $ssExtraTopSpace -= shrinkNum;
16065					 $ssExtraTopSpace -= headerPadding2;
16066				}
16067				
16068				//condesne
16069				if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
16070					
16071						var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
16072						var $secondaryHeader = $('#header-secondary-outer');
16073						
16074						$ssExtraTopSpace = 50;
16075						$ssExtraTopSpace += $('#header-outer').height() - (parseInt($headerSpan9.position().top) - parseInt($('#header-outer #logo').css('margin-top')) ) - parseInt(nectarDOMInfo.secondaryHeaderHeight);
16076				}
16077				
16078
16079			}
16080
16081			if($('#wpadminbar').length > 0) {
16082				$ssExtraTopSpace += $('#wpadminbar').outerHeight();
16083			}
16084
16085 			if($('#header-outer').attr('data-using-secondary') == '1') {
16086				$ssExtraTopSpace += $('#header-secondary-outer').outerHeight();
16087			}
16088			
16089			if($(this).parents('.wpb_widgetised_column').length > 0) {
16090				
16091				if($('body.vc_editor').length > 0) {
16092
16093				} else {
16094						$(this).parents('.wpb_column').theiaStickySidebar({
16095							additionalMarginTop: $ssExtraTopSpace,
16096							updateSidebarHeight: false
16097						});
16098				}
16099				
16100			} 
16101			
16102			else {
16103				$(this).theiaStickySidebar({
16104			      additionalMarginTop: $ssExtraTopSpace,
16105						updateSidebarHeight: false
16106			    });
16107			}
16108			
16109		});
16110	}
16111
16112	if( $().theiaStickySidebar ) {
16113		blogStickySS();
16114	}
16115
16116	var blogMediaQuerySize;
16117	function blogColumnNumbCalcs(post_container){
16118		
16119			 var $cols = 3;
16120				
16121		   if($('body').hasClass('mobile') && window.innerWidth < 990 || post_container.parents('.post-area').hasClass('span_9') && post_container.parents('.post-area.meta_overlaid').length == 0) {
16122			   $cols = 2;
16123		   } else if( post_container.parents('.post-area').hasClass('full-width-content') || post_container.parents('.post-area').parent().hasClass('full-width-content') && $('#boxed').length == 0 || post_container.parents('.post-area.meta_overlaid').length > 0 ){
16124		   		
16125				var windowSize = $(window).width();
16126
16127				
16128				if(window.innerWidth >= 1600){
16129					blogMediaQuerySize = (post_container.parents('.post-area.meta_overlaid').length > 0) ? 'four' :'five';
16130				} else if(window.innerWidth < 1600 && window.innerWidth >= 1300){
16131					blogMediaQuerySize = 'four';
16132				} else if(window.innerWidth < 1300 && window.innerWidth >= 990){
16133					blogMediaQuerySize = (post_container.parents('.post-area.meta_overlaid').length > 0) ? 'four' :'three';
16134				} else if(window.innerWidth < 990 && window.innerWidth >= 470){
16135					blogMediaQuerySize = 'two';
16136				} else if(window.innerWidth < 470){
16137					blogMediaQuerySize = (post_container.parents('.post-area.meta_overlaid').length > 0) ? 'two' :'one';
16138				}
16139			
16140				
16141				//boxed
16142				if($('#boxed').length > 0) {
16143					if(window.innerWidth > 1300){
16144						blogMediaQuerySize = 'four';
16145					} else if(window.innerWidth < 1300 && window.innerWidth > 990){
16146						blogMediaQuerySize = (post_container.parents('.post-area.meta_overlaid').length > 0) ? 'four' :'three';
16147					} else if(window.innerWidth < 990){
16148						blogMediaQuerySize = (post_container.parents('.post-area.meta_overlaid').length > 0) ? 'two' :'one';
16149					}
16150					
16151				}
16152				
16153				
16154				switch (blogMediaQuerySize) {
16155					case 'five':
16156						$cols = 5;
16157					break;
16158					
16159					case 'four':
16160						$cols = 4;
16161					break;
16162					
16163					case 'three':
16164						$cols = 3;
16165					break;
16166					
16167					case 'two':
16168						$cols = 2;
16169					break;
16170					
16171					case 'one':
16172						$cols = 1;
16173					break;
16174				}
16175		   		
16176			
16177		   } else {
16178
16179		   	   $cols = 3;
16180		   }
16181
16182		   return $cols;
16183
16184	}
16185
16186
16187var shrinkNum = 6;
16188		
16189if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
16190
16191headerPadding2 = headerPadding - headerPadding/1.8;
16192
16193$('body').on('click','.section-down-arrow',function(){
16194	
16195	if($(this).parents('.nectar-box-roll').length > 0) return false;
16196
16197	var $currentSection = $(this).parents('#page-header-bg');
16198	var $topDistance = $currentSection.height();
16199	var $offset = ($currentSection.parents('.first-section').length == 0 || $('body[data-transparent-header="false"]').length > 0) ? $currentSection.offset().top : 0;
16200	var $bodyBorderSize = ($('.body-border-top').length > 0 && $(window).width() > 1000) ? $('.body-border-top').height(): 0;
16201	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0) ? 0 : $('#header-space').height();
16202	
16203	var $materialSecondary = 0;
16204	if($('body.material').length > 0 && $('#header-secondary-outer').length > 0) { $materialSecondary = $('#header-secondary-outer').height(); }
16205	
16206	if($('body[data-permanent-transparent="1"]').length == 0) {
16207		//regular
16208		if(!$('body').hasClass('mobile')){
16209			
16210			if($('body[data-hhun="1"]').length > 0 && $('#header-outer[data-remove-fixed="1"]').length == 0) {
16211				$('body,html').stop().animate({
16212					scrollTop: parseInt($topDistance) + $offset + 2 - $bodyBorderSize*2
16213				},1000,'easeInOutCubic')
16214			} 
16215			else {
16216				
16217				$resize = ($('#header-outer[data-header-resize="0"]').length > 0) ? 0 : parseInt(shrinkNum) + headerPadding2*2;
16218				if($('#header-outer[data-remove-fixed="1"]').length > 0) { 
16219					$headerNavSpace = 0;
16220					$offset = 0;
16221				}
16222					
16223				//condesne
16224				if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
16225					
16226						var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
16227						var $secondaryHeader = $('#header-secondary-outer');
16228						
16229						$headerNavSpace = $('#header-outer').height() - (parseInt($headerSpan9.position().top) - parseInt($('#header-outer #logo').css('margin-top')) ) - parseInt(nectarDOMInfo.secondaryHeaderHeight);
16230				}
16231				
16232				
16233				$('body,html').stop().animate({
16234					scrollTop: parseInt($topDistance - $headerNavSpace) +$resize + 3 + $offset + $materialSecondary
16235				},1000,'easeInOutCubic')
16236
16237			}
16238			
16239		} else {
16240			$scrollPos = ($('#header-outer[data-mobile-fixed="1"]').length > 0) ? parseInt($topDistance) - $headerNavSpace + parseInt($currentSection.offset().top) + 2 : parseInt($topDistance) + parseInt($currentSection.offset().top) + 2;
16241			$('body,html').stop().animate({
16242				scrollTop: $scrollPos - $bodyBorderSize*2
16243			},1000,'easeInOutCubic')
16244		}
16245	} else {
16246		//permanent transparent
16247		$('body,html').stop().animate({
16248			scrollTop: parseInt($topDistance) + parseInt($currentSection.offset().top) + 2 - $bodyBorderSize*2
16249		},1000,'easeInOutCubic')
16250	}
16251	return false;
16252});
16253
16254
16255$('body').on('mouseover','.post-area.featured_img_left .grav-wrap .text a, .masonry.material .masonry-blog-item .grav-wrap .text a, .blog-recent[data-style="material"] .grav-wrap .text a',function(){
16256	$(this).parents('.grav-wrap').find('img').addClass('hovered');
16257});
16258$('body').on('mouseleave','.post-area.featured_img_left .grav-wrap .text a, .masonry.material .masonry-blog-item .grav-wrap .text a, .blog-recent[data-style="material"] .grav-wrap .text a',function(){
16259	$(this).parents('.grav-wrap').find('img').removeClass('hovered');
16260});  
16261
16262
16263
16264/*-------------------------------------------------------------------------*/
16265/*	7.	Cross Browser Fixes
16266/*-------------------------------------------------------------------------*/	
16267	 
16268	 function crossBrowserFixes() {
16269	
16270		 
16271		//Fix current class in menu 
16272		if ($("body").hasClass("single-portfolio") || $('body').hasClass("error404") || $('body').hasClass("search-results")) {   
16273			$("li").removeClass("current_page_parent").removeClass("current-menu-ancestor").removeClass('current_page_ancestor');   
16274		}
16275		
16276		//for users updating to 8 with a custom, old header template file
16277		if($('html.js').length == 0) { $('html').removeClass('no-js').addClass('js'); }
16278		
16279		//remove br's from code tag
16280		$('code').find('br').remove();	
16281		
16282		//if a clear is the last div, remove the padding
16283		if($('.container.main-content > .row > div:last-child').hasClass('clear')) {
16284			$('.container.main-content > .row > div:last-child').css('padding-bottom','0');
16285		}
16286		
16287		//homepage recent blog for IE8
16288		$('.container-wrap .blog-recent > div:last-child').addClass('col_last');
16289		
16290		//blog ascend bottom padding
16291		if($('.single .blog_next_prev_buttons').length > 0) $('.container-wrap').css('padding-bottom',0);
16292
16293		//contact form
16294		$('.wpcf7-form p:has(input[type=submit])').css('padding-bottom','0px');
16295
16296		$('.full-width-content .wpcf7-submit').on('click',function(){ setTimeout(function(){ fullWidthContentColumns() },1000); setTimeout(function(){ fullWidthContentColumns() },2000); });
16297		
16298		//no caption home slider fix
16299		$('#featured article').each(function(){
16300			if($(this).find('h2').attr('data-has-caption') == '0') {
16301				$(this).parents('.slide').addClass('no-caption');
16302			}
16303		});
16304		
16305		//add class for IE
16306		var ua = window.navigator.userAgent;
16307		var msie = ua.indexOf("Edge/");
16308		if(msie > 0) {
16309			$('body').addClass('msie');
16310		}
16311
16312		//gravity form inside fw content row
16313		$('.gform_body').on('click',function(e){
16314		   setTimeout(function(){ fullWidthContentColumns(); },200);
16315		 });
16316		 
16317		//pum salient close 
16318		$('.pum.pum-theme-salient-page-builder-optimized button.pum-close').wrapInner('<span />'); 
16319		
16320		//pum inside fspr
16321		if($('#nectar_fullscreen_rows').length > 0 && $('.pum-container .pum-content > .wpb_row .full-page-inner > .container > .span_12').length > 0) {
16322			$('.pum-container .pum-content > .wpb_row .full-page-inner > .container > .span_12').unwrap();
16323		}
16324
16325		//chat post format nth child color
16326		$('article.post.format-chat .content-inner dt:odd').css('color','#333');
16327		
16328		//remove margin on last cols inside of full width sections 
16329		$('.full-width-section').each(function(){
16330			$(this).find('> .span_12 > div.col_last').last().css('margin-bottom','0');
16331		});
16332		
16333		//remove p tags from extra content editor when warpping only an img 
16334		$('#portfolio-extra p').each(function(){
16335			if($(this).find('*').length == 1 && $(this).find('img').length == 1) {
16336				$(this).find('img').unwrap();
16337			}
16338		});
16339	
16340
16341		//vc text_separator color
16342		$('.vc_text_separator').each(function(){
16343			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'));
16344		});
16345		
16346		//carousel head button alignment  
16347		$('.carousel-heading').each(function(){
16348			if($(this).find('h2').length > 0) $(this).find('.carousel-prev, .carousel-next').css('top','7px');
16349		});
16350		
16351		//remove carousel heading if not being used
16352		$('.carousel-wrap').each(function(){
16353			if($(this).find('.carousel-heading .container:empty').length > 0) $(this).find('.carousel-heading').remove();
16354		});
16355		
16356		//woocommerce product thuimbnails
16357		$('.woocommerce div.product div.images div.thumbnails a:nth-child(4n+4)').css('margin-right','0px');
16358		
16359		//remove extra galleries when using the nectar gallery slider on projects and posts
16360		$('article.post .gallery-slider .gallery,  article.post .gallery-slider .jetpack-slideshow, .single-portfolio .gallery-slider .gallery, .single-portfolio .gallery-slider .jetpack-slideshow').remove();
16361		
16362		
16363		$('.woocommerce .span_9 .products.related .products li:nth-child(4), .woocommerce .span_9 .products.upsells .products li:nth-child(4)').remove();
16364		$('.woocommerce .span_9 .products.related .products li:nth-child(3), .woocommerce .span_9 .products.upsells .products li:nth-child(3)').css('margin-right','0');	
16365		
16366		$('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy');
16367
16368		//clients no hover if no link
16369		$('div.clients').each(function(){
16370			$(this).find('> div').each(function(){
16371				if($(this).find('a').length == 0) {
16372					$(this).addClass('no-link');
16373				}
16374			});
16375		});
16376
16377		//remove ajaxy from single posts when using disqus
16378		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');
16379
16380		//blog next color bg only 
16381		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();
16382		
16383		if($('#single-below-header').hasClass('fullscreen-header') && $('.blog_next_prev_buttons').length == 0 ) $('#author-bio, .comment-wrap').addClass('lighter-grey');
16384
16385		//shop header parallax margin 
16386		if($('body.woocommerce').find('#page-header-bg').length > 0){
16387			$('.container-wrap').css({'margin-top':'0px','padding-top':'30px'});
16388		}
16389		
16390		//if using wooCommerce sitewide notice
16391		if($('.demo_store').length > 0) $('#header-outer, #header-space').css('margin-top','32px');
16392	
16393		
16394		//nectar slider external links
16395		$('.swiper-slide.external-button-1 .buttons > div:nth-child(1) a').attr('target','_blank');
16396		$('.swiper-slide.external-button-2 .buttons > div:nth-child(2) a').attr('target','_blank');
16397		
16398		//portfolio external links
16399		$(".portfolio-items").find("a[href*='http://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank"); 
16400		$(".recent_projects_widget").find("a[href*='http://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank"); 
16401		
16402		$(".portfolio-items").find("a[href*='https://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank"); 
16403		$(".recent_projects_widget").find("a[href*='https://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank"); 
16404		
16405		//remove excess inner content when empty row
16406		$('.container-wrap .row > .wpb_row').each(function(){
16407			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();
16408		});
16409		
16410		//remove boxed style from full width content
16411		$('.full-width-content .col.boxed').removeClass('boxed');
16412		
16413		//remove full width attribute on slider in full width content section
16414		$('.full-width-content .wpb_column .nectar-slider-wrap[data-full-width="true"]').attr('data-full-width','false');	
16415
16416	    //neg marg z-index
16417	    $('.wpb_column.neg-marg').parents('.wpb_row').css('z-index','110');
16418
16419
16420	    //portfolio description remove on hover
16421	    var $tmpTitle = null;
16422	    $('.portfolio-items > .col a[title]').on('mouseenter',function(){
16423	    	$tmpTitle = $(this).attr('title');
16424	    	$(this).attr('title','');
16425	    });
16426			$('.portfolio-items > .col a[title]').on('mouseleave',function(){
16427	    	$(this).attr('title', $tmpTitle);
16428	    });
16429			
16430	    $('.portfolio-items > .col a[title]').on('click',function(e){
16431			$(this).attr('title', $tmpTitle);
16432	    });
16433
16434	};
16435
16436	crossBrowserFixes();
16437
16438
16439
16440	jQuery( document.body ).on( 'updated_cart_totals', function() { 
16441		if($('.plus').length == 0) 
16442			$( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" class="plus" />' ).prepend( '<input type="button" value="-" class="minus" />' );
16443	});
16444
16445	// Quantity buttons
16446	if($('.plus').length == 0) {
16447		$( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" class="plus" />' ).prepend( '<input type="button" value="-" class="minus" />' );
16448
16449		$( document ).on( 'click', '.plus, .minus', function() {
16450
16451			// Get values
16452			var $qty		= $( this ).closest( '.quantity' ).find( '.qty' ),
16453				currentVal	= parseFloat( $qty.val() ),
16454				max			= parseFloat( $qty.attr( 'max' ) ),
16455				min			= parseFloat( $qty.attr( 'min' ) ),
16456				step		= $qty.attr( 'step' );
16457
16458			// Format values
16459			if ( ! currentVal || currentVal === '' || currentVal === 'NaN' ) currentVal = 0;
16460			if ( max === '' || max === 'NaN' ) max = '';
16461			if ( min === '' || min === 'NaN' ) min = 0;
16462			if ( step === 'any' || step === '' || step === undefined || parseFloat( step ) 
16462=== 'NaN' ) step = 1;
16463
16464			// Change the value
16465			if ( $( this ).is( '.plus' ) ) {
16466
16467				if ( max && ( max == currentVal || currentVal > max ) ) {
16468					$qty.val( max );
16469				} else {
16470					$qty.val( currentVal + parseFloat( step ) );
16471				}
16472
16473			} else {
16474
16475				if ( min && ( min == currentVal || currentVal < min ) ) {
16476					$qty.val( min );
16477				} else if ( currentVal > 0 ) {
16478					$qty.val( currentVal - parseFloat( step ) );
16479				}
16480
16481			}
16482
16483			// Trigger change event
16484			$qty.trigger( 'change' );
16485
16486		});
16487	}
16488
16489	function wooPriceSlider(){
16490
16491
16492		// woocommerce_price_slider_params is required to continue, ensure the object exists
16493		if ( typeof woocommerce_price_slider_params === 'undefined' || !$('body').hasClass('woocommerce') ) {
16494			return false;
16495		}
16496
16497		// Get markup ready for slider
16498		$( 'input#min_price, input#max_price' ).hide();
16499		$( '.price_slider, .price_label' ).show();
16500
16501		// Price slider uses jquery ui
16502		var min_price = $( '.price_slider_amount #min_price' ).data( 'min' ),
16503			max_price = $( '.price_slider_amount #max_price' ).data( 'max' );
16504
16505		current_min_price = parseInt( min_price, 10 );
16506		current_max_price = parseInt( max_price, 10 );
16507
16508		if ( woocommerce_price_slider_params.min_price ) current_min_price = parseInt( woocommerce_price_slider_params.min_price, 10 );
16509		if ( woocommerce_price_slider_params.max_price ) current_max_price = parseInt( woocommerce_price_slider_params.max_price, 10 );
16510
16511		$( 'body' ).bind( 'price_slider_create price_slider_slide', function( event, min, max ) {
16512			if ( woocommerce_price_slider_params.currency_pos === 'left' ) {
16513
16514				$( '.price_slider_amount span.from' ).html( woocommerce_price_slider_params.currency_symbol + min );
16515				$( '.price_slider_amount span.to' ).html( woocommerce_price_slider_params.currency_symbol + max );
16516
16517			} else if ( woocommerce_price_slider_params.currency_pos === 'left_space' ) {
16518
16519				$( '.price_slider_amount span.from' ).html( woocommerce_price_slider_params.currency_symbol + " " + min );
16520				$( '.price_slider_amount span.to' ).html( woocommerce_price_slider_params.currency_symbol + " " + max );
16521
16522			} else if ( woocommerce_price_slider_params.currency_pos === 'right' ) {
16523
16524				$( '.price_slider_amount span.from' ).html( min + woocommerce_price_slider_params.currency_symbol );
16525				$( '.price_slider_amount span.to' ).html( max + woocommerce_price_slider_params.currency_symbol );
16526
16527			} else if ( woocommerce_price_slider_params.currency_pos === 'right_space' ) {
16528
16529				$( '.price_slider_amount span.from' ).html( min + " " + woocommerce_price_slider_params.currency_symbol );
16530				$( '.price_slider_amount span.to' ).html( max + " " + woocommerce_price_slider_params.currency_symbol );
16531
16532			}
16533
16534			$( 'body' ).trigger( 'price_slider_updated', min, max );
16535		});
16536
16537		$( '.price_slider' ).slider({
16538			range: true,
16539			animate: true,
16540			min: min_price,
16541			max: max_price,
16542			values: [ current_min_price, current_max_price ],
16543			create : function( event, ui ) {
16544
16545				$( '.price_slider_amount #min_price' ).val( current_min_price );
16546				$( '.price_slider_amount #max_price' ).val( current_max_price );
16547
16548				$( 'body' ).trigger( 'price_slider_create', [ current_min_price, current_max_price ] );
16549			},
16550			slide: function( event, ui ) {
16551
16552				$( 'input#min_price' ).val( ui.values[0] );
16553				$( 'input#max_price' ).val( ui.values[1] );
16554
16555				$( 'body' ).trigger( 'price_slider_slide', [ ui.values[0], ui.values[1] ] );
16556			},
16557			change: function( event, ui ) {
16558
16559				$( 'body' ).trigger( 'price_slider_change', [ ui.values[0], ui.values[1] ] );
16560
16561			},
16562		});
16563
16564	}
16565	
16566
16567//vc col mobile fixes
16568function vcMobileColumns() {
16569
16570	$('.wpb_row').each(function(){
16571		if(typeof $(this).find('.span_12').offset() != 'undefined' ) {
16572		
16573			$(this).find('[class*="vc_col-"]').each(function(){
16574
16575				var $firstChildOffset = $(this).parents('.span_12').offset().left;
16576				
16577				$(this).removeClass('no-left-margin');
16578				if($(this).offset().left < $firstChildOffset + 27) { 
16579					$(this).addClass('no-left-margin');
16580				} else {
16581					$(this).removeClass('no-left-margin');
16582				}
16583			});
16584		}
16585	});
16586}
16587
16588if( $('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) { vcMobileColumns(); }
16589
16590
16591/*-------------------------------------------------------------------------*/
16592/*	8.	Form Styling
16593/*-------------------------------------------------------------------------*/	
16594
16595
16596if($('body[data-fancy-form-rcs="1"]').length > 0) {
16597
16598
16599    //select only as of v9
16600    $('select:not(.comment-form-rating #rating)').each(function(){
16601			
16602			var $selector;
16603
16604    	//cf7
16605    	if($(this).parents('.wpcf7-form-control-wrap').length > 0) {
16606
16607    		//select 2 already initialized
16608	    	if($(this).parents('.wpcf7-form-control-wrap').find('.select2-container').length > 0) {
16609	    		$selector = $($(this).prev('.select2-container'));
16610	    	} else {
16611	    		$selector = $(this);
16612	    	}
16613
16614	    	//if label is found
16615	    	if($selector.parents('.wpcf7-form-control-wrap').parent().find('label').length == 1) {
16616	    		$selector.parents('.wpcf7-form-control-wrap').parent().wrapInner('<div class="fancy-select-wrap" />');
16617	    	} else {
16618	    		//default wrap
16619	    		$selector.wrap('<div class="fancy-select-wrap" />');
16620	    	}
16621    	} 
16622    	//default
16623    	else {
16624
16625	    	//select 2 already initialized
16626	    	if($(this).prev('.select2-container').length > 0) {
16627	    		$selector = $(this).prev('.select2-container');
16628	    	} else {
16629	    		$selector = $(this);
16630	    	}
16631				
16632				if($(this).parents('#buddypress').length == 0) {
16633			    	//if label is found
16634			    	if($selector.prev('label').length == 1) {
16635			    		$selector.prev('label').andSelf().wrapAll('<div class="fancy-select-wrap" />');
16636			    	} else if($selector.next('label').length == 1) {
16637			    		$selector.next('label').andSelf().wrapAll('<div class="fancy-select-wrap" />');
16638			    	} else {
16639			    		//default wrap
16640			    		$selector.wrap('<div class="fancy-select-wrap" />');
16641			    	}
16642				}
16643				
16644    	}
16645    });
16646	
16647	function select2Init(){
16648		$('select:not(.state_select):not(.country_select):not(.comment-form-rating #rating):not(#tribe-bar-form select):not(.woocommerce-currency-switcher)' ).each( function() {
16649			
16650			if($(this).parents('#buddypress').length == 0) {
16651			
16652						if($(this).parents('.woocommerce-ordering').length == 0) {
16653							$( this ).select2({
16654								minimumResultsForSearch: 7,
16655								width: '100%'
16656							});
16657						} else {
16658							$( this ).select2({
16659								minimumResultsForSearch: 7,
16660								dropdownAutoWidth: true
16661							});
16662						}
16663			}
16664
16665		});
16666	}
16667   
16668	select2Init();
16669
16670}
16671	
16672
16673
16674//Back/forward cache OCM close
16675if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
16676	
16677	window.onpageshow = function(event) {
16678		
16679			if(event.persisted) {
16680					
16681					//play video BGs
16682					$('.nectar-video-wrap, .nectar-slider-wrap .swiper-slide .video-wrap').each(function(i){
16683						
16684						if($(this).find('video').length > 0) {
16685							  $(this).find('video')[0].play();
16686						}
16687						
16688					});
16689	
16690
16691					//close mobile nav
16692					
16693					////material
16694					if($('body.material-ocm-open').length > 0) {	
16695							$('body > .slide_out_area_close').addClass('non-human-allowed').trigger('click');
16696
16697							setTimeout(function(){
16698								$('body > .slide_out_area_close').removeClass('non-human-allowed');
16699							},100);
16700						
16701					} 
16702					else if( $('#slide-out-widget-area.slide-out-from-right-hover.open').length > 0 && navigator.userAgent.match(/(iPod|iPhone|iPad)/) ) {
16703						mobileCloseNavCheck();
16704					}
16705					////others
16706					else if( $('#slide-out-widget-area.fullscreen.open').length > 0 || $('#slide-out-widget-area.fullscreen-alt.open').length > 0 || $('#slide-out-widget-area.slide-out-from-right.open').length > 0 ) {
16707						
16708							$('#slide-out-widget-area .slide_out_area_close').addClass('non-human-allowed');
16709							$('.slide-out-widget-area-toggle:not(.std-menu) a.open').addClass('non-human-allowed').trigger('click');
16710							setTimeout(function(){
16711								$('#slide-out-widget-area .slide_out_area_close').removeClass('non-human-allowed');
16712							},100);
16713						
16714					}
16715
16716			} // if loaded from bf cache
16717			
16718		} //onpage show
16719		
16720} // only used on Safari or mobile
16721	
16722	
16723/*-------------------------------------------------------------------------*/
16724/*	10.	Page transitions
16725/*-------------------------------------------------------------------------*/	
16726
16727	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 ) {
16728
16729		$('#ajax-content-wrap').ajaxify({
16730			'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([data-fancybox]):not(.product_list_widget a):not(.magnific):not(.pp):not
16730([rel^="prettyPhoto"]):not(.pretty_photo), #header-outer li:not(.no-ajaxy) > a:not(.no-ajaxy), #header-outer #logo',
16731			'verbosity': 0, 
16732			requestDelay: 400,
16733			previewoff : true,
16734			memoryoff: true,
16735			turbo : false
16736		});
16737
16738		$(window).on("pronto.render", initPage)
16739		.on("pronto.load", destroyPage)
16740		.on("pronto.request", transitionPage);
16741
16742		if($('.nectar-box-roll').length == 0 && $('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) setTimeout(function() { waypoints(); }, 750);
16743		else if($('.nectar-box-roll').length == 0) setTimeout(function() { waypoints(); },300);
16744
16745		if($('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) {
16746			setTimeout(function(){ 
16747				$('#ajax-loading-screen').addClass('loaded');
16748			},30);
16749		}
16750
16751		initPage();
16752
16753	} else if($('body[data-ajax-transitions="true"]').length > 0 && $('#ajax-loading-screen[data-method="standard"]').length > 0 ) {
16754		
16755		//chrome white BG flash fix
16756		$('html').addClass('page-trans-loaded');
16757
16758		//fadeout loading animation
16759		if($('#ajax-loading-screen[data-effect="standard"]').length > 0) {
16760
16761			if($('.nectar-particles').length == 0) {
16762
16763					$('#ajax-loading-screen').transition({'opacity':0},500,function(){ 
16764						$(this).css({'display':'none'}); 
16765					}); 
16766					$('#ajax-loading-screen .loading-icon').transition({'opacity':0},500) 
16767				
16768			}
16769
16770			//bind waypoints after loading screen has left
16771			if($('.nectar-box-roll').length == 0) setTimeout(function() { waypoints(); },550);
16772
16773			//safari back/prev fix
16774			if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
16775				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) };
16776				window.onpageshow = function(event) {
16777					
16778		    		if (event.persisted) {
16779							
16780							
16781		    			$('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ 
16782		    				$(this).css({'display':'none'}); 
16783		    			}); 
16784		    			$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600);
16785							
16786		    		} //presisted
16787						
16788		    	}
16789					
16790			} else if(navigator.userAgent.indexOf('Firefox') != -1) {
16791				window.onunload = function(){};
16792			}
16793
16794	    		
16795	    	
16796			
16797		} else {
16798
16799			//for swipe trans add loaded immediately
16800			if($('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) {
16801				setTimeout(function(){ 
16802					$('#ajax-loading-screen').addClass('loaded');
16803				},60);
16804			}
16805
16806			if($('#page-header-wrap #page-header-bg[data-animate-in-effect="zoom-out"] .nectar-video-wrap').length == 0 && $('.first-nectar-slider').length == 0) {
16807				setTimeout(function(){ 
16808					$('#ajax-loading-screen:not(.loaded)').addClass('loaded');
16809					setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
16810				},150);
16811			}
16812
16813			//safari back/prev fix
16814			if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
16815				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) };
16816				window.onpageshow = function(event) {
16817		    		if (event.persisted) { 
16818		    			$('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ 
16819		    				$(this).css({'display':'none'}); 
16820		    			}); 
16821		    			$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600);
16822		    		}
16823		    	}
16824			} else if(navigator.userAgent.indexOf('Firefox') != -1) {
16825				window.onunload = function(){};
16826			}
16827			
16828			//bind waypoints after loading screen has left
16829			if($('.nectar-box-roll').length == 0 && $('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) { setTimeout(function() { waypoints(); }, 750); }
16830			else if($('.nectar-box-roll').length == 0) setTimeout(function() { waypoints(); },350);
16831
16832		}
16833
16834		//remove excess loading images now
16835		$('.portfolio-loading, .nectar-slider-loading .loading-icon').remove();
16836
16837
16838		if($('#ajax-loading-screen[data-disable-fade-on-click="1"]').length == 0) {
16839				
16840				if( $('body.using-mobile-browser #ajax-loading-screen[data-method="standard"][data-disable-mobile="1"]').length == 0) {
16841					
16842					var ignore_onbeforeunload = false;
16843					$('a[href^="mailto"], a[href^="tel"]').on('click',function(){
16844			        ignore_onbeforeunload = true;
16845			    });
16846					window.addEventListener('beforeunload', function () {
16847								
16848								if (!ignore_onbeforeunload){
16849									$('#ajax-loading-screen').addClass('set-to-fade');
16850									transitionPageStandard();
16851								}
16852								ignore_onbeforeunload = false;
16853					});
16854				}
16855
16856		} // if disable fade out is not on
16857		
16858		
16859	} else {	
16860		//bind waypoints regularly
16861		if($('.nectar-box-roll').length == 0 && !nectarDOMInfo.usingFrontEndEditor) setTimeout(function() { waypoints(); },100);
16862	}
16863
16864
16865	function transitionPage(e) {
16866		
16867		if($('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) {
16868
16869			if($(window).scrollTop() > 0) {
16870
16871				//stop nicescroll
16872				if($().niceScroll && $("html").getNiceScroll()){
16873					var nice = $("html").getNiceScroll();
16874					nice.stop();
16875				}
16876				
16877				$('body,html').stop(true,true).animate({
16878					scrollTop:0
16879				},500,'easeOutQuad',function(){ 
16880					
16881					//close widget area
16882					setTimeout(function(){  if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');  },400);
16883					$('#ajax-loading-screen').removeClass('loaded');
16884					$('#ajax-loading-screen').addClass('in-from-right');
16885					setTimeout(function(){
16886						$('#ajax-loading-screen').addClass('loaded');
16887					},30);
16888
16889				});
16890			}
16891			else { 
16892				//close widget area
16893				setTimeout(function(){  if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');  },400);
16894				$('#ajax-loading-screen').removeClass('loaded');
16895				$('#ajax-loading-screen').addClass('in-from-right');
16896				setTimeout(function(){
16897					$('#ajax-loading-screen').addClass('loaded');
16898				},30);
16899			}
16900
16901		} else {
16902			if($(window).scrollTop() > 0) {
16903
16904				//stop nicescroll
16905				if($().niceScroll && $("html").getNiceScroll()){
16906					var nice = $("html").getNiceScroll();
16907					nice.stop();
16908				}
16909				
16910				$('body,html').stop(true,true).animate({
16911					scrollTop:0
16912				},500,'easeOutQuad',function(){ 
16913					$('#ajax-loading-screen').css({'opacity':'1', 'display':'none'});
16914					$('#ajax-loading-screen').stop(true,true).fadeIn(600,function(){
16915						$('#ajax-loading-screen .loading-icon').animate({'opacity':1},400);
16916						//close widget area
16917						setTimeout(function(){  if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');  },400);
16918					});
16919				});
16920
16921			} else {
16922				$('#ajax-loading-screen').css('opacity','1').stop().fadeIn(600,function(){
16923					$('#ajax-loading-screen .loading-icon').animate({'opacity':1},400);
16924				});
16925
16926				//close widget area
16927				setTimeout(function(){  if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');  },400);
16928			}
16929		}
16930
16931		
16932	}
16933
16934	function transitionPageStandard(e) {
16935
16936		if($('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) {
16937			$('#ajax-loading-screen').removeClass('loaded');
16938			$('#ajax-loading-screen').addClass('in-from-right');
16939			setTimeout(function(){
16940				$('#ajax-loading-screen').addClass('loaded');
16941			},30);
16942		} else {
16943			if($('#ajax-loading-screen[data-effect="center_mask_reveal"]').length > 0) {
16944				$('#ajax-loading-screen').css('opacity','0').css('display','block').transition({'opacity':'1'},450);
16945			} else {
16946				$('#ajax-loading-screen').show().transition({'opacity':'1'},450);
16947			}
16948		}
16949		
16950	}
16951
16952	function destroyPage(e) {
16953		$(window).off('scroll.appear');
16954		if($('#nectar_fullscreen_rows').length > 0 && $().fullpage) 
16955			$.fn.fullpage.destroy('all');
16956	}
16957
16958	function initPage(e) {
16959
16960		if(!$('body').hasClass('ajax-loaded')) return false;
16961
16962
16963		//init js
16964		lightBoxInit();
16965		addOrRemoveSF();
16966		
16967		if($('body[data-header-format="left-header"]').length == 0) {
16968			$(".sf-menu").superfish('destroy');
16969		}
16970
16971		initSF();
16972		SFArrows();
16973		headerInit();
16974		var $effectTimeout = ($('#ajax-loading-screen').length > 0) ? 800 : 0;
16975		pageHeaderTextEffectInit();
16976		if($('#page-header-bg .nectar-video-wrap video').length == 0) { setTimeout(pageHeaderTextEffect,$effectTimeout); }
16977		coloredButtons();
16978		columnBGColors();
16979		fwCarouselLinkFix();
16980		if($('.carousel').length > 0) {
16981			standardCarouselInit();
16982			clientsCarouselInit();
16983			carouselHeightCalcs();
16984		}
16985		if($('.owl-carousel').length > 0) owlCarouselInit();
16986		if($('.products-carousel').length > 0 || $('.nectar-woo-flickity').length > 0) productCarouselInit();
16987		if($('#nectar_fullscreen_rows').length > 0 && $().fullpage) {
16988			setFPNames();
16989			initFullPageFooter();
16990			fullscreenRowLogic();
16991			initNectarFP();
16992		}
16993		flexsliderInit();
16994		accordionInit();
16995		tabbedInit();
16996		nectarLiquidBGs();
16997		tabbbedDeepLinking();
16998		accordionDeepLinking();
16999		ulChecks();
17000		oneFourthClasses();
17001		carouselfGrabbingClass();
17002		cascadingImageBGSizing();
17003		fullWidthSections();
17004		fwsClasses();
17005		fullwidthImgOnlySizingInit();
17006		fullwidthImgOnlySizing();
17007		if(nectarDOMInfo.usingMobileBrowser) {
17008			fullWidthRowPaddingAdjustCalc();
17009		}
17010		boxRollInit();
17011		setTimeout(function(){ 
17012		   waypoints();
17013		   flickityInit();
17014		},100); 
17015		if($('body[data-animated-anchors="true"]').length > 0) setTimeout(scrollSpyInit,200);
17016		socialSharingInit();
17017		hotSpotHoverBind();
17018		pricingTableHeight();
17019		createTestimonialControls();
17020		imageWithHotspotClickEvents();
17021		testimonialSliderHeight(); 
17022		largeIconHover();
17023		if($('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length == 0) {
17024			fullscreenMenuInit();
17025		}
17026		boxRollMouseWheelInit();
17027		midnightInit();
17028		responsiveVideoIframesInit();
17029		responsiveVideoIframes();
17030		fullWidthContentColumns();
17031		videoBGInit();
17032		$window.unbind('scroll.parallaxSections').unbind('resize.parallaxSections');
17033		parallaxScrollInit();
17034		
17035		$blog_containers = [];
17036		$('.posts-container').each(function(i){
17037			$blog_containers[i] = $(this);
17038		});
17039		
17040		nectarAccountPageTabs();
17041		masonryBlogInit();
17042		masonryPortfolioInit();
17043		portfolioAccentColor();
17044		portfolioHoverEffects();
17045		portfolioFiltersInit();
17046		style6Img();
17047		isotopeCatSelection();
17048		$(window).unbind('.infscr');
17049		infiniteScrollInit();
17050		toTopBind();
17051		centerLove();
17052		postNextButtonEffect();
17053		pageLoadHash();
17054		slideOutWidgetAreaScrolling();
17055		
17056		//search results
17057		if($('body.search-results').length > 0 && $('#search-results article').length > 0) { searchResultMasonry(); }
17058		
17059		//cf7
17060		if($().wpcf7InitForm) $('div.wpcf7 > form').wpcf7InitForm();
17061
17062		//woocommerce price slider
17063		wooPriceSlider();
17064
17065		//twitter widget 
17066		if(typeof twttr != 'undefined') { twttr.widgets.load(); }
17067
17068		//Calendarize.it
17069		if(typeof init_rhc === 'function') { init_rhc(); }
17070
17071		//unwrap post and protfolio videos
17072		$('.video-wrap iframe').unwrap();
17073		$('#sidebar iframe[src]').unwrap();
17074
17075		$('video:not(.slider-video)').attr('width','100%');
17076		$('video:not(.slider-video)').attr('height','100%'); 
17077
17078		$('.wp-video-shortcode.mejs-container').each(function(){
17079			$(this).attr('data-aspectRatio', parseInt($(this).css('height')) / parseInt($(this).css('width')));
17080		});
17081
17082		//mediaElement
17083		$('video.wp-media-shortcode-ajax, audio.wp-media-shortcode-ajax').each(function(){ 
17084			if(!$(this).parent().hasClass('mejs-mediaelement') && $().mediaelementplayer) {
17085				$(this).mediaelementplayer();  
17086			}
17087		});
17088
17089		$('.mejs-container').css({'height': '100%', 'width': '100%'});
17090		
17091		$('audio').attr('width','100%');
17092		$('audio').attr('height','100%');
17093
17094		$('audio').css('visibility','visible');
17095
17096		if($('body').hasClass('mobile')){
17097			$('video').css('visibility','hidden');
17098		} else {
17099			$('video').css('visibility','visible');
17100		}
17101
17102		$('.wpb_row:has(".nectar-video-wrap")').each(function(i){
17103			$(this).css('z-index',100 + i);
17104		});
17105
17106		mouseParallaxInit();
17107
17108		//chrome self hosted slider bg video correct
17109		 if(navigator.userAgent.indexOf('Chrome') > 0) { 
17110		 	$('.swiper-wrapper .video-wrap').each(function(i){
17111			  	var webmSource = jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
17112	          	var firstVideo = jQuery(this).find('video').get(0);
17113	          	firstVideo.src = webmSource;
17114	          	firstVideo.load();
17115            });
17116	    }
17117
17118
17119		if($('.nectar-video-bg').length > 0) {
17120			setTimeout(function(){
17121			    	resizeVideoToCover();
17122			    	$('.video-color-overlay').each(function(){
17123			    		$(this).css('background-color',$(this).attr('data-color'));
17124			    	});
17125			    	$('.nectar-video-wrap').transition({'opacity':'1'},0);
17126			    	$('.video-color-overlay').transition({'opacity':'0.7'},0);
17127			    	
17128			    },400);
17129		}
17130
17131		
17132		nectarPageHeader();
17133	
17134
17135		//cart dropdown
17136		$('#header-outer div.cart-outer').hoverIntent(function(){
17137			$('#header-outer .widget_shopping_cart').addClass('open').stop(true,true).fadeIn(400);
17138			$('#header-outer .cart_list').stop(true,true).fadeIn(400);
17139			clearTimeout(timeout);
17140			$('#header-outer .cart-notification').fadeOut(300);
17141		});
17142
17143
17144		//remove excess loading images now
17145		$('.portfolio-loading, .nectar-slider-loading .loading-icon').remove();
17146
17147		setTimeout(portfolioSidebarFollow,250);
17148		setTimeout(portfolioSidebarFollow,500);
17149		setTimeout(portfolioSidebarFollow,1000);
17150
17151		crossBrowserFixes();
17152
17153
17154		$(window).trigger('resize');
17155
17156		//fix admin bar
17157		$("#wpadminbar").show();	
17158
17159
17160		//close widget area
17161		if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click'); 
17162
17163		if($('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) {
17164			closeSearch();
17165			$('#ajax-loading-screen').removeClass('in-from-right').removeClass('loaded');
17166			setTimeout(function(){ $('#ajax-loading-screen').addClass('loaded'); },30);
17167		} else {
17168			//fade in page
17169			setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0}); }); closeSearch();  },200);
17170			setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0}); }); closeSearch(); },900);
17171		}
17172	} 
17173
17174
17175
17176(function($){
17177	if(!$.fn.textareaCount) { 
17178		$.fn.textareaCount = function(options, fn) {
17179	        var defaults = {
17180				maxCharacterSize: -1,
17181				originalStyle: 'originalTextareaInfo',
17182				warningStyle: 'warningTextareaInfo',
17183				warningNumber: 20,
17184				displayFormat: '#input characters | #words words'
17185			};
17186
17187			var options = $.extend(defaults, options);
17188
17189			var container = $(this);
17190
17191			$("<div class='charleft'>&nbsp;</div>").insertAfter(container);
17192
17193
17194			//create charleft css
17195			var charLeftCss = {
17196				'width' : container.width()
17197			};
17198
17199			var charLeftInfo = getNextCharLeftInformation(container);
17200			charLeftInfo.addClass(options.originalStyle);
17201			//charLeftInfo.css(charLeftCss);
17202
17203
17204			var numInput = 0;
17205			var maxCharacters = options.maxCharacterSize;
17206			var numLeft = 0;
17207			var numWords = 0;
17208
17209			container.on('keyup', function(event){limitTextAreaByCharacterCount();})
17210					 .on('mouseover', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);})
17211					 .on('paste', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);});
17212
17213	        limitTextAreaByCharacterCount();
17214
17215			function limitTextAreaByCharacterCount(){
17216				charLeftInfo.html(countByCharacters());
17217
17218				//function call back
17219				if(typeof fn != 'undefined'){
17220					fn.call(this, getInfo());
17221				}
17222				return true;
17223			}
17224
17225			function countByCharacters(){
17226				var content = container.val();
17227				var contentLength = content.length;
17228				//Start Cut
17229				if(options.maxCharacterSize > 0){
17230					//If copied content is already more than maxCharacterSize, chop it to maxCharacterSize.
17231					if(contentLength >= options.maxCharacterSize) {
17232						content = content.substring(0, options.maxCharacterSize);
17233					}
17234
17235					var newlineCount = getNewlineCount(content);
17236
17237					// newlineCount new line character. For windows, it occupies 2 characters
17238					var systemmaxCharacterSize = options.maxCharacterSize - newlineCount;
17239					if (!isWin()){
17240						 systemmaxCharacterSize = options.maxCharacterSize
17241					}
17242					if(contentLength > systemmaxCharacterSize){
17243						//avoid scroll bar moving
17244						var originalScrollTopPosition = this.scrollTop;
17245						container.val(content.substring(0, systemmaxCharacterSize));
17246						this.scrollTop = originalScrollTopPosition;
17247					}
17248					charLeftInfo.removeClass(options.warningStyle);
17249					if(systemmaxCharacterSize - contentLength <= options.warningNumber){
17250						charLeftInfo.addClass(options.warningStyle);
17251					}
17252
17253					numInput = container.val().length + newlineCount;
17254					if(!isWin()){
17255						numInput = container.val().length;
17256					}
17257
17258					numWords = countWord(getCleanedWordString(container.val()));
17259
17260					numLeft = maxCharacters - numInput;
17261				} else {
17262					//normal count, no cut
17263					var newlineCount = getNewlineCount(content);
17264					numInput = container.val().length + newlineCount;
17265					if(!isWin()){
17266						numInput = container.val().length;
17267					}
17268					numWords = countWord(getCleanedWordString(container.val()));
17269				}
17270
17271				return formatDisplayInfo();
17272			}
17273
17274			function formatDisplayInfo(){
17275				var format = options.displayFormat;
17276				format = format.replace('#input', numInput);
17277				format = format.replace('#words', numWords);
17278				//When maxCharacters <= 0, #max, #left cannot be substituted.
17279				if(maxCharacters > 0){
17280					format = format.replace('#max', maxCharacters);
17281					format = format.replace('#left', numLeft);
17282				}
17283				return format;
17284			}
17285
17286			function getInfo(){
17287				var info = {
17288					input: numInput,
17289					max: maxCharacters,
17290					left: numLeft,
17291					words: numWords
17292				};
17293				return info;
17294			}
17295
17296			function getNextCharLeftInformation(container){
17297					return container.next('.charleft');
17298			}
17299
17300			function isWin(){
17301				var strOS = navigator.appVersion;
17302				if (strOS.toLowerCase().indexOf('win') != -1){
17303					return true;
17304				}
17305				return false;
17306			}
17307
17308			function getNewlineCount(content){
17309				var newlineCount = 0;
17310				for(var i=0; i<content.length;i++){
17311					if(content.charAt(i) == '\n'){
17312						newlineCount++;
17313					}
17314				}
17315				return newlineCount;
17316			}
17317
17318			function getCleanedWordString(content){
17319				var fullStr = content + " ";
17320				var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
17321				var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "");
17322				var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
17323				var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " ");
17324				var splitString = cleanedStr.split(" ");
17325				return splitString;
17326			}
17327
17328			function countWord(cleanedWordString){
17329				var word_count = cleanedWordString.length-1;
17330				return word_count;
17331			}
17332		};
17333	}
17334})(jQuery);	
17335	
17336	
17337	
17338	
17339});
17340
17341
17342 }(window.jQuery, window, document));
17343
17344
17345function resizeIframe() {
17346	var element = document.getElementById("pp_full_res").getElementsByTagName("iframe");
17347	var height = element[0].contentWindow.document.body.scrollHeight;
17348    
17349    //iframe height
17350    element[0].style.height = height + 'px';
17351	
17352	//pp height
17353	document.getElementsByClassName("pp_content_container")[0].style.height = height+40+ 'px';
17354	document.getElementsByClassName("pp_content")[0].style.height = height+40+ 'px';
17355	
17356}
17357
17358
17359
17360/*!
17361 * hoverIntent v1.9.0 // 2017.09.01 // jQuery v1.7.0+
17362 * http://briancherne.github.io/jquery-hoverIntent/
17363 *
17364 * You may use hoverIntent under the terms of the MIT license. Basically that
17365 * means you are free to use hoverIntent as long as this header is left intact.
17366 * Copyright 2007-2017 Brian Cherne
17367 */
17368!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):jQuery&&!jQuery.fn.hoverIntent&&factory(jQuery)}(function($){"use strict";var cX,cY,_cfg={interval:100,sensitivity:6,timeout:0},INSTANCE_COUNT=0,track=function(ev){cX=ev.pageX,cY=ev.pageY},compare=function(ev,$el,s,cfg){if(Math.sqrt((s.pX-cX)*(s.pX-cX)+(s.pY-cY)*(s.pY-cY))<cfg.sensitivity)return $el.off(s.event,track),delete s.timeoutId,s.isActive=!0,ev.pageX=cX,ev.pageY=cY,delete s.pX,delete s.pY,cfg.over.apply($el[0],[ev]);s.pX=cX,s.pY=cY,s.timeoutId=setTimeout(function(){compare(ev,$el,s,cfg)},cfg.interval)},delay=function(ev,$el,s,out){return delete $el.data("hoverIntent")[s.id],out.apply($el[0],[ev])};$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var instanceId=INSTANCE_COUNT++,cfg=$.extend({},_cfg);$.isPlainObject(handlerIn)?(cfg=$.extend(cfg,handlerIn),$.isFunction(cfg.out)||(cfg.out=cfg.over)):cfg=$.isFunction(handlerOut)?$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector}):$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut});var handleHover=function(e){var ev=$.extend({},e),$el=$(this),hoverIntentData=$el.data("hoverIntent");hoverIntentData||$el.data("hoverIntent",hoverIntentData={});var state=hoverIntentData[instanceId];state||(hoverIntentData[instanceId]=state={id:instanceId}),state.timeoutId&&(state.timeoutId=clearTimeout(state.timeoutId));var mousemove=state.event="mousemove.hoverIntent.hoverIntent"+instanceId;if("mouseenter"===e.type){if(state.isActive)return;state.pX=ev.pageX,state.pY=ev.pageY,$el.off(mousemove,track).on(mousemove,track),state.timeoutId=setTimeout(function(){compare(ev,$el,state,cfg)},cfg.interval)}else{if(!state.isActive)return;$el.off(mousemove,track),state.timeoutId=setTimeout(function(){delay(ev,$el,state,cfg.out)},cfg.timeout)}};return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.