PageSourceSearch

https://www.camptakajo.com/wp-content/themes/salient/js/init.js?ver=10.0.1

js camptakajo.com collected 2026-10-04 13:33:39 UTC 673,814 bytes, 17,374 lines download raw bytes

vendor: 9,405 bytes, lines 1-30
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
18
19/*-------------------------------------------------------------------------*/
20/*	1.	Plugin Init
21/*-------------------------------------------------------------------------*/
22
23
24/*!
25Waypoints - 4.0.1
26*/
27!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))}();
28
29//visible
30!function(t){var i=t(window);
vendor: 4,914 bytes, lines 30-44
30t.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);
31
32
33/*
34* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
35*/
36jQuery.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}})
37
38
39/*anime*/
40/*
41 2017 Julian Garnier
42 Released under the MIT license
43*/
44var $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_";
vendor: 1,723 bytes, lines 45-49
45$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_++};
46$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}})};
47$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};
48$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;
49(function(e,r){"function"===typeof define&&define.amd?define([],r
vendor: 12,167 bytes, lines 49-72
49):"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;
50h.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);
51a=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("+
52255*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)&&
53u(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]||
540}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*
55Math.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;
56case "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,
57function(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,
58c)}),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))/
591E3;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]})):f?b.delay:d.offset+b.delay+
60b.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],
61k=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+" "));
62else 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;
63if(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=
640;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();
65g.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")},
66pth: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,
67d,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===
68n)k=l;else{var l=h,h=h+.1,g=0;do 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,
69.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)?
70d: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=
71function(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=
72!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});
73
74
75/*! Mousewheel by Brandon Aaron (http://brandon.aaron.sh) */
76!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)}})});
77
78(function($, window, document) {
79
80
81
82jQuery(document).ready(function($){
83	
84	
85	
86  // ========================= smartresize ===============================
87
88  /*
89   * smartresize: debounced resize event for jQuery
90   *
91   * latest version and complete README available on Github:
92   * https://github.com/louisremi/jquery.smartresize.js
93   *
94   * Copyright 2011 @louis_remi
95   * Licensed under the MIT license.
96   */
97
98  var $event = $.event,
99      dispatchMethod = $.event.handle ? 'handle' : 'dispatch',
100      resizeTimeout;
101
102  $event.special.smartresize = {
103    setup: function() {
104      $(this).on( "resize", $event.special.smartresize.handler );
105    },
106    teardown: function() {
107      $(this).off( "resize", $event.special.smartresize.handler );
108    },
109    handler: function( event, execAsap ) {
110      // Save the context
111      var context = this,
112          args = arguments;
113
114      // set correct event type
115      event.type = "smartresize";
116
117      if ( resizeTimeout ) { clearTimeout( resizeTimeout ); }
118      resizeTimeout = setTimeout(function() {
119        $event[ dispatchMethod ].apply( context, args );
120      }, execAsap === "execAsap"? 0 : 100 );
121    }
122  };
123
124  $.fn.smartresize = function( fn ) {
125    return fn ? this.on( "smartresize", fn ) : this.trigger( "smartresize", ["execAsap"] );
126  };
127
128
129
130	/*!
131	 * jQuery Transit - CSS3 transitions and transformations
132	 * (c) 2011-2012 Rico Sta. Cruz <[email protected]>
133	 * MIT Licensed.
134	 *
135	 * http://ricostacruz.com/jquery.transit
136	 * http://github.com/rstacruz/jquery.transit
137	 */
138	(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
138)",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")}
138this.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);
139	
140
141
142
143	
144/****************** Nectar ******************/	
145
146// Create cross browser requestAnimationFrame method:
147window.requestAnimationFrame = window.requestAnimationFrame
148|| window.mozRequestAnimationFrame
149|| window.webkitRequestAnimationFrame
150|| window.msRequestAnimationFrame
151|| function(f){setTimeout(f, 1000/60)}
152	 
153var nectarDOMInfo = {
154	
155	usingMobileBrowser: (navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) ? true : false,
156	
157	usingFrontEndEditor: (typeof window.vc_iframe === 'undefined') ? false : true,
158	
159	getWindowSize: function() {
160		nectarDOMInfo.windowHeight = window.innerHeight;
161		nectarDOMInfo.windowWidth = window.innerWidth;
162		
163		nectarDOMInfo.adminBarHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0;
164		nectarDOMInfo.secondaryHeaderHeight = ($('#header-secondary-outer').length > 0) ? $('#header-secondary-outer').height() : 0;
165	},
166
167	scrollPosMouse: function() {
168		return $(window).scrollTop();
169	},
170	
171	scrollPosRAF: function() {
172		nectarDOMInfo.scrollTop = $(window).scrollTop();
173		requestAnimationFrame(nectarDOMInfo.scrollPosRAF);
174	},
175	
176
177	bindEvents: function() {
178		
179		if(!nectarDOMInfo.usingMobileBrowser) {
180			$(window).on('scroll',function(){ nectarDOMInfo.scrollTop = nectarDOMInfo.scrollPosMouse(); });
181		}
182		
183		$(window).on('resize',nectarDOMInfo.getWindowSize);
184		
185	}
186
187}
188
189nectarDOMInfo.getWindowSize();
190nectarDOMInfo.scrollTop = nectarDOMInfo.scrollPosMouse();
191
192if(nectarDOMInfo.usingMobileBrowser) { requestAnimationFrame(nectarDOMInfo.scrollPosRAF); } 
193
194nectarDOMInfo.bindEvents();
195
196
197//set row sizes
198fullWidthSections();
199fwsClasses();
200
201
202
203
204
205
206
207
208/***************** VC FRONTEND  ******************/
209
210function addRowCtrls() {
211
212
213		//remove padding for rows with only fullwidth ns
214		$('.wpb_row').removeClass('only-ns');
215		$('.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');
216		
217		//padding when column contains item that could get lost under column controls 
218		$('body.vc_editor.compose-mode .wpb_row .vc_vc_column > .wpb_column > .vc_column-inner').each(function(){
219			
220			if($(this).find('> .vc_element-container > div').length > 0) {
221				
222				if( $(this).find('> .vc_element-container > div:first-child').is('.vc_vc_row_inner') ) {
223					$(this).find('> .vc_element-container > div:first-child').addClass('first-inner-row-el');
224				} else {
225					$(this).find('> .vc_element-container > div:first-child').removeClass('first-inner-row-el');
226				}
227				
228			}
229			
230		}); 
231		
232	} //addRowCtrl end
233	
234	
235	function convertFrontEndPadding() {
236		 $('.vc_element > .wpb_column[class*="padding-"][class*="-percent"]').each(function(){
237			 
238				var $elPaddingPercent = 4;
239
240				var elclassName = this.className.match(/padding-\d+/); 
241				if (elclassName) {
242						$elPaddingPercent = elclassName[0].match(/\d+/); 
243						if($elPaddingPercent) {
244							$elPaddingPercent = $elPaddingPercent[0]/100;
245						} else {
246							$elPaddingPercent = 0;
247						}
248				}
249				
250				if($elPaddingPercent) {
251					 var $parentRowWidth = $(this).parents('.span_12').width();
252					 
253					 if($(this).is('[data-padding-pos="all"]')){
254							$(this).css('padding', $parentRowWidth * $elPaddingPercent );
255					 } else if($(this).is('[data-padding-pos="top"]')) {
256						 $(this).css('padding-top', $parentRowWidth * $elPaddingPercent );
257					 } else if($(this).is('[data-padding-pos="bottom"]')) {
258						 $(this).css('padding-bottom', $parentRowWidth * $elPaddingPercent );
259					 } else if($(this).is('[data-padding-pos="left"]')) {
260						 $(this).css('padding-left', $parentRowWidth * $elPaddingPercent );
261					 } else if($(this).is('[data-padding-pos="right"]')) {
262						 $(this).css('padding-right', $parentRowWidth * $elPaddingPercent );
263					 } else if($(this).is('[data-padding-pos="top-bottom"]')) {
264						 $(this).css({
265							 'padding-top': $parentRowWidth * $elPaddingPercent,
266							 'padding-bottom': $parentRowWidth * $elPaddingPercent,
267						 });
268					 } else if($(this).is('[data-padding-pos="top-right"]')) {
269						 $(this).css({
270							 'padding-top': $parentRowWidth * $elPaddingPercent,
271							 'padding-right': $parentRowWidth * $elPaddingPercent,
272						 });
273					 } else if($(this).is('[data-padding-pos="bottom-right"]')) {
274						 $(this).css({
275							 'padding-right': $parentRowWidth * $elPaddingPercent,
276							 'padding-bottom': $parentRowWidth * $elPaddingPercent,
277						 });
278					 } else if($(this).is('[data-padding-pos="bottom-left"]')) {
279						 $(this).css({
280							 'padding-left': $parentRowWidth * $elPaddingPercent,
281							 'padding-bottom': $parentRowWidth * $elPaddingPercent,
282						 });
283					 } else if($(this).is('[data-padding-pos="left-right"]')) {
284						 $(this).css({
285							 'padding-left': $parentRowWidth * $elPaddingPercent,
286							 'padding-right': $parentRowWidth * $elPaddingPercent,
287						 });
288					 }
289			 }
290
291		 }); //each
292		 
293		 //remove margins on element wrappers that are setting custom margin
294		 $('.wpb_row[class*="vc_custom_"]').each(function(){
295			 
296				$(this).parent().addClass('no-bottom-margin');
297		
298		 });
299		 
300	} //convertFrontEndPadding end
301 
302 
303 setTimeout(function(){
304	 
305	if($('body.compose-mode').length > 0) {
306		$('.container-wrap').addClass('visible-editor-controls');
307  }
308	
309	if(nectarDOMInfo.usingFrontEndEditor) {
310		addRowCtrls();
311		convertFrontEndPadding();
312		
313		$(window).smartresize(convertFrontEndPadding);
314	}
315
316},200);
317 
318 
319
320 
321 var $fp_section_length = 0, $fp_section_prev_length = 0;
322 
323 
324 $(window).on( 'vc_reload', function() {
325	 
326	 addRowCtrls();
327	 
328	 columnBGColors();
329	 coloredButtons();
330	 twentytwentyInit();
331	 parallaxRowsBGCals();
332	 
333	 if($('.carousel').length > 0) {
334		standardCarouselInit();
335		clientsCarouselInit();
336		carouselHeightCalcs();
337	}
338	
339	
340	if($('.owl-carousel').length > 0) { 
341		$('.owl-carousel').each(function(){
342			$(this).trigger('destroy.owl.carousel').removeClass('owl-loaded');
343			$(this).find('.owl-stage-outer .owl-stage > *').unwrap();
344			$(this).find('.owl-stage-outer > *').unwrap();
345			$(this).find('.owl-item > *').unwrap();
346			$(this).find('.owl-dots').remove();
347			$(this).find('.owl-nav').remove();
348		});
349		owlCarouselInit();
350	}
351	
352	flexsliderInit();
353	accordionInit();
354	ulChecks();
355	oneFourthClasses();
356	carouselfGrabbingClass();
357	if($('.nectar_cascading_images').length > 0) {
358		imagesLoaded($('.nectar_cascading_images'),function(instance){
359			cascadingImageBGSizing();
360		});
361	}
362	fullWidthSections();
363	fwsClasses();
364	fullwidthImgOnlySizingInit();
365	fullwidthImgOnlySizing();
366	fullWidthRowPaddingAdjustInit();
367	recentPostsFlickityInit();
368	if(nectarDOMInfo.usingMobileBrowser) {
369		fullWidthRowPaddingAdjustCalc();
370	}
371	if($('.nectar-box-roll').length == 0) { boxRollInit(); }
372	
373  /*flickity carousels*/
374	if($flickitySliders.length > 0) {
375		for(var i=0; i<$flickitySliders.length; i++) {
376			
377			$flickitySliders[i].reloadCells();
378			$flickitySliders[i].off( 'scroll.flickity'); 
379			$flickitySliders[i].off( 'dragStart.flickity'); 
380			$flickitySliders[i].off( 'dragEnd.flickity'); 
381
382		 }
383	}
384
385	setTimeout(function(){ 
386		
387		flickityInit();
388		if($flickitySliders.length > 0) { 
389			for(var i=0; i<$flickitySliders.length; i++) {
390				$flickitySliders[i].reloadCells();
391				$flickitySliders[i].resize();
392			 }
393		}
394	
395	},100);
396	
397	/*flickity product carousels*/
398	if($wooFlickityCarousels.length > 0) {
399		for(var i=0; i<$wooFlickityCarousels.length; i++) {
400			
401			$wooFlickityCarousels[i].flickity('reloadCells');
402			$wooFlickityCarousels[i].off( 'scroll.flickity'); 
403			$wooFlickityCarousels[i].off( 'dragStart.flickity'); 
404			$wooFlickityCarousels[i].off( 'dragEnd.flickity'); 
405
406		 }
407	}
408
409	setTimeout(function(){ 
410		
411		if( $('.nectar-woo-flickity').length > 0) { productCarouselInit(); }
412		if($wooFlickityCarousels.length > 0) { 
413			for(var i=0; i<$wooFlickityCarousels.length; i++) {
414				$wooFlickityCarousels[i].flickity('reloadCells');
415				$wooFlickityCarousels[i].flickity('resize');
416			 }
417		}
418	
419	},100);
420	
421	
422	socialSharingInit();
423	hotSpotHoverBind();
424	pricingTableHeight();
425	nectarIconMatchColoring();
426	
427	if($testimonialSlider.length > 0) {
428		for(var i=0; i<$testimonialSlider.length; i++) {
429			var testimonialflkty = $testimonialSlider[i].data('flickity');
430			$testimonialSlider[i].flickity('reloadCells');
431			$testimonialSlider[i].off( 'select.flickity');
432		}
433	} 
434
435	createTestimonialControls();
436	
437	lightBoxInit();
438	
439	imageWithHotspotClickEvents();
440	testimonialSliderHeight(); 
441	largeIconHover();
442	if($('.nectar-box-roll').length == 0) boxRollMouseWheelInit();
443	midnightInit();
444	responsiveVideoIframesInit();
445	responsiveVideoIframes();
446	fullWidthContentColumns();
447	setTimeout(fullWidthContentColumns,1000);
448	videoBGInit();
449	$(window).off('scroll.parallaxSections').off('resize.parallaxSections');
450	parallaxScrollInit();
451	
452	//update blog arr
453	$('.posts-container').each(function(i){
454		$blog_containers[i] = $(this);
455	});
456	masonryBlogInit();
457	masonryPortfolioInit();
458	portfolioAccentColor();
459	portfolioHoverEffects();
460	portfolioFiltersInit();
461	style6Img();
462	
463	fsProjectSliderInit();
464	
465	setTimeout(function(){
466		if($('.nectar_fullscreen_zoom_recent_projects').length > 0){
467			portfolioFullScreenSliderCalcs();
468			splitLineText();
469			$(window).resize(splitLineText);
470			$(window).resize(portfolioFullScreenSliderCalcs);
471		}
472	},300);
473	
474	isotopeCatSelection();
475	$(window).unbind('.infscr');
476	infiniteScrollInit();
477	postNextButtonEffect();
478	mouseParallaxInit();
479	
480	//play video BGs
481	$('.nectar-video-wrap').each(function(i){
482		if($(this).find('video').length > 0) {
483			  $(this).find('video').css('visibility','visible');
484		}
485	});
486	
487	//tablet inherits small desktop
488	$('.wpb_column[data-t-w-inherits]').each(function(){
489		if( $(this).is('[data-t-w-inherits="small_desktop"]') ) {
490			$(this).parent().addClass('inherits-s-desktop-col');
491		} else {
492			$(this).parent().removeClass('inherits-s-desktop-col');
493		}
494	});
495	
496	//full screen page rows
497	if($('#nectar_fullscreen_rows').length > 0) {
498		
499		$fp_section_length = $('#nectar_fullscreen_rows > .vc_element').length;
500		
501		
502		if( $('#nectar_fullscreen_rows > .vc_element').length == 0 ) {
503			$('#nectar_fullscreen_rows').prepend('<div class="vc_element empty_placeholder" />');
504		} 
505		
506		
507		if( $('#nectar_fullscreen_rows > .vc_element:not(.empty_placeholder)').length > 0 ) {
508			$('#nectar_fullscreen_rows >.vc_element.empty_placeholder').remove();
509		}
510		
511		setFPNames();
512
513		
514		//first load	
515		if($('#fp-nav').length == 0) {
516			initNectarFP();
517			
518			var currentFPSectionIndex = ($('#nectar_fullscreen_rows > .vc_element.active').length > 0) ? $('#nectar_fullscreen_rows > .vc_element.active').index() + 1 : 1;
519			setFPNavColoring(currentFPSectionIndex,'na');
520		} 
521		//after
522		////reinit if sections have been added/removed
523		else if($fp_section_length != $fp_section_prev_length) {
524
525			$.fn.fullpage.destroy('all');
526			initNectarFP();
527
528			var currentFPSectionIndex = ($('#nectar_fullscreen_rows > .vc_element.active').length > 0) ? $('#nectar_fullscreen_rows > .vc_element.active').index() + 1 : 1;
529			setFPNavColoring(currentFPSectionIndex,'na');
530
531		}
532		
533
534		//keep tooltip active status
535		var $nectarFPindex = 0;
536		var nectarFPOffsets = [{el: '', offset: 0}]; 
537		
538		////create list of offsets
539		$('#nectar_fullscreen_rows > div.vc_element').each(function(i){
540			nectarFPOffsets[i] = {
541				el: $(this),
542				offset: $(this).offset().top
543			}
544		});
545		
546		////loop to find lowest
547		for(var x in nectarFPOffsets) {
548			
549			if(nectarFPOffsets[x].offset < $(window).height()){
550				$nectarFPindex = x;
551			} 
552			
553		} 
554		////start active on that index
555		//$('#fp-nav ul > li:nth-child(' + (parseInt($nectarFPindex)+1) + ')').find('> a').trigger('click');
556		
557		//move back to first section when all have been deleted but one
558		if($('#nectar_fullscreen_rows > div.vc_element').length === 1) {
559			$('#nectar_fullscreen_rows').css({'transform' : 'translate3d(0,0,0)'});
560		}
561		
562		$('body').scrollTo(0,0);
563			
564		//update prev section length
565		$fp_section_prev_length = $fp_section_length;
566		
567	} else {
568		
569		//remove container wrap padding/margin when needded
570		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 ) {
571				$('.container-wrap').css({ 'padding-top': '0', 'margin-top' : '0'});
572		} else {
573			$('.container-wrap').css({ 'padding-top': '40px'});
574		}
575		
576	}
577	
578	
579	//reset svg icon arr
580	$svg_icons = [];
581	$('.svg-icon-holder').removeClass('animated-in').removeClass('bound');
582
583	
584	//gmap
585	if($('.vc_nectar_gmap').length > 0) {
586		
587		setTimeout(function(){
588			
589			if(typeof google === 'object' && typeof google.maps === 'object') {
590				mapAPI_Loaded();
591			} else {
592
593				if(nectarLove.mapApiKey.length > 0) {
594					$.getScript('https://maps.google.com/maps/api/js?sensor=false&key='+nectarLove.mapApiKey+'&callback=mapAPI_Loaded');
595				}
596			}
597			
598		},100);
599}
600	
601	if( $().theiaStickySidebar ) {
602		blogStickySS();
603	}
604	
605	
606	 if(typeof window.Waypoint != 'undefined') {
607		 Waypoint.destroyAll();
608		 waypoints();
609	 }
610	 
611 });
612
613
614
615
616
617/***************** Lightbox Init ******************/
618	
619	function fancyBoxInit() {
620		//convert old pp links
621		$('a.pp').removeClass('pp').attr('data-fancybox','');
622		$("a[rel^='prettyPhoto']:not([rel*='_gal']):not([rel*='product-gallery']):not([rel*='prettyPhoto['])").removeAttr('rel').attr('data-fancybox','');
623		
624		//image gallery nectar
625		$('.wpb_gallery .wpb_gallery_slidesnectarslider_style').each(function(){
626			var $unique_id = Math.floor(Math.random()*10000);
627			$(this).find('.swiper-slide a:not(.ext-url-link)').attr('data-fancybox','group_'+$unique_id);
628		});
629		
630		//flex
631		$('.wpb_gallery_slides.wpb_flexslider').each(function(){
632			var $unique_id = Math.floor(Math.random()*10000);
633			$(this).find('.slides > li > a').attr('data-fancybox','group_'+$unique_id);
634		});
635		
636		//touch enabled gal
637		$('.wpb_gallery_slidesflickity_style').each(function(){
638			var $unique_id = Math.floor(Math.random()*10000);
639			$(this).find('.cell > a:not(.ext-url-link)').attr('data-fancybox','group_'+$unique_id);
640		});
641		
642		//add galleries to portfolios
643		$('.portfolio-items, .wpb_gallery .parallax-grid-item').each(function(){
644			var $unique_id = Math.floor(Math.random()*10000);
645			if($(this).find('.pretty_photo').length > 0) {
646				$(this).find('.pretty_photo').removeClass('pretty_photo').attr('data-fancybox','group_'+$unique_id);
647			} else if($(this).find('a[rel*="prettyPhoto["]').length > 0){
648				$(this).find('a[rel*="prettyPhoto["]').removeAttr('rel').attr('data-fancybox','group_'+$unique_id);
649			}
650
651		});
652		
653		//nectar auto lightbox
654		if($('body').hasClass('nectar-auto-lightbox')){
655			$('.gallery').each(function(){
656				if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length == 0) {
657					var $unique_id = Math.floor(Math.random()*10000);
658					$(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');
659				}
660			});
661			$('.main-content img').each(function(){
662				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) {
663					var match = $(this).parent().attr('href').match(/\.(jpg|png|gif)\b/);
664					if(match) $(this).parent().attr('data-fancybox','');
665				} 
666			});
667		}
668		
669		//regular
670		fbMarginArr = ($('body.admin-bar').length > 0) ? [60,100] : [60,100];
671		if(window.innerWidth < 1000) {
672			fbMarginArr = [0,0];
673		}
674		$("[data-fancybox]").fancybox({
675			animationEffect : "zoom-in-out",
676			animationDuration : 350,
677			buttons : [
678        //'slideShow',
679        'fullScreen',
680        //'thumbs',
681        //'share',
682        //'download',
683        'zoom',
684        'close'
685    	],
686			margin : fbMarginArr,
687			loop     : true,
688			caption : function( instance, item ) {
689				return $(this).attr('title');
690			},
691			beforeLoad: function(instance,current) {
692				//when there's nothing to load
693				if(typeof instance.current.src !== 'string') {  $.fancybox.close(true);  }
694			},
695			mobile : {
696				margin   : 0
697			}
698		});
699	}
700	
701	
702	function magnificInit() {
703		
704		//convert old pp links
705		$('a.pp').removeClass('pp').addClass('magnific-popup');
706		$("a[rel^='prettyPhoto']:not([rel*='_gal']):not([rel*='product-gallery']):not([rel*='prettyPhoto['])").removeAttr('rel').addClass('magnific-popup');
707
708
709		//image gallery nectar
710		$('.wpb_gallery .wpb_gallery_slidesnectarslider_style').each(function(){
711			var $unique_id = Math.floor(Math.random()*10000);
712			$(this).find('.swiper-slide a:not(.ext-url-link)').addClass('pretty_photo');
713		});
714
715		//flex
716		$('.wpb_gallery_slides.wpb_flexslider').each(function(){
717			var $unique_id = Math.floor(Math.random()*10000);
718			$(this).find('.slides > li > a').addClass('pretty_photo');
719		});
720		//touch enabled gal
721		$('.wpb_gallery_slidesflickity_style').each(function(){
722			var $unique_id = Math.floor(Math.random()*10000);
723			$(this).find('.cell > a:not(.ext-url-link)').addClass('pretty_photo');
724		});
725
726		//add galleries to portfolios
727		$('.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(){
728			if($(this).find('.pretty_photo').length > 0) {
729				$(this).find('.pretty_photo').removeClass('pretty_photo').addClass('gallery').addClass('magnific');
730			} else if($(this).find('a[rel*="prettyPhoto["]').length > 0){
731				$(this).find('a[rel*="prettyPhoto["]').removeAttr('rel').addClass('gallery').addClass('magnific');
732			}
733
734		});
735		
736		$("a[data-rel='prettyPhoto[product-gallery]']").each(function(){
737			$(this).removeAttr('data-rel').addClass('magnific').addClass('gallery');
738		});
739		
740		//nectar auto lightbox
741		if($('body').hasClass('nectar-auto-lightbox')){
742			$('.gallery').each(function(){
743				if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length == 0) {
744					var $unique_id = Math.floor(Math.random()*10000);
745					$(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');
746				}
747			});
748			$('.main-content img').each(function(){
749				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) {
750					var match = $(this).parent().attr('href').match(/\.(jpg|png|gif)\b/);
751					if(match) $(this).parent().addClass('magnific-popup').addClass('image-link');
752				} 
753			});
754		}
755		
756
757		//regular
758		$('a.magnific-popup:not(.gallery):not(.nectar_video_lightbox)').magnificPopup({ 
759			type: 'image', 
760			callbacks: {
761				
762				imageLoadComplete: function()  {	
763					var $that = this;
764					setTimeout( function() { $that.wrap.addClass('mfp-image-loaded'); }, 10);
765				},
766				beforeOpen: function() {
767				    this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
768			    },
769			    open: function() {
770					    	
771					$.magnificPopup.instance.next = function() {
772						var $that = this;
773
774						this.wrap.removeClass('mfp-image-loaded');
775						setTimeout( function() { $.magnificPopup.proto.next.call($that); }, 100);
776					}
777
778					$.magnificPopup.instance.prev = function() {
779						var $that = this;
780
781						this.wrap.removeClass('mfp-image-loaded');
782						setTimeout( function() { $.magnificPopup.proto.prev.call($that); }, 100);
783					}
784					
785				}
786			},
787			fixedContentPos: false,
788		    mainClass: 'mfp-zoom-in', 
789		    removalDelay: 400 
790		});
791
792		//video
793		$('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({ 
794			type: 'iframe', 
795			fixedContentPos: false,
796		    mainClass: 'mfp-zoom-in', 
797		    removalDelay: 400 
798		});
799
800
801		//galleries
802		$('a.magnific.gallery').each(function(){
803
804			var $parentRow = ($(this).closest('.wpb_column').length > 0) ? $(this).closest('.wpb_column') : $(this).parents('.row');
805			if($parentRow.length > 0 && !$parentRow.hasClass('lightbox-col')) {
806
807				$parentRow.magnificPopup({
808					type: 'image',
809					delegate: 'a.magnific',
810					mainClass: 'mfp-zoom-in',
811					fixedContentPos: false,
812					callbacks: {
813
814						elementParse: function(item) {
815			
816							 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 ) {
817						         item.type = 'iframe';
818						      } else if ($(item.el.context).is('[href]') && $(item.el.context).attr('href').indexOf('video-popup-') != -1) {
819						      	item.type = 'inline';
820						      } else {
821						         item.type = 'image';
822						      }
823						},
824
825						imageLoadComplete: function()  {	
826							var $that = this;
827							setTimeout( function() { $that.wrap.addClass('mfp-image-loaded'); }, 10);
828						},
829
830						beforeOpen: function() {
831					       this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
832					    },
833
834					    open: function() {
835					    	
836
837					    	//self hosted video
838					    	if($(this.content).find('.mejs-video video').length > 0 && $().mediaelementplayer ) {
839	            				$(this.content).find('.mejs-video video')[0].player.remove();
840	            				
841	            				var $that = this;
842	            				setTimeout(function(){
843	            					$($that.content).find('video').mediaelementplayer();
844	            					$($that.content).find('.mejs-video video')[0].player.play();
845	            				},50);
846	            				
847	            			}
848
849							$.magnificPopup.instance.next = function() {
850								var $that = this;
851
852								this.wrap.removeClass('mfp-image-loaded');
853								setTimeout( function() { 
854									$.magnificPopup.proto.next.call($that); 
855
856									//self hosted video
857									if($($that.content).find('.mejs-video video').length > 0) {
858			            				$($that.content).find('.mejs-video video')[0].play();
859			            			}
860
861								}, 100);
862							}
863
864							$.magnificPopup.instance.prev = function() {
865								var $that = this;
866
867								this.wrap.removeClass('mfp-image-loaded');
868								setTimeout( function() { 
869									$.magnificPopup.proto.prev.call($that); 
870
871									//self hosted video
872									if($($that.content).find('.mejs-video video').length > 0) {
873			            				$($that.content).find('.mejs-video video')[0].play();
874			            			}
875								}, 100);
876							}
877							
878						},
879
880						close: function() {
881							//self hosted video
882					    	if($(this.content).find('.mejs-video video').length > 0) {
883	            				 $(this.content).find('.mejs-video video')[0].load();
884	            			}
885						}
886					},
887					removalDelay: 400, 
888					gallery: {
889			          enabled:true
890			        }
891				});
892
893				$parentRow.addClass('lightbox-col');
894			}
895			
896		});
897
898	}
899
900	function lightBoxInit() {
901		if($('body[data-ls="magnific"]').length > 0 || $('body[data-ls="pretty_photo"]').length > 0 ) {
902			magnificInit();
903		} else if($('body[data-ls="fancybox"]').length > 0) {
904			fancyBoxInit();
905		}
906	}
907
908	lightBoxInit();
909	//check for late links
910	setTimeout(lightBoxInit,500);
911	
912
913
914
915/*nectar liquid*/
916
917function NectarLiquid(bgIMG, type, el_type) {
918	this.canvasContainer = bgIMG[0];
919	this.rowBG = bgIMG;
920	this.animationType = type;
921	this.elType = el_type;
922	
923	this.bgDivWidth = $(this.rowBG).width();
924	this.bgDivHeight = $(this.rowBG).height();
925	this.bgDivRatio = this.bgDivHeight / this.bgDivWidth;
926	
927	
928	this.app = new PIXI.Application({
929		width: this.bgDivWidth, 
930		height: this.bgDivHeight,
931		transparent: true,
932		sharedTicker: true
933	});
934	
935	this.app.stage = new window.PIXI.Container();
936	this.imgContainer = new window.PIXI.Container();
937	
938
939	//grab displacement filter from css
940	$(this.canvasContainer).remove('.nectar-displacement');
941	$(this.canvasContainer).append('<div class="nectar-displacement"></div>');
942	this.displacementIMG_URL = $(this.canvasContainer).find('.nectar-displacement').css('background-image');			
943	this.displacementIMG_URL = this.displacementIMG_URL.replace(/(url\(|\)|")/g, '');
944				
945	//get row BG img
946	this.bgIMG_SRC = bgIMG.css('background-image');
947	this.bgIMG_SRC = this.bgIMG_SRC.replace(/(url\(|\)|")/g, '');
948	
949	
950	//init everything once loaded
951	this.loader = new PIXI.loaders.Loader();
952	this.loader.add('rowBG',this.bgIMG_SRC);
953	this.loader.add('displaceBG', this.displacementIMG_URL);
954	this.loader.load(this.initialize.bind(this));
955
956}
957
958NectarLiquid.prototype.initialize = function() {
959	
960  this.settings = {
961      animationStrength: 1,
962			animationStrengthSpeed: 1,
963		  displacementScaleX: 30,
964			displacementScaleY: 90,
965      time: Math.random()*20,
966			filterMultX: 200,
967			filterMultY: 350,
968			shouldAnimate: true
969  };
970	if(this.animationType == 'displace-filter-fade') {
971		
972		if(this.elType == 'row') {
973			this.settings.filterMultX = 150;
974			this.settings.filterMultY = 375;
975			this.settings.displacementScaleX = 80;
976			this.settings.displacementScaleY = 170;
977			this.settings.animationStrengthSpeed = 2;
978		} else {
979			this.settings.filterMultX = 55;
980			this.settings.filterMultY = 150;
981			this.settings.displacementScaleX = 50;
982			this.settings.displacementScaleY = 160;
983			this.settings.animationStrengthSpeed = 1;
984		}
985	} else {
986		
987		if(this.elType != 'row') {
988			this.settings.displacementScaleY = 70;
989		}
990		
991	}
992	
993
994	//displacement
995	this.filterSprite = new window.PIXI.Sprite( this.loader.resources.displaceBG.texture );
996	this.filterSprite.texture.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT;
997	this.filter = new window.PIXI.filters.DisplacementFilter( this.filterSprite );
998
999	//bg	
1000	this.bg = new PIXI.Sprite( this.loader.resources.rowBG.texture );
1001
1002	////store actual img height/ratio
1003	this.imgHeight = this.loader.resources.rowBG.texture.orig.height;
1004	this.imgWidth = this.loader.resources.rowBG.texture.orig.width;
1005	this.imgRatio = this.imgWidth/this.imgHeight;
1006	
1007	// Set image anchor to the center of the image
1008  this.bg.anchor.x = 0.5;
1009  this.bg.anchor.y = 0.5;
1010	
1011	//sim background-size cover
1012	this.bg.height = $(this.rowBG).height();
1013	this.bg.width = this.imgRatio * this.bg.height;
1014	
1015	if( this.bg.width <= $(this.rowBG).width() ) {
1016		
1017		this.bg.width = $(this.rowBG).width() + 100;
1018		this.bg.height = this.bg.width / this.imgRatio;
1019		
1020	} else {
1021		this.bg.height = $(this.rowBG).height() + 100;
1022		this.bg.width = this.imgRatio * this.bg.height;
1023	}
1024
1025	//reset the dimensions for the renderer incase the row height has changed inbetween loading the bg resouce
1026	this.app.renderer.resize( $(this.rowBG).width(), $(this.rowBG).height() ); 
1027
1028  this.buildStage();
1029  this.createFilters();
1030	
1031	this.app.view.setAttribute( "class", "nectar-liquid-bg" );
1032  this.canvasContainer.appendChild( this.app.view );
1033	
1034	
1035	if(this.animationType == 'displace-filter-loop') {
1036		
1037		if($('#nectar_fullscreen_rows').length == 0) {
1038			
1039			this.animateFilters();
1040			
1041			$liquidBGOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '105%';
1042			
1043			var self = this;
1044			var $parentSelector = (self.elType == 'row') ? '.row-bg-wrap' : '.column-image-bg-wrap';
1045			
1046			var waypoint = new Waypoint({
1047				element: $(this.canvasContainer).parents($parentSelector),
1048				handler: function(direction) {
1049					//add bg to container
1050					self.imgContainer.addChild( self.bg );
1051				},
1052				offset: $liquidBGOffsetPos
1053			});
1054			
1055		} else {
1056			
1057			this.animateFilters();
1058			this.imgContainer.addChild( this.bg );
1059			
1060		}
1061
1062		
1063	}
1063 //end displace loop
1064	
1065	else if(this.animationType == 'displace-filter-fade') {
1066		
1067		this.animateFilters();
1068		this.settings.shouldAnimate = false;
1069		
1070		$liquidBGOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '85%';
1071		
1072		var self = this;
1073		var $parentSelector = (self.elType == 'row') ? '.row-bg-wrap' : '.column-image-bg-wrap';
1074			
1075		if($('#nectar_fullscreen_rows').length == 0 || $('#nectar_fullscreen_rows').length > 0 && $(this.canvasContainer).parents('.wpb_row.fp-section').index() == 0 || $disableFPonMobile == 'on') {
1076			
1077			var waypoint = new Waypoint({
1078				 element: $(this.canvasContainer).parents($parentSelector),
1079				 handler: function(direction) {
1080
1081					if($(self.canvasContainer).parents('.wpb_tab').length > 0 && $(self.canvasContainer).parents('.wpb_tab').css('visibility') == 'hidden' || $(self.canvasContainer).hasClass('animated-in')) { 
1082							 waypoint.destroy();
1083							 return;
1084					}
1085				
1086
1087					//add bg to container
1088					self.imgContainer.addChild( self.bg );
1089					
1090					//animate down
1091					self.animateProps(self);
1092					
1093					waypoint.destroy();
1094				},
1095				offset: $liquidBGOffsetPos
1096
1097			}); //waypoint end
1098		}
1099		
1100		
1101	} // end fade in displace
1102	
1103	//resize logic
1104 	$(window).resize(this.resize.bind(this));
1105  $(window).smartresize(this.resize.bind(this));
1106}
1107
1108NectarLiquid.prototype.animateProps = function(self) {
1109	
1110	setTimeout(function(){
1111
1112		$(self.canvasContainer).find('.nectar-liquid-bg').addClass('animated-in');
1113		
1114		self.settings.shouldAnimate = true;
1115		self.settings.animationStrength = 1;
1116		self.settings.animationStrengthSpeed = 2.5;
1117		self.animateFilters();
1118		
1119		//animate displacement down
1120		anime({
1121			targets: self.settings,
1122			animationStrength: 0,
1123			duration: 1900,
1124			easing: [.36,.42,.3,1],
1125			complete: function(anim) {
1126				self.settings.shouldAnimate = false
1127			}
1128		});
1129		
1130		anime({
1131			targets: self.settings,
1132			animationStrengthSpeed: 0.8,
1133			duration: 1900,
1134			easing: [.36,.42,.3,1],
1135			complete: function(anim) {
1136				self.settings.shouldAnimate = false
1137			}
1138		});
1139	
1140	},100);
1141	
1142}
1143
1144NectarLiquid.prototype.resize = function(){
1145	var self = this;
1146
1147  self.bgDivRatio = $(self.rowBG).height() / $(self.rowBG).width();
1148	 
1149	 self.imgContainer.position.x = $(self.rowBG).width() / 2;
1150   self.imgContainer.position.y = $(self.rowBG).height() / 2;
1151	 
1152	 //sim background-size cover
1153	 self.bg.height = $(self.rowBG).height();
1154	 self.bg.width = self.imgRatio * self.bg.height;
1155	 
1156	 if( self.bg.width <= $(self.rowBG).width() ) {
1157		 self.bg.width = $(self.rowBG).width() + 100;
1158		 self.bg.height = self.bg.width / self.imgRatio;
1159		 
1160	 } else {
1161		 self.bg.height = $(self.rowBG).height() + 100;
1162		 self.bg.width = self.imgRatio * self.bg.height;
1163	 }
1164	 
1165	 self.app.stage.scale.x = self.app.stage.scale.y = 1;
1166
1167	 self.app.renderer.resize( $(self.rowBG).width(), $(self.rowBG).height() ); 
1168
1169}
1170
1171NectarLiquid.prototype.createFilters = function() {
1172  this.app.stage.addChild( this.filterSprite );
1173  this.filter.scale.x = this.filter.scale.y = 1;
1174  this.imgContainer.filters = [
1175      this.filter
1176  ];
1177}
1178
1179	
1180NectarLiquid.prototype.buildStage = function() {
1181  this.imgContainer.position.x = $(this.rowBG).width() / 2;
1182  this.imgContainer.position.y = $(this.rowBG).height() / 2;
1183  this.app.stage.scale.x = this.app.stage.scale.y = 1;
1184  this.app.stage.addChild( this.imgContainer );
1185}
1186
1187
1188NectarLiquid.prototype.animateFilters = function() {
1189	this.filterSprite.rotation = this.settings.time * 0.01;
1190	this.filterSprite.x = Math.sin(this.settings.time * 0.1) * this.settings.filterMultX;
1191  this.filterSprite.y = Math.cos(this.settings.time * 0.1) * this.settings.filterMultY;
1192  this.filter.scale.x = this.settings.displacementScaleX * this.settings.animationStrength;
1193  this.filter.scale.y = this.settings.displacementScaleY * this.settings.animationStrength;
1194  
1195	
1196	this.settings.time += 0.05 * this.settings.animationStrengthSpeed;
1197	
1198	if(this.animationType == 'displace-filter-loop') {
1199		requestAnimationFrame(function(){
1200	    this.animateFilters();
1201	  }.bind(this));
1202	}
1203	else if(this.animationType == 'displace-filter-fade' && this.settings.shouldAnimate) {
1204		requestAnimationFrame(function(){
1205	    this.animateFilters();
1206	  }.bind(this));
1207	}
1208	
1209} 
1210
1211function nectarLiquidBGs() {
1212	$liquidBG_EL = [];
1213
1214	$('.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){
1215		
1216		var $that_el = $(this);
1217		
1218		if( $(this).is('.row-bg') ) {
1219			
1220			var $type = $(this).parents('.row-bg-wrap').attr('data-bg-animation');
1221			var $el_type = 'row';
1222			
1223		} else if(  $(this).is('.column-image-bg') ) {
1224			
1225			var $type = $(this).parents('.column-image-bg-wrap').attr('data-bg-animation');
1226			var $el_type = 'col';
1227		}
1228		
1229		$liquidBG_EL[i] = new NectarLiquid($that_el, $type, $el_type);
1230		
1231	});
1232}
1233
1234
1235
1236
1237
1238/***************** Global vars ******************/
1239var $standAnimatedColTimeout = [];
1240var $animatedSVGIconTimeout = [];
1241var $svg_icons = [];
1242var $nectarCustomSliderRotate = [];
1243var $flickitySliders = [];
1244var $wooFlickityCarousels = [];
1245var $liquidBG_EL = [];
1246
1247/***************** Smooth Scrolling ******************/
1248
1249	function niceScrollInit(){
1250		//removed since 9.0.
1251	}
1252
1253	var $smoothActive = 0; 
1254	var $smoothCache = false;
1255	
1256	
1257	//chrome ss
1258	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) {
1259		!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))}();
1260	}
1261
1262
1263/***************** Sliders ******************/
1264
1265	//gallery
1266	function flexsliderInit(){
1267		$('.flex-gallery').each(function(){
1268			
1269			var $that = $(this);
1270			
1271			imagesLoaded($(this),function(instance){
1272			
1273				 $that.flexslider({
1274			        animation: 'fade',
1275			        smoothHeight: false, 
1276			        animationSpeed: 500,
1277			        useCSS: false, 
1278			        touch: true
1279			    });
1280				
1281				////gallery slider add arrows
1282				$('.flex-gallery .flex-direction-nav li a.flex-next').html('<i class="fa fa-angle-right"></i>');
1283				$('.flex-gallery .flex-direction-nav li a.flex-prev').html('<i class="fa fa-angle-left"></i>');
1284			
1285			});
1286			
1287		});
1288	}
1289	flexsliderInit();
1290
1291  
1292
1293
1294	function flickityInit() {
1295		if($('.nectar-flickity:not(.masonry)').length == 0) return false;
1296		$flickitySliders = [];
1297		$('.nectar-flickity:not(.masonry)').each(function(i){
1298			
1299			$(this).removeClass(function (index, className) {
1300			    return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
1301			});
1302			$(this).addClass('instance-'+i);
1303			
1304			var $freeScrollBool = ($(this).is('[data-free-scroll]') && $(this).attr('data-free-scroll') == 'true') ? true : false;
1305			var $groupCellsBool = true;
1306			var $flickContainBool = true;
1307			var $flcikAttr = 0.025;
1308			
1309			var $flickCellAlign = 'center';
1310			if( $(this).is('[data-format="fixed_text_content_fullwidth"]') ) {
1311					$flickCellAlign = 'left';
1312					$groupCellsBool = false;
1313					$flickContainBool = false;
1314					$flcikAttr = 0.02;
1315			}
1316
1317			if($freeScrollBool == true) {
1318				 $groupCellsBool = false;
1319			}
1320
1321			if($(this).attr('data-controls').length > 0 && $(this).attr('data-controls') == 'next_prev_arrows') {
1322				var $paginationBool = false;
1323				var $nextPrevArrowBool = true;
1324			} else {
1325				var $paginationBool = true;
1326				var $nextPrevArrowBool = false;
1327			}
1328
1329			if($(this).attr('data-controls').length > 0 && $(this).attr('data-controls') == 'none') {
1330				var $paginationBool = false;
1331				var $nextPrevArrowBool = false;
1332			}
1333
1334			var $flickity_autoplay = false;
1335			var $selectedAttraction = 0.025;
1336
1337			if($(this).is('[data-autoplay]') && $(this).attr('data-autoplay') == 'true') {
1338				
1339				$flickity_autoplay = true;
1340				$selectedAttraction = 0.019;
1341
1342				if($(this).is('[data-autoplay-dur]') && $(this).attr('data-autoplay-dur').length > 0) {
1343
1344					if(parseInt($(this).attr('data-autoplay-dur')) > 100 && parseInt($(this).attr('data-autoplay-dur')) < 30000) {
1345						$flickity_autoplay = parseInt($(this).attr('data-autoplay-dur'));
1346					}
1347					
1348				}
1349
1350			}
1351
1352			var $that = $(this);
1353			var $frontEndEditorDrag =  ($('body.vc_editor').length > 0) ? false: true;
1354			var $frontEndEditorPause =  ($('body.vc_editor').length > 0) ? true: false;
1355			
1356			$flickitySliders[i] = new Flickity('.nectar-flickity.instance-'+i, {
1357			  contain: $flickContainBool,
1358			  draggable:$frontEndEditorDrag,
1359			  lazyLoad: false,
1360			  imagesLoaded: true,
1361			  percentPosition: true,
1362				cellAlign: $flickCellAlign,
1363			  selectedAttraction: $selectedAttraction,
1364			  groupCells: $groupCellsBool,
1365			  prevNextButtons: $nextPrevArrowBool,
1366			  freeScroll: $freeScrollBool,
1367			  pageDots: $paginationBool,
1368			  resize: true,
1369				selectedAttraction: $flcikAttr,
1370			  autoPlay: $flickity_autoplay,
1371				pauseAutoPlayOnHover: $frontEndEditorPause,
1372			  setGallerySize: true,
1373			  wrapAround: true,
1374			  accessibility: false,
1375			  arrowShape: { 
1376				     x0: 20,
1377					  x1: 70, y1: 30,
1378					  x2: 70, y2: 25,
1379					  x3: 70
1380				}
1381			});
1382			
1383
1384			if($(this).is('[data-format="fixed_text_content_fullwidth"]') && !nectarDOMInfo.usingFrontEndEditor) {
1385				
1386				var $onMobileBrowser = navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/);
1387				
1388				$flickitySliders[i].on( 'scroll', function() {
1389					
1390					if($onMobileBrowser) { return; }
1391					
1392					var $curFlkSlid = $flickitySliders[i];
1393					var $flkSlideWidth = $that.find('.cell').outerWidth() + 25;
1394					var $leftHeaderSize = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 275 : 0;
1395					var $extraWindowSpace = ( ($(window).width() + $leftHeaderSize) - $that.parents('.main-content').width())/2;
1396					$extraWindowSpace += parseInt($that.css('margin-left')) + 2;
1397					$flickitySliders[i].slides.forEach( function( slide, j ) {
1398
1399							var $scaleAmt = 1;
1400							var $translateXAmt = 0;
1401							var $rotateAmt = 0;
1402							var $slideZIndex = 10;
1403							var $opacityAmt = 1;
1404							
1405							var $slideOffset = $(slide.cells[0].element).offset().left;
1406							
1407							var flkInstanceSlide = $('.nectar-flickity.instance-'+i+' .cell:nth-child('+ (j+1) +')');
1408							
1409							if($slideOffset - $extraWindowSpace < 0 && $slideOffset  - $extraWindowSpace > $flkSlideWidth*-1 ) {
1410								$scaleAmt = 1 + ( ($slideOffset - $extraWindowSpace) / 1500);
1411								$opacityAmt = 1 + ( ($slideOffset - $extraWindowSpace + 70) / 550);
1412								$translateXAmt = ( ($slideOffset - $extraWindowSpace)) * -1;
1413								$rotateAmt = ( ($slideOffset  - $extraWindowSpace) / 25) * -1;
1414							} else {
1415								$scaleAmt = 1;
1416								$opacityAmt = 1;
1417								$translateXAmt = 0;
1418								$rotateAmt = 0;
1419							}
1420							
1421							//handle z separately for an extra cushion of 5px in case
1422							if($slideOffset + 5 - $extraWindowSpace < 0 && $slideOffset  - $extraWindowSpace > $flkSlideWidth*-1 ) {
1423								$slideZIndex = 5;
1424							} else {
1425								$slideZIndex = 10;
1426							}
1427							
1428							flkInstanceSlide.css({
1429								'z-index' : $slideZIndex
1430							});
1431							
1432							flkInstanceSlide.find('.inner-wrap-outer').css({
1433								'transform': 'perspective(800px) translateX('+ $translateXAmt +'px) rotateY('+$rotateAmt+'deg) translateZ(0)',
1434								'opacity' : $opacityAmt
1435							});
1436							
1437							flkInstanceSlide.find('.inner-wrap').css({
1438								'transform': 'scale('+ $scaleAmt +') translateZ(0)'
1439							}); 
1440							
1441						  
1442					
1443					});
1444				});
1445				
1446				
1447			}
1448
1449			var $removeHiddenTimeout;
1450
1451			$flickitySliders[i].on( 'dragStart', function() {
1452			   clearTimeout($removeHiddenTimeout);
1453				 $that.addClass('is-dragging');
1454			   $that.find('.flickity-prev-next-button').addClass('hidden');
1455			});
1456			$flickitySliders[i].on( 'dragEnd', function() {
1457				$that.removeClass('is-dragging');
1458				$removeHiddenTimeout = setTimeout(function(){
1459					$that.find('.flickity-prev-next-button').removeClass('hidden');
1460				},600);
1461			 
1462			});
1463
1464			$('.flickity-prev-next-button').on( 'click', function() {
1465			   clearTimeout($removeHiddenTimeout);
1466			   $(this).parents('.nectar-flickity').find('.flickity-prev-next-button').addClass('hidden');
1467			   $removeHiddenTimeout = setTimeout(function(){
1468					$that.find('.flickity-prev-next-button').removeClass('hidden');
1469				},600);
1470			});
1471			
1472			
1473			//imgs loaded
1474			if($that.hasClass('nectar-carousel')) {
1475				imagesLoaded($that,function(instance){
1476					nectarCarouselFlkEH($that);
1477				});
1478			}
1479			
1480
1481		});
1482		
1483
1484	}
1485	
1486	
1487	setTimeout(flickityInit,100);
1488	
1489	
1490	//nectar carousel flickity equal height
1491	
1492	////loop
1493	function setNectarCarouselFlkEH() {
1494			$('.nectar-carousel.nectar-flickity:not(.masonry)').each(function(){
1495				  nectarCarouselFlkEH($(this));
1496			});
1497	}
1498	
1499	function nectarCarouselFlkEH($slider_instance) {
1500			
1501			var $tallestSlideCol = 0;
1502			
1503			$slider_instance.find('.flickity-slider > .cell').css('height','auto');
1504			
1505			$slider_instance.find('.flickity-slider > .cell').each(function(){
1506				($(this).height() > $tallestSlideCol) ? $tallestSlideCol = $(this).height() : $tallestSlideCol = $tallestSlideCol;
1507			});	
1508			
1509			//safety net incase height couldn't be determined
1510			if($tallestSlideCol < 10) $tallestSlideCol = 'auto';
1511
1512			//set even height
1513			$slider_instance.find('.flickity-slider > .cell').css('height',$tallestSlideCol+'px');
1514
1515	}
1516	
1517	
1518
1519
1520	function flickityBlogInit() {
1521		if($('.nectar-flickity.masonry.not-initialized').length == 0) return false;
1522
1523		$('.nectar-flickity.masonry.not-initialized').each(function(){
1524
1525			//move pos for large_featured
1526			if($(this).parents('article').hasClass('large_featured')) 
1527				$(this).insertBefore( $(this).parents('article').find('.content-inner') );
1528			
1529		});
1530
1531
1532		$('.nectar-flickity.masonry.not-initialized').flickity({
1533		  contain: true,
1534		  draggable: false,
1535		  lazyLoad: false,
1536		  imagesLoaded: true,
1537		  percentPosition: true,
1538		  prevNextButtons: true,
1539		  pageDots: false,
1540		  resize: true,
1541		  setGallerySize: true,
1542		  wrapAround: true,
1543		  accessibility: false
1544		});
1545
1546		$('.nectar-flickity.masonry').removeClass('not-initialized');
1547
1548		//add count
1549		$('.nectar-flickity.masonry:not(.not-initialized)').each(function(){
1550
1551			if($(this).find('.item-count').length == 0) {
1552				
1553				$('<div class="item-count"/>').insertBefore($(this).find('.flickity-prev-next-button.next'));
1554				$(this).find('.item-count').html('<span class="current">1</span>/<span class="total">' + $(this).find('.flickity-slider .cell').length + '</span>');
1555
1556				$(this).find('.flickity-prev-next-button, .item-count').wrapAll('<div class="control-wrap" />');
1557
1558				//move pos for wide_tall
1559				if($(this).parents('article').hasClass('wide_tall') && $(this).parents('.masonry.material').length == 0) 
1560					$(this).find('.control-wrap').insertBefore( $(this) );
1561			}
1562		});
1563
1564		//update count
1565		$('.masonry .flickity-prev-next-button.previous,  .masonry .flickity-prev-next-button.next').on('click',function(){
1566			if($(this).parents('.wide_tall').length > 0) 
1567				$(this).parent().find('.item-count .current').html($(this).parents('article').find('.nectar-flickity .cell.is-selected').index()+1);
1568			else 
1569				$(this).parent().find('.item-count .current').html($(this).parents('.nectar-flickity').find('.cell.is-selected').index()+1);
1570		});
1571
1572		$('body').on('mouseover','.flickity-prev-next-button.next',function(){
1573			$(this).parent().find('.flickity-prev-next-button.previous, .item-count').addClass('next-hovered');
1574		});
1575		$('body').on('mouseleave','.flickity-prev-next-button.next',function(){
1576			$(this).parent().find('.flickity-prev-next-button.previous, .item-count').removeClass('next-hovered');
1577		});
1578	
1579	}
1580/****************twenty twenty******************/
1581function twentytwentyInit() {
1582	$('.twentytwenty-container').each(function(){
1583		var $that = $(this);
1584		
1585		if($that.find('.twentytwenty-handle').length == 0) {
1586			$(this).imagesLoaded(function(){
1587				$that.twentytwenty();
1588			});
1589		}
1590		
1591	});
1592}
1593twentytwentyInit();
1594
1595/****************split line text******************/
1596if($('.nectar-recent-posts-single_featured.multiple_featured').length > 0) {
1597  splitLineText();
1598}
1599	
1600/****************full page******************/
1601var $frontEndEditorFPRDiv = '';
1602var $usingFullScreenRows = false;
1603var $fullscreenSelector = '';
1604var $disableFPonMobile = ($('#nectar_fullscreen_rows[data-mobile-disable]').length > 0) ? $('#nectar_fullscreen_rows').attr('data-mobile-disable') : 'off';
1605var $onMobileBrowser = navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/);
1606
1607if(!$onMobileBrowser) {
1608	$disableFPonMobile = 'off';
1609}
1610
1611//change anchor link IDs for when disabled on mobile
1612if($disableFPonMobile == 'on' && $('#nectar_fullscreen_rows').length > 0) {
1613	$('#nectar_fullscreen_rows > .wpb_row[data-fullscreen-anchor-id]').each(function(){
1614		if($(this).attr('data-fullscreen-anchor-id').length > 0)
1615			$(this).attr('id',$(this).attr('data-fullscreen-anchor-id'));
1616	});
1617
1618
1619	//remove main content row padding
1620	$('.container-wrap .main-content > .row').css({'padding-bottom':'0'});
1621
1622	//extra padding for first row is using transparent header
1623	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') ) {
1624		$('#nectar_fullscreen_rows > .wpb_row:nth-child(1)').addClass('extra-top-padding');
1625	}
1626}
1627
1628if($('#nectar_fullscreen_rows').length > 0 && $disableFPonMobile != 'on' || $().fullpage && $disableFPonMobile != 'on') {
1629
1630	function setFPNavColoring(index,direction) {
1631			
1632		  if($('#boxed').length > 0 && overallWidth > 750) return;
1633		
1634		  if($('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv+':nth-child('+index+')').find('.span_12.light').length > 0) {
1635    		$('#fp-nav').addClass('light-controls');
1636
1637    		  if(direction == 'up')
1638    			  $('#header-outer.dark-slide').removeClass('dark-slide');
1639    		  else
1640    		  	setTimeout(function(){ $('#header-outer.dark-slide').removeClass('dark-slide'); },520);
1641    	} else {
1642    		  $('#fp-nav.light-controls').removeClass('light-controls');
1643
1644    		  if(direction == 'up')
1645    		  	$('#header-outer').addClass('dark-slide');
1646    		  else
1647    			  setTimeout(function(){ $('#header-outer').addClass('dark-slide'); },520);
1648    	}
1649			
1650			//handle n slider coloring
1651			if($('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv+':nth-child('+index+')').find('.nectar-slider-wrap[data-fullscreen="true"]').length > 0) {
1652			 var $currentSlider = $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv+':nth-child('+index+')').find('.nectar-slider-wrap[data-fullscreen="true"]');
1653		
1654				if( $currentSlider.is('[data-overall_style="directional"]') && $('#header-outer #logo span.dark').length > 0 ){
1655					$('#header-outer').addClass('directional-nav-effect').removeClass('dne-disabled');
1656				}
1657				
1658				if($currentSlider.find('.swiper-slide-active[data-color-scheme="light"]').length > 0) {
1659					$('#header-outer').removeClass('dark-slide');
1660				} else if($currentSlider.find('.swiper-slide-active[data-color-scheme="dark"]').length > 0) {
1661					$('#header-outer').addClass('dark-slide');
1662				}
1663				
1664			} else {
1665				
1666					$('#header-outer').removeClass('directional-nav-effect').addClass('dne-disabled');
1667				
1668			}
1669			
1670	}
1671	
1672	
1673
1674	var $anchors = [];
1675	var $names = [];
1676	
1677	function setFPNames() {
1678		$anchors = [];
1679		$names = [];
1680		$frontEndEditorFPRDiv =  (window.vc_iframe) ? '> .vc_element': '> .wpb_row';
1681		
1682		$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv).each(function(i){
1683			var $id = ($(this).is('[data-fullscreen-anchor-id]')) ? $(this).attr('data-fullscreen-anchor-id') : '';
1684
1685			//anchor checks
1686			if($('#nectar_fullscreen_rows[data-anchors="on"]').length > 0) {
1687				if($id.indexOf('fws_') == -1) $anchors.push($id);
1688				else $anchors.push('section-'+(i+1));
1689			}
1690
1691			//name checks
1692			if($(this).find('.full-page-inner-wrap[data-name]').length > 0) 
1693				$names.push($(this).find('.full-page-inner-wrap').attr('data-name'));
1694			else 
1695				$names.push(' ');
1696		});
1697	}
1698	setFPNames();
1699
1700	function initFullPageFooter() {
1701		var $footerPos = $('#nectar_fullscreen_rows').attr('data-footer');
1702
1703		if($footerPos == 'default') {
1704			$('#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" />');
1705		}
1706		else if($footerPos == 'last_row') {
1707			$('#footer-outer').remove();
1708			$('#nectar_fullscreen_rows > .wpb_row:last-child').attr('id','footer-outer').addClass('fp-auto-height');
1709		} else {
1710			$('#footer-outer').remove();
1711		}
1712		
1713	}	
1714
1715	if($('#nectar_fullscreen_rows').length > 0)
1716		initFullPageFooter();
1717
1718	//fullscreen row logic
1719	function fullscreenRowLogic() {
1720		$('.full-page-inner-wrap .full-page-inner > .span_12 > .wpb_column').each(function(){
1721			if($(this).find('> .vc_column-inner > .wpb_wrapper').find('> .wpb_row').length > 0) {
1722
1723				//add class for css
1724				$(this).find('> .vc_column-inner > .wpb_wrapper').addClass('only_rows');
1725
1726				//set number of rows for css
1727				var $rowNum = $(this).find('> .vc_column-inner > .wpb_wrapper').find('> .wpb_row').length;
1728				$(this).find('> .vc_column-inner > .wpb_wrapper').attr('data-inner-row-num',$rowNum);
1729			} 
1730
1731			else if($(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').find('> .wpb_row').length > 0) {
1732
1733				//add class for css
1734				$(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').addClass('only_rows');
1735
1736				//set number of rows for css
1737				var $rowNum = $(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').find('> .wpb_row').length;
1738				$(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').attr('data-inner-row-num',$rowNum);
1739			}
1740		});
1741	}
1742
1743	fullscreenRowLogic();
1744
1745	function fullHeightRowOverflow() {
1746		//handle rows with full height that are larger than viewport
1747		if($(window).width() >= 1000) {
1748
1749	    	$('#nectar_fullscreen_rows > .wpb_row .full-page-inner-wrap[data-content-pos="full_height"]').each(function(){
1750
1751	    		//reset mobile calcs incase user plays with window resize
1752	    		$(this).find('> .full-page-inner').css('height','100%');
1753
1754	    		var maxHeight = overallHeight;
1755	    		var columnPaddingTop = 0;
1756	    		var columnPaddingBottom = 0;
1757
1758	    		
1759	    		if($('#nectar_fullscreen_rows').attr('data-animation') == 'none')
1760	    			$(this).find('> .full-page-inner > .span_12 ').css('height','100%');
1761	    		else
1762	    			$(this).find('> .full-page-inner > .span_12 ').css('height',overallHeight);
1763
1764	    		$(this).find('> .full-page-inner > .span_12 > .wpb_column > .vc_column-inner > .wpb_wrapper').each(function(){
1765	    			 columnPaddingTop = parseInt($(this).parents('.wpb_column').css('padding-top'));
1766	    			 columnPaddingBottom = parseInt($(this).parents('.wpb_column').css('padding-bottom'));
1767
1768	    			 maxHeight = maxHeight > $(this).height() + columnPaddingTop + columnPaddingBottom ? maxHeight : $(this).height() + columnPaddingTop + columnPaddingBottom;
1769	    		});
1770	    		
1771	    	
1772	    		if(maxHeight > overallHeight)
1773	    			$(this).find('> .full-page-inner > .span_12').height(maxHeight).css('float','none');
1774	    		
1775	    	});
1776
1777	    }
1778
1779	    else {
1780	    	//mobile min height set
1781	    	$('#nectar_fullscreen_rows > .wpb_row').each(function(){
1782	    		$totalColHeight = 0;
1783	    		$(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(){
1784	    			$totalColHeight += $(this).outerHeight(true);
1785	    		});
1786
1787	    		$(this).find('.fp-scrollable > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner').css('height','100%');
1788	    		if($totalColHeight > $(this).find('.fp-scrollable > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner').height())
1789	    			$(this).find('.fp-scrollable  > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner').height($totalColHeight);
1790	    	});
1791	    }
1792
1793	}
1794
1795	function fullscreenElementSizing() {
1796		//nectar slider
1797		var $nsSelector = '.nectar-slider-wrap[data-fullscreen="true"][data-full-width="true"], .nectar-slider-wrap[data-fullscreen="true"][data-full-width="boxed-full-width"]';
1798		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) {
1799			if($('#nectar_fullscreen_rows .wpb_row').length > 0) 
1800				$($nsSelector).find('.swiper-container').attr('data-height',$('#nectar_fullscreen_rows .wpb_row').height()+1);
1801	        
1802	        $(window).trigger('resize.nsSliderContent');
1803
1804	        $($nsSelector).parents('.full-page-inner').addClass('only-nectar-slider');
1805	    }
1806	}
1807
1808
1809	//kenburns first slide fix
1810	$('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"] > .wpb_row:first-child .row-bg.using-image').addClass('kenburns');
1811	setTimeout(function(){
1812		//ken burns first slide fix
1813		$('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"] > .wpb_row:first-child .row-bg.using-image').removeClass('kenburns');
1814	},500);
1815
1816	//remove kenburns from safari
1817	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');
1818
1819	var overallHeight = $(window).height();
1820	var overallWidth = $(window).width();
1821	var $fpAnimation = $('#nectar_fullscreen_rows').attr('data-animation');
1822	var $fpAnimationSpeed;
1823	var $svgResizeTimeout;
1824	
1825	switch($('#nectar_fullscreen_rows').attr('data-animation-speed')) {
1826		case 'slow':
1827			$fpAnimationSpeed = 1150;
1828			break;
1829		case 'medium':
1830			$fpAnimationSpeed = 850;
1831			break;
1832		case 'fast':
1833			$fpAnimationSpeed = 650;
1834			break;
1835		default:
1836			$fpAnimationSpeed = 850;
1837	}
1838	
1839	function heyFirefoxDrawTheEl(){
1840			var $drawTheEl = $('#nectar_fullscreen_rows > div:first-child').height();
1841			if($('#nectar_fullscreen_rows.trans-animation-active').length > 0){
1842				requestAnimationFrame(heyFirefoxDrawTheEl);
1843			}
1844	}
1845
1846	
1847	function initNectarFP() {
1848		
1849		$frontEndEditorFPRDiv =  (window.vc_iframe) ? '> .vc_element': '> .wpb_row';
1850		
1851		if(window.vc_iframe) {
1852			setTimeout(function(){
1853				$('html,body').css({
1854					'height':'100%',
1855				  'overflow-y':'hidden'
1856			  });
1857			},100);
1858			
1859			//remove scrolling to help performance of FE editor
1860			$('body,html').on("mousewheel.removeScroll", function() {
1861			    return false;
1862			});
1863			
1864		}
1865		
1866		//move row IDs onto parents for front end editor
1867		if($('body.vc_editor').length > 0) {
1868			$('#nectar_fullscreen_rows > .vc_empty-placeholder').remove();
1869			
1870			$('#nectar_fullscreen_rows > .vc_element').each(function(){
1871				var innerRowID = $(this).find('> .wpb_row').attr('id');
1872				$(this).attr('id',innerRowID);
1873			});
1874		}
1875		
1876		$usingFullScreenRows = true;
1877		$fullscreenSelector = (window.vc_iframe) ? '.vc_element.vc_vc_row.active ' : '.wpb_row.active ';
1878
1879		$('.container-wrap, .container-wrap .main-content > .row').css({'padding-bottom':'0', 'margin-bottom': '0'});
1880		$('#nectar_fullscreen_rows').fullpage({
1881			sectionSelector: '#nectar_fullscreen_rows '+$frontEndEditorFPRDiv,
1882			navigation: true,
1883			css3: true,
1884			scrollingSpeed: $fpAnimationSpeed,
1885			anchors: $anchors,
1886			scrollOverflow: true,
1887			navigationPosition: 'right',
1888			navigationTooltips: $names,
1889			afterLoad: function(anchorLink, index, slideAnchor, slideIndex){ 
1890
1891				if($('#nectar_fullscreen_rows').hasClass('afterLoaded')) {
1892				 	
1893					//ensure no scrolling body occurs
1894					if(nectarDOMInfo.scrollTop != 0) {
1895						window.scrollTo(0,0);
1896					}
1897					
1898					//reset slim scroll to top
1899					$('.wpb_row:not(.last-before-footer):not(:nth-child('+index+')) .fp-scrollable').each(function(){
1900						var $scrollable = $(this).data('iscrollInstance');
1901						$scrollable.scrollTo(0,0);
1902					});
1903
1904					//reset carousel
1905					$('.wpb_row:not(:nth-child('+index+')) .owl-carousel').trigger('to.owl.carousel',[0]);
1906
1907					var $row_id = $('#nectar_fullscreen_rows > .wpb_row:nth-child('+index+')').attr('id');
1908
1909					$('#nectar_fullscreen_rows '+$frontEndEditorFPRDiv).removeClass('transition-out').removeClass('trans');
1910					
1911
1912					$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':nth-child('+index+')').removeClass('next-current');
1913					$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':nth-child('+index+') .full-page-inner-wrap-outer').css({'height': '100%'});
1914					$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +' .full-page-inner-wrap-outer').css({'transform':'none'});
1915					//take care of nav/control coloring
1916					//setFPNavColoring(index,'na');
1917					
1918					//handle waypoints
1919					if($row_id != 'footer-outer' && $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':nth-child('+index+').last-before-footer').length == 0) {
1920						waypoints();
1921						if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) && !nectarDOMInfo.usingFrontEndEditor) {
1922							resetWaypoints();
1923							Waypoint.destroyAll();
1924							startMouseParallax();
1925						}
1926						if(!nectarDOMInfo.usingFrontEndEditor) {
1927							nectarLiquidBGFP();
1928						}
1929						responsiveTooltips();
1930					}
1931					
1932					if($row_id !='footer-outer') {
1933						$('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv).removeClass('last-before-footer').css('transform','initial');
1934
1935						//reset animation attrs
1936						if(!window.vc_iframe) {
1937
1938							$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(.active):not(#footer-outer)').css({'transform':'translateY(0)','left':'-9999px', 'transition': 'none', 'opacity':'1', 'will-change':'auto'});
1939							$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(#footer-outer)').find('.full-page-inner-wrap-outer').css({'transition': 'none',  'transform':'none', 'will-change':'auto'});
1940							$('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(#footer-outer)').find('.fp-tableCell').css({'transition': 'none', 'transform':'none', 'will-change':'auto'});
1941						}
1942						
1943						//stacking fix
1944						$('#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'});
1945					}
1946				} else {
1947					fullHeightRowOverflow();
1948					overallHeight = $('#nectar_fullscreen_rows').height();
1949					$('#nectar_fullscreen_rows').addClass('afterLoaded');
1950
1951					//for users that have scrolled down prior to turning on full page
1952					setTimeout(function(){ window.scrollTo(0,0); },1800);
1953
1954					//ken burns first slide fix
1955					$('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"] '+ $frontEndEditorFPRDiv +':first-child .row-bg.using-image').removeClass('kenburns');
1956
1957					//handle fullscreen elements
1958	        fullscreenElementSizing();
1959
1960						
1961				}
1962
1963				
1964				$('#nectar_fullscreen_rows').removeClass('nextSectionAllowed');
1965
1966				
1967			 },
1968	        onLeave: function(index, nextIndex, direction){ 
1969	        	
1970						$('#nectar_fullscreen_rows').addClass('trans-animation-active');
1971						
1972						var $row_id = $('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv + ':nth-child('+nextIndex+')').attr('id');
1973	        	var $indexRow = $('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv + ':nth-child('+index+')');
1974	        	var $nextIndexRow = $('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv + ':nth-child('+nextIndex+')');
1975	        	var $nextIndexRowInner = $nextIndexRow.find('.full-page-inner-wrap-outer');
1976	        	var $nextIndexRowFpTable = $nextIndexRow.find('.fp-tableCell');
1977	        	//mobile/safari  fix
1978	        	var $transformProp = (!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) ? 'transform' : 'all'; 
1979	        	//if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) $transformProp = 'all';
1980
1981	        	if( $row_id == 'footer-outer') {
1982	        		$indexRow.addClass('last-before-footer'); 
1983	        		$('#footer-outer').css('opacity','1');
1984	        	} else {
1985	        		$('#nectar_fullscreen_rows '+$frontEndEditorFPRDiv+'.last-before-footer').css('transform','translateY(0px)');
1986	        		$('#footer-outer').css('opacity','0');
1987	        	}
1988	        	if($indexRow.attr('id') == 'footer-outer') {
1989	        		$('#footer-outer').css({'transition': $transformProp+' 460ms cubic-bezier(0.60, 0.23, 0.2, 
19890.93)', 'backface-visibility': 'hidden'});
1990	        		$('#footer-outer').css({'transform': 'translateY(45%) translateZ(0)'});
1991	        	}
1992	 			
1993
1994	 			//stacking fix
1995	 			if($nextIndexRow.attr('id') != 'footer-outer') {
1996					$nextIndexRowFpTable.find('.full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner > .container').css({'backface-visibility':'hidden', 'z-index':'110'});
1997				}
1998
1999	        	//animation
2000	        	if($nextIndexRow.attr('id') != 'footer-outer' && $indexRow.attr('id') != 'footer-outer' && $('#nectar_fullscreen_rows[data-animation="none"]').length == 0 ) {
2001
2002	        		//scrolling down
2003	        		if(direction == 'down') {
2004
2005	        			if($fpAnimation == 'parallax') {
2006		        			$indexRow.css({'transition': $transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1)', 'will-change':'transform', 'transform':'translateZ(0)' ,'z-index': '100'});
2007		        			setTimeout(function() { 
2008		        				$indexRow.css({'transform': 'translateY(-50%) translateZ(0)'});
2009		        			}, 60);
2010
2011		        			$nextIndexRow.css({'z-index':'1000','top':'0','left':'0'});
2012		        			$nextIndexRowFpTable.css({'transform':'translateY(100%) translateZ(0)', 'will-change':'transform'});
2013		        			$nextIndexRowInner.css({'transform':'translateY(-50%) translateZ(0)', 'will-change':'transform'});
2014		        			
2015	        			} else if($fpAnimation == 'zoom-out-parallax') {
2016
2017	        				$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'});
2018		        			setTimeout(function() { 
2019		        				$indexRow.css({'transform': 'scale(0.77) translateZ(0)', 'opacity': '0'});
2020		        			}, 60);
2021
2022		        			$nextIndexRow.css({'z-index':'1000','top':'0','left':'0'});
2023		        			$nextIndexRowFpTable.css({'transform':'translateY(100%) translateZ(0)', 'will-change':'transform'});
2024		        			$nextIndexRowInner.css({'transform':'translateY(-50%) translateZ(0)',  'will-change':'transform'});
2025	        			} 
2026
2027	        		}
2028
2029	        		//scrolling up
2030	        		else {
2031
2032	        			if($fpAnimation == 'parallax') {
2033		        			$indexRow.css({'transition': $transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1)', 'z-index': '100', 'will-change':'transform'});
2034		        			setTimeout(function() { 
2035		        				$indexRow.css({'transform': 'translateY(50%) translateZ(0)'});
2036		        			}, 60);
2037
2038		        			$nextIndexRow.css({'z-index':'1000','top':'0','left':'0'});
2039		        			$nextIndexRowFpTable.css({'transform':'translateY(-100%) translateZ(0)','will-change':'transform'});
2040		        			$nextIndexRowInner.css({'transform':'translateY(50%) translateZ(0)','will-change':'transform'});
2041	        			}
2042
2043	        			else if($fpAnimation == 'zoom-out-parallax') {
2044		        			$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'});
2045		        			setTimeout(function() { 
2046		        				$indexRow.css({'transform': 'scale(0.77) translateZ(0)', 'opacity': '0'});
2047		        			}, 60);
2048
2049		        			$nextIndexRow.css({'z-index':'1000','top':'0','left':'0'});
2050		        			$nextIndexRowFpTable.css({'transform':'translateY(-100%) translateZ(0)', 'will-change':'transform'});
2051		        			$nextIndexRowInner.css({'transform':'translateY(50%) translateZ(0)', 'will-change':'transform'});
2052	        			} 
2053
2054	        		}
2055	        		
2056	        		setTimeout(function() { 
2057	    				$nextIndexRowFpTable.css({'transition':$transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1) 0ms', 'transform':'translateY(0%) translateZ(0)'});
2058	    				if($fpAnimation != 'none') { 
2059									$nextIndexRowInner.css({'transition':$transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1) 0ms', 'transform':'translateY(0%) translateZ(0)'});
2060									if(navigator.userAgent.indexOf('Firefox') != -1) {
2061										requestAnimationFrame(heyFirefoxDrawTheEl);
2062									}
2063							}
2064							
2065							
2066
2067							
2068	    			},60);
2069
2070	        	}
2071
2072	        	//adjust transform if larger than row height for parallax
2073	        	if($('#nectar_fullscreen_rows[data-animation="none"]').length == 0 && $nextIndexRow.find('.fp-scrollable').length > 0) {
2074	        		$nextIndexRow.find('.full-page-inner-wrap-outer').css('height',overallHeight);
2075						}
2076
2077	        	setTimeout(function() { 
2078	        		
2079	        		if( $row_id == 'footer-outer') {
2080
2081		        		$indexRow.css('transform','translateY(-'+($('#footer-outer').height()-1)+'px)');
2082
2083		        		$('#footer-outer').css({'transform': 'translateY(45%) translateZ(0)'});
2084		        		$('#footer-outer').css({'transition-duration': '0s', 'backface-visibility': 'hidden'});
2085		        		setTimeout(function() { 
2086		        			$('#footer-outer').css({'transition': $transformProp+' 500ms cubic-bezier(0.60, 0.23, 0.2, 
20860.93)', 'backface-visibility': 'hidden'});
2087	        				$('#footer-outer').css({'transform': 'translateY(0%) translateZ(0)'});
2088	        			},30);
2089		        	}
2090	        	},30);
2091
2092	        	if($row_id!='footer-outer') {
2093	        		
2094	        		stopMouseParallax();
2095
2096	        		//take care of nav/control coloring
2097	        		setFPNavColoring(nextIndex,direction);
2098							
2099							//handle main nav link highlight
2100							setTimeout(function(){
2101								FPActiveMenuItems(nextIndex);
2102							},50);
2103							
2104							
2105	        	}
2106	        		
2107	        },
2108
2109	        afterResize: function(){
2110	        	overallHeight = $('#nectar_fullscreen_rows').height();
2111	        	overallWidth = $(window).width();
2112	        	fullHeightRowOverflow();
2113	        	fullscreenElementSizing();
2114	        	fullscreenFooterCalcs();
2115
2116	        	if( $('#footer-outer.active').length > 0) {
2117	        		setTimeout(function(){
2118	        			$('.last-before-footer').css('transform','translateY(-'+$('#footer-outer').height()+'px)');
2119	        		},200);
2120		        } 
2121
2122		        //fix for svg animations when resizing and iscroll wraps/unwraps
2123		        clearTimeout($svgResizeTimeout);
2124		        $svgResizeTimeout = setTimeout(function(){ 
2125
2126		        	if($svg_icons.length > 0) {
2127			        	$('.svg-icon-holder.animated-in').each(function(i){
2128									$(this).css('opacity','1');
2129									$svg_icons[$(this).find('svg').attr('id').slice(-1)].finish();
2130								});
2131			        }
2132
2133		         },300);
2134	        }
2135
2136		});
2137	}
2138	
2139	if(window.vc_iframe) {
2140		
2141		//do nothing
2142	
2143	}	 else {
2144		if($('#nectar_fullscreen_rows').length > 0)
2145			initNectarFP();
2146	}
2147
2148
2149	$(window).smartresize(function(){
2150		
2151		if($('#nectar_fullscreen_rows').length > 0) {
2152			setTimeout(function(){
2153				$('.wpb_row:not(.last-before-footer) .fp-scrollable').each(function(){
2154					var $scrollable = $(this).data('iscrollInstance');
2155					$scrollable.refresh();
2156				});
2157			},200);
2158
2159			fullHeightRowOverflow();
2160
2161		}
2162	});
2163
2164	function fullscreenFooterCalcs() {
2165		if($('#footer-outer.active').length > 0) {
2166	    		$('.last-before-footer').addClass('fp-notransition').css('transform','translateY(-'+$('#footer-outer').height()+'px)');
2167	    		setTimeout(function(){
2168	    			$('.last-before-footer').removeClass('fp-notransition');
2169	    		},10);
2170	    	}
2171	}
2172
2173
2174
2175	function stopMouseParallax(){
2176		$.each($mouseParallaxScenes,function(k,v){
2177			v.parallax('disable');
2178		});
2179	}
2180
2181	function startMouseParallax(){
2182		if($('#nectar_fullscreen_rows > .wpb_row.active .nectar-parallax-scene').length > 0) {
2183			$.each($mouseParallaxScenes,function(k,v){
2184				v.parallax('enable');
2185			});
2186		}
2187	}
2188
2189	if($('#nectar_fullscreen_rows').length > 0) {
2190		
2191		if(window.vc_iframe) { 
2192			setTimeout(function(){
2193				setFPNavColoring(1,'na'); 
2194			},500);
2195		}
2196		else {
2197			setFPNavColoring(1,'na');
2198		}
2199		
2200		fullscreenElementSizing();
2201		
2202		//slide out right OCM material nav compat
2203		if($('body[data-slide-out-widget-area-style="slide-out-from-right"].material').length > 0) {
2204			$('#slide-out-widget-area .off-canvas-menu-container').find("a[href*='#']").on('click',function(e){
2205					
2206					var $link_hash = $(this).prop("hash");	
2207
2208					if($link_hash != '#' && $link_hash.indexOf("#") != -1 && $('div[data-fullscreen-anchor-id="'+$link_hash.substr($link_hash.indexOf("#")+1)+'"]').length > 0) {
2209						
2210							if($('body.material-ocm-open').length > 0) {
2211									
2212									$('body > .slide_out_area_close').addClass('non-human-allowed').trigger('click');
2213
2214									setTimeout(function(){
2215										$('body > .slide_out_area_close').removeClass('non-human-allowed');
2216									},100);
2217
2218							} 
2219							
2220					} // if a section has been found
2221					
2222			}); //click
2223		}
2224		
2225		
2226	}
2227	
2228	function FPActiveMenuItems(index) {
2229		
2230		if(!$('#nectar_fullscreen_rows[data-anchors="on"]').length > 0 || !index) return;
2231		
2232		var $hash = window.location.hash;
2233		var $hashSubstrng = ($hash && $hash.length > 0) ? $hash.substring(1,$hash.length) : '';
2234
2235		 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 ) {
2236			  $('header#top nav > ul.sf-menu > li').removeClass('current-menu-item');
2237				$('header#top nav > ul.sf-menu > li').find('> a[href$="'+$hashSubstrng+'"]').parent().addClass('current-menu-item');
2238		 } 
2239	}
2240
2241	function resetWaypoints() {
2242		//animated columns / imgs
2243		$('img.img-with-animation.animated-in:not([data-animation="none"])').css({'transition':'none'});
2244		$('img.img-with-animation.animated-in:not([data-animation="none"])').css({'opacity':'0','transform':'none'}).removeClass('animated-in');
2245		$('.col.has-animation.animated-in:not([data-animation*="reveal"]), .wpb_column.has-animation.animated-in:not([data-animation*="reveal"])').css({'transition':'none'});
2246		$('.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');	
2247		$('.col.has-animation.boxed:not([data-animation*="reveal"]), .wpb_column.has-animation.boxed:not([data-animation*="reveal"])').addClass('no-pointer-events');
2248		
2249		//row BG animations
2250		$('.row-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]):not([data-bg-animation*="displace-filter"]) .inner-wrap.using-image').removeClass('animated-in');
2251		$('.column-image-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]):not([data-bg-animation*="displace-filter"]) .inner-wrap').removeClass('animated-in');
2252		
2253		//reveal columns
2254		$('.wpb_column.has-animation[data-animation*="reveal"], .nectar_cascading_images').removeClass('animated-in');
2255		if(overallWidth > 1000 && $('.using-mobile-browser').length == 0) {
2256			$('.wpb_column.has-animation[data-animation="reveal-from-bottom"] > .column-inner-wrap').css({'transition':'none','transform':'translate(0, 100%)'});
2257			$('.wpb_column.has-animation[data-animation="reveal-from-bottom"] > .column-inner-wrap > .column-inner').css({'transition':'none','transform':'translate(0, -90%)'});
2258			$('.wpb_column.has-animation[data-animation="reveal-from-top"] > .column-inner-wrap').css({'transition':'none','transform':'translate(0, -100%)'});
2259			$('.wpb_column.has-animation[data-animation="reveal-from-top"] > .column-inner-wrap > .column-inner').css({'transition':'none','transform':'translate(0, 90%)'});
2260			$('.wpb_column.has-animation[data-animation="reveal-from-left"] > .column-inner-wrap').css({'transition-duration':'0s','transform':'translate(-100%, 0)'});
2261			$('.wpb_column.has-animation[data-animation="reveal-from-left"] > .column-inner-wrap > .column-inner').css({'transition-duration':'0s','transform':'translate(90%, 0)'});
2262			$('.wpb_column.has-animation[data-animation="reveal-from-right"] > .column-inner-wrap').css({'transition-duration':'0s','transform':'translate(100%, 0)'});
2263			$('.wpb_column.has-animation[data-animation="reveal-from-right"] > .column-inner-wrap > .column-inner').css({'transition-duration':'0s','transform':'translate(-90%, 0)'});
2264		}
2265		$('.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');
2266
2267		//vcwaypoints
2268		$('.wpb_animate_when_almost_visible.animated').removeClass('wpb_start_animation').removeClass('animated');
2269
2270		//column borders
2271		$('.wpb_column[data-border-animation="true"] .border-wrap.animation').removeClass('animation').removeClass('completed');
2272
2273		//milestone
2274		$('.nectar-milestone.animated-in').removeClass('animated-in').removeClass('in-sight');
2275		$('.nectar-milestone .symbol').removeClass('in-sight');
2276
2277		//fancy ul
2278		$('.nectar-fancy-ul[data-animation="true"]').removeClass('animated-in');
2279		$('.nectar-fancy-ul[data-animation="true"] ul li').css({'opacity':'0','left':'-20px'});
2280
2281		//progress bars
2282		$('.nectar-progress-bar').parent().removeClass('completed');
2283		$('.nectar-progress-bar .bar-wrap > span').css({'width':'0px'});
2284		$('.nectar-progress-bar .bar-wrap > span > strong').css({'opacity':'0'});
2285		//$('.nectar-progress-bar .bar-wrap').css({'opacity':'0'});
2286
2287		//clients
2288		$('.clients.fade-in-animation').removeClass('animated-in');
2289		$('.clients.fade-in-animation > div').css('opacity','0');
2290
2291		//carousel
2292		$('.owl-carousel[data-enable-animation="true"]').removeClass('animated-in');
2293		$('.owl-carousel[data-enable-animation="true"] .owl-stage > .owl-item').css({'transition':'none','opacity':'0','transform':'translate(0, 70px)'});
2294		//dividers
2295		$('.divider-small-border[data-animate="yes"], .divider-border[data-animate="yes"]').removeClass('completed').css({'transition':'none','transform':'scale(0,1)'});
2296
2297		//icon list
2298		$('.nectar-icon-list').removeClass('completed');
2299		$('.nectar-icon-list-item').removeClass('animated');
2300
2301		//portfolio
2302		$('.portfolio-items .col').removeClass('animated-in');
2303
2304		//split line
2305		$('.nectar-split-heading').removeClass('animated-in');
2306		$('.nectar-split-heading .heading-line > div').transit({'y':'200%'},0);
2307
2308		//image with hotspots
2309		$('.nectar_image_with_hotspots[data-animation="true"]').removeClass('completed');
2310		$('.nectar_image_with_hotspots[data-animation="true"] .nectar_hotspot_wrap').removeClass('animated-in');
2311
2312		//animated titles
2313		$('.nectar-animated-title').removeClass('completed');
2314		
2315		//highlighted text
2316		$('.nectar-highlighted-text em').removeClass('animated');
2317
2318		if($('.vc_pie_chart').length > 0) {
2319			vc_pieChart();
2320		}
2321
2322		$('.col.has-animation:not([data-animation*="reveal"]), .wpb_column.has-animation:not([data-animation*="reveal"])').each(function(i) {
2323		   	//clear previous timeout (needed for fullscreen rows)
2324			clearTimeout($standAnimatedColTimeout[i]); 
2325		});
2326
2327	}
2328
2329	
2330
2331} else if($('#nectar_fullscreen_rows').length > 0 && $disableFPonMobile == 'on' || $().fullpage && $disableFPonMobile == 'on') {
2332
2333	//remove markup
2334	$('html,body').css({'height':'auto','overflow-y':'auto'});
2335}
2336
2337
2338function nectarLiquidBGFP(){
2339	
2340	$('.nectar-liquid-bg').removeClass('animated-in');
2341	
2342	for(var k=0; k<$liquidBG_EL.length;k++) {
2343		if($liquidBG_EL[k].animationType == 'displace-filter-fade' && $($liquidBG_EL[k].canvasContainer).parents('.fp-section.active').length > 0) {
2344			
2345			//add bg to container
2346			if($($liquidBG_EL[k].canvasContainer).find('.image-added-to-stage').length == 0) {
2347				$liquidBG_EL[k].imgContainer.addChild( $liquidBG_EL[k].bg );
2348			}
2349			$($liquidBG_EL[k].canvasContainer).find('.nectar-liquid-bg').addClass('image-added-to-stage');
2350			
2351			$liquidBG_EL[k].animateProps($liquidBG_EL[k]);
2352
2353		}
2354	}
2355}
2356
2357
2358/***************** Superfish ******************/
2359	
2360	function initSF(){
2361
2362		if($('body[data-header-format="left-header"]').length == 0) {
2363
2364
2365			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;
2366
2367			$(".sf-menu").superfish({
2368				 delay: 650,
2369				 speed: 'fast',
2370				 disableHI: $disableHI,
2371				 speedOut:      'fast',             
2372				 animation:   {opacity:'show'}
2373			}); 
2374
2375			//handle initial show on left class for minimal styling
2376			$('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function(){
2377				
2378				if($(this).offset().left + $(this).outerWidth() > $(window).width()) {
2379					$(this).addClass('on-left-side');
2380					$(this).find('ul').addClass('on-left-side');
2381				} 
2382				
2383			});
2384			
2385
2386			//megamenu multi section per column title support
2387			$('body:not([data-header-format="left-header"]) header#top nav > ul > li.megamenu > ul > li > ul > li:has("> ul")').addClass('has-ul'); 
2388
2389			//fullwidth megamenu
2390			if($('body[data-megamenu-width="full-width"]').length > 0 && $('ul.sub-menu').length > 0) {
2391				megamenuFullwidth();
2392				$(window).on('smartresize',megamenuFullwidth);
2393				$('header#top nav > ul > li.megamenu > .sub-menu').css('box-sizing','content-box');
2394			}
2395
2396			//extra hover class for megamenu check
2397			$('header#top nav > ul.sf-menu > li').on('mouseenter',function(){
2398				$(this).addClass('menu-item-over');
2399			});
2400			$('header#top nav > ul.sf-menu > li').on('mouseleave',function(){
2401				$(this).removeClass('menu-item-over');
2402			});
2403
2404			//remove arrows on mega menu item
2405			$('header#top nav .megamenu .sub-menu a.sf-with-ul .sf-sub-indicator, header#top .megamenu .sub-menu a .sf-sub-indicator').remove();
2406
2407			//blank title megamenu columns
2408			////desktop
2409			$('header#top nav > ul > li.megamenu > ul.sub-menu > li > a').each(function(){
2410				if( $(this).text() == '–' ) {
2411					$(this).remove();
2412				}
2413			});
2414
2415		
2416		}
2417		
2418	}
2419
2420	
2421	function megamenuFullwidth() {
2422		var $windowWidth = $(window).width();
2423		var $headerContainerWidth = $('header#top > .container').width();
2424		$('header#top nav > ul > li.megamenu > .sub-menu').css({
2425			'padding-left' : ($windowWidth - $headerContainerWidth)/2 + 'px',
2426			'padding-right' : ($windowWidth+2 - $headerContainerWidth)/2 + 'px',
2427			'width' : $headerContainerWidth,
2428			'left' : '-' + ($windowWidth - $headerContainerWidth)/2 + 'px'
2429		});
2430	}
2431	
2432	var $navLeave;
2433	
2434	function addOrRemoveSF(){
2435		
2436		if( window.innerWidth < 1000 && $('body').attr('data-responsive') == '1'){
2437			$('body').addClass('mobile');
2438			$('header#top nav').css('display','none');
2439		}
2440		
2441		else {
2442			$('body').removeClass('mobile');
2443			$('header#top nav').css('display','');
2444			$('#mobile-menu').hide();
2445			$('.slide-out-widget-area-toggle #toggle-nav .lines-button').removeClass('close');
2446			
2447			//recalc height of dropdown arrow
2448			$('.sf-sub-indicator').css('height',$('a.sf-with-ul').height());
2449		}
2450
2451		//add specific class if on device for better tablet tracking
2452		if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) { $('body').addClass('using-mobile-browser'); }
2453
2454	}
2455
2456	function showOnLeftSubMenu() {
2457		//show on left class for minimal styling
2458		$('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function(){
2459			
2460			$(this).removeClass('on-left-side');
2461
2462			if($(this).offset().left + $(this).outerWidth() > $(window).width()) {
2463				$(this).addClass('on-left-side');
2464				$(this).find('ul').addClass('on-left-side');
2465			} else {
2466				$(this).removeClass('on-left-side');
2467				$(this).find('ul').removeClass('on-left-side');
2468			}
2469			
2470		});
2471	}
2472	
2473	addOrRemoveSF();
2474	initSF();
2475	
2476	$(window).resize(addOrRemoveSF);
2477
2478	
2479	function SFArrows(){
2480
2481		//set height of dropdown arrow
2482		$('.sf-sub-indicator').css('height',$('a.sf-with-ul').height());
2483	}
2484	
2485	SFArrows();
2486	
2487
2488	//deactivate hhun on phone
2489	if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/))
2490		$('body').attr('data-hhun','0');
2491
2492
2493/***************** Caroufredsel ******************/
2494	
2495	function standardCarouselInit() {
2496		$('ul.carousel:not(".clients")').each(function(){
2497	    	var $that = $(this); 
2498	    	var maxCols = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 'auto' : 3 ;
2499	    	var scrollNum = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 'auto' : '' ;
2500	    	var colWidth = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 500 : 453 ;
2501	    	var scrollSpeed, easing;
2502	    	var $autoplayBool = ($(this).attr('data-autorotate') == 'true') ? true : false;
2503			
2504			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') {
2505				if($(this).find('li').length % 3 === 0) {
2506					var $themeSkin = true;
2507					var $themeSkin2 = true;
2508				} else {
2509					var $themeSkin = false;
2510					var $themeSkin2 = true;
2511				}
2512	
2513			} else {
2514				var $themeSkin = true;
2515				var $themeSkin2 = true;
2516			}
2517
2518			(parseInt($(this).attr('data-scroll-speed'))) ? scrollSpeed = parseInt($(this).attr('data-scroll-speed')) : scrollSpeed = 700;
2519			($(this).is('[data-easing]')) ? easing = $(this).attr('data-easing') : easing = 'linear';
2520			
2521			
2522			var $element = $that;
2523			if($that.find('img').length == 0) $element = $('body');
2524			
2525			imagesLoaded($element,function(instance){
2526	
2527				
2528		    	$that.carouFredSel({
2529		    		circular: $themeSkin,
2530		    		infinite: $themeSkin2,
2531		    		height : 'auto',
2532		    		responsive: true,
2533			        items       : {
2534						width : colWidth,
2535				        visible     : {
2536				            min         : 1,
2537				            max         : maxCols
2538				        }
2539				    },
2540				    swipe       : {
2541				        onTouch     : true,
2542				        onMouse         : true,
2543				        options      : {
2544				        	excludedElements: "button, input, select, textarea, .noSwipe",
2545				        	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'); }
2546				        },
2547				        onBefore : function(){
2548				    		//hover effect fix
2549				    		$that.find('.work-item').trigger('mouseleave');
2550				    		$that.find('.work-item .work-info a').trigger('mouseup');
2551				    	}
2552				    },
2553				    scroll: {
2554				    	items			: scrollNum,
2555				    	easing          : easing,
2556			            duration        : scrollSpeed,
2557			            onBefore	: function( data ) {
2558			            	
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 .total').html(Math.ceil($that.find('> li').length / $that.triggerHandler("currentVisible").length));
2561
2562			            	 }	
2563						},
2564						onAfter	: function( data ) {
2565			            	 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') {
2566			            	 	$that.parents('.carousel-wrap').find('.item-count .current').html( $that.triggerHandler('currentPage') +1);
2567			            	 	$that.parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($that.find('> li').length / $that.triggerHandler("currentVisible").length));
2568
2569			            	 }	
2570						}
2571
2572				    },
2573			        prev    : {
2574				        button  : function() {
2575				           return $that.parents('.carousel-wrap').find('.carousel-prev');
2576				        }
2577			    	},
2578				    next    : {
2579			       		button  : function() {
2580				           return $that.parents('.carousel-wrap').find('.carousel-next');
2581				        }
2582				    },
2583				    auto    : {
2584				    	play: $autoplayBool
2585				    }
2586			    }, { transition: true }).animate({'opacity': 1},1300);
2587			    
2588			    $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">');
2589
2590			    if($that.parents('.carousel-wrap').attr('data-full-width') == 'true') $that.parents('.carousel-outer').css('overflow','visible');
2591
2592			    //add count for non full width ascend skin
2593			    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') {
2594					$('<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'));
2595				}
2596			    
2597			    $that.addClass('finished-loading');
2598
2599			    carouselHeightCalcs();
2600
2601		     });//images loaded
2602		     	     
2603	    });//each
2604
2605		
2606    }
2607    if($('.carousel').length > 0) standardCarouselInit();
2608
2609
2610    function owlCarouselInit() {
2611    	//owl
2612		$('.owl-carousel').each(function(){
2613			
2614			$(this).addClass('owl-theme'); //new version removed this
2615			
2616			var $that = $(this);
2617			var $stagePadding = ($(window).width()<1000) ? 0 : parseInt($(this).attr('data-column-p
2617adding'));
2618			var $autoRotateBool = $that.attr('data-autorotate');
2619			var $autoRotateSpeed = $that.attr('data-autorotation-speed');
2620			var $owlLoopBool = ($that.is('[data-loop="true"]')) ? true : false;
2621			
2622			$(this).owlCarousel({
2623			      responsive:{
2624				        0:{
2625				            items: $(this).attr('data-mobile-cols')
2626				        },
2627				        690:{
2628				            items: $(this).attr('data-tablet-cols')
2629				        },
2630				        1000:{
2631				          items: $(this).attr('data-desktop-small-cols')
2632				        },
2633				        1300:{
2634				            items: $(this).attr('data-desktop-cols')
2635				        }
2636				    },
2637			      /*stagePadding: $stagePadding,*/
2638			      autoplay: $autoRotateBool,
2639			      autoplayTimeout: $autoRotateSpeed,
2640						loop: $owlLoopBool,
2641						smartSpeed: 350,
2642			      onTranslate: function(){
2643			      	$that.addClass('moving');
2644			      },
2645			      onTranslated: function(){
2646			      	$that.removeClass('moving');
2647			      }
2648
2649			  });
2650
2651			$(this).on('changed.owl.carousel', function (event) {
2652			    if (event.item.count - event.page.size == event.item.index)
2653			        $(event.target).find('.owl-dots div:last')
2654			          .addClass('active').siblings().removeClass('active');
2655			});	
2656
2657		});	
2658
2659
2660    }
2661
2662
2663
2664	function owl_carousel_animate() {
2665		$($fullscreenSelector+'.owl-carousel[data-enable-animation="true"]').each(function(){
2666
2667			$owlOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
2668
2669			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;
2670
2671			var $that = $(this);
2672			var waypoint = new Waypoint({
2673	 			element: $that,
2674	 			 handler: function(direction) {
2675
2676	 			 	if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
2677					     waypoint.destroy();
2678					     return;
2679					}
2680
2681					setTimeout(function(){
2682		 			 	$that.find('.owl-stage > .owl-item').each(function(i){
2683		 			 		var $that = $(this);
2684							$that.delay(i*200).transition({
2685								'opacity': '1',
2686								'y' : '0'
2687							},600,'easeOutQuart');
2688						});
2689						$that.addClass('animated-in');
2690		 			 },$animationDelay);
2691
2692					waypoint.destroy();
2693				},
2694				offset: $owlOffsetPos
2695
2696			}); 
2697
2698		});
2699	}
2700
2701
2702
2703
2704    function productCarouselInit() {
2705		$('.products-carousel').each(function(){
2706	    	var $that = $(this).find('ul'); 
2707	    	var maxCols = 'auto';
2708	    	var scrollNum = 'auto';
2709	    	var colWidth = ($(this).parents('.full-width-content ').length > 0) ? 400 : 353 ;
2710			var scrollSpeed = 800;
2711			var easing = 'easeInOutQuart';
2712			
2713			
2714			var $element = $that;
2715			if($that.find('img').length == 0) $element = $('body');
2716			
2717			//controls on hover
2718			$(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>')
2719
2720			imagesLoaded($element,function(instance){
2721	
2722				
2723		    	$that.carouFredSel({
2724		    		circular: true,
2725		    		responsive: true,
2726			        items       : {
2727						width : colWidth,
2728				        visible     : {
2729				            min         : 1,
2730				            max         : maxCols
2731				        }
2732				    },
2733				    swipe       : {
2734				        onTouch     : true,
2735				        onMouse         : true,
2736				        options      : {
2737				        	excludedElements: "button, input, select, textarea, .noSwipe",
2738				        	tap: function(event, target){ 
2739				        		if($(target).attr('href') && !$(target).is('[target="_blank"]') && !$(target).hasClass('add_to_wishlist') && !$(target).hasClass('add_to_cart_button') && !$(target).is('[rel^="prettyPhoto"]')) 
2740				        			window.open($(target).attr('href'), '_self'); 
2741				        		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"]')) 
2742				        			window.open($(target).parent().attr('href'), '_self'); 
2743				        	}
2744				        },
2745				        onBefore : function(){
2746				    		//hover effect fix
2747				    		$that.find('.product-wrap').trigger('mouseleave');
2748				    		$that.find('.product a').trigger('mouseup');
2749				    	}
2750				    },
2751				    scroll: {
2752				    	items			: scrollNum,
2753				    	easing          : easing,
2754			            duration        : scrollSpeed
2755				    },
2756			        prev    : {
2757				        button  : function() {
2758				           return $that.parents('.carousel-wrap').find('.carousel-prev');
2759				        }
2760			    	},
2761				    next    : {
2762			       		button  : function() {
2763				           return $that.parents('.carousel-wrap').find('.carousel-next');
2764				        }
2765				    },
2766				    auto    : {
2767				    	play: false
2768				    }
2769			    }).animate({'opacity': 1},1300);
2770			    
2771			    $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">');
2772			    
2773			    $that.addClass('finished-loading');
2774			    fullWidthContentColumns();
2775			    $(window).trigger('resize');
2776
2777		     });//images loaded
2778				 
2779		     	     
2780	    });//each
2781			
2782			
2783			
2784		
2785			$wooFlickityCarousels = [];
2786			$('.nectar-woo-flickity').each(function(i){
2787				
2788				var $that = $(this);
2789
2790				$(this).find('.products > li').each(function(){
2791					$(this).wrap('<div class="flickity-cell"></div>');
2792				});
2793				
2794				fullWidthSections();
2795				
2796				var pageDotsBool = ($that.is('[data-controls="bottom-pagination"]')) ? true : false;
2797				var arrowsBool = ($that.is('[data-controls="bottom-pagination"]')) ? false : true;
2798				var $autoplay = ( $that.is('[data-autorotate-speed]') && parseInt( $that.attr('data-autorotate-speed') ) > 800) ? parseInt($that.attr('data-autorotate-speed')) : 5000;
2799				if(!$that.is('[data-autorotate="true"]')) { $autoplay = false; }
2800				
2801				$(this).find('ul').addClass('generate-markup');
2802				
2803				$wooFlickityCarousels[i] = $(this).find('ul');
2804				
2805				if(arrowsBool == true) {
2806					$wooFlickityCarousels[i].on( 'ready.flickity', function() {
2807						var flickityPrv = $that.find('.flickity-prev-next-button.previous').detach();
2808	 				  var flickityNxt = $that.find('.flickity-prev-next-button.next').detach();
2809						
2810						$that.find('.nectar-woo-carousel-top').append(flickityPrv).append(flickityNxt);
2811				  });
2812				}
2813				
2814				$wooFlickityCarousels[i].flickity({
2815					 draggable: true,
2816					 lazyLoad: false,
2817					 imagesLoaded: true,
2818					 cellAlign: 'left',
2819					 groupCells: pageDotsBool,
2820					 prevNextButtons: arrowsBool,
2821					 pageDots: pageDotsBool,
2822					 resize: true,
2823					 percentPosition: true,
2824					 setGallerySize: true,
2825					 wrapAround: true,
2826					 autoPlay: $autoplay,
2827					 accessibility: false
2828				 });
2829				 
2830				 
2831				 //mobile pagination numbers
2832				 if(arrowsBool == true) {
2833					 
2834					 	$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>');
2835					 
2836						var $wooFlickityCount = $('<div class="woo-flickity-count" />');
2837						$that.append($wooFlickityCount);
2838						var $wooFlickityData = $wooFlickityCarousels[i].data('flickity');
2839						
2840						function updateWooFlickityCount() {
2841						  var slideNumber = $wooFlickityData.selectedIndex + 1;
2842						  $wooFlickityCount.text( slideNumber + '/' + $wooFlickityData.slides.length );
2843						}
2844						updateWooFlickityCount();
2845						$wooFlickityCarousels[i].on( 'select.flickity', updateWooFlickityCount );
2846				 }
2847				 
2848
2849				
2850			});
2851			
2852			
2853    }
2854		
2855    if($('.products-carousel').length > 0 || $('.nectar-woo-flickity').length > 0) { productCarouselInit(); }
2856
2857
2858
2859
2860    
2861    //fullwidth carousel swipe link fix
2862    function fwCarouselLinkFix() {
2863	    var $mousePosStart = 0;
2864	    var $mousePosEnd = 0;
2865	    $('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mousedown(function(e){
2866	    	$mousePosStart = e.clientX;
2867	    });
2868	    
2869	    $('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mouseup(function(e){
2870	    	$mousePosEnd = e.clientX;
2871	    });
2872	    
2873	    $('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').click(function(e){
2874	    	if(Math.abs($mousePosStart - $mousePosEnd) > 10)  return false;
2875	    });
2876	}
2877	fwCarouselLinkFix();
2878    
2879     
2880	function carouselHeightCalcs(){
2881		
2882		//recent work carousel
2883		$('.carousel.portfolio-items.finished-loading').each(function(){
2884
2885			var bottomSpace = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true' && $(this).find('.style-2, .style-3, .style-4').length > 0) ? 0 : 28 ;
2886			
2887			var tallestMeta = 0;
2888			
2889			$(this).find('> li').each(function(){
2890				($(this).find('.work-meta').height() > tallestMeta) ? tallestMeta = $(this).find('.work-meta').height() : tallestMeta = tallestMeta;
2891			});	
2892    	 
2893     		$(this).parents('.caroufredsel_wrapper').css({
2894     			'height' : ($(this).find('.work-item').outerHeight() + tallestMeta + bottomSpace -2) + 'px'
2895     		});
2896
2897     		 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') {
2898        	 	$(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler("currentPosition")+1)/$(this).triggerHandler("currentVisible").length));
2899        	 	$(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('> li').length / $(this).triggerHandler("currentVisible").length));
2900        	 }	
2901   	  	});
2902   	  	
2903   	  	//standard carousel
2904   	  	$('.carousel.finished-loading:not(".portfolio-items, .clients"), .caroufredsel_wrapper .products.finished-loading').each(function(){
2905			
2906			var tallestColumn = 0;
2907			
2908			$(this).find('> li').each(function(){
2909				($(this).height() > tallestColumn) ? tallestColumn = $(this).height() : tallestColumn = tallestColumn;
2910			});	
2911
2912         	$(this).css('height',tallestColumn + 5);
2913         	$(this).parents('.caroufredsel_wrapper').css('height',tallestColumn + 5);
2914
2915         	 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') {
2916        	 	$(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler("currentPosition")+1)/$(this).triggerHandler("currentVisible").length));
2917        	 	$(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('> li').length / $(this).triggerHandler("currentVisible").length));
2918        	 }	
2919			
2920   	  	});
2921   	  	
2922	}
2923
2924
2925	function clientsCarouselInit(){
2926	     $('.carousel.clients').each(function(){
2927	    	var $that = $(this);
2928	    	var columns; 
2929	    	var $autoRotate = (!$(this).hasClass('disable-autorotate')) ? true : false;
2930	    	(parseInt($(this).attr('data-max'))) ? columns = parseInt($(this).attr('data-max')) : columns = 5;
2931	    	if($(window).width() < 690 && $('body').attr('data-responsive') == '1') { columns = 2; $(this).addClass('phone') }
2932	    	
2933	    	var $element = $that;
2934			if($that.find('img').length == 0) $element = $('body');
2935			
2936			imagesLoaded($element,function(instance){
2937	    		
2938		    	$that.carouFredSel({
2939			    		circular: true,
2940			    		responsive: true, 
2941				        items       : {
2942							
2943							height : $that.find('> div:first').height(),
2944							width  : $that.find('> div:first').width(),
2945					        visible     : {
2946					            min         : 1,
2947					            max         : columns
2948					        }
2949					    },
2950					    swipe       : {
2951					        onTouch     : true,
2952					        onMouse         : true
2953					    },
2954					    scroll: {
2955					    	items           : 1,
2956					    	easing          : 'easeInOutCubic',
2957				            duration        : '800',
2958				            pauseOnHover    : true
2959					    },
2960					    auto    : {
2961					    	play            : $autoRotate,
2962					    	timeoutDuration : 2700
2963					    }
2964			    }).animate({'opacity': 1},1300);
2965			    
2966			    $that.addClass('finished-loading');
2967
2968			    $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">');
2969			     
2970
2971			    $(window).trigger('resize');
2972			    
2973		    
2974		    });
2975	
2976	    });
2977    }
2978   if($('.carousel').length > 0)  clientsCarouselInit();
2979    
2980
2981    function clientsCarouselHeightRecalc(){
2982
2983    	var tallestImage = 0;
2984		  			
2985    	 $('.carousel.clients.finished-loading').each(function(){
2986    	 	
2987    	 	$(this).find('> div').each(function(){
2988				($(this).height() > tallestImage) ? tallestImage = $(this).height() : tallestImage = tallestImage;
2989			});	
2990    	 	
2991         	$(this).css('height',tallestImage);
2992         	$(this).parent().css('height',tallestImage);
2993         });
2994    }
2995
2996
2997    //carousel grabbing class
2998    function carouselfGrabbingClass() {
2999	    $('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(){
3000	    	$(this).addClass('active');
3001	    });
3002	    
3003	    $('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(){
3004	    	$(this).removeClass('active');
3005	    });
3006	}
3007	carouselfGrabbingClass();
3008	    
3009
3010	//ascend arrow hover class
3011	$('body.ascend, body.material').on('mouseover','.carousel-next',function(){
3012		$(this).parent().find('.carousel-prev, .item-count').addClass('next-hovered');
3013	});
3014	$('body.ascend, body.material').on('mouseleave','.carousel-next',function(){
3015		$(this).parent().find('.carousel-prev, .item-count').removeClass('next-hovered');
3016	});
3017
3018	//fadein for clients / carousels
3019	function clientsFadeIn() {
3020
3021		var $clientsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? 100: 'bottom-in-view';
3022		$($fullscreenSelector+'.clients.fade-in-animation').each(function() {
3023
3024			var $that = $(this);
3025			var waypoint = new Waypoint({
3026 			element: $that,
3027 			 handler: function(direction) {
3028				
3029				if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
3030					 waypoint.destroy();
3031					return;
3032				}
3033
3034				 $that.find('> div').each(function(i){
3035					$(this).delay(i*80).transition({'opacity':"1"},450);
3036				});
3037				
3038				
3039				//add the css transition class back in after the aniamtion is done
3040				setTimeout(function(){ $that.addClass('completed'); },($that.find('> div').length*80) + 450);
3041			
3042
3043				$that.addClass('animated-in');
3044				waypoint.destroy();
3045			},
3046			offset: $clientsOffsetPos
3047
3048			}); 
3049		}); 
3050	}
3051	 
3052	//if($('.nectar-box-roll').length == 0) clientsFadeIn();
3053	
3054	
3055/*-------------------------------------------------------------------------*/
3056/*	2.	Helper Functions
3057/*-------------------------------------------------------------------------*/
3058
3059	jQuery.fn.setCursorPosition = function(position){
3060		
3061	    if(this.length == 0) { 
3062				return this; 
3063			}
3064	    return $(this).setSelection(position, position);
3065	}
3066	
3067	jQuery.fn.setSelection = function(selectionStart, selectionEnd) {
3068	    if(this.length == 0) { 
3069				return this;
3070			}
3071	    input = this[0];
3072	
3073	    if (input.createTextRange) {
3074	        var range = input.createTextRange();
3075	        range.collapse(true);
3076	        range.moveEnd('character', selectionEnd);
3077	        range.moveStart('character', selectionStart);
3078	        range.select();
3079	    } else if (input.setSelectionRange) {
3080	        input.focus();
3081	        input.setSelectionRange(selectionStart, selectionEnd);
3082	    }
3083	
3084	    return this;
3085	}
3086	
3087	
3088
3089	$.extend($.expr[':'], {
3090	    transparent: function(elem, i, attr){
3091	      return( $(elem).css("opacity") === "0" );
3092	    }
3093	});
3094	
3095
3096	function getQueryParams(qs) {
3097	    qs = qs.split("+").join(" ");
3098	    var params = {},
3099	        tokens,
3100	        re = /[?&]?([^=]+)=([^&]*)/g;
3101
3102	    while (tokens = re.exec(qs)) {
3103	        params[decodeURIComponent(tokens[1])]
3104	            = decodeURIComponent(tokens[2]);
3105	    }
3106
3107	    return params;
3108	}
3109
3110	var $_GET = getQueryParams(document.location.search);
3111
3112	
3113	//count
3114	var CountUp = function(target, startVal, endVal, decimals, duration, options) {
3115
3116    // make sure requestAnimationFrame and cancelAnimationFrame are defined
3117    // polyfill for browsers without native support
3118    // by Opera engineer Erik Möller
3119    var lastTime = 0;
3120    var vendors = ['webkit', 'moz', 'ms', 'o'];
3121    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
3122        window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
3123        window.cancelAnimationFrame =
3124          window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame'];
3125    }
3126    if (!window.requestAnimationFrame) {
3127        window.requestAnimationFrame = function(callback, element) {
3128            var currTime = new Date().getTime();
3129            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
3130            var id = window.setTimeout(function() { callback(currTime + timeToCall); },
3131              timeToCall);
3132            lastTime = currTime + timeToCall;
3133            return id;
3134        };
3135    }
3136    if (!window.cancelAnimationFrame) {
3137        window.cancelAnimationFrame = function(id) {
3138            clearTimeout(id);
3139        };
3140    }
3141
3142    var self = this;
3143
3144     // default options
3145    self.options = {
3146        useEasing : true, // toggle easing
3147        useGrouping : true, // 1,000,000 vs 1000000
3148        separator : ',', // character to use as a separator
3149        decimal : '.', // character to use as a decimal
3150        easingFn: null, // optional custom easing closure function, default is Robert Penner's easeOutExpo
vendor: 4,251 bytes, lines 3151-3267
3151        formattingFn: null // optional custom formatting function, default is self.formatNumber below
3152    };
3153    // extend default options with passed options object
3154    for (var key in options) {
3155        if (options.hasOwnProperty(key)) {
3156            self.options[key] = options[key];
3157        }
3158    }
3159    if (self.options.separator === '') { self.options.useGrouping = false; }
3160    if (!self.options.prefix) self.options.prefix = '';
3161    if (!self.options.suffix) self.options.suffix = '';
3162
3163    self.d = (typeof target === 'string') ? document.getElementById(target) : target;
3164    self.startVal = Number(startVal);
3165    self.endVal = Number(endVal);
3166    self.countDown = (self.startVal > self.endVal);
3167    self.frameVal = self.startVal;
3168    self.decimals = Math.max(0, decimals || 0);
3169    self.dec = Math.pow(10, self.decimals);
3170    self.duration = Number(duration) * 1000 || 2000;
3171
3172    self.formatNumber = function(nStr) {
3173        nStr = nStr.toFixed(self.decimals);
3174        nStr += '';
3175        var x, x1, x2, rgx;
3176        x = nStr.split('.');
3177        x1 = x[0];
3178        x2 = x.length > 1 ? self.options.decimal + x[1] : '';
3179        rgx = /(\d+)(\d{3})/;
3180        if (self.options.useGrouping) {
3181            while (rgx.test(x1)) {
3182                x1 = x1.replace(rgx, '$1' + self.options.separator + '$2');
3183            }
3184        }
3185        return self.options.prefix + x1 + x2 + self.options.suffix;
3186    };
3187    // Robert Penner's easeOutExpo
3188    self.easeOutExpo = function(t, b, c, d) {
3189        return c * (-Math.pow(2, -10 * t / d) + 1) * 1024 / 1023 + b;
3190    };
3191
3192    self.easingFn = self.options.easingFn ? self.options.easingFn : self.easeOutExpo;
3193    self.formattingFn = self.options.formattingFn ? self.options.formattingFn : self.formatNumber;
3194
3195    self.version = function () { return '1.7.1'; };
3196
3197    // Print value to target
3198    self.printValue = function(value) {
3199        var result = self.formattingFn(value);
3200
3201        if (self.d.tagName === 'INPUT') {
3202            this.d.value = result;
3203        }
3204        else if (self.d.tagName === 'text' || self.d.tagName === 'tspan') {
3205            this.d.textContent = result;
3206        }
3207        else {
3208            this.d.innerHTML = result;
3209        }
3210    };
3211
3212    self.count = function(timestamp) {
3213
3214        if (!self.startTime) { self.startTime = timestamp; }
3215
3216        self.timestamp = timestamp;
3217        var progress = timestamp - self.startTime;
3218        self.remaining = self.duration - progress;
3219
3220        // to ease or not to ease
3221        if (self.options.useEasing) {
3222            if (self.countDown) {
3223                self.frameVal = self.startVal - self.easingFn(progress, 0, self.startVal - self.endVal, self.duration);
3224            } else {
3225                self.frameVal = self.easingFn(progress, self.startVal, self.endVal - self.startVal, self.duration);
3226            }
3227        } else {
3228            if (self.countDown) {
3229                self.frameVal = self.startVal - ((self.startVal - self.endVal) * (progress / self.duration));
3230            } else {
3231                self.frameVal = self.startVal + (self.endVal - self.startVal) * (progress / self.duration);
3232            }
3233        }
3234
3235        // don't go past endVal since progress can exceed duration in the last frame
3236        if (self.countDown) {
3237            self.frameVal = (self.frameVal < self.endVal) ? self.endVal : self.frameVal;
3238        } else {
3239            self.frameVal = (self.frameVal > self.endVal) ? self.endVal : self.frameVal;
3240        }
3241
3242        // decimal
3243        self.frameVal = Math.round(self.frameVal*self.dec)/self.dec;
3244
3245        // format and print value
3246        self.printValue(self.frameVal);
3247
3248        // whether to continue
3249        if (progress < self.duration) {
3250            self.rAF = requestAnimationFrame(self.count);
3251        } else {
3252            if (self.callback) { self.callback(); }
3253        }
3254    };
3255    // start your animation
3256    self.start = function(callback) {
3257        self.callback = callback;
3258        self.rAF = requestAnimationFrame(self.count);
3259        return false;
3260    };
3261    // toggles pause/resume animation
3262    self.pauseResume = function() {
3263        if (!self.paused) {
3264            self.paused = true;
3265            cancelAnimationFrame(self.rAF);
3266        } else {
3267            self.paused = false;
3268            delete self.startTime;
3269            self.duration = self.remaining;
3270            self.startVal = self.frameVal;
3271            requestAnimationFrame(self.count);
3272        }
3273    };
3274    // reset to startVal so animation can be run again
3275    self.reset = function() {
3276        self.paused = false;
3277        delete self.startTime;
3278        self.startVal = startVal;
3279        cancelAnimationFrame(self.rAF);
3280        self.printValue(self.startVal);
3281    };
3282    // pass a new endVal and start animation
3283    self.update = function (newEndVal) {
3284        cancelAnimationFrame(self.rAF);
3285        self.paused = false;
3286        delete self.startTime;
3287        self.startVal = self.frameVal;
3288        self.endVal = Number(newEndVal);
3289        self.countDown = (self.startVal > self.endVal);
3290        self.rAF = requestAnimationFrame(self.count);
3291    };
3292
3293    // format startVal on initialization
3294    self.printValue(self.startVal);
3295};
3296	
3297var easeOutCubic = function(t, b, c, d) {
3298    return c*((t=t/d-1)*t*t + 1) + b;
3299};	
3300	
3301	
3302/*-------------------------------------------------------------------------*/
3303/*	3.	Shortcode Stuff
3304/*-------------------------------------------------------------------------*/
3305
3306
3307function vcWaypoints() {
3308	$($fullscreenSelector+' .wpb_animate_when_almost_visible').each(function() {
3309		  
3310			var $vcOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '90%';
3311
3312			var $that = $(this);
3313			var waypoint = new Waypoint({
3314	 			element: $that,
3315	 			 handler: function(direction) {
3316
3317	 			 	if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated')) { 
3318					     waypoint.destroy();
3319					     return;
3320					}
3321	 				$that.addClass("animated");
3322	 				$that.addClass("wpb_start_animation");
3323	 				waypoint.destroy();
3324					
3325					if($that.is('.nectar-button') && $('body[data-button-style*="rounded_shadow"]').length > 0) {
3326						setTimeout(function(){
3327							$that.removeClass('wpb_start_animation');
3328						},1100);
3329					}
3330				
3331				},
3332				offset: $vcOffsetPos
3333
3334			}); 
3335
3336	});
3337}
3338			 
3339
3340/***************** Milestone Counter ******************/
3341	
3342	function milestoneInit() {
3343
3344		$('.nectar-milestone').each(function() {
3345			
3346			//symbol
3347			if($(this).is('[data-symbol]')) {
3348				if($(this).find('.symbol-wrap').length == 0) {
3349					if($(this).attr('data-symbol-pos') == 'before') {
3350						$(this).find('.number').prepend('<div class="symbol-wrap"><span class="symbol">' + $(this).attr('data-symbol') + '</span></div>');
3351					} else {
3352						$(this).find('.number').append('<div class="symbol-wrap"><span class="symbol">' + $(this).attr('data-symbol') + '</span></div>');
3353					}
3354				}
3355
3356				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'));
3357			
3358				$(this).find('.symbol-wrap').css({'font-size': $symbol_size + 'px', 'line-height': $symbol_size + 'px'});
3359			}
3360
3361			$(this).find('.number').css({'font-size': $(this).find('.number').attr('data-number-size') +'px', 'line-height': $(this).find('.number').attr('data-number-size') + 'px'});
3362		});
3363		
3364		if(!$('body').hasClass('mobile') && $('.nectar-milestone').length > 0) {
3365			
3366
3367			//blur effect
3368			var $blurCssString = '';
3369			$($fullscreenSelector+'.nectar-milestone.motion_blur').each(function(i){
3370				
3371				$(this).removeClass(function (index, className) {
3372				    return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
3373				});	
3374					
3375				$(this).addClass('instance-'+i);
3376
3377				var $currentColor = $(this).find('.number').css('color');
3378				var colorInt = parseInt($currentColor.substring(1),16);
3379		   		var R = (colorInt & 0xFF0000) >> 16;
3380		    	var G = (colorInt & 0x00FF00) >> 8;
3381		   		var B = (colorInt & 0x0000FF) >> 0;
3382		   		
3383		   		var $rgbaColorStart = 'rgba('+R+','+G+','+B+',0.2)';
3384				var $rgbaColorEnd = 'rgba('+R+','+G+','+B+',1)';
3385				var $numberSize = parseInt($(this).find('.number').attr('data-number-size'));
3386
3387				$blurCssString += '@keyframes motion-blur-number-'+i+' { ' +
3388				   ' 0% { '+
3389				   		'opacity: 0;'+
3390						'color: '+$rgbaColorStart+'; '+
3391   						'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+'; '+
3392    					'transform: translateZ(0px) translateY(-100%); '+
3393    					'-webkit-transform: translateZ(0px) translateY(-100%); '+
3394    				'} '+
3395    				'33% { opacity: 1 }' +
3396    				'100% { '+
3397						'color: '+$rgbaColorEnd+'; '+
3398   						'text-shadow: none; '+
3399    					'transform: translateZ(0px) translateY(0px); '+
3400    					'-webkit-transform: translateZ(0px) translateY(0px); '+
3401    				'} '+
3402    			'} '+
3403    			'@-webkit-keyframes motion-blur-number-'+i+' { ' +
3404				   ' 0% { '+
3405				  	    'opacity: 0;'+
3406						'color: '+$rgbaColorStart+'; '+
3407   						'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+'; '+
3408    					'transform: translateZ(0px) translateY(-100%); '+
3409    					'-webkit-transform: translateZ(0px) translateY(-100%); '+
3410    				'} '+
3411    				'33% { opacity: 1 }' +
3412    				'100% { '+
3413						'color: '+$rgbaColorEnd+'; '+
3414   						'text-shadow: none; '+
3415    					'transform: translateZ(0px) translateY(0px); '+
3416    					'-webkit-transform: translateZ(0px) translateY(0px); '+
3417    				'} '+
3418    			'} '+
3419    			'.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+'; } ';
3420    			
3421    			//separate each character into spans
3422    			$symbol = $(this).find('.symbol-wrap').clone();
3423    			$(this).find('.symbol-wrap').remove();
3424    			var characters = $(this).find('.number').text().split("");
3425    			$this = $(this).find('.number');
3426				$this.empty();
3427    			$.each(characters, function (i, el) {
3428				    $this.append("<span>" + el + "</span");
3429				});
3430
3431				//handle symbol
3432				if($(this).has('[data-symbol]')) {
3433	    			if($(this).attr('data-symbol-pos') == 'after') {
3434	    				$this.append($symbol);
3435	    			} else {
3436	    				$this.prepend($symbol);
3437	    			}
3438	    		}
3439				
3440			});
3441
3442			var head = document.head || document.getElementsByTagName('head')[0];
3443				var style = document.createElement('style');
3444
3445				style.type = 'text/css';
3446			if (style.styleSheet){
3447			  style.styleSheet.cssText = $blurCssString;
3448			} else {
3449			  style.appendChild(document.createTextNode($blurCssString));
3450			}
3451			$(style).attr('id','milestone-blur');
3452			$('head #milestone-blur').remove();
3453			head.appendChild(style);
3454
3455
3456			//activate
3457			milestoneWaypoint();
3458
3459		}
3460
3461	}
3462
3463	function milestoneWaypoint() {
3464		$($fullscreenSelector+'.nectar-milestone').each(function() {
3465			//animation
3466			
3467			var $offset = ($('#nectar_fullscreen_rows').length > 0) ? '250%' : '98%';
3468
3469			var $that = $(this);
3470			var waypoint = new Waypoint({
3471	 			element: $that,
3472	 			 handler: function(direction) {
3473
3474	 			 	if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
3475					     waypoint.destroy();
3476					     return;
3477					}
3478
3479	 			 	var $endNum = parseInt($that.find('.number span:not(.symbol)').text().replace(/,/g , ''));
3480
3481					if(!$that.hasClass('motion_blur')) {
3482
3483						var countOptions = { easingFn: easeOutCubic };
3484						var $countEle = $that.find('.number span:not(.symbol)')[0];
3485						var numAnim = new CountUp($countEle, 0, $endNum,0,2.2,countOptions);
3486						numAnim.start();
3487
3488					} else {
3489						$that.find('span').each(function(i){
3490							var $that = $(this);
3491							setTimeout(function(){ $that.addClass('in-sight'); },200*i);
3492						});
3493					}
3494
3495
3496					$that.addClass('animated-in');
3497					waypoint.destroy();
3498				},
3499				offset: $offset
3500
3501			}); 
3502
3503		}); 
3504	}
3505
3506	var $animationOnScrollTimeOut = ($('.nectar-box-roll').length > 0) ? 850: 125;	
3507
3508	
3509/***************** Tabbed ******************/
3510	
3511	var $tabbedClickCount = 0;
3512	$('body').on('click','.tabbed > ul li:not(.cta-button) a',function(){
3513		var $id = $(this).parents('li').index()+1;
3514		
3515		var $frontEndEditorTabDiv =  ($('body.vc_editor').length > 0) ? '> .wpb_tab ': '';
3516		
3517		if(!$(this).hasClass('active-tab') && !$(this).hasClass('loading')){
3518			$(this).parents('ul').find('a').removeClass('active-tab');
3519			$(this).addClass('active-tab');
3520			
3521			$(this).parents('.tabbed').find('>
3521 div:not(.clear)' + $frontEndEditorTabDiv).css({'visibility':'hidden','position':'absolute','opacity':'0','left':'-9999px'});
3522			
3523			if($('body.vc_editor').length > 0) {
3524				//front end editor locate tab by modal id
3525				var $data_m_id = ($(this).parent().is('[data-m-id]')) ? $(this).parent().attr('data-m-id') : '';
3526				$(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);
3527				//update padding
3528				convertFrontEndPadding();
3529				
3530			} else {
3531				$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).css({'visibility':'visible', 'position' : 'relative','left':'0','display':'block'}).stop().transition({'opacity':1},400);
3532			}
3533			
3534			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); 
3535		}
3536		
3537		//waypoint checking
3538		if($tabbedClickCount != 0) {
3539			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-progress-bar').length > 0 ) 
3540				progressBars();
3541			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 ) 
3542				dividers();
3543			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('img.img-with-animation').length > 0 ||
3544			   $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.col.has-animation').length > 0  || 
3545			   $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar_cascading_images').length > 0  || 
3546			   $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.wpb_column.has-animation').length > 0 ) {
3547				colAndImgAnimations();
3548				cascadingImageBGSizing();
3549			}
3550			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.column-image-bg-wrap[data-bg-animation="displace-filter-fade"]').length > 0){
3551				for(var k=0; k<$liquidBG_EL.length;k++) {
3552					if($($liquidBG_EL[k].canvasContainer).parents('.wpb_tab').length > 0 && $($liquidBG_EL[k].canvasContainer).parents('.wpb_tab').css('visibility') != 'hidden') {
3553						
3554						//add bg to container
3555						if($($liquidBG_EL[k].canvasContainer).find('.image-added-to-stage').length == 0) {
3556							$liquidBG_EL[k].imgContainer.addChild( $liquidBG_EL[k].bg );
3557						}
3558						$($liquidBG_EL[k].canvasContainer).find('.nectar-liquid-bg').addClass('image-added-to-stage');
3559						
3560						//resize calcs
3561						$liquidBG_EL[k].resize();
3562						
3563						//animate
3564						if($($liquidBG_EL[k].canvasContainer).find('.nectar-liquid-bg.animated-in').length == 0) {
3565							$liquidBG_EL[k].animateProps($liquidBG_EL[k]);
3566						}
3567			
3568					}
3569				}
3570			}
3571			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-milestone').length > 0 ) 
3572				milestoneWaypoint();
3573			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar_image_with_hotspots[data-animation="true"]').length > 0 ) 
3574				imageWithHotspots();
3575			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-fancy-ul').length > 0 ) 
3576				nectar_fancy_ul_init();
3577			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-split-heading').length > 0 ) 
3578				splitLineHeadings();
3579			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.wpb_column[data-border-animation="true"]').length > 0) {
3580				animatedColBorders();
3581			}
3582			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.wpb_animate_when_almost_visible').length > 0) {
3583				vcWaypoints();
3584			}
3585			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-animated-title').length > 0) {
3586				animated_titles();
3587			}
3588			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-highlighted-text').length > 0) {
3589				highlighted_text();
3590			}
3591			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar_food_menu_item').length > 0) {
3592				foodMenuItems();
3593			}
3594			if($(this).parents('.wpb_row').length > 0) {
3595				if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.vc_pie_chart').length > 0  ||
3596				   $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.wp-video-shortcode').length > 0 ||
3597					 $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.post-area.masonry .posts-container').length > 0 ||
3598				   $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.twentytwenty-container').length > 0 ||
3599					 $(this).parents('#nectar_fullscreen_rows[data-content-overflow="scrollbar"]').length > 0 ||
3600					 $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.wpb_gallery').length > 0 ||
3601				   $(this).parents('.wpb_row').next().hasClass('parallax_section'))
3602					$(window).trigger('resize');
3603					
3604					
3605				if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-flickity').length > 0 && typeof Flickity != 'undefined' ) {
3606					var tabbedFlkty = Flickity.data( $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-flickity')[0] );
3607					tabbedFlkty.resize();
3608				}
3609				
3610				if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.nectar-woo-flickity').length > 0 && typeof Flickity != 'undefined' ) {
3611					var wootabbedFlkty = Flickity.data( $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-woo-flickity > ul')[0] );
3612					wootabbedFlkty.resize();
3613				}
3614				
3615			}
3616
3617			//svg icons
3618		
3619			$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')' + $frontEndEditorTabDiv).find('.svg-icon-holder').each(function(i){
3620				var $that = $(this);
3621
3622				setTimeout(function(){
3623
3624					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;
3625
3626					clearTimeout($animatedSVGIconTimeout[i]);
3627
3628					if($that.attr('data-animation') == 'false') { 
3629						$animationSpeed = 1;
3630						$that.css('opacity','1');
3631						$svg_icons[$that.find('svg').attr('id').slice(-1)].finish();
3632					} else {
3633						
3634						$svg_icons[$that.find('svg').attr('id').slice(-1)].reset();
3635						$animatedSVGIconTimeout[i] = setTimeout(function(){ $svg_icons[$that.find('svg').attr('id').slice(-1)].play(); },$animationDelay);
3636						
3637					}
3638				},150);
3639			});
3640
3641		}
3642
3643		//fix columns inside tabs
3644		$(this).parents('.tabbed').find('.wpb_row').each(function(){
3645			if( typeof $(this).find('[class*="vc_col-"]').first().offset() != 'undefined') {
3646				
3647				var $firstChildOffset = $(this).find('[class*="vc_col-"]').first().offset().left;
3648				$(this).find('[class*="vc_col-"]').each(function(){
3649					$(this).removeClass('no-left-margin');
3650					if($(this).offset().left < $firstChildOffset + 15) { 
3651						$(this).addClass('no-left-margin');
3652					} else {
3653						$(this).removeClass('no-left-margin');
3654					}
3655				});
3656			}
3657		});
3658
3659		$tabbedClickCount++;
3660
3661		//magic line
3662		if($(this).parent().parent().find('.magic-line').length > 0) {
3663			magicLineCalc($(this));
3664	     }
3665
3666		return false;
3667	});
3668
3669
3670	function magicLineCalc($ele) {
3671		var el, leftPos, ratio;
3672	    el = $ele.parent();
3673	    if (el.length) {
3674	        leftPos = el.position().left;
3675	        ratio = el.width();
3676	    } else {
3677	        leftPos = ratio = 0;
3678	    }
3679
3680	    $ele.parent().parent().find('.magic-line').css('transform', 'translateX(' + leftPos + 'px) scaleX(' + ratio + ')');
3681	}
3682	
3683	
3684	function tabbedInit(){ 
3685		$('.tabbed').each(function(){
3686			
3687			//handle icons
3688			$(this).find('.wpb_tab').each(function(i){
3689				
3690				if($(this).is('[data-tab-icon]') && $(this).attr('data-tab-icon').length > 0) {
3691					$(this).parents('.tabbed').addClass('using-icons');
3692					$(this).parents('.tabbed').find('.wpb_tabs_nav li:nth-child('+ (i+1) +') > a').prepend('<i class="'+$(this).attr("data-tab-icon")+'"></i>');
3693				}
3694			});
3695			
3696			//make sure the tabs don't have a nectar slider - we'll init this after the sliders load in that case
3697			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){
3698				$(this).find('> ul li:first-child a').click();
3699			}	
3700			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 ){
3701				var $that = $(this);
3702				
3703				$(this).find('.wpb_tab').show().css({'opacity':0,'height':'1px'});
3704				$(this).find('> ul li a').addClass('loading');
3705				
3706				setTimeout(function(){ 
3707					$that.find('.wpb_tab').hide().css({'opacity':1,'height':'auto'}); 
3708					$that.find('> ul li a').removeClass('loading');
3709					$that.find('> ul li:first-child a').click(); 
3710				},900);
3711			}
3712
3713			var $that = $(this);
3714			//minimal alt effect
3715			setTimeout(function(){
3716				if($that.is('[data-style="minimal_alt"]')) {
3717					$that.find('> ul').append('<li class="magic-line" />');
3718					 magicLineCalc($that.find('> ul > li:first-child > a'));
3719				}
3720			},100);
3721
3722
3723		});
3724	}
3725	setTimeout(tabbedInit,60);
3726
3727	//deep linking
3728	function tabbbedDeepLinking(){
3729		if(typeof $_GET['tab'] != 'undefined'){
3730			$('.wpb_tabs_nav').each(function(){
3731
3732				$(this).find('li').each(function(){
3733					var $currentText = $(this).find('a').text();
3734					var $getText = $_GET['tab'];
3735					var $that = $(this);
3736
3737					$currentText = $currentText.replace(/\s+/g, '-').toLowerCase();
3738					$getText = $getText.replace(/\s+/g, '-').replace(/</g, '&lt;').replace(/"/g, '&quot;').toLowerCase();
3739
3740					if($currentText == $getText)  { 
3741
3742			          $(this).find('a').click(); 
3743			           setTimeout(function(){ 
3744			              $that.find('a').click(); 
3745			           },901);
3746			        }
3747				})
3748			});
3749		}
3750	}
3751	tabbbedDeepLinking();
3752
3753/***************** Toggle ******************/
3754	
3755	//toggles
3756	$('body').on('click','.toggle h3 a', function(){
3757	
3758		if(!$(this).parents('.toggles').hasClass('accordion')) { 
3759			$(this).parents('.toggle').find('> div').slideToggle(300);
3760			$(this).parents('.toggle').toggleClass('open');
3761			
3762			//switch icon
3763			if( $(this).parents('.toggle').hasClass('open') ){
3764				$(this).find('i').attr('class','icon-minus-sign');
3765			} else {
3766				$(this).find('i').attr('class','icon-plus-sign');
3767			}
3768
3769			if($(this).parents('.toggle').find('> div .iframe-embed').length > 0 && $(this).parents('.toggle').find('> div iframe.iframe-embed').height() == '0') responsiveVideoIframes();
3770			if($(this).parents('.full-width-content').length > 0) setTimeout(function(){ fullWidthContentColumns(); },300);
3771			if($('#nectar_fullscreen_rows').length > 0) setTimeout(function(){ $(window).trigger('smartresize'); },300);
3772			return false;
3773		}
3774	});
3775	
3776	//accordion
3777	$('body').on('click','.accordion .toggle h3 a', function(){
3778		
3779		if($(this).parents('.toggle').hasClass('open')) return false;
3780		
3781		$(this).parents('.toggles').find('.toggle > div').slideUp(300);
3782		$(this).parents('.toggles').find('.toggle h3 a i').attr('class','icon-plus-sign');
3783		$(this).parents('.toggles').find('.toggle').removeClass('open');
3784		
3785		$(this).parents('.toggle').find('> div').slideDown(300);
3786		$(this).parents('.toggle').addClass('open');
3787		
3788		//switch icon
3789		if( $(this).parents('.toggle').hasClass('open') ){
3790			$(this).find('i').attr('class','icon-minus-sign');
3791		} else {
3792			$(this).find('i').attr('class','icon-plus-sign');
3793		}
3794
3795		if($(this).parents('.full-width-content').length > 0) { 
3796			clearTimeout($t);
3797			var $t = setTimeout(function(){ fullWidthContentColumns(); },400);
3798		}
3799		if($('#nectar_fullscreen_rows').length > 0) {
3800			clearTimeout($t);
3801			var $t = setTimeout(function(){ $(window).trigger('smartresize'); },400);
3802		}
3803		
3804		return false;
3805	});
3806	
3807	//accordion start open
3808	function accordionInit(){ 
3809		$('.accordion').each(function(){
3810			$(this).find('> .toggle').first().addClass('open').find('> div').show();
3811			$(this).find('> .toggle').first().find('a i').attr('class','icon-minus-sign');
3812		});
3813		
3814		
3815		$('.toggles').each(function(){
3816			
3817			var $isAccordion = ($(this).hasClass('accordion')) ? true : false;
3818			
3819			$(this).find('.toggle').each(function(){
3820				if($(this).find('> div .testimonial_slider').length > 0 || $(this).find('> div iframe').length > 0) {
3821					var $that = $(this);
3822					$(this).find('> div').show().css({'opacity':0,'height':'1px', 'padding':'0'});
3823					
3824					testimonialHeightResize();
3825					
3826					setTimeout(function(){
3827						$that.find('> div').hide().css({'opacity':1,'height':'auto', 'padding':'10px 14px'}); 
3828						if($isAccordion == true && $that.index() == 0) $that.find('> div').slideDown(300);
3829					},900);
3830				} 
3831			});
3832		})
3833	}
3834	accordionInit();
3835
3836	//deep linking
3837	function accordionDeepLinking(){
3838		if(typeof $_GET['toggle'] != 'undefined'){
3839			$('.toggles').each(function(){
3840
3841				$(this).find('.toggle').each(function(){
3842					var $currentText = $(this).find('h3 a').clone();
3843					var $getText = $_GET['toggle'];
3844
3845					$($currentText).find('i').remove();
3846					$currentText = $currentText.text();
3847					$currentText = $currentText.replace(/\s+/g, '-').toLowerCase();
3848					$getText = $getText.replace(/\s+/g, '-').replace(/</g, '&lt;').replace(/"/g, '&quot;').toLowerCase();
3849
3850					if($currentText == $getText) $(this).find('h3 a').click();
3851				});
3852			});
3853		}
3854	}
3855	accordionDeepLinking();
3856
3857/***************** Button ******************/
3858	
3859	$.cssHooks.color = {
3860	    get: function(elem) {
3861	        if (elem.currentStyle)
3862	            var color = elem.currentStyle["color"];
3863	        else if (window.getComputedStyle)
3864	            var color = document.defaultView.getComputedStyle(elem,
3865	                null).getPropertyValue("color");
3866	        if (color.search("rgb") == -1)
3867	            return color;
3868	        else {
3869	            color = color.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
3870	            function hex(x) {
3871	                return ("0" + parseInt(x).toString(16)).slice(-2);
3872	            }
3873	            if(color) {
3874	            	return "#" + hex(color[1]) + hex(color[2]) + hex(color[3]);
3875	            }
3876	        }
3877	    }
3878	}
3879
3880	$.cssHooks.backgroundColor = {
3881	    get: function(elem) {
3882	        if (elem.currentStyle)
3883	            var bg = elem.currentStyle["backgroundColor"];
3884	        else if (window.getComputedStyle)
3885	            var bg = document.defaultView.getComputedStyle(elem,
3886	                null).getPropertyValue("background-color");
3887	        if (bg.search("rgb") == -1)
3888	            return bg;
3889	        else {
3890	            bg = bg.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
3891	            function hex(x) {
3892	                return ("0" + parseInt(x).toString(16)).slice(-2);
3893	            }
3894	            if(bg) {
3895	            	return "#" + hex(bg[1]) + hex(bg[2]) + hex(bg[3]);
3896	            }
3897	        }
3898	    }
3899	}
3900	
3901	function shadeColor(hex, lum) {
3902
3903	  // validate hex string
3904		hex = String(hex).replace(/[^0-9a-f]/gi, '');
3905		if (hex.length < 6) {
3906			hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];
3907		}
3908		lum = lum || 0;
3909
3910		// convert to decimal and change luminosity
3911		var rgb = "#", c, i;
3912		for (i = 0; i < 3; i++) {
3913			c = parseInt(hex.substr(i*2,2), 16);
3914			c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16);
3915			rgb += ("00"+c).substr(c.length);
3916		}
3917
3918		return rgb;
3919	}
3920
3921	//color
3922	function coloredButtons() {
3923		$('.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(){
3924			
3925			var $usingMaterialSkin = ($('body.material[data-button-style^="rounded"]').length > 0) ? true : false;
3926			$(this).css('visibility','visible');
3927			
3928			if($(this).hasClass('see-through-3') && $(this).attr('data-color-override') == 'false') {
3929				return true;
3930			}
3931			//if($(this).attr('data-color-override') != 'false'){
3932
3933				if($(this).attr('data-color-override') != 'false') {
3934					var $color = $(this).attr('data-color-override') ;
3935				} else {
3936					if($(this).parents('.dark').length > 0) 
3937						var $color = '#000000';
3938					else 
3939						var $color = '#ffffff';
3940				}
3941
3942				if(!$(this).hasClass('see-through-3')) $(this).css('color',$color);
3943				$(this).find('i').css('color',$color);
3944				
3945				var colorInt = parseInt($color.substring(1),16);
3946				var $hoverColor = ($(this).has('[data-hover-color-override]')) ? $(this).attr('data-hover-color-override') : 'no-override';
3947				var $hoverTextColor = ($(this).has('[data-hover-text-color-override]')) ? $(this).attr('data-hover-text-color-override') : '#fff';
3948				
3949	   		var R = (colorInt & 0xFF0000) >> 16;
3950	    	var G = (colorInt & 0x00FF00) >> 8;
3951	   		var B = (colorInt & 0x0000FF) >> 0;
3952	   		
3953	   		var $opacityStr = ($(this).hasClass('see-through-3')) ? '1': '0.75';
3954
3955				$(this).css('border-color','rgba('+R+','+G+','+B+','+$opacityStr+')');
3956				
3957				//material buttons w/ icons starting
3958				if($usingMaterialSkin) {
3959					$(this).find('i').css({'background-color': 'rgba('+R+','+G+','+B+',1)', 'box-shadow': '0px 8px 15px rgba('+R+','+G+','+B+',0.24)'});
3960				}
3961				
3962				if($(this).hasClass('see-through')) {
3963					
3964					var $that = $(this);
3965					
3966					$(this).on('mouseenter touchstart', function(){
3967						$that.css('border-color','rgba('+R+','+G+','+B+',1)');
3968					});
3969					
3970					$(this).on('mouseleave touchtouchend', function(){
3971						$that.css('border-color','rgba('+R+','+G+','+B+',1)');
3972						$opacityStr = ($(this).hasClass('see-through-3')) ? '1': '0.75';
3973						$that.css('border-color','rgba('+R+','+G+','+B+','+$opacityStr+')');
3974					});
3975					
3976					
3977				} else {
3978					
3979					$(this).find('i').css('color', $hoverTextColor);
3980					
3981					if($hoverColor != 'no-override'){
3982						
3983						var $that = $(this);
3984						
3985						$(this).on('mouseenter touchstart', function(){
3986							
3987							$that.css({
3988								'border-color': $hoverColor,
3989								'background-color': $hoverColor,
3990								'color': $hoverTextColor
3991							});
3992							
3993							//material buttons w/ icons over
3994							if($usingMaterialSkin) {
3995								$that.find('i').css({'background-color': '', 'box-shadow': ''});
3996							}
3997							
3998						});
3999						
4000						$(this).on('mouseleave touchtouchend', function(){
4001								
4002								$opacityStr = ($(this).hasClass('see-through-3')) ? '1': '0.75';
4003								
4004								//material buttons w/ icons leave
4005								if($usingMaterialSkin) {
4006									$that.find('i').css({'background-color': 'rgba('+R+','+G+','+B+',1)', 'box-shadow': '0px 8px 15px rgba('+R+','+G+','+B+',0.24)'});
4007								}
4008								
4009								if(!$that.hasClass('see-through-3')) {
4010									$that.css({
4011										'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
4012										'background-color': 'transparent',
4013										'color': $color
4014									});
4015								} else {
4016									$that.css({
4017										'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
4018										'background-color': 'transparent'
4019									});
4020								}
4021							
4022						});
4023							
4024
4025					
4026					} else {
4027						
4028						var $that = $(this);
4029						
4030						$(this).on('mouseenter touchstart', function(){
4031							
4032								$that.css({
4033									'border-color': $hoverColor,
4034									'color': $hoverTextColor
4035								});
4036								
4037						});
4038						
4039						$(this).on('mouseleave touchtouchend', function(){
4040							
4041								$opacityStr = ($that.hasClass('see-through-3')) ? '1': '0.75';
4042								$that.css({
4043									'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
4044									'color':  $hoverTextColor
4045								});
4046								
4047						});
4048							
4049
4050					
4051					}
4052			//	}
4053			
4054			}
4055		});
4056		
4057		$('.nectar-button:not(.see-through):not(.see-through-2):not(.see-through-3)[data-color-override]').each(function(){
4058			
4059			$(this).css('visibility','visible');
4060			
4061			if($(this).attr('data-color-override') != 'false'){
4062				
4063				var $color = $(this).attr('data-color-override');
4064				$(this).removeClass('accent-color').removeClass('extra-color-1').removeClass('extra-color-2').removeClass('extra-color-3');
4065				$(this).css('background-color',$color);
4066				
4067			}
4068			
4069		});
4070
4071
4072		//solid color tilt 
4073		if($('.swiper-slide .solid_color_2').length > 0 || $('.tilt-button-inner').length > 0) {
4074
4075			var $tiltButtonCssString = '';
4076
4077			$('.swiper-slide .solid_color_2 a').each(function(i){
4078				
4079				$(this).addClass('instance-'+i);
4080
4081				if($(this).attr('data-color-override') != 'false') {
4082					var $color = $(this).attr('data-color-override');
4083				} else {
4084					if($(this).parents('.dark').length > 0) 
4085						var $color = '#000000';
4086					else 
4087						var $color = '#ffffff';
4088				}
4089
4090				$(this).css('color',$color);
4091				$(this).find('i').css('color',$color);
4092				
4093				var $currentColor = $(this).css('background-color');
4094				var $topColor = shadeColor($currentColor, 0.13);
4095				var $bottomColor = shadeColor($currentColor, -0.15);
4096	
4097				$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+'; } ';
4098
4099			});
4100
4101
4102			$('.tilt-button-wrap a').each(function(i){
4103				
4104				$(this).addClass('instance-'+i);
4105
4106				var $currentColor = $(this).css('background-color');
4107
4108				if($(this).attr('data-color-override') != 'false') {
4109					var $color = $(this).attr('data-color-override');
4110					$(this).css('background-color',$color);
4111					$currentColor = $color;
4112				} 
4113			
4114				var $topColor = shadeColor($currentColor, 0.13);
4115				var $bottomColor = shadeColor($currentColor, -0.15);
4116	
4117				$tiltButtonCssString += '.tilt-button-wrap a.instance-'+i + ':after { background-color: '+$topColor+';  }' + ' .tilt-button-wrap a.instance-'+i + ':before { background-color: '+$bottomColor+'; } ';
4118
4119			});
4120
4121			var head = document.head || document.getElementsByTagName('head')[0];
4122   			var style = document.createElement('style');
4123
4124   			style.type = 'text/css';
4125			if (style.styleSheet){
4126			  style.styleSheet.cssText = $tiltButtonCssString;
4127			} else {
4128			  style.appendChild(document.createTextNode($tiltButtonCssString));
4129			}
4130
4131			head.appendChild(style);
4132		}
4133
4134
4135		//transparent 3d
4136		if($('.nectar-3d-transparent-button').length > 0) {
4137
4138			var $3dTransButtonCssString = '';
4139			$('.nectar-3d-transparent-button').each(function(i){
4140
4141				var $that = $(this);
4142				var $size = $that.attr('data-size');
4143				var $padding = 0;
4144				var $font_size;
4145		
4146
4147				//size
4148
4149				if($size == 'large') {
4150					$padding = 46;
4151					$font_size = 16;
4152				} else if($size == 'medium') {
4153					$padding = 30;
4154					$font_size = 16;
4155				} else if($size == 'small') {
4156					$padding = 20;
4157					$font_size = 12;
4158				} else if($size == 'jumbo') {
4159					$padding = 54;
4160					$font_size = 24;
4161				} else if($size == 'extra_jumbo') {
4162					$padding = 100;
4163					$font_size = 64;
4164				}
4165
4166				$that.find('svg text').attr('font-size',$font_size);
4167				var $boundingRect = $(this).find('.back-3d .button-text')[0].getBoundingClientRect();
4168
4169				var $text_width = $boundingRect.width;
4170				var $text_height = $font_size*1.5;
4171
4172				var $extraMult = (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) ? 0 : 1;
4173
4174				$that.css({'width': ($text_width+$padding*1.5)+'px','height': ($text_height+$padding)+'px'});
4175				$that.find('> a').css({'height': ($text_height+$padding)+'px'});
4176
4177				$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));
4178				if($size == 'jumbo')
4179					$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.5)/2 +' ' + (($text_height+$padding) / 1.68) +')');
4180				else if($size == 'extra_jumbo')
4181					$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.6)/2 +' ' + (($text_height+$padding) / 1.6) +')');
4182				else if($size == 'large') {
4183					$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.5)/2 +' ' + (($text_height+$padding) / 1.7) +')');
4184				}
4185				else {
4186					$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.5)/2 +' ' + (($text_height+$padding) / 1.65) +')');
4187				}
4188				$that.find('.front-3d ').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
4189				$that.find('.back-3d').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
4190
4191				//mask
4192				$(this).find('.front-3d svg > rect').attr('id','masked-rect-id-'+i);
4193				$(this).find('.front-3d defs mask').attr('id','button-text-mask-'+i);
4194
4195				$that.css('visibility','visible');
4196				$3dTransButtonCssString+= '#masked-rect-id-'+i+' { mask: url(#button-text-mask-'+i+'); -webkit-mask: url(#button-text-mask-'+i+')} ';
4197
4198			});
4199
4200			//extra jumbo resize
4201			function createExtraJumboSize() {
4202				$('.nectar-3d-transparent-button').each(function(i){
4203					
4204					if($(this).css('visibility') != 'visible') return;
4205
4206					var $that = $(this);
4207					var $size = $that.attr('data-size');
4208					if($size == 'extra_jumbo') {
4209						
4210						var $font_size;
4211						
4212						var $extraMult = (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) ? 0 : 1;
4213
4214						if(window.innerWidth < 1000 && window.innerWidth > 690) {
4215							$padding = 64;
4216							$font_size = 34;
4217							$that.find('.back-3d rect').attr('stroke-width','12');
4218							$vert_height_divider = 1.7;
4219						} else if(window.innerWidth <= 690 ) {
4220							$padding = 46;
4221							$font_size = 16;
4222							$that.find('.back-3d rect').attr('stroke-width','10');
4223							$vert_height_divider = 1.7;
4224						}  else {
4225							$padding = 100;
4226							$font_size = 64;
4227							$that.find('.back-3d rect').attr('stroke-width','20');
4228							$vert_height_divider = 1.6;
4229						}
4230			
4231
4232						$that.find('svg text').attr('font-size',$font_size);
4233
4234						var $boundingRect = $(this).find('.back-3d .button-text')[0].getBoundingClientRect();
4235						var $text_width = $boundingRect.width;
4236						var $text_height = $font_size*1.5;
4237
4238						$that.css({'width': ($text_width+$padding*1.5)+'px','height': ($text_height+$padding)+'px'});
4239						$that.find('> a').css({'height': ($text_height+$padding)+'px'});
4240
4241						$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));
4242
4243						$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.6)/2 +' ' + (($text_height+$padding) / $vert_height_divider) +')');
4244
4245						$that.find('.front-3d ').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
4246						$that.find('.back-3d').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
4247
4248					}
4249				});
4250			}
4251			createExtraJumboSize();
4252			$(window).on('smartresize',createExtraJumboSize);
4253
4254			var head = document.head || document.getElementsByTagName('head')[0];
4255				var style = document.createElement('style');
4256
4257				style.type = 'text/css';
4258			if (style.styleSheet){
4259			  style.styleSheet.cssText = $3dTransButtonCssString;
4260			} else {
4261			  style.appendChild(document.createTextNode($3dTransButtonCssString));
4262			}
4263
4264			head.appendChild(style);
4265		}
4266
4267		//gradient btn init
4268		setTimeout(function(){
4269			$('.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');
4270		},150);
4271		//no grad for ff
4272		if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1 || navigator.userAgent.indexOf("MSIE ") > -1 || navigator.userAgent.match(/Trident\/7\./)) {
4273			$('.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');
4274		}
4275	}	
4276
4277	coloredButtons();
4278
4279
4280	//large icon hover
4281	function largeIconHover(){
4282		$('.icon-3x').each(function(){
4283			
4284			$(this).closest('.col').on('mouseenter',function(){
4285				$(this).find('.icon-3x').addClass('hovered')
4286			});
4287			$(this).closest('.col').on('mouseleave',function(){
4288				$(this).find('.icon-3x').removeClass('hovered')
4289			});
4290			
4291		});
4292
4293		//remove gradient from FF
4294		if( navigator.userAgent.indexOf("MSIE ") > -1 || navigator.userAgent.match(/Trident\/7\./))
4295			$('[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');
4296	}
4297	largeIconHover();
4298
4299
4300/***************** Team Member ******************/
4301function teamMemberFullscreen() {
4302
4303	//open
4304	$('body').on('click','.team-member[data-style="bio_fullscreen"]',function(){
4305		
4306		if($('.nectar_team_member_overlay').length > 0) return;
4307
4308		var $usingBoxedClass = ($('body > #boxed').length > 0) ? 'in-boxed' : null;
4309
4310		$teamMemberMeta = $(this).find('.nectar_team_bio').html();
4311		$teamMemberImg = ($(this).find('.nectar_team_bio_img[data-img-src]').length > 0) ? $(this).find('.nectar_team_bio_img').attr('data-img-src') : '';
4312		$('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>');
4313		if($teamMemberImg.length > 0) {
4314
4315			//fadein img on load
4316			var teamTmpImg = new Image();
4317			teamTmpImg.src = $teamMemberImg;
4318		    teamTmpImg.onload = function() {
4319		        $('.nectar_team_member_overlay .team_member_image').css('opacity','1');
4320		    };
4321			$('.nectar_team_member_overlay .team_member_image').css({ 'background-image': 'url("'+$teamMemberImg+'")'});
4322		}
4323		
4324		
4325		var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').height();
4326		$('.nectar_team_member_overlay .inner-wrap').css({ 'padding-top': $headerNavSpace });
4327		
4328		//no-scroll class - ios ready
4329		if($('.using-mobile-browser').length > 0) {
4330			$('body,html').addClass('nectar-no-scrolling');
4331		}
4332		
4333		teamFullscreenResize();
4334
4335		//transition in
4336		$('.nectar_team_member_overlay').addClass('open').addClass('animating');
4337
4338		setTimeout(function(){
4339			$('.nectar_team_member_close').addClass('visible');
4340			$('.nectar_team_member_overlay').removeClass('animating');
4341		},500);
4342
4343		//bind close mousemove
4344		$(document).on('mousemove',teamMousemoveOn);
4345
4346		//bind overflow
4347		if($('.using-mobile-browser').length == 0) {
4348			fullscreenBioScrolling();
4349		}
4350
4351		if($('.team-member[data-style="bio_fullscreen"]').length > 0 && navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) { 
4352			$('.nectar_team_member_overlay').addClass('on-mobile');
4353		}
4354
4355	});
4356
4357	//close
4358	$('body').on('click','.nectar_team_member_overlay',function(){
4359		if(!$(this).hasClass('animating')) {
4360
4361			$('.nectar_team_member_overlay').removeClass('open');
4362			$('.nectar_team_member_close').removeClass('visible');
4363			
4364			if($('.using-mobile-browser').length > 0) {
4365				$('body,html').removeClass('nectar-no-scrolling');
4366			}
4367			
4368			setTimeout(function(){
4369				
4370				//unbind close mousemove
4371				$(document).off('mousemove',teamMousemoveOn);
4372
4373				$('.nectar_team_member_overlay, .nectar_team_member_close').remove();
4374
4375			},820);
4376		}
4377	});
4378
4379	if($('.team-member[data-style="bio_fullscreen"]').length > 0) {
4380		$(window).resize(teamFullscreenResize);
4381	}
4382
4383	
4384}
4385
4386function teamFullscreenResize() {
4387	var $leftHeaderSize = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 275 : 0;
4388	$('.nectar_team_member_overlay').css({'width' : $(window).width()-$leftHeaderSize, 'left': $leftHeaderSize});
4389}
4390
4391function fullscreenBioScrolling(){ 
4392	$('.nectar_team_member_overlay .inner-wrap').mousewheel(function(event, delta) {
4393
4394	     this.scrollTop -= (delta * 30);
4395	     event.preventDefault();
4396
4397	});
4398
4399}
4400
4401function teamMousemoveOn(e) {
4402	
4403	if($('a:hover').length > 0) {
4404		$('.nectar_team_member_close .inner').removeClass('visible');
4405	} else {
4406		$('.nectar_team_member_close .inner').addClass('visible');
4407	}
4408    $('.nectar_team_member_close').css({
4409       left:  e.pageX - 26,
4410       top:   e.pageY - $(window).scrollTop() - 29
4411    });
4412}
4413
4414if($('.team-member').length > 0) {
4415	teamMemberFullscreen();
4416}
4417
4418/***************** Column Hover BG ******************/
4419
4420function columnBGColors() {	
4421	
4422	var $columnColorCSS = '';
4423
4424	$('.wpb_column').each(function(i){
4425		
4426		$(this).removeClass(function (index, className) {
4427		    return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
4428		});
4429		
4430		$(this).addClass('instance-'+i);
4431
4432		//bg color
4433		if($(this).attr('data-has-bg-color') == 'true') {
4434			if($(this).is('[data-animation*="reveal"]') && $(this).hasClass('has-animation')) {
4435				$columnColorCSS += '.wpb_column.instance-'+i+ ' > .column-bg-overlay { background-color:' + $(this).attr('data-bg-color') + ';  opacity: '+$(this).attr('data-bg-opacity')+'; }';
4436			}
4437			else {
4438				$columnColorCSS += '.wpb_column.instance-'+i+ ' > .column-bg-overlay{ background-color:' + $(this).attr('data-bg-color') + ';  opacity: '+$(this).attr('data-bg-opacity')+'; }';
4439			}
4440		}
4441
4442		//hover bg color
4443		if($(this).is('[data-hover-bg^="#"]')) {
4444			if($(this).is('[data-animation*="reveal"]') && $(this).hasClass('has-animation')) {
4445				 $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; }';
4446			}
4447			else {
4448	   		 $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; }';
4449			}
4450
4451		}
4452	});
4453	
4454	if($('head #column-bg-colors').length > 0) {
4455		$('head #column-bg-colors').remove();
4456	}
4457	if($columnColorCSS.length > 1) {
4458		var head = document.head || document.getElementsByTagName('head')[0];
4459		var style = document.createElement('style');
4460
4461		style.type = 'text/css';
4462		if (style.styleSheet){
4463		  style.styleSheet.cssText = $columnColorCSS;
4464		} else {
4465		  style.appendChild(document.createTextNode($columnColorCSS));
4466		}
4467		
4468		$(style).attr('id','column-bg-colors');
4469		head.appendChild(style);
4470	}
4471
4472}
4473columnBGColors();
4474
4475
4476
4477
4478
4479
4480/***************** morphing button ******************/
4481
4482function morphingOutlines() {
4483
4484	if($('.morphing-outline').length > 0) {
4485
4486		$morphingOutlineCSS = '';
4487		var $frontEndEditorMOSelector =  ($('body.vc_editor').length > 0) ? '' : '>';
4488		
4489		$('.morphing-outline').each(function(i){
4490			
4491			$(this).removeClass(function (index, className) {
4492			    return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
4493			});
4494			
4495			$(this).addClass('instance-'+i).css({'visibility':'visible'});
4496			var $width = $(this).find('.inner').width();
4497			var $height = $(this).find('.inner').height();
4498			var $border = parseInt($(this).attr("data-border-thickness"));
4499			var $hover = ($('body[data-button-style*="rounded"]').length > 0) ? ':hover': '';
4500			var $hover2 = ($('body[data-button-style*="rounded"]').length > 0) ? '': ':hover';
4501
4502			$morphingOutlineCSS += 'body .morphing-outline.instance-'+i+' .inner > * { color: '+$(this).attr("data-starting-color")+'; } ';
4503			$morphingOutlineCSS += 'body .morphing-outline.instance-'+i+' .inner:after  { border-width:'+$(this).attr("data-border-thickness")+'px ; border-color: '+$(this).attr("data-starting-color")+'; } ';
4504			
4505			$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")+'; } ';
4506			$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")+'; } ';
4507			//padding calcs
4508			$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}';
4509			$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
4510			$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 }';
4511
4512			$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 }';
4513			////hover
4514			$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}';
4515			$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 }';
4516
4517		});
4518
4519		var head = document.head || document.getElementsByTagName('head')[0];
4520		var style = document.createElement('style');
4521
4522		style.type = 'text/css';
4523		style.id = 'morphing-outlines';
4524		if (style.styleSheet){
4525		  style.styleSheet.cssText = $morphingOutlineCSS;
4526		} else {
4527		  style.appendChild(document.createTextNode($morphingOutlineCSS));
4528		}
4529
4530		$('#morphing-outlines').remove();
4531		head.appendChild(style);
4532	}
4533}
4534
4535setTimeout(morphingOutlines,100); 
4536setTimeout(fullWidthContentColumns,126);
4537
4538
4539/***************** svg icons *******************/
4540
4541var $svg_icons = [];
4542function svgAnimations() {
4543	
4544	var $svgOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
4545
4546	if($svg_icons.length == 0) {
4547
4548		$('.svg-icon-holder:not(.animated-in)').has('svg').each(function(i){
4549			var $that = $(this);
4550
4551			if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) $that.attr('data-animation','false');
4552
4553			//size
4554			$that.find('svg').css({'height': parseInt($that.attr('data-size')) +'px', 'width': parseInt($that.attr('data-size')) +'px'});
4555
4556			//animation
4557			$(this).find('svg').attr('id','nectar-svg-animation-instance-'+i);
4558			var $animationSpeed = ($that.is('[data-animation-speed]') && $that.attr('data-animation-speed').length > 0) ? $that.attr('data-animation-speed') : 200;
4559			if($that.attr('data-animation') == 'false') { 
4560				$animationSpeed = 1;
4561				$that.css('opacity','1');
4562			}
4563
4564			if(!$that.hasClass('bound')) {
4565				$svg_icons[i] = new Vivus($that.find('svg').attr('id'), {type: 'delayed', pathTimingFunction: Vivus.EASE_OUT, animTimingFunction: Vivus.LINEAR, duration: $animationSpeed, onReady: svgInit });
4566			}
4567
4568			if($animationSpeed !== 1) {
4569
4570				var $that = $(this);
4571				var waypoint = new Waypoint({
4572		 			element: $that,
4573		 			 handler: function(direction) {
4574		 			 	if( $that.hasClass('animated-in')) { 
4575						     waypoint.destroy();
4576						     return;
4577						}
4578
4579		 			 	checkIfReady();
4580						$that.addClass('animated-in');
4581						waypoint.destroy();
4582					},
4583					offset: $svgOffsetPos
4584
4585				}); 
4586
4587			} else {
4588				checkIfReady();
4589			}
4590
4591			function checkIfReady() {
4592				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;
4593				
4594				var $iconID = $that.find('svg').attr('id').replace(/[^0-9]/g,'');
4595
4596				if($svg_icons[$iconID].isReady == true) {
4597					 setTimeout(function(){ $that.css('opacity','1'); $svg_icons[$iconID].reset().play(); },$animationDelay);
4598				} else {
4599					setTimeout(checkIfReady,50);
4600				}
4601			}
4602
4603			function svgInit() {
4604
4605				//set size
4606				$that.css({'height': parseInt($that.attr('data-size')) +'px', 'width': parseInt($that.attr('data-size')) +'px'});
4607
4608
4609			}
4610
4611			$that.addClass('bound');
4612
4613		});	
4614	} else {
4615		$('.svg-icon-holder').addClass('animated-in').css('opacity','1');
4616	}
4617	
4618	//full vc row support
4619	$('#nectar_fullscreen_rows .svg-icon-holder.animated-in').has('svg').each(function(i){
4620		
4621		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;
4622		var $that = $(this);
4623
4624		var $iconID = $that.find('svg').attr('id').replace(/[^0-9]/g,'');
4625
4626		clearTimeout($animatedSVGIconTimeout[i]);
4627
4628		if($that.attr('data-animation') == 'false') { 
4629			$animationSpeed = 1;
4630			$that.css('opacity','1');
4631			$svg_icons[$iconID].finish();
4632		} else {
4633			if($(this).parents('.active').length > 0 || $(this).parents('#footer-outer').length > 0 || $('body.mobile').length > 0) {
4634				$svg_icons[$iconID].reset();
4635				$animatedSVGIconTimeout[i] = setTimeout(function(){ $svg_icons[$iconID].play(); },$animationDelay);
4636			}
4637
4638			else {
4639				$svg_icons[$iconID].reset().stop();
4640			}
4641		}
4642	});
4643}
4644//svg in equal height column resize
4645if($('.vc_row-o-equal-height .svg-icon-holder[data-animation="true"]').length > 0 && $('#nectar_fullscreen_rows').length == 0) {
4646	 $(window).on('smartresize', function(){
4647	    clearTimeout($svgResizeTimeout);
4648	    $svgResizeTimeout = setTimeout(function(){ 
4649
4650	    	if($svg_icons.length > 0) {
4651	        	$('.svg-icon-holder.animated-in').each(function(i){
4652					$(this).css('opacity','1');
4653					var $iconID = $(this).attr('id').replace(/[^0-9]/g,'');
4654					$svg_icons[$iconID].finish();
4655				});
4656	        }
4657
4658	     },300);
4659	});
4660}
4661
4662
4663/***************** fancy ul ******************/
4664
4665	function nectar_fancy_ul_init() {
4666		$($fullscreenSelector+'.nectar-fancy-ul').each(function(){
4667
4668
4669			var $icon = $(this).attr('data-list-icon');
4670			var $color = $(this).attr('data-color');
4671			var $animation = $(this).attr('data-animation');
4672			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;
4673			
4674			$(this).find('li').each(function(){
4675				
4676				if($(this).find('> i').length == 0) 
4677					$(this).prepend('<i class="icon-default-style '+$icon+ ' ' + $color +'"></i> ');
4678			});
4679
4680			
4681			if($animation == 'true') {
4682
4683
4684				var $that = $(this);
4685				var waypoint = new Waypoint({
4686		 			element: $that,
4687		 			 handler: function(direction) {
4688
4689		 			 	if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
4690						     waypoint.destroy();
4691						     return;
4692						}
4693
4694						setTimeout(function(){
4695			 			 	$that.find('li').each(function(i){
4696			 			 		var $that = $(this);
4697								$that.delay(i*220).transition({
4698									'opacity': '1',
4699									'left' : '0'
4700								},220,'easeOutCubic');
4701							});
4702			 			 },$animationDelay);
4703
4704						$that.addClass('animated-in');
4705						waypoint.destroy();
4706					},
4707					offset: 'bottom-in-view'
4708
4709				}); 
4710
4711			} 
4712			
4713			
4714			
4715		});
4716	}
4717
4718
4719	
4720
4721/***************** flip box min heights ******************/
4722//if content height exceeds min height change it
4723function flipBoxHeights() {
4724	$('.nectar-flip-box').each(function(){
4725		
4726		var $flipBoxMinHeight = parseInt($(this).attr('data-min-height'));
4727		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();
4728
4729		if($flipBoxHeight >= $flipBoxMinHeight - 80) {
4730			$(this).find('> div').css('height', $flipBoxHeight + 80);
4731		} else 
4732			$(this).find('> div').css('height','auto');
4733
4734	});
4735}
4736flipBoxHeights();
4737
4738if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
4739	$('body').on('click','.nectar-flip-box', function(){
4740		$(this).toggleClass('flipped');
4741	});
4742}
4743
4744/***************** PARALLAX SECTIONS ******************/
4745	
4746	var $window = $(window);
4747	var windowHeight = $window.height();
4748
4749		
4750	$window.off('scroll.parallaxSections').off('resize.parallaxSections');
4751	$window.unbind('resize.parallaxSectionsUpdateHeight');
4752	$window.unbind('load.parallaxSectionsOffsetL');
4753	$window.unbind('resize.parallaxSectionsOffsetR');
4754
4755	$window.on('resize.parallaxSectionsUpdateHeight',psUpdateWindowHeight);
4756
4757	function psUpdateWindowHeight() {
4758		windowHeight = $window.height();
4759	}
4760
4761	function psUpdateOffset($this) {
4762		$this.each(function(){
4763	  	    firstTop = $this.offset().top;
4764		});
4765	}
4766	
4767	var firstTop;
4768	
4769	$.fn.parallaxScroll = function(xpos, speedFactor, outerHeight) {
4770		var $this = $(this);
4771		var getHeight;
4772		var paddingTop = 0;
4773		
4774		var $windowDOMWidth = window.innerWidth, $windowDOMHeight = window.innerHeight;
4775		var $orientationChange = 0;
4776		
4777		//get the starting position of each element to have parallax applied to it		
4778		$this.each(function(){
4779		    firstTop = $this.offset().top;
4780		});
4781
4782		
4783		$window.on('resize.parallaxSectionsOffsetR',psUpdateOffset($this));
4784		$window.on('load.parallaxSectionsOffsetL',psUpdateOffset($this));
4785	
4786		getHeight = function(jqo) {
4787			return jqo.outerHeight(true);
4788		};
4789		 
4790			
4791		// setup defaults if arguments aren't specified
4792		if (arguments.length < 1 || xpos === null) xpos = "50%";
4793		if (arguments.length < 2 || speedFactor === null) speedFactor = 0.25;
4794		if (arguments.length < 3 || outerHeight === null) outerHeight = true;
4795		
4796		// function to be called whenever the window is scrolled or resized
4797
4798		var $element, top, height;
4799		
4800		var ua = window.navigator.userAgent;
4801		var msie = ua.indexOf("MSIE ");
4802		var $onMobileBrowser = navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/);		
4803		
4804		var $toTransformOrNot = ($smoothCache == true) ? true : false;
4805		
4806		if(!$toTransformOrNot) {
4807			$this.find('.row-bg.using-image, .page-header-bg-image, .image-bg, .video-wrap').addClass('translate');
4808		}
4809		
4810		var $ifFast = 0;
4811		$element = $this;
4812		
4813		height = getHeight($element);
4814		
4815		var classic_mobile_menu_open = false;
4816		
4817		setInterval(function(){
4818			height = getHeight($element);
4819			
4820			classic_mobile_menu_open = ( $('body.classic_mobile_menu_open.mobile').length > 0 ) ? true : false;
4821			
4822		},600);
4823		
4824		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;
4825		
4826		//for first nectar slider shortcode without page builder or portfolio first
4827		if( $('.wpb_row').length == 0 && $element.parents('.parallax_slider_outer').length > 0 && $element.is('[data-full-width="true"]') ||
4828	      ($('#portfolio-extra').length > 0 && $element.parents('.parallax_slider_outer').length > 0 && $element.parents('.wpb_row').length > 0 && $element.parents('.wpb_row').index() == '0') ) {
4829			firstSection = true;
4830		}
4831		
4832		if(nectarDOMInfo.usingFrontEndEditor) {
4833			firstSection = false;
4834		}
4835		
4836		var nectarSliderElBool = $this.is('.nectar-slider-wrap');
4837		var pageHeaderBool = ($this.find('.page-header-bg-image').length > 0) ? true : false;
4838		
4839		var $elToParallax = false;
4840		
4841		if(nectarSliderElBool) {
4842			
4843				if($this.find('.video-wrap').length > 0 || $this.find('.image-bg').length > 0) {
4844					$elToParallax = $this.find('.video-wrap, .image-bg');
4845				} 
4846		}
4847		else {
4848			
4849				if($this.find('.row-bg.using-image').length > 0) {
4850					
4851					$elToParallax = $this.find('.row-bg.using-image');
4852					
4853				} else if($this.find('.page-header-bg-image').length > 0) {
4854					
4855					$elToParallax = $this.find('.page-header-bg-image');
4856				}
4857				
4858		}
4859		
4860
4861		function update(){
4862				
4863				firstTop = $element.offset().top;
4864				
4865				// Check if totally above or totally below viewport
4866				if ($elToParallax == false || firstTop + height < nectarDOMInfo.scrollTop || firstTop > nectarDOMInfo.scrollTop + windowHeight || $('body.material-ocm-open').length > 0) {
4867					
4868				} else {
4869
4870		        //for IE, Safari or any setup using the styled scrollbar default to animating the BG pos
4871		        if ($toTransformOrNot) {
4872		        	$this.find('.row-bg.using-image').css('backgroundPosition', xpos + " " + Math.round((firstTop - nectarDOMInfo.scrollTop) * speedFactor) + "px");
4873		        }
4874		       	//for Firefox/Chrome use a higher performing method
4875		        else  {
4876							
4877							//nectar slider
4878							if(nectarSliderElBool) {
4879									
4880								 if(firstSection) {
4881									 //top level row
4882 										if(!classic_mobile_menu_open) {
4883									 		$this.find('.video-wrap, .image-bg').css({ 'transform':  'translate3d(0, ' + parseFloat(nectarDOMInfo.scrollTop * speedFactor)  + 'px, 0)' }); 
4884									  }
4885								 } else {
4886									 	$this.find('.video-wrap, .image-bg').css({ 'transform':  'translate3d(0, ' + parseFloat((($windowDOMHeight + nectarDOMInfo.scrollTop -  firstTop) * speedFactor) ) + 'px, 0)' }); 
4887								 }
4888								
4889							} else {
4890								
4891								//rows
4892								if(firstSection) {
4893									//top level row
4894									if(!classic_mobile_menu_open) {
4895		        				$elToParallax.css({ 'transform':  'translate3d(0, ' + parseFloat(nectarDOMInfo.scrollTop * speedFactor)  + 'px, 0)' });
4896									}
4897								} else {
4898									//regular rows
4899									$elToParallax.css({ 'transform':  'translate3d(0, ' + parseFloat((($windowDOMHeight + nectarDOMInfo.scrollTop -  firstTop) * speedFactor) ) + 'px, 0), scale(1.005)' });
4900								}
4901								
4902								//page header
4903								if(pageHeaderBool && !classic_mobile_menu_open) {
4904									$elToParallax.css({ 'transform':  'translate3d(0, ' + parseFloat(nectarDOMInfo.scrollTop * speedFactor) + 'px, 0)' });
4905								}
4906							
4907							}
4908							
4909						} 
4910				
4911				}
4912				
4913
4914			//if on mobile, auto RAF
4915			if($onMobileBrowser){
4916				requestAnimationFrame(update); 
4917			}
4918			
4919		}		
4920
4921		if (window.addEventListener) {
4922			
4923			if(nectarDOMInfo.usingFrontEndEditor) {
4924				$(window).on('scroll.parallaxSections', update);
4925				
4926				$(window).resize(function(){
4927					$windowDOMWidth = window.innerWidth;
4928					$windowDOMHeight = window.innerHeight;
4929				});
4930				
4931			}
4932			else if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
4933					 window.addEventListener('scroll', function(){ 
4934			          requestAnimationFrame(update); 
4935			     }, false);
4936					 
4937					 $(window).resize(function(){
4938						 $windowDOMWidth = window.innerWidth;
4939						 $windowDOMHeight = window.innerHeight;
4940					 });
4941					 
4942			 } else {
4943				 	//if on mobile, auto RAF
4944					requestAnimationFrame(update); 
4945					
4946
4947					window.addEventListener("orientationchange", function() {
4948						 $orientationChange = 1;
4949					});
4950					
4951					$(window).resize(function(){
4952							if( ($(window).width() != $windowDOMWidth && $(window).height != $windowDOMHeight) || $orientationChange == 1){
4953
4954									//store the current window dimensions
4955									$windowDOMWidth = window.innerWidth;
4956									$windowDOMHeight = window.innerHeight;
4957									
4958									$orientationChange = 0;
4959							}
4960					});
4961					 
4962			 }
4963			 
4964		}
4965
4966		$window.on('resize.parallaxSections',update);
4967
4968		update();
4969	};
4970
4971 
4972
4973	
4974/***************** Full Width Section ******************/
4975
4976	//nectar slider in container but fullwidth fix
4977	$('.wpb_row .vc_col-sm-12 .nectar-slider-wrap[data-full-width="true"]').each(function(){
4978		if($(this).parents('.wpb_row.full-width-section').length == 0 && $(this).parents('.wpb_row.full-width-content').length == 0) {
4979			$(this).parents('.wpb_row').addClass('full-width-section');
4980		}
4981	});
4982
4983	function fullWidthSections(){
4984
4985		var $windowInnerWidth = window.innerWidth;
4986		var $scrollBar = ($('#ascrail2000').length > 0 && $windowInnerWidth > 1000) ? -13 : 0;
4987		var $bodyBorderWidth = ($('.body-border-right').length > 0 && $windowInnerWidth > 1000) ? parseInt($('.body-border-right').width())*2 : 0;
4988		var $justOutOfSight;
4989		
4990		if($('#boxed').length == 1){
4991			$justOutOfSight = ((parseInt($('.container-wrap').width()) - parseInt($('.main-content').width())) / 2) + 4;
4992		} else {
4993			
4994			//if the ext responsive mode is on - add the extra padding into the calcs
4995			var $extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && $windowInnerWidth >= 1000) ? 180 : 0;
4996			var $leftHeaderSize = ($('#header-outer[data-format="left-header"]').length > 0 && $windowInnerWidth >= 1000) ? parseInt($('#header-outer[data-format="left-header"]').width()) : 0;
4997			if($(window).width() - $leftHeaderSize - $bodyBorderWidth  <= parseInt($('.main-content').css('max-width'))) { 
4998				var $windowWidth = parseInt($('.main-content').css('max-width'));
4999
5000				//no need for the scrollbar calcs with ext responsive on desktop views
5001				if($extResponsivePadding == 180) $windowWidth = $windowWidth - $scrollBar;
5002
5003			} else { 
5004				var $windowWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth;
5005			}
5006
5007			
5008			var $contentWidth = parseInt($('.main-content').css('max-width'));
5009
5010			//single post fullwidth
5011			if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 ) {
5012				$contentWidth = $('.post-area').width();
5013				$extResponsivePadding = 0;
5014			}
5015			
5016			$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
5017		}
5018		
5019	
5020	    //full width content sections
5021	    $('.carousel-outer').has('.carousel-wrap[data-full-width="true"]').css('overflow','visible');
5022	    
5023	    $('.carousel-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"]:not(.fullwidth-constrained), .full-width-content').each(function(){
5024			
5025			var $leftHeaderSize = ($('#header-outer[data-format="left-header"]').length > 0 && $windowInnerWidth >= 1000) ? parseInt($('#header-outer[data-format="left-header"]').width()) : 0;
5026			var $bodyBorderWidth = ($('.body-border-right').length > 0 && $windowInnerWidth > 1000) ? (parseInt($('.body-border-right').width())*2) - 2 : 0;
5027
5028			//single post fullwidth
5029			if($('#boxed').length == 1){
5030
5031				var $mainContentWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').width()) : parseInt($(this).parents('.container').width());
5032
5033				if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 && $(this).parents('.post-area').length > 0) {
5034					$contentWidth = $('.post-area').width();
5035					$extResponsivePadding = 0;
5036					$windowWidth = $(window).width() - $bodyBorderWidth;
5037					$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
5038				} else {
5039					if($(this).parents('.page-submenu').length > 0)
5040						$justOutOfSight = ((parseInt($('.container-wrap').width()) - $mainContentWidth) / 2);
5041					else 
5042						$justOutOfSight = ((parseInt($('.container-wrap').width()) - $mainContentWidth) / 2) + 4;
5043				}
5044			} else {
5045				if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 && $(this).parents('.post-area').length > 0) {
5046					$contentWidth = $('.post-area').width();
5047					$extResponsivePadding = 0;
5048					$windowWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth;
5049				} else {
5050
5051					var $mainContentMaxWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').css('max-width')) : parseInt($(this).parents('.container').css('max-width'));
5052
5053					//when using gutter on portfolio don't add extra space for scroll bar
5054			    	if($('#boxed').length == 0 && $(this).hasClass('portfolio-items') && $(this).is('[data-gutter*="px"]') && $(this).attr('data-gutter').length > 0 && $(this).attr('data-gutter') != 'none') {
5055			    		$scrollBar = ($('#ascrail2000').length > 0 && $windowInnerWidth > 1000) ? -13 : 0;
5056			    	}
5057
5058					if($(window).width() - $leftHeaderSize - $bodyBorderWidth <= $mainContentMaxWidth) { 
5059						$windowWidth = $mainContentMaxWidth;
5060						//no need for the scrollbar calcs with ext responsive on desktop views
5061						if($extResponsivePadding == 180) $windowWidth = $windowWidth - $scrollBar;
5062					}
5063					$contentWidth = $mainContentMaxWidth;
5064					$extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1000) ? 180 : 0;
5065					if($leftHeaderSize > 0) $extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1000) ? 120 : 0;
5066				}
5067
5068				$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
5069			}
5070
5071			var $extraSpace = 0;
5072			if( $(this).hasClass('carousel-wrap')) $extraSpace = 1;
5073			if( $(this).hasClass('portfolio-items')) $extraSpace = 5;
5074			
5075	    	var $carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : $(window).width() - $leftHeaderSize - $bodyBorderWidth +$extraSpace  + $scrollBar ;
5076
5077	    	//when using gutter on portfolio don't add extra space
5078	    	if($('#boxed').length == 0 && $(this).hasClass('portfolio-items') && $(this).is('[data-gutter*="px"]') && $(this).attr('data-gutter').length > 0 && $(this).attr('data-gutter') != 'none') {
5079	    		if($(window).width() > 1000)
5080	    			$carouselWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth + $scrollBar + 3
5081	    		else 
5082	    			$carouselWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth + $scrollBar 
5083	    	}
5084
5085	    	if($(this).parent().hasClass('default-style')) { 
5086
5087	    		var $mainContentWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').width()) : parseInt($(this).parents('.container').width());
5088	    		
5089	    		if($('#boxed').length != 0) {
5090	    			$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : $(window).width() - $leftHeaderSize + $extraSpace + $scrollBar ;
5091				}
5092				else {
5093					$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : ($(window).width() - $leftHeaderSize - $bodyBorderWidth) - (($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.025) + $extraSpace + $scrollBar ;
5094					$windowWidth = ($(window).width() - $leftHeaderSize - $bodyBorderWidth <= $mainContentWidth) ? $mainContentWidth : ($(window).width() - $leftHeaderSize - $bodyBorderWidth) - (($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.025);
5095					$justOutOfSight = Math.ceil( (($windowWidth + $scrollBar - $mainContentWidth) / 2) )
5096				}
5097			}
5098
5099			else if($(this).parent().hasClass('spaced')) { 
5100
5101				var $mainContentWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').width()) : parseInt($(this).parents('.container').width());
5102
5103				if($('#boxed').length != 0) {
5104	    			$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) - ($(window).width()*.02) : $(window).width() + $extraSpace + $scrollBar ;
5105				} else {
5106					$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : ($(window).width()- $leftHeaderSize - $bodyBorderWidth)  - Math.ceil(($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.02) + $extraSpace + $scrollBar ;
5107					var $windowWidth2 = ($(window).width() - $leftHeaderSize - $bodyBorderWidth <= $mainContentWidth) ? $mainContentWidth : ($(window).width() - $leftHeaderSize - $bodyBorderWidth) - (($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.02);
5108					$justOutOfSight = Math.ceil( (($windowWidth2 + $scrollBar - $mainContentWidth) / 2) +2)
5109				}
5110			}
5111	    	
5112	    	if(!$(this).parents('.span_9').length > 0 && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner' && $(this).parent().attr('id') != 'portfolio-extra' 
5113	      && !$(this).find('.carousel-wrap[data-full-width="true"]').length > 0
5114				&& !$(this).find('.nectar-carousel-flickity-fixed-content').length > 0
5115	    	&& !$(this).find('.portfolio-items:not(".carousel")[data-col-num="elastic"]').length > 0){
5116
5117	    		//escape if inside woocoommerce page and not using applicable layout
5118	    		if($('.single-product').length > 0 && $(this).parents('#tab-description').length > 0 && $(this).parents('.full-width-tabs').length == 0) {
5119	    			$(this).css({
5120						'visibility': 'visible'
5121					});	
5122	    		} else {
5123	    			if($(this).hasClass('portfolio-items')) {
5124		    				$(this).css({
5125								'transform': 'translateX(-'+ $justOutOfSight + 'px)',
5126								'margin-left': 0,
5127								'left': 0,
5128								'width': $carouselWidth,
5129								'visibility': 'visible'
5130							});	
5131	    			} else {
5132							
5133							//fullscreen page rows left fix
5134							if($('#nectar_fullscreen_rows').length > 0 && $(this).hasClass('wpb_row')) {
5135								$(this).css({
5136									'margin-left': - $justOutOfSight,
5137									'width': $carouselWidth,
5138									'visibility': 'visible'
5139								});	
5140							} else {
5141								$(this).css({
5142									'left': 0,
5143									'margin-left': - $justOutOfSight,
5144									'width': $carouselWidth,
5145									'visibility': 'visible'
5146								});	
5147							}
5148							
5149	    			}
5150					
5151				}
5152			}  else if($(this).parent().attr('id') == 'portfolio-extra' && $('#full_width_portfolio').length != 0) {
5153				$(this).css({
5154					'left': 0,
5155					'margin-left': - $justOutOfSight,
5156					'width': $carouselWidth,
5157					'visibility': 'visible'
5158				});	
5159			}
5160			
5161			else {
5162
5163				$(this).css({
5164					'margin-left': 0,
5165					'width': 'auto',
5166					'left': '0',
5167					'visibility': 'visible'
5168				});	
5169			}
5170	    	
5171	    });
5172			
5173	}
5174	
5175	var $contentElementsNum = ($('#portfolio-extra').length == 0) ? $('.main-content > .row > *').length : $('.main-content > .row #portfolio-extra > *').length ;
5176
5177	function parallaxSrollSpeed(speedString) {
5178
5179		var ua = window.navigator.userAgent;	
5180		var msie = ua.indexOf("MSIE ");
5181		var speed;
5182
5183		 //not as modern browsers
5184		 if ($smoothCache == true) {
5185			 switch(speedString) {
5186			   	  case 'slow':
5187			   	      speed = 0.2;
5188			   	      break;
5189			   	  case 'medium': 
5190			   	  	  speed = 0.4;
5191			   	      break;
5192			   	  case 'fast': 
5193			    	  speed = 0.6;
5194			   	       break;
5195			   }
5196		}
5197		 //chrome/ff
5198		 else {
5199		 	 switch(speedString) {
5200			   	  case 'slow':
5201			   	      speed = 0.6;
5202			   	      break;
5203			   	  case 'medium': 
5204			   	  	  speed = 0.4;
5205			   	      break;
5206			   	  case 'fast': 
5207			    	  speed = 0.25;
5208			   	       break;
5209			   }
5210		}
5211
5212		   return speed;
5213	}
5214
5215	function parallaxScrollInit(){
5216		
5217		if(nectarDOMInfo.usingMobileBrowser && $('body[data-remove-m-parallax="1"]').length > 0) {
5218			return;
5219		}
5220		
5221		parallaxRowsBGCals();
5222		
5223		$('.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(){
5224		   var $id = $(this).attr('id');	
5225
5226		    var ua = window.navigator.userAgent;	
5227		    var msie = ua.indexOf("MSIE ");
5228
5229			if ($smoothCache == true)  {
5230				
5231		   		if($(this).find('[data-parallax-speed="fixed"]').length == 0) { 
5232						
5233							if($(this).find('.row-bg').length == 0) {
5234								$('#'+$id).parallaxScroll("50%", 0.25);
5235							} else {
5236								$('#'+$id + ".parallax_section").parallaxScroll("50%", parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')) );
5237							}
5238					}
5239					
5240		  } else if($(this).find('[data-parallax-speed="fixed"]').length == 0) {
5241				
5242					if($(this).find('.row-bg').length == 0) {
5243							//set default scroll speed if not defined
5244							$('#'+$id).parallaxScroll("50%", 0.25);
5245					} else {
5246							$('#'+$id + ".parallax_section").parallaxScroll("50%", parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')) );
5247					}
5248		  }
5249			
5250			$(this).addClass('nectar-parallax-enabled');
5251			
5252		});
5253		
5254	}
5255	
5256	
5257	
5258	//add first class for rows for page header trans effect (zoom only as of now)
5259	$('.full-width-section.wpb_row, .full-width-content.wpb_row').each(function(){
5260		
5261		if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){
5262			
5263			
5264			if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false;
5265				
5266			if($(this).index() == '0' && $('#page-header-bg').length == 0 && $('.page-header-no-bg').length == 0 
5267							 && $('.project-title').length == 0 && $('body.single').length == 0 
5268							 && $('.project-title').length == 0 ) {
5269
5270				$(this).addClass('first-section');
5271				var $that = $(this);
5272				setTimeout( function() { $that.addClass('loaded'); },50);
5273				
5274			} 
5275				
5276
5277		}
5278	});	
5279	
5280	
5281	
5282
5283	parallaxScrollInit();
5284	parallaxRowsBGCals();
5285
5286	function parallaxRowsBGCals(){
5287		
5288		if(nectarDOMInfo.usingMobileBrowser && $('body[data-remove-m-parallax="1"]').length > 0) {
5289			return;
5290		}
5291
5292		$('.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(){
5293			
5294			 var ua = window.navigator.userAgent;
5295		   var msie = ua.indexOf("MSIE ");
5296
5297			 if ($smoothCache == true) {
5298			 	 $(this).find('.row-bg').css({'height': $(this).outerHeight(true)*2.8, 'margin-top': '-' + ($(this).outerHeight(true)*2.8)/2 + 'px' });
5299			 } else {
5300				 
5301				 if($(this).find('.row-bg').length == 0 && $(this).find('.page-header-bg-image').length > 0 ) {
5302					 	//$(this).find('.page-header-bg-image').css({'height': $(this).outerHeight(true)   });
5303				 } 
5304				 else if($(this).find('.row-bg').length == 0 && $(this).find('.image-bg').length > 0 ) {
5305					 	
5306						var $non_page_builder_slider = false;
5307						//for first nectar slider shortcode without page builder
5308				 		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' ) {
5309				 			$non_page_builder_slider = true;
5310				 		}
5311						//portfolio first
5312						if($('#portfolio-extra').length > 0 && $(this).parents('.wpb_row').length > 0 && $(this).parents('.parallax_slider_outer').length > 0 && $(this).parents('.wpb_row').index() == '0' ) {
5313								$non_page_builder_slider = true;
5314						}
5315					 
5316					 if($(this).parents('.top-level').length > 0 && !nectarDOMInfo.usingFrontEndEditor || $non_page_builder_slider && !nectarDOMInfo.usingFrontEndEditor) {
5317						 $(this).find('.image-bg').css({'height':  Math.ceil( $(this).parent().offset().top * 0.25 ) + $(this).outerHeight(true) });
5318					 } else {
5319						 	$(this).find('.image-bg').css({'height': Math.ceil( $(window).height() * 0.25 ) + $(this).outerHeight(true)   });
5320					 }
5321					 
5322				 }
5323				 else if($(this).find('.row-bg').length == 0 && $(this).find('.video-wrap').length > 0 ) {
5324					 
5325					 
5326					 var $non_page_builder_slider = false;
5327					 //for first nectar slider shortcode without page builder
5328					 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' ) {
5329						 $non_page_builder_slider = true;
5330					 } 
5331					 //portfolio first
5332					 if($('#portfolio-extra').length > 0 && $(this).parents('.wpb_row').length > 0 && $(this).parents('.parallax_slider_outer').length > 0 && $(this).parents('.wpb_row').index() == '0' ) {
5333							 $non_page_builder_slider = true;
5334					 }
5335					 
5336					 if($(this).parents('.top-level').length > 0 && !nectarDOMInfo.usingFrontEndEditor || $non_page_builder_slider && !nectarDOMInfo.usingFrontEndEditor) {
5337						 $(this).find('.video-wrap').css({'height': Math.ceil( $(this).parent().offset().top * 0.25 ) + $(this).outerHeight(true) });
5338					 } else {
5339						 	$(this).find('.video-wrap').css({'height': Math.ceil( $(window).height() * 0.25 ) + $(this).outerHeight(true)   });
5340					 }
5341					 
5342					 var vid = $(this).find('.video-wrap video');
5343					 var vid_w_orig = 1280;
5344					 var vid_h_orig = 720;
5345
5346					 // get the parent element size
5347					 var container_w = vid.parent().width();
5348					 var container_h = vid.parent().height();	 
5349					 var scale_w = container_w / vid_w_orig;
5350					 var scale_h = container_h / vid_h_orig;
5351					 var scale = scale_w > scale_h ? scale_w : scale_h;
5352					 
5353					 // scale the video
5354					 vid.width(scale * vid_w_orig);
5355					 vid.height(scale * vid_h_orig);
5356
5357				 }  
5358				 else {
5359					  
5360					 	if($(this).is('.nectar-recent-posts-single_featured') && $(this).parents('.top-level').length > 0 && !nectarDOMInfo.usingFrontEndEditor ) {
5361							
5362						}
5363					 	else if( !$(this).hasClass('top-level') || nectarDOMInfo.usingFrontEndEditor) {
5364							var $ifFast = ($(this).find('.row-bg[data-parallax-speed="fast"]').length > 0) ? 60 : 0;
5365						 	$(this).find('.row-bg').css({'height': Math.ceil( $(window).height() * parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')) ) + $(this).outerHeight(true) + $ifFast  });
5366						} 
5367						
5368				 }
5369			 
5370			 }
5371			 
5372		});
5373	}
5374	
5375	//if fullwidth section is first or last, remove the margins so it fits flush against header/footer
5376	function fwsClasses() {
5377		
5378		$('.wpb_wrapper > .nectar-slider-wrap[data-full-width="true"]').each(function(){
5379			if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){
5380				if($(this).parents('.wpb_row').index() == '0'){
5381					$(this).addClass('first-nectar-slider');
5382				} 
5383			}
5384		});
5385
5386		if($('#portfolio-extra').length == 0) {
5387			$contentElementsNum = ($('.main-content > .row > .wpb_row').length > 0) ? $('.main-content > .row > .wpb_row').length : $('.main-content > .row > *').length;
5388		} else {
5389			$contentElementsNum = $('.main-content > .row #portfolio-extra > *').length;
5390		}
5391
5392		$('.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(){
5393			
5394			if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){
5395				
5396				if($(this).parents('.wpb_row').length > 0){ 
5397				
5398					if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false;
5399					
5400					////first
5401					if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length != 0 ){
5402						//$(this).css('margin-top','-2.1em').addClass('first-section nder-page-header');
5403					} 
5404					else if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length == 0 && $('.page-header-no-bg').length == 0 
5405					         && $('.project-title').length == 0 && $(this).parents('.wpb_row').index() == '0' 
5406					         && $('.project-title').length == 0 
5407					         && $('body[data-bg-header="true"]').length == 0) {
5408
5409					     if($('.single').length == 0) {
5410					     	$('.container-wrap').css('padding-top','0px');
5411					     } else {
5412					     	$(this).addClass('first-section');
5413					     } 	
5414						
5415					} 
5416					
5417					//check if it's also last (i.e. the only fws)
5418					if($(this).parents('.wpb_row').index() == $contentElementsNum-1 && $('#respond').length == 0 ) { 
5419						if($(this).attr('id') != 'portfolio-filters-inline') {
5420							$('.container-wrap').css('padding-bottom','0px');
5421							$('#call-to-action .triangle').remove();
5422						}
5423					} 
5424				
5425				} else {
5426
5427					if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false;
5428					
5429					if( $(this).find('.portfolio-filters-inline').length == 0 && $(this).attr('id') != 'post-area' ) {
5430						
5431						////first
5432						if($(this).index() == '0' && $('#page-header-bg').length != 0 ){
5433							//$(this).css('margin-top','-2.1em').addClass('first-section nder-page-header');
5434			
5435						} 
5436						else if($(this).index() == '0' && $('#page-header-bg').length == 0 && $(this).index() == '0' && $('.page-header-no-bg').length == 0 && 
5437						        $(this).index() == '0' && !$(this).hasClass('blog_next_prev_buttons') && !$(this).hasClass('nectar-shop-outer') && $(this).parents('.pum-container').length == 0 ) {
5438						     
5439						      if($('body[data-header-resize="0"]').length == 1 && $('.single').length == 0 || $('body.material').length > 0 && $('.single').length == 0) { 
5440											
5441											if(!$('body.blog .blog-fullwidth-wrap > .masonry:not(.meta-overlaid)').length > 0) {
5442						          	$('.container-wrap').css('padding-top','0px');
5443											}
5444											
5445						      } else {
5446						      	  $(this).addClass('first-section');
5447						      }   	
5448							
5449						} 
5450						
5451						//check if it's also last (i.e. the only fws)
5452						if($(this).index() == $contentElementsNum-1 && $('#respond').length == 0 && $('body.woocommerce-checkout').length == 0) { 
5453							$('.container-wrap').css('padding-bottom','0px');
5454							$('.bottom_controls').css('margin-top','0px');
5455							$('#call-to-action .triangle').remove();
5456						} 
5457					}
5458					
5459				}
5460			}
5461		});
5462
5463
5464		$('#portfolio-extra > .nectar-slider-wrap[data-full-width="true"], .portfolio-wrap').each(function(){
5465			//check if it's last 
5466			if($(this).index() == $contentElementsNum-1 && $('#commentform').length == 0 && $('#pagination').length == 0) { 
5467				if(parseInt($('.container-wrap').css('padding-bottom')) > 0) $(this).css('margin-bottom','-40px');
5468				$('#call-to-action .triangle').remove();
5469			}
5470		});
5471		
5472
5473		$('.portfolio-filters').each(function(){
5474			////first
5475			if($(this).index() == '0' && $('#page-header-bg').length != 0 || $(this).index() == '0' ){
5476				$(this).addClass('first-section nder-page-header');
5477			}  else if($(this).index() == '0' && $('#page-header-bg').length == 0 || $(this).index() == '0'){
5478				$(this).css({'margin-top':'0px'}).addClass('first-section');
5479			}
5480		});
5481		
5482		$('.portfolio-filters-inline').each(function(){
5483			////first
5484			if($(this).parents('.wpb_row').length > 0){ 
5485				
5486				if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length != 0 || $(this).parents('.wpb_row').index() == '0' ){
5487					if($('body[data-header-resize="0"]').length == 0) { 
5488						//$(this).css({'margin-top':'-2.1em', 'padding-top' : '19px'}).addClass('first-section nder-page-header');
5489					}
5490				}  
5491				
5492			} else {
5493				if($(this).index() == '0' && $('#page-header-bg').length != 0 || $(this).index() == '0' ){
5494					$(this).css({'margin-top':'-2.1em', 'padding-top' : '19px'}).addClass('first-section nder-page-header');
5495				}  else if($(this).index() == '0' && $('#page-header-bg').length == 0 || $(this).index() == '0'){
5496					
5497					//if($('body[data-header-resize="0"]').length == 1 || $('body.material').length > 0) { 
5498				          $(this).css({'margin-top':'-30px', 'padding-top' : '50px'}).addClass('first-section');
5499				      //} else {
5500				      //	  $(this).css({'margin-top':'-70px', 'padding-top' : '50px'}).addClass('first-section');
5501				      //} 
5502
5503				
5504				}
5505			}
5506			
5507		});
5508		
5509
5510	}
5511	
5512
5513	//sizing for fullwidth sections that are image only
5514
5515	function fullwidthImgOnlySizingInit(){
5516		////set inital sizes
5517		$('.full-width-section:not(.custom-skip)').each(function(){
5518			
5519			var $fwsHeight = $(this).outerHeight(true);
5520
5521			//make sure it's empty and also not being used as a small dvider
5522			if($(this).find('.span_12 *').length == 0 && $.trim( $(this).find('.span_12').text() ).length == 0  && $fwsHeight > 40){
5523				$(this).addClass('bg-only');
5524				$(this).css({'height': $fwsHeight, 'padding-top': '0px', 'padding-bottom': '0px'});
5525				$(this).attr('data-image-height',$fwsHeight);
5526			}
5527
5528		});
5529	}
5530
5531	function fullwidthImgOnlySizing(){
5532
5533		$('.full-width-section.bg-only').each(function(){
5534			var $initialHeight = $(this).attr('data-image-height');
5535			
5536			if( window.innerWidth < 1000 && window.innerWidth > 690 ) {
5537				$(this).css('height', $initialHeight - $initialHeight*.60);
5538			} 
5539			
5540			else if( window.innerWidth <= 690 ) {
5541				$(this).css('height', $initialHeight - $initialHeight*.78);
5542			} 
5543			
5544			else if( window.innerWidth < 1300 && window.innerWidth >= 1000  ) {
5545				$(this).css('height', $initialHeight - $initialHeight*.33);
5546			} 
5547			
5548			else {
5549				$(this).css('height', $initialHeight);
5550			}
5551			
5552		});
5553		
5554	}
5555
5556	fullwidthImgOnlySizingInit();
5557	fullwidthImgOnlySizing();
5558	
5559	
5560	
5561	//change % padding on rows to be relative to screen
5562	function fullWidthRowPaddingAdjustInit(){
5563		if($('#boxed').length == 0){
5564			$('.full-width-section, .full-width-content').each(function(){
5565				var $topPadding = $(this)[0].style.paddingTop;
5566				var $bottomPadding = $(this)[0].style.paddingBottom;
5567
5568				if($topPadding.indexOf("%") >= 0) $(this).attr('data-top-percent',$topPadding);
5569				if($bottomPadding.indexOf("%") >= 0) $(this).attr('data-bottom-percent',$bottomPadding);
5570				
5571
5572			});
5573		}
5574	}
5575
5576	function fullWidthRowPaddingAdjustCalc(){
5577		if($('#boxed').length == 0){
5578			$('.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(){
5579
5580				var $windowHeight = $(window).width();
5581				var $topPadding = ($(this).attr('data-top-percent')) ? $(this).attr('data-top-percent') : 'skip';
5582				var $bottomPadding = ($(this).attr('data-bottom-percent')) ? $(this).attr('data-bottom-percent') : 'skip';
5583
5584				//top
5585				if($topPadding != 'skip') {
5586					$(this).css('padding-top',$windowHeight*(parseInt($topPadding)/100));
5587				}
5588
5589				//bottom
5590				if($bottomPadding != 'skip'){
5591					$(this).css('padding-bottom',$windowHeight*(parseInt($bottomPadding)/100));
5592				}
5593				
5594
5595			});
5596		}
5597	}
5598	if(nectarDOMInfo.usingMobileBrowser) {
5599		fullWidthRowPaddingAdjustCalc();
5600	}
5601
5602	
5603	//full width content column sizing
5604	function fullWidthContentColumns(){
5605		
5606		var $frontEndEditorElDiv = ($('body.vc_editor').length > 0) ? '.vc_element > ': '';
5607		
5608		//standard carousel
5609		$('.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(){
5610			
5611			//only set the height if more than one column
5612			if($(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').length > 1){
5613				
5614				var tallestColumn = 0;
5615				var $columnInnerHeight = 0;
5616				var $column_inner_selector; 
5617				
5618				$(this).find('> .span_12 > '+$frontEndEditorElDiv+'  .col').each(function(){
5619
5620					$column_inner_selector = ($(this).find('> .vc_column-inner > .wpb_wrapper').length > 0) ? '.vc_column-inner' : '.column-inner-wrap > .column-inner';
5621					
5622					var $padding = parseInt($(this).css('padding-top'));
5623					var $frontEndEditorElPadding = ($frontEndEditorElDiv.length > 2 && $(this).find('> .vc_column-inner').length > 0) ? parseInt($(this).find('> .vc_column-inner').css('padding-top')) : 0;
5624
5625					($(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;
5626				});	
5627	    	 	
5628	    	 	$(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').each(function(){
5629
5630	    	 		$column_inner_selector = ($(this).find('> .vc_column-inner > .wpb_wrapper').length > 0) ? '.vc_column-inner' : '.column-inner-wrap > .column-inner';
5631					
5632	    	 		//columns with content
5633		    	 	if($(this).find('> '+$column_inner_selector+' > .wpb_wrapper > *').length > 0){
5634		    	 		//added in 7.6 to fix equal height columns 
5635							if($frontEndEditorElDiv.length < 2 && !$(this).parent().parent().hasClass('vc_row-o-equal-height')) { $(this).css('height',tallestColumn); }
5636							else if($frontEndEditorElDiv.length > 2 && !$(this).parent().parent().parent().hasClass('vc_row-o-equal-height')) { $(this).css('height',tallestColumn); }
5637		    	 	} 
5638		    	 	//empty columns
5639		    	 	else {
5640		    	 		$(this).css('min-height',tallestColumn);
5641		    	 		if($(this).is('[data-animation*="reveal"]')) $(this).find('.column-inner').css('min-height',tallestColumn);
5642		    	 	}
5643	    	 	});
5644	         	
5645	         	//nested column height
5646						var $childRows = $(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col .wpb_row').length;
5647	         	if(window.innerWidth > 1000) { 
5648	         		
5649	         		var $padding = parseInt($(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').css('padding-top'));
5650	         		
5651	         		//$(this).find('> .span_12 > .col .wpb_row .col').css('min-height',(tallestColumn-($padding*2))/$childRows + 'px'); 
5652	         	} else {
5653	         		$(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col .wpb_row .col').css('min-height','0px'); 
5654	         	}
5655	         	
5656	         	
5657	         	//vertically center
5658	         	if($(this).hasClass('vertically-align-columns') && window.innerWidth > 1000 && !$(this).hasClass('vc_row-o-equal-height')){
5659	         		
5660	         		//parent columns
5661		         	$(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').each(function(){
5662
5663		         		$column_inner_selector = ($(this).find('> .vc_column-inner > .wpb_wrapper').length > 0) ? '.vc_column-inner' : '.column-inner-wrap > .column-inner';
5664						
5665						$columnInnerHeight = $(this).find('> '+$column_inner_selector+' > .wpb_wrapper').height();
5666						var $marginCalc = ($(this).height()/2)-($columnInnerHeight/2);
5667						if($marginCalc <= 0) $marginCalc = 0;
5668						
5669						$(this).find('> '+$column_inner_selector+' > .wpb_wrapper').css('margin-top',$marginCalc);
5670						$(this).find('> '+$column_inner_selector+' > .wpb_wrapper').css('margin-bottom',$marginCalc);
5671						
5672					});	
5673	
5674					
5675				}
5676			
5677			}
5678			
5679   	  	});
5680
5681		//equal height columns in container type with reveal columns
5682		$('.main-content > .row > .wpb_row:not(.full-width-content).vc_row-o-equal-height').each(function(){
5683			if($(this).find('>.span_12 > '+$frontEndEditorElDiv+' .wpb_column[data-animation*="reveal"]').length >0) {
5684				var tallestColumn = 0;
5685				var $columnInnerHeight = 0;
5686				
5687			$(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').each(function(){
5688					
5689					var $padding = parseInt($(this).find('> .column-inner-wrap > .column-inner').css('padding-top'));
5690					($(this).find('> .column-inner-wrap > .column-inner').height() + ($padding*2) > tallestColumn) ? tallestColumn = $(this).find('> .column-inner-wrap > .column-inner').height() + ($padding*2)  : tallestColumn = tallestColumn;
5691				});	
5692	    	 	
5693	    	 	$(this).find('> .span_12 > '+$frontEndEditorElDiv+' .col').each(function(){
5694					
5695	    	 		//columns with content
5696		    	 	if($(this).find('> .column-inner-wrap > .column-inner .wpb_wrapper > *').length > 0){
5697		    	 		$(this).find('> .column-inner-wrap').css('height',tallestColumn);
5698		    	 	} 
5699		    	 	//empty columns
5700		    	 	else {
5701		    	 		$(this).css('min-height',tallestColumn);
5702		    	 		if($(this).is('[data-animation*="reveal"]')) $(this).find('.column-inner').css('min-height',tallestColumn);
5703		    	 	}
5704	    	 	});
5705
5706			}	
5707		});
5708
5709		//using equal height option, top/bottom padding % needs to be convered into px for cross browser (flex bug)
5710		$('.wpb_row.vc_row-o-equal-height>.span_12> '+$frontEndEditorElDiv+'.wpb_column[class*="padding-"][data-padding-pos="all"]').each(function(){
5711			if($(this).parents('.tabbed').length == 0) {
5712				$(this).css({ 'padding-top': $(this).css('padding-left'), 'padding-bottom': $(this).css('padding-left')});
5713			}
5714		});
5715		
5716	}
5717	
5718	fullWidthContentColumns();
5719	if($('.owl-carousel').length > 0) owlCarouselInit();
5720
5721
5722var $mouseParallaxScenes = [];
5723function mouseParallaxInit(){
5724	$('.wpb_row:has(.nectar-parallax-scene)').each(function(i){
5725
5726		var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-space').height();
5727		
5728		var $strength = parseInt($(this).find('.nectar-parallax-scene').attr('data-scene-strength'));
5729
5730		$mouseParallaxScenes[i] = $(this).find('.nectar-parallax-scene').parallax({
5731			scalarX: $strength,
5732	  		scalarY: $strength
5733		});
5734
5735		//wait until the images in the scene have loaded
5736		var images = $(this).find('.nectar-parallax-scene li');
5737		
5738		$.each(images, function(){
5739			if($(this).find('div').length > 0) {
5740			    var el = $(this).find('div'),
5741			    image = el.css('background-image').replace(/"/g, '').replace(/url\(|\)$/ig, '');
5742			    if(image && image !== '' && image !== 'none')
5743			        images = images.add($('<img>').attr('src', image));
5744			}
5745		});
5746
5747		var $that = $(this);
5748
5749
5750	});
5751}
5752mouseParallaxInit();
5753
5754
5755	
5756/***************** Checkmarks ******************/
5757
5758function ulChecks() {
5759	$('ul.checks li').each(function(){
5760		if( $(this).find('i.icon-ok-sign').length == 0 ) {
5761			$(this).prepend('<i class="icon-ok-sign"></i>');
5762		}
5763	});
5764}
5765ulChecks();
5766
5767
5768
5769function rowBGAnimations() {
5770	var $rowBGAnimationsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '93%';
5771	
5772	$($fullscreenSelector+'.row-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]):not([data-bg-animation*="displace-filter"]) .row-bg.using-image').each(function() {
5773		
5774		var $that = $(this);
5775		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
5776		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
5777		
5778		var waypoint = new Waypoint({
5779			 element: $that.parents('.row-bg-wrap'),
5780			 handler: function(direction) {
5781				 
5782				 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
5783						waypoint.destroy();
5784					 return;
5785				 }
5786				 
5787					$that.parents('.inner-wrap').addClass('animated-in');
5788				 
5789				 waypoint.destroy();
5790			 },
5791			 offset: $rowBGAnimationsOffsetPos
5792		});
5793		
5794	});
5795	
5796}
5797
5798function columnBGAnimations() {
5799	var $rowBGAnimationsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '93%';
5800	
5801	$($fullscreenSelector+'.column-image-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]):not([data-bg-animation*="displace-filter"]) .column-image-bg').each(function() {
5802		
5803		var $that = $(this);
5804		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
5805		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
5806		
5807		var waypoint = new Waypoint({
5808			 element: $that.parents('.column-image-bg-wrap'),
5809			 handler: function(direction) {
5810				 
5811				 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
5812						waypoint.destroy();
5813					 return;
5814				 }
5815				 
5816					$that.parents('.inner-wrap').addClass('animated-in');
5817				 
5818				 waypoint.destroy();
5819			 },
5820			 offset: $rowBGAnimationsOffsetPos
5821		});
5822		
5823	});
5824	
5825}
5826
5827/***************** Image with Animation / Col Animation *******************/
5828
5829
5830	
5831function colAndImgAnimations(){
5832
5833	var $colAndImgOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '88%';
5834	var $colAndImgOffsetPos2 = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '70%';
5835
5836	$($fullscreenSelector+'img.img-with-animation').each(function() {
5837		
5838		var $that = $(this);
5839		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
5840		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
5841
5842		var waypoint = new Waypoint({
5843 			element: $that,
5844 			 handler: function(direction) {
5845			   
5846					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
5847						 waypoint.destroy();
5848						return;
5849					}
5850
5851					if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) {
5852				
5853						if($that.attr('data-animation') == 'fade-in-from-left'){
5854							$that.delay($that.attr('data-delay')).transition({
5855								'opacity' : 1,
5856								'x' : '0px'
5857							},$animationDuration, $animationEasing);
5858						} else if($that.attr('data-animation') == 'fade-in-from-right'){
5859							$that.delay($that.attr('data-delay')).transition({
5860								'opacity' : 1,
5861								'x' : '0px'
5862							},$animationDuration, $animationEasing);
5863						} else if($that.attr('data-animation') == 'fade-in-from-bottom'){
5864							$that.delay($that.attr('data-delay')).transition({
5865								'opacity' : 1,
5866								'y' : '0px'
5867							},$animationDuration, $animationEasing);
5868						} else if($that.attr('data-animation') == 'fade-in') {
5869							$that.delay($that.attr('data-delay')).transition({
5870								'opacity' : 1
5871							},$animationDuration, $animationEasing);	
5872						} else if($that.attr('data-animation') == 'grow-in') {
5873							setTimeout(function(){ 
5874								$that.transition({ scale: 1, 'opacity':1 },$animationDuration,$animationEasing);
5875							},$that.attr('data-delay'));
5876						}
5877						else if($that.attr('data-animation') == 'flip-in') {
5878							setTimeout(function(){ 
5879								$that.transition({  rotateY: 0, 'opacity':1 },$animationDuration, $animationEasing);
5880							},$that.attr('data-delay'));
5881						}
5882						else if($that.attr('data-animation') == 'flip-in-vertical') {
5883							setTimeout(function(){ 
5884								$that.transition({  rotateX: 0, 'opacity':1 },$animationDuration, $animationEasing);
5885							},$that.attr('data-delay'));
5886						}
5887
5888						$that.addClass('animated-in');
5889						
5890					}
5891
5892					waypoint.destroy();
5893
5894			  },
5895			  offset: $colAndImgOffsetPos
5896		});
5897
5898		
5899	
5900	});
5901
5902
5903	$($fullscreenSelector+'.nectar_cascading_images').each(function() {
5904		
5905		var $that = $(this);
5906		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
5907		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
5908		var $animationDelay = ($(this).is('[data-animation-timing]')) ? $(this).attr('data-animation-timing') : 175;
5909		$animationDelay = parseInt($animationDelay);
5910
5911		var waypoint = new Waypoint({
5912 			element: $that,
5913 			 handler: function(direction) {
5914			   
5915					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
5916						 waypoint.destroy();
5917						return;
5918					}
5919
5920					if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) {
5921					
5922						$that.find('.cascading-image').each(function(i){
5923
5924							var $that2 = $(this);
5925
5926							if($that2.attr('data-animation') == 'flip-in' || $that2.attr('data-animation') == 'flip-in-vertical') {
5927								setTimeout(function(){
5928									$that2.find('.inner-wrap').css({
5929										'opacity' : 1,
5930										'transform' : 'rotate(0deg) translateZ(0px)'
5931									});
5932								}, i* $animationDelay);
5933							} else {
5934								setTimeout(function(){
5935									$that2.find('.inner-wrap').css({
5936										'opacity' : 1,
5937										'transform' : 'translateX(0px) translateY(0px) scale(1,1) translateZ(0px)'
5938									});
5939								}, i* $animationDelay);
5940							}
5941					
5942
5943						});
5944
5945						$that.addClass('animated-in');
5946						
5947					}
5948
5949					waypoint.destroy();
5950
5951			  },
5952			  offset: $colAndImgOffsetPos
5953		});
5954
5955		
5956	
5957	});
5958	
5959
5960	
5961	$($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) {
5962	    
5963		var $that = $(this);
5964		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
5965		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
5966
5967		//set perspective for vertical flip
5968		if($that.is('[data-animation="flip-in-vertical"]')) {
5969			$that.parents('.col.span_12').addClass('flip-in-vertical-wrap');
5970		}
5971
5972		var waypoint = new Waypoint({
5973 			element: $that,
5974 			 handler: function(direction) {
5975				
5976				if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
5977					 waypoint.destroy();
5978					return;
5979				}
5980
5981				if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) {
5982				 	
5983				 	
5984					if($that.attr('data-animation') == 'fade-in-from-left'){
5985						$standAnimatedColTimeout[i] = setTimeout(function(){ 
5986							$that.transition({
5987								'opacity' : 1,
5988								'x' : '0px'
5989							},$animationDuration,$animationEasing);
5990						},$that.attr('data-delay'));
5991					} else if($that.attr('data-animation') == 'fade-in-from-right'){
5992						$standAnimatedColTimeout[i] = setTimeout(function(){ 
5993							$that.transition({
5994								'opacity' : 1,
5995								'x' : '0px'
5996							},$animationDuration,$animationEasing);
5997						},$that.attr('data-delay'));
5998					} else if($that.attr('data-animation') == 'fade-in-from-bottom'){
5999						$standAnimatedColTimeout[i] = setTimeout(function(){ 
6000							$that.transition({
6001								'opacity' : 1,
6002								'y' : '0px'
6003							},$animationDuration,$animationEasing);
6004						},$that.attr('data-delay'));
6005					} else if($that.attr('data-animation') == 'fade-in') {
6006						$standAnimatedColTimeout[i] = setTimeout(function(){ 
6007							$that.transition({
6008								'opacity' : 1
6009							},$animationDuration,$animationEasing);	
6010						},$that.attr('data-delay'));
6011					} else if($that.attr('data-animation') == 'grow-in' || $that.attr('data-animation') == 'zoom-out') {
6012						$standAnimatedColTimeout[i] = setTimeout(function(){ 
6013							$that.transition({ scale: 1, 'opacity':1 },$animationDuration,$animationEasing);
6014						},$that.attr('data-delay'));
6015					} else if($that.attr('data-animation') == 'flip-in') {
6016						$standAnimatedColTimeout[i] = setTimeout(function(){ 
6017							$that.transition({  rotateY: 0, 'opacity':1 },$animationDuration, $animationEasing);
6018						},$that.attr('data-delay'));
6019					} else if($that.attr('data-animation') == 'flip-in-vertical') {
6020						$standAnimatedColTimeout[i] = setTimeout(function(){ 
6021							$that.transition({  rotateX: 0, y: 0, 'opacity':1 },$animationDuration, $animationEasing);
6022						},$that.attr('data-delay'));
6023					}
6024
6025					//boxed column hover fix
6026					if($that.hasClass('boxed')) {
6027						$that.addClass('no-pointer-events');
6028						setTimeout(function(){
6029							$that.removeClass('no-pointer-events');
6030						},parseInt($animationDuration) + parseInt($that.attr('data-delay')) + 30 );
6031					}
6032
6033					$that.addClass('animated-in');
6034				
6035				}
6036
6037				waypoint.destroy();
6038			},
6039			offset: $colAndImgOffsetPos
6040		});
6041	
6042	});
6043
6044	
6045	$($fullscreenSelector+'.wpb_column.has-animation[data-animation*="reveal"]').each(function() {
6046	    
6047		var $that = $(this);
6048		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
6049		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
6050
6051		var waypoint = new Waypoint({
6052 			element: $that,
6053 			 handler: function(direction) {
6054				
6055				if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
6056					 waypoint.destroy();
6057					return;
6058				}
6059
6060				if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) {
6061					
6062					if($that.attr('data-animation') == 'reveal-from-bottom' || $that.attr('data-animation') == 'reveal-from-top') {
6063						setTimeout(function(){ 
6064							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'); });
6065						},$that.attr('data-delay'));
6066					} else if($that.attr('data-animation') == 'reveal-from-right' || $that.attr('data-animation') == 'reveal-from-left') {
6067						setTimeout(function(){ 
6068							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'); });
6069						},$that.attr('data-delay'));
6070					} 
6071
6072					$that.addClass('animated-in');
6073				
6074				}
6075
6076				waypoint.destroy();
6077			},
6078			offset: $colAndImgOffsetPos2
6079		});
6080	
6081	}); 	
6082
6083	
6084}
6085
6086
6087
6088function cascadingImageBGSizing() {
6089	$('.nectar_cascading_images').each(function(){
6090
6091		//handle max width for cascading images in equal height columns
6092		if($(this).parents('.vc_row-o-equal-height').length > 0 && $(this).parents('.wpb_column').length > 0) 
6093			$(this).css('max-width',$(this).parents('.wpb_column').width());
6094
6095		//set size for layers with no images
6096		$(this).find('.bg-color').each(function(){
6097			var $bgColorHeight = 0;
6098			var $bgColorWidth = 0;
6099			if($(this).parent().find('.img-wrap').length == 0) {
6100				var $firstSibling = $(this).parents('.cascading-image').siblings('.cascading-image[data-has-img="true"]').first();
6101
6102				$firstSibling.css({'position':'relative', 'visiblity':'hidden'});
6103				$bgColorHeight = $firstSibling.find('.img-wrap').height();
6104				$bgColorWidth = $firstSibling.find('.img-wrap').width();
6105				if($firstSibling.index() == 0) {
6106					$firstSibling.css({'visiblity':'visible'});
6107				} else {
6108					$firstSibling.css({'position':'absolute', 'visiblity':'visible'});
6109				}
6110			} else {
6111				$bgColorHeight = $(this).parent().find('.img-wrap').height();
6112				$bgColorWidth = $(this).parent().find('.img-wrap').width();
6113			}
6114
6115			$(this).css({'height': $bgColorHeight,'width': $bgColorWidth});
6116		});
6117	});
6118}
6119
6120if($('.nectar_cascading_images').length > 0) {
6121	imagesLoaded($('.nectar_cascading_images'),function(instance){
6122		cascadingImageBGSizing();
6123	});
6124}
6125
6126function splitLineHeadings() {
6127
6128	var $splitLineOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
6129	$($fullscreenSelector+'.nectar-split-heading').each(function() {
6130
6131		var $that = $(this);
6132		var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine';
6133		var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650';
6134
6135		var waypoint = new Waypoint({
6136				element: $that,
6137				 handler: function(direction) {
6138				
6139				if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
6140					 waypoint.destroy();
6141					return;
6142				}
6143
6144				if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) {
6145				 	
6146					
6147					$that.find('.heading-line').each(function(i){
6148						//if($that.parents('.first-section').length > 0 && $('body[data-aie="zoom-out"]').length > 0) i = i+4;
6149						$(this).find('> div').delay(i*70).transition({
6150							'y' : '0px'
6151						},$animationDuration,$animationEasing);
6152
6153					});
6154					
6155
6156					$that.addClass('animated-in');
6157				
6158				}
6159
6160				waypoint.destroy();
6161			},
6162			offset: $splitLineOffsetPos
6163		});
6164
6165	});
6166}
6167
6168	
6169/***************** Custom tablet default column widths  ******************/
6170	
6171	//add one-fourth class
6172	function oneFourthClasses() {
6173		$('.col.span_3, .vc_span3, .vc_col-sm-3').each(function(){
6174			if( !$(this).is('[data-t-w-inherits="small_desktop"]') ) {
6175				var $currentDiv = $(this);
6176				var $nextDiv = $(this).next('div');
6177				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') ) {
6178					$currentDiv.addClass('one-fourths clear-both');
6179					$nextDiv.addClass('one-fourths right-edge');
6180				}
6181			}
6182		});
6183		
6184		//make empty second 1/2 half columsn display right on iPad
6185		$('.span_12 .col.span_6').each(function(){
6186			if($(this).next('div').hasClass('span_6') && $.trim( $(this).next('div').html() ).length == 0 ) {
6187				$(this).addClass('empty-second')
6188			}
6189		}); 
6190		
6191	}
6192	oneFourthClasses();
6193	
6194/***************** Bar Graph ******************/
6195function progressBars(){
6196	var $progressBarsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
6197	$($fullscreenSelector+'.nectar-progress-bar').parent().each(function(i){
6198		
6199		var $that = $(this);
6200		var waypoint = new Waypoint({
6201 			element: $that,
6202 			 handler: function(direction) {
6203			   
6204					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6205						 waypoint.destroy();
6206						return;
6207					}
6208
6209					if($progressBarsOffsetPos == '100%') $that.find('.nectar-progress-bar .bar-wrap').css('opacity','1');
6210
6211					$that.find('.nectar-progress-bar').each(function(i){
6212
6213
6214						var percent = $(this).find('span').attr('data-width');
6215						var $endNum = parseInt($(this).find('span strong i').text());
6216						var $that = $(this);
6217						
6218						$that.find('span').delay(i*90).transition({
6219							'width' : percent + '%'
6220						},1050, 'easeInOutQuint',function(){
6221						});
6222	
6223						setTimeout(function(){
6224
6225							var countOptions = { useEasing : false };
6226							var $countEle = $that.find('span strong i')[0];
6227							var numAnim = new CountUp($countEle, 0, $endNum,0,1,countOptions);
6228							numAnim.start();
6229
6230							$that.find('span strong').transition({
6231								'opacity' : 1
6232							},550, 'easeInCirc');
6233						}, (i*90) );
6234					
6235						////100% progress bar 
6236						if(percent == '100'){
6237							$that.find('span strong').addClass('full');
6238						}
6239					});
6240
6241					$that.addClass('completed');
6242
6243					waypoint.destroy();
6244
6245			  },
6246			  offset: $progressBarsOffsetPos
6247		});
6248
6249	});
6250}
6251
6252
6253/***************** Column Borders ******************/
6254function animatedColBorders(){
6255	var $progressBarsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '75%';
6256	$($fullscreenSelector+'.wpb_column[data-border-animation="true"]').each(function(i){
6257
6258		var $that = $(this);
6259		var waypoint = new Waypoint({
6260 			element: $that,
6261 			 handler: function(direction) {
6262			   
6263					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6264						 waypoint.destroy();
6265						return;
6266					}
6267
6268					var $borderDelay = ($that.attr('data-border-animation-delay').length > 0) ? parseInt($that.attr('data-border-animation-delay')) : 0;
6269					setTimeout(function(){
6270						$that.find('.border-wrap').addClass('animation');
6271						$that.find('.border-wrap').addClass('completed');
6272					},$borderDelay)
6273					
6274
6275					waypoint.destroy();
6276
6277			  },
6278			  offset: $progressBarsOffsetPos
6279		});
6280
6281	});
6282}
6283
6284/***************** Food Menu Item ******************/
6285function foodMenuItems() {
6286	var $foodItemOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '80%';
6287	$($fullscreenSelector+'.nectar_food_menu_item').parent().each(function(i){
6288
6289		var $that = $(this);
6290		var waypoint = new Waypoint({
6291 			element: $that,
6292 			 handler: function(direction) {
6293			   
6294					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6295						 waypoint.destroy();
6296						return;
6297					}
6298
6299					$that.find('.nectar_food_menu_item').each(function(i){
6300
6301						var $that = $(this);
6302
6303						setTimeout(function(){
6304							$that.addClass('animated-in');
6305						},i*150);
6306						
6307					});
6308					
6309					waypoint.destroy();
6310
6311			  },
6312			  offset: $foodItemOffsetPos
6313		});
6314
6315	});
6316}
6317
6318
6319/***************** Dividers ******************/
6320function dividers() {
6321	var $dividerOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
6322
6323	$($fullscreenSelector+'.divider-small-border[data-animate="yes"], '+$fullscreenSelector+'.divider-border[data-animate="yes"]').each(function(i){
6324
6325		var $lineDur = ($(this).hasClass('divider-small-border')) ? 1300 : 1500;
6326		var $that = $(this);
6327		var waypoint = new Waypoint({
6328 			element: $that,
6329 			 handler: function(direction) {
6330			   
6331					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6332						 waypoint.destroy();
6333						return;
6334					}
6335				
6336					$that.each(function(i){
6337
6338						$(this).css({'transform':'scale(0,1)', 'visibility': 'visible'});
6339						var $that = $(this);
6340						
6341						$that.delay($that.attr('data-animation-delay')).transition({
6342							'transform' : 'scale(1, 1)'
6343						},$lineDur, 'cubic-bezier(.18,1,.22,1)');
6344						
6345					});
6346
6347					$that.addClass('completed');
6348
6349					waypoint.destroy();
6350
6351			  },
6352			  offset: $dividerOffsetPos
6353		});
6354
6355	});
6356}
6357
6358
6359
6360/***************** Icon List ******************/
6361function iconList() {
6362	var $iconListOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '250%' : '75%';
6363
6364	$($fullscreenSelector+'.nectar-icon-list[data-animate="true"]').each(function(i){
6365
6366		var $that = $(this);
6367		var waypoint = new Waypoint({
6368 			element: $that,
6369 			 handler: function(direction) {
6370			   
6371					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6372						 waypoint.destroy();
6373						return;
6374					}
6375				
6376					$that.each(function(i){
6377						
6378						var $listItemAnimationDelay = ( $that.is('[data-direction="horizontal"]') ) ? 100 : 300;
6379						
6380						$(this).find('.nectar-icon-list-item').each(function(i){
6381							var $thatt = $(this);
6382							setTimeout(function(){ $thatt.addClass('animated') },i*$listItemAnimationDelay);
6383						});
6384						
6385					});
6386
6387					$that.addClass('completed');
6388
6389					waypoint.destroy();
6390
6391			  },
6392			  offset: $iconListOffsetPos
6393		});
6394
6395	});
6396}
6397
6398//bg color match 
6399
6400function narrowParentBGC(element) {
6401	
6402	var narrowedBGC;
6403	
6404	if(element.parents('.wpb_column[data-bg-color*="#"]').length > 0 && element.parents('.wpb_column[data-bg-opacity="1"]').length > 0) {
6405		var narrowedBGC = element.parents('.wpb_column').attr('data-bg-color');
6406	}
6407	else if(element.parents('.wpb_row').length > 0 && element.parents('.wpb_row').find('.row-bg.using-bg-color').length > 0) {
6408		var narrowedBGC = element.parents('.wpb_row').find('.row-bg.using-bg-color').css('background-color');
6409	}
6410	else {
6411		if($('#nectar_fullscreen_rows').length > 0)
6412			var narrowedBGC = $('#nectar_fullscreen_rows > .wpb_row .full-page-inner-wrap').css('background-color');
6413		else 
6414			var narrowedBGC = $('.container-wrap').css('background-color');
6415	}
6416	
6417	return narrowedBGC;
6418	
6419}
6420
6421var nectarMatchingBGCss = '';
6422
6423function nectarIconMatchColoring() {
6424	
6425	//icon list
6426	$('.nectar-icon-list[data-icon-style="border"], .nectar_icon_wrap[data-style="border-animation"][data-color*="extra-color-gradient-"]').each(function(i){
6427		
6428		var $bgColorToSet = narrowParentBGC($(this));
6429		
6430		if($(this).hasClass('nectar-icon-list')) 
6431			$(this).find('.list-icon-holder').css('background-color',$bgColorToSet);
6432		else {
6433			//must be set in css, can't manip pseudo
6434			$(this).removeClass(function (index, className) {
6435			    return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
6436			});
6437			$(this).addClass('instance-'+i);
6438			nectarMatchingBGCss += '.nectar_icon_wrap.instance-'+i+' .nectar_icon:before { background-color: '+$bgColorToSet+'!important; }';
6439		}
6440			
6441	});
6442
6443	//material gradient btns
6444	$('body.material .nectar-button.see-through[class*="m-extra-color-gradient"]').each(function(i){
6445		
6446		var $bgColorToSet = narrowParentBGC($(this));
6447		
6448		$(this).removeClass(function (index, className) {
6449				return (className.match (/(^|\s)instance-\S+/g) || []).join(' ');
6450		});
6451		$(this).addClass('instance-'+i);
6452		nectarMatchingBGCss += '.nectar-button.see-through.instance-'+i+':after { background-color: '+$bgColorToSet+'!important; }';
6453		
6454	});
6455
6456	if(nectarMatchingBGCss.length > 0) {
6457		var head = document.head || document.getElementsByTagName('head')[0];
6458		var style = document.createElement('style');
6459
6460		style.type = 'text/css';
6461		if (style.styleSheet){
6462		  style.styleSheet.cssText = nectarMatchingBGCss;
6463		} else {
6464		  style.appendChild(document.createTextNode(nectarMatchingBGCss));
6465		}
6466		
6467		$(style).attr('id','nectaricon-color-match');
6468		$('head #nectaricon-color-match').remove();
6469		head.appendChild(style);
6470	}
6471	
6472}
6473nectarIconMatchColoring();
6474
6475
6476/***************** Hotspot ******************/
6477//add pulse animation
6478$('.nectar_image_with_hotspots[data-hotspot-icon="numerical"]').each(function(){
6479	$(this).find('.nectar_hotspot_wrap').each(function(i){
6480		var $that = $(this);
6481		setTimeout(function(){
6482			$that.find('.nectar_hotspot').addClass('pulse');
6483		},i*300);	
6484	});
6485});
6486
6487
6488
6489function hotSpotHoverBind() {
6490
6491	var hotSpotHoverTimeout = [];
6492
6493	$('.nectar_image_with_hotspots:not([data-tooltip-func="click"]) .nectar_hotspot').each(function(i){
6494		
6495		hotSpotHoverTimeout[i] = '';
6496
6497		$(this).on('mouseover', function(){
6498			clearTimeout(hotSpotHoverTimeout[i]);
6499			$(this).parent().css({'z-index':'400', 'height':'auto','width':'auto'});
6500		});
6501
6502		$(this).on('mouseleave', function(){
6503
6504			var $that = $(this);
6505			$that.parent().css({'z-index':'auto'});
6506
6507			hotSpotHoverTimeout[i] = setTimeout(function(){
6508				$that.parent().css({'height':'30px','width':'30px'});
6509			},300);
6510
6511		});
6512
6513	});
6514
6515}
6516
6517hotSpotHoverBind();
6518
6519function responsiveTooltips() {
6520
6521	$('.nectar_image_with_hotspots').each(function(){
6522		$(this).find('.nectar_hotspot_wrap').each(function(i){
6523			
6524			if(  window.innerWidth > 690) {
6525
6526				//remove click if applicable
6527				if($(this).parents('.nectar_image_with_hotspots[data-tooltip-func="hover"]').length > 0) {
6528					$(this).find('.nectar_hotspot').removeClass('click');
6529					$(this).find('.nttip').removeClass('open');
6530				}
6531				$(this).find('.nttip .inner a.tipclose').remove();
6532				$('.nttip').css('height','auto');
6533
6534				//reset for positioning
6535				$(this).css({'width': 'auto','height': 'auto'});
6536				$(this).find('.nttip').removeClass('force-right').removeClass('force-left').removeClass('force-top').css('width','auto');
6537
6538				var $tipOffset = $(this).find('.nttip').offset();
6539
6540				//against right side fix
6541				if($tipOffset.left > $(this).parents('.nectar_image_with_hotspots').width() - 200)
6542					$(this).find('.nttip').css('width','250px');
6543				else 
6544					$(this).find('.nttip').css('width','auto');
6545
6546				//responsive
6547				if($tipOffset.left < 0)
6548					$(this).find('.nttip').addClass('force-right');
6549				else if($tipOffset.left + $(this).find('.nttip').outerWidth(true) >  window.innerWidth )
6550					$(this).find('.nttip').addClass('force-left').css('width','250px');
6551				else if($tipOffset.top + $(this).find('.nttip').height() + 35 > $(window).height() && $('#nectar_fullscreen_rows').length > 0)
6552					$(this).find('.nttip').addClass('force-top');
6553
6554				if($(this).find('> .open').length == 0)
6555					$(this).css({'width': '30px','height': '30px'});
6556
6557			} else {
6558				//fixed position
6559				$(this).find('.nttip').removeClass('force-left').removeClass('force-right').removeClass('force-top');
6560				$(this).find('.nectar_hotspot').addClass('click');
6561			
6562				if($(this).find('.nttip a.tipclose').length == 0)
6563					$(this).find('.nttip .inner').append('<a href="#" class="tipclose"><span></span></a>');
6564
6565				//change height of fixed
6566				$('.nttip').css('height',$(window).height());
6567			}
6568		});
6569	});
6570
6571
6572}
6573responsiveTooltips();
6574
6575function imageWithHotspotClickEvents() {
6576	//click
6577	$('body').on('click','.nectar_hotspot.click',function(){
6578		$(this).parents('.nectar_image_with_hotspots').find('.nttip').removeClass('open');
6579		$(this).parent().find('.nttip').addClass('open');
6580
6581		$(this).parents('.nectar_image_with_hotspots').find('.nectar_hotspot').removeClass('open');
6582		$(this).parent().find('.nectar_hotspot').addClass('open');
6583
6584		if( window.innerWidth > 690) {
6585			$(this).parent().css({'z-index':'120', 'height':'auto','width':'auto'});
6586
6587			var $that = $(this);
6588
6589			setTimeout(function(){
6590				$that.parents('.nectar_image_with_hotspots').find('.nectar_hotspot_wrap').each(function(){
6591					if($(this).find('> .open').length == 0)
6592						$(this).css({'height':'30px','width':'30px', 'z-index':'auto'});
6593				});
6594			},300);
6595		}
6596
6597		if(  window.innerWidth <= 690) $(this).parents('.wpb_row, [class*="vc_col-"]').css('z-index','200');
6598
6599		return false;
6600	});
6601
6602	$('body').on('click','.nectar_hotspot.open',function(){
6603		$(this).parent().find('.nttip').removeClass('open');
6604		$(this).parent().find('.nectar_hotspot').removeClass('open');
6605
6606		$(this).parents('.wpb_row').css('z-index','auto');
6607
6608		return false;
6609	});
6610
6611	$('body').on('click','.nttip.open',function(){
6612		if(  window.innerWidth < 690) {
6613			$(this).parents('.nectar_image_with_hotspots').find('.nttip').removeClass('open');
6614			$(this).parents('.wpb_row').css('z-index','auto');
6615			return false;
6616		}
6617	});
6618}
6619imageWithHotspotClickEvents();
6620
6621function imageWithHotspots() {
6622
6623	var $imageWithHotspotsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '50%';
6624
6625	$($fullscreenSelector+'.nectar_image_with_hotspots[data-animation="true"]').each(function(i){
6626
6627		var $that = $(this);
6628		var waypoint = new Waypoint({
6629 			element: $that,
6630 			 handler: function(direction) {
6631			   
6632					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6633						 waypoint.destroy();
6634						return;
6635					}
6636
6637					$that.addClass('completed');
6638					$that.find('.nectar_hotspot_wrap').each(function(i){
6639						var $that2 = $(this);
6640						var $extrai = ($that2.parents('.col.has-animation').length > 0) ? 1 : 0;
6641						setTimeout(function(){
6642							$that2.addClass('animated-in');
6643						},175*(i+$extrai));
6644					});
6645
6646					waypoint.destroy();
6647
6648			  },
6649			  offset: $imageWithHotspotsOffsetPos
6650		});
6651
6652	});
6653}
6654
6655
6656/***************** Animated Title ******************/
6657function animated_titles() {
6658	var $animatedTitlesOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
6659
6660	$($fullscreenSelector+'.nectar-animated-title').each(function(i){
6661
6662		var $that = $(this);
6663		var waypoint = new Waypoint({
6664 			element: $that,
6665 			 handler: function(direction) {
6666			   
6667					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 
6668						 waypoint.destroy();
6669						return;
6670					}
6671
6672					$that.addClass('completed');
6673
6674					waypoint.destroy();
6675
6676			  },
6677			  offset: $animatedTitlesOffsetPos
6678		});
6679
6680	});
6681}
6682
6683
6684/***************** Highlighted Text ******************/
6685function highlighted_text() {
6686	var $highlightedTextOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';
6687
6688	$($fullscreenSelector+'.nectar-highlighted-text').each(function(i){
6689		
6690		/*custom color*/
6691		if($(this).is('[data-using-custom-color="true"]')) {
6692			
6693				var highlightedColorCss = '';
6694				var $custom_highlight_color = $(this).attr('data-color');
6695			
6696				$(this).addClass('instance-'+i);
6697			
6698				highlightedColorCss += '.nectar-highlighted-text.instance-' + i + ' em:before { background-color: ' + $custom_highlight_color + '; }';
6699			
6700				if(highlightedColorCss.length > 1) {
6701		
6702					var head = document.head || document.getElementsByTagName('head')[0];
6703					var style = document.createElement('style');
6704		
6705						style.type = 'text/css';
6706					if (style.styleSheet){
6707					  style.styleSheet.cssText = highlightedColorCss;
6708					} else {
6709					  style.appendChild(document.createTextNode(highlightedColorCss));
6710					}
6711		
6712					head.appendChild(style);
6713				}
6714			
6715		}
6716		
6717		if(nectarDOMInfo.usingMobileBrowser) {
6718			$(this).find('em').addClass('animated');
6719		}
6720		
6721		/*waypoint*/
6722		var $that = $(this);
6723		var waypoint = new Waypoint({
6724 			element: $that,
6725 			 handler: function(direction) {
6726			   
6727					if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated')) { 
6728						 waypoint.destroy();
6729						return;
6730					}
6731					
6732					$that.find('em').each(function(i){
6733						var $highlighted_em = $(this);
6734						setTimeout(function(){
6735							$highlighted_em.addClass('animated');
6736						},i*300);
6737
6738					});
6739
6740					waypoint.destroy();
6741
6742			  },
6743			  offset: $highlightedTextOffsetPos
6744		});
6745
6746	});
6747}
6748
6749
6750
6751/***************** Pricing Tables ******************/
6752
6753
6754var $tallestCol;
6755
6756function pricingTableHeight(){
6757	$('.pricing-table[data-style="default"]').each(function(){
6758		$tallestCol = 0;
6759		
6760		$(this).find('> div ul').each(function(){
6761			($(this).height() > $tallestCol) ? $tallestCol = $(this).height() : $tallestCol = $tallestCol;
6762		});	
6763		
6764		//safety net incase pricing tables height couldn't be determined
6765		if($tallestCol == 0) $tallestCol = 'auto';
6766		
6767		//set even height
6768		$(this).find('> div ul').css('height',$tallestCol);
6769
6770	});
6771}
6772
6773pricingTableHeight();
6774
6775 
6776/***************** Testimonial Slider ******************/
6777
6778//testimonial slider controls
6779
6780//non minimal
6781$('body').on('click','.testimonial_slider:not([data-style*="multiple_visible"]):not([data-style="minimal"]) .controls li', function(){
6782	
6783	if($(this).find('span').hasClass('active')) return false;
6784	
6785	var $frontEndEditorTestimonialDiv =  ($('body.vc_editor').length > 0) ? '> div': 'blockquote';
6786	var $index = $(this).index();
6787	var currentHeight = $(this).parents('.testimonial_slider').find('.slides blockquote').eq($index).height();
6788	
6789	$(this).parents('.testimonial_slider').find('li span').removeClass('active');
6790	$(this).find('span').addClass('active');
6791	
6792	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).addClass('no-trans');
6793	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).css({'opacity':'0', 'transform': 'translateX(-25px)', 'z-index': '1'});
6794	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($index).removeClass('no-trans').css({'opacity':'1', 'transform': 'translateX(0px)'}).css('z-index','20');
6795	$(this).parents('.testimonial_slider:not(.disable-height-animation)').find('.slides').stop(true,true).animate({'height' : currentHeight + 40 + 'px' },450,'easeOutCubic');
6796	
6797	resizeVideoToCover();
6798});
6799
6800//minimal
6801$('body').on('click','.testimonial_slider[data-style="minimal"] .testimonial-next-prev a', function(){
6802	
6803	var $frontEndEditorTestimonialDiv =  ($('body.vc_editor').length > 0) ? '> div': 'blockquote';
6804	var $index = $(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv+'.active').index();
6805	var $actualIndex = $index;
6806
6807	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).addClass('no-trans');
6808	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).css({'opacity':'0', 'transform': 'translateX(-25px)', 'z-index': '1'});
6809
6810
6811	$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($index).removeClass('active');
6812
6813	if($(this).hasClass('next')) {
6814		if($index+1 >= $(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).length) { 
6815			$actualIndex = 0; 
6816		} else {
6817			$actualIndex = $index+1; 
6818		}
6819		var currentHeight = $(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($actualIndex).height();
6820		//show slide
6821		$(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($actualIndex).addClass('active').removeClass('no-trans').css({'opacity':'1', 'transform': 'translateX(0px)'}).css('z-index','20');
6822		//change pag #
6823		$(this).parents('.testimonial_slider').find('.control-wrap ul').css({'transform':'translateX(-'+(20*$actualIndex)+'px)'});
6824	} else {
6825		if($index-1 == -1) { 
6826			$actualIndex = $(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).length-1; 
6827		} else {
6828			$actualIndex = $index-1; 
6829		}
6830		var currentHeight = $(this).parents('.testimonial_slider').find('.slides '+$frontEndEditorTestimonialDiv).eq($index-1).height();
6831		//show slide
6832		$(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');
6833		//change pag #
6834		$(this).parents('.testimonial_slider').find('.control-wrap ul').css({'transform':'translateX(-'+(20*$actualIndex)+'px)'});
6835	}
6836	
6837	
6838	$(this).parents('.testimonial_slider:not(.disable-height-animation)').find('.slides').stop(true,true).animate({'height' : currentHeight + 40 + 'px' },450,'easeOutCubic');
6839	
6840	resizeVideoToCover();
6841
6842	return false;
6843});
6844
6845
6846var $tallestQuote;
6847
6848var $testimonialSlider = [];
6849
6850//create controls
6851function createTestimonialControls() {
6852	
6853	var $frontEndEditorTestimonialDiv =  ($('body.vc_editor').length > 0) ? '> div': 'blockquote';
6854	
6855	//fadeIn
6856	$('.testimonial_slider:not([data-style*="multiple_visible"])').animate({'opacity':'1'},800);
6857
6858	$('.testimonial_slider:not([data-style*="multiple_visible"])').each(function(i){
6859		
6860		if($(this).find('blockquote').length > 1) {
6861			$(this).find('.controls, .testimonial-next-prev').remove();
6862			$(this).append('<div class="controls"><ul></ul></div>');
6863			
6864			var slideNum = $(this).find('blockquote').length;
6865			var $that = $(this);
6866			
6867			for(var i=0;i<slideNum;i++) {
6868
6869				if( !$(this).is('[data-style="minimal"]') ) {
6870					$that.find('.controls ul').append('<li><span class="pagination-switch"></span></li>');
6871				} else {
6872					$that.find('.controls ul').append('<li>'+(i+1)+'</li>');
6873				}
6874			}
6875			
6876			//minimal
6877			if( $(this).is('[data-style="minimal"]') ) {
6878
6879				//add next/prev
6880				$(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>');
6881
6882				//start on first
6883				if($(this).find('.active').length == 0) {
6884					$(this).find('.slides '+$frontEndEditorTestimonialDiv +':first-child').addClass('active').css({'opacity':'1', 'transform': 'translateX(0px)'}).css('z-index','20');
6885					if(	!$(this).hasClass('disable-height-animation') ) {
6886						$(this).find('.slides').css({'height' : $(this).find('.slides '+$frontEndEditorTestimonialDiv +':first-child').height() + 40 + 'px' });
6887					}
6888				}
6889
6890				//autorotate
6891				if($(this).attr('data-autorotate').length > 0) {
6892					var slide_interval = (parseInt($(this).attr('data-autorotate')) < 100) ? 4000 : parseInt($(this).attr('data-autorotate'));
6893					var $that = $(this);
6894					var $rotate = setInterval(function(){ testimonialRotate($that) },slide_interval);
6895				}
6896				$(this).find('.testimonial-next-prev a').on('click',function(e){
6897					if(typeof e.clientX != 'undefined') clearInterval($rotate);
6898				});
6899
6900				//wrap bullets
6901				$(this).find('.controls ul').wrap('<div class="control-wrap" />');
6902				$(this).find('.controls ul').css('width', (($(this).find('.controls ul li').length * 20) +1) + 'px');
6903				$(this).find('.controls').append('<span class="out-of">/</span><span class="total">'+$(this).find('blockquote').length+'</span>');
6904
6905				////swipe for testimonials
6906				$(this).swipe({
6907				
6908					swipeLeft : function(e) {
6909						$(this).find('.testimonial-next-prev .next').trigger('click');
6910						e.stopImmediatePropagation();
6911						clearInterval($rotate);
6912						return false;
6913					 },
6914					 swipeRight : function(e) {
6915						$(this).find('.testimonial-next-prev .prev').trigger('click');
6916						e.stopImmediatePropagation();
6917						clearInterval($rotate);
6918						return false;
6919					 }    
6920				});
6921
6922
6923			}
6924
6925			//non minimal
6926			if( !$(this).is('[data-style="minimal"]') ) {
6927
6928				//activate first slide
6929				$(this).find('.controls ul li').first().click();
6930
6931				//autorotate
6932				if($(this).attr('data-autorotate').length > 0) {
6933					var slide_interval = (parseInt($(this).attr('data-autorotate')) < 100) ? 4000 : parseInt($(this).attr('data-autorotate'));
6934					var $that = $(this);
6935					var $rotate = setInterval(function(){ testimonialRotate($that) },slide_interval);
6936				}
6937				
6938				$(this).find('.controls li').on('click',function(e){
6939					if(typeof e.clientX != 'undefined') clearInterval($rotate);
6940				});
6941				
6942				////swipe for testimonials
6943				$(this).swipe({
6944				
6945					swipeLeft : function(e) {
6946						$(this).find('.controls ul li span.active').parent().next('li').find('span').trigger('click');
6947						e.stopImmediatePropagation();
6948						clearInterval($rotate);
6949						return false;
6950					 },
6951					 swipeRight : function(e) {
6952						$(this).find('.controls ul li span.active').parent().prev('li').find('span').trigger('click');
6953						e.stopImmediatePropagation();
6954						clearInterval($rotate);
6955						return false;
6956					 }    
6957				});
6958
6959		}
6960		} 
6961		//only one testimonial
6962		else if($(this).find('.controls').length == 0) {
6963			var currentHeight = $(this).find('.slides blockquote').height();
6964			$(this).find('.slides blockquote').css({'opacity':'0', 'transform': 'translateX(-25px)', 'z-index': '1'});
6965			$(this).find('.slides blockquote').css({'opacity':'1', 'transform': 'translateX(0px)'}).css('z-index','20');
6966			$(this).find('.slides').stop(true,true).animate({'height' : currentHeight + 20 + 'px' },450,'easeOutCubic');
6967		}
6968	});
6969
6970
6971  $testimonialSlider = [];
6972		
6973	$('.testimonial_slider[data-style*="multiple_visible"] .slides').each(function(i){
6974	    	var $that = $(this); 
6975	    	var $element = $that;
6976	    	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;
6977			if($that.find('img').length == 0) $element = $('body');
6978
6979			//move img pos
6980			if( $(this).parents('.testimonial_slider').attr('data-style') != 'multiple_visible_minimal') {
6981				$(this).find('blockquote').each(function(){
6982					$(this).find('.image-icon').insertAfter($(this).find('p'));
6983				});
6984			} else {
6985				//has alf class
6986				if($(this).find('blockquote').length > 4) {
6987					$(this).parents('.testimonial_slider').addClass('has-alf');
6988				}
6989			}
6990			
6991			var $testimonialGroupCells = ($(this).parents('.testimonial_slider').attr('data-style') == 'multiple_visible_minimal') ? true : false;
6992
6993			imagesLoaded($element,function(instance){
6994				
6995				var $frontEndEditorDrag =  ($('body.vc_editor').length > 0) ? false: true;
6996				var $frontEndEditorPause =  ($('body.vc_editor').length > 0) ? true: false;
6997
6998		    	$testimonialSlider[i] = $that.flickity({
6999		    		contain: true,
7000					  draggable: $frontEndEditorDrag,
7001					  groupCells: $testimonialGroupCells,
7002					  lazyLoad: false,
7003					  imagesLoaded: true,
7004					  percentPosition: true,
7005					  prevNextButtons: false,
7006					  pageDots: true,
7007					  resize: true,
7008					  setGallerySize: true,
7009					  wrapAround: true,
7010					  autoPlay: $autoplay,
7011						pauseAutoPlayOnHover: $frontEndEditorPause,
7012					  accessibility: false
7013		    	});
7014					
7015					if($testimonialSlider[i].find('.vc_element.is-selected > blockquote').length > 0) {
7016						
7017						//starting
7018						$testimonialSlider[i].find('.vc_element.is-selected > blockquote').addClass('is-selected');
7019						
7020						//changed
7021						$testimonialSlider[i].on( 'select.flickity', function() {
7022							$testimonialSlider[i].find('.vc_element > blockquote').removeClass('is-selected');
7023							$testimonialSlider[i].find('.vc_element.is-selected > blockquote').addClass('is-selected');
7024						});
7025					}
7026					
7027
7028			    $that.parents('.testimonial_slider').css('opacity','1');
7029			    
7030
7031		     });//images loaded
7032		     	     
7033	    });//each	
7034
7035
7036}
7037createTestimonialControls();
7038
7039function testimonialRotate(slider){
7040	
7041	var $testimonialLength = slider.find('li').length;
7042	var $currentTestimonial = slider.find('.pagination-switch.active').parent().index();
7043	
7044	//stop the rotation when toggles are closed
7045	if( slider.parents('.toggle').length > 0 && slider.parents('.toggle').hasClass('open') ) {
7046
7047		if( !slider.is('[data-style="minimal"]') ) {
7048			if( $currentTestimonial+1 == $testimonialLength) {
7049				slider.find('ul li:first-child').click();
7050			} else {
7051				slider.find('.pagination-switch.active').parent().next('li').click();
7052			}
7053		} else {
7054			slider.find('.testimonial-next-prev .next').click();
7055		}
7056			
7057	} else {
7058		
7059		if( !slider.is('[data-style="minimal"]') ) {
7060			if( $currentTestimonial+1 == $testimonialLength) {
7061				slider.find('ul li:first-child').click();
7062			} else {
7063				slider.find('.pagination-switch.active').parent().next('li').click();
7064			}
7065		} else {
7066			slider.find('.testimonial-next-prev .next').click();
7067		}
7068	
7069	}
7070
7071}
7072
7073function testimonialHeightResize(){
7074	$('.testimonial_slider:not(.disable-height-animation):not([data-style*="multiple_visible"])').each(function(){
7075		
7076		var $frontEndEditorTestimonialDiv =  ($('body.vc_editor').length > 0) ? '> div': 'blockquote';
7077		
7078		var $index = $(this).find('.controls ul li span.active').parent().index();
7079		var currentHeight = $(this).find('.slides '+$frontEndEditorTestimonialDiv).eq($index).height();
7080		$(this).find('.slides').stop(true,true).css({'height' : currentHeight + 40 + 'px' });
7081		
7082	});
7083}
7084
7085
7086function testimonialSliderHeight() {
7087		
7088	$('.testimonial_slider.disable-height-animation:not([data-style*="multiple_visible"])').each(function(){
7089		$tallestQuote = 0;
7090			
7091		$(this).find('blockquote').each(function(){
7092			($(this).height() > $tallestQuote) ? $tallestQuote = $(this).height() : $tallestQuote = $tallestQuote;
7093		});	
7094		
7095		//safety net incase height couldn't be determined
7096		if($tallestQuote == 0) $tallestQuote = 100;
7097		
7098		//set even height
7099		$(this).find('.slides').css('height',$tallestQuote+40+'px');
7100		
7101		//show the slider once height is set
7102		$(this).animate({'opacity':'1'});
7103
7104		fullWidthContentColumns();
7105
7106	});
7107
7108
7109}
7110
7111function testimonialSliderHeightMinimalMult() {
7112		
7113	$('.testimonial_slider[data-style="multiple_visible_minimal"]').each(function(){
7114		$tallestQuote = 0;
7115		
7116		$(this).find('blockquote > .inner p').css('height','auto');
7117		
7118		$(this).find('blockquote > .inner p').each(function(){
7119			($(this).height() > $tallestQuote) ? $tallestQuote = $(this).height() : $tallestQuote = $tallestQuote;
7120		});	
7121		
7122		//safety net incase height couldn't be determined
7123		if($tallestQuote == 0) $tallestQuote = 200;
7124		
7125		//set even height
7126		$(this).find('blockquote > .inner p').css('height',$tallestQuote+'px');
7127		
7128	});
7129
7130}
7131
7132if($('.testimonial_slider.disable-height-animation:not([data-style*="multiple_visible"])').length > 0) {
7133	testimonialSliderHeight(); 
7134	setTimeout(testimonialSliderHeight,500);
7135}
7136
7137if($('.testimonial_slider[data-style="multiple_visible_minimal"]').length > 0) {
7138	testimonialSliderHeightMinimalMult();
7139	setTimeout(testimonialSliderHeightMinimalMult,500);
7140}
7141
7142
7143/***************** WP Media Embed / External Embed ******************/
7144
7145//this isn't the for the video shortcode* This is to help any external iframe embed fit & resize correctly 
7146function responsiveVideoIframesInit(){
7147	$('iframe').each(function(){
7148		
7149		//make sure the iframe has a src (things like adsense don't)
7150		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){
7151			
7152			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) {
7153				
7154				$(this).addClass('iframe-embed');	
7155
7156				$(this).attr('data-aspectRatio', $(this).height() / $(this).width()).removeAttr('height').removeAttr('width');
7157				
7158				if($(this).parents('.post-area.masonry.classic').length > 0) {
7159						$(this).attr('data-aspectRatio', '0.56').removeAttr('height').removeAttr('width');
7160				}
7161
7162			}
7163			 
7164		}
7165		
7166	});
7167
7168
7169}
7170
7171function responsiveVideoIframes(){
7172	 $('iframe[data-aspectRatio]').each(function() {
7173	 	var newWidth = $(this).parent().width();
7174	 	 
7175		var $el = $(this);
7176		
7177		//in nectar slider
7178		if($(this).parents('.swiper-slide').length > 0) {
7179			if($(this).is(':visible')) $el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
7180		} 
7181		//all others
7182		else {
7183			$el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
7184		}
7185		
7186		
7187	});
7188}
7189
7190
7191function videoshortcodeSize(){
7192	//removed in 9.0.
7193}
7194
7195responsiveVideoIframesInit();
7196responsiveVideoIframes();
7197
7198
7199//unwrap post and protfolio videos
7200$('.video-wrap iframe').unwrap();
7201$('#sidebar iframe[src]').unwrap();
7202
7203$('audio').attr('width','100%');
7204$('audio').attr('height','100%');
7205
7206$('audio').css('visibility','visible');
7207
7208if($('body').hasClass('mobile')){
7209	$('video').css('visibility','hidden');
7210} else {
7211	$('video').css('visibility','visible');
7212}
7213
7214
7215$('.wp-video').each(function(){
7216	 var video = $(this).find('video').get(0);
7217	 video.addEventListener('loadeddata', function() {
7218	   $(window).trigger('resize');
7219	 }, false);
7220});
7221
7222//webkit video back button fix 
7223$('.main-content iframe[src]').each(function(){
7224	$(this).css({'opacity':'1', 'visibility':'visible'});
7225});
7226
7227
7228/***************** Nectar Video BG ******************/
7229
7230	$('.wpb_row:has(".nectar-video-wrap"):not(.fp-section)').each(function(i){
7231		$(this).css('z-index',100 + i);
7232	});
7233
7234	var min_w = 1200; // minimum video width allowed
7235	var vid_w_orig;  // original video dimensions
7236	var vid_h_orig;
7237	
7238    vid_w_orig = 1280;
7239    vid_h_orig = 720;
7240 
7241	function resizeVideoToCover() {
7242		$('.nectar-video-wrap').each(function(i){
7243			if($(this).find('video').length == 0 ) return;
7244
7245			if($(this).parents('#page-header-bg').length > 0) {
7246				if($('.container-wrap.auto-height').length > 0) return false;
7247				var $containerHeight = $(this).parents('#page-header-bg').outerHeight();			
7248				var $containerWidth = $(this).parents('#page-header-bg').outerWidth();
7249			} else {
7250				
7251				if($(this).hasClass('column-video')) {
7252					var $containerHeight = $(this).parents('.wpb_column').outerHeight();			
7253					var $containerWidth = $(this).parents('.wpb_column').outerWidth();			
7254				} else {
7255					var $containerHeight = $(this).parents('.wpb_row').outerHeight();			
7256					var $containerWidth = ($(this).parents('.full-width-section').length > 0) ? window.innerWidth : $(this).parents('.wpb_row').outerWidth();			
7257				}	
7258			}
7259			
7260		    // set the video viewport to the window size
7261		    $(this).width($containerWidth);
7262				if($(this).parents('#page-header-bg').length > 0) {
7263			    $(this).height($containerHeight);
7264				}
7265		
7266		    // use largest scale factor of horizontal/vertical
7267		    var scale_h = $containerWidth / vid_w_orig;
7268		    var scale_v = ($containerHeight - $containerHeight) / vid_h_orig; 
7269		    var scale = scale_h > scale_v ? scale_h : scale_v;
7270			
7271			//update minium width to never allow excess space
7272		    min_w = 1280/720 * ($containerHeight+40);
7273		    
7274		    // don't allow scaled width < minimum video width
7275		    if (scale * vid_w_orig < min_w) {scale = min_w / vid_w_orig;}
7276		        
7277		    // now scale the video
7278		    $(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * vid_w_orig +0));
7279		    $(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * vid_h_orig +0));
7280		    
7281		    // and center it by scrolling the video viewport
7282		    $(this).scrollLeft(($(this).find('video').width() - $containerWidth) / 2);
7283		    $(this).scrollTop(($(this).find('video').height() - ($containerHeight)) / 2);
7284		    $(this).find('.mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($containerHeight)) / 2);
7285
7286
7287		    //align bottom
7288		    if($(this).attr('data-bg-alignment') == 'center bottom' || $(this).attr('data-bg-alignment') == 'bottom'){
7289		    	$(this).scrollTop(($(this).find('video').height() - ($containerHeight+6)));
7290		    }
7291		    //align top
7292		    else if($(this).attr('data-bg-alignment') == 'center top' || $(this).attr('data-bg-alignment') == 'top') {
7293		    	$(this).scrollTop(0);
7294		    } 
7295				
7296				//add loaded class
7297				$(this).addClass('position-loaded');
7298		});
7299	}
7300    
7301    //init
7302    function videoBGInit(){
7303	    setTimeout(function(){
7304	    	resizeVideoToCover();
7305	    	$('.video-color-overlay').each(function(){
7306	    		$(this).css('background-color',$(this).attr('data-color'));
7307	    	});
7308	    	$('.nectar-video-wrap').each(function(i){
7309
7310	    		if($(this).find('video').length == 0) return;
7311
7312	    		var $headerVideo = ($(this).parents('#page-header-bg').length > 0) ? true : false;
7313	    		var $that = $(this);
7314
7315	    		 var videoReady = setInterval(function(){
7316
7317	        		if($that.find('video').get(0).readyState > 3) {
7318								
7319								if(!nectarDOMInfo.usingMobileBrowser) {
7320		        			$that.transition({'opacity':'1'},400);
7321				    			$that.find('video').transition({'opacity':'1'},400);
7322				    			$that.parent().find('.video-color-overlay').transition({'opacity':'0.7'},400);
7323									if($headerVideo == true) {
7324					    			pageHeaderTextEffect();
7325								  }
7326								}
7327
7328							//remove page loading screen
7329							$('#ajax-loading-screen').addClass('loaded');
7330							setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
7331					
7332
7333							clearInterval(videoReady);
7334						}
7335						
7336	    		},60);
7337					
7338					if(nectarDOMInfo.usingMobileBrowser) {
7339						if($that.parents('.full-width-section').length > 0 && $that.parents('#nectar_fullscreen_rows').length == 0) {
7340							$that.css('left','50%');
7341						} else {
7342							$that.css('left','0px');
7343						}
7344						
7345						if($headerVideo == true) {
7346							pageHeaderTextEffect();
7347						}
7348						$that.find('video')[0].onplay = function(){
7349							$that.transition({'opacity':'1'},400);
7350							$that.find('video').transition({'opacity':'1'},400);
7351							$that.parent().find('.video-color-overlay').transition({'opacity':'0.7'},400);
7352						};
7353					}
7354	    		
7355	    	});
7356	    },300);
7357
7358		if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
7359
7360				
7361				$('.nectar-video-wrap').each(function(){
7362					
7363						if(!$(this).find('video').is('[muted]')) {
7364
7365								//autoplay not supported unless muted
7366								$(this).parent().find('.mobile-video-image').show();
7367								$(this).remove();
7368						}
7369						
7370				});
7371		
7372		
7373		}
7374
7375		
7376		 if(navigator.userAgent.indexOf('Chrome') > 0 && !/Edge\/12./i.test(navigator.userAgent) && !/Edge\/\d./i.test(navigator.userAgent)) { 
7377		 	
7378		 	$('.nectar-video-wrap').each(function(i){
7379		 		if(jQuery(this).find('video source[type="video/webm"]').length > 0 ) {
7380				  	var webmSource = jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
7381		          	var firstVideo = jQuery(this).find('video').get(0);
7382		          	firstVideo.src = webmSource;
7383		          	firstVideo.load();
7384		         }
7385            });
7386	    }
7387
7388
7389
7390
7391	    jQuery(".vc_row").each(function() {
7392	        var youtubeUrl, youtubeId, $row = jQuery(this);
7393	        $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
7393d($row.find('.nectar-youtube-bg'), youtubeId))) : $row.find(".nectar-youtube-bg").remove()
7394
7395	        //remove yt url
7396	        $row.find('.nectar-youtube-bg span').remove();
7397					
7398					if(!nectarDOMInfo.usingMobileBrowser) {
7399		        $row.find('.nectar-video-wrap, .nectar-youtube-bg').css({'opacity':'1','width':'100%', 'height':'100%'});
7400					}
7401	         $row.find('.video-color-overlay').transition({'opacity':'0.7'},400);
7402	    });
7403		
7404
7405		function nectarInsertYoutubeVideoAsBackground($element, youtubeId, counter) {
7406		    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() {
7407		        nectarInsertYoutubeVideoAsBackground($element, youtubeId, counter++)
7408		    }, 100);
7409		    var $container = $element.prepend('<div class="vc_video-bg"><div class="inner"></div></div>').find(".inner");
7410		    new YT.Player($container[0], {
7411		        width: "100%",
7412		        height: "100%",
7413		        videoId: youtubeId,
7414		        playerVars: {
7415		            playlist: youtubeId,
7416		            iv_load_policy: 3,
7417		            enablejsapi: 1,
7418		            disablekb: 1,
7419		            autoplay: 1,
7420		            controls: 0,
7421		            showinfo: 0,
7422		            rel: 0,
7423		            loop: 1
7424		        },
7425		        events: {
7426		            onReady: function(event) {
7427		                event.target.mute().setLoop(!0);
7428										nectarResizeVideoBackground($element);
7429		            }
7430		        }
7431		    }), nectarResizeVideoBackground($element), jQuery(window).on("resize", function() {
7432		        nectarResizeVideoBackground($element);
7433		    });
7434				
7435				setTimeout(function(){
7436					 nectarResizeVideoBackground($element);
7437				},100);
7438		}
7439
7440		function nectarResizeVideoBackground($element) {
7441		    var iframeW, iframeH, marginLeft, marginTop, containerW = $element.innerWidth(),
7442		        containerH = $element.innerHeight(),
7443		        ratio1 = 16,
7444		        ratio2 = 9;
7445		    ratio1 / ratio2 > containerW / containerH ? (iframeW = containerH * (ratio1 / ratio2), 
7446		    	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", 
7447		    	marginLeft = -Math.round((iframeW - containerW) / 2) + "px", iframeW += "px", iframeH += "px"), 
7448		    	$element.find(".vc_video-bg iframe").css({
7449			        maxWidth: "1000%",
7450			        marginLeft: marginLeft,
7451			        marginTop: marginTop,
7452			        width: iframeW,
7453			        height: iframeH
7454			    })
7455		}
7456
7457		function nectarExtractYoutubeId(url) {
7458		    if ("undefined" == typeof url) return !1;
7459		    var id = url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);
7460		    return null !== id ? id[1] : !1
7461		}
7462
7463
7464	}
7465
7466	if($('.nectar-video-wrap').length > 0 || $('.nectar-youtube-bg').length > 0) {
7467		videoBGInit();
7468	}
7469
7470
7471/*-------------------------------------------------------------------------*/
7472/*	4.	Header + Search
7473/*-------------------------------------------------------------------------*/	 
7474
7475////mobile megamenus without titles / nested groupings
7476var $mobileNavSelector = ($('.off-canvas-menu-container.mobile-only').length > 0) ? '.off-canvas-menu-container.mobile-only ': '#mobile-menu .container ';
7477$($mobileNavSelector+'.megamenu > ul > li > a').each(function(){
7478	if( $(this).text() == '–' ) {
7479		$navLIs = $(this).parent().find('> ul > li').clone();
7480		$(this).parent().find('ul').remove();
7481		$(this).parent().parent().append($navLIs);
7482		$(this).parent().remove();
7483	}
7484});
7485
7486/***************** Slide Out Widget Area **********/
7487
7488var $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;
7489var $bodyBorderWidth = ($('.body-border-right').length > 0) ? $('.body-border-right').width() : 0;
7490var $resetHeader;
7491
7492
7493function mobileBreakPointCheck() {
7494	var $mobileBreakpoint = ( $('body[data-header-breakpoint]').length > 0 && $('body').attr('data-header-breakpoint') != '1000' ) ? parseInt($('body').attr('data-header-breakpoint')) : 1000;
7495	var $withinCustomBreakpoint = false;
7496
7497	if($mobileBreakpoint != 1000) {
7498		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 ) {
7499			$withinCustomBreakpoint = true;
7500		}
7501	}
7502
7503	return $withinCustomBreakpoint;
7504}
7505
7506//icon effect html creation
7507if($('#slide-out-widget-area.slide-out-from-right-hover').length > 0) {
7508
7509	if($('#ajax-content-wrap > .slide-out-widget-area-toggle').length == 0) {
7510		$('<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');
7511		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');
7512	}
7513
7514
7515	function calculateHoverNavMinHeight() {
7516		$widgetHeights = 0;
7517		$('#slide-out-widget-area > .widget').each(function(){
7518			$widgetHeights += $(this).height();
7519		});
7520		$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();
7521
7522		$('#slide-out-widget-area .inner').css({'height':'auto', 'min-height': $menuHeight  });
7523
7524		$('#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);
7525	
7526	}
7527
7528	function openRightHoverNav() {
7529
7530		
7531
7532			calculateHoverNavMinHeight();
7533
7534			if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) && $('#slide-out-widget-area.open').length > 0) {
7535				mobileCloseNavCheck();
7536				return;
7537			}
7538			
7539
7540			$('#slide-out-widget-area').css({ 'transform': 'translate3d(0,0,0)' }).addClass('open');
7541
7542			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;
7543
7544			//icon effect
7545			////set pos 
7546			if($('header#top .container .span_9 > .slide-out-widget-area-toggle').length > 0) {
7547				
7548				var secondaryBarHeight = ($('#header-secondary-outer').length > 0) ? $('#header-secondary-outer').height() : 0; 
7549				
7550
7551				if($('body.mobile').length > 0) {
7552
7553					$('.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 });
7554				} else {
7555
7556					if($bodyBorderHeaderColorMatch) {
7557
7558						var $extraCushion = ($('#header-outer[data-has-menu="false"]').length > 0) ? 2 : 1;
7559						$('.slide-out-hover-icon-effect').css({
7560							'top': nectarDOMInfo.adminBarHeight + secondaryBarHeight + parseInt($('header#top nav >ul .slide-out-widget-area-toggle a').css('padding-top')), 
7561							'right': 29 + $extraCushion });
7562
7563					} else {
7564
7565						var $withinCustomBreakpoint = mobileBreakPointCheck();
7566
7567						if($('body.ascend').length > 0 && $withinCustomBreakpoint != true) {
7568							var $extraCushion = ($('#header-outer[data-has-menu="false"]').length > 0) ? 2 : 1;
7569							$('.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 });
7570						} else {
7571
7572							if($('body.material').length > 0) {
7573								if($('#header-outer[data-format="centered-menu-bottom-bar"]').length > 0) {
7574									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();
7575									if($('#header-secondary-outer.hide-up').length > 0) { secondaryBarHeight = 0; }
7576									$('.slide-out-hover-icon-effect').css({'top': secondaryBarHeight + parseInt($nectarHamMenuPos.top) - nectarDOMInfo.scrollTop , 'right': parseInt($('#header-outer header >.container').css('padding-right')) + 2  });
7577								} else {
7578									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();
7579									if($('#header-secondary-outer.hide-up').length > 0) { secondaryBarHeight = 0; }
7580									$('.slide-out-hover-icon-effect').css({'top': nectarDOMInfo.adminBarHeight + secondaryBarHeight + parseInt($nectarHamMenuPos.top) , 'right': parseInt($('#header-outer header >.container').css('padding-right')) + 2  });
7581								}
7582								
7583								
7584							} else {
7585								$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');
7586								$('.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')) });
7587							}
7588						}
7589					}
7590					
7591				}
7592			}
7593
7594			////open
7595
7596			$('.slide-out-hover-icon-effect .lines-button').removeClass('no-delay').addClass('unhidden-line');
7597			
7598
7599			if($('#header-outer[data-permanent-transparent="1"]').length == 0 && $('#nectar_fullscreen_rows').length == 0 && !nectarDOMInfo.usingFrontEndEditor) {
7600
7601				if(!($(window).scrollTop() == 0 && $('#header-outer.transparent').length > 0)) {
7602
7603					if($('body.mobile').length == 0 && $bodyBorderHeaderColorMatch) {
7604
7605						$('#header-outer').attr('data-transparent','true').addClass('no-bg-color').addClass('slide-out-hover');
7606						$('#header-outer header, #header-outer > .cart-outer').addClass('all-hidden');
7607					}
7608
7609				}
7610
7611				if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('body.mobile').length == 0 && $bodyBorderHeaderColorMatch) {
7612					var headerResize = $('#header-outer').attr('data-header-resize');
7613					if(headerResize == 1) {
7614
7615						$(window).off('scroll',bigNav);
7616						$(window).off('scroll',smallNav);
7617
7618
7619					} else {
7620						
7621						$(window).off('scroll',opaqueCheck);
7622						$(window).off('scroll',transparentCheck);
7623					}
7624				}
7625
7626			}
7627
7628			if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
7629				$(window).on('mousemove.rightOffsetCheck',closeNavCheck);
7630			}
7631
7632	}
7633
7634	function closeNavCheck(e) {
7635		var $windowWidth = $(window).width();
7636		if(e.clientX < $windowWidth - 340 - $bodyBorderWidth) {
7637
7638				$(window).off('mousemove.rightOffsetCheck',closeNavCheck);
7639
7640				$('#slide-out-widget-area').css({ 'transform': 'translate3d(341px,0,0)' }).removeClass('open');
7641
7642				$('#header-outer').removeClass('style-slide-out-from-right');
7643
7644				$('.slide-out-hover-icon-effect .lines-button').removeClass('unhidden-line').addClass('no-delay');
7645
7646				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;
7647
7648				if($('#header-outer[data-permanent-transparent="1"]').length == 0) {
7649
7650					if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('body.mobile').length == 0 && $bodyBorderHeaderColorMatch) {
7651
7652						if($('body.mobile').length == 0) {
7653							$('#header-outer').removeClass('no-bg-color');
7654							$('#header-outer header, #header-outer > .cart-outer').removeClass('all-hidden');
7655						}
7656					}
7657
7658					if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('body.mobile').length == 0 && $bodyBorderHeaderColorMatch) {
7659						var headerResize = $('#header-outer').attr('data-header-resize');
7660						if(headerResize == 1) {
7661						
7662							$(window).off('scroll.headerResizeEffect');
7663							if($(window).scrollTop() == 0) {
7664								$(window).on('scroll.headerResizeEffect',smallNav); 
7665
7666								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) {
7667									$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
7668										'padding' : '0'			
7669									},{queue:false, duration:250, easing: 'easeOutCubic'});	
7670								}
7671							}
7672							else {
7673								$(window).on('scroll.headerResizeEffect',bigNav);
7674							}
7675							
7676				
7677						} else {
7678							
7679							$(window).off('scroll.headerResizeEffectOpaque');
7680							$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
7681						}
7682					}
7683				}
7684
7685			}
7686
7687	}
7688
7689	function mobileCloseNavCheck(e) {
7690		
7691
7692				$('#slide-out-widget-area').css({ 'transform': 'translate3d(341px,0,0)' }).removeClass('open');
7693
7694				$('#header-outer').removeClass('style-slide-out-from-right');
7695
7696				$('.slide-out-hover-icon-effect .lines-button').removeClass('unhidden-line').addClass('no-delay');
7697
7698				if($('#header-outer[data-permanent-transparent="1"]').length == 0) {
7699
7700					$('#header-outer').removeClass('no-bg-color');
7701					$('#header-outer header').removeClass('all-hidden');
7702
7703				}
7704
7705				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;
7706
7707				if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('body.mobile').length == 0 && $bodyBorderHeaderColorMatch) {
7708					
7709					var headerResize = $('#header-outer').attr('data-header-resize');
7710					if(headerResize == 1) {
7711					
7712						$(window).off('scroll.headerResizeEffect');
7713						if($(window).scrollTop() == 0) {
7714							$(window).on('scroll.headerResizeEffect',smallNav); 
7715
7716							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) {
7717								$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
7718									'padding' : '0'			
7719								},{queue:false, duration:250, easing: 'easeOutCubic'});	
7720							}
7721						}
7722						else {
7723							$(window).on('scroll.headerResizeEffect',bigNav);
7724						}
7725						
7726			
7727					} else {
7728						
7729						$(window).off('scroll.headerResizeEffectOpaque');
7730						$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
7731					}
7732			}
7733
7734			
7735
7736	}
7737
7738	//hover triggered
7739	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
7740		$('body').on('mouseenter','#header-outer .slide-out-widget-area-toggle:not(.std-menu) a',openRightHoverNav);
7741	}
7742	else {
7743		$('body').on('click','.slide-out-widget-area-toggle:not(.std-menu) a',openRightHoverNav);
7744	}
7745
7746	$(window).on('smartresize',calculateHoverNavMinHeight);
7747
7748}
7749
7750
7751
7752function setMaterialWidth() {
7753	
7754	
7755	$('#slide-out-widget-area.slide-out-from-right').css({
7756		'padding-top' : $(window).height()*0.1,
7757		'padding-bottom' : $(window).height()*0.1
7758	});
7759
7760	slideOutWidgetOverflowState();
7761}
7762
7763if($('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length > 0) {
7764	setMaterialWidth();
7765}
7766
7767//icon hover effect
7768if($('body.material').length > 0 && $('body[data-slide-out-widget-area-style="slide-out-from-right-hover"]').length == 0) {
7769
7770	if($('body[data-slide-out-widget-area-style*="fullscreen"]').length == 0) {
7771		var $menuIconClone = $('header#top nav ul .slide-out-widget-area-toggle a > span > i').clone();
7772		$menuIconClone.addClass('hover-effect');
7773		$('header#top nav ul .slide-out-widget-area-toggle a > span').append($menuIconClone);
7774
7775		var $menuIconClone2 = $('header#top .slide-out-widget-area-toggle.mobile-icon a > span > i').clone();
7776		$menuIconClone2.addClass('hover-effect');
7777		$('header#top .slide-out-widget-area-toggle.mobile-icon a > span').append($menuIconClone2);
7778	}
7779
7780	$('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>'));
7781}
7782
7783if($('body.material #boxed').length > 0 && $('body[data-slide-out-widget-area-style="slide-out-from-right-hover"]').length > 0) {
7784	$('#ajax-content-wrap > .slide-out-widget-area-toggle.slide-out-hover-icon-effect.small').insertAfter('.ocm-effect-wrap');
7785}
7786
7787//move material skin default ocm
7788if($('body.material').length > 0 && $('body[data-slide-out-widget-area-style*="fullscreen"]').length == 0) {
7789	$('body.material #slide-out-widget-area.slide-out-from-right .slide_out_area_close').insertAfter('.ocm-effect-wrap');
7790	$('#slide-out-widget-area-bg').insertAfter('.ocm-effect-wrap');
7791	$('#slide-out-widget-area').insertAfter('.ocm-effect-wrap');
7792	
7793}
7794
7795//remove trans on material search/ocm when resizing 
7796if($('body.material[data-header-search="true"]').length > 0 || $('body.material .ocm-effect-wrap').length > 0 ) {
7797		
7798	var materialTransTO;
7799
7800	$(window).resize(function(){
7801
7802		clearTimeout(materialTransTO);
7803
7804		$('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');
7805
7806		materialTransTO = setTimeout(function(){
7807			$('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');
7808		},250);
7809
7810		setMaterialWidth();
7811
7812	});
7813}
7814
7815
7816function materialOCM_Size() {
7817	if($('.ocm-effect-wrap.material-ocm-open').length > 0 ) {
7818
7819		//$('#ajax-content-wrap').css({'position' : 'relative', 'top' : '-' + $(window).scrollTop() + 'px' });
7820		$('.ocm-effect-wrap').css({'height': $(window).height() });
7821		$('.ocm-effect-wrap-inner').css({'padding-top': nectarDOMInfo.adminBarHeight });
7822		
7823		
7824	}
7825}
7826$(window).resize(materialOCM_Size);
7827
7828
7829function OCM_dropdown_function() {
7830	var $nectar_ocm_dropdown_func = ($('#slide-out-widget-area[data-dropdown-func]').length > 0) ? $('#slide-out-widget-area').attr('data-dropdown-func') : 'default';
7831	if($nectar_ocm_dropdown_func == 'separate-dropdown-parent-link') {
7832		$('#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>');
7833	}
7834}
7835
7836OCM_dropdown_function();
7837
7838//click triggered
7839$('body').on('click','.slide-out-widget-area-toggle:not(.std-menu) a.closed:not(.animating)',function(){
7840	if(animating == 'true' || $('.slide-out-from-right-hover').length > 0) return false;
7841	var $that = $(this);
7842
7843	$('#header-outer').removeClass('no-transition');
7844
7845	//slide out from right
7846	if($('#slide-out-widget-area').hasClass('slide-out-from-right')) {
7847
7848		var $slideOutAmount = ($('.body-border-top').length > 0 && $('body.mobile').length == 0) ? $('.body-border-top').height() : 0;
7849
7850
7851		if($('body.material').length == 0) {
7852
7853				//calc height if used bottom meta
7854				$('#slide-out-widget-area .inner').css({'height':'auto', 'min-height': $('#slide-out-widget-area').height() - 25 - $('.bottom-meta-wrap').height() });
7855
7856				if($('#boxed').length == 0) {
7857					$('.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');
7858
7859					var $withinCustomBreakpoint = mobileBreakPointCheck();
7860
7861					if($('#header-outer[data-format="centered-logo-between-menu"]').length == 0 || $withinCustomBreakpoint) {
7862						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) {
7863							$('#header-outer').stop(true).css('transform','translateY(0)').transition({ x: '-' + (300+$slideOutAmount) +'px'},700,'easeInOutCubic');
7864						} else {
7865							$('#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');
7866						}
7867					} else {
7868						$('#header-outer header#top nav > ul.buttons, body:not(.material) #header-outer .cart-outer .cart-menu-wrap').transition({ x: '-300px'},700,'easeInOutCubic');
7869					}
7870
7871					$('#ascrail2000').transition({ 'x': '-' + (300+$slideOutAmount) +'px' },700,'easeInOutCubic');
7872					$('body:not(.ascend):not(.material) #header-outer .cart-menu').stop(true).transition({ 'x': '300px' },700,'easeInOutCubic');
7873				}
7874
7875				$('#slide-out-widget-area').stop(true).transition({ x: '-' + $slideOutAmount +'px' },700,'easeInOutCubic').addClass('open');
7876
7877
7878				if($('#boxed').length == 0) {
7879					//full width menu adjustments
7880					if($('#header-outer[data-full-width="true"]').length > 0 && !$('body').hasClass('mobile')) { 
7881						$('#header-outer').addClass('highzI'); 
7882						$('#ascrail2000').addClass('z-index-adj');
7883
7884						if($('#header-outer[data-format="centered-logo-between-menu"]').length == 0) {
7885							if($bodyBorderWidth == 0)
7886								$('header#top #logo').stop(true).transition({ x: (300+$slideOutAmount) +'px' },700,'easeInOutCubic'); 
7887							
7888						}
7889
7890						$('header#top .slide-out-widget-area-toggle .lines-button').addClass('close');
7891
7892						if($('#header-outer[data-remove-border="true"]').length > 0) {
7893							$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '64px' },700,'easeInOutCubic');
7894						} else {
7895							$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '89px' },700,'easeInOutCubic'); 
7896						}
7897
7898						$('body #header-outer nav > ul > li > a').css({'margin-bottom':'0'});
7899						
7900					}
7901				}
7902
7903				$('#header-outer').addClass('style-slide-out-from-right');
7904
7905				//fade In BG Overlay
7906				$('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).stop(true).transition({
7907					'opacity' : 1
7908				},700,'easeInOutCubic',function(){
7909					$('.slide-out-widget-area-toggle:not(.std-menu) > div > a').removeClass('animating');
7910				});
7911				
7912				//hide menu if no space
7913				if($('#header-outer[data-format="centered-logo-between-menu"]').length == 0) {
7914					$logoWidth = ($('#logo img:visible').length > 0) ? $('#logo img:visible').width() : $('#logo').width();
7915					if($('header#top nav > .sf-menu').offset().left - $logoWidth - 300 < 20) $('#header-outer').addClass('hidden-menu');
7916				} else {
7917					$('#header-outer').addClass('hidden-menu-items');
7918				}
7919
7920				var headerResize = $('#header-outer').attr('data-header-resize');
7921
7922				if($('#header-outer[data-remove-fixed="1"]').length == 0) {
7923					if($bodyBorderHeaderColorMatch == true && headerResize == 1) {
7924						
7925						$('#header-outer').stop(true).transition({ y: '0' },0).addClass('transparent').css('transition','transform');
7926						if($('#header-outer').attr('data-transparent-header') != 'true') {
7927							$('#header-outer').attr('data-transparent-header','true').addClass('pseudo-data-transparent');
7928						}
7929
7930						$(window).off('scroll',bigNav);
7931						$(window).off('scroll',smallNav);
7932
7933					} else if ($bodyBorderHeaderColorMatch == true) {
7934						$('#header-outer').addClass('transparent');
7935						$(window).off('scroll',opaqueCheck);
7936						$(window).off('scroll',transparentCheck);
7937
7938						if($('#header-outer').attr('data-transparent-header') != 'true') {
7939							$('#header-outer').attr('data-transparent-header','true').addClass('pseudo-data-transparent');
7940						}
7941					}
7942				}
7943
7944		} else if ( $('body.material').length > 0 ) {
7945
7946			//material
7947			
7948			//move ajax loading outside
7949			if($('#ajax-loading-screen').length > 0 && $('.ocm-effect-wrap #ajax-loading-screen').length > 0) {
7950				$('#ajax-loading-screen').insertBefore('.ocm-effect-wrap');
7951			}
7952			
7953			////hide secondary header when not at top with hhun
7954			if($(window).scrollTop() > 40) {
7955				
7956				$('body[data-hhun="1"] #header-secondary-outer').addClass('hidden');
7957			}
7958
7959
7960			setTimeout(function(){ $('.slide-out-widget-area-toggle:not(.std-menu) > div > a').removeClass('animating'); },300);
7961			$('#slide-out-widget-area, #slide-out-widget-area-bg, #header-outer .slide-out-widget-area-toggle').addClass('material-open');
7962
7963
7964			//handle bottom bar nav
7965			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') {
7966				$('#header-outer:not(.fixed-menu)').css('top', nectarDOMInfo.adminBarHeight - $(window).scrollTop() + 'px' );
7967				
7968				if($('#header-secondary-outer').length > 0  && $('#header-outer.fixed-menu').length > 0) {
7969					$('#header-secondary-outer').css('visibility','hidden');
7970				}
7971				
7972			}
7973			
7974			$('#ajax-content-wrap').css({'position' : 'relative', 'top' : '-' + $(window).scrollTop() + 'px' });
7975			$('.ocm-effect-wrap-inner').css({'padding-top': nectarDOMInfo.adminBarHeight });
7976			$('#fp-nav').addClass('material-ocm-open');
7977			$('body').addClass('material-ocm-open');
7978			$('.ocm-effect-wrap').css({'height': window.innerHeight });
7979
7980			setTimeout(function(){
7981				$('.ocm-effect-wrap').addClass('material-ocm-open');
7982			},40);
7983			
7984			
7985			$('body > .slide_out_area_close').addClass('follow-body');
7986
7987			//icon effect
7988			$('#header-outer:not([data-format="left-header"]) header#top .slide-out-widget-area-toggle a').addClass('effect-shown');
7989
7990			//handle hhun when at top
7991			$('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)'});
7992
7993			setTimeout(function(){
7994				$('body > .slide_out_area_close').addClass('material-ocm-open');
7995			},350);
7996
7997
7998		}
7999
8000
8001	}
8002     else if($('#slide-out-widget-area').hasClass('fullscreen')) {
8003
8004     	if ( $('body.material').length > 0 ) {
8005     		$('header#top .slide-out-widget-area-toggle a').addClass('menu-push-out');
8006     	}
8007
8008		//scroll away from fixed reveal footer if shown (firefox bug with bluring over it)
8009		var $scrollDelay = 0;
8010		var $scrollDelay2 = 0;
8011
8012		if($(window).scrollTop() + $(window).height() > $('.blurred-wrap').height() && $('#nectar_fullscreen_rows').length == 0) {
8013			$('body,html').stop().animate({
8014				scrollTop: $('.blurred-wrap').height() - $(window).height()
8015			},600,'easeInOutCubic');
8016			$scrollDelay = 550;
8017			$scrollDelay2 = 200;
8018		}
8019
8020		$('header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button').addClass('close');
8021		setTimeout(function(){ $('.blurred-wrap').addClass('blurred'); },$scrollDelay);
8022		$('#slide-out-widget-area.fullscreen').show().addClass('open');
8023
8024		if($('.nectar-social-sharing-fixed').length == 0) {
8025			hideToTop();
8026		}
8027
8028		//remove box shadow incase at the top of the page with nectar box roll above
8029		$('.container-wrap').addClass('no-shadow');
8030		$('#header-outer').stop(true).css('transform','translateY(0)');
8031
8032		setTimeout(function(){
8033
8034			$('.off-canvas-menu-container .menu > li').each(function(i){
8035				$(this).delay(i*50).transition({y: 0, 'opacity': 1},800,'easeOutExpo');
8036			});
8037
8038			$('#slide-out-widget-area.fullscreen .widget').each(function(i){
8039				$(this).delay(i*100).transition({y: 0, 'opacity': 1},800,'easeOutExpo');
8040			});
8041		},370+$scrollDelay2);
8042
8043		setTimeout(function(){
8044			$('#slide-out-widget-area .off-canvas-social-links').addClass('line-shown');
8045
8046			$('#slide-out-widget-area .off-canvas-social-links li').each(function(i){
8047				$(this).delay(i*50).transition({'scale':1},400,'easeOutCubic');
8048			});
8049			$('#slide-out-widget-area .bottom-text').transition({'opacity':0.7},400,'easeOutCubic');
8050		},750+$scrollDelay2);
8051		
8052		//fade In BG Overlay
8053		setTimeout(function(){
8054			$easing = ($('body.mobile').length > 0) ? 'easeOutCubic' : 'easeInOutQuint';
8055			$('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).show().stop(true).transition({
8056				'y' : '0%'
8057			},920,$easing,function(){
8058				$('.slide-out-widget-area-toggle > div > a').removeClass('animating');
8059			});
8060		},50+$scrollDelay2);
8061
8062		//overflow state 
8063		slideOutWidgetOverflowState();
8064		if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').addClass('at-content');
8065		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());
8066	} 
8067
8068	else if($('#slide-out-widget-area').hasClass('fullscreen-alt')) {
8069
8070		if ( $('body.material').length > 0 ) {
8071     		$('header#top .slide-out-widget-area-toggle a').addClass('menu-push-out');
8072     	}
8073
8074		$('header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button').addClass('close');
8075		$('#slide-out-widget-area.fullscreen-alt').show().addClass('open');
8076		$('#slide-out-widget-area-bg').addClass('open');
8077
8078		$('body > div[class*="body-border"]').css('z-index','9995');
8079
8080		$('.off-canvas-menu-container .menu').transition({y: '0px', 'opacity': 1},0);	
8081
8082		if($('.nectar-social-sharing-fixed').length == 0) {
8083			hideToTop();
8084		}
8085
8086		if($('#header-outer.transparent').length == 0) {
8087
8088
8089		}
8090		else { 
8091
8092			if($('.body-border-top').length > 0) {
8093				$('.admin-bar #slide-out-widget-area-bg.fullscreen-alt').css({'padding-top': ($('.body-border-top').outerHeight(true)+32) + 'px'});
8094				$('body:not(.admin-bar) #slide-out-widget-area-bg.fullscreen-alt').css({'padding-top': ($('.body-border-top').outerHeight(true))+ 'px'});
8095			}
8096		}
8097		
8098		//set translateY to 0 in all cases
8099		$('#header-outer').stop(true).css('transform','translateY(0)');
8100
8101		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) {
8102
8103			$('#header-outer').stop(true).css('transform','translateY(0)').addClass('transparent');
8104			if($('#header-outer').attr('data-transparent-header') != 'true') {
8105				$('#header-outer').attr('data-transparent-header','true').addClass('pseudo-data-transparent');
8106			}
8107		}
8108
8109		$('.off-canvas-menu-container .clip-wrap').css('transition-duration','0s');
8110
8111		setTimeout(function(){
8112
8113			$('.off-canvas-menu-container .menu > li').each(function(i){
8114				$(this).delay(i*50).transition({y: 0, 'opacity': 1},750,'easeOutCubic').addClass('no-pointer-events');
8115			});
8116
8117			setTimeout(function(){
8118				$('.off-canvas-menu-container .menu > li').removeClass('no-pointer-events');
8119				$('.off-canvas-menu-container .clip-wrap').css('transition-duration','.45s');
8120			},500);
8121
8122			$('#slide-out-widget-area.fullscreen-alt .widget').each(function(i){
8123				$(this).delay(i*100).transition({y: 0, 'opacity': 1},650,'easeOutCubic');
8124			});
8125		},200);
8126
8127		setTimeout(function(){
8128			$('#slide-out-widget-area .off-canvas-social-links').addClass('line-shown');
8129
8130			$('#slide-out-widget-area .off-canvas-social-links li').css('opacity','1').each(function(i){
8131				$(this).delay(i*50).transition({'scale':1},400,'easeOutCubic');
8132			});
8133			$('#slide-out-widget-area .bottom-text').transition({'opacity':1},600,'easeOutCubic');
8134		},200);
8135		
8136		//fade In BG Overlay
8137		if($('#slide-out-widget-area-bg').hasClass('solid')) $opacity = 1;
8138		if($('#slide-out-widget-area-bg').hasClass('dark')) $opacity = 0.97;
8139		if($('#slide-out-widget-area-bg').hasClass('medium')) $opacity = 0.6;
8140		if($('#slide-out-widget-area-bg').hasClass('light')) $opacity = 0.4;
8141		$('#slide-out-widget-area-bg').removeClass('no-transition');
8142		
8143
8144		$('#slide-out-widget-area-bg').addClass('padding-removed').css({'height':'100%','width':'100%', 'left':'0','opacity': $opacity});
8145		
8146
8147		setTimeout(function(){
8148			$('.slide-out-widget-area-toggle > div > a').removeClass('animating');
8149		},600);
8150			
8151
8152		//overflow state 
8153		slideOutWidgetOverflowState();
8154		if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').addClass('at-content');
8155		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());
8156	}
8157
8158
8159
8160	//add open class
8161	$('#header-outer').removeClass('side-widget-closed').addClass('side-widget-open');
8162
8163	//give header transparent state
8164	if($('#header-outer[data-transparency-option="1"]').length > 0 && $('#boxed').length == 0 && $('#header-outer[data-full-width="true"]').length > 0 && !nectarDOMInfo.usingFrontEndEditor) {
8165			if($('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length == 0 && $('body.material #header-outer[data-condense="true"]').length == 0) {
8166				$('#header-outer').addClass('transparent');
8167			}
8168	}
8169
8170	//dark slide transparent nav
8171	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');
8172	
8173	$('.slide-out-widget-area-toggle > div > a').removeClass('closed').addClass('open');
8174	$('.slide-out-widget-area-toggle > div > a').addClass('animating');
8175
8176	return false;
8177});
8178
8179$('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){
8180
8181	if (e.originalEvent == undefined && $('.slide_out_area_close.non-human-allowed').length == 0 ) { return; }
8182
8183	if($('.slide-out-widget-area-toggle:not(.std-menu) a.animating').length > 0) return;
8184
8185	$('#header-outer').removeClass('no-transition');
8186
8187
8188	var $that = $(this);
8189
8190	$('.slide-out-widget-area-toggle:not(.std-menu) a').removeClass('open').addClass('closed');
8191	$('.slide-out-widget-area-toggle:not(.std-menu) a').addClass('animating');
8192
8193	//slide out from right
8194	if($('#slide-out-widget-area').hasClass('slide-out-from-right')) {
8195
8196			if($('body.material').length == 0) {
8197
8198				$('.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');
8199
8200				if($('#header-outer[data-transparency-option="1"]').length > 0  && $('#boxed').length == 0) {
8201					$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');
8202					$('#header-outer').stop(true).transition({ x: '0px', 'background-color': $currentRowBG },700,'easeInOutCubic');
8203				} else {
8204					$('#header-outer').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
8205				}
8206
8207				$('#ascrail2000').stop(true).transition({ 'x': '0px' },700,'easeInOutCubic');
8208				$('body:not(.ascend):not(.material) #header-outer .cart-menu').stop(true).transition({ 'x': '0px' },700,'easeInOutCubic');
8209
8210				$('#slide-out-widget-area').stop(true).transition({ x: '301px' },700,'easeInOutCubic').removeClass('open');
8211
8212
8213				if($('#boxed').length == 0) {
8214					if($('#header-outer[data-full-width="true"]').length > 0) {  
8215						$('#header-outer').removeClass('highzI'); 
8216						$('header#top #logo').stop(true).transition({ x: '0px' },700,'easeInOutCubic'); 
8217						$('.lines-button').removeClass('close');
8218
8219						$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
8220
8221					}
8222				}
8223
8224				if($('#header-outer[data-format="centered-logo-between-menu"]').length > 0) {
8225					$('#header-outer header#top nav > ul.buttons, #header-outer .cart-outer .cart-menu-wrap').stop(true).transition({ x: '0px' },700,'easeInOutCubic'); 
8226				}
8227
8228				//fade out overlay
8229				$('#slide-out-widget-area-bg').stop(true).transition({
8230					'opacity' : 0
8231				},700,'easeInOutCubic',function(){
8232					$('.slide-out-widget-area-toggle a').removeClass('animating');
8233					$(this).css({'height':'1px','width':'1px'});
8234
8235					if($('#header-outer[data-remove-fixed="1"]').length == 0) {
8236						//hide menu if transparent, user has scrolled down and hhun is on
8237						if($('#header-outer').hasClass('parallax-contained') && $(window).scrollTop() > 0 && $('#header-outer[data-permanent-transparent="1"]').length == 0) {
8238							$('#header-outer').removeClass('parallax-contained').addClass('detached').removeClass('transparent');
8239						}
8240						else if($(window).scrollTop() == 0 && $('body[data-hhun="1"]').length >
8240 0 && $('#page-header-bg[data-parallax="1"]').length > 0 ||
8241							$(window).scrollTop() == 0 && $('body[data-hhun="1"]').length > 0 && $('.parallax_slider_outer').length > 0) {
8242
8243							if($('#header-outer[data-transparency-option="1"]').length > 0) $('#header-outer').addClass('transparent');
8244							$('#header-outer').addClass('parallax-contained').removeClass('detached');
8245						}
8246					}
8247
8248					//fix for fixed subpage menu
8249					$('.container-wrap').css('transform','none');
8250				});
8251
8252
8253				$('#header-outer').removeClass('style-slide-out-from-right');
8254
8255
8256				var headerResize = $('#header-outer').attr('data-header-resize');
8257				if($('#header-outer[data-remove-fixed="1"]').length == 0) {
8258
8259					if($bodyBorderHeaderColorMatch == true && headerResize == 1) {
8260					
8261						$(window).off('scroll.headerResizeEffect');
8262						if($(window).scrollTop() == 0) {
8263							$(window).on('scroll.headerResizeEffect',smallNav); 
8264
8265							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) {
8266								$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
8267									'padding' : '0'			
8268								},{queue:false, duration:250, easing: 'easeOutCubic'});	
8269							}
8270						}
8271						else
8272							$(window).on('scroll.headerResizeEffect',bigNav); 
8273							//smallNav();
8274
8275						if($('#header-outer').hasClass('pseudo-data-transparent')) {
8276							$('#header-outer').attr('data-transparent-header','false').removeClass('pseudo-data-transparent').removeClass('transparent');
8277						}
8278
8279						$('#header-outer').css('transition','transform');
8280
8281					} else if ($bodyBorderHeaderColorMatch == true) {
8282						
8283						$(window).off('scroll.headerResizeEffectOpaque');
8284						$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
8285
8286						$('#header-outer').css('transition','transform');
8287
8288						if($('#header-outer').hasClass('pseudo-data-transparent')) {
8289							$('#header-outer').attr('data-transparent-header','false').removeClass('pseudo-data-transparent').removeClass('transparent');
8290						}
8291					}
8292				}
8293		}
8294
8295		else if ( $('body.material').length > 0 ) {
8296
8297			//material
8298			$('#slide-out-widget-area').removeClass('open');
8299
8300			$('#slide-out-widget-area, #slide-out-widget-area-bg, #header-outer .slide-out-widget-area-toggle').removeClass('material-open');
8301			$('.ocm-effect-wrap, .ocm-effect-wrap-shadow, body > .slide_out_area_close, #fp-nav').removeClass('material-ocm-open');
8302
8303			$('body > .slide_out_area_close').removeClass('follow-body');
8304
8305			setTimeout(function(){
8306				$('.slide-out-widget-area-toggle a').removeClass('animating');
8307				$('body').removeClass('material-ocm-open');
8308				$('.ocm-effect-wrap').css({'height': '100%'});
8309				$('.ocm-effect-wrap-inner').css({'padding-top': '0' });
8310				$(window).scrollTop(Math.abs( parseInt($('#ajax-content-wrap').css('top')) ) );
8311				$('#ajax-content-wrap').css({'position' : '', 'top' : '' });
8312				
8313
8314				//handle bottom bar nav
8315				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) {
8316					$('#header-outer:not(.fixed-menu)').css('top', '');
8317					$('#header-secondary-outer').css('visibility','');
8318				}
8319				
8320				//handle hhun when at top
8321				$('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':''});
8322				setTimeout(function(){
8323					$('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':''});
8324				},30);
8325				
8326
8327				$('body[data-hhun="1"] #header-secondary-outer.hidden').removeClass('hidden');
8328
8329			},900);
8330
8331			setTimeout(function(){
8332				//icon effect
8333				$('#header-outer:not([data-format="left-header"]) header#top .slide-out-widget-area-toggle a').addClass('no-trans').removeClass('effect-shown');
8334			},200);
8335
8336			setTimeout(function(){
8337				//icon
8338				$('#header-outer:not([data-format="left-header"]) header#top .slide-out-widget-area-toggle a').removeClass('no-trans')
8339			},500);
8340			
8341		}
8342
8343
8344	} 
8345
8346	else if($('#slide-out-widget-area').hasClass('fullscreen')) {
8347
8348
8349		if ( $('body.material').length > 0 ) {
8350			setTimeout(function(){
8351				$('header#top .slide-out-widget-area-toggle a').removeClass('menu-push-out');
8352			},350);
8353     	}
8354
8355		$('.slide-out-widget-area-toggle:not(.std-menu) .lines-button').removeClass('close');
8356		$('.blurred-wrap').removeClass('blurred');
8357		$('#slide-out-widget-area.fullscreen').transition({'opacity': 0 },700,'easeOutQuad',function(){ $('#slide-out-widget-area.fullscreen').hide().css('opacity','1'); }).removeClass('open');
8358		$('#slide-out-widget-area.fullscreen .widget').transition({'opacity': 0},700,'easeOutQuad',function(){
8359			$(this).transition({y: '110px'},0);
8360		});
8361
8362		setTimeout(function(){
8363			$('.off-canvas-menu-container .menu > li').transition({y: '80px', 'opacity': 0},0);		
8364			$('#slide-out-widget-area .off-canvas-social-links li').transition({'scale':0},0);
8365			$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');
8366			$('#slide-out-widget-area .bottom-text').transition({'opacity':0},0);	
8367
8368			//close submenu items
8369			$('#slide-out-widget-area .menuwrapper .menu').removeClass( 'subview' );
8370			$('#slide-out-widget-area .menuwrapper .menu li').removeClass( 'subview subviewopen' );
8371			$('#slide-out-widget-area.fullscreen .inner .off-canvas-menu-container').css('height','auto');
8372		},800);
8373
8374		setTimeout(function(){
8375			if($('.nectar-social-sharing-fixed').length == 0) {
8376				showToTop();
8377			}
8378			$('.container-wrap').removeClass('no-shadow');
8379		},500);
8380
8381		//fade out overlay
8382		$('#slide-out-widget-area-bg').stop(true).transition({'opacity': 0},900,'easeOutQuad',function(){
8383			if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').removeClass('at-content');
8384			if($('.mobile #header-outer[data-permanent-transparent="false"]').length == 0) $('#slide-out-widget-area.fullscreen .inner-wrap').css('padding-top', '0');
8385			$('.slide-out-widget-area-toggle a').removeClass('animating');
8386			if($('#slide-out-widget-area-bg').hasClass('solid')) $opacity = 1;
8387			if($('#slide-out-widget-area-bg').hasClass('dark')) $opacity = 0.93;
8388			if($('#slide-out-widget-area-bg').hasClass('medium')) $opacity = 0.6;
8389			if($('#slide-out-widget-area-bg').hasClass('light')) $opacity = 0.4;
8390			$(this).css({'height':'1px','width':'1px', 'opacity': $opacity}).transition({ y : '-100%'},0);
8391		});
8392
8393		
8394	}
8395
8396	else if($('#slide-out-widget-area').hasClass('fullscreen-alt')) {
8397
8398
8399		if ( $('body.material').length > 0 ) {
8400			setTimeout(function(){
8401				$('header#top .slide-out-widget-area-toggle a').removeClass('menu-push-out');
8402			},350);
8403     	}
8404
8405		$('.slide-out-widget-area-toggle:not(.std-menu) .lines-button').removeClass('close');
8406		$('.blurred-wrap').removeClass('blurred');
8407		$('#slide-out-widget-area-bg').removeClass('open');
8408		
8409		$('#slide-out-widget-area.fullscreen-alt .widget').transition({'opacity': 0},500,'easeOutQuad',function(){
8410			$(this).transition({y: '40px'},0);
8411		});
8412		$('#slide-out-widget-area .bottom-text, #slide-out-widget-area .off-canvas-social-links li').transition({'opacity': 0},250,'easeOutQuad');
8413		$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');
8414
8415		$('.off-canvas-menu-container .menu').transition({y: '-13px', 'opacity': 0},400);	
8416
8417
8418		setTimeout(function(){
8419			$('.off-canvas-menu-container .menu > li').stop(true,true).transition({y: '40px', 'opacity': 0},0);		
8420			$('#slide-out-widget-area .off-canvas-social-links li').transition({'scale':0},0);
8421			$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');	
8422
8423			//close submenu items
8424			$('#slide-out-widget-area .menuwrapper .menu').removeClass( 'subview' );
8425			$('#slide-out-widget-area .menuwrapper .menu li').removeClass( 'subview subviewopen' );
8426			$('#slide-out-widget-area.fullscreen-alt .inner .off-canvas-menu-container').css('height','auto');
8427
8428			if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').removeClass('at-content');
8429			if($('.mobile #header-outer[data-permanent-transparent="false"]').length == 0) $('#slide-out-widget-area.fullscreen-alt .inner-wrap').css('padding-top', '0');
8430			$('.slide-out-widget-area-toggle a').removeClass('animating');
8431			$('#slide-out-widget-area-bg').css({'height':'1px','width':'1px','left':'-100%'});
8432			$('#slide-out-widget-area.fullscreen-alt').hide().removeClass('open');
8433		},550);
8434
8435		setTimeout(function(){
8436			if($('.nectar-social-sharing-fixed').length == 0) {
8437				showToTop();
8438			}
8439		},600);
8440
8441		//fade out overlay
8442		setTimeout(function(){
8443			$('#slide-out-widget-area-bg').removeClass('padding-removed');
8444		},50);	
8445
8446		
8447		var borderDelay = ($bodyBorderHeaderColorMatch == true) ? 150: 50;
8448
8449		setTimeout(function(){
8450			$('#slide-out-widget-area-bg').stop(true).css({'opacity': 0});
8451			if($('[data-transparent-header="true"]').length > 0) $('body > div[class*="body-border"]').css('z-index','10000');
8452		},borderDelay);
8453
8454		setTimeout(function(){
8455			$('#header-outer.transparent.small-nav, #header-outer.transparent.detached, #header-outer:not([data-permanent-transparent="1"]).transparent.scrolled-down').removeClass('transparent');
8456			
8457			if($('#header-outer').hasClass('pseudo-data-transparent')) {
8458				$('#header-outer').attr('data-transparent-header','false').removeClass('pseudo-data-transparent').removeClass('transparent');
8459			}
8460
8461		},100);
8462		
8463	}
8464
8465
8466	//dark slide transparent nav
8467	if($('#header-outer.temp-removed-dark-slide.transparent').length > 0  && $('#boxed').length == 0) $('#header-outer').removeClass('temp-removed-dark-slide').addClass('dark-slide');
8468
8469	//remove header transparent state
8470	if($('#header-outer[data-permanent-transparent="1"]').length == 0 && $('#slide-out-widget-area.fullscreen-alt').length == 0) {
8471
8472		if($('.nectar-box-roll').length == 0) {
8473			if($('#header-outer.small-nav').length > 0 || $('#header-outer.scrolled-down').length > 0 || $('#header-outer.detached').length > 0) $('#header-outer').removeClass('transparent');
8474		} else {
8475			if($('#header-outer.small-nav').length > 0 || $('#header-outer.scrolled-down').length > 0 || $('.container-wrap.auto-height').length > 0) $('#header-outer').removeClass('transparent');
8476		}
8477	} 
8478
8479
8480
8481	//remove hidden menu
8482	$('#header-outer').removeClass('hidden-menu');
8483
8484	$('#header-outer').removeClass('side-widget-open').addClass('side-widget-closed');
8485
8486	return false;
8487});
8488
8489function slideOutWidgetOverflowState() {
8490
8491	//switch position of social media/extra info based on screen size
8492	if(window.innerWidth < 1000 || $('body > #boxed').length > 0 || $('.ocm-effect-wrap-inner > #boxed').length > 0) {
8493
8494		$('#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');
8495		$('#slide-out-widget-area.fullscreen .bottom-text, #slide-out-widget-area.fullscreen-alt .bottom-text').appendTo('#slide-out-widget-area .inner');
8496	} else {
8497		$('#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');
8498		$('#slide-out-widget-area.fullscreen .bottom-text, #slide-out-widget-area.fullscreen-alt .bottom-text').appendTo('#slide-out-widget-area .inner-wrap');
8499	}
8500
8501	//add overflow
8502	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'); }
8503	else { $('#slide-out-widget-area[class*="fullscreen"] .inner, #slide-out-widget-area[class*="fullscreen"]').removeClass('overflow-state'); }
8504
8505	$('#slide-out-widget-area[class*="fullscreen"] .inner').transition({ y : '-' + ($('#slide-out-widget-area[class*="fullscreen"] .inner').height()/2) + 'px' },0);
8506
8507	//close mobile only slide out widget area if switching back to desktop
8508	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'); }
8509
8510	//sizing for dropdown
8511	OCM_Dropdown_Icon_Pos();
8512
8513
8514}
8515
8516
8517function OCM_Dropdown_Icon_Pos() {
8518	$('#slide-out-widget-area[class*="slide-out-from-right"] .off-canvas-menu-container li.menu-item-has-children').each(function(){
8519		$(this).find('.ocm-dropdown-arrow').css({'top': $(this).find('a').height()/2 });
8520	});
8521}
8522OCM_Dropdown_Icon_Pos();
8523
8524
8525function fullWidthHeaderSlidingWidgetMenuCalc() {
8526	$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': $(window).width() - 360, 'left': '300px' },700,'easeInOutCubic');
8527}
8528
8529//slide out widget area scrolling 
8530function slideOutWidgetAreaScrolling(){ 
8531	$('#slide-out-widget-area').mousewheel(function(event, delta) {
8532
8533	     this.scrollTop -= (delta * 30);
8534	    
8535	     event.preventDefault();
8536
8537	});
8538}
8539setTimeout(slideOutWidgetAreaScrolling,500);
8540
8541
8542//handle mobile scrolling
8543if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
8544	$('#slide-out-widget-area').addClass('mobile');
8545}
8546
8547
8548function closeOCM(item) {
8549    if($('#slide-out-widget-area.open').length > 0) {
8550
8551    	var $windowCurrentLocation = window.location.href.split("#")[0];
8552		  var $windowClickedLocation = item.find('> a').attr('href').split("#")[0];
8553
8554    	if($windowCurrentLocation == $windowClickedLocation || item.find('a[href^="#"]').length > 0) {
8555				if(item.parents('.slide-out-from-right-hover').length > 0) {
8556					$('.slide-out-widget-area-toggle.slide-out-hover-icon-effect a').trigger('click');
8557				} else {
8558					$('.slide-out-widget-area-toggle a').trigger('click');
8559				}
8560        
8561			}
8562    } 
8563		
8564}
8565
8566
8567//left header
8568function leftHeaderSubmenus() {
8569
8570	//remove megamenu class
8571	$('#header-outer[data-format="left-header"] nav li.megamenu').removeClass('megamenu');
8572
8573	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';
8574	//click
8575	$('#header-outer[data-format="left-header"]  li.menu-item-has-children > a, '+$ocm_link_selector).on('click',function(e){
8576		
8577		if($(this).parent().hasClass('open-submenu')) {
8578			$(this).parent().find('.sub-menu').css({
8579				'max-height' : '0'
8580			});
8581			$(this).parent().removeClass('open-submenu');
8582		}
8583		else {
8584
8585			//get max height
8586			var $that = $(this);
8587			var $maxSubMenuHeight;
8588
8589			$that.parent().find('> .sub-menu').addClass('no-trans');
8590
8591			setTimeout(function(){
8592
8593				$that.parent().find('> .sub-menu').css({
8594					'max-height' : 'none',
8595					'position' : 'absolute',
8596					'visibility' : 'hidden'
8597				});
8598				
8599				$maxSubMenuHeight =  $that.parent().find('> .sub-menu').height();
8600
8601				$that.parent().find('> .sub-menu').removeClass('no-trans');
8602				$that.parent().find('> .sub-menu').css({
8603					'max-height' : '0',
8604					'position' : 'relative',
8605					'visibility' : 'visible'
8606				});
8607
8608			},25);
8609
8610			setTimeout(function(){
8611				
8612				//reset
8613				$that.closest('ul').find('li.menu-item-has-children').removeClass('open-submenu');
8614				$that.closest('ul').find('li.menu-item-has-children > .sub-menu').css({
8615					'max-height' : '0'
8616				});
8617
8618				$that.parent().addClass('open-submenu');
8619
8620				$that.parent().find('> .sub-menu').css('max-height', $maxSubMenuHeight);
8621
8622				//add height to open parents
8623				if($that.parents('ul').length > 0) {
8624
8625					$that.parents('ul:not(.sf-menu)').each(function(){
8626						$(this).css('max-height');
8627						$(this).css('max-height', parseInt($(this).height() + parseInt($(this).css('padding-top'))*2 + $maxSubMenuHeight)+'px');
8628					});
8629				} 
8630					
8631
8632			},50);
8633		}
8634		
8635		return false;
8636	});
8637	
8638	//start open for current page items
8639	var $maxSubMenuHeightArr = [];
8640
8641	$('#header-outer[data-format="left-header"] .current-menu-ancestor').find('.current-menu-item').parents('ul.sub-menu').each(function(i){
8642
8643		
8644
8645		$maxSubMenuHeightArr[i] =  $(this).parent().find('> .sub-menu').height();
8646
8647
8648		var $that = $(this);
8649		setTimeout(function(){
8650
8651			var $totalSubMenuHeight = 0;
8652
8653			for(var $i=0; $i < $maxSubMenuHeightArr.length; $i++) {
8654				$totalSubMenuHeight += parseInt($maxSubMenuHeightArr[i]);
8655			}
8656	
8657			$that.parent().addClass('open-submenu');
8658			$that.css('max-height', $totalSubMenuHeight);
8659
8660		},40);
8661	});
8662}
8663
8664if($('#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) {
8665	leftHeaderSubmenus();
8666}
8667
8668
8669//fullscreen submenu
8670;( function( $, window, undefined ) {
8671
8672	'use strict';
8673
8674	// global
8675	var Modernizr = window.Modernizr, $body = $( 'body' );
8676
8677	$.DLMenu = function( options, element ) {
8678		this.$el = $( element );
8679		this._init( options );
8680	};
8681
8682	// the options
8683	$.DLMenu.defaults = {
8684		// classes for the animation effects
8685		animationClasses : { classin : 'dl-animate-in-1', classout : 'dl-animate-out-1' },
8686		onLevelClick : function( el, name ) { return false; },
8687		onLinkClick : function( el, ev ) { return false; }
8688	};
8689
8690	$.DLMenu.prototype = {
8691		_init : function( options ) {
8692
8693			// options
8694			this.options = $.extend( true, {}, $.DLMenu.defaults, options );
8695			this._config();
8696			
8697			var animEndEventNames = {
8698					'WebkitAnimation' : 'webkitAnimationEnd',
8699					'OAnimation' : 'oAnimationEnd',
8700					'msAnimation' : 'MSAnimationEnd',
8701					'animation' : 'animationend'
8702				},
8703				transEndEventNames = {
8704					'WebkitTransition' : 'webkitTransitionEnd',
8705					'MozTransition' : 'transitionend',
8706					'OTransition' : 'oTransitionEnd',
8707					'msTransition' : 'MSTransitionEnd',
8708					'transition' : 'transitionend'
8709				};
8710			// animation end event name
8711			this.animEndEventName = animEndEventNames[ Modernizr.prefixed( 'animation' ) ] + '.menu';
8712			// transition end event name
8713			this.transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ] + '.menu',
8714			// support for css animations and css transitions
8715			this.supportAnimations = Modernizr.cssanimations,
8716			this.supportTransitions = Modernizr.csstransitions;
8717
8718			this._initEvents();
8719
8720		},
8721		_config : function() {
8722			this.open = false;
8723			this.$trigger = this.$el.children( '.trigger' );
8724			this.$menu = this.$el.children( 'ul.menu' );
8725			this.$menuitems = this.$menu.find( 'li:not(.back) > a' );
8726			this.$el.find( 'ul.sub-menu' ).prepend( '<li class="back"><a href="#"> '+$('#slide-out-widget-area').attr('data-back-txt')+' </a></li>' );
8727			this.$back = this.$menu.find( 'li.back' );
8728		},
8729		_initEvents : function() {
8730
8731			var self = this;
8732
8733			this.$trigger.on( 'click.menu', function() {
8734				
8735				if( self.open ) {
8736					self._closeMenu();
8737				} 
8738				else {
8739					self._openMenu();
8740				}
8741				return false;
8742
8743			} );
8744			
8745			this.$menuitems.on( 'click.menu', function( event ) {
8746
8747
8748				var $item = $(this).parent('li'),
8749					$submenu = $item.children( 'ul.sub-menu' );
8750
8751				$('.fullscreen-alt .off-canvas-menu-container .clip-wrap, .fullscreen-alt .off-canvas-menu-container .clip-wrap span').css('transition-duration','0s');	
8752	
8753				if( $submenu.length > 0 ) {
8754
8755					var $flyin = $submenu.clone().css( 'opacity', 0 ).insertAfter( self.$menu ),
8756						onAnimationEndFn = function() {
8757							self.$menu.off( self.animEndEventName ).removeClass( self.options.animationClasses.classout ).addClass( 'subview' );
8758							$item.addClass( 'subviewopen' ).parents( '.subviewopen:first' ).removeClass( 'subviewopen' ).addClass( 'subview' );
8759							$flyin.remove();
8760							setTimeout(function(){
8761								$('.off-canvas-menu-container .menu > li').removeClass('no-pointer-events');
8762								$('.off-canvas-menu-container .clip-wrap, .off-canvas-menu-container .clip-wrap span').css('transition-duration','.45s');
8763							},300);
8764							
8765			
8766						};
8767
8768					setTimeout( function() {
8769						$flyin.addClass( self.options.animationClasses.classin );
8770						self.$menu.addClass( self.options.animationClasses.classout );
8771						if( self.supportAnimations ) {
8772							self.$menu.on( self.animEndEventName, onAnimationEndFn );
8773						}
8774						else {
8775							onAnimationEndFn.call();
8776						}
8777
8778						self.options.onLevelClick( $item, $item.children( 'a:first' ).text() );
8779					} );
8780
8781
8782					$item.parents('.off-canvas-menu-container').css('height',$item.parents('.off-canvas-menu-container').find('.menuwrapper .menu').height()).transition({ 'height': $flyin.height() },500,'easeInOutQuad' );
8783
8784
8785					return false;
8786
8787				}
8788				else {
8789		
8790					self.options.onLinkClick( $item.find('> a'), event );
8791				}
8792
8793				closeOCM($item);
8794
8795			});
8796
8797			
8798
8799
8800			this.$back.on( 'click.menu', function( event ) {
8801				
8802				var $this = $( this ),
8803					$submenu = $this.parents( 'ul.sub-menu:first' ),
8804					$item = $submenu.parent(),
8805
8806					$flyin = $submenu.clone().insertAfter( self.$menu );
8807
8808				var onAnimationEndFn = function() {
8809					self.$menu.off( self.animEndEventName ).removeClass( self.options.animationClasses.classin );
8810					$flyin.remove();
8811				};
8812
8813				setTimeout( function() {
8814					$flyin.addClass( self.options.animationClasses.classout );
8815					self.$menu.addClass( self.options.animationClasses.classin );
8816					if( self.supportAnimations ) {
8817						self.$menu.on( self.animEndEventName, onAnimationEndFn );
8818					}
8819					else {
8820						onAnimationEndFn.call();
8821					}
8822
8823					$item.removeClass( 'subviewopen' );
8824					
8825					var $subview = $this.parents( '.subview:first' );
8826					if( $subview.is( 'li' ) ) {
8827						$subview.addClass( 'subviewopen' );
8828					}
8829					$subview.removeClass( 'subview' );
8830				} );
8831
8832		
8833				$item.parents('.off-canvas-menu-container').css('height', $item.parents('.off-canvas-menu-container').find('.menuwrapper .menu').height())
8834				setTimeout(function() { 
8835					$item.parents('.off-canvas-menu-container').transition({ 'height': $item.parent().height() },500,'easeInOutQuad');
8836				},50);
8837
8838
8839				return false;
8840
8841			} );
8842			
8843		},
8844		closeMenu : function() {
8845			if( this.open ) {
8846				this._closeMenu();
8847			}
8848		},
8849		_closeMenu : function() {
8850			var self = this,
8851				onTransitionEndFn = function() {
8852					self.$menu.off( self.transEndEventName );
8853					self._resetMenu();
8854				};
8855			
8856			this.$menu.removeClass( 'menuopen' );
8857			this.$menu.addClass( 'menu-toggle' );
8858			this.$trigger.removeClass( 'active' );
8859			
8860			if( this.supportTransitions ) {
8861				this.$menu.on( this.transEndEventName, onTransitionEndFn );
8862			}
8863			else {
8864				onTransitionEndFn.call();
8865			}
8866
8867			this.open = false;
8868		},
8869		openMenu : function() {
8870			if( !this.open ) {
8871				this._openMenu();
8872			}
8873		},
8874		_openMenu : function() {
8875			var self = this;
8876			$body.off( 'click' ).on( 'click.menu', function() {
8877				self._closeMenu() ;
8878			} );
8879			this.$menu.addClass( 'menuopen menu-toggle' ).on( this.transEndEventName, function() {
8880				$( this ).removeClass( 'menu-toggle' );
8881			} );
8882			this.$trigger.addClass( 'active' );
8883			this.open = true;
8884		},
8885		_resetMenu : function() {
8886			this.$menu.removeClass( 'subview' );
8887			this.$menuitems.removeClass( 'subview subviewopen' );
8888		}
8889	};
8890
8891	var logError = function( message ) {
8892		if ( window.console ) {
8893			window.console.error( message );
8894		}
8895	};
8896
8897	$.fn.dlmenu = function( options ) {
8898		if ( typeof options === 'string' ) {
8899			var args = Array.prototype.slice.call( arguments, 1 );
8900			this.each(function() {
8901				var instance = $.data( this, 'menu' );
8902				if ( !instance ) {
8903					logError( "cannot call methods on menu prior to initialization; " +
8904					"attempted to call method '" + options + "'" );
8905					return;
8906				}
8907				if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
8908					logError( "no such method '" + options + "' for menu instance" );
8909					return;
8910				}
8911				instance[ options ].apply( instance, args );
8912			});
8913		} 
8914		else {
8915			this.each(function() {	
8916				var instance = $.data( this, 'menu' );
8917				if ( instance ) {
8918					instance._init();
8919				}
8920				else {
8921					instance = $.data( this, 'menu', new $.DLMenu( options, this ) );
8922				}
8923			});
8924		}
8925		return this;
8926	};
8927
8928} )( jQuery, window );
8929
8930function fullscreenMenuInit() {
8931	$('#slide-out-widget-area .off-canvas-menu-container .menu').wrap('<div class="menu-wrap menuwrapper" />');
8932	$('#slide-out-widget-area .off-canvas-menu-container .menu').addClass('menuopen');
8933	$ocmAnimationClassNum = ($('#slide-out-widget-area.fullscreen-alt').length > 0) ? '4' : '5';
8934	$('#slide-out-widget-area .off-canvas-menu-container .menu-wrap').dlmenu({ animationClasses : { classin : 'dl-animate-in-'+$ocmAnimationClassNum, classout : 'dl-animate-out-'+$ocmAnimationClassNum } });
8935	
8936}
8937
8938if($('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 ) {
8939	fullscreenMenuInit();
8940} else if($('body.using-mobile-browser[data-slide-out-widget-area-style="slide-out-from-right-hover"]').length > 0){
8941	
8942	//close OCM on mobile when clicking anchor on same page 
8943	$('body #slide-out-widget-area .inner .off-canvas-menu-container li a[href]').on('click',function(){
8944
8945		  if($(this).attr('href') != '#') {
8946				closeOCM($(this).parent());	
8947			}
8948
8949	});
8950	
8951} 
8952
8953
8954
8955//submenu link hover fix
8956$('body').on('mouseover','#slide-out-widget-area .off-canvas-menu-container .menuwrapper > .sub-menu li > a',function(){
8957	var $currentTxt = $(this).text();
8958	$('.off-canvas-menu-container .menuwrapper .menu li > a').removeClass('hovered');
8959	$('.off-canvas-menu-container .menuwrapper .menu li > a:contains('+$currentTxt+')').addClass('hovered');
8960});
8961$('body').on('mouseover','.off-canvas-menu-container .menuwrapper .menu li > a',function(){
8962	$('.off-canvas-menu-container .menuwrapper .menu li > a').removeClass('hovered');
8963});
8964
8965
8966
8967/***************** Page Headers ******************/
8968
8969var pageHeaderHeight;
8970var pageHeaderHeightCopy;
8971var pageHeadingHeight;
8972var extraSpaceFromResize = ($('#header-outer[data-header-resize="1"]').length > 0 && $('.nectar-box-roll').length == 0) ? 0 : 1;
8973var $headerRemoveStickyness = ($('body[data-hhun="1"]').length > 0 && $('#header-outer[data-remove-fixed="1"]').length > 0) ? 1 : 0;
8974
8975if($('body.material').length > 0 ) { extraSpaceFromResize = 0; }
8976
8977//full screen header
8978function fullScreenHeaderInit(){
8979	
8980	pageHeaderHeight = parseInt($('#page-header-bg').height());
8981	
8982	return;
8983	
8984	pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height'));
8985	pageHeaderHeightCopy = parseInt($('#page-header-bg').attr('data-height'));
8986
8987	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && window.innerWidth > 1000) ? 0 : $('#header-outer').height();
8988
8989	if($('.fullscreen-header').length > 0) {
8990
8991		if($('#header-outer[data-transparency-option]').length > 0 && $('#header-outer').attr('data-transparency-option') != '0'){
8992			var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height() : $(window).height() - parseInt($headerNavSpace) ;
8993		} else {
8994			var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height() - parseInt($headerNavSpace) + extraSpaceFromResize : $(window).height() - parseInt($headerNavSpace) ;
8995		}
8996		var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
8997		if($('.nectar-box-roll').length > 0) extraHeight = 0;
8998		pageHeaderHeight =   calculatedNum  - extraHeight; 
8999		pageHeaderHeightCopy = calculatedNum - extraHeight; 
9000	}
9001
9002	$('#page-header-bg').css('height',pageHeaderHeight+'px').removeClass('not-loaded');
9003	setTimeout(function(){ $('#page-header-bg').css('overflow','visible') },800);
9004
9005}
9006
9007fullScreenHeaderInit();
9008
9009function pageHeader(){
9010	
9011	pageHeaderHeight = parseInt($('#page-header-bg').height());
9012	
9013	//handle slide down effect
9014	$('body[data-aie="slide-down"] #page-header-wrap:not(.fullscreen-header)').css('height',pageHeaderHeight +'px');
9015  
9016  //as of 9.0
9017	return;
9018	
9019	
9020	var $scrollTop = 0;
9021	var $windowInnerWidth = window.innerWidth;
9022	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $windowInnerWidth > 1000) ? 0 : $('#header-outer').height();
9023	var $windowHeight = $(window).height();
9024
9025	//full screen header
9026	if($('.fullscreen-header').length > 0) {
9027		if($('#header-outer[data-transparency-option]').length > 0 && $('#header-outer').attr('data-transparency-option') != '0'){
9028			var calculatedNum = (!$('body').hasClass('mobile')) ? $windowHeight : $windowHeight - parseInt($headerNavSpace) ;
9029			if($('body[data-permanent-transparent="1"]').length > 0) calculatedNum = $windowHeight;
9030		} else {
9031			var calculatedNum = (!$('body').hasClass('mobile')) ? $windowHeight - parseInt($headerNavSpace) + extraSpaceFromResize : $windowHeight - parseInt($headerNavSpace);
9032		}
9033		var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
9034		if($('.nectar-box-roll').length > 0) extraHeight = 0;
9035		pageHeaderHeight =   calculatedNum  - extraHeight; 
9036		pageHeaderHeightCopy = calculatedNum - extraHeight; 
9037	}
9038
9039	if( $windowInnerWidth < 1000 && $windowInnerWidth > 690 && !$('body').hasClass('salient_non_responsive') ) {
9040		var $multiplier = ($('.fullscreen-header').length > 0) ? 1 : 1.6;
9041		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
9042		$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
9043		
9044	} else if( $windowInnerWidth <= 690 && $windowInnerWidth > 480 && !$('body').hasClass('salient_non_responsive')) {
9045		var $multiplier = ($('.fullscreen-header').length > 0) ? 1 : 2.1;
9046		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
9047		$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
9048		
9049	} else if( $windowInnerWidth <= 480 && !$('body').hasClass('salient_non_responsive')) {
9050		var $multiplier = ($('.fullscreen-header').length > 0) ? 1 : 2.5;
9051		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
9052		$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
9053		
9054	} else {
9055		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy).css('height',pageHeaderHeightCopy +'px');
9056		if($('.fullscreen-header').length > 0){
9057			$('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
9058		} else {
9059			$('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
9060		}
9061
9062		if($('#page-header-bg[data-parallax="1"]').length == 0) { $('#page-header-wrap').css('height',pageHeaderHeightCopy +'px'); }
9063	}
9064
9065
9066	//handle left header 
9067	if($('body[data-header-format="left-header"]').length > 0 ) { $('#page-header-bg[data-parallax="1"]').css('width',$('#ajax-content-wrap').width()) }
9068	
9069	
9070	if(!$('body').hasClass('mobile')){
9071		
9072		//recalc
9073		pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height'));
9074		$('#page-header-bg .container > .row').css('top',0);
9075		var $divisionMultipler = ($('#header-outer[data-remove-border="true"]').length > 0 && $('#header-outer[data-format="centered-menu-under-logo"]').length == 0) ? 2 : 1;
9076
9077		//center the heading
9078		pageHeadingHeight = $('#page-header-bg .col.span_6').height();
9079		
9080		
9081		if($('#header-outer[data-transparent-header="true"]').length > 0 && $('.fullscreen-header').length == 0) {
9082
9083		} else {
9084			var $extraResizeHeight = ($('#header-outer[data-header-resize="1"]').length > 0) ? 22: 0;
9085		}
9086		
9087		//center portfolio filters
9088		$('#page-header-bg:not("[data-parallax=1]") .portfolio-filters').css('top', (pageHeaderHeight/2) + 2);	
9089		
9090		if($('#page-header-bg[data-parallax="1"]').length > 0) {
9091			$scrollTop = $(window).scrollTop();
9092		}
9093
9094		if($('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap').css('opacity') > 0) {
9095			
9096			if($('#header-outer[data-transparent-header="true"]').length > 0 && $('body.single-post .fullscreen-header').length == 0) {
9097				//center the parallax heading
9098
9099				if($headerRemoveStickyness) {
9100					
9101				    //center parllax portfolio filters
9102				    $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 
9103						'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
9104				    });
9105
9106				} else {
9107
9108				    //center parllax portfolio filters
9109				    $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 
9110						'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
9111						'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
9112				    });
9113				}
9114			    
9115		  } else {
9116
9117		  		if($headerRemoveStickyness) {
9118			  		//center the parallax heading
9119
9120				    //center parllax portfolio filters
9121				    $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 
9122						'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
9123				    });
9124				} else {
9125 
9126				    //center parllax portfolio filters
9127				    $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 
9128						'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
9129						'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
9130				    });
9131				}
9132		  }
9133	   }
9134	}
9135	
9136	else {
9137		//recalc
9138		pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height'));
9139		
9140		//center the heading
9141		var pageHeadingHeight = $('#page-header-bg .container > .row').height();
9142		$('#page-header-bg .container > .row').css('top', (pageHeaderHeight/2) - (pageHeadingHeight/2) + 5);
9143		
9144	}
9145
9146
9147	$('#page-header-bg .container > .row').css('visibility','visible');
9148}
9149
9150var $pt_timeout = ($('body[data-ajax-transitions="true"]').length > 0 && $('#page-header-bg[data-animate-in-effect="slide-down"]').length > 0) ? 350 : 0; 
9151
9152if($('#page-header-bg').length > 0) { 
9153	setTimeout(function(){ pageHeader(); },$pt_timeout);
9154}
9155
9156
9157if($('#header-outer').attr('data-header-resize') == '' || $('#header-outer').attr('data-header-resize') == '0'){
9158	$('#page-header-wrap').css('margin-top','0');
9159}
9160
9161
9162function extractUrl(input) {
9163	return input.replace(/"/g,"").replace(/url\(|\)$/ig, "");
9164}
9165 
9166/***************** Parallax Page Headers ******************/
9167if($('#page-header-bg[data-parallax="1"]').length > 0) {
9168
9169	//fadeIn
9170
9171	var img = new Image();
9172	
9173	var imgX, imgY, aspectRatio;
9174	var diffX, diffY;
9175	var pageHeadingHeight = $('#page-header-bg .col.span_6').height();
9176	var pageHeaderHeight = parseInt($('#page-header-bg').height());
9177	var headerPadding2 = parseInt($('#header-outer').attr('data-padding'))*2;
9178	var wooCommerceHeader = ($('.demo_store').length > 0) ? 32 : 0 ;
9179	
9180	
9181	var $initialImgCheck = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
9182	
9183	if ($initialImgCheck && $initialImgCheck.indexOf('.') !== -1) {    
9184		img.onload = function() {
9185		   pageHeaderInit(); 
9186		}
9187		
9188		img.src = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
9189		
9190	} else {
9191		 pageHeaderInit();
9192	}
9193
9194	
9195	
9196	var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
9197
9198
9199	 if($('body[data-hhun="1"]').length > 0 && !$('#header-outer[data-remove-fixed="1"]').length > 0)  $('#header-outer').addClass('parallax-contained');
9200
9201	 window.addEventListener('scroll', function(){ 
9202        window.requestAnimationFrame(bindHeaderParallax);
9203    }, false);
9204
9205}
9206
9207					
9208function bindHeaderParallax(){
9209
9210	var $scrollTop = $(window).scrollTop();
9211	var pageHeadingHeight = $('#page-header-bg .col.span_6').height();
9212	
9213	if(!$('body').hasClass('mobile') && navigator.userAgent.match(/iPad/i) == null && $('body.material-ocm-open').length == 0 ){
9214
9215
9216		//material needs to set top for when effect wrap sets transform
9217		if(window.innerWidth > 1000) {
9218        $('body:not("[data-header-format=\'left-header\']") #page-header-bg[data-
9218parallax="1"]').css('top',$('#ajax-content-wrap').offset().top);
9219    } else {
9220        $('body:not("[data-header-format=\'left-header\']") #page-header-bg[data-parallax="1"]').css('top','0');
9221    }
9222
9223		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;
9224    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;
9225    var $parallaxHeaderHUN = ($('#header-outer[data-transparency-option="1"]').length > 0) ? 0.49: 0.4;
9226
9227		//calc bg pos
9228		if($('#page-header-bg.out-of-sight').length == 0) {
9229
9230			if($headerRemoveStickyness) {
9231				$('#page-header-bg[data-parallax="1"]').css({ 'transform': 'translateY('+ $scrollTop*-0.55 +'px)' });	
9232			} else {
9233				$('#page-header-bg[data-parallax="1"]').css({ 'transform': 'translateY('+ $scrollTop*-$multiplier1 +'px)' });
9234			}
9235
9236			var multipler = ($('body').hasClass('single')) ? 1 : 2;
9237			if(!$headerRemoveStickyness) {
9238				$('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap,  #page-header-bg[data-parallax="1"][data-post-hs="default_minimal"] .author-section').css({ 
9239					'opacity' : 1-($scrollTop/(pageHeaderHeight-60))
9240				});
9241			}
9242			
9243			if($headerRemoveStickyness) {
9244				$('#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)' });
9245			} else {
9246				$('#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)' });
9247			}
9248			
9249			if($('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap').css('opacity') == 0){
9250				$('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap, #page-header-bg[data-parallax="1"] .portfolio-filters').hide();
9251			} else {
9252				$('#page-header-bg[data-parallax="1"] .span_6 .inner-wrap, #page-header-bg[data-parallax="1"] .portfolio-filters').show();
9253			}
9254
9255			if($('body[data-hhun="1"]').length > 0  && !$('#header-outer').hasClass('side-widget-open') && !$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')) { 
9256          $('#header-outer.parallax-contained').css({ 'transform': 'translateY('+$scrollTop*-$parallaxHeaderHUN+'px)' });
9257      }
9258			
9259		
9260		}
9261		else if($('#page-header-bg.out-of-sight').length == 0) {
9262			//alt parallax effect
9263			var multipler = ($('body').hasClass('single')) ? 1 : 2;
9264			$('#page-header-wrap .nectar-particles .fade-out').css({ 
9265				'opacity' : 0+($scrollTop/(pageHeaderHeight+pageHeaderHeight*$multiplier))
9266			});
9267		}
9268
9269
9270		//hide elements to allow other parallax sections to work in webkit browsers
9271		if( ($scrollTop / (pageHeaderHeight + $('#header-space').height() + extraHeight)) > 1 ) {
9272			$('#page-header-bg, .nectar-particles, #page-header-bg .fade-out').css('visibility','hidden').hide().addClass('out-of-sight');
9273		}
9274		else {
9275		 	$('#page-header-bg, .nectar-particles, #page-header-bg .fade-out').css('visibility','visible').show().removeClass('out-of-sight');
9276
9277		 		//ensure header is centered
9278		 		pageHeaderHeight = parseInt($('#page-header-bg').height());
9279				$('#page-header-bg .container > .row').css('top',0);
9280				var $divisionMultipler = ($('#header-outer[data-remove-border="true"]').length > 0 && $('#header-outer[data-format="centered-menu-under-logo"]').length == 0) ? 2 : 1;
9281				pageHeadingHeight = $('#page-header-bg .col.span_6').height();
9282
9283	    }
9284		
9285
9286	}
9287
9288
9289
9290}
9291
9292if($('#page-header-bg').length > 0) {
9293	var $initialImgCheckAscend = extractUrl($('#page-header-bg').css('background-image'));
9294	if ($initialImgCheckAscend && $initialImgCheckAscend.indexOf('.') !== -1) {    
9295		   $('#page-header-bg').addClass('has-bg');
9296	}
9297}
9298
9299
9300function pageHeaderInit(){
9301
9302	 var wooCommerceHeader = ($('.demo_store').length > 0) ? 32 : 0 ;
9303	 var centeredNavAltSpace = ($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) ? $('header#top nav > .sf-menu').height() -20 : null;
9304	 //transparent
9305	  if($('#header-outer[data-transparent-header="true"]').length > 0) {	
9306	     $('#page-header-bg[data-parallax="1"]').css({'top': extraHeight+wooCommerceHeader });
9307	  } else {
9308
9309	   var logoHeight = parseInt($('#header-outer').attr('data-logo-height'));
9310		 var headerPadding = parseInt($('#header-outer').attr('data-padding'));
9311		 var headerPadding2 = parseInt($('#header-outer').attr('data-padding'));
9312		 var extraDef = 10;
9313		 var headerResize = ($('body').hasClass('pp-video-function')) ? '1' : $('#header-outer').attr('data-header-resize');
9314		 var headerResizeOffExtra = 0;
9315		 var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
9316		 var usingLogoImage = true;
9317	     var mediaElement = ($('.wp-video-shortcode').length > 0) ? 36 : 0;
9318	     var secondaryHeader = ($('#header-outer').attr('data-using-secondary') == '1') ? 32 : 0 ;
9319	  	 if($('body[data-header-resize="0"]').length == 0 && $('body.material').length == 0) {
9320				 $('#page-header-bg[data-parallax="1"]').css({'top': ($('#page-header-wrap').offset().top)  + 'px' });
9321			 }
9322	  }
9323	  
9324	  //fade in header
9325	  if($('#ajax-content-wrap').length == 0 || !$('body').hasClass('ajax-loaded')){
9326	  	$('#page-header-bg[data-parallax="1"]').animate({ 'opacity' : 1},350,'easeInCubic');
9327	  } else if($('#ajax-content-wrap').length == 1) {
9328	  	$('#page-header-bg[data-parallax="1"]').css({ 'opacity' : 1});
9329	  }
9330
9331	  //verify smooth scorlling
9332	  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') } 
9333	  
9334
9335	  $('#page-header-bg[data-parallax="1"] .nectar-particles').append('<div class="fade-out" />');
9336}
9337
9338
9339
9340
9341function nectarPageHeader() {
9342
9343	if($('#page-header-bg').length > 0) {
9344		fullScreenHeaderInit();
9345		pageHeader();
9346	}
9347
9348
9349	if($('#page-header-bg[data-parallax="1"]').length > 0) {
9350
9351		var img = new Image();
9352		var $initialImgCheck = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
9353			
9354		if ($initialImgCheck && $initialImgCheck.indexOf('.') !== -1) {    
9355			img.onload = function() {
9356			   pageHeaderInit();    
9357					
9358			}
9359			
9360			img.src = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
9361			
9362		} else {
9363			 pageHeaderInit();
9364		}
9365
9366		//bindHeaderParallax();
9367		$('#page-header-bg[data-parallax="1"] .span_6').css({ 
9368			'opacity' : 1
9369		});
9370
9371		
9372
9373		if (window.addEventListener) {
9374			 window.addEventListener('scroll', function(){ 
9375	          requestAnimationFrame(bindHeaderParallax); 
9376	        }, false);
9377		}
9378
9379	} 
9380
9381	if($('#page-header-bg').length > 0) {
9382		var $initialImgCheckAscend = extractUrl($('#page-header-bg').css('background-image'));
9383		if ($initialImgCheckAscend && $initialImgCheckAscend.indexOf('.') !== -1) {    
9384			   $('#page-header-bg').addClass('has-bg');
9385		}
9386	}
9387}
9388
9389if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
9390	window.onunload = function(){ nectarPageHeader(); };
9391}
9392
9393
9394/***************** header text effects *****************/
9395
9396// rotate in
9397function pageHeaderTextEffectInit() {
9398	$('#page-header-bg').each(function(){
9399		if($(this).attr('data-text-effect') == 'rotate_in') {
9400			var $topHeading = 'none';
9401
9402			if($(this).find('.span_6 h1').length > 0) {
9403				$topHeading = 'h1';
9404			} 
9405
9406
9407			if($topHeading != 'none') {
9408
9409				var $selector = ($(this).find('.nectar-particles').length > 0) ? '.inner-wrap.shape-1' : '.span_6';
9410
9411				$(this).find($selector).find($topHeading).addClass('top-heading').contents().filter(function () {
9412			        return this.nodeType === 3 && typeof this.data != 'undefined' && this.data.replace(/\s+/, "");
9413			    }).wrap('<span class="wraped"></span>');
9414
9415			    $(this).find($selector).find('.wraped').each(function () {
9416
9417				    textNode = $(this);
9418
9419				    text = textNode.text().split(' ');
9420				    replace = '';
9421
9422				    $.each(text, function (index, value) {
9423				        if (value.replace(/\s+/, "")) {
9424				            replace += '<span class="wraped"><span>' + value + '</span></span> ';
9425				        }
9426				    });
9427				    textNode.replaceWith($(replace));
9428				    
9429				});
9430			}//make sure suitable heading was found
9431
9432		}//tilt
9433	});
9434	
9435}
9436function pageHeaderTextEffect() {
9437
9438	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) {
9439
9440		var $selector = ($('.nectar-box-roll').length == 0) ? '#page-header-bg .span_6' : '.nectar-box-roll .overlaid-content .span_6';
9441
9442		$($selector).find('.wraped').each(function(i){
9443			$(this).find('span').delay(i*370).transition({ rotateX: '0', 'opacity' : 1, y: 0},400,'easeOutQuad');
9444		});
9445
9446		setTimeout(function(){
9447
9448			$($selector).find('.inner-wrap > *:not(.top-heading)').each(function(i){
9449				$(this).delay(i*370).transition({ rotateX: '0', 'opacity' : 1, y: 0 },650,'easeOutQuad');
9450			});
9451
9452			$('.scroll-down-wrap').removeClass('hidden');
9453
9454		}, $($selector).find('.wraped').length * 370);
9455	}
9456
9457}
9458var $effectTimeout = ($('#ajax-loading-screen').length > 0) ? 800 : 0;
9459
9460pageHeaderTextEffectInit();
9461
9462if($('#page-header-bg .nectar-video-wrap video').length == 0) { setTimeout(pageHeaderTextEffect,$effectTimeout); }
9463
9464
9465
9466
9467 //submenu fix
9468  if($('header#top nav > ul.sf-menu ul').length > 0) {
9469
9470  	var $midnightSubmenuTimeout;
9471  	$('body').on('mouseover','#header-outer .midnightHeader .sf-with-ul, #header-outer .midnightHeader .cart-menu',function(){
9472
9473  		if($(this).parents('.midnightHeader').offset().top - $(window).scrollTop() < 50){
9474  		
9475  			$(this).parents('.midnightHeader').css({'z-index': '9999'}).addClass('overflow');
9476  			$(this).parents('.midnightInner').css('overflow','visible');
9477  		}
9478  	});
9479  	$('body').on('mouseleave','#header-outer .midnightHeader',function(){
9480  		var $that = $(this);
9481  		clearTimeout($midnightSubmenuTimeout);
9482  		$midnightSubmenuTimeout = setTimeout(function(){
9483  			if(!$that.is(':hover')) {
9484  				$that.css({'z-index': 'auto'}).removeClass('overflow');
9485  				$that.find('.midnightInner').css('overflow','hidden');
9486  		
9487  			}
9488
9489  		},900);
9490  	});
9491  }
9492
9493  function midnightInit() {
9494
9495  	if( $('#header-outer[data-permanent-transparent="1"]').length > 0 && $('body[data-bg-header="true"]').length > 0) {
9496
9497			//perma trans
9498			
9499			////fix pages that set no midnight coloring
9500			if($('.container-wrap div[data-midnight]').length == 0) {
9501				$('.container-wrap').attr('data-midnight','dark');
9502			}
9503
9504			////cache midnighgt compat divs
9505			var $midnightCompatArr = [];
9506			$('div[data-midnight]').each(function(){
9507
9508				if($(this).attr('data-midnight') == 'light' || $(this).attr('data-midnight') == 'dark') {
9509					$midnightCompatArr.push($(this));
9510				}
9511
9512			});
9513
9514
9515			if($midnightCompatArr.length > 0) {
9516
9517				$.each($midnightCompatArr,function(k,v){
9518
9519						if(v.attr('data-midnight') == 'light' || v.attr('data-midnight') == 'dark') {
9520
9521							var $that = v;
9522							var waypoint = new Waypoint({
9523				 				element: $that,
9524					 			handler: function(direction) {
9525				
9526					 				if($('body.material-ocm-open').length > 0) return;
9527
9528									if(direction == 'down') {
9529										var $textColor = ($that.attr('data-midnight') == 'light') ? '' : 'dark-slide';
9530										$('#header-outer').removeClass('dark-slide').addClass($textColor);
9531								
9532									} else {
9533
9534										if(k-1 >= 0) { 
9535											var $prevMidItem = k-1;
9536										} else {
9537											var $prevMidItem = k;
9538										}
9539
9540										var $textColor = ($midnightCompatArr[$prevMidItem].attr('data-midnight') == 'light') ? '' : 'dark-slide';
9541										$('#header-outer').removeClass('dark-slide').addClass($textColor);
9542
9543									} 
9544
9545							
9546								},
9547								offset: $('#header-outer').height()
9548
9549							}); 
9550
9551						}
9552
9553				}); //each
9554
9555			} //if rows with color set are found
9556
9557  	} //if page is using trans effect
9558
9559  
9560  } 
9561
9562
9563
9564//box roll
9565function getScrollbarWidth() {
9566    var outer = document.createElement("div");
9567    outer.style.visibility = "hidden";
9568    outer.style.width = "100px";
9569    outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
9570
9571    document.body.appendChild(outer);
9572
9573    var widthNoScroll = outer.offsetWidth;
9574    // force scrollbars
9575    outer.style.overflow = "scroll";
9576
9577    // add innerdiv
9578    var inner = document.createElement("div");
9579    inner.style.width = "100%";
9580    outer.appendChild(inner);        
9581
9582    var widthWithScroll = inner.offsetWidth;
9583
9584    // remove divs
9585    outer.parentNode.removeChild(outer);
9586
9587    return widthNoScroll - widthWithScroll;
9588}
9589
9590
9591function boxRollInit() {
9592	if($('.nectar-box-roll').length > 0) { 
9593
9594		$('body').attr('data-scrollbar-width',getScrollbarWidth());
9595		
9596		$('body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap').addClass('no-scroll');
9597		$('body,html').stop().animate({ scrollTop:0 },0);
9598		$('.container-wrap').css('opacity',0).addClass('no-transform-animation-bottom-out').addClass('bottomBoxOut');
9599		//keep loading icon centered if scrollbar is going away
9600		if($('.mobile').length == 0) $('#ajax-loading-screen .loading-icon > span').css({ 'left' : '-'+getScrollbarWidth()/2 +'px'});
9601
9602		//change content pos
9603		var $overlaid = $('#page-header-bg .overlaid-content').clone();
9604		var $scrollDownOverlaid = $('.scroll-down-wrap').clone();
9605		$('#page-header-bg').removeAttr('data-midnight');
9606		$('#page-header-bg .overlaid-content, #page-header-bg .scroll-down-wrap').remove();
9607		$('.nectar-box-roll').append($overlaid);
9608		if($('#header-outer.dark-slide').length == 0) {
9609			$('.nectar-box-roll').attr('data-midnight','light');
9610		} else {
9611			$('.nectar-box-roll').attr('data-midnight','dark');
9612		}
9613		$('.overlaid-content').append($scrollDownOverlaid);
9614
9615		if($('.page-submenu[data-sticky="true"]').length > 0) {
9616			$('.container-wrap').addClass('no-trans');
9617		}
9618		
9619		nectarBoxRollContentHeight();
9620		
9621		$('html').addClass('nectar-box-roll-loaded');
9622		
9623		setTimeout(function() { pageLoadHash(); },700);
9624	} else {
9625		$('#ajax-content-wrap, .blurred-wrap').addClass('at-content');
9626		$('body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap').removeClass('no-scroll');
9627		$('.container-wrap').css('opacity',1).removeClass('no-transform-animation-bottom-out').removeClass('bottomBoxOut').removeClass('bottomBoxIn');
9628		perspect = 'not-rolled';
9629	}
9630}
9631if($('.nectar-box-roll').length > 0) { 
9632	boxRollInit();
9633}
9634
9635function nectarBoxRollContentHeight() {
9636
9637	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-space').height();
9638
9639	if($('#header-outer[data-transparent-header="true"]').length == 0) {
9640			$('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css({'height':window.innerHeight - $headerNavSpace, 'min-height':window.innerHeight - $headerNavSpace });
9641			if($('.mobile').length == 0 && $('body[data-header-format="left-header"]').length == 0) { 
9642				$('#ajax-content-wrap').css('margin-top',$headerNavSpace); 
9643				$('#slide-out-widget-area.fullscreen').css('margin-top','-'+$headerNavSpace+'px'); 
9644			}
9645			else { 
9646				$('#ajax-content-wrap, #slide-out-widget-area.fullscreen').css('margin-top','0'); 
9647			}
9648	} else {
9649		
9650		if($('.mobile').length > 0 && $('body[data-permanent-transparent="1"]').length == 0 ) {
9651			$('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css('height',window.innerHeight - $headerNavSpace);
9652		} else {
9653			$('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css('height',window.innerHeight);
9654		}
9655		
9656	}
9657}
9658
9659if($('.nectar-box-roll').length > 0) $(window).on('resize',nectarBoxRollContentHeight);
9660
9661
9662var perspect = 'not-rolled';
9663var animating = 'false';
9664function boxRoll(e,d) {
9665	
9666	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-space').height();
9667
9668	if($('#slide-out-widget-area.open').length > 0) return false;
9669	if( $('.nectar-box-roll canvas').length > 0 && $('.nectar-box-roll canvas[data-loaded="true"]').length == 0) return false;
9670
9671	if(perspect == 'not-rolled' && animating == 'false' && d == -1) {
9672		perspect = 'rolled';
9673		animating = 'true';
9674		$('body').addClass('box-animating').addClass('box-perspective-rolled').addClass('box-rolling');
9675
9676		$('.nectar-box-roll #page-header-bg').removeClass('topBoxIn').addClass('topBoxOut').css('will-change','transform');
9677		
9678		$('.nectar-box-roll .overlaid-content').removeClass('topBoxIn2').removeClass('topBoxIn').addClass('topBoxOut2').css('will-change','transform');
9679		
9680		$('.container-wrap').removeClass('bottomBoxOut').addClass('bottomBoxIn').removeClass('no-transform-animation-bottom-out').addClass('nectar-box-roll-class').css('will-change','transform');
9681		if($('#header-outer[data-transparent-header="true"]').length == 0) {
9682			$('.container-wrap').css({'height':$(window).height() - $headerNavSpace, 'opacity': 1});
9683			$('#slide-out-widget-area.fullscreen').css('margin-top','0px');
9684		} else {
9685			$('.container-wrap').css({'height':$(window).height(), 'opacity': 1});
9686		}
9687		
9688
9689		$('.nectar-slider-wrap').css({'opacity':0});
9690
9691		updateRowRightPadding(d);
9692		pauseVideoBG();
9693
9694		//old browser workaround
9695		var timeout1 = 1220;
9696		var timeout2 = 1650;
9697		var timeout3 = 1700;
9698		var timeout4 = 1350;
9699		if( $('html.no-cssanimations').length > 0) {
9700			timeout1 = 1;
9701			timeout2 = 1;
9702			timeout3 = 1;
9703			timeout4 = 1;
9704		}
9705
9706		$('.container-wrap').css('padding-right',$('body').attr('data-scrollbar-width') + 'px');
9707		setTimeout(function(){
9708			$('#header-outer, #wpadminbar, body:not(.material) .cart-outer .cart-menu, .midnightHeader .midnightInner').animate({'padding-right': $('body').attr('data-scrollbar-width')},250);
9709			$('.nectar-box-roll .canvas-bg').addClass('out-of-sight');
9710			if($('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').removeClass('transparent');
9711
9712			if($('body.mobile').length > 0) $('.nectar-box-roll').css({'z-index':'1'});
9713			
9714			//perma trans coloring
9715			$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';
9716			if($('#header-outer[data-permanent-transparent="1"]').length > 0) {
9717				
9718				if($first_row_coloring == 'dark') {
9719					$('#header-outer').addClass('dark-slide');
9720				} else {
9721					$('#header-outer').removeClass('dark-slide');
9722				}
9723				
9724			}
9725			
9726		},timeout1);
9727		setTimeout(function(){ 
9728			updateRowRightPadding(1);
9729			$('body,html,#ajax-content-wrap, .container-wrap, .blurred-wrap').removeClass('no-scroll'); 
9730			$('#ajax-content-wrap, .blurred-wrap').addClass('at-content');
9731			$('.container-wrap, #footer-outer').removeClass('bottomBoxIn').removeClass('nectar-box-roll-class').addClass('auto-height');
9732			$('#header-outer, #wpadminbar, .container-wrap, .cart-outer .cart-menu, .midnightHeader .midnightInner').stop().css('padding-right',0);
9733
9734			if( $smoothActive == 1 && $(window).width() > 690  && Modernizr.csstransforms3d && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ 
9735				niceScrollInit();
9736			}
9737			
9738			$('.nectar-box-roll').css({'z-index':'-1000'}).transition({'y': '-200%'},0);
9739			$('.nectar-box-roll canvas').hide();
9740			$('body').removeClass('box-rolling');
9741			$('.nectar-slider-wrap').transition({'opacity':1},600,'easeOutCubic');
9742
9743			$('.nectar-box-roll #page-header-bg, .nectar-box-roll .overlaid-content, .container-wrap').css('will-change','auto');
9744			if($waypointsBound == false) { 
9745				waypoints();	
9746				midnightInit();
9747			}
9748			
9749		},timeout2);
9750		
9751		//fadeIn
9752		setTimeout(function(){ 
9753			$('.container-wrap .main-content > .row > div > div[class*="col"]').css({'opacity':1});
9754		},timeout4);
9755
9756		setTimeout(function(){ 
9757					animating ='false'; 
9758					$('body').removeClass('box-animating');		
9759		},timeout3);
9760
9761		//header position when transparent nav was used
9762		if($('#header-outer[data-permanent-transparent="1"]').length == 0 && $('.mobile').length == 0 && $('#header-outer[data-transparent-header="true"]').length != 0) { 
9763			$('#ajax-content-wrap').transition({'margin-top':$('#header-outer').outerHeight(true) + $('#header-outer').offset().top},2000,'easeInOutQuad');
9764		}
9765
9766		//remove header if not fixed
9767		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');
9768
9769	}
9770
9771	else if(perspect == 'rolled' && animating == 'false' && d == 1 && $(window).scrollTop() < 100) {
9772
9773		$('.container-wrap').removeClass('auto-height');
9774		if($('#header-outer[data-transparent-header="true"]').length == 0) {
9775			$('.container-wrap').css({'height':$(window).height() - $headerNavSpace, 'opacity': 1});
9776		} else {
9777			$('.container-wrap').css({'height':$(window).height(), 'opacity': 1});
9778		}
9779		
9780		$('#footer-outer').removeClass('auto-height');
9781		$('body').addClass('box-rolling');
9782
9783		perspect = 'not-rolled';
9784		animating = 'true';
9785		$('body').addClass('box-animating').addClass('box-perspective-not-rolled');
9786
9787		$('#header-outer, #wpadminbar, .container-wrap, .cart-outer .cart-menu, .midnightHeader .midnightInner').css('padding-right',$('body').attr('data-scrollbar-width') + 'px');
9788		$('.nectar-slider-wrap').transition({'opacity':0},600,'easeOutCubic');
9789		$('.container-wrap .main-content > .row > div > div[class*="col"]').stop(true).css({'opacity':0});
9790		setTimeout(function(){
9791			$('#header-outer, #wpadminbar, .cart-outer .cart-menu, .midnightHeader .midnightInner').animate({'padding-right': 0},250);
9792			$('.nectar-box-roll .canvas-bg').removeClass('out-of-sight');
9793			resizeVideoToCover();
9794			//header position when transparent nav was used
9795			if($('#header-outer[data-transparent-header="true"]').length != 0) { 
9796				$('#ajax-content-wrap').stop(true,true).transition({'margin-top':0},2000,'easeInOutCubic');
9797			} else {
9798				if($('.mobile').length == 0) $('#slide-out-widget-area.fullscreen').css('margin-top','-'+$headerNavSpace+'px');
9799			}
9800
9801		},30);
9802
9803		//old browser workaround
9804		var timeout1 = 1700;
9805		var timeout2 = 1600;
9806		var timeout3 = 1300;
9807		if( $('html.no-cssanimations').length > 0) {
9808			timeout1 = 1;
9809			timeout2 = 1;
9810			timeout3 = 1;
9811		}
9812
9813		if($('body.mobile').length > 0) {
9814			setTimeout(function(){
9815				$('.nectar-box-roll').css('z-index','1000');
9816			},timeout3);
9817		} else {
9818			$('.nectar-box-roll').css('z-index','1000');
9819		}
9820
9821		updateRowRightPadding(d);
9822		removeNiceScroll();
9823		$('.nectar-box-roll').transition({'y': '0'},0);
9824		$('.nectar-box-roll canvas').show();
9825		setTimeout(function(){ 
9826			updateRowRightPadding(1);
9827			animating ='false'; 
9828			$('body').removeClass('box-animating');
9829			$('#page-header-bg').removeClass('topBoxIn');
9830			$('.overlaid-content').removeClass('topBoxIn2');	
9831			$('body').removeClass('box-rolling');
9832			resumeVideoBG();
9833			$('.nectar-box-roll #page-header-bg, .nectar-box-roll .overlaid-content, .container-wrap').css('will-change','auto');
9834			
9835			
9836			//perma trans coloring
9837			if($('#header-outer[data-permanent-transparent="1"]').length > 0) {
9838				
9839				if( $('.nectar-box-roll[data-midnight="dark"]').length > 0 ) {
9840					$('#header-outer').addClass('dark-slide');
9841				} else {
9842					$('#header-outer').removeClass('dark-slide');
9843				}
9844				
9845			}
9846			
9847		},timeout1);
9848
9849		setTimeout(function(){
9850			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');
9851		},timeout2);
9852
9853		$('body,html,#ajax-content-wrap, .container-wrap, .blurred-wrap').addClass('no-scroll');
9854		$('#ajax-content-wrap, .blurred-wrap').removeClass('at-content');
9855		$('.container-wrap').addClass('nectar-box-roll-class');
9856		$('.nectar-box-roll #page-header-bg').removeClass('topBoxOut').addClass('topBoxIn').css('will-change','transform');
9857		
9858		$('.container-wrap').removeClass('bottomBoxIn').addClass('bottomBoxOut').css('will-change','transform');
9859
9860		if($('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').addClass('transparent');
9861
9862		$('.nectar-box-roll .overlaid-content').removeClass('topBoxOut2').removeClass('topBoxOut').addClass('topBoxIn2').css('will-change','transform');
9863	
9864		if($('#header-outer[data-header-resize="1"]').length > 0) { bigNav(); }
9865
9866		$('.nectar-box-roll .trigger-scroll-down').removeClass('hovered');
9867	}
9868
9869	
9870}
9871
9872function boxScrollEvent(event, delta) {
9873	if($('#slide-out-widget-area.open.fullscreen').length > 0 || $('.material-ocm-open').length > 0 ||  $('#search-outer.material-open').length > 0 ) return false;
9874	boxRoll(event,delta);
9875}
9876
9877function boxRollMouseWheelInit() {
9878	if($('.nectar-box-roll').length > 0) {
9879		$('body').on("mousewheel", boxScrollEvent);
9880	} else {
9881		$('body').off("mousewheel", boxScrollEvent);
9882	}
9883}
9884
9885if($('.nectar-box-roll').length > 0) {
9886	boxRollMouseWheelInit();
9887}
9888
9889$('body').on('click','.nectar-box-roll .section-down-arrow',function(){
9890	boxRoll(null,-1);
9891	$(this).addClass('hovered');
9892	setTimeout(function(){ $('.nectar-box-roll .section-down-arrow').removeClass('hovered'); },2000);
9893	return false;
9894});
9895
9896
9897
9898function updateRowRightPadding(d){
9899	$('.wpb_row.full-width-section').each(function(){
9900		if($(this).hasClass('extraPadding') && d == 1) {
9901			$(this).css('padding-right',parseInt($(this).css('padding-right')) - parseInt($('body').attr('data-scrollbar-width')) + 'px' ).removeClass('extraPadding');
9902		} else {
9903			$(this).css('padding-right',parseInt($('body').attr('data-scrollbar-width')) + parseInt($(this).css('padding-right')) + 'px' ).addClass('extraPadding');
9904		}	
9905	});
9906	$('.wpb_row.full-width-content').each(function(){
9907		if($(this).find('.row-bg.using-image').length == 0) {
9908			if($(this).hasClass('extraPadding') && d == 1) {
9909				$(this).find('.row-bg').css('width',parseInt($(this).width()) - parseInt($('body').attr('data-scrollbar-width')) + 'px' ).removeClass('extraPadding');
9910			} else {
9911				$(this).find('.row-bg').css('width',parseInt($('body').attr('data-scrollbar-width')) + $(this).width() + 'px' ).addClass('extraPadding');
9912			}	
9913		}
9914	});
9915}
9916
9917function pauseVideoBG() {
9918	if($('.nectar-box-roll video').length > 0 && !nectarDOMInfo.usingMobileBrowser) { $('.nectar-box-roll video')[0].pause(); }
9919}
9920function resumeVideoBG() {
9921	if($('.nectar-box-roll video').length > 0 && !nectarDOMInfo.usingMobileBrowser) { $('.nectar-box-roll video')[0].play(); }
9922}
9923
9924//touch 
9925if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) && $('.nectar-box-roll').length > 0) {
9926	$('body').swipe({
9927		tap: function(event,target) {
9928			if($(target).parents('.nectar-flip-box').length > 0)
9929				$(target).parents('.nectar-flip-box').trigger('click');
9930			if($(target).is('.nectar-flip-box'))
9931				$(target).trigger('click');
9932		},
9933		swipeStatus: function(event, phase, direction, distance, duration, fingers) {
9934			if($('#slide-out-widget-area.open').length > 0) return false;
9935			if(direction == 'up') {
9936				boxRoll(null,-1);
9937				if($('#ajax-content-wrap.no-scroll').length == 0) $('body').swipe("option", "allowPageScroll", 'vertical');
9938			} else if(direction == "down" && $(window).scrollTop() == 0) {
9939				boxRoll(null,1);
9940				$('body').swipe("option", "allowPageScroll", 'auto');
9941			}
9942		}
9943	});
9944
9945}
9946
9947function removeNiceScroll() {
9948		if($().niceScroll && $("html").getNiceScroll()){
9949			var nice = $("html").getNiceScroll();
9950			nice.stop();
9951			
9952			$('html').removeClass('no-overflow-y');
9953			$('.nicescroll-rails').hide();
9954			if($('#boxed').length == 0){
9955				$('body, body #header-outer, body #header-secondary-outer, body #search-outer, .midnightHeader .midnightInner').css('padding-right','0px');
9956			} else if($('body[data-ext-responsive="true"]').length == 0 ) {
9957				$('body').css('padding-right','0px');
9958			}
9959
9960			$('body').attr('data-smooth-scrolling','0');
9961		}
9962	}
9963//called after box roll
9964var $waypointsBound = false;
9965function waypoints() {
9966	rowBGAnimations();
9967	columnBGAnimations();
9968	colAndImgAnimations(); 
9969	progressBars(); 
9970	dividers();
9971	iconList();
9972	animated_titles();
9973	highlighted_text();
9974	imageWithHotspots();
9975	clientsFadeIn(); 
9976	splitLineHeadings();
9977	svgAnimations(); 
9978	milestoneInit();
9979	nectar_fancy_ul_init();
9980	owl_carousel_animate();
9981	headerRowColorInheritInit();
9982	morphingOutlines(); 
9983	portfolioLoadIn();
9984	animatedColBorders();
9985	foodMenuItems();
9986	vcWaypoints();
9987	$waypointsBound = true;
9988}
9989
9990
9991
9992/***************** WooCommerce Cart *****************/
9993var timeout;
9994var productToAdd;
9995var $dropdownStyle = ($('body[data-dropdown-style="minimal"]').length > 0)  ? 'minimal' : 'default';
9996//notification
9997$('body').on('click','.product .add_to_cart_button', function(){
9998
9999	var $productHeading = ($(this).parents('li').find('h2').length > 0) ? 'h2' : 'h3';
10000
10001	productToAdd = $(this).parents('li').find($productHeading).text();
10002	$('#header-outer .cart-notification span.item-name').html(productToAdd);
10003	
10004});
10005
10006//notification hover
10007$('body').on('mouseenter','#header-outer .cart-notification',function(){
10008	if($dropdownStyle == 'minimal') {
10009		$(this).hide();
10010		$('#header-outer .widget_shopping_cart').addClass('open').stop(true,true).show();
10011		$('#header-outer .cart_list').stop(true,true).show();
10012	} else {
10013		$(this).fadeOut(400);
10014		$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(300);
10015		$('#header-outer .cart_list').stop(true,true).fadeIn(300);
10016	}
10017	
10018	clearTimeout(timeout);
10019});
10020
10021//cart dropdown
10022var $headerCartSelector = ($('body.material').length > 0) ? '#header-outer .nectar-woo-cart' : '#header-outer  div.cart-outer';
10023
10024if($($headerCartSelector).length > 0) {
10025	$($headerCartSelector).hoverIntent(function(){
10026
10027		if($dropdownStyle == 'minimal') { 
10028			$('#header-outer .widget_shopping_cart').addClass('open').stop(true,true).show()
10029			$('#header-outer .cart_list').stop(true,true).show();
10030			clearTimeout(timeout);
10031			$('#header-outer .cart-notification').hide();
10032		} else {
10033			$('#header-outer .widget_shopping_cart').addClass('open').stop(true,true).fadeIn(300);
10034			$('#header-outer .cart_list').stop(true,true).fadeIn(300);
10035			clearTimeout(timeout);
10036			$('#header-outer .cart-notification').fadeOut(300);
10037		}
10038		
10039	});
10040}
10041
10042
10043$('body').on('mouseleave',$headerCartSelector,function(){
10044	var $that = $(this);
10045	setTimeout(function(){
10046		if(!$that.is(':hover')){
10047			$('#header-outer .widget_shopping_cart').removeClass('open').stop(true,true).fadeOut(300);
10048			$('#header-outer .cart_list').stop(true,true).fadeOut(300);
10049		}
10050	},200);
10051});
10052
10053if($('#header-outer[data-cart="false"]').length == 0) {
10054	$('body').on('added_to_cart', shopping_cart_dropdown_show);
10055	$('body').on('added_to_cart', shopping_cart_dropdown);
10056	
10057	//update header cart markup after ajax remove
10058	$('body').on('removed_from_cart', wooCartImgPos);
10059}
10060
10061function shopping_cart_dropdown() {
10062		
10063		if(!$('.widget_shopping_cart .widget_shopping_cart_content .cart_list .empty').length && $('.widget_shopping_cart .widget_shopping_cart_content .cart_list').length > 0 ) {
10064			$('.cart-menu-wrap').addClass('has_products');
10065			$('header#top nav > ul, #search-outer #search #close a, header#top .span_9 >.slide-out-widget-area-toggle').addClass('product_added');
10066
10067			if(!$('.cart-menu-wrap').hasClass('static')) $('.cart-menu-wrap, #mobile-cart-link').addClass('first-load');
10068			
10069			//change position of img in cart nav dropdown
10070			wooCartImgPos();
10071			
10072			//nectar slider nav directional effect
10073			if($('#header-outer').hasClass('directional-nav-effect') && $('#header-outer .cart-icon-wrap .dark').length == 0 && $('body.ascend').length > 0){
10074				$('#header-outer .cart-outer .cart-icon-wrap').each(function(){
10075                    $(this).find('> i, > span.light, > span.dark, > span.original').remove();
10076                    $(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>');
10077                	$(this).find('.original').attr('data-w',$(this).find('span.original').width()+1);
10078                });
10079			}
10080		}
10081
10082}
10083
10084
10085function shopping_cart_dropdown_show(e) {
10086		
10087		clearTimeout(timeout);
10088		
10089		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' ) {
10090			
10091			//fix for standalone woocommerce add to cart buttons
10092			if( $('#header-outer .cart-notification .item-name').length > 0 && $('#header-outer .cart-notification .item-name').text().length == 0 ) { return; }
10093			
10094			//before cart has slide in
10095			if(!$('#header-outer .cart-menu-wrap').hasClass('has_products')) {
10096				setTimeout(function(){ $('#header-outer .cart-notification').fadeIn(400); },400);
10097			}
10098			else if(!$('#header-outer .cart-notification').is(':visible')) {
10099				$('#header-outer .cart-notification').fadeIn(400);
10100			} else {
10101				$('#header-outer .cart-notification').show();
10102			}
10103			timeout = setTimeout(hideCart,2700);
10104
10105			$('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy');
10106		}
10107}
10108
10109function hideCart() {
10110	$('#header-outer .cart-notification').stop(true,true).fadeOut();
10111}
10112
10113function checkForWooItems(){ 
10114	
10115	var checkForCartItems = setInterval(shopping_cart_dropdown,250);
10116	setTimeout(function(){ clearInterval(checkForCartItems); },4500);
10117	
10118}
10119
10120function wooCartImgPos() {
10121	$('#header-outer .widget_shopping_cart .cart_list li').each(function(){
10122		
10123		if( $(this).find('> img').length == 0 && $(this).find('.product-meta').length == 0 ) {
10124			
10125			var productCartImgLinkSrc = ($(this).find('> a[href]:not(.remove)').length > 0) ? $(this).find('> a[href]:not(.remove)').attr('href') : '';
10126			var productCartImg = $(this).find('> a > img').clone();
10127			
10128			$(this).wrapInner('<div class="product-meta" />');
10129			
10130			$(this).prepend(productCartImg);
10131			
10132			if(productCartImgLinkSrc.length > 0) {
10133			   productCartImg.wrap('<a href="'+productCartImgLinkSrc+'"></a>');
10134			}
10135			
10136		}
10137		
10138	});
10139}
10140
10141if($('#header-outer[data-cart="false"]').length == 0) {
10142	checkForWooItems();
10143}
10144
10145function nectarAccountPageTabs() {
10146	
10147	//if not on account page
10148	if($('body.woocommerce-account #customer_login').length == 0) return;
10149	
10150	//create HTML
10151	$('.woocommerce-account .woocommerce > #customer_login').prepend('<div class="nectar-form-controls" />');
10152	
10153	$('.woocommerce-account .woocommerce > #customer_login > div:not(.nectar-form-controls)').each(function(){
10154			var $title = $(this).find('> h2').text();
10155			$('#customer_login .nectar-form-controls').append('<div class="control">' + $title + '</div>');
10156	});
10157	
10158	//event
10159	$('.woocommerce-account .woocommerce > #customer_login .nectar-form-controls .control').on('click',function(){
10160		
10161		$('.woocommerce-account .woocommerce >
10161 #customer_login .nectar-form-controls .control').removeClass('active');
10162		$(this).addClass('active');
10163		
10164		var formIndex = $(this).index() + 1;
10165		$('#customer_login div[class*="u-column"]').hide();
10166		$('#customer_login div[class*="u-column"].col-'+formIndex).show();
10167		
10168		setTimeout(function(){
10169			$('#customer_login div[class*="u-column"]').removeClass('visible');
10170			$('#customer_login div[class*="u-column"].col-'+formIndex).addClass('visible');
10171		},30);
10172		
10173	});
10174	
10175	//starting
10176	$('.woocommerce-account .woocommerce > #customer_login .nectar-form-controls .control:nth-child(1)').trigger('click');
10177	
10178}
10179
10180nectarAccountPageTabs();
10181
10182var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
10183var secondaryHeader = ($('#header-outer').attr('data-using-secondary') == '1') ? 32 : 0 ;
10184function searchFieldCenter(){
10185	var $headerHeightSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').outerHeight();
10186	$('#search-outer').css('top', $headerHeightSpace + extraHeight + secondaryHeader);
10187	$('#search-outer > #search #search-box').css('top',($(window).height()/2) - ($('#search-outer > #search input').height()/2) - $headerHeightSpace );
10188}
10189
10190
10191
10192//text on hover effect
10193$('body').on('mouseover','.text_on_hover .product-wrap',function(){
10194	$(this).parent().addClass('hovered');
10195});
10196$('body').on('mouseover','.text_on_hover > a:first-child',function(){
10197	$(this).parent().addClass('hovered');
10198});
10199
10200$('body').on('mouseout','.text_on_hover .product-wrap',function(){
10201	$(this).parent().removeClass('hovered');
10202});
10203$('body').on('mouseout','.text_on_hover > a:first-child',function(){
10204	$(this).parent().removeClass('hovered');
10205});
10206
10207
10208//material/fancy parallax hover effect zindex
10209if($('.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){
10210
10211	var $productZindex = 101;
10212	
10213	$('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(){
10214		
10215		$productZindex++;
10216
10217		$(this).css('z-index',$productZindex+1);
10218		
10219	});
10220	$('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(){
10221		
10222		var $that = $(this);
10223		setTimeout(function(){ if(!$that.is(':hover')) $that.css('z-index',100); },350);
10224	});
10225
10226	//reset to stop zindex from getting too high
10227	setInterval(function(){ 
10228		if($('.nectar-fancy-box[data-style="parallax_hover"]:hover').length > 0 || $('.minimal.product:hover').length > 0) {
10229			 return;
10230		}
10231
10232		$('.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);
10233		$productZindex = 101; 
10234	},10000);
10235
10236}
10237
10238function minimalProductHover() {
10239	
10240	//add icons
10241	$('.products .classic .product-wrap .add_to_cart_button').wrapInner('<span />');
10242	$('.products .classic .product-wrap .add_to_cart_button').prepend('<i class="normal icon-salient-cart"></i>');
10243	
10244	//bind hover
10245	$('body').on('mouseover', '.products .minimal.product',function(){
10246		minimalProductCalc($(this));
10247	});
10248	
10249	$('body').on('mouseleave', '.products .minimal.product',function(){
10250		
10251		$(this).find('.background-color-expand').css({
10252			'transform': 'scale(1)'
10253		});
10254		
10255	});
10256	
10257	//starting trigger mouse over
10258	$('.products .minimal.product').each(function(){
10259		if($(this).is(':hover')) {
10260			$(this).trigger('mouseover');
10261		}
10262	});
10263}
10264
10265function minimalProductCalc(el) {
10266	var $item = el;
10267	var $itemWidth = $item.width();
10268	var $itemHeight = $item.height();
10269	
10270	var $wChange = (parseInt($itemWidth) + 40) / parseInt($itemWidth);
10271	var $hChange = (parseInt($itemHeight) + 40) / parseInt($itemHeight);
10272	
10273	$item.addClass('hover-bound');
10274	
10275	$item.find('.background-color-expand').css({
10276		'transform': 'scale('+ $wChange + ',' + $hChange  +') translateY(0px)'
10277	});
10278}
10279
10280minimalProductHover();
10281
10282
10283
10284
10285//mobile widget filters
10286////skip widgets without any titles
10287$('.woocommerce #sidebar .widget.woocommerce').each(function(){
10288	if($(this).find('> h4').length == 0) {
10289		$(this).addClass('no-widget-title');
10290	}
10291});
10292
10293$('body').on('click','#sidebar .widget.woocommerce:not(.widget_price_filter) h4',function(){
10294	if($(window).width() < 1000) {
10295		$(this).parent().find('> ul').slideToggle();
10296		$(this).parent().toggleClass('open-filter');
10297	}
10298});
10299
10300	//slide in cart
10301	$('body').on('mouseenter','#header-outer [data-cart-style="slide_in"] .cart-menu-wrap',openRightCart);
10302
10303	function openRightCart() {
10304
10305		if($('.nectar-slide-in-cart ul.cart_list li:not(.empty)').length > 0) {
10306			$('.nectar-slide-in-cart').addClass('open');
10307
10308			$(window).on('mousemove.rightCartOffsetCheck',closeCartCheck);
10309		}
10310	}
10311
10312	function closeCartCheck(e) {
10313		var $windowWidth = $(window).width();
10314		if(e.clientX < $windowWidth - 370 - $bodyBorderWidth) {
10315
10316			$(window).off('mousemove.rightCartOffsetCheck',closeNavCheck);
10317
10318			$('.nectar-slide-in-cart').removeClass('open');
10319
10320		}
10321
10322	}
10323
10324
10325
10326
10327
10328/***************** Search ******************/
10329	var $placeholder = ($('#search-outer #search input[type=text][data-placeholder]').length > 0) ? $('#search-outer #search input[type=text]').attr('data-placeholder') : '';
10330	var logoHeight = parseInt($('#header-outer').attr('data-logo-height'));
10331	
10332
10333	if($('body').hasClass('material') && $('#header-outer .bg-color-stripe').length == 0) {
10334		$('#header-outer').append('<div class="bg-color-stripe" />');
10335	} 
10336
10337	////search box event
10338	$('body').on('click', '#search-btn a', function(){ return false; });
10339	$('body').on('mouseup', '#search-btn a:not(.inactive), #header-outer .mobile-search', function(){
10340
10341		if($(this).hasClass('open-search')) { return false; } 
10342
10343
10344		if($('body').hasClass('ascend') || $('body[data-header-format="left-header"]').length > 0 && $('body.material').length == 0 ){ 
10345			$('#search-outer > #search form, #search-outer #search .span_12 span').css('opacity',0);
10346			$('#search-outer > #search form').css('bottom','10px');
10347			$('#search-outer #search .span_12 span').css('top','10px');
10348			$('#search-outer').show();
10349			$('#search-outer').stop().transition({scale: '1,0', 'opacity': 1},0).transition({ scale: '1,1'},400,'easeInOutCubic');
10350
10351			$('#search-outer > #search form').delay(400).animate({'opacity':1, 'bottom':0},'easeOutCirc');
10352			$('#search-outer #search .span_12 span').delay(470).animate({'opacity':1, 'top':0},'easeOutCirc');
10353			
10354		} else if( !$('body').hasClass('material') ) {
10355			$('#search-outer').stop(true).fadeIn(600,'easeOutExpo');
10356		} else {
10357
10358			/*material*/
10359			$('#header-outer[data-transparent-header="true"] .bg-color-stripe').css('transition',''); 
10360
10361			$('#search-outer').addClass('material-open');
10362			$('#ajax-content-wrap').addClass('material-open');
10363			$('#header-outer').addClass('material-search-open');
10364			$('#fp-nav').addClass('material-ocm-open');
10365
10366
10367		}
10368
10369
10370		if($('body[data-header-format="left-header"]').length == 0) {
10371			$('body.original #search-outer > #search input[type="text"]').css({
10372				'top' : $('#search-outer').height()/2 - $('#search-outer > #search input[type="text"]').height()/2
10373			});
10374		}
10375		
10376		setTimeout(function(){
10377
10378			$('#search input[type=text]').focus();
10379			
10380			if($('#search input[type=text]').attr('value') == $placeholder){
10381				$('#search input[type=text]').setCursorPosition(0);	
10382			}
10383
10384		},300);
10385
10386		//ascend
10387		if($('body').hasClass('ascend') || $('body[data-header-format="left-header"]').length > 0 && $('body.material').length == 0){ 
10388			searchFieldCenter();
10389		}
10390
10391		$(this).toggleClass('open-search');
10392
10393		//close slide out widget area
10394		$('.slide-out-widget-area-toggle a:not(#toggle-nav).open:not(.animating)').trigger('click');
10395
10396		return false;
10397	});
10398	
10399	$('body:not(.material)').on('keydown','#search input[type=text]',function(){
10400		if($(this).attr('value') == $placeholder){
10401			$(this).attr('value', '');
10402		}
10403	});
10404	
10405// 	$('body:not(.material)').on('keyup','#search input[type=text]',function(){
10406// 		if($(this).attr('value') == ''){
10407// 			$(this).attr('value', $placeholder);
10408// 			$(this).setCursorPosition(0);
10409// 		}
10410// 	});
10411	
10412	
10413	////close search btn event
10414	$('body').on('click','#close',function(){
10415		closeSearch();
10416		$('#search-btn a, #header-outer .mobile-search').removeClass('open-search');
10417		return false;
10418	});
10419
10420	//close material when clicking off the search
10421	$('body.material').on('click', '#ajax-content-wrap', function(e){
10422		if (e.originalEvent !== undefined) {
10423			closeSearch();
10424			$('#search-btn a, #header-outer .mobile-search').removeClass('open-search');
10425		}
10426	});
10427
10428	//material gets esc
10429	if($('body.material').length > 0) {
10430		$(document).keyup(function(e) {
10431
10432	     if (e.keyCode == 27) { 
10433	     	closeSearch();  
10434	     	$('#search-btn a').removeClass('open-search'); 
10435
10436	     	//close ocm material
10437	     	if($('.ocm-effect-wrap.material-ocm-open').length > 0) {
10438	     		$('.slide-out-widget-area-toggle.material-open a').trigger('click');
10439	     	}
10440	     }
10441
10442		});
10443	}
10444
10445	//if user clicks away from the search close it
10446	$('body:not(.material)').on('blur','#search-box input[type=text]',function(e){
10447		closeSearch();
10448		$('#search-btn a, #header-outer .mobile-search').removeClass('open-search');
10449	});
10450
10451	
10452	function closeSearch(){
10453		if($('body').hasClass('ascend') || $('body[data-header-format="left-header"]').length > 0 && $('body.material').length == 0){ 
10454			$('#search-outer').stop().transition({'opacity' :0},300,'easeOutCubic');
10455			$('#search-btn a').addClass('inactive');
10456			setTimeout(function(){ $('#search-outer').hide(); $('#search-btn a').removeClass('inactive'); },300);
10457		} else if($('body.material').length == 0) {
10458			$('#search-outer').stop(true).fadeOut(450,'easeOutExpo');
10459		}
10460
10461		if($('body').hasClass('material')) {
10462			$('#ajax-content-wrap').removeClass('material-open');
10463			$('#header-outer').removeClass('material-search-open');
10464			$('#search-outer').removeClass('material-open');
10465			$('#fp-nav').removeClass('material-ocm-open');
10466		}
10467	}
10468	
10469	
10470	//mobile search
10471	$('body').on('click', '#mobile-menu #mobile-search .container a#show-search',function(){
10472		$('#mobile-menu .container > ul').slideUp(500);
10473		return false;
10474	});
10475	
10476/***************** Nav ******************/
10477	
10478
10479	function centeredNavBottomBarReposition() {
10480		
10481		var $headerOuter = $('#header-outer');
10482		var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
10483		var $headerSpan3 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_3');
10484		var $secondaryHeader = $('#header-secondary-outer');
10485		var $headerBtns = $headerSpan3.find('nav >ul.buttons');
10486		var $bodyBorderSize = ($('.body-border-top').length > 0 && $(window).width() > 1000) ? $('.body-border-top').height(): 0;
10487		var override_remove_check = false;
10488		
10489		function centeredNavBottomBarSecondary() {
10490			if($('body.mobile').length > 0) {
10491				$('#header-outer').css('margin-top','');
10492			} else {
10493				if($('#header-outer').css('top') == '0px') {
10494						
10495						$(window).off('scroll', centeredNavBottomFixed_Add);
10496						$(window).off('scroll', centeredNavBottomFixed_Remove);
10497						
10498						$navLogoMargin = parseInt($('body.material #header-outer #logo').css('margin-top'));
10499						if($headerSpan9.offset().top - $navLogoMargin - nectarDOMInfo.scrollTop <= $headerOuter.offset().top - parseInt($secondaryHeader.height()) ) {
10500								$(window).on('scroll', centeredNavBottomFixed_Add);
10501						} else {
10502								$(window).on('scroll', centeredNavBottomFixed_Remove);
10503						}
10504					
10505				}
10506
10507				
10508				$('#header-outer').css('margin-top',nectarDOMInfo.secondaryHeaderHeight);
10509				
10510				// custom mobile breakpoint
10511				if($('#header-outer .span_9').css('display') == 'none') {
10512					 $('#header-outer').css('margin-top','');
10513				} else if($('#header-outer .span_9').css('display') != 'none' && parseInt($('#header-outer').css('top')) > 0) {
10514					 $('#header-outer').css('top','');
10515				}
10516				
10517				
10518			}
10519			
10520		}
10521		
10522		if($secondaryHeader.length > 0) {
10523			
10524			if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
10525				setTimeout(function(){
10526					nectarDOMInfo.secondaryHeaderHeight = $('#header-secondary-outer').height();
10527					centeredNavBottomBarSecondary();
10528				},50);
10529				$(window).smartresize(centeredNavBottomBarSecondary);
10530			}
10531		
10532		} 
10533		
10534
10535		var $navLogoMargin = parseInt($('body.material #header-outer #logo').css('margin-top'));
10536		
10537
10538		if($('#header-outer[data-condense="true"]').length > 0) {
10539			
10540				$(window).on('scroll',centeredNavBottomFixed_Add);
10541				$(window).trigger('scroll');
10542				
10543				
10544				$(window).smartresize(function(){
10545					
10546					condenseCustomBreakPointHelper();
10547					
10548					//trigger condense if switching from mobile to desktop and user has scrolled down
10549					if(nectarDOMInfo.windowWidth > 1000 && $('#header-outer').css('position') == 'fixed' && $('#header-outer').css('top') == '0px' && override_remove_check == false) {
10550						setTimeout(function(){
10551							$(window).off('scroll', centeredNavBottomFixed_Add);
10552							$(window).off('scroll', centeredNavBottomFixed_Remove);
10553							override_remove_check = true;
10554							centeredNavBottomFixed_Remove();
10555						},100);
10556							
10557					}
10558				});
10559				
10560				function condenseCustomBreakPointHelper() {
10561					var $withinCustomBreakpoint = mobileBreakPointCheck();
10562					
10563					//adding class to prevent logo from hiding when opening OCM
10564					if($withinCustomBreakpoint) {
10565						$('#header-outer').addClass('within-custom-breakpoint');
10566					} else {
10567						$('#header-outer').removeClass('within-custom-breakpoint');
10568					}
10569				}
10570				
10571				condenseCustomBreakPointHelper();
10572
10573		}
10574
10575		
10576		
10577		
10578		function centeredNavBottomFixed_Add() {
10579				
10580				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; }
10581				
10582				$navLogoMargin = parseInt($('body.material #header-outer #logo').css('margin-top'));
10583				
10584				var $bodyBorderTop = ($('.body-border-top').length > 0 && nectarDOMInfo.secondaryHeaderHeight > 0) ? $('.body-border-top').height() : 0;
10585				
10586				if($headerSpan9.offset().top - $navLogoMargin - nectarDOMInfo.scrollTop <= $headerOuter.offset().top - parseInt(nectarDOMInfo.secondaryHeaderHeight) + $bodyBorderTop ) {
10587						
10588						var amountToMove = (parseInt($headerSpan9.position().top) - $navLogoMargin - parseInt(nectarDOMInfo.adminBarHeight)) + parseInt(nectarDOMInfo.secondaryHeaderHeight) - $bodyBorderTop;
10589						
10590						//megamenu RT
10591						if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer .megamenu').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0) {
10592							$('#header-outer').removeClass('no-transition');	
10593						}
10594						
10595						$headerOuter.addClass('fixed-menu').removeClass('transparent').css({
10596							'top' : '-' + amountToMove + 'px',
10597							'position': 'fixed'
10598						});
10599						
10600						var $headerNavBarOffset = $('header#top .span_9 nav >ul').offset().top;
10601						var $headerButtonsOffset = $headerBtns.offset().top;
10602						
10603						if($('#boxed > #header-outer').length > 0) {
10604							$headerButtonsOffset = $headerButtonsOffset + 20;
10605						}
10606
10607						var $headerButtonsHeight = ($headerSpan9.find('.sf-menu > li > a').length > 0) ? (20 - parseInt($headerSpan9.find('.sf-menu > li > a').height())) / 2 : 2;
10608						$headerBtns.css('transform','translateY('+ (parseInt($headerNavBarOffset) - parseInt($headerButtonsOffset) - $headerButtonsHeight - 1) +'px)');
10609						
10610						$headerBtns.find('.nectar-woo-cart').css('height',$headerOuter.height() + parseInt($headerOuter.css('top')) - parseInt(nectarDOMInfo.adminBarHeight) + parseInt(nectarDOMInfo.secondaryHeaderHeight) );
10611
10612						//search
10613
10614						$(window).off('scroll', centeredNavBottomFixed_Add);
10615						$(window).on('scroll', centeredNavBottomFixed_Remove);
10616				}
10617		}
10618		
10619		function centeredNavBottomFixed_Remove() {
10620			
10621			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; }
10622			
10623			$navLogoMargin = parseInt($('body.material #header-outer #logo').css('margin-top'));
10624			
10625			if($headerSpan9.offset().top - $navLogoMargin - nectarDOMInfo.scrollTop > $headerOuter.offset().top - parseInt(nectarDOMInfo.secondaryHeaderHeight) || override_remove_check ) {
10626						$headerOuter.removeClass('fixed-menu').css({
10627							'top' : '0',
10628							'position': 'absolute'
10629						});
10630						
10631						//reset override_remove_check
10632						override_remove_check = false;
10633						
10634						//search
10635						//$('#search-outer .container').css('transform','translateY(0px)');
10636						
10637						$headerBtns.css('transform','translateY(0px)');
10638						
10639						$headerBtns.find('.nectar-woo-cart').css('height','');
10640						
10641						if($('#header-outer.transparent').length == 0) {
10642							
10643							if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer .megamenu').length > 0) {
10644								$('#header-outer').removeClass('no-transition');	
10645							}
10646							
10647							if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer .megamenu').length > 0) {
10648								
10649								if($('#header-outer').attr('data-transparent-header') == 'true' && $('.nectar-box-roll').length == 0 && $('.megamenu.sfHover').length == 0) {
10650									$('#header-outer').addClass('transparent');
10651									$('#header-outer').removeClass('no-transition');	
10652								}
10653								
10654								else if($('#header-outer').attr('data-transparent-header') == 'true' && $('.nectar-box-roll').length == 0 && $('.megamenu.sfHover').length > 0) {
10655									$('#header-outer').addClass('no-transition');	
10656								}
10657								
10658							} else {
10659								if($('#header-outer').attr('data-transparent-header') == 'true'  && $('.nectar-box-roll').length == 0) $('#header-outer').addClass('transparent');
10660							}
10661						}
10662						
10663						$(window).off('scroll', centeredNavBottomFixed_Remove);
10664						$(window).on('scroll', centeredNavBottomFixed_Add);
10665							
10666			}
10667			
10668		}
10669		
10670		
10671		
10672}
10673	
10674	
10675
10676function condenseHeaderMobileOverride() {
10677	var $transCondenseHeader = $('#header-outer[data-has-menu="true"][data-format="centered-menu-bottom-bar"][data-condense="true"][data-transparent-header="true"] .span_9');
10678	
10679	if($transCondenseHeader.length > 0 && nectarDOMInfo.windowWidth > 1000 && $transCondenseHeader.css('display') == 'none') {
10680		$('#header-outer').removeClass('transparent').addClass('no-transition');
10681	} else if($transCondenseHeader.length > 0 && nectarDOMInfo.scrollTop < 20 && nectarDOMInfo.windowWidth > 1000 && $transCondenseHeader.css('display') != 'none') {
10682		$('#header-outer:not(.transparent)').addClass('transparent');
10683	}
10684
10685	
10686}
10687
10688
10689	
10690	if($('#header-outer[data-format="centered-menu-bottom-bar"]').length > 0) {
10691		centeredNavBottomBarReposition();
10692		
10693		condenseHeaderMobileOverride();
10694		$(window).smartresize(condenseHeaderMobileOverride);
10695	}
10696	
10697	
10698	function centeredLogoMargins() {
10699
10700		if($('#header-outer[data-format="centered-logo-between-menu"]').length > 0 && $(window).width() > 1000) {
10701			$midnightSelector = ($('#header-outer .midnightHeader').length > 0) ? '> .midnightHeader:first-child' : '';
10702			var $navItemLength = $('#header-outer[data-format="centered-logo-between-menu"] '+$midnightSelector+' nav > .sf-menu > li').length;
10703			if($('#header-outer #social-in-menu').length > 0) { $navItemLength--; }
10704
10705			$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());
10706
10707			$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'));
10708			
10709			if($extraMenuSpace > 30) {
10710				$extraMenuSpace += 45;
10711			} else if($extraMenuSpace > 20) {
10712				$extraMenuSpace += 40;
10713			} else {
10714				$extraMenuSpace += 30;
10715			}
10716
10717			$('#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');
10718			$leftMenuWidth = 0;
10719			$rightMenuWidth = 0;
10720			$('#header-outer[data-format="centered-logo-between-menu"] '+$midnightSelector+' nav > .sf-menu > li:not(#social-in-menu)').each(function(i){
10721				if(i+1 <= Math.floor($navItemLength/2)) {
10722					$leftMenuWidth += $(this).width();
10723				} else {
10724					$rightMenuWidth += $(this).width();
10725				}
10726
10727			});
10728
10729			var $menuDiff = Math.abs($rightMenuWidth - $leftMenuWidth);
10730
10731			if($leftMenuWidth > $rightMenuWidth)  {
10732				$('#header-outer .row > .col.span_9').css('padding-right',$menuDiff);
10733			}
10734			else {
10735				$('#header-outer .row > .col.span_9').css('padding-left',$menuDiff);
10736			}
10737
10738			$('#header-outer[data-format="centered-logo-between-menu"] nav').css('visibility','visible');
10739		}
10740	}
10741	
10742	var logoHeight = parseInt($('#header-outer').attr('data-logo-height'));
10743	var headerPadding = parseInt($('#header-outer').attr('data-padding'));
10744	var usingLogoImage = $('#header-outer').attr('data-using-logo');
10745	
10746	if( isNaN(headerPadding) || headerPadding.length == 0 ) { headerPadding = 28; }
10747	if( isNaN(logoHeight) || usingLogoImage.length == 0 ) { usingLogoImage = false; logoHeight = 30;}
10748	
10749	if($('header#top nav > ul li#search-btn a').length > 0) {
10750		var $searchBtnHeight = $('header#top nav > ul li#search-btn a').height();
10751	} else {
10752		var $searchBtnHeight = 24;
10753	}
10754
10755	//inital calculations
10756	function headerInit() {
10757		
10758		if($('#header-outer[data-format="left-header"]').length > 0) return;
10759
10760
10761		if($('body.material').length == 0) {
10762
10763			$('#header-outer #logo img').css({
10764				'height' : logoHeight				
10765			});	
10766
10767			$('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({
10768				'padding-top' : headerPadding
10769			});	
10770			
10771			if($('body.mobile').length == 0) {
10772				$('header#top nav > ul > li:not(#social-in-menu) > a').css({
10773					'padding-bottom' : Math.floor( ((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding),
10774					'padding-top' : Math.floor( (logoHeight/2) - ($('header#top nav > ul > li > a').height()/2))
10775				});	
10776				
10777				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();
10778				
10779				$('header#top nav > ul > li#social-in-menu > a').css({
10780					'margin-top' : Math.ceil(logoHeight/2) - Math.ceil($socialInMenuHeight/2)
10781				});	
10782			}
10783			
10784			if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
10785				$('#header-outer .cart-menu').css({  
10786					'padding-bottom' : Math.ceil(((logoHeight/2) - ($searchBtnHeight/2)) + headerPadding),
10787					'padding-top' : Math.ceil(((logoHeight/2) - ($searchBtnHeight/2)) + headerPadding)
10788				});	
10789			} 
10790			
10791			
10792			$('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({
10793				'padding-bottom' : (logoHeight/2) - ($searchBtnHeight/2),
10794				'padding-top' : (logoHeight/2) - ($searchBtnHeight/2)
10795			});	
10796			
10797
10798			
10799			if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) {
10800				$('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({
10801					'padding-top': 0,
10802					'padding-bottom': 0
10803				});
10804
10805				$('header#top nav > ul.buttons').css({
10806					'margin-top' : - headerPadding,
10807					'height' : Math.floor(logoHeight + headerPadding*2) -1
10808				});
10809
10810				$('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({
10811					'visibility' : 'visible',
10812					'padding-top': Math.floor((logoHeight/2) - ($searchBtnHeight/2) + headerPadding),
10813					'padding-bottom': Math.floor((logoHeight/2) - ($searchBtnHeight/2) + headerPadding)
10814				});
10815			}
10816			
10817			$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').css({
10818				'top' : $('header#top nav > ul.sf-menu > li > a').outerHeight() 
10819			});	
10820			
10821			
10822			setTimeout(function(){ 
10823				$('body:not(.ascend):not(.material) #search-outer #search-box .ui-autocomplete').css({
10824					'top': parseInt($('#header-outer').outerHeight())+'px'
10825				}); 
10826			},1000);
10827			
10828			$('body:not(.ascend):not(.material) #search-outer #search-box .ui-autocomplete').css({
10829				'top': parseInt($('#header-outer').outerHeight())+'px'
10830			});
10831
10832		}//not material skin
10833
10834		//header space
10835		if($('.nectar-parallax-scene.first-section').length == 0) {
10836
10837			if($('#header-outer').attr('data-using-secondary') == '1'){
10838				if($('#header-outer[data-mobile-fixed="false"]').length > 0  || $('body.mobile').length == 0 ) {
10839					$('#header-space').css('height', parseInt($('#header-outer').outerHeight()) + $('#header-secondary-outer').height());
10840					
10841				} else {
10842					$('#header-space').css('height', parseInt($('#header-outer').outerHeight()));
10843					
10844				}
10845				
10846			} else {
10847
10848				$('#header-space').css('height', $('#header-outer').outerHeight() );
10849			} 
10850		}
10851		
10852		$('#header-outer .container, #header-outer .cart-menu').css('visibility','visible');
10853		
10854
10855		if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
10856			$('body:not(.ascend):not(.material) #search-outer, #search .container').css({
10857				'height' : logoHeight + headerPadding*2
10858			});	
10859			
10860			$('body:not(.ascend):not(.material) #search-outer > #search input[type="text"]').css({
10861				'font-size'  : 43,
10862				'height' : '59px',
10863				'top' : ((logoHeight + headerPadding*2)/2) - $('#search-outer > #search input[type="text"]').height()/2
10864			});
10865			
10866			$('body:not(.ascend):not(.material) #search-outer > #search #close a').css({
10867				'top' : ((logoHeight + headerPadding*2)/2) - 8
10868			});	
10869		} else {
10870			$('body:not(.ascend):not(.material) #search-outer, #search .container').css({
10871				'height' : logoHeight + headerPadding*2 + logoHeight + 17
10872			});	
10873			
10874			$('body:not(.ascend):not(.material) #search-outer > #search input[type="text"]').css({
10875				'font-size'  : 43,
10876				'height' : '59px',
10877				'top' : ((logoHeight + headerPadding*2)/2) - ($('#search-outer > #search input[type="text"]').height()/2) + logoHeight/2 + 17
10878			});
10879			
10880			$('body:not(.ascend):not(.material) #search-outer > #search #close a').css({
10881				'top' : ((logoHeight + headerPadding*2)/2) - 8 + logoHeight/2 + 17
10882			});	
10883		}
10884		
10885
10886	}
10887
10888	
10889	//is header resize on scroll enabled?
10890	var headerResize = $('#header-outer').attr('data-header-resize');
10891	var headerHideUntilNeeded = $('body').attr('data-hhun');
10892
10893	//transparent fix
10894
10895	if($('#header-outer[data-remove-fixed="1"]').length == 0) {
10896		if($(window).scrollTop() != 0 && $('#header-outer.transparent[data-permanent-transparent="false"]').length == 1) $('#header-outer').removeClass('transparent');
10897	}
10898
10899	if( headerResize == 1 && headerHideUntilNeeded != '1'){
10900		
10901		headerInit();
10902
10903		$(window).off('scroll.headerResizeEffect');
10904
10905		if($('#nectar_fullscreen_rows').length == 0) {
10906			$(window).on('scroll.headerResizeEffect',smallNav);
10907		}
10908		else if($('#nectar_fullscreen_rows[data-mobile-disable="on"]').length > 0 && navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) ) {
10909			$(window).on('scroll.headerResizeEffect',smallNav);
10910		}
10911
10912	} else if(headerHideUntilNeeded != '1') {
10913		headerInit();
10914		$(window).off('scroll.headerResizeEffectOpaque');
10915		$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
10916		
10917	} else if(headerHideUntilNeeded == '1') {
10918
10919		headerInit();
10920
10921		if($('.nectar-box-roll').length > 0) $('#header-outer').addClass('at-top-before-box');
10922
10923		var previousScroll = 0, // previous scroll position
10924        menuOffset = $('#header-space').height()*2, // height of menu (once scroll passed it, menu is hidden)
10925        detachPoint = ($('body.mobile').length > 0) ? 150 : 600, // point of detach (after scroll passed it, menu is fixed)
10926        hideShowOffset = 6; // scrolling value after which triggers hide/show menu
10927
10928	    // on scroll hide/show menu
10929	    function hhunCalcs(e) {
10930
10931	     //stop scrolling while animated anchors
10932	     if($('body.animated-scrolling').length > 0 && $('#header-outer.detached').length > 0) return false;
10933
10934	     //stop when material ocm or material search is open
10935	     if($('body.material-ocm-open').length > 0 || $('#search-outer.material-open').length > 0) { return false; }
10936
10937	     //stop on mobile if not using sticky option
10938	      if($('#header-outer[data-mobile-fixed="false"]').length > 0 && $('body.mobile').length > 0) {  $('#header-outer').removeClass('detached'); return false; }
10939
10940	      var currentScroll = $(this).scrollTop(), // gets current scroll position
10941	            scrollDifference = Math.abs(currentScroll - previousScroll); // calculates how fast user is scrolling
10942
10943	      if (!$('#header-outer').hasClass('side-widget-open') && !$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')) {
10944	       
10945	        // if scrolled past menu
10946	        if (currentScroll > menuOffset) {
10947	          // if scrolled past detach point add class to fix menu
10948	          if (currentScroll > detachPoint) {
10949	            if (!$('#header-outer').hasClass('detached'))
10950	              $('#header-outer').addClass('detached').removeClass('parallax-contained');
10951	          	   $('#header-outer').removeClass('no-transition');	
10952
10953
10954	          	  if($('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').removeClass('transparent');
10955	          }
10956
10957	          // if scrolling faster than hideShowOffset hide/show menu
10958	          if (scrollDifference >= hideShowOffset) {
10959	            if (currentScroll > previousScroll) {
10960	              // scrolling down; hide menu
10961	              if (!$('#header-outer').hasClass('invisible')) {
10962								
10963									if($('#header-outer.at-top').length > 0) {
10964									
10965										//prevent header from transitioning when first hiding
10966										$('#header-outer').addClass('no-trans-hidden');
10967										setTimeout(function(){
10968											$('#header-outer').addClass('invisible').removeClass('at-top');
10969											$('#header-outer').removeClass('no-trans-hidden');
10970										},30);
10971										
10972									} else {
10973										
10974										$('#header-outer').addClass('invisible').removeClass('at-top');
10975									}
10976								
10977	                
10978									
10979	                 //close submenus
10980	                 if( $(".sf-menu").length > 0 && $().superfish ) {
10981		          		 $(".sf-menu").superfish('hide');
10982		          		 $('header#top nav > ul.sf-menu > li.menu-item-over').removeClass('menu-item-over');
10983		          	 }
10984
10985	              }
10986	                $('.page-submenu.stuck').css('transform','translateY(0px)').addClass('header-not-visible');
10987
10988	            	
10989	            } else {
10990	              // scrolling up; show menu
10991	              if ($('#header-outer').hasClass('invisible'))
10992	                $('#header-outer').removeClass('invisible');
10993
10994	            	if($('.body-border-top').length > 0 && $('body.mobile').length == 0) {
10995
10996	            		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;
10997	            		var $bodyBorderSizeToRemove = ($bodyBorderHeaderColorMatch) ? $('.body-border-top').height() : 0;
10998	          	    	$('.page-submenu.stuck').css('transform','translateY('+ ($('#header-outer').outerHeight()-$bodyBorderSizeToRemove) +'px)').removeClass('header-not-visible');
10999
11000	            	} else {
11001	            		$('.page-submenu.stuck').css('transform','translateY('+$('#header-outer').outerHeight()+'px)').removeClass('header-not-visible');
11002	            	}
11003	            }
11004	          }
11005	        } else {
11006	          // only remove "detached" class if user is at the top of document (menu jump fix)
11007	          $topDetachNum = ($('#header-outer[data-using-secondary="1"]').length > 0) ? 32 : 0;
11008	          if($('.body-border-top').length > 0) {
11009	          		$topDetachNum = ($('#header-outer[data-using-secondary="1"]').length > 0) ? 32 + $('.body-border-top').height() : $('.body-border-top').height();
11010	          }
11011
11012	          if (currentScroll <= $topDetachNum){
11013	            $('#header-outer').removeClass('detached').removeClass('invisible').addClass('at-top');
11014	            
11015	            if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer .megamenu').length > 0) {
11016		            if($('#header-outer[data-transparent-header="true"]').length > 0 && $('.nectar-box-roll').length == 0 && $('.megamenu.sfHover').length == 0) { 
11017		            	$('#header-outer').addClass('transparent').css('transform','translateY(0)');
11018		            	$('#header-outer').removeClass('no-transition');	
11019		            }
11020		            else if($('.nectar-box-roll').length > 0) $('#header-outer').css('transform','translateY(0)').addClass('at-top-before-box');
11021		          
11022		        } else {
11023		        	 if($('#header-outer[data-transparent-header="true"]').length > 0 && $('.nectar-box-roll').length == 0) $('#header-outer').addClass('transparent').css('transform','translateY(0)');
11024		            else if($('.nectar-box-roll').length > 0) $('#header-outer').css('transform','translateY(0)').addClass('at-top-before-box');
11025		        }
11026
11027	            if( $('#page-header-bg[data-parallax="1"]').length > 0) $('#header-outer').addClass('parallax-contained').css('transform','translateY(0)');
11028	          }
11029	        }
11030
11031	        // if user is at the bottom of document show menu
11032	        if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
11033	          $('#header-outer').removeClass('invisible');
11034
11035	            if($('.body-border-top').length > 0 && $('body.mobile').length == 0) {
11036
11037            		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;
11038            		var $bodyBorderSizeToRemove = ($bodyBorderHeaderColorMatch) ? $('.body-border-top').height() : 0;
11039          	    	$('.page-submenu.stuck').css('transform','translateY('+ ($('#header-outer').outerHeight()-$bodyBorderSizeToRemove) +'px)').removeClass('header-not-visible');
11040	            }
11041	            else {
11042	            	$('.page-submenu.stuck').css('transform','translateY('+$('#header-outer').outerHeight()+'px)').removeClass('header-not-visible');
11043	            }
11044	          
11045	        }
11046
11047	      }
11048
11049	      // replace previous scroll position with new one
11050	      previousScroll = currentScroll;
11051
11052	    }
11053
11054	    //don't trigger for header remove stickiness
11055	    if($('#header-outer[data-remove-fixed="1"]').length == 0) {
11056		    hhunCalcs();
11057		    $(window).scroll(hhunCalcs);
11058		}
11059
11060
11061	}//end if hhun
11062	
11063	if($('#nectar_fullscreen_rows').length == 0 && $('.nectar-box-roll').length == 0) { midnightInit(); }	
11064	
11065	if($('#nectar_fullscreen_rows').length > 0 ) { ($('#header-outer').attr('data-permanent-transparent','false')) }
11066
11067	var shrinkNum = 6;
11068	var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
11069	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;
11070	var $scrollTriggerOffset = ( $('body.material').length > 0 ) ? 150 : 0;
11071
11072	if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
11073
11074	function smallNav(){
11075		var $offset = $(window).scrollTop();
11076		var $windowWidth = $(window).width();
11077		
11078
11079		if($offset > $scrollTriggerOffset && $windowWidth > 1000 && $('body.material-ocm-open').length == 0) {
11080		
11081
11082			//if going to small when material search is closing, it must be closed immediately
11083			if($('body.material').length > 0) {
11084				if($('#search-outer.material-open').length == 0) {
11085					$('#header-outer[data-transparent-header="true"] .bg-color-stripe').css('transition','none');
11086				}
11087
11088				//secondary header
11089				if($('#header-secondary-outer').length > 0) {
11090					$('#header-secondary-outer').addClass('hide-up').css('transform','translateY(-100%)');
11091					$('#header-outer').css('transform', 'translateY(-' +$('#header-secondary-outer').height()+ 'px)');
11092				}
11093
11094			}
11095
11096			if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer .megamenu').length > 0) {
11097				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) { 
11098					$('#header-outer').removeClass('transparent');
11099					$('#header-outer').removeClass('no-transition');	
11100				}
11101			} else {
11102				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');
11103			}
11104
11105			
11106			$('#header-outer, #search-outer').addClass('small-nav');
11107			
11108			//body border full width side padding
11109			if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0 && $('.body-border-top').length > 0 && $bodyBorderHeaderColorMatch == true) {
11110				$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
11111					'padding' : '0'			
11112				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11113			}
11114
11115			if($('body.material').length > 0) {
11116				$('header#top nav > ul > li.menu-item-with-margin').stop(true,true).animate({
11117					'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) - parseInt(shrinkNum)*3) +'px'
11118				},{queue:false, duration:310, easing: 'easeOutQuad'});	
11119			}
11120			if($('body.material').length == 0) {
11121
11122				$('#header-outer #logo img').stop(true,true).animate({
11123					'height' : logoHeight - shrinkNum
11124				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11125					
11126				$('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({
11127					'padding-top' : Math.ceil(headerPadding / 1.8)
11128				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11129				
11130				if($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) {
11131					$('#header-outer .row > .span_3').stop(true,true).animate({
11132						'padding-bottom' : Math.ceil(headerPadding / 1.8)
11133					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11134				}
11135
11136				$('header#top nav > ul > li:not(#social-in-menu) > a').stop(true,true).animate({
11137					'padding-bottom' :  Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding / 1.8) ,
11138					'padding-top' :  Math.floor(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) 
11139				},{queue:false, duration:250, easing: 'easeOutCubic'});	 
11140
11141				
11142
11143				$('header#top nav > ul > li#social-in-menu > a').stop(true,true).animate({
11144					'margin-bottom' :  Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li#social-in-menu > a').height()/2)) + headerPadding / 1.8) ,
11145					'margin-top' :  Math.floor(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li#social-in-menu > a').height()/2)) 
11146				},{queue:false, duration:250, easing: 'easeOutCubic'});	 
11147				
11148				$('header#top nav > ul > li.menu-item-with-margin').stop(true,true).animate({
11149					'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) - parseInt(shrinkNum)*3) +'px'
11150				},{queue:false, duration:250, easing: 'easeOutCubic'});	 
11151
11152				if($bodyBorderHeaderColorMatch == true) {
11153					$('.body-border-top').stop(true,true).animate({
11154						'margin-top': '-'+$('.body-border-top').height()+'px'
11155					},{queue:false, duration:400, easing: 'easeOutCubic', complete: function() { $(this).css('margin-top',0)} });	 
11156				}
11157
11158				if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
11159					$('#header-outer .cart-menu').stop(true,true).animate({
11160						'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2) + headerPadding/ 1.7),
11161						'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2) + headerPadding/ 1.7) +1
11162					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11163				} 
11164				
11165				if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) {
11166					$('header#top nav > ul.buttons').stop(true,true).animate({
11167						'margin-top' : - Math.ceil(headerPadding/ 1.8),
11168						'height' : Math.floor((headerPadding*2)/ 1.8 + logoHeight-shrinkNum)
11169					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11170
11171					$('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({
11172						'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2) + headerPadding/ 1.7),
11173						'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2) + headerPadding/ 1.7) +1
11174					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11175
11176				} else {
11177					$('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({
11178						'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2)),
11179						'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($searchBtnHeight/2))
11180					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11181				}
11182
11183				if($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) {
11184					$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
11185						'top' : Math.floor($('header#top nav > ul > li > a').outerHeight())
11186					},{queue:false, duration:250, easing: 'easeOutCubic'});		
11187				} else {
11188					$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
11189						'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),
11190					},{queue:false, duration:250, easing: 'easeOutCubic'});		
11191				}
11192				
11193				$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({
11194					'top': Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) +'px'
11195				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11196			
11197
11198				if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
11199					$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
11200						'height' : Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8)
11201					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11202
11203					$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
11204						'font-size'  : 30,
11205						'line-height' : '30px',
11206						'height' : '44px',
11207						'top' : ((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2
11208					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11209				
11210					$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
11211						'top' : ((logoHeight-shrinkNum + headerPadding+5)/2) - 10
11212					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11213
11214				} else {
11215					$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
11216						'height' : Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) + logoHeight - shrinkNum + 17
11217					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11218
11219					$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
11220						'font-size'  : 30,
11221						'line-height' : '30px',
11222						'height' : '44px',
11223						'top' : ((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2 + (logoHeight- shrinkNum)/2 + 8
11224					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11225
11226					$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
11227						'top' : ((logoHeight-shrinkNum + headerPadding+5)/2) - 10 + (logoHeight- shrinkNum)/2 + 8
11228					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11229				}
11230
11231			}//not material skin
11232		
11233			
11234
11235			//box roll
11236			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'})
11237			
11238			
11239			if($('body').hasClass('ascend')){ 
11240				$('#search-outer').stop(true,true).animate({
11241					'top' : Math.floor((logoHeight-shrinkNum) +(headerPadding*2)/ 1.8 + extraHeight + secondaryHeader)
11242				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11243			}
11244			
11245			//if no image is being used
11246			if(usingLogoImage == false) $('body:not(.material) header#top #logo').stop(true,true).animate({
11247				'margin-top' : 0
11248			},{queue:false, duration:450, easing: 'easeOutExpo'});	
11249			
11250			$(window).off('scroll',smallNav);
11251			$(window).on('scroll',bigNav);
11252
11253			//dark slider coloring border fix
11254			$('#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');
11255			$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none');
11256			setTimeout(function(){ 
11257				$('#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'); 
11258				$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.30s ease');
11259			},300);
11260
11261		}
11262
11263	}
11264	
11265	function bigNav(){
11266		var $offset = $(window).scrollTop();
11267		var $windowWidth = $(window).width();
11268
11269		if($('body.material-ocm-open').length > 0) { return false; }
11270
11271		if($offset <= $scrollTriggerOffset && $windowWidth > 1000 || $('.small-nav').length > 0 && $('#ajax-content-wrap.no-scroll').length > 0 ) {
11272			
11273
11274			$('#header-outer, #search-outer').removeClass('small-nav');
11275			
11276			if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer .megamenu').length > 0) {
11277				if($('#header-outer').attr('data-transparent-header') == 'true'  && $('.nectar-box-roll').length == 0 && $('.megamenu.sfHover').length == 0) {
11278					$('#header-outer').addClass('transparent');
11279					$('#header-outer').removeClass('no-transition');	
11280				}
11281			} else {
11282				if($('#header-outer').attr('data-transparent-header') == 'true'  && $('.nectar-box-roll').length == 0) $('#header-outer').addClass('transparent');
11283			}
11284
11285			
11286
11287
11288			//body border full width side padding
11289			if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0 && $('.body-border-top').length > 0 && $bodyBorderHeaderColorMatch == true) {
11290				$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
11291					'padding' : '0 28px'			
11292				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11293			}
11294
11295
11296			if($('body.material').length > 0) {
11297
11298				$('header#top nav > ul > li.menu-item-with-margin').stop(true,true).animate({
11299					'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) + parseInt(shrinkNum)*3) +'px'
11300				},{queue:false, duration:140, easing: 'easeOutQuad'});
11301
11302				//secondary header
11303				if($('#header-secondary-outer').length > 0) {
11304					$('#header-secondary-outer, #header-outer').removeClass('hide-up').css('transform','translateY(0%)');
11305				}
11306		
11307			}
11308
11309			if($('body.material').length == 0) {
11310
11311				$('#header-outer #logo img').stop(true,true).animate({
11312					'height' : logoHeight,				
11313				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11314
11315				$('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({
11316					'padding-top' : headerPadding 
11317				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11318				
11319				if($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) {
11320					$('#header-outer .row > .span_3').stop(true,true).animate({
11321						'padding-bottom' : headerPadding 
11322					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11323				}
11324
11325				$('header#top nav > ul > li:not(#social-in-menu) > a').stop(true,true).animate({
11326					'padding-bottom' : ((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding,
11327					'padding-top' : (logoHeight/2) - ($('header#top nav > ul > li > a').height()/2) 
11328				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11329				
11330				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();
11331				
11332				$('header#top nav > ul > li#social-in-menu > a').stop(true,true).animate({
11333					'margin-top' : Math.ceil(logoHeight/2) - Math.ceil($socialInMenuHeight/2)
11334				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11335					
11336				$('header#top nav > ul > li.menu-item-with-margin').stop(true,true).animate({
11337					'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) + parseInt(shrinkNum)*3) +'px'
11338				},{queue:false, duration:250, easing: 'easeOutCubic'});	 
11339
11340				if($bodyBorderHeaderColorMatch == true) {
11341					$('.body-border-top').css({ 'margin-top': '-'+$('.body-border-top').height()+'px'}).stop(true,true).animate({
11342						'margin-top': '0'
11343					},{queue:false, duration:250, easing: 'easeOutCubic'});	 
11344				}
11345
11346				if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
11347					$('#header-outer .cart-menu').stop(true,true).animate({
11348						'padding-bottom' : Math.ceil(((logoHeight/2) - ($searchBtnHeight/2)) + headerPadding),
11349						'padding-top' : Math.ceil(((logoHeight/2) - ($searchBtnHeight/2)) + headerPadding)
11350					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11351				}
11352
11353				if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) {
11354					$('header#top nav > ul.buttons').stop(true,true).animate({
11355						'margin-top' : - Math.ceil(headerPadding),
11356						'height' : Math.floor(headerPadding*2 + logoHeight) -1
11357					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11358
11359					$('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({
11360						'padding-top': Math.floor((logoHeight/2) - ($searchBtnHeight/2) + headerPadding),
11361						'padding-bottom': Math.floor((logoHeight/2) - ($searchBtnHeight/2) + headerPadding)
11362					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11363				} else {
11364					$('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({
11365						'padding-bottom' : Math.floor((logoHeight/2) - ($searchBtnHeight/2)),
11366						'padding-top' : Math.ceil((logoHeight/2) - ($searchBtnHeight/2))
11367					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11368				}
11369				
11370				if($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) {
11371					$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
11372						'top' : Math.floor($('header#top nav > ul > li > a').outerHeight())
11373					},{queue:false, duration:250, easing: 'easeOutCubic'});		
11374				} else {
11375					$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
11376						'top' : Math.ceil($('header#top nav > ul > li > a').height() + (((logoHeight)/2) - ($('header#top nav > ul > li > a').height()/2))*2 + headerPadding),
11377					},{queue:false, duration:250, easing: 'easeOutCubic'});		
11378				}
11379				
11380				$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({
11381					'top': Math.ceil(logoHeight + headerPadding*2) +'px'
11382				},{queue:false, duration:250, easing: 'easeOutCubic'});	
11383				
11384				
11385				if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
11386					$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
11387						'height' : Math.ceil(logoHeight + headerPadding*2)
11388					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11389					
11390					$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
11391						'font-size'  : 43,
11392						'line-height' : '43px',
11393						'height' : '59px',
11394						'top' : ((logoHeight + headerPadding*2)/2) - 30
11395					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11396					
11397					
11398					$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
11399						'top' : ((logoHeight + headerPadding*2)/2) - 8
11400					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11401					
11402				} else {
11403					$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
11404						'height' : Math.ceil(logoHeight + headerPadding*2) + logoHeight + 17
11405					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11406					
11407					$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
11408						'font-size'  : 43,
11409						'line-height' : '43px',
11410						'height' : '59px',
11411						'top' : ((logoHeight + headerPadding*2)/2) - 30 + (logoHeight)/2 + 8
11412					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11413					
11414					
11415					$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
11416						'top' : ((logoHeight + headerPadding*2)/2) - 8 + (logoHeight)/2 + 8
11417					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11418				}
11419
11420
11421				if($('body').hasClass('ascend')){ 
11422					$('#search-outer').stop(true,true).animate({
11423						'top' : (logoHeight) +(headerPadding*2) + extraHeight + secondaryHeader
11424					},{queue:false, duration:250, easing: 'easeOutCubic'});	
11425				}
11426
11427				//if no image is being used
11428				if(usingLogoImage == false) $('header#top #logo').stop(true,true).animate({
11429					'margin-top' : 4
11430				},{queue:false, duration:450, easing: 'easeOutExpo'});	
11431				
11432
11433
11434			}//not material skin
11435
11436
11437				//box roll
11438			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'})
11439			
11440
11441			$(window).off('scroll',bigNav);
11442			$(window).on('scroll',smallNav);
11443
11444
11445			//dark slider coloring border fix
11446			$('#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');
11447			$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none');
11448			setTimeout(function(){ 
11449				$('#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'); 
11450				$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.30s ease');
11451			},300);
11452		}
11453
11454	}
11455	
11456	
11457	function headerSpace() {
11458		if($('.mobile').length > 0) {
11459			if(window.innerHeight < window.innerWidth && window.innerWidth > 1000) {
11460				if($('#header-outer.small-nav').length == 0)
11461					$('#header-space').css('height', $('#header-outer').outerHeight() + $('#header-secondary-outer').height());
11462			} else {
11463				$('#header-space').css('height', $('#header-outer').outerHeight());
11464			}
11465			
11466		} else {
11467			if($('.nectar-parallax-scene.first-section').length == 0) {
11468
11469				var shrinkNum = 6;	
11470				var headerPadding = parseInt($('#header-outer').attr('data-padding'));
11471				if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
11472				var headerPadding2 = headerPadding - headerPadding/1.8;
11473				var $headerHeight = ($('#header-outer[data-header-resize="1"]').length > 0 && $('.small-nav').length > 0 ) ? $('#header-outer').outerHeight() + (parseInt(shrinkNum) + headerPadding2*2) : $('#header-outer').outerHeight();
11474
11475				if($('#header-outer').attr('data-using-secondary') == '1'){
11476					$('#header-space').css('height', $headerHeight + $('#header-secondary-outer').height());
11477				} else {
11478					$('#header-space').css('height', $headerHeight);
11479				} 
11480			}
11481		}
11482		
11483	}
11484
11485	//call immediately on mobile to make sure there's no gap with fixed setups
11486	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) {
11487		$('#header-space').css('height', $('#header-outer').outerHeight());
11488	}
11489
11490
11491	var lastPosition = -1;
11492	var $headerScrollTop = nectarDOMInfo.scrollTop;
11493
11494	function headerOffsetAdjust(){
11495		if($('body.compose-mode').length > 0) { return; }
11496		$headerScrollTop = nectarDOMInfo.scrollTop;
11497
11498		 if (lastPosition == $headerScrollTop) {
11499            requestAnimationFrame(headerOffsetAdjust);
11500            return false;
11501        } else lastPosition = $headerScrollTop;
11502		
11503		headerOffsetAdjustCalc();
11504
11505		requestAnimationFrame(headerOffsetAdjust);
11506
11507	}
11508	var condenseHeaderLayout = $('#header-outer[data-condense="true"]').length > 0 ? true : false;
11509	var headerOuterCached = $('#header-outer');
11510	
11511	function headerOffsetAdjustCalc() {
11512		if($('body.mobile').length > 0 || condenseHeaderLayout == true && $('#header-outer .span_9').css('display') == 'none') {
11513			var $eleHeight = 0;
11514
11515			var $endOffset = ($('#wpadminbar').css('position') == 'fixed') ? $('#wpadminbar').height() : 0;
11516			$eleHeight += ($('#header-secondary-outer').length > 0 && $('#header-secondary-outer').css('display') == 'block') ? nectarDOMInfo.secondaryHeaderHeight : 0;
11517			$eleHeight += nectarDOMInfo.adminBarHeight;
11518			
11519			if( $eleHeight - $headerScrollTop > $endOffset) { 
11520				headerOuterCached.css('top', $eleHeight - $headerScrollTop + 'px');
11521			}
11522			else { headerOuterCached.css('top', $endOffset); }
11523
11524		} else {
11525				if(condenseHeaderLayout == false) {
11526					var $eleHeight = 0;
11527					
11528					$eleHeight += nectarDOMInfo.secondaryHeaderHeight;
11529					$eleHeight += nectarDOMInfo.adminBarHeight;
11530					headerOuterCached.css('top',$eleHeight+'px');
11531				}
11532		}
11533	}
11534
11535	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) {
11536		if($('#nectar_fullscreen_rows').length == 0) { requestAnimationFrame(headerOffsetAdjust); }
11537		else if($('#nectar_fullscreen_rows').length > 0 && $onMobileBrowser) {
11538			requestAnimationFrame(headerOffsetAdjust);
11539		}
11540		$(window).smartresize(headerOffsetAdjustCalc);
11541	}
11542		
11543
11544	function footerRevealCalcs() {
11545		var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').outerHeight();
11546
11547		if($(window).height() - $('#wpadminbar').height() - $headerNavSpace - $('#footer-outer').height() - 1 -$('#page-header-bg').height()  - $('.page-header-no-bg').height() > 0) {
11548			var $resizeExtra = ($('body:not(.material) #header-outer[data-header-resize="1"]').length > 0) ? 55: 0;
11549			$('body[data-footer-reveal="1"] .container-wrap').css({'margin-bottom': $('#footer-outer').height()-1 });
11550			//let even non reveal footer have min height set when using material ocm
11551			$('.container-wrap').css({'min-height': $(window).height() - $('#wpadminbar').height() - $headerNavSpace - $('#footer-outer').height() -1  - $('.page-header-no-bg').height() -$('#page-header-bg').height() + $resizeExtra });
11552		} else {
11553			$('body[data-footer-reveal="1"] .container-wrap').css({'margin-bottom': $('#footer-outer').height()-1 });
11554		}
11555		
11556		if( $(window).width() < 1000) $('#footer-outer').attr('data-midnight','light');
11557		else $('#footer-outer').removeAttr('data-midnight');
11558	}
11559	if($('body[data-footer-reveal="1"]').length > 0 || $('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length > 0) { 
11560		setTimeout(function(){
11561			footerRevealCalcs();
11562		},60);
11563		footerRevealCalcs();
11564		//set shadow to match BG color if applicable
11565		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') });
11566	}
11567	
11568	
11569	function opaqueCheck(){
11570		if($('#header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length > 0) { return; }
11571		
11572		var $offset = $(window).scrollTop();
11573		var $windowWidth = $(window).width();
11574
11575		if($offset > 0 && $windowWidth > 1000) {
11576			
11577			if($('body.material').length > 0) {
11578				$('#header-outer').addClass('scrolled-down');
11579
11580				//secondary header
11581				if($('#header-secondary-outer').length > 0) {
11582					$('#header-secondary-outer').addClass('hide-up').css('transform','translateY(-100%)');
11583					$('#header-outer').css('transform', 'translateY(-' +$('#header-secondary-outer').height()+ 'px)');
11584				}
11585			}
11586
11587			if($('#header-outer').attr('data-transparent-header') == 'true' && $('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').removeClass('transparent').addClass('scrolled-down');
11588			
11589			$(window).off('scroll',opaqueCheck);
11590			$(window).on('scroll',transparentCheck);
11591		}
11592	}
11593	
11594	
11595	function transparentCheck(){
11596		
11597		if($('#header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length > 0) { return; }
11598		
11599		var $offset = $(window).scrollTop();
11600		var $windowWidth = $(window).width();
11601
11602		if($offset == 0 && $windowWidth > 1000 && $('body.material-ocm-open').length == 0) {
11603			
11604			if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer .megamenu').length > 0) {
11605				
11606				if($('#header-outer').attr('data-transparent-header') == 'true' && $('.megamenu.sfHover').length == 0) { 
11607					$('#header-outer').addClass('transparent').removeClass('scrolled-down');
11608					$('#header-outer').removeClass('no-transition');	
11609				}
11610				else if($('#header-outer').attr('data-transparent-header') == 'true') { $('#header-outer').removeClass('scrolled-down'); }
11611				
11612			} else {
11613				if($('#header-outer').attr('data-transparent-header') == 'true') { $('#header-outer').addClass('transparent').removeClass('scrolled-down'); }
11614			}
11615
11616			if($('body.material').length > 0) {
11617				$('#header-outer').removeClass('scrolled-down');
11618
11619				//secondary header
11620				if($('#header-secondary-outer').length > 0) {
11621					$('#header-secondary-outer, #header-outer').removeClass('hide-up').css('transform','translateY(0%)');
11622				}
11623			}
11624
11625			
11626			$(window).off('scroll',transparentCheck);
11627			$(window).on('scroll',opaqueCheck);
11628		}
11629	}
11630	
11631
11632	
11633	
11634	//header inherit row color effect
11635	function headerRowColorInheritInit(){
11636		if($('body[data-header-inherit-rc="true"]').length > 0 && $('.mobile').length == 0){
11637			
11638			var headerOffset = ($('#header-outer[data-permanent-transparent="1"]').length == 0) ? (logoHeight - shrinkNum) + Math.
11638ceil((headerPadding*2) / 1.8) + nectarDOMInfo.adminBarHeight : logoHeight/2 + headerPadding + nectarDOMInfo.adminBarHeight;
11639			
11640			$('.main-content > .row > .wpb_row').each(function(){
11641
11642				var $that = $(this);
11643				var waypoint = new Waypoint({
11644	 				element: $that,
11645		 			handler: function(direction) {
11646
11647						if(direction == 'down') {
11648							
11649							if($that.find('.row-bg.using-bg-color').length > 0) {
11650								
11651								var $textColor = ($that.find('> .col.span_12.light').length > 0) ? 'light-text' : 'dark-text';
11652								$('#header-outer').css('background-color',$that.find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor);
11653								$('#header-outer').attr('data-current-row-bg-color',$that.find('.row-bg').css('background-color'));
11654
11655								$('body.material #header-outer .bg-color-stripe').css('background-color',$that.find('.row-bg').css('background-color'));
11656							} else {
11657								$('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text');
11658								$('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg'));
11659
11660								$('body.material #header-outer .bg-color-stripe').css('background-color', '');
11661							}
11662						
11663						} else {
11664
11665							if($that.prev('div.wpb_row').find('.row-bg.using-bg-color').length > 0) {
11666								var $textColor = ($that.prev('div.wpb_row').find('> .col.span_12.light').length > 0) ? 'light-text' : 'dark-text';
11667								$('#header-outer').css('background-color',$that.prev('div.wpb_row').find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor);
11668								$('#header-outer').attr('data-current-row-bg-color', $that.prev('div.wpb_row').find('.row-bg').css('background-color'));
11669
11670								$('body.material #header-outer .bg-color-stripe').css('background-color', $that.prev('div.wpb_row').find('.row-bg').css('background-color'));
11671							} else {
11672								$('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text');
11673								$('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg'));
11674
11675								$('body.material #header-outer .bg-color-stripe').css('background-color', '');
11676							}
11677
11678						} 
11679
11680				
11681					},
11682					offset: headerOffset
11683
11684				}); 
11685
11686
11687			});
11688		}
11689	}
11690
11691
11692
11693/****************sticky page submenu******************/
11694	if($('.page-submenu[data-sticky="true"]').length > 0 && $('#nectar_fullscreen_rows').length == 0) {
11695
11696		(function() {
11697		  'use strict'
11698
11699		  var $ = window.jQuery
11700		  var Waypoint = window.Waypoint
11701		  var $offsetHeight = 0; 
11702		  var shrinkNum = 6;	
11703		  var headerPadding = parseInt($('#header-outer').attr('data-padding'));
11704
11705		  if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
11706		  var headerPadding2 = headerPadding - headerPadding/1.8;
11707		  var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').outerHeight();
11708		  var $headerHeight = ($('#header-outer[data-header-resize="1"]').length > 0 && $('body.mobile').length == 0) ? $headerNavSpace - (parseInt(shrinkNum) + headerPadding2*2) : $headerNavSpace;
11709			
11710			if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
11711				
11712					var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
11713					var $secondaryHeader = $('#header-secondary-outer');
11714					
11715					$headerHeight = $('#header-outer').height() - (parseInt($headerSpan9.position().top) - parseInt($('#header-outer #logo').css('margin-top')) ) -  parseInt(nectarDOMInfo.secondaryHeaderHeight);
11716			}
11717			
11718		  if( $('.page-template-template-no-header-footer').length > 0 || $('.page-template-template-no-header').length > 0 ) { $headerNavSpace = 0; $headerHeight = 0; }
11719
11720		  if($('#header-secondary-outer').length > 0 && $('body.mobile').length == 0 && $('body.material').length == 0) $headerHeight += $('#header-secondary-outer').height();
11721		  
11722
11723		  $(window).on('smartresize',function(){
11724
11725		    $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').outerHeight();
11726		  	$headerHeight = ($('#header-outer[data-header-resize="1"]').length > 0 && $('.small-nav').length == 0 && $('body.mobile').length == 0) ? $headerNavSpace - (parseInt(shrinkNum) + headerPadding2*2) : $headerNavSpace;
11727		  	
11728				if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
11729					
11730						var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
11731						var $secondaryHeader = $('#header-secondary-outer');
11732						
11733						$headerHeight = $('#header-outer').height() - (parseInt($headerSpan9.position().top) - parseInt($('#header-outer #logo').css('margin-top')) ) - parseInt(nectarDOMInfo.secondaryHeaderHeight);
11734				}
11735				
11736				if($('#header-secondary-outer').length > 0  && $('body.mobile').length == 0 && $('body.material').length == 0) $headerHeight += $('#header-secondary-outer').height();
11737
11738		  	$offsetHeight = 0; 
11739		
11740		  	  if($('#wpadminbar').length > 0 && $('#wpadminbar').css('position') == 'fixed') $offsetHeight += $('#wpadminbar').height();
11741 			  if($('body[data-hhun="0"] #header-outer').length > 0 && !($('body.mobile').length > 0 && $('#header-outer[data-mobile-fixed="false"]').length > 0) ) {
11742 			  	  $offsetHeight += $headerHeight;
11743 			  }
11744
11745 			  if($('.body-border-top').length > 0 && $(window).width() > 1000 && $('body[data-hhun="1"]').length > 0) $offsetHeight += $('.body-border-top').height();
11746 	
11747 			
11748 			 //recalc for resizing (same as stuck/unstuck logic below)
11749 			 if($('.page-submenu.stuck').length > 0) {
11750
11751		        	$('.page-submenu.stuck').addClass('no-trans').css('top',$offsetHeight).css('transform','translateY(0)').addClass('stuck');
11752		        	var $that = this;
11753		        	setTimeout(function(){ $('.page-submenu.stuck').removeClass('no-trans'); },50);
11754		        	$('.page-submenu.stuck').parents('.wpb_row').css('z-index',10000);
11755
11756		        	//boxed
11757		        	if($('#boxed').length > 0) { 
11758		        		var $negMargin = ($(window).width() > 1000) ? $('.container-wrap').width()*0.04 :39;
11759		        		$('.page-submenu.stuck').css({'margin-left':'-'+$negMargin+'px', 'width' : $('.container-wrap').width()});
11760		        	}
11761
11762		        }
11763		        else { 
11764		        	$('.page-submenu.stuck').css('top','0').removeClass('stuck');
11765		       	   $('.page-submenu.stuck').parents('.wpb_row').css('z-index','auto');
11766
11767		       	    if($('#boxed').length > 0) $('.page-submenu.stuck').css({'margin-left':'0px', 'width' : '100%'});
11768		       	}
11769
11770		  });
11771
11772		  /* http://imakewebthings.com/waypoints/shortcuts/sticky-elements */
11773		  function Sticky(options) {
11774		    this.options = $.extend({}, Waypoint.defaults, Sticky.defaults, options)
11775		    this.element = this.options.element
11776		    this.$element = $(this.element)
11777		    this.createWrapper()
11778		    this.createWaypoint()
11779		  }
11780
11781		  /* Private */
11782		  Sticky.prototype.createWaypoint = function() {
11783		    var originalHandler = this.options.handler
11784
11785		    $offsetHeight = 0; 
11786		    if($('#wpadminbar').length > 0 && $('#wpadminbar').css('position') == 'fixed') $offsetHeight += $('#wpadminbar').height();
11787 			if($('body[data-hhun="0"] #header-outer').length > 0 && !($('body.mobile').length > 0 && $('#header-outer[data-mobile-fixed="false"]').length > 0) ) { 
11788 				$offsetHeight += $headerHeight;
11789 			}
11790 			 if($('.body-border-top').length > 0 && $(window).width() > 1000 && $('body[data-hhun="1"]').length > 0) $offsetHeight += $('.body-border-top').height();
11791 		
11792		    this.waypoint = new Waypoint($.extend({}, this.options, {
11793		      element: this.wrapper,
11794		      handler: $.proxy(function(direction) {
11795		        var shouldBeStuck = this.options.direction.indexOf(direction) > -1
11796		        var wrapperHeight = shouldBeStuck ? this.$element.outerHeight(true) : ''
11797
11798		        this.$wrapper.height(wrapperHeight)
11799		        if(shouldBeStuck) {
11800		        	this.$element.addClass('no-trans').css('top',$offsetHeight).css('transform','translateY(0)').addClass('stuck');
11801		        	var $that = this;
11802		        	setTimeout(function(){ $that.$element.removeClass('no-trans'); },50);
11803		        	this.$element.parents('.wpb_row').css('z-index',10000);
11804
11805		        	//boxed
11806		        	if($('#boxed').length > 0) { 
11807		        		var $negMargin = ($(window).width() > 1000) ? $('.container-wrap').width()*0.04 :39;
11808		        		this.$element.css({'margin-left':'-'+$negMargin+'px', 'width' : $('.container-wrap').width()});
11809		        	}
11810
11811		        }
11812		        else { 
11813		        	this.$element.css('top','0').removeClass('stuck');
11814
11815		       	    if($('#boxed').length > 0) this.$element.css({'margin-left':'0px', 'width' : '100%'});
11816		       	}
11817
11818		        if (originalHandler) {
11819		          originalHandler.call(this, direction)
11820		        }
11821		      }, this),
11822		      offset: $offsetHeight
11823		    }))
11824
11825		    var $that = this;
11826
11827			    setInterval(function(){ 
11828
11829			    	if($('body[data-hhun="1"] #header-outer.detached:not(.invisible)').length > 0)
11830		        		$that.waypoint.options.offset = $offsetHeight + $headerHeight;
11831		        	else 
11832		        		$that.waypoint.options.offset = $offsetHeight;
11833			    	Waypoint.refreshAll();
11834			
11835			    },100); 
11836			
11837
11838		  }
11839
11840		  /* Private */
11841		  Sticky.prototype.createWrapper = function() {
11842		    if (this.options.wrapper) {
11843		      this.$element.wrap(this.options.wrapper)
11844		    }
11845		    this.$wrapper = this.$element.parent()
11846		    this.wrapper = this.$wrapper[0]
11847		  }
11848
11849		  /* Public */
11850		  Sticky.prototype.destroy = function() {
11851		    if (this.$element.parent()[0] === this.wrapper) {
11852		      this.waypoint.destroy()
11853		      this.$element.removeClass(this.options.stuckClass)
11854		      if (this.options.wrapper) {
11855		        this.$element.unwrap()
11856		      }
11857		    }
11858		  }
11859
11860		  Sticky.defaults = {
11861		    wrapper: '<div class="sticky-wrapper" />',
11862		    stuckClass: 'stuck',
11863		    direction: 'down right'
11864		  }
11865
11866		  Waypoint.Sticky = Sticky
11867		}())
11868		;
11869
11870		//remove outside of column setups 
11871		if($('.page-submenu').parents('.span_12').find('> .wpb_column').length > 1){
11872			var pageMenu = $('.page-submenu').clone();
11873			var pageMenuParentRow = $('.page-submenu').parents('.wpb_row');
11874			$('.page-submenu').remove();
11875			pageMenuParentRow.before(pageMenu);
11876		}
11877
11878		var sticky = new Waypoint.Sticky({
11879		  element: $('.page-submenu[data-sticky="true"]')[0]
11880		});
11881
11882
11883	}
11884
11885	if($('#nectar_fullscreen_rows').length == 0)
11886		$('.page-submenu').parents('.wpb_row').css('z-index',10000);
11887
11888	$('.page-submenu .mobile-menu-link').on('click',function(){
11889		$(this).parents('.page-submenu').find('ul').stop(true).slideToggle(350);
11890		return false;
11891	});
11892
11893	$('.page-submenu ul li a').on('click',function(){
11894		if($('body.mobile').length > 0) $(this).parents('.page-submenu').find('ul').stop(true).slideToggle(350);
11895	});
11896
11897
11898	//responsive nav
11899	$('body').on('click','#toggle-nav',function(){
11900		if(window.innerWidth > 1000) {
11901			window.scrollTo(0,0);	
11902		}
11903
11904		$(this).find('.lines-button').toggleClass('close');
11905		
11906		
11907		if( $('body').hasClass('classic_mobile_menu_open') ) {
11908			
11909			$('#mobile-menu').hide();
11910			$('body').removeClass('classic_mobile_menu_open');
11911			
11912		} else {
11913			
11914			if($('#header-outer[data-transparent-header="true"][data-permanent-transparent="1"][data-mobile-fixed="false"].transparent').length > 0) {
11915				$('#mobile-menu').css({
11916					'top': parseInt($('#header-outer').outerHeight() + nectarDOMInfo.adminBarHeight) + 'px' ,
11917					'position': 'absolute',
11918					'width': '100%',
11919					'left': '0' 
11920				});
11921			}
11922			
11923			$('#mobile-menu').show();
11924			$('body').addClass('classic_mobile_menu_open');
11925			
11926		}
11927		
11928		
11929		return false;
11930	});
11931	
11932	
11933	//add wpml to mobile menu
11934	if($('header#top nav > ul > li.menu-item-language').length > 0 && $('#header-secondary-outer ul > li.menu-item-language').length == 0){
11935		var $langSelector = $('header#top nav > ul > li.menu-item-language').clone();
11936		$langSelector.insertBefore('#mobile-menu ul #mobile-search');
11937	}
11938	
11939	////append dropdown indicators / give classes
11940	$('#mobile-menu .container ul li').each(function(){
11941		if($(this).find('> ul').length > 0) {
11942			 $(this).addClass('has-ul');
11943			 $(this).find('> a').append('<span class="sf-sub-indicator"><i class="icon-angle-down"></i></span>');
11944		}
11945	});
11946	
11947	////events
11948	$('#mobile-menu .container ul li:has(">ul") > a .sf-sub-indicator').on('click',function(e){
11949		$(this).parent().parent().toggleClass('open');
11950		$(this).parent().parent().find('> ul').stop(true,true).slideToggle();
11951		return false;
11952	});
11953	
11954
11955
11956/*-------------------------------------------------------------------------*/
11957/*	5.	Page Specific
11958/*-------------------------------------------------------------------------*/	
11959	
11960	function vcFullHeightRow() {
11961        var $element = $(".vc_row-o-full-height:first");
11962        if ($element.length) {
11963            var $window, windowHeight, offsetTop, fullHeight;
11964            $window = $(window), 
11965            windowHeight = $window.height();
11966
11967            $(".vc_row-o-full-height").each(function(){
11968            	offsetTop = $(this).offset().top;
11969
11970            	var $realRowIndex = ($(this).parent().hasClass('vc_ie-flexbox-fixer')) ? $(this).parent().index() : $(this).index();
11971
11972            	if(offsetTop < windowHeight && $(this).hasClass('top-level') && !nectarDOMInfo.usingFrontEndEditor) {
11973            		fullHeight = 100 - offsetTop / (windowHeight / 100);
11974          	    	$(this).css("min-height", fullHeight + "vh");
11975          	    	$(this).find('> .col.span_12').css("min-height", fullHeight + "vh");
11976            	} else {
11977            		$(this).css("min-height", windowHeight);
11978            		$(this).find('> .col.span_12').css("min-height", windowHeight);
11979            	}
11980          	   
11981            });
11982
11983            
11984        }
11985
11986    }
11987    function fixIeFlexbox() {
11988        var ua = window.navigator.userAgent,
11989            msie = ua.indexOf("MSIE ");
11990        (msie > 0 || navigator.userAgent.match(/Trident.*rv\:11\./)) && $(".vc_row-o-full-height").each(function() {
11991            "flex" === $(this).find('> .span_12').css("display") && $(this).wrap('<div class="vc_ie-flexbox-fixer"></div>')
11992        })
11993    }
11994    fixIeFlexbox();
11995
11996    vcFullHeightRow();
11997		
11998		if(!nectarDOMInfo.usingFrontEndEditor) {
11999			nectarLiquidBGs();
12000		}
12001
12002	//recent work
12003	function piVertCenter() {
12004		$('.portfolio-items  > .col').each(function(){
12005				
12006			//style 4
12007			$(this).find('.style-4 .work-info .bottom-meta:not(.shown)').stop().animate({
12008				'bottom' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px'
12009			},420,'easeOutCubic');
12010
12011			
12012		});	 
12013	}
12014	
12015	
12016	//ie8 width fix
12017	function ie8Width(){
12018		if( $(window).width() >= 1300 ) {
12019			$('.container').css('max-width','1100px');
12020		} else {
12021			$('.container').css('max-width','880px');
12022		}
12023	}
12024	
12025	if( $(window).width() >= 1300 && $('html').hasClass('no-video')) { $('.container').css('max-width','1100px'); $(window).resize(ie8Width); };
12026	
12027
12028
12029	function smartResizeInit() {
12030		
12031		 //carousel height calcs
12032		 carouselHeightCalcs();
12033		 clientsCarouselHeightRecalc();
12034
12035		 //portfolio comment order
12036		 portfolioCommentOrder();
12037		 
12038		 //testimonial slider height
12039		 testimonialHeightResize(); //animated
12040		 testimonialSliderHeight(); //non-animated
12041		 
12042		 //full width content columns sizing
12043		 fullWidthContentColumns();
12044		 
12045		 //parallax BG Calculations
12046		 parallaxRowsBGCals();
12047		 
12048		
12049		 vcFullHeightRow();
12050		 headerSpace();
12051
12052		 centeredLogoMargins();
12053
12054		 slideOutWidgetOverflowState();
12055		 recentPostHeight();
12056
12057		 morphingOutlines();
12058
12059		 flipBoxHeights();
12060
12061		 showOnLeftSubMenu();
12062
12063		 //minimal alt effect
12064		if($('.tabbed[data-style="minimal_alt"]').length > 0) {
12065			 magicLineCalc($('.tabbed[data-style="minimal_alt"] > ul > li > a.active-tab'));
12066		}
12067		
12068	}
12069
12070  $(window).off('smartresize.srInit'); 
12071	$(window).on('smartresize.srInit', smartResizeInit); 
12072	
12073	
12074	var $usingNectarCarouselFlk = ($('.nectar-carousel.nectar-flickity:not(.masonry)').length > 0) ? true : false;
12075	
12076	function resizeInit() {
12077		 portfolioDeviceCheck();
12078
12079		 //fullwidth page section calcs
12080		 fullWidthSections(); 
12081		 fullwidthImgOnlySizing();
12082		 fullWidthContentColumns();
12083		 if(nectarDOMInfo.usingMobileBrowser) {
12084		  fullWidthRowPaddingAdjustCalc();
12085		}
12086		 
12087		 //iframe video emebeds
12088		 responsiveVideoIframes();
12089		 
12090		 //parallax BG Calculations
12091		 if(!nectarDOMInfo.usingMobileBrowser){
12092		   parallaxRowsBGCals();
12093		 }
12094		 
12095		 testimonialSliderHeightMinimalMult();
12096		 if($usingNectarCarouselFlk) {
12097			 setNectarCarouselFlkEH();
12098		 }
12099		 
12100		 if($('.nectar-social.full-width').length > 0) {
12101		 	nectarLoveFWCenter();
12102		 }
12103
12104		 if($('body').hasClass('ascend') ){ 
12105			searchFieldCenter();
12106		 }
12107
12108		 if($('body').hasClass('single-post')) { centerPostNextButtonImg(); }
12109
12110		 cascadingImageBGSizing();
12111
12112		 responsiveTooltips();
12113
12114		 //vc mobile columns
12115		 if($('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) { vcMobileColumns(); }
12116
12117		 if($('body[data-footer-reveal="1"]').length > 0 || $('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length > 0) { footerRevealCalcs(); }
12118
12119		 if($('#page-header-bg').length > 0) { pageHeader(); }
12120
12121		 if($('.nectar-video-bg').length > 0) {
12122		 	resizeVideoToCover();
12123		 }
12124	}
12125
12126	$(window).off('resize.srInit'); 
12127	$(window).on('resize.srInit', resizeInit); 
12128	
12129	
12130	$(window).load(function(){
12131		
12132		if($(window).scrollTop() == 0 ) { headerSpace(); }
12133		setTimeout(portfolioSidebarFollow,200);
12134		
12135		$('video').css('visibility','visible');
12136		
12137		if($('body[data-animated-anchors="true"]').length > 0) { 
12138				if($('.nectar-box-roll').length == 0 && $('#nectar_fullscreen_rows').length == 0) { 
12139					
12140					//inside tabs
12141					if( typeof $_GET['tab'] != 'undefined' ) {
12142							setTimeout(function(){
12143								pageLoadHash(); 
12144							},500);
12145					} 
12146					//regular
12147					else {
12148						pageLoadHash(); 
12149					}
12150					
12151				}
12152				
12153				if($('#nectar_fullscreen_rows[data-mobile-disable="on"]').length > 0 && $('.nectar-box-roll').length == 0 && nectarDOMInfo.usingMobileBrowser) {
12154					pageLoadHash();
12155				}
12156		}
12157		
12158		parallaxRowsBGCals();
12159		portfolioCommentOrder();
12160		fullWidthContentColumns();
12161		resizeVideoToCover();
12162
12163	});
12164
12165
12166	$(window).on("orientationchange",function(){
12167	  setTimeout(clientsCarouselHeightRecalc,200);
12168	});
12169	
12170	//blog next post button
12171	function postNextButtonEffect(){
12172
12173		$('.blog_next_prev_buttons').imagesLoaded(function(){
12174
12175			centerPostNextButtonImg();
12176			
12177			$('.blog_next_prev_buttons img').css('opacity','1');
12178
12179		});
12180	}
12181
12182	function centerPostNextButtonImg(){
12183		
12184		if($('.blog_next_prev_buttons').length == 0) return false;
12185
12186		if( $('.blog_next_prev_buttons img').height() >= $('.blog_next_prev_buttons').height() + 50 ) {
12187			var $height = 'auto';
12188			var $width = $('.blog_next_prev_buttons').width();
12189		} else {
12190
12191			if( $('.blog_next_prev_buttons').width() < $('.blog_next_prev_buttons img').width()) {
12192				var $height = $('.blog_next_prev_buttons').height() + 49;
12193				var $width = 'auto';
12194			} else {
12195				var $height = 'auto';
12196				var $width = '100%';
12197			}
12198			
12199		}
12200
12201		$('.blog_next_prev_buttons img').css({ 'height' : $height, 'width': $width });
12202
12203		$('.blog_next_prev_buttons img').css({
12204			'top' : ($('.blog_next_prev_buttons').height()/2) - ($('.blog_next_prev_buttons img').height()/2) + 'px',
12205			'left' : ($('.blog_next_prev_buttons').width()/2) - ($('.blog_next_prev_buttons img').width()/2) + 'px'
12206		});
12207
12208		$('.blog_next_prev_buttons .inner').each(function(){
12209			$(this).css({'top': $(this).parent().height()/2 - ($(this).height()/2), 'opacity':'1' });
12210		})
12211	}
12212	
12213	postNextButtonEffect();
12214
12215
12216	function recentPostHeight() {
12217		$('.blog-recent[data-style="title_only"]').each(function(){
12218			if($(this).find('> .col').length > 1) return false;
12219			if($(this).parent().parent().parent().hasClass('vc_col-sm-3') || 
12220				$(this).parent().parent().parent().hasClass('vc_col-sm-4') || 
12221				$(this).parent().parent().parent().hasClass('vc_col-sm-6') || 
12222				$(this).parent().parent().parent().hasClass('vc_col-sm-8') || 
12223				$(this).parent().parent().parent().hasClass('vc_col-sm-9')) {
12224				
12225				if($('body.mobile').length == 0 && $(this).next('div').length == 0) {
12226					var tallestColumn = 0;
12227					
12228					$(this).find('> .col').css('padding', '50px 20px');
12229
12230					$(this).parents('.span_12').find(' > .wpb_column').each(function(){
12231						(Math.floor($(this).height()) > tallestColumn) ? tallestColumn = Math.floor($(this).height()) : tallestColumn = tallestColumn;
12232					});	
12233			
12234					if(Math.floor($(this).find('> .col').outerHeight(true)) < Math.floor($(this).parents('.wpb_row').height()) - 1) {
12235						$(this).find('> .col').css('padding-top',(tallestColumn-$(this).find('> .col').height())/2 + 'px');
12236						$(this).find('> .col').css('padding-bottom',(tallestColumn-$(this).find('> .col').height())/2 + 'px');
12237					}
12238					
12239				}
12240				 else {
12241				 		$(this).find('> .col').css('padding', '50px 20px');
12242				}
12243			}
12244		});
12245	}
12246	recentPostHeight();
12247
12248
12249	//recent post slider
12250	function recentPostsFlickityInit() {
12251
12252		//classic enhanced specific 
12253    $('.blog-recent[data-style="classic_enhanced_alt"] .inner-wrap').each(function(){
12254        	$(this).find('.post-featured-img').each(function(){
12255				var $src = $(this).find('img').attr('src');
12256				$(this).css('background-image','url('+$src+')');
12257			});
12258        });
12259		$('.blog-recent[data-style="classic_enhanced"]').each(function(){
12260			if($(this).find('.inner-wrap.has-post-thumbnail').length == 0) {
12261				$(this).addClass('no-thumbs');
12262			}
12263		});
12264
12265		if($('.nectar-recent-posts-slider-inner').length > 0) {
12266		
12267			var $rpFGroupCells = ($('.nectar-recent-posts-slider_multiple_visible').length > 0) ? '90%' : false;
12268			
12269			var $rpF = $('.nectar-recent-posts-slider-inner').flickity({
12270				  contain: true,
12271					groupCells: $rpFGroupCells,
12272				  draggable: true,
12273				  lazyLoad: false,
12274				  imagesLoaded: true,
12275				  percentPosition: true,
12276				  prevNextButtons: false,
12277				  pageDots: true,
12278				  resize: true,
12279				  setGallerySize: true,
12280				  wrapAround: true,
12281				  accessibility: false
12282			});
12283			
12284			setTimeout(function(){
12285				$('.nectar-recent-posts-slider-inner').addClass('loaded');
12286			},1150);
12287			var flkty = $rpF.data('flickity');
12288			
12289			$rpF.on( 'dragStart.flickity', function() {
12290				$('.flickity-viewport').addClass('is-moving');
12291			});
12292			
12293			$rpF.on( 'dragEnd.flickity', function() {
12294				$('.flickity-viewport').removeClass('is-moving');
12295			});
12296			
12297			var $dragTimeout;
12298			
12299			$rpF.on( 'select.flickity', function() {
12300
12301				  $('.flickity-viewport').addClass('no-hover');
12302				  clearTimeout( $dragTimeout);
12303				   $dragTimeout = setTimeout(function(){ $('.flickity-viewport').removeClass('no-hover'); },400);
12304			 
12305			});
12306			
12307			
12308	  
12309			recentPostSliderHeight();
12310			$(window).resize(recentPostSliderHeight);
12311
12312			if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/) && ! nectarDOMInfo.usingFrontEndEditor) {
12313				$(window).resize(recentPostSliderParallaxMargins);
12314			}
12315
12316			function recentPostSliderHeight(){
12317
12318				$('.nectar-recent-posts-slider').each(function(){
12319						
12320							var $heightCalc;
12321							var $minHeight = 250;
12322							var $windowWidth = $(window).width();
12323							var $definedHeight = parseInt($(this).attr('data-height'));
12324
12325							var dif = ($('body[data-ext-responsive="true"]').length > 0) ? $(window).width() / 1400 : $(window).width() / 1100;
12326
12327							if( window.innerWidth > 1000 && $('#boxed').length == 0) {
12328
12329								if($(this).parents('.full-width-content').length == 0) {
12330									if($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1400){
12331										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight));
12332									} else if($('body[data-ext-responsive="true"]').length == 0 && window.innerWidth >= 1100) {
12333										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.
12333ceil($definedHeight));
12334									} else {
12335										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
12336									}
12337									
12338								} else {
12339									$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
12340								}
12341								
12342							} else {
12343								
12344								//column sliders
12345								var $parentCol = ($(this).parents('.wpb_column').length > 0) ? $(this).parents('.wpb_column') : $(this).parents('.col') ;
12346								if($parentCol.length == 0) $parentCol = $('.main-content');
12347									
12348								if(!$parentCol.hasClass('vc_span12') && !$parentCol.hasClass('main-content') && !$parentCol.hasClass('span_12') && !$parentCol.hasClass('vc_col-sm-12') ) {
12349								
12350									var $parentColWidth = sliderColumnDesktopWidth($parentCol);
12351									var $aspectRatio = $definedHeight/$parentColWidth;
12352
12353									
12354									//min height
12355									if( $aspectRatio*$parentCol.width() <= $minHeight ){
12356										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$minHeight);
12357									} else {
12358										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$aspectRatio*$parentCol.width());
12359									}
12360								  
12361								} 
12362								
12363								//regular
12364								else {
12365									
12366									//min height
12367									if( $definedHeight*dif <= $minHeight ){
12368										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$minHeight);
12369									} else {
12370										$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
12371									}
12372									
12373								}
12374								
12375							}
12376							
12377		
12378						
12379					});
12380			
12381			}
12382
12383			////helper function
12384			function sliderColumnDesktopWidth(parentCol) {
12385				
12386				var $parentColWidth = 1100;
12387				var $columnNumberParsed = $(parentCol).attr('class').match(/\d+/);
12388				
12389				if($columnNumberParsed == '2') { $parentColWidth = 170 }
12390				else if($columnNumberParsed == '3') { $parentColWidth = 260 } 
12391				else if($columnNumberParsed == '4') { $parentColWidth = 340 } 
12392				else if($columnNumberParsed == '6') { $parentColWidth = 530 } 
12393				else if($columnNumberParsed == '8') { $parentColWidth = 700 } 
12394				else if($columnNumberParsed == '9') { $parentColWidth = 805 }
12395				else if($columnNumberParsed == '10') { $parentColWidth = 916.3 }
12396				else if($columnNumberParsed == '12') { $parentColWidth = 1100 }
12397			
12398				return $parentColWidth;
12399			}
12400		
12401		}//if using rp slider
12402		
12403		
12404		//multiple featured controls
12405		
12406		function multipleLargeFeaturedInit() {
12407			 $('.nectar-recent-posts-single_featured.multiple_featured').each(function(sliderIndex){
12408					 if($(this).find('> .normal-container').length > 0) {
12409					 	$(this).find('> .normal-container').remove();
12410					}
12411				 	$(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>');
12412					var $that = $(this);
12413					
12414					//store instance
12415					$nectarCustomSliderRotate[sliderIndex] = { autorotate: '' };
12416					
12417					var tallestFeaturedSlide = 0;
12418					$(this).find('.nectar-recent-post-slide').each(function(i){
12419						
12420						if($(this).find('.recent-post-container').height() > tallestFeaturedSlide) {
12421							$(this).siblings().removeClass('tallest');
12422							$(this).addClass('tallest');
12423							tallestFeaturedSlide = $(this).find('.recent-post-container').height();
12424						} 
12425						
12426						var $activeClass = (i == 0 && $(this).parents('.nectar-recent-posts-single_featured.multiple_featured[data-autorotate="none"]').length > 0) ? 'class="active"': '';
12427						 $that.find('.controls').append('<li '+$activeClass+'><span class="title">'+ $(this).find('h2').text() +'</span></li>');
12428					});
12429					
12430					$(this).addClass('js-loaded');
12431					
12432					var $slideClickTimeout;
12433					
12434					//click Functionality
12435					$(this).find('.controls li').on('click',function(e){
12436						
12437							if($(this).hasClass('active')) 
12438								return;
12439								
12440							if(e.originalEvent !== undefined)
12441								$(this).parent().find('.active').addClass('trans-out');
12442							
12443							var $index = $(this).index();
12444							var $oldIndex = $(this).parent().find('.active').index();
12445							var $that = $(this);
12446							
12447							clearTimeout($slideClickTimeout);
12448							
12449							$(this).siblings().removeClass('active');
12450							$(this).addClass('active');
12451							$slideClickTimeout = setTimeout( function() { 
12452								$that.parents('.multiple_featured').find('.nectar-recent-post-slide:not(:eq('+$index+'))').css('opacity','0').removeClass('active');
12453								$that.parent().find('.trans-out').removeClass('trans-out');
12454							}, 300);
12455							$that.parents('.multiple_featured').find('.nectar-recent-post-slide:not(:eq('+$index+'))').css('z-index','10');
12456							$that.parents('.multiple_featured').find('.nectar-recent-post-slide:eq('+$oldIndex+')').css('z-index','15');
12457							
12458							$(this).parents('.multiple_featured').find('.nectar-recent-post-slide').eq($index).css({'opacity':'1', 'z-index':'20'}).addClass('active');
12459							
12460							if($(this).parents('.multiple_featured').attr('data-autorotate') != 'none') {
12461								nectarCustomSliderResetRotate($that.parents('.nectar-recent-posts-single_featured.multiple_featured'),sliderIndex);
12462							}
12463					});
12464					
12465					
12466				//autorotate
12467				var $that = $(this);
12468				 if($(this).attr('data-autorotate').length > 0 && $(this).attr('data-autorotate') != 'none' && $('body.vc_editor').length == 0 ) {
12469					 
12470					 setTimeout(function(){
12471							 var slide_interval = (parseInt($that.attr('data-autorotate')) < 100) ? 4000 : parseInt($that.attr('data-autorotate'));
12472							 $nectarCustomSliderRotate[sliderIndex].autorotate = setInterval(function(){ nectarCustomSliderRotate($that) },slide_interval);
12473							 
12474							 //set first active class
12475							 $that.find('.controls > li:first-child').addClass('active');
12476
12477					 },30);
12478					 
12479				 }
12480				 
12481			 });
12482			 
12483			 splitLineText();
12484			 $(window).resize(splitLineText);
12485			 
12486
12487		}
12488		
12489		multipleLargeFeaturedInit();
12490	
12491	}
12492	
12493	recentPostsFlickityInit();
12494
12495	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) {
12496		if($('.nectar-recent-posts-slider').length > 0 && ! nectarDOMInfo.usingFrontEndEditor) {
12497			window.requestAnimationFrame(recentPostSliderParallax);
12498		}
12499	}
12500	
12501	function recentPostSliderParallax(){
12502
12503		$('.nectar-recent-posts-slider').each(function(){
12504			var $offset = parseInt($(this).find('.flickity-slider').position().left);
12505			var $slideLength = $(this).find('.nectar-recent-post-slide').length;
12506			var $lastChildIndex = $(this).find('.nectar-recent-post-slide:last-child').index();
12507			var $slideWidth = $(this).find('.nectar-recent-post-slide').width();
12508			//wrapped fix
12509
12510			////first going to first
12511			if($offset >= -3) {
12512				$(this).find('.nectar-recent-post-slide:last-child .nectar-recent-post-bg').css('margin-left',parseInt(Math.ceil($slideWidth/3.5))+'px');
12513			} else {
12514				$(this).find('.nectar-recent-post-slide:last-child .nectar-recent-post-bg').css('margin-left','-'+parseInt(Math.ceil($slideWidth/3.5*$lastChildIndex))+'px');
12515			}
12516			////last going to first
12517			if(Math.abs($offset) >= ($slideLength-1) * $slideWidth) {
12518				$(this).find('.nectar-recent-post-slide:first-child .nectar-recent-post-bg').css('margin-left','-'+parseInt(Math.ceil(($slideWidth/3.5)*$slideLength))+'px');
12519			} else {
12520				$(this).find('.nectar-recent-post-slide:first-child .nectar-recent-post-bg').css('margin-left','0px');
12521			}
12522
12523			$(this).find('.nectar-recent-post-bg').css('transform','translateX('+Math.ceil($(this).find('.flickity-slider').position().left/-3.5)+'px)');
12524			
12525			
12526		});
12527		requestAnimationFrame(recentPostSliderParallax);
12528	}
12529
12530	function recentPostSliderParallaxMargins(){
12531
12532		$('.nectar-recent-posts-slider').each(function(){		
12533			var $slideWidth = $(this).find('.nectar-recent-post-slide').width();
12534			$(this).find('.nectar-recent-post-slide').each(function(i){
12535				$(this).find('.nectar-recent-post-bg').css('margin-left','-'+  parseInt(Math.ceil($slideWidth/3.5)*i)+'px');
12536			});
12537		
12538		});
12539	}
12540
12541	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/) && ! nectarDOMInfo.usingFrontEndEditor) {
12542		recentPostSliderParallaxMargins();
12543	}
12544
12545	//portfolio item hover effect
12546	
12547	////desktop event 
12548	function portfolioHoverEffects() { 
12549
12550		if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(iPad|IEMobile)/)) {
12551			
12552			//style 1 & 2
12553			$('.portfolio-items:not([data-ps="7"]) .col .work-item:not(.style-3-alt):not(.style-3):not([data-custom-content="on"])').on('mouseenter',function(){
12554				$(this).find('.work-info .vert-center').css({'margin-top' : 0});
12555				$(this).find('.work-info, .work-info .vert-center > *, .work-info > i').css({'opacity' : 1});
12556				$(this).find('.work-info-bg').css({ 'opacity' : 0.9 });
12557			});
12558			$('.portfolio-items:not([data-ps="7"]) .col .work-item:not(.style-3-alt):not(.style-3):not([data-custom-content="on"])').on('mouseleave',function(){	
12559				$(this).find('.work-info .vert-center').css({ 'margin-top' : -20 });
12560				$(this).find('.work-info, .work-info .vert-center > *:not(.mfp-figure), .work-info > i').css({ 'opacity' : 0 });
12561				$(this).find('.work-info-bg').css({ 'opacity' : 0 });
12562			});
12563			
12564			
12565			//style 3
12566			$('.portfolio-items .col .work-item.style-3').on('mouseenter',function(){
12567				$(this).find('.work-info-bg').css({ 'opacity' : 0 });
12568			});
12569			$('.portfolio-items .col .work-item.style-3').on('mouseleave',function(){
12570				$(this).find('.work-info-bg').css({ 'opacity' : 0.45 });
12571			});
12572			
12573			
12574			//style 4
12575			$('.portfolio-items .col .work-item.style-4').on('mouseenter',function(){
12576				$(this).find('img').stop().animate({
12577					'top' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()/2+'px'
12578				},250,'easeOutCubic');
12579				
12580				$(this).find('.work-info .bottom-meta').addClass('shown').stop().animate({
12581					'bottom' : '0px'
12582				},320,'easeOutCubic');
12583
12584			});
12585			$('.portfolio-items .col .work-item.style-4').on('mouseleave',function(){
12586				$(this).find('img').stop().animate({
12587					'top' : '0px'
12588				},250,'easeOutCubic');
12589				
12590				$(this).find('.work-info .bottom-meta').removeClass('shown').stop().animate({
12591					'bottom' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px'
12592				},320,'easeOutCubic');
12593				
12594			});
12595		
12596		} 
12597		////mobile event
12598		else {
12599			portfolioDeviceCheck();
12600		}
12601
12602	}
12603
12604	portfolioHoverEffects();
12605
12606	function style6Img(){
12607  
12608		//change sizer pos
12609		$('.style-5').each(function(){
12610			$(this).find('.sizer').insertBefore($(this).find('.parallaxImg'));
12611		});
12612
12613		//set parent zindex
12614		$('.style-5').parents('.wpb_row').css('z-index','100');
12615
12616		var d = document,
12617			de = d.documentElement,
12618			bd = d.getElementsByTagName('body')[0],
12619			htm = d.getElementsByTagName('html')[0],
12620			win = window,
12621			imgs = d.querySelectorAll('.parallaxImg'),
12622			totalImgs = imgs.length,
12623			supportsTouch = 'ontouchstart' in win || navigator.msMaxTouchPoints;
12624
12625		if(totalImgs <= 0){
12626			return;
12627		}
12628
12629		// build HTML
12630		for(var l=0;l<totalImgs;l++){
12631
12632			var thisImg = imgs[l],
12633				layerElems = thisImg.querySelectorAll('.parallaxImg-layer'),
12634				totalLayerElems = layerElems.length;
12635
12636			if(totalLayerElems <= 0){
12637				continue;
12638			}
12639
12640			while(thisImg.firstChild) {
12641				thisImg.removeChild(thisImg.firstChild);
12642			}
12643			
12644			var lastMove = 0;
12645
12646			//throttle performance for all browser other than chrome
12647			var eventThrottle = $('html').hasClass('cssreflections') ? 1 : 80;
12648			if(eventThrottle == 80) $('body').addClass('cssreflections');
12649
12650			var containerHTML = d.createElement('div'),
12651				shineHTML = d.createElement('div'),
12652				shadowHTML = d.createElement('div'),
12653				layersHTML = d.createElement('div'),
12654				layers = [];
12655
12656			thisImg.id = 'parallaxImg__'+l;
12657			containerHTML.className = 'parallaxImg-container';
12658			//shineHTML.className = 'parallaxImg-shine';
12659			shadowHTML.className = 'parallaxImg-shadow';
12660			layersHTML.className = 'parallaxImg-layers';
12661
12662			for(var i=0;i<totalLayerElems;i++){
12663				var layer = d.createElement('div'),
12664					layerInner = d.createElement('div'),
12665					imgSrc = layerElems[i].getAttribute('data-img');
12666
12667				$(layer).html($(layerElems[i]).html());
12668				layer.className = 'parallaxImg-rendered-layer';
12669				layer.setAttribute('data-layer',i);
12670
12671				if(i==0 && $(thisImg).parents('.wpb_gallery').length == 0) { 
12672					layerInner.className = 'bg-img';
12673					layerInner.style.backgroundImage = 'url('+imgSrc+')';
12674					layer.appendChild(layerInner);
12675				}
12676				layersHTML.appendChild(layer);
12677
12678				layers.push(layer);
12679			}
12680
12681			containerHTML.appendChild(layersHTML);
12682			thisImg.appendChild(containerHTML);
12683			$(thisImg).wrap('<div class="parallaxImg-wrap" />');
12684			if(!(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1)) { $(thisImg).parent().append(shadowHTML); }
12685
12686			var w = thisImg.clientWidth || thisImg.offsetWidth || thisImg.scrollWidth;
12687
12688			if(supportsTouch && $('body.using-mobile-browser').length > 0 ){
12689				
12690		    } else {
12691		    	(function(_thisImg,_layers,_totalLayers,_shine) {
12692					$(thisImg).parents('.style-5').on('mousemove', function(e){
12693						
12694						var parentEl = $(this);
12695					 	var now = Date.now();
12696				        if (now > lastMove + eventThrottle) {
12697				            lastMove = now;
12698							window.requestAnimationFrame(function(){
12699								processMovement(e,false,_thisImg,_layers,_totalLayers,_shine,parentEl);		
12700							});
12701						}
12702
12703
12704					});
12705		            $(thisImg).parents('.style-5').on('mouseenter', function(e){
12706						processEnter(e,_thisImg,_layers,_totalLayers,_shine);		
12707					});
12708					$(thisImg).parents('.style-5').on('mouseleave', function(e){
12709						processExit(e,_thisImg,_layers,_totalLayers,_shine);		
12710					});
12711		        })(thisImg,layers,totalLayerElems,shineHTML);
12712		    }
12713
12714		    //set the depths
12715		    (function(_thisImg,_layers,_totalLayers,_shine) {
12716			    depths(false,_thisImg,_layers,_totalLayers,_shine);
12717			     window.addEventListener('resize', function(e){
12718			    	  depths(false,_thisImg,_layers,_totalLayers,_shine);
12719			    });
12720			 })(thisImg,layers,totalLayerElems,shineHTML);
12721		}
12722
12723		function processMovement(e, touchEnabled, elem, layers, totalLayers, shine, parentEl){
12724			
12725			//stop raf if exit already called
12726			if(!$(elem.firstChild).hasClass('over')) { processExit(e,elem,layers,totalLayers,shine); return false }
12727
12728			//set up multipliers
12729
12730			if($(elem).parents('.col.wide').length > 0 ) {
12731				var yMult = 0.03;
12732				var xMult = 0.063;
12733			} else if( $(elem).parents('.col.regular').length > 0  || $(elem).parents('.wpb_gallery').length > 0) {
12734				var yMult = 0.045;
12735				var xMult = 0.045;
12736			} else if($(elem).parents('.col.tall').length > 0 ) {
12737				var yMult = 0.05;
12738				var xMult = 0.015;
12739			} else if($(elem).parents('.col.wide_tall').length > 0) {
12740				var yMult = 0.04;
12741				var xMult = 0.04;
12742			} else if(parentEl.hasClass('nectar-fancy-box')) {
12743				var yMult = 0.045;
12744				var xMult = 0.022;
12745			} else {
12746				var yMult = 0.045;
12747				var xMult = 0.075;
12748			}
12749			
12750			var bdst = $(window).scrollTop(),
12751				bdsl = bd.scrollLeft,
12752				pageX = (touchEnabled)? e.touches[0].pageX : e.pageX,
12753				pageY = (touchEnabled)? e.touches[0].pageY : e.pageY,
12754				offsets = elem.getBoundingClientRect(),
12755				w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth, // width
12756				h = elem.clientHeight || elem.offsetHeight || elem.scrollHeight, // height
12757				wMultiple = 320/w,
12758				offsetX = 0.52 - (pageX - offsets.left - bdsl)/w, //cursor position X
12759				offsetY = 0.52 - (pageY - offsets.top - bdst)/h, //cursor position Y
12760				dy = (pageY - offsets.top - bdst) - h / 2, //@h/2 = center of container
12761				dx = (pageX - offsets.left - bdsl) - w / 2, //@w/2 = center of container
12762				yRotate = (offsetX - dx)*(yMult * wMultiple), //rotation for container Y
12763				xRotate = (dy - offsetY)*(xMult * wMultiple); //rotation for container X //old
12764
12765				if($(elem).parents('.wpb_gallery').length > 0) {
12766					var imgCSS = ' perspective('+ w*3 +'px) rotateX(' + -xRotate*1.9 + 'deg) rotateY(' + -yRotate*1.3 + 'deg)'; //img transform	
12767				} else {
12768					if($(elem).parents('.wide_tall').length == 0 && $(elem).parents('.wide').length == 0 && $(elem).parents('.tall').length == 0) {
12769						var $scaleAmount = (parentEl.hasClass('nectar-fancy-box')) ? '1.06' : '1.03';
12770						var $offsetAmount = (parentEl.hasClass('nectar-fancy-box')) ? '-2' : '-10';
12771						
12772						var imgCSS = ' perspective('+ w*3 +'px) rotateX(' + xRotate 
12772+ 'deg) rotateY(' + yRotate + 'deg)  translateY('+offsetY*$offsetAmount+'px) translateX('+offsetX*$offsetAmount+'px) scale('+$scaleAmount+')'; //img transform
12773					} else {
12774						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	
12775					}
12776				}
12777
12778				
12779			//container transform
12780
12781
12782			$(elem).find('.parallaxImg-container').css('transform',imgCSS);
12783
12784			if(!(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1)) {
12785				$(elem).parents('.parallaxImg-wrap').find('.parallaxImg-shadow').css('transform',imgCSS);
12786			}
12787
12788			
12789		}
12790
12791		function processShineMovement(e, touchEnabled, elem, layers, totalLayers, shine){
12792
12793		}
12794
12795		function processEnter(e, elem, layers, totalLayers, shine){
12796
12797			elem.firstChild.className += ' over';
12798			elem.className += ' over';
12799
12800
12801				$(elem).addClass('transition');
12802
12803				if($(elem).parents('.wpb_gallery').length > 0) {
12804					var $timeout = setTimeout(function(){ $(elem).removeClass('transition'); },450);
12805				} else {
12806					var $timeout = setTimeout(function(){ $(elem).removeClass('transition'); },200);
12807				}
12808
12809		}
12810
12811		function processExit(e, elem, layers, totalLayers, shine){
12812
12813			var w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth;
12814			var container = elem.firstChild;
12815
12816			container.className = container.className.replace(' over','');
12817			elem.className = elem.className.replace(' over','');
12818			$(container).css('transform', 'perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0)');
12819			$(elem).parents('.parallaxImg-wrap').find('.parallaxImg-shadow').css('transform','perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0)');
12820
12821			$(elem).addClass('transition');
12822				var $timeout = setTimeout(function(){ $(elem).removeClass('transition'); },200);
12823
12824
12825		}
12826
12827		function depths(touchEnabled, elem, layers, totalLayers, shine) {
12828			
12829			var w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth;
12830			var revNum = totalLayers;
12831			var container = elem.firstChild;
12832			
12833			//set z
12834			for(var ly=0;ly<totalLayers;ly++){
12835				if(ly == 0) $(layers[ly]).css('transform', 'translateZ(0px)');
12836				else $(layers[ly]).css('transform','translateZ(' +(w*3)/27*(ly*1.1) + 'px) ');
12837
12838				revNum--;
12839			}
12840			
12841			totalLayers = totalLayers + 3;
12842
12843			//set perspective from beginning
12844			$(container).css('transform','perspective('+ w*3 +'px)');
12845
12846		}
12847
12848		function removeDepths(touchEnabled, elem, layers, totalLayers, shine) {
12849			
12850			var w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth;
12851			var revNum = totalLayers;
12852			
12853			//set z
12854			for(var ly=0;ly<totalLayers;ly++){
12855				
12856				if(ly == 0) $(layers[ly]).css('transform', 'translateZ(' +(w*3)/45*(ly*1.1) + 'px) scale(1)');
12857				else $(layers[ly]).css('transform', 'translateZ(' +(w*3)/45*(ly*1.1) + 'px) scale(1)');
12858
12859				revNum--;
12860			}
12861			
12862			totalLayers = totalLayers + 3;
12863			
12864		}
12865	}
12866
12867	style6Img();
12868
12869	function portfolioDeviceCheck(){
12870		if($('body').hasClass('mobile') || navigator.userAgent.match(/(iPad|IEMobile)/) ){
12871			
12872			//if using more details
12873			if($('.portfolio-items .col .work-item').find('a:not(".pp")').length > 0){
12874				$('.portfolio-items .col .work-item').find('a.pp').css('display','none');
12875			} 
12876			
12877			//if only using pp
12878			else {
12879				$('.portfolio-items .col .work-item').find('a:not(".pp")').css('display','none');
12880			}
12881		
12882		} else {
12883			$('.portfolio-items .col .work-item').find('a').css('display','inline');
12884		}
12885	}
12886	
12887	
12888	//portfolio fullscreen zoom slider
12889
12890	//remove outside of column setups 
12891	$('.nectar_fullscreen_zoom_recent_projects').each(function(){
12892		if($(this).parents('.span_12').find('> .wpb_column').length > 1){
12893			var $zoomProjects = $(this).clone();
12894			var $zoomProjectsRow = $(this).parents('.span_12');
12895			$(this).remove();
12896			$zoomProjectsRow.prepend($zoomProjects);
12897		}
12898	});
12899
12900	 $.fn.lines = function (opts) {
12901        var s = $.extend({
12902            'lineClass' : 'line'
12903        },opts);
12904        return this.each(function () {
12905            var self = this,
12906                $self = $(self),
12907                $line,
12908                $prev;
12909            $self.find('.' + s.lineClass).contents().unwrap();
12910            $self.html(function (i, h) {
12911                return h.replace(/(\b[\w']+\b)/g, '<span class="' + s.lineClass + '">$1</span>');
12912            });
12913
12914            $self.find('.line + .line').each(function(i, el){
12915                $line = $(this),
12916                $prev = $line.prev('.line');
12917                if ($line.offset().top === $prev.offset().top) {
12918                    $prev.append(el.previousSibling, $line.contents());
12919                    $line.remove();
12920                }
12921            });
12922        });
12923    };
12924
12925	function splitLineText() {
12926		$('.nectar_fullscreen_zoom_recent_projects, .nectar-recent-posts-single_featured.multiple_featured').each(function(){
12927			
12928			var $slideClass = ($(this).find('.project-slides').length > 0) ? '.project-slide' : '.nectar-recent-post-slide';
12929			var $slideInfoClass = ($(this).find('.project-slides').length > 0) ? '.project-info h1' : '.inner-wrap h2 a';
12930			
12931			$(this).find($slideClass).each(function(i){
12932				
12933				$(this).find($slideInfoClass).each(function(){
12934					
12935					var textArr = $(this).text();
12936		      textArr = textArr.trim();
12937		      textArr = textArr.split(' ');
12938		
12939		      $(this)[0].innerHTML = '';
12940		      
12941		      for(var i=0;i<textArr.length;i++) {
12942		          $(this)[0].innerHTML += '<span>'+ textArr[i] + '</span> ';
12943		      }
12944					
12945				});
12946
12947				$(this).find($slideInfoClass + ' > span').wrapInner('<span class="inner" />');
12948
12949			});
12950			
12951		});
12952		
12953	}
12954
12955	function portfolioFullScreenSliderCalcs() {
12956
12957		var $bodyBorderSize = ($('.body-border-top').length > 0 && $(window).width() > 1000) ? $('.body-border-top').height(): 0;
12958
12959		$('.nectar_fullscreen_zoom_recent_projects').each(function(){
12960			
12961			//frontend editor fix
12962			if(nectarDOMInfo.usingFrontEndEditor) {
12963				if($(this).parents('.wpb_row').parent().index() > 1) { $(this).parents('.first-section').removeClass('first-section'); }
12964			}
12965			
12966			if($(this).parents('.first-section').length > 0) {
12967				$(this).css('height',$(window).height() - $(this).offset().top - $bodyBorderSize);
12968			} else {
12969				$(this).css('height',$(window).height());
12970			}
12971		});
12972
12973	}
12974
12975				
12976	function nectarCustomSliderRotate(slider){
12977		
12978		if($('body.vc_editor').length > 0) { return; }
12979		
12980		var $controlSelector = (slider.find('.project-slides').length > 0) ? '.dot-nav > span' : '.controls > li';
12981		var $controlSelectorInd = (slider.find('.project-slides').length > 0) ? 'span' : ' li';
12982		
12983		var $slideLength = slider.find($controlSelector).length;
12984		var $currentSlide = slider.find($controlSelector+'.active').index();
12985		if( $currentSlide+1 == $slideLength) {
12986			slider.find($controlSelector+':first-child').click();
12987		} else {
12988			slider.find($controlSelector+'.active').next($controlSelectorInd).click();
12989		}
12990	}
12991	
12992	function nectarCustomSliderResetRotate(slider,index){
12993		clearInterval($nectarCustomSliderRotate[index].autorotate);
12994
12995		//reinit autorotate
12996		if(slider.attr('data-autorotate').length > 0) {
12997			var slide_interval = (parseInt(slider.attr('data-autorotate')) < 100) ? 4000 : parseInt(slider.attr('data-autorotate'));
12998			$nectarCustomSliderRotate[index].autorotate = setInterval(function(){ nectarCustomSliderRotate(slider) },slide_interval);
12999		}
13000	}
13001
13002
13003	if($('.nectar_fullscreen_zoom_recent_projects').length > 0){
13004		portfolioFullScreenSliderCalcs();
13005		splitLineText();
13006		$(window).resize(splitLineText);
13007		$(window).resize(portfolioFullScreenSliderCalcs);
13008	}
13009	
13010	
13011	function fsProjectSliderInit() {
13012		
13013		$('.nectar_fullscreen_zoom_recent_projects').each(function(recentProjectSliderIndex){
13014
13015			
13016			//store instance
13017			$nectarCustomSliderRotate[recentProjectSliderIndex] = { autorotate: '' };
13018			
13019			var $projLength = $(this).find('.project-slide').length;
13020			
13021			//autorotate
13022			if($(this).attr('data-autorotate').length > 0) {
13023				var slide_interval = (parseInt($(this).attr('data-autorotate')) < 100) ? 4000 : parseInt($(this).attr('data-autorotate'));
13024				var $that = $(this);
13025				$nectarCustomSliderRotate[recentProjectSliderIndex].autorotate = setInterval(function(){ nectarCustomSliderRotate($that) },slide_interval);
13026			}
13027
13028			//next/prev
13029			$(this).find('.zoom-slider-controls .next').on('click',function(e){
13030
13031				//thres
13032				
13033				var $that = $(this);
13034				if(!$that.parent().hasClass('timeout')) {
13035					setTimeout(function(){
13036						$that.parent().removeClass('timeout');
13037					},1150);
13038				}
13039
13040				if($(this).parent().hasClass('timeout')) return false;
13041				$(this).parent().addClass('timeout');
13042				//switch logic
13043
13044				nectarCustomSliderResetRotate($that.parents('.nectar_fullscreen_zoom_recent_projects'), recentProjectSliderIndex);
13045				
13046				var $current = $(this).parents('.nectar_fullscreen_zoom_recent_projects').find('.project-slide.current');
13047				var $sliderInstance = $(this).parents('.nectar_fullscreen_zoom_recent_projects');
13048
13049				$sliderInstance.find('.project-slide').removeClass('next').removeClass('prev');
13050				$sliderInstance.find('.project-slide').each(function(i){
13051
13052					if(i < $current.index()+1 && $current.index()+1 < $projLength)
13053						$(this).addClass('prev');
13054					else
13055						$(this).addClass('next');
13056				});
13057
13058				if($current.index()+1 == $projLength) {
13059					$sliderInstance.find('.project-slide:first-child').addClass('no-trans');
13060				}
13061
13062				setTimeout(function(){
13063
13064					if($current.index()+1 == $projLength) {
13065						$sliderInstance.find('.project-slide:first-child').removeClass('no-trans').removeClass('next').removeClass('prev').addClass('current');
13066						$sliderInstance.find('.project-slide:last-child').removeClass('next').removeClass('current').addClass('prev');
13067					} else {
13068						$current.next('.project-slide').removeClass('next').removeClass('prev').addClass('current');
13069						$current.removeClass('current').addClass('prev');
13070					}
13071
13072					//update dot nav
13073					if($sliderInstance.find('.dot-nav').length > 0) {
13074						$sliderInstance.find('.dot-nav span.active').removeClass('active');
13075						$sliderInstance.find('.dot-nav span:nth-child('+ ($sliderInstance.find('.project-slide.current').index() + 1) +')').addClass('active');
13076					}
13077
13078				},30);
13079
13080				return false;
13081				
13082			});
13083
13084			$(this).find('.zoom-slider-controls .prev').on('click',function(e){
13085
13086				//thres
13087				var $that = $(this);
13088				if(!$that.parent().hasClass('timeout')) {
13089					setTimeout(function(){
13090						$that.parent().removeClass('timeout');
13091					},1150);
13092				}
13093
13094				if($(this).parent().hasClass('timeout')) return false;
13095				$(this).parent().addClass('timeout');
13096				
13097				nectarCustomSliderResetRotate($that.parents('.nectar_fullscreen_zoom_recent_projects'), recentProjectSliderIndex);
13098
13099				//switch logic
13100				var $current = $(this).parents('.nectar_fullscreen_zoom_recent_projects').find('.project-slide.current');
13101				var $sliderInstance = $(this).parents('.nectar_fullscreen_zoom_recent_projects');
13102
13103				
13104				$sliderInstance.find('.project-slide').removeClass('next').removeClass('prev');
13105				$sliderInstance.find('.project-slide').each(function(i){
13106
13107					if(i < $current.index() || $current.index() == 0)
13108						$(this).addClass('prev');
13109					else
13110						$(this).addClass('next');
13111				});
13112
13113				if($current.index() == 0)
13114					$sliderInstance.find('.project-slide:last-child').addClass('no-trans');
13115
13116				setTimeout(function(){
13117
13118					if($current.index() == 0) {
13119						$sliderInstance.find('.project-slide:last-child').removeClass('no-trans').removeClass('next').removeClass('prev').addClass('current');
13120						$sliderInstance.find('.project-slide:first-child').removeClass('next').removeClass('prev').removeClass('current').addClass('next');
13121					} else {
13122						$current.prev('.project-slide').removeClass('next').removeClass('prev').addClass('current');
13123						$current.removeClass('current').addClass('next');
13124					}
13125
13126					//update dot nav
13127					if($sliderInstance.find('.dot-nav').length > 0) {
13128						$sliderInstance.find('.dot-nav span.active').removeClass('active');
13129						$sliderInstance.find('.dot-nav span:nth-child('+ ($sliderInstance.find('.project-slide.current').index() + 1) +')').addClass('active');
13130					}
13131
13132				},30);
13133
13134
13135				return false;
13136
13137			});
13138
13139			//pagination
13140				$(this).find('> .normal-container > .dot-nav').remove();
13141				$(this).find('> .normal-container').append('<div class="dot-nav"></div>');
13142				for(var $i=0;$i < $projLength;$i++) {
13143					if($i == 0) {
13144						$(this).find('.dot-nav').append('<span class="dot active"><span></span></span>');
13145					} else {
13146						$(this).find('.dot-nav').append('<span class="dot"><span></span></span>');
13147					}
13148			
13149				}
13150	
13151
13152			var $dotIndex = 1;
13153
13154			$('.nectar_fullscreen_zoom_recent_projects .dot-nav > span').on('click',function(e){
13155
13156				if($(this).hasClass('active')) return;
13157
13158				//thres
13159				var $that = $(this);
13160				if(!$that.parent().hasClass('timeout')) {
13161					setTimeout(function(){
13162						$that.parent().removeClass('timeout');
13163					},1150);
13164				}
13165
13166				if($(this).parent().hasClass('timeout')) return;
13167				$(this).parent().addClass('timeout');
13168
13169				nectarCustomSliderResetRotate($that.parents('.nectar_fullscreen_zoom_recent_projects'), recentProjectSliderIndex);
13170
13171				//switch logic
13172				$(this).parent().find('span.active').removeClass('active');
13173				$(this).addClass('active');
13174
13175				$dotIndex = $(this).index() + 1;
13176
13177				var $current = $(this).parents('.nectar_fullscreen_zoom_recent_projects').find('.project-slide.current');
13178				var $sliderInstance = $(this).parents('.nectar_fullscreen_zoom_recent_projects');
13179
13180				var $prevIndex = $current.index() + 1;
13181
13182				$sliderInstance.find('.project-slide').removeClass('next').removeClass('prev');
13183
13184				$sliderInstance.find('.project-slide').each(function(i){
13185					if(i < $dotIndex-1)
13186						$(this).addClass('prev');
13187					else
13188						$(this).addClass('next');
13189				});
13190
13191				//going prev
13192				if($prevIndex > $dotIndex) {
13193					$sliderInstance.find('.project-slide').eq($dotIndex-1).addClass('no-trans').addClass('prev').removeClass('next');
13194					setTimeout(function(){
13195						$sliderInstance.find('.project-slide').eq($dotIndex-1).removeClass('no-trans').removeClass('next').removeClass('prev').addClass('current');
13196						$current.removeClass('current').addClass('next');
13197					},30);
13198				
13199				} 
13200
13201				//going forawrd
13202				else {
13203					$sliderInstance.find('.project-slide').eq($dotIndex-1).addClass('no-trans').addClass('next').removeClass('prev');
13204					setTimeout(function(){
13205						$sliderInstance.find('.project-slide').eq($dotIndex-1).removeClass('no-trans').removeClass('next').removeClass('prev').addClass('current');
13206						$current.removeClass('current').addClass('prev');
13207					},30);
13208
13209				}
13210				
13211			});	
13212
13213
13214		});
13215		
13216	}
13217	fsProjectSliderInit();
13218 	
13219
13220	//portfolio accent color
13221	function portfolioAccentColor() {
13222
13223		var portfolioSocialColorCss = '';
13224
13225		$('.portfolio-items .col').each(function(){
13226			if ($(this).has('[data-project-color]')) { 
13227				$(this).find('.work-info-bg, .bottom-meta').css('background-color',$(this).attr('data-project-color'));
13228
13229				//style5
13230				$(this).find('.parallaxImg-rendered-layer .bg-overlay').css('border-color',$(this).attr('data-project-color'));
13231
13232				var	$projColor = $(this).attr('data-project-color');
13233				if($(this).find('.custom-content .nectar-social').length > 0 && $('body[data-button-style="rounded"]') ) portfolioSocialColorCss += 'body[data-button-style="rounded"] .col[data-
13233project-color="'+$projColor+'"] .custom-content .nectar-social > *:hover i { color: '+ $projColor +'!important; } ';
13234
13235			}
13236		});
13237		
13238		if(portfolioSocialColorCss.length > 1) {
13239
13240			var head = document.head || document.getElementsByTagName('head')[0];
13241			var style = document.createElement('style');
13242
13243				style.type = 'text/css';
13244			if (style.styleSheet){
13245			  style.styleSheet.cssText = portfolioSocialColorCss;
13246			} else {
13247			  style.appendChild(document.createTextNode(portfolioSocialColorCss));
13248			}
13249
13250			head.appendChild(style);
13251		}
13252	}
13253	portfolioAccentColor();
13254	
13255	//portfolio sort
13256	$('body').on('mouseenter','.portfolio-filters',function(){
13257		if(!portfolioFiltersOnMobile) {
13258			$(this).find('> ul').stop(true,true).slideDown(500,'easeOutExpo');
13259		}
13260		$(this).find('a#sort-portfolio span').html($(this).find('a#sort-portfolio').attr('data-sortable-label'));
13261	});
13262
13263	$('body').on('mouseleave','.portfolio-filters',function(){
13264		var $activeCat = $(this).find('a.active').html();
13265		if( typeof $activeCat == 'undefined' || $activeCat.length == 0) $activeCat = $(this).attr('data-sortable-label');
13266		$(this).find('a#sort-portfolio span').html($activeCat);
13267		if(!portfolioFiltersOnMobile) {
13268			$(this).find('> ul').stop(true,true).slideUp(500,'easeOutExpo');
13269		}
13270	});
13271	
13272	//portfolio selected category
13273	$('body').on('click','.portfolio-filters ul li a', function(){
13274		$(this).parents('.portfolio-filters').find('#sort-portfolio span').html($(this).html());
13275	});
13276	
13277	//portfolio prevent jump on parent dropdown click
13278	$('body').on('click','.portfolio-filters > a#sort-portfolio', function(){
13279		return false;
13280	});
13281	
13282	//inline portfolio selected category
13283	$('body').on('click','.portfolio-filters-inline ul li a',function(){
13284
13285		$(this).parents('ul').find('li a').removeClass('active');
13286		$(this).addClass('active');
13287		$(this).parents('.portfolio-filters-inline').find('#current-category').html($(this).html());
13288		
13289	});
13290	
13291	var portfolioFiltersOnMobile = false;
13292	
13293	function portfolioFiltersInit() {
13294		//mobile sort menu fix
13295		if($('body').hasClass('mobile') || navigator.userAgent.match(/(iPad|IEMobile)/)){
13296			portfolioFiltersOnMobile = true;
13297			$('.portfolio-filters').unbind('mouseenter mouseleave');
13298			$('.portfolio-filters > a, .portfolio-filters ul li a').on('click',function(e){
13299				if(e.originalEvent !== undefined) $(this).parents('.portfolio-filters').find('> ul').stop(true,true).slideToggle(600,'easeOutCubic');
13300			});
13301		}
13302
13303		if($('.portfolio-filters-inline[data-alignment="left"]').length > 0 || $('.portfolio-filters-inline[data-alignment="center"]').length > 0) {
13304			$('.portfolio-filters-inline .container > ul > li:nth-child(1) a').click();
13305		} else {
13306			$('.portfolio-filters-inline .container > ul > li:nth-child(2) a').click();
13307		}
13308		
13309		//portfolio more details page menu highlight
13310		$('body.single-portfolio #header-outer nav > ul > li > a:contains("Portfolio")').parents('li').addClass('current-menu-item');
13311		
13312		//blog page highlight
13313		$('body.single-post #header-outer nav > ul > li > a:contains("Blog")').parents('li').addClass('current-menu-item');
13314	}
13315
13316	portfolioFiltersInit();
13317
13318	
13319	//blog love center
13320	function centerLove(){
13321		$('.post').each(function(){
13322			
13323			var $loveWidth = $(this).find('.post-meta .nectar-love').outerWidth();
13324			var $loveWrapWidth = $(this).find('.post-meta  .nectar-love-wrap').width();
13325			
13326			//center
13327			$(this).find('.post-meta .nectar-love').css('margin-left', $loveWrapWidth/2 - $loveWidth/2 + 'px' );
13328			$(this).find('.nectar-love-wrap').css('visibility','visible');
13329		});
13330	}
13331	
13332	$('.nectar-love').on('click',function(){
13333		centerLove();
13334	});
13335	
13336	centerLove();	
13337	
13338
13339	//portfolio single comment order
13340	function portfolioCommentOrder(){
13341	
13342		if($('body').hasClass('mobile') && $('body').hasClass('single-portfolio') && $('#respond').length > 0){
13343			$('#sidebar').insertBefore('.comments-section');
13344		}
13345		 
13346		else if($('body').hasClass('single-portfolio') && $('#respond').length > 0) {
13347			$('#sidebar').insertAfter('.post-area');
13348		}
13349		
13350	}
13351
13352	portfolioCommentOrder();
13353	 
13354	
13355	//portfolio sidebar follow
13356	var sidebarFollow = $('.single-portfolio #sidebar').attr('data-follow-on-scroll');
13357	
13358	function portfolioSidebarFollow(){
13359		
13360		if($('body.single-portfolio').length == 0 || $('#sidebar[data-follow-on-scroll]').length == 0) { return; }
13361
13362		sidebarFollow = $('.single-portfolio #sidebar').attr('data-follow-on-scroll');
13363	
13364		if( sidebarFollow == 1 && !$('body').hasClass('mobile') && parseInt($('#sidebar').height()) + 50 <= parseInt($('.post-area').height())) {
13365			
13366			 
13367			 //padding from top of screen
13368			 var $ssExtraTopSpace = 50;
13369
13370			 if($('#header-outer[data-remove-fixed="0"]').length > 0 && $('body[data-hhun="1"]').length == 0) { 
13371				 $ssExtraTopSpace += $('#header-outer').outerHeight();	
13372				 
13373				 //resize effect
13374				 if($('#header-outer[data-shrink-num][data-header-resize="1"]').length > 0 ) {
13375						var shrinkNum = 6;		
13376						var headerPadding2 = parseInt($('#header-outer').attr('data-padding')) - parseInt($('#header-outer').attr('data-padding'))/1.8;
13377						shrinkNum = $('#header-outer').attr('data-shrink-num');
13378						$ssExtraTopSpace -= shrinkNum;
13379						$ssExtraTopSpace -= headerPadding2;
13380				 }
13381				 
13382				 //condesne
13383				 if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
13384					 
13385						 var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
13386						 var $secondaryHeader = $('#header-secondary-outer');
13387						 
13388						 $ssExtraTopSpace = 50;
13389						 $ssExtraTopSpace += $('#header-outer').height() - (parseInt($headerSpan9.position().top) - parseInt($('#header-outer #logo').css('margin-top')) ) - parseInt(nectarDOMInfo.secondaryHeaderHeight);
13390				 }
13391				 
13392
13393			 }
13394
13395			 if($('#wpadminbar').length > 0) {
13396				 $ssExtraTopSpace += $('#wpadminbar').outerHeight();
13397			 }
13398
13399			if($('#header-outer').attr('data-using-secondary') == '1' && $('body.material').length == 0) {
13400				 $ssExtraTopSpace += $('#header-secondary-outer').outerHeight();
13401			 }
13402			 
13403			 $('.single-portfolio #sidebar').theiaStickySidebar({
13404				 additionalMarginTop: $ssExtraTopSpace,
13405				 updateSidebarHeight: false
13406			 });
13407
13408			 
13409		}
13409 //if sticky sidebar is active and needs to be called
13410		
13411	} // end  portfolioSidebarFollow function
13412	
13413
13414	
13415	
13416	
13417	//remove the portfolio filters that are not found in the current page
13418	function isotopeCatSelection() {
13419
13420
13421		$('.portfolio-items:not(".carousel")').each(function(){
13422			
13423			var isotopeCatArr = [];
13424			var $portfolioCatCount = 0;
13425			$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(i){
13426				if($(this).find('a').length > 0) {
13427					isotopeCatArr[$portfolioCatCount] = $(this).find('a').attr('data-filter').substring(1);	
13428					$portfolioCatCount++;
13429				}
13430			});
13431		
13432			
13433			////ice the first (all)
13434			isotopeCatArr.shift();
13435			
13436			
13437			var itemCats = '';
13438			
13439			$(this).find('> div').each(function(i){
13440				itemCats += $(this).attr('data-project-cat');
13441			});
13442			itemCats = itemCats.split(' ');
13443			
13444			////remove the extra item on the end of blank space
13445			itemCats.pop();
13446			
13447			////make sure the array has no duplicates
13448			itemCats = $.unique(itemCats);
13449			
13450			////if user has chosen a set of filters to display - only show those
13451			if($(this).is('[data-categories-to-show]') && $(this).attr('data-categories-to-show').length != 0 && $(this).attr('data-categories-to-show') != 'all') {
13452				var $userSelectedCats = $(this).attr('data-categories-to-show').replace(/,/g , ' ');
13453				$userSelectedCats = $userSelectedCats.split(' ');
13454				
13455				if(!$(this).hasClass('infinite_scroll')) $(this).removeAttr('data-categories-to-show');
13456			} else {
13457				var $userSelectedCats = itemCats;
13458			}
13459			
13460			
13461			////Find which categories are actually on the current page
13462			var notFoundCats = [];
13463			$.grep(isotopeCatArr, function(el) {
13464
13465		    	if ($.inArray(el, itemCats) == -1) notFoundCats.push(el);
13466		    	if ($.inArray(el, $userSelectedCats) == -1) notFoundCats.push(el);
13467
13468			});
13469			
13470			//manipulate the list
13471			if(notFoundCats.length != 0){
13472				$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(){
13473					if($(this).find('a').length > 0) {
13474						if( $.inArray($(this).find('a').attr('data-filter').substring(1), notFoundCats) != -1 ){ 
13475							
13476							if($(this).find('> ul.children').length > 0) {
13477								$(this).find('> a').hide(); 
13478							} else {
13479								$(this).hide(); 
13480							}
13481							
13482						} else {
13483							$(this).show();
13484						}
13485					}
13486				})
13487			}
13488		});
13489	}
13490	
13491	isotopeCatSelection();
13492	
13493	
13494	//sharing buttons
13495
13496	var completed = 0;
13497	var windowLocation = window.location.href.replace(window.location.hash, '');
13498
13499	function facebookShare(){
13500		windowLocation = window.location.href.replace(window.location.hash, '');
13501		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" ) 
13502		return false;
13503	}
13504
13505	function googlePlusShare(){
13506		windowLocation = window.location.href.replace(window.location.hash, '');
13507		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" ) 
13508		return false;
13509	}
13510
13511	function twitterShare(){
13512        windowLocation = window.location.href.replace(window.location.hash, '');		
13513		if($(".section-title h1").length > 0) {
13514			var $pageTitle = encodeURIComponent($(".section-title h1").text());
13515		} else {
13516			var $pageTitle = encodeURIComponent($(document).find("title").text());
13517		}
13518		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" ) 
13519		return false;
13520	}
13521
13522	function wooTwitterShare(){
13523		windowLocation = window.location.href.replace(window.location.hash, '');
13524		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" ) 
13525		return false;
13526	}
13527
13528	function linkedInShare(){
13529	    windowLocation = window.location.href.replace(window.location.hash, '');	
13530		if($(".section-title h1").length > 0) {
13531			var $pageTitle = encodeURIComponent($(".section-title h1").text());
13532		} else {
13533			var $pageTitle = encodeURIComponent($(document).find("title").text());
13534		}
13535		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" ) 
13536		return false;
13537	}
13538
13539	function woolinkedInShare(){
13540	    windowLocation = window.location.href.replace(window.location.hash, '');	
13541		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" ) 
13542		return false;
13543	}
13544
13545	function pinterestShare(){
13546		windowLocation = window.location.href.replace(window.location.hash, '');
13547		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'); 
13548		
13549		if($(".section-title h1").length > 0) {
13550			var $pageTitle = encodeURIComponent($(".section-title h1").text());
13551		} else {
13552			var $pageTitle = encodeURIComponent($(document).find("title").text());
13553		}
13554		
13555		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" ) 
13556		return false;
13557	}
13558	
13559	function wooPinterestShare(){
13560		$imgToShare = ($('img.attachment-shop_single').length > 0) ? $('img.attachment-shop_single').first().attr('src') : $('.single-product-main-image img').first().attr('src');
13561		windowLocation = window.location.href.replace(window.location.hash, '');
13562		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" ) 
13563		return false;
13564	}
13565
13566
13567	function socialFade(){
13568
13569			if(completed == $('a.nectar-sharing').length && $('a.nectar-sharing').parent().hasClass('in-sight')) {
13570
13571					//love fadein
13572					$('.nectar-social .nectar-love span').show(350,'easeOutSine',function(){
13573						$(this).stop().animate({'opacity':1},800);
13574					});
13575					
13576					//sharing loadin
13577					$('.nectar-social > a').each(function(i){
13578						var $that = $(this);
13579						
13580						$(this).find('> span').show(350,'easeOutSine',function(){
13581							$that.find('> span').stop().animate({'opacity':1},800);
13582						});
13583						
13584					});
13585
13586
13587				//alt blog layout total share count
13588				var $totalShares = 0;
13589				$('.nectar-social > a .count').each(function(){
13590					$totalShares += parseInt($(this).html());
13591				});
13592				
13593				if($totalShares != 1){
13594					$('.single .meta-share-count .plural').css({'opacity':'1', 'display':'inline'});
13595					$('.single .meta-share-count .singular').remove();
13596				} else {
13597					$('.single .meta-share-count .singular').css({'opacity':'1', 'position':'relative',  'display':'inline'});
13598					$('.single .meta-share-count .plural').remove();
13599				}
13600
13601				$('.meta-share-count .share-count-total').html($totalShares).css('opacity',1);
13602			}
13603		}
13604
13605	$('body').on('click','#single-below-header .nectar-social a', function(){ return false; });
13606
13607	$('body').on('click','.facebook-share:not(.inactive)', facebookShare);
13608	$('body').on('click','.google-plus-share:not(.inactive)', googlePlusShare);
13609	$('body').on('click','.nectar-social:not(".woo") .twitter-share:not(.inactive)', twitterShare);
13610	$('body').on('click','.nectar-social.woo .twitter-share', wooTwitterShare);
13611	$('body').on('click','.nectar-social:not(".woo") .linkedin-share:not(.inactive)', linkedInShare);
13612	$('body').on('click','.nectar-social.woo .linkedin-share', woolinkedInShare);
13613	$('body').on('click','.nectar-social:not(".woo") .pinterest-share:not(.inactive)', pinterestShare);
13614	$('body').on('click','.nectar-social.woo .pinterest-share', wooPinterestShare);
13615	$('body').on('click','.nectar-social-sharing-fixed > a', function(){ return false; });
13616
13617	function socialSharingInit() {
13618
13619		//mobile fullscreen blog class for click event fix
13620		if($('body').hasClass('mobile') && $('.single-post .fullscreen-header').length > 0) {
13621			$('#single-below-header .nectar-social .nectar-sharing, #single-below-header .nectar-social .nectar-sharing-alt').addClass('inactive');
13622		}
13623
13624		completed = 0;
13625
13626		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) {
13627  
13628		 
13629			////facebook
13630			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) {
13631				
13632				//load share count on load  
13633				$.getJSON("https://graph.facebook.com/?id="+ windowLocation +"&callback=?", function(data) {
13634					if( data.share != undefined && data.share.share_count != undefined && data.share.share_count != 0 && (data.share.share_count != null)) { 
13635						$('.facebook-share a span.count, a.facebook-share span.count').html( data.share.share_count );	
13636					}
13637					else {
13638						$('.facebook-share a span.count, a.facebook-share span.count').html( 0 );	
13639					}
13640					completed++;
13641					socialFade();
13642				});
13643			 
13644				
13645				
13646			} else if($('a.facebook-share').length > 0 && $('body[data-button-style="rounded"]').length > 0 || $('.sharing-default-minimal a.facebook-share').length > 0) {
13647				completed++;
13648				socialFade();
13649			}
13650			
13651			
13652			////twitter
13653			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) {
13654				//load tweet count on load 
13655			
13656					$('.twitter-share a span.count, a.twitter-share span.count').html( 0 );
13657				
13658					completed++;
13659					socialFade();
13660				
13661
13662
13663			} else if($('a.twitter-share').length > 0 && $('body[data-button-style="rounded"]').length > 0 || $('.sharing-default-minimal a.twitter-share').length > 0 ) {
13664				completed++;
13665				socialFade();
13666			}
13667			
13668			
13669			////linkedIn
13670			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) {
13671				//load share count on load 
13672			
13673						$('.linkedin-share a span.count, a.linkedin-share span.count').html( 0 );
13674			
13675					completed++;
13676					socialFade();
13677
13678				
13679			} else if($('a.linkedin-share').length > 0 && $('body[data-button-style="rounded"]').length > 0 || $('.sharing-default-minimal a.linkedin-share').length > 0) {
13680				completed++;
13681				socialFade();
13682			}
13683			
13684			
13685			////pinterest
13686			if(nectarDOMInfo.usingFrontEndEditor) {
13687				completed++;
13688				socialFade();
13689			}
13690			else {
13691				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) {
13692					//load pin count on load 
13693					$.getJSON('https://api.pinterest.com/v1/urls/count.json?url='+windowLocation+'&callback=?', function(data) {
13694						if((data.count != 0) && (data.count != undefined) && (data.count != null)) { 
13695							$('.pinterest-share a span.count, a.pinterest-share span.count').html( data.count );
13696						}
13697						else {
13698							$('.pinterest-share a span.count, a.pinterest-share span.count').html( 0 );
13699						}
13700						completed++;
13701						socialFade();
13702					});
13703
13704				} else if($('a.pinterest-share').length > 0 && $('body[data-button-style="rounded"]').length >  0 || $('.sharing-default-minimal a.pinterest-share').length > 0) {
13705					completed++;
13706					socialFade();
13707				}
13708		}
13709
13710		//fadeIn
13711		$('a.nectar-sharing > span.count, a.nectar-sharing-alt > span.count').hide().css('width','auto');
13712
13713
13714		//social light up
13715		$('.nectar-social').each(function() {
13716			if($(this).parents('.custom-content').length == 0 && $(this).parents('.nectar-social-sharing-fixed').length == 0) {
13717
13718
13719				var $that = $(this);
13720				var waypoint = new Waypoint({
13721	 			element: $that,
13722	 			 handler: function(direction) {
13723
13724					var $slide_timeout = ($('#page-header-bg[data-animate-in-effect="slide-down"] .nectar-social').length > 0 ) ? 900 : 1;
13725
13726					setTimeout(function(){
13727
13728						$that.addClass('in-sight');
13729						socialFade();
13730						
13731						if($('#page-header-bg .nectar-social').length == 0) {
13732							$that.find('> *').each(function(i){
13733								
13734								var $that = $(this);
13735								var $timeout = ($('body[data-button-style="rounded"]').length > 0) ? 0: 750;
13736
13737								setTimeout(function(){ 
13738									
13739									$that.delay(i*80).queue(function(){ 
13740										
13741										var $that = $(this); $(this).addClass('hovered'); 
13742										
13743										setTimeout(function(){ 
13744											$that.removeClass('hovered');
13745										},300); 
13746										
13747									});
13748								
13749								},$timeout);
13750							});
13751						}
13752
13753					},$slide_timeout );
13754
13755					$that.addClass('animated-in');
13756					waypoint.destroy();
13757				},
13758				offset: 'bottom-in-view'
13759
13760			}); 
13761
13762				
13763			}
13764			}); 
13765
13766		}
13767
13768	}
13769	
13770	socialSharingInit();
13771
13772
13773	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
13774
13775		var $socialTimeout;
13776		$('body').on('mouseenter','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
13777			clearTimeout($socialTimeout);
13778
13779			if($(this).parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 
13780				$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'right':'0px'},0);
13781			else 
13782				$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'left':'0px'},0);
13783
13784			$(this).parents('[id*="-meta"]').addClass('social-hovered');
13785
13786			$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':0},250);
13787			$(this).find('.nectar-social a').each(function(i){
13788				$(this).stop(true).delay(i*40).animate({'opacity': 1,  'left':'0px'}, 150);
13789			});
13790
13791		});
13792
13793	
13794		$('body').on('mouseleave','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
13795			$(this).parents('[id*="-meta"]').removeClass('social-hovered');
13796
13797			if($(this).parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 
13798				$(this).find('.nectar-social').stop(true).animate({'opacity': 0,  'right':'-20px'}, 200);
13799			else 
13800				$(this).find('.nectar-social').stop(true).animate({'opacity': 0,  'left':'-20px'}, 200);
13801
13802			$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':1},250);
13803
13804			var $that = $(this);
13805			
13806			$socialTimeout = setTimeout(function(){ 
13807				$that.find('.nectar-social').hide(); 
13808				if($that.parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 
13809					$that.find('.nectar-social a').stop(true).animate({'opacity': 0,  'left':'20px'},0);   
13810				else 
13811					$that.find('.nectar-social a').stop(true).animate({'opacity': 0,  'left':'-20px'},0);   
13812			}, 200);
13813		});
13814	} else {
13815		var $socialTimeout;
13816		$('body').on('click','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
13817			clearTimeout($socialTimeout);
13818
13819			if($(this).parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 
13820				$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'right':'0px'},0);
13821			else 
13822				$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'left':'0px'},0);
13823
13824			$(this).parents('[id*="-meta"]').addClass('social-hovered');
13825
13826			$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':0},250);
13827			$(this).find('.nectar-social a').each(function(i){
13828				$(this).stop(true).delay(i*40).animate({'opacity': 1,  'left':'0px'}, 150);
13829			});
13830
13831			return false;
13832		});
13833
13834	}
13835
13836	$('body').on('mouseenter','.fullscreen-header  .meta-share-count', function(){
13837		$(this).find('> a, > i').stop(true).animate({'opacity': 0},400);
13838		$(this).find('.nectar-social > *').each(function(i){
13839			$(this).stop(true).delay(i*50).animate({'opacity':'1', 'top': '0px'},250,'easeOutCubic');
13840		});
13841		//allow clickable on mobile
13842		setTimeout(function(){ $('.meta-share-count .nectar-sharing, .meta-share-count .nectar-sharing-alt').removeClass('inactive'); },300);
13843	});
13844
13845	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
13846		$('body').on('mouseleave','.fullscreen-header  .meta-share-count', function(){
13847			$(this).find('> a, > i').stop(true).animate({'opacity': 1},300,'easeInCubic');
13848			$(this).find('.nectar-social > *').each(function(i){
13849				$(this).stop(true).animate({'opacity':'0', 'top': '10px'},200,'easeInCubic');
13850			});
13851		});
13852	}
13853
13854	//full width love center
13855	function nectarLoveFWCenter(){
13856		$('.nectar-social.full-width').each(function(){ 
13857			$(this).find('.n-shortcode .nectar-love').css('padding-top', $(this).find('> a').css('padding-top'));
13858		});
13859	}
13860	
13861	nectarLoveFWCenter();
13862	
13863
13864	//-----------------------------------------------------------------
13865	// NectarLove
13866	//-----------------------------------------------------------------
13867	
13868	////love iwth txt
13869	$('.fullscreen-header .nectar-love').each(function(){
13870		if($(this).find('.nectar-love-count').text() == '1') {
13871			$(this).find('span.love-txt.single').css({'visibility':'visible', 'text-indent':'0'});
13872			$(this).find('span.love-txt.plural').css({'visibility':'hidden', 'text-indent':'-9999px'});
13873		} else {
13874			$(this).find('span.love-txt.single').css({'visibility':'hidden', 'text-indent':'-9999px'});
13875			$(this).find('span.love-txt.plural').css({'visibility':'visible', 'text-indent':'0'});
13876		}
13877	});
13878
13879	$('body').on('click','.nectar-love', function() {
13880			
13881
13882			var $loveLink = $(this);
13883			var $id = $(this).attr('id');
13884			var $that = $(this);
13885			
13886			if($loveLink.hasClass('loved')) return false;
13887			if($(this).hasClass('inactive')) return false;
13888			
13889			var $dataToPass = {
13890				action: 'nectar-love', 
13891				loves_id: $id,
13892				love_nonce: nectarLove.loveNonce
13893			}
13894			
13895			$.post(nectarLove.ajaxurl, $dataToPass, function(data){
13896				$loveLink.find('span:not(.love-txt)').html(data);
13897				$loveLink.addClass('loved').attr('title','You already love this!');
13898				$loveLink.find('span:not(.love-txt)').css({'opacity': 1,'width':'auto'});
13899
13900				if($(data).text() == '1') {
13901					$loveLink.find('span.love-txt.single').css({'visibility':'visible', 'text-indent':'0'});
13902					$loveLink.find('span.love-txt.plural').css({'visibility':'hidden', 'text-indent':'-9999px'});
13903				} else {
13904					$loveLink.find('span.love-txt.single').css({'visibility':'hidden', 'text-indent':'-9999px'});
13905					$loveLink.find('span.love-txt.plural').css({'visibility':'visible', 'text-indent':'0'});
13906				}
13907
13908				//ascend
13909				if($('body').hasClass('ascend') && $that.parents('.classic_enhanced').length == 0 ){
13910					$that.find('.icon-salient-heart-2').addClass('loved');
13911				} else if($that.parents('.classic_enhanced').length > 0 ) {
13912					$that.find('.icon-salient-heart-2').addClass('loved');
13913				}
13914			});
13915			
13916			$(this).addClass('inactive');
13917			
13918			return false;
13919	});
13920
13921
13922	
13923	//infinite scroll
13924	function infiniteScrollInit() {
13925
13926		if($('.infinite_scroll').length > 0) {
13927			
13928			//portfolio
13929			$('.portfolio-items.infinite_scroll').infinitescroll({
13930		    	navSelector  : "div#pagination",            
13931		   	    nextSelector : "div#pagination a:first",    
13932		   	    itemSelector : ".portfolio-items.infinite_scroll .element",
13933		   	    finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
13934		        msgText: " ",         
13935		   },function(newElements){
13936		   	
13937
13938				var $container = $('.portfolio-items.infinite_scroll:not(.carousel)');
13939				//loading effect   
13940
13941		        var $newElems = $( newElements ).css('opacity',0);
13942		        //// ensure that images load before adding to masonry layout
13943		        $newElems.imagesLoaded(function(){
13944		          
13945		          $( newElements ).css('opacity',1);
13946
13947		          $container.isotope( 'appended', $( newElements ));
13948		          
13949		          $( newElements ).find('.work-item').addClass('ajax-loaded');
13950		          $( newElements ).addClass('ajax-loaded');
13951		          ///// show elems now they're ready
13952		          
13953		          $(newElements).find('.work-meta, .nectar-love-wrap').css({'opacity':1});
13954		          
13955		          //keep filtering
13956		          if($('.portfolio-filters-inline').length > 0 || $('.portfolio-filters').length > 0) {
13957		          	
13958		          	  if($('.portfolio-filters-inline').length > 0) {
13959		          	  	 var selector = $('.portfolio-filters-inline a.active').attr('data-filter');
13960		          	  } else {
13961		          	  	 var selector = $('.portfolio-filters a.active').attr('data-filter');
13962		          	  }
13963		          	  
13964		          	  $('.portfolio-filters-inline a.active').attr('data-filter');
13965			  	 	  $container.isotope({ filter: selector });
13966		          }
13967		          
13968			  	//set width
13969			  	//portfolioItemWidths();
13970			  	reLayout();
13971
13972		        if($(newElements).find('.work-item.style-5').length > 0) style6Img();
13973
13974	          	if($(newElements).find('.inner-wrap').attr('data-animation') == 'none') {
13975					$('.portfolio-items .col .inner-wrap').removeClass('animated');
13976				} else {
13977
13978					masonryZindex();
13979					$(newElements).each(function(i){
13980						
13981						var $portfolioOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '90%';
13982						
13983						//not already visible
13984						var $that = $(this);
13985						var waypoint = new Waypoint({
13986			 			element: $that,
13987			 			 handler: function(direction) {
13988							
13989							var $portfolioAnimationDelay = ($that.is('[data-masonry-type="photography"].masonry-items')) ? 85 : 115;
13990						
13991							setTimeout(function(){
13992								$that.addClass("animated-in");
13993							},$portfolioAnimationDelay * $that.attr('data-delay-amount'));
13994						
13995							
13996							waypoint.destroy();
13997						},
13998						offset: $portfolioOffsetPos
13999
14000						}); //waypoint
14001
14002	
14003					}); //each
14004				}
14005
14006		       
14007		    portfolioHoverEffects();	
14008				portfolioAccentColor();
14009		         
14010		    //verify smooth scorlling
14011				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') } 
14012				
14013				
14014				
14015				//prettyphoto
14016				$('.portfolio-items').each(function(){
14017					var $unique_id = Math.floor(Math.random()*10000);
14018					$(this).find('a[rel^="prettyPhoto"], a.pretty_photo').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo');
14019				});
14020		
14021				lightBoxInit();
14022				
14023				piVertCenter();
14024
14025				setTimeout(function(){masonryZindex(); reLayout(); $( newElements ).removeClass('ajax-loaded'); },700);
14026		        
14027		        //recalc the filters
14028		        isotopeCatSelection();
14029
14030		        parallaxRowsBGCals();
14031	          
14032	          }); 
14033
14034				
14035		   });
14036
14037			//blog
14038			$('.post-area.infinite_scroll .posts-container').infinitescroll({
14039		    	navSelector  : "div#pagination",            
14040		   	    nextSelector : "div#pagination a:first",    
14041		   	    itemSelector : ".post-area .posts-container .post",
14042		   	    finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
14043		        msgText: " " 
14044		   },function(newElements){
14045		   	
14046		   	if($('.masonry.meta_overlaid').length == 0) { 
14047			   	//reinit js
14048			   	centerLove();
14049			   	
14050			   	//gallery
14051				$(newElements).find('.flex-gallery').each(function(){
14052					
14053					var $that = $(this);
14054					
14055					 $that.flexslider({
14056				        animation: 'fade',
14057				        smoothHeight: false, 
14058				        animationSpeed: 500,
14059				        useCSS: false, 
14060				        touch: true
14061				    });
14062					
14063					////gallery slider add arrows
14064					$('.flex-gallery .flex-direction-nav li a.flex-next').html('<i class="fa fa-angle-right"></i>');
14065					$('.flex-gallery .flex-direction-nav li a.flex-prev').html('<i class="fa fa-angle-left"></i>');
14066
14067				});
14068			   	
14069			   	
14070			   	//media players
14071			   	if($().mediaelementplayer) $(newElements).find('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer();
14072			   	
14073			   	
14074			   	//lightbox
14075			    lightBoxInit();
14076			   	
14077			   	//carousels
14078			   	if($('.carousel').length > 0) {
14079				   	standardCarouselInit();
14080			    	clientsCarouselInit();
14081			    }
14082			   	
14083
14084			   	//milestone
14085			   	$(newElements).find('.nectar-milestone').each(function() {
14086					//symbol
14087					if($(this).has('[data-symbol]')) {
14088						if($(this).attr('data-symbol-pos') == 'before') {
14089							$(this).find('.number').prepend($(this).attr('data-symbol'));
14090						} else {
14091							$(this).find('.number').append($(this).attr('data-symbol'));
14092						}
14093					}
14094				});
14095				
14096				if(!$('body').hasClass('mobile')) {
14097					
14098					$(newElements).find('.nectar-milestone').each(function() {
14099						//animation
14100
14101							var $that = $(this);
14102							var waypoint = new Waypoint({
14103				 			element: $that,
14104				 			 handler: function(direction) {
14105								if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
14106								     waypoint.destroy();
14107								     return;
14108								}
14109
14110								var $endNum = parseInt($that.find('.number span').text());
14111
14112								var countOptions = { easingFn: easeOutCubic };
14113								var $countEle = $that.find('.number span:not(.symbol)')[0];
14114								var numAnim = new CountUp($countEle, 0, $endNum,0,2.2,countOptions);
14115								numAnim.start();
14116
14117
14118								$that.addClass('animated-in');
14119								waypoint.destroy();
14120							},
14121							offset: 'bottom-in-view'
14122
14123						}); 
14124
14125						
14126					}); 
14127				}
14128				
14129				//pie chart		
14130			    if($().vcChat) $(newElements).find('.vc_pie_chart').vcChat();
14131		    	
14132		    	//fancy ul
14133		    	nectar_fancy_ul_init();
14134		    	
14135		    	//testimonial slider
14136		    	$('.testimonial_slider').animate({'opacity':'1'},800);
14137		    	createTestimonialControls();
14138				testimonialSliderHeight(); 
14139				testimonialHeightResize();
14140		    	
14141				//bar graph
14142				$(newElements).find('.nectar-progress-bar').each(function(i){
14143				
14144
14145				var $that = $(this);
14146				var waypoint = new Waypoint({
14147		 			element: $that,
14148		 			 handler: function(direction) {
14149						if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
14150						     waypoint.destroy();
14151						     return;
14152						}
14153
14154						var percent = $that.find('span').attr('data-width');
14155						var $endNum = parseInt($that.find('span strong i').text());
14156						
14157						$that.find('span').transition({
14158							'width' : percent + '%'
14159						},1600, 'easeInOutCirc',function(){
14160						});
14161						
14162						$that.find('span strong').transition({
14163							'opacity' : 1
14164						},1350);
14165						
14166						
14167						var countOptions = { useEasing : false };
14168						var $countEle = $that.find('span strong i')[0];
14169						var numAnim = new CountUp($countEle, 0, $endNum,0,1.2,countOptions);
14170						numAnim.start();
14171
14172						
14173						////100% progress bar 
14174						if(percent == '100'){
14175							$that.find('span strong').addClass('full');
14176						}
14177
14178
14179						$that.addClass('animated-in');
14180						waypoint.destroy();
14181					},
14182					offset: 'bottom-in-view'
14183
14184				}); 
14185
14186
14187			
14188				});
14189				
14190				
14191				//columns & images with animation
14192				colAndImgAnimations();
14193				splitLineHeadings();
14194
14195				setTimeout(function(){
14196					responsiveVideoIframesInit();
14197					responsiveVideoIframes();
14198					$(window).trigger('resize');
14199				},500);
14200
14201
14202				parallaxRowsBGCals();
14203
14204				$(window).trigger('resize');
14205			   	
14206		   	}//non meta overlaid style 
14207		   	else {
14208		   		parallaxRowsBGCals();
14209
14210				  $(window).trigger('resize');
14211		   	}
14212
14213		   	// trigger Masonry as a callback
14214		   	var $container = $('.posts-container');
14215		    if($container.parent().hasClass('masonry')) { 
14216		    	 
14217		    	$(newElements).addClass('masonry-blog-item');
14218				$(newElements).prepend('<span class="bottom-line"></span>');
14219				
14220				//move the meta to the bottom
14221				$(newElements).each(function(){
14222					
14223					var $metaClone = $(this).find('.post-meta').clone();
14224		
14225					$(this).find('.post-meta').remove();
14226					
14227					if($('.post-area.meta_overlaid').length > 0){
14228						$(this).find('.post-header h2').after($metaClone);
14229					} else {
14230						$(this).find('.content-inner').after($metaClone);
14231					}
14232					
14233				});
14234			
14235		    	}//if masonry
14236
14237
14238		    	//loading effect   
14239		    	
14240		        //// hide new items while they are loading
14241		        var $newElems = $( newElements );
14242		        //// ensure that images load before adding to masonry layout
14243						
14244		        if($newElems.find('img').length == 0) $newElems = $('body');
14245		        
14246		        $newElems.imagesLoaded(function(){
14247							
14248							if($container.parent().hasClass('masonry') && !$container.parent().hasClass('auto_meta_overlaid_spaced')) {
14249			          $container.isotope( 'appended', $( newElements ));
14250							}
14251
14252		          flickityBlogInit();
14253
14254		          $( newElements ).addClass('ajax-loaded');
14255		          ///// show elems now they're ready
14256
14257
14258		        //classic enhanced specific 
14259		        if($container.parent().hasClass('classic_enhanced')){
14260					$container.find('.large_featured.has-post-thumbnail.ajax-loaded .post-featured-img, .wide_tall.has-post-thumbnail.ajax-loaded .post-featured-img').each(function(){
14261						var $src = $(this).find('img').attr('src');
14262						$(this).css('background-image','url('+$src+')');
14263					});
14264
14265					$container.find('.large_featured.ajax-loaded .nectar-flickity, .wide_tall.ajax-loaded .nectar-flickity').each(function(){
14266
14267						$(this).find('.cell').each(function(){
14268							var $src = $(this).find('img').attr('src');
14269							$(this).css('background-image','url('+$src+')');
14270						});
14271						
14272					});
14273				}
14274
14275
14276		          if($(newElements).parents('.posts-container').attr('data-animation') == 'none') {
14277						$( newElements ).find('.inner-wrap').removeClass('animated');
14278					} else {
14279						blogMasonryZindex();
14280						$(newElements).each(function(i){
14281
14282							var $that = $(this);
14283							var waypoint = new Waypoint({
14284
14285					 			element: $that,
14286					 			 handler: function(direction) {
14287									
14288									setTimeout(function(){
14289									    $that.addClass("animated-in");
14290									},80*$that.attr('data-delay-amount'));
14291
14292									waypoint.destroy();
14293								},
14294								offset: '90%'
14295
14296							}); 
14297
14298		
14299						}); //each
14300					}
14301
14302					setTimeout(function(){$( newElements ).removeClass('ajax-loaded'); },700);
14303
14304		        
14305		        });
14306		        
14307		    
14308		   	
14309		   });
14310		   
14311	   }
14312
14313}
14314
14315infiniteScrollInit();
14316
14317function destroyInfiniteScroll(){
14318	$('.post-area.infinite_scroll .posts-container').infinitescroll('destroy');
14319	$('.portfolio-items.infinite_scroll').infinitescroll('destroy');
14320}
14321	
14322/*-------------------------------------------------------------------------*/
14323/*	6.	Scroll to top
14324/*-------------------------------------------------------------------------*/	
14325
14326var $scrollTop = $(window).scrollTop();
14327
14328//starting bind
14329function toTopBind() {
14330	if( $('#to-top').length > 0 && $(window).width() > 1020 || $('#to-top').length > 0 &&  $('#to-top.mobile-enabled').length > 0 ) {
14331		
14332		if($scrollTop > 350){
14333			$(window).on('scroll',hideToTop);
14334		}
14335		else {
14336			$(window).on('scroll',showToTop);
14337		}
14338	}
14339}
14340
14341if($('.nectar-social-sharing-fixed').length == 0) {
14342	toTopBind();
14343} else {
14344	if($(window).width() < 1000 && $('body.single').length > 0) {
14345		if($scrollTop > 150){
14346			$(window).on('scroll',hideFixedSharing);
14347		}
14348		else {
14349			$(window).on('scroll',showFixedSharing);
14350		}
14351	}
14352
14353	$(window).smartresize(function(){
14354		if($(window).width() > 1000) { 
14355			$('.nectar-social-sharing-fixed').addClass('visible');
14356		}	
14357		else if($scrollTop < 150) { 
14358			$(window).off('scroll',hideFixedSharing);
14359			$(window).on('scroll',showFixedSharing);
14360			$('.nectar-social-sharing-fixed').removeClass('visible');	
14361		} else {
14362			$(window).off('scroll',showFixedSharing);
14363			$(window).on('scroll',hideFixedSharing);
14364		}
14365	});
14366}
14367
14368function showFixedSharing(){
14369	
14370  $scrollTop = $(window).scrollTop();
14371	if( $scrollTop > 150){
14372
14373		$('.nectar-social-sharing-fixed').addClass('visible');	
14374		
14375		$(window).off('scroll',showFixedSharing);
14376		$(window).on('scroll',hideFixedSharing);
14377	}
14378
14379}
14380
14381function hideFixedSharing(){
14382  
14383	$scrollTop = $(window).scrollTop();
14384	if( $scrollTop < 150){
14385
14386		$('.nectar-social-sharing-fixed').removeClass('visible');	
14387		
14388		$(window).off('scroll',hideFixedSharing);
14389		$(window).on('scroll',showFixedSharing);
14390	}
14391
14392}
14393
14394
14395
14396function showToTop(){
14397
14398	if( nectarDOMInfo.scrollTop > 350 && $('#slide-out-widget-area.fullscreen.open').length == 0){
14399
14400		$('#to-top').stop().transition({
14401			'bottom' : '17px'
14402		},350,'easeInOutCubic');	
14403		
14404		$(window).off('scroll',showToTop);
14405		$(window).on('scroll',hideToTop);
14406	}
14407
14408}
14409
14410function hideToTop(){
14411	
14412	if( nectarDOMInfo.scrollTop < 350 || $('#slide-out-widget-area.fullscreen.open').length > 0){
14413
14414		var $animationTiming = ($('#slide-out-widget-area.fullscreen.open').length > 0) ? 1150 : 350;
14415
14416		$('#to-top').stop().transition({
14417			'bottom' : '-30px'
14418		},$animationTiming,'easeInOutQuint');	
14419		
14420		$(window).off('scroll',hideToTop);
14421		$(window).on('scroll',showToTop);	
14422		
14423	}
14424}
14425
14426
14427//to top color
14428if( $('#to-top').length > 0 ) {
14429	
14430	var $windowHeight, $pageHeight, $footerHeight, $ctaHeight;
14431	
14432	function calcToTopColor(){
14433		$scrollTop = $(window).scrollTop();
14434		$windowHeight = $(window).height();
14435		$pageHeight = $('body').height();
14436		$footerHeight = $('#footer-outer').height();
14437		$ctaHeight = ($('#call-to-action').length > 0) ? $('#call-to-action').height() : 0;
14438		
14439		if( ($scrollTop-35 + $windowHeight) >= ($pageHeight - $footerHeight) && $('#boxed').length == 0){
14440			$('#to-top').addClass('dark');
14441		}
14442		
14443		else {
14444			$('#to-top').removeClass('dark');
14445		}
14446	}
14447	
14448	if(!nectarDOMInfo.usingMobileBrowser) {
14449		//calc on scroll
14450		$(window).scroll(calcToTopColor);
14451		
14452		//calc on resize
14453		$(window).resize(calcToTopColor);
14454	}
14455
14456}
14457
14458//alt style
14459if($('body[data-button-style*="rounded"]').length > 0){
14460	var $clone = $('#to-top .fa-angle-up').clone();
14461	$clone.addClass('top-icon');
14462	$('#to-top').prepend($clone)
14463}
14464
14465//scroll up event
14466$('body').on('click','#to-top, a[href="#top"]',function(){
14467	$('body,html').stop().animate({
14468		scrollTop:0
14469	},800,'easeOutQuad',function(){
14470		if($('.nectar-box-roll').length > 0) {
14471			$('body').trigger('mousewheel', [1, 0, 0]);
14472		}
14473	})
14474	return false;
14475});
14476
14477
14478/* one page scrolling */
14479function scrollSpyInit(){ 
14480
14481	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-outer').outerHeight();
14482
14483	if( $('.page-template-template-no-header-footer').length > 0 || $('.page-template-template-no-header').length > 0 ) { $headerNavSpace = 0; }
14484
14485	//prevent jump to rop on empty items
14486	$('header#top .sf-menu li a[href="#"]').on('click',function(e){
14487		e.preventDefault();
14488	});
14489	
14490	if( $('#nectar_fullscreen_rows').length == 0 || $disableFPonMobile == 'on') {
14491
14492		$('a.nectar-next-section').each(function(){
14493			
14494			if($(this).parents('.wpb_row:not(.inner_row)').length > 0) {
14495				
14496				var $parentRow = $(this).parents('.wpb_row:not(.inner_row)');
14497				var $parentRowIndex = $(this).parents('.wpb_row:not(.inner_row)').index();
14498				
14499				if($parentRow.parent().find('> .wpb_row[id]:eq('+($parentRowIndex+1)+')').length > 0) {
14500					var $nextRowID = $parentRow.parent().find('> .wpb_row:eq('+($parentRowIndex+1)+')').attr('id');
14501					$(this).attr('href', '#' + $nextRowID);
14502				} 
14503				
14504			}
14505			
14506		});
14507	} else if( $().fullpage ) {
14508			$('a.nectar-next-section').on('click',function(){
14509				$.fn.fullpage.moveSectionDown();
14510				return false;
14511			});
14512	}
14513
14514	//remove full page URLs from hash if located on same page to fix current menu class
14515	//if(location.pathname.length > 1) {
14516	
14517	  //ocm
14518		if($('#slide-out-widget-area .off-canvas-menu-container').length > 0) {
14519			$('#slide-out-widget-area .off-canvas-menu-container').find("a[href*='" + location.pathname + "']").each(function(){
14520					
14521					var $href = $(this).attr('href');
14522
14523					//regular animated anchors
14524					if($href != '#' && $href.indexOf("#") != -1 && $('div'+$href.substr($href.indexOf("#"))).length > 0 ) {
14525						$(this).attr('href',$href.substr($href.indexOf("#")));
14526						$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
14527					}
14528					
14529					//fullpage is a little different
14530					if($('div[data-fullscreen-anchor-id="'+$href.substr($href.indexOf("#")+1)+'"]').length > 0) {
14531						$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
14532					}
14533					
14534			});
14535		}
14536		
14537	  //header
14538		$("#header-outer").find("a[href*='" + location.pathname + "']").each(function(){
14539			var $href = $(this).attr('href');
14540
14541			//regular animated anchors
14542			if($href.indexOf("#") != -1 && $('div'+$href.substr($href.indexOf("#"))).length > 0 ) {
14543
14544				$(this).attr('href',$href.substr($href.indexOf("#")));
14545				$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
14546			}
14547
14548			//fullpage is a little different
14549			if($('div[data-fullscreen-anchor-id="'+$href.substr($href.indexOf("#")+1)+'"]').length > 0) {
14550				$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
14551			}
14552
14553		});
14554	//}
14555
14556	var $target = ($('.page-submenu[data-sticky="true"]').length == 0) ? '#header-outer nav': '.page-submenu';
14557	$('body').scrollspy({
14558		target: $target,
14559		offset: $headerNavSpace + nectarDOMInfo.adminBarHeight + 40
14560	});
14561
14562}
14563
14564
14565/*helper function to scroll the page in an animated manner*/
14566function nectar_scrollToY(scrollTargetY, speed, easing) {
14567
14568		var scrollY = window.scrollY || document.documentElement.scrollTop,
14569				scrollTargetY = scrollTargetY || 0,
14570				speed = speed || 2000,
14571				easing = easing || 'easeOutSine',
14572				currentTime = 0;
14573
14574		var time = Math.max(.1, Math.min(Math.abs(scrollY - scrollTargetY) / speed, .8));
14575
14576
14577		var easingEquations = {
14578						easeInOutQuint: function (pos) {
14579								if ((pos /= 0.5) < 1) {
14580										return 0.5 * Math.pow(pos, 5);
14581								}
14582								return 0.5 * (Math.pow((pos - 2), 5) + 2);
14583						}
14584				};
14585
14586
14587		function tick() {
14588				currentTime += 1 / 60;
14589
14590				var p = currentTime / time;
14591				var t = easingEquations[easing](p);
14592
14593				if (p < 1) {
14594						requestAnimationFrame(tick);
14595
14596						window.scrollTo(0, scrollY + ((scrollTargetY - scrollY) * t));
14597				} else {
14598						window.scrollTo(0, scrollTargetY);
14599				}
14600		}
14601
14602		tick();
14603}
14604
14605
14606function pageLoadHash() {
14607
14608	var $hash = window.location.hash;
14609	
14610	var $hashSubstrng = ($hash && $hash.length > 0) ? $hash.substring(1,$hash.length) : 0;
14611
14612	//if hash has slashes 
14613	var $hasSlashLength = 0;
14614	if($hashSubstrng) {
14615		$hasSlashLength = $hashSubstrng.split("/");
14616		$hasSlashLength = $hasSlashLength.length;
14617	}
14618	
14619	if($hashSubstrng && $hasSlashLength > 1 ) { 
14620		$hashSubstrng = $hashSubstrng.replace(/\//g, ""); 
14621		$hash = $hash.replace(/\//g, ""); 
14622	}
14623
14624	if($hash && $('.main-content').find($hash).length > 0 || $hash && $('.main-content').find('[data-fullscreen-anchor-id="'+$hashSubstrng+'"]').length > 0) {
14625
14626		var $hashObj = ($('.main-content').find($hash).length > 0) ? $('.main-content').find($hash) : $('.main-content').find('[data-fullscreen-anchor-id="'+$hashSubstrng+'"]');
14627
14628		var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-space').outerHeight();
14629		if( $('.page-template-template-no-header-footer').length > 0 || $('.page-template-template-no-header').length > 0 ) { $headerNavSpace = 0; }
14630
14631		$timeoutVar = 0;
14632		if($('.nectar-box-roll').length > 0 && $('.container-wrap.bottomBoxOut').length > 0) {
14633			boxRoll(null,-1);
14634			$timeoutVar = 2050;
14635		} 
14636		setTimeout(function(){
14637		
14638			if( $('body[data-permanent-transparent="1"]').length == 0 ) {
14639				
14640				if(!$('body').hasClass('mobile')){
14641					$resize = ($('#header-outer[data-header-resize="0"]').length > 0) ? 0 : parseInt(shrinkNum) + headerPadding2*2;
14642					if($('#header-outer[data-remove-fixed="1"]').length > 0) { 
14643						$headerNavSpace = 0;
14644					}
14645					var $scrollTopDistance =  $hashObj.offset().top - parseInt($headerNavSpace) +$resize + 3 - nectarDOMInfo.adminBarHeight;
14646					
14647					
14648					
14649					//condesne
14650					if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
14651						
14652							var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
14653							var $secondaryHeader = $('#header-secondary-outer');
14654							var $headerHeightStored = $('#header-outer').height();
14655							
14656							$headerHeightCondensed = $headerHeightStored - ( parseInt($headerSpan9.height()) + parseInt($('#header-outer #logo').css('margin-top')) );
14657						
14658							$scrollTopDistance =  $hashObj.offset().top - parseInt($headerNavSpace) + $headerHeightCondensed - nectarDOMInfo.adminBarHeight;
14659					}
14660						
14661					
14662					
14663				} else {
14664					var $scrollTopDistance = ($('#header-outer[data-mobile-fixed="1"]').length > 0) ? $hashObj.offset().top + 2 - $headerNavSpace + nectarDOMInfo.adminBarHeight : $hashObj.offset().top - nectarDOMInfo.adminBarHeight + 1;	
14665				}
14666
14667			} else {
14668				var $scrollTopDistance = $hashObj.offset().top - nectarDOMInfo.adminBarHeight + 1;
14669			}
14670
14671			if($('body[data-hhun="1"]').length > 0 && $('#header-outer[data-remove-fixed="1"]').length == 0) {
14672				//alter offset 
14673				if($('#header-outer.detached').length == 0) 
14674					$scrollTopDistance = $scrollTopDistance + $headerNavSpace;
14675			}
14676
14677			var $pageSubMenu = ($('.page-submenu[data-sticky="true"]').length > 0) ? $('.page-submenu').height() : 0;
14678			
14679			if($('body.material').length > 0 && 
14680				 $('#header-secondary-outer').length > 0 &&
14681				 $('body[data-hhun="1"]').length == 0 && 
14682				 $('#header-outer[data-remove-fixed="1"]').length == 0 && 
14683				 !$('body').hasClass('mobile')) { 
14684					 
14685					 var $headerSecondary = $('#header-secondary-outer').height();
14686					 
14687			 } else {
14688					 var $headerSecondary = 0;
14689			 }
14690			 
14691			nectar_scrollToY($scrollTopDistance - $pageSubMenu + $headerSecondary, 700, 'easeInOutQuint');
14692
14693		},$timeoutVar);
14694	}
14695}
14696
14697if($('body[data-animated-anchors="true"]').length > 0 || $('.single-product [data-gallery-style="left_thumb_sticky"]').length > 0) { 
14698
14699
14700+ function(t) {
14701    "use strict";
14702
14703    function s(e, i) {
14704        var r = t.proxy(this.process, this);
14705        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()
14706    }
14707
14708    function e(e) {
14709        return this.each(function() {
14710            var i = t(this),
14711                r = i.data("bs.scrollspy"),
14712                o = "object" == typeof e && e;
14713            r || i.data("bs.scrollspy", r = new s(this, o)), "string" == typeof e && r[e]()
14714        })
14715    }
14716    s.VERSION = "3.2.0", s.DEFAULTS = {
14717        offset: 10
14718    }, s.prototype.getScrollHeight = function() {
14719        return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
14720    }, s.prototype.refresh = function() {
14721        var s = "offset",
14722            e = 0;
14723        t.isWindow(this.$scrollElement[0]) || (s = "position", e = this.$scrollElement.scrollTop()), this.offsets = [], this.targets = [], this.scrollHeight = this.getScrollHeight();
14724        var i = this;
14725        this.$body.find(this.selector).map(function() {
14726            var i = t(this),
14727                r = i.data("target") || i.attr("href"),
14728                o = /^#./.test(r) && t(r);
14729            return o && o.length && o.is(":visible") && [
14730                [o[s]().top + e, r]
14731            ] || null
14732        }).sort(function(t, s) {
14733            return t[0] - s[0]
14734        }).each(function() {
14735            i.offsets.push(this[0]), i.targets.push(this[1])
14736        })
14737    }, s.prototype.process = function() {
14738    	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;
14739
14740        var t, s = this.$scrollElement.scrollTop() + this.options.offset + $pageSubMenu,
14741            e = this.getScrollHeight(),
14742            i = this.options.offset + e - this.$scrollElement.height() -$pageSubMenu,
14743            r = this.offsets,
14744            o = this.targets,
14745            l = this.activeTarget;
14746        if (this.scrollHeight != e && this.refresh(), s >= i) return l != (t = o[o.length - 1]) && this.activate(t);
14747        if (l && s <= r[0]) return l != (t = o[0]) && this.activate(t);
14748        for (t = r.length; t--;) l != o[t] && s >= r[t] && (!r[t + 1] || s <= r[t + 1]) && this.activate(o[t])
14749    }, s.prototype.activate = function(s) {
14750        this.activeTarget = s, t(this.selector).parentsUntil(this.options.target, ".current-menu-item").removeClass("current-menu-item").removeClass('sfHover');
14751        var e = this.selector + '[data-target="' + s + '"],' + this.selector + '[href="' + s + '"]',
14752            i = t(e).parents("li").addClass("current-menu-item");
14753        i.parent(".dropdown-menu").length && (i = i.closest("li.dropdown").addClass("current-menu-item")), i.trigger("activate.bs.scrollspy")
14754    };
14755    var i = t.fn.scrollspy;
14756    t.fn.scrollspy = e, t.fn.scrollspy.Constructor = s, t.fn.scrollspy.noConflict = function() {
14757        return t.fn.scrollspy = i, this
14758    }
14759}(jQuery);
14760
14761
14762var shrinkNum = 6;	
14763if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
14764headerPadding2 = headerPadding - headerPadding/1.8;
14765
14766setTimeout(scrollSpyInit,200);
14767
14768var $animatedScrollingTimeout;
14769
14770$('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){
14771	
14772
14773
14774	var $hash = $(this).prop("hash");	
14775
14776	$('body').addClass('animated-scrolling');
14777	clearTimeout($animatedScrollingTimeout);
14778	$animatedScrollingTimeout = setTimeout(function(){ $('body').removeClass('animated-scrolling'); },850);
14779	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 0 : $('#header-space').outerHeight();
14780	if( $('.page-template-template-no-header-footer').length > 0 || $('.page-template-template-no-header').length > 0 ) { $headerNavSpace = 0; }
14781
14782	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') {
14783
14784
14785		//update hash
14786		if(!$(this).hasClass('skip-hash')) {
14787			if(history.pushState) {
14788			    history.pushState(null, null, $hash);
14789			}
14790			else {
14791			    location.hash = $hash;
14792			}
14793		}
14794
14795		if($(this).parents('ul').length > 0) { 
14796			$(this).parents('ul').find('li').removeClass('current-menu-item');
14797		}
14798
14799		//side widget area click
14800		if($(this).parents('#slide-out-widget-area').length > 0){
14801			
14802			if($('body.material[data-slide-out-widget-area-style="slide-out-from-right"].material-ocm-open').length > 0) {
14803				$('body > .slide_out_area_close').addClass('non-human-allowed').trigger('click');
14804				//scroll
14805				var $clickedLinkStore = $(this);
14806				setTimeout(function(){
14807					$clickedLinkStore.trigger('click');
14808				},1000);
14809				
14810			} else {
14811				$('#slide-out-widget-area .slide_out_area_close').addClass('non-human-allowed').trigger('click');
14812			}
14813			
14814			setTimeout(function(){
14815				if($('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length > 0) {
14816					$('body > .slide_out_area_close').removeClass('non-human-allowed');
14817
14818				} else {
14819					$('#slide-out-widget-area .slide_out_area_close').removeClass('non-human-allowed');
14820				}
14821			},100);
14822		}
14823
14824		//mobile menu click
14825		if($(this).parents('#mobile-menu').length > 0) $('#toggle-nav').trigger('click');
14826		var $mobileMenuHeight = ($(this).parents('#mobile-menu').length > 0) ? $(this).parents('#mobile-menu').height() : null;
14827		
14828		$timeoutVar = 1;
14829		if($('.nectar-box-roll').length > 0 && $('.container-wrap.bottomBoxOut').length > 0) {
14830			boxRoll(null,-1);
14831			$timeoutVar = 2050;
14832		} 
14833
14834		var $that = $(this);
14835
14836		setTimeout(function(){
14837
14838			//scrolling
14839			var $headerSpace = ($('body[data-permanent-transparent="1"]').length > 0) ? 0 : parseInt($headerNavSpace);
14840			
14841			if( $('body[data-permanent-transparent="1"]').length == 0 ) {
14842				
14843				if(!$('body').hasClass('mobile')){
14844					$resize = ($('#header-outer[data-header-resize="0"]').length > 0) ? 0 : parseInt(shrinkNum) + headerPadding2*2;
14845					if($('#header-outer[data-remove-fixed="1"]').length > 0) { 
14846						$headerNavSpace = 0;
14847					}
14848					
14849					var $scrollTopDistance =  $($hash).offset().top - $mobileMenuHeight - parseInt($headerNavSpace) +$resize + 3 - nectarDOMInfo.adminBarHeight;
14850					
14851					
14852					//condesne
14853					if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
14854							var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
14855							var $secondaryHeader = $('#header-secondary-outer');
14856							var $headerHeightStored = $('#header-outer').height();
14857							
14858							$headerHeightCondensed = $headerHeightStored - ( parseInt($headerSpan9.height()) + parseInt($('#header-outer #logo').css('margin-top')) );
14859						
14860							$scrollTopDistance =  $($hash).offset().top - parseInt($headerNavSpace) + $headerHeightCondensed - nectarDOMInfo.adminBarHeight;
14861					}
14862					
14863					
14864				} else {
14865					var $scrollTopDistance = ($('#header-outer[data-mobile-fixed="1"]').length > 0) ? $($hash).offset().top + 2 - $headerNavSpace + nectarDOMInfo.adminBarHeight : $($hash).offset().top - $mobileMenuHeight - nectarDOMInfo.adminBarHeight + 1;	
14866				}
14867
14868			} else {
14869				var $scrollTopDistance = $($hash).offset().top - nectarDOMInfo.adminBarHeight + 1;
14870			}
14871
14872			if($('body[data-hhun="1"]').length > 0 && $('#header-outer[data-remove-fixed="1"]').length == 0) {
14873				//alter offset 
14874				if($('#header-outer.detached').length == 0 || $that.parents('.page-submenu[data-sticky="true"]').length > 0) 
14875					$scrollTopDistance = $scrollTopDistance + $headerNavSpace;
14876
14877				//hide top header
14878				if($that.parents('.page-submenu[data-sticky="true"]').length > 0) { 
14879					$('#header-outer.detached').addClass('invisible');
14880					$('.page-submenu').addClass('header-not-visible').css('transform','translateY(0px)');
14881				}
14882			} 
14883
14884			var $pageSubMenu = ($that.parents('.page-submenu[data-sticky="true"]').length > 0) ? $that.parents('.page-submenu').height() : 0;
14885			
14886			 if($('body.material').length > 0 && 
14887			 		$('#header-secondary-outer').length > 0 &&
14888			    $('body[data-hhun="1"]').length == 0 && 
14889			    $('#header-outer[data-remove-fixed="1"]').length == 0 && 
14890					!$('body').hasClass('mobile')) { 
14891						
14892						var $headerSecondary = $('#header-secondary-outer').height();
14893						
14894				} else {
14895						var $headerSecondary = 0;
14896				}
14897
14898			nectar_scrollToY($scrollTopDistance - $pageSubMenu + $headerSecondary, 700, 'easeInOutQuint');
14899			
14900
14901		},$timeoutVar);
14902		
14903
14904		e.preventDefault();
14905
14906	}
14907
14908	if($hash == '#top') {
14909		//side widget area click
14910		if($(this).parents('#slide-out-widget-area').length > 0){
14911			$('#slide-out-widget-area .slide_out_area_close').trigger('click');
14912		}
14913	}
14914
14915
14916});
14917
14918
14919
14920}
14921
14922
14923
14924
14925function searchResultMasonry() {
14926	var $searchContainer = $('#search-results');
14927	var $dividerNum = ($searchContainer.is('[data-layout="masonry-no-sidebar"]')) ? 4 : 3;
14928	
14929	$searchContainer.imagesLoaded(function(){
14930		
14931		$searchContainer.isotope({
14932			 itemSelector: '.result',
14933			 layoutMode: 'packery',
14934			 packery: { columnWidth: $('#search-results').width() / $dividerNum }
14935		});
14936		
14937		$searchContainer.find('article').css('opacity','1');
14938		
14939	});
14940				
14941
14942	$(window).resize(function(){
14943		 $searchContainer.isotope({
14944				layoutMode: 'packery',
14945				packery: { columnWidth: $('#search-results').width() / $dividerNum }
14946		 });
14947	});
14948	
14949}
14950
14951if($('body.search-results').length > 0 && $('#search-results article').length > 0 && $('#search-results[data-layout="list-no-sidebar"]').length == 0) { searchResultMasonry(); }
14952
14953
14954
14955	//portfolio colors
14956	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 ) {
14957		var portfolioColorCss = '';
14958		$('.portfolio-items .col').each(function(){
14959			var $titleColor = $(this).attr('data-title-color');
14960			var $subTitleColor = $(this).attr('data-subtitle-color');
14961
14962			 if($titleColor.length > 0 ) { 
14963			 	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; } ';
14964			 	portfolioColorCss += ' .portfolio-items[data-ps="8"] .col[data-title-color="'+$titleColor+'"] .line { background-color: '+$titleColor+'; }';
14965			 	portfolioColorCss += '.portfolio-items[data-ps="8"] .col[data-title-color="'+$titleColor+'"] .next-arrow line { stroke: '+$titleColor+'; } ';
14966			 }
14967			 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+'; } ';
14968	
14969		});
14970
14971
14972		var head = document.head || document.getElementsByTagName('head')[0];
14973		var style = document.createElement('style');
14974
14975			style.type = 'text/css';
14976		if (style.styleSheet){
14977		  style.styleSheet.cssText = portfolioColorCss;
14978		} else {
14979		  style.appendChild(document.createTextNode(portfolioColorCss));
14980		}
14981
14982		head.appendChild(style);
14983	}
14984
14985	//bottom controls 2
14986	$('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(){
14987		$(this).addClass('mouse-leaving');
14988	});	
14989
14990	// masonryPortfolio
14991
14992	var $portfolio_containers = [];
14993
14994	$('.portfolio-items:not(.carousel)').each(function(i){
14995		$portfolio_containers[i] = $(this);
14996	});
14997
14998	function masonryPortfolioInit() {
14999
15000		$portfolio_containers = [];
15001		$('.portfolio-items:not(.carousel)').each(function(i){
15002			$portfolio_containers[i] = $(this);
15003		});
15004
15005		//// cache window
15006		var $window = jQuery(window);	
15007		
15008			
15009			$.each($portfolio_containers,function(i){
15010
15011				
15012				//// start up isotope with default settings
15013				$portfolio_containers[i].imagesLoaded(function(){
15014					
15015					//verify smooth scorlling
15016					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') } 
15017					
15018					//transformns enabled logic
15019					var $isoUseTransforms = true;
15020					
15021					//Panr 
15022					if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
15023
15024						$isoUseTransforms = true;
15025						
15026					}
15027
15028					piVertCenter();
15029
15030					//initial call to setup isotope
15031					var $layoutMode = ( $portfolio_containers[i].hasClass('masonry-items')) ? 'packery' : 'fitRows';
15032					var $startingFilter = ($portfolio_containers[i].attr('data-starting-filter') != '' && $portfolio_containers[i].attr('data-starting-filter') != 'default') ? '.' + $portfolio_containers[i].attr('data-starting-filter') : '*';
15033
15034					reLayout();
15035					
15036					$portfolio_containers[i].addClass('isotope-activated');
15037					
15038					$portfolio_containers[i].isotope({
15039					  itemSelector : '.element',
15040					  filter: $startingFilter,
15041					  layoutMode: $layoutMode,
15042					  transitionDuration: '0.6s',
15043					  packery: {
15044						 gutter: 0
15045					  }
15046					}).isotope( 'layout' );
15047					
15048					
15049					if($startingFilter != '*'){
15050						$('.portfolio-filters ul a[data-filter="'+$startingFilter+'"], .portfolio-filters-inline ul a[data-filter="'+$startingFilter+'"]').click();
15051					}
15052
15053					//call the reLayout to get things rollin'
15054					masonryZindex();
15055					setTimeout(function(){masonryZindex(); },800);
15056					
15057				
15058					
15059					//inside fwc fix
15060					if($portfolio_containers[i].parents('.full-width-content').length > 0) { setTimeout(function(){ fullWidthContentColumns(); },200);  }
15061
15062					//fadeout the loading animation
15063					$('.portfolio-loading').stop(true,true).fadeOut(200);
15064					
15065					//fadeIn items one by one
15066					if($portfolio_containers[i].find('.inner-wrap').attr('data-animation') == 'none') {
15067						$portfolio_containers[i].find('.inner-wrap').removeClass('animated');
15068					} 
15069
15070			
15071				});
15072				
15073
15074
15075			});//each
15076			
15077			if($portfolio_containers.length > 0) {
15078				$window.resize( reLayout );
15079
15080				$window.smartresize( function(){
15081					setTimeout(masonryZindex,700);
15082				});
15083			}
15084			
15085		
15086
15087	}
15088
15089	masonryPortfolioInit();
15090
15091	function portfolioLoadIn() {
15092
15093		$($fullscreenSelector+'.portfolio-items').each(function(){
15094
15095			var $portfolioOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '90%';
15096
15097			if($(this).find('.inner-wrap').attr('data-animation') == 'none') return;
15098		
15099			$(this).find('.col').each(function(i){
15100
15101				var $that = $(this);
15102
15103				//loaded visible
15104				if($(this).visible(true) || $(this).parents('#nectar_fullscreen_rows').length > 0) {
15105
15106					var $portfolioAnimationDelay = ($that.is('[data-masonry-type="photography"].masonry-items')) ? 90 : 115;
15107					$(this).delay($portfolioAnimationDelay *i).queue(function(next){
15108					    $(this).addClass("animated-in");
15109					    next();
15110					});
15111
15112				} else {
15113
15114					//not already visible
15115					var waypoint = new Waypoint({
15116		 			element: $that,
15117		 			 handler: function(direction) {
15118						
15119						if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 
15120						     waypoint.destroy();
15121						     return;
15122						}
15123
15124						var $portfolioAnimationDelay = ($that.is('[data-masonry-type="photography"].masonry-items')) ? 85 : 100;
15125					
15126						setTimeout(function(){
15127							$that.addClass("animated-in");
15128						},$portfolioAnimationDelay * $that.attr('data-delay-amount'));
15129					
15130						
15131						waypoint.destroy();
15132					},
15133					offset: $portfolioOffsetPos
15134
15135					}); //waypoint
15136				}
15137
15138			}); //each
15139		}); //each
15140					
15141	}
15142
15143
15144	//perspective load in
15145	if($('.portfolio-items .inner-wrap[data-animation="perspective"]').length > 0 || $('.posts-container[data-load-animation="perspective"]').length > 0) {
15146
15147		var lastScrollTop = $(window).scrollTop();
15148
15149		$('.portfolio-items, .posts-container[data-load-animation="perspective"]').css('perspective-origin','50% '+ (lastScrollTop + $(window).height()) + 'px');
15150
15151		requestAnimationFrame(updatePerspectiveOrigin);
15152		
15153		function updatePerspectiveOrigin() {
15154
15155			var scrollTop = $(window).scrollTop();
15156
15157			if (lastScrollTop === scrollTop) {
15158				requestAnimationFrame(updatePerspectiveOrigin);
15159				return;
15160			} else {
15161				lastScrollTop = scrollTop;
15162				$('.portfolio-items,.posts-container[data-load-animation="perspective"]').css('perspective-origin','50% '+ (lastScrollTop + $(window).height()) + 'px');
15163				requestAnimationFrame(updatePerspectiveOrigin);
15164			}
15165		}
15166
15167	}
15168
15169	var mediaQuerySize;
15170	function reLayout() {
15171
15172		clearTimeout(clearIsoAnimation);
15173	    $('.portfolio-items .col').addClass('no-transition');
15174	    clearIsoAnimation = setTimeout(function(){  $('.portfolio-items .col').removeClass('no-transition'); },700); 
15175
15176		var windowSize = $window.width();
15177		var masonryObj;
15178		var masonryObjHolder = [];
15179
15180
15181		//user defined cols
15182		var userDefinedColWidth;
15183
15184		$.each($portfolio_containers,function(i,v){
15185
15186			if( $portfolio_containers[i].attr('data-user-defined-cols') == 'span4') {
15187				userDefinedColWidth = 3
15188			} 
15189			
15190			else if( $portfolio_containers[i].attr('data-user-defined-cols') == 'span3') {
15191				userDefinedColWidth = 4
15192			} 
15193			
15194			var isFullWidth = $portfolio_containers[i].attr('data-col-num') == 'elastic';
15195			
15196			
15197			//chrome 33 approved method for getting column sizing
15198			if(window.innerWidth > 1600){
15199				
15200				if($portfolio_containers[i].hasClass('fullwidth-constrained')) {
15201					if($portfolio_containers[i].is('[data-masonry-type="photography"]')) {
15202						mediaQuerySize = 'three';
15203					} else {
15204						mediaQuerySize = 'four';
15205					}
15206	
15207				} else {
15208					if($portfolio_containers[i].hasClass('constrain-max-cols')) {
15209						mediaQuerySize = 'four';
15210					} else {
15211						mediaQuerySize = 'five';
15212					}
15213				}
15214				
15215			} else if(window.innerWidth <= 1600 && window.innerWidth > 1300){
15216
15217				if($portfolio_containers[i].hasClass('fullwidth-constrained')) {
15218					if($portfolio_containers[i].is('[data-masonry-type="photography"]')) {
15219						mediaQuerySize = 'three';
15220					} else {
15221						mediaQuerySize = 'four';
15222					}
15223				} else {
15224					mediaQuerySize = 'four';
15225				}
15226			} else if(window.innerWidth <= 1300 && window.innerWidth > 990){
15227				
15228				if($portfolio_containers[i].hasClass('constrain-max-cols')) {
15229					mediaQuerySize = 'four';
15230				} else {
15231					mediaQuerySize = 'three';
15232				}
15233				
15234			} else if(window.innerWidth <= 990 && window.innerWidth > 470){
15235				mediaQuerySize = 'two';
15236			} else if(window.innerWidth <= 470){
15237				mediaQuerySize = 'one';
15238			}
15239			
15240			//boxed
15241			if($('#boxed').length > 0) {
15242				if(window.innerWidth > 1300){
15243					mediaQuerySize = 'four';
15244				} else if(window.innerWidth < 1300 && window.innerWidth > 990){
15245					
15246					if($portfolio_containers[i].hasClass('constrain-max-cols')) {
15247						mediaQuerySize = 'four';
15248					} else {
15249						mediaQuerySize = 'three';
15250					}
15251
15252				} else if(window.innerWidth < 990){
15253					mediaQuerySize = 'one';
15254				}
15255				
15256			}
15257			
15258			//change masonry columns depending on screen size
15259			var colWidth;
15260			
15261			switch (mediaQuerySize) {
15262				case 'five':
15263					(isFullWidth) ? colWidth = 5 : colWidth = userDefinedColWidth;
15264					//change cols for photography
15265					if(isFullWidth && $portfolio_containers[i].is('[data-masonry-type="photography"]')) colWidth = 6;
15266
15267					masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
15268				break;
15269				
15270				case 'four':
15271					(isFullWidth) ? colWidth = 4 : colWidth = userDefinedColWidth;
15272					//change cols for photography
15273					if(isFullWidth && $portfolio_containers[i].is('[data-masonry-type="photography"]')) colWidth = 5;
15274
15275					masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
15276				break;
15277				
15278				case 'three':
15279					(isFullWidth) ? colWidth = 3 : colWidth = userDefinedColWidth;
15280					//change cols for photography
15281					if(isFullWidth && $portfolio_containers[i].is('[data-masonry-type="photography"]')) colWidth = 4;
15282					
15283					masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
15284				break;
15285				
15286				case 'two':
15287					masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / 2) };
15288				break;
15289				
15290				case 'one':
15291					masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / 1) };
15292				break;
15293			}
15294
15295
15296			 //set widths
15297			 portfolioItemWidths(i,v);
15298			
15299
15300			//sizing for large items
15301			if(!$portfolio_containers[i].is('[data-bypass-cropping="true"]')) {
15302				
15303				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) {
15304
15305					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;
15306					var multipler = (window.innerWidth > 470) ? 2 : 1;
15307
15308					//reset height for calcs
15309					$itemClassForSizing = 'regular';
15310
15311					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) {
15312						$itemClassForSizing = 'wide';
15313					} 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) {
15314						$itemClassForSizing = 'wide_tall';
15315						multipler = 1;
15316					} 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) {
15317						$itemClassForSizing = 'tall';
15318						multipler = 1;
15319					}
15320
15321				    $portfolio_containers[i].find('.col.elastic-portfolio-item.'+$itemClassForSizing+' img').css('height','auto');
15322
15323					var tallColHeight = $portfolio_containers[i].find('.col.elastic-portfolio-item.'+$itemClassForSizing+':visible img').height();
15324					
15325					 $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');
15326					 $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img:not(.custom-thumbnail)').css('height',(tallColHeight*multipler) + ($gutterSize*2));
15327
15328					 if($itemClassForSizing == 'regular' || $itemClassForSizing == 'wide') {
15329					 	$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);
15330					 } else {
15331					 	$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));
15332					 }
15333
15334					 $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 );
15335					 
15336					 if($itemClassForSizing == 'regular' || $itemClassForSizing == 'wide') {
15337						 $portfolio_containers[i].find('.col.elastic-portfolio-item.regular .parallaxImg, .col.elastic-portfolio-item.wide .parallaxImg').css('height',tallColHeight);
15338					} else {
15339					 	 $portfolio_containers[i].find('.col.elastic-portfolio-item.regular .parallaxImg, .col.elastic-portfolio-item.wide .parallaxImg').css('height',(tallColHeight/2) - ($gutterSize*2));
15340					 }
15341
15342				} else {
15343					$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');
15344				}
15345			
15346			} //bypass cropping option
15347
15348			//non masonry
15349			if($portfolio_containers[i].hasClass('no-masonry') && $portfolio_containers[i].find('.col:first:visible').length > 0 && $portfolio_containers[i].parents('.wpb_gallery').length == 0){
15350			  
15351				//skip style 9
15352				if( !$portfolio_containers[i].is('[data-ps="9"]') && !$portfolio_containers[i].is('[data-bypass-cropping="true"]') ) {
15353
15354				   	//reset height for calcs
15355			   	   $portfolio_containers[i].find('.col img').css('height','auto');
15356			   	   var tallColHeight = $portfolio_containers[i].find('.col:first:visible img').height();
15357			   	   $portfolio_containers[i].find('.col img:not(.custom-thumbnail)').css('height',tallColHeight);
15358			   	   $portfolio_containers[i].find('.col .parallaxImg').css('height',tallColHeight);
15359				 }
15360				 
15361			}
15362	
15363
15364
15365			masonryObjHolder[i] = masonryObj;
15366			
15367			if($portfolio_containers[i].isotope()) $portfolio_containers[i].isotope( 'layout' ); 
15368				
15369			
15370
15371		}); //each
15372	
15373	}
15374
15375	function portfolioItemWidths(i,v) {
15376		// passing each index value where function is called first to avoid nested loops
15377
15378		 		var isFullWidth = $portfolio_containers[i].attr('data-col-num') == 'elastic';
15379
15380		 		if(isFullWidth) { 
15381
15382				 	var $colSize = 4;
15383				 	var $mult = (mediaQuerySize == 'one') ? 1 : 2;
15384				 	if(mediaQuerySize == 'five') $colSize = 5;
15385				 	if(mediaQuerySize == 'four') $colSize = 4;
15386				 	if(mediaQuerySize == 'three') $colSize = 3;
15387				 	if(mediaQuerySize == 'two') $colSize = 2;
15388				 	if(mediaQuerySize == 'one') $colSize = 1;
15389				 	if($(v).is('[data-ps="6"]') && $colSize == 5) $colSize = 4;
15390
15391				 	//photography
15392				 	if(isFullWidth && $portfolio_containers[i].is('[data-masonry-type="photography"]') && !$portfolio_containers[i].hasClass('no-masonry')) {
15393				 		if(mediaQuerySize == 'five') $colSize = 6;
15394				 		if(mediaQuerySize == 'four') $colSize = 5;
15395				 		if(mediaQuerySize == 'three') $colSize = 4;
15396				 	}
15397				 	
15398				 	if($(v).width() % $colSize == 0) {
15399					 	$(v).find('.elastic-portfolio-item:not(.wide):not(.wide_tall)').css('width',Math.floor($(v).width()/$colSize) +'px');
15400					 	$(v).find('.elastic-portfolio-item.wide, .elastic-portfolio-item.wide_tall').css('width',Math.floor($(v).width()/$colSize*$mult) +'px');
15401					 } else {
15402					 	var $loopEndNum = ($(window).width() > 1000) ? 6 : 3;
15403					 	if($portfolio_containers[i].hasClass('fullwidth-constrained') && $(window).width() > 1000) $loopEndNum = 4;
15404					 	//find closest number to give 0
15405					 	for(var i = 1; i<$loopEndNum; i++) {
15406
15407					 		if(($(v).width() - i) % $colSize == 0) {
15408					 			$(v).find('.elastic-portfolio-item:not(.wide):not(.wide_tall)').css('width',($(v).width()- i)/$colSize +'px');
15409					 			$(v).find('.elastic-portfolio-item.wide, .elastic-portfolio-item.wide_tall').css('width',($(v).width()-i)/$colSize*$mult +'px');
15410					 		}
15411
15412					 	}
15413					 }
15414
15415				} // isFullWidth
15416
15417	}
15418
15419	//z-index for masonry
15420	function masonryZindex(){
15421
15422		//escape if no browser support
15423		if($('body .portfolio-items:not(".carousel") > .col').length > 0 && $('body .portfolio-items:not(".carousel") > .col').offset().left) {
15424
15425			$('body .portfolio-items:not(".carousel")').each(function(){
15426
15427				var $coords = {};
15428				var $zindexRelation = {};
15429				var $that = $(this);
15430
15431				$(this).find('> .col').each(function(){
15432					var $itemOffset = $(this).offset();
15433					$itemOffset = $itemOffset.left;
15434
15435					$coords[$(this).index()] = $itemOffset;
15436					$(this).css('z-index',Math.abs(Math.floor($(this).offset().left/20)));
15437				});
15438
15439				var $corrdsArr = $.map($coords, function (value) { return value; });
15440
15441				$corrdsArr = removeDuplicates($corrdsArr);
15442				$corrdsArr.sort(function(a,b){return a-b});
15443
15444				for(var i = 0; i < $corrdsArr.length; i++){
15445					$zindexRelation[$corrdsArr[i]] = i; 
15446				}
15447		
15448				$.each($coords,function(k,v){
15449					
15450					var $zindex;
15451					var $coordCache = v;
15452					$.each($zindexRelation,function(k,v){
15453						if($coordCache == k) {
15454							$zindex = v;
15455						}
15456					});
15457				
15458					$that.find('> .col:eq('+k+')').attr('data-delay-amount',$zindex);
15459				});
15460
15461				
15462			});
15463			
15464			
15465			
15466		}
15467
15468
15469	}
15470
15471	function blogMasonryZindex(){
15472	
15473		//escape if no browser support
15474		if($('body .post-area .masonry-blog-item').length > 0 && $('body .post-area .masonry-blog-item').offset().left) {
15475		
15476			$('body .post-area.masonry').each(function(){
15477				
15478				var $coords = {};
15479				var $zindexRelation = {};
15480				var $that = $(this);
15481
15482				$(this).find('.masonry-blog-item').each(function(){
15483					var $itemOffset = $(this).offset();
15484					$itemOffset = $itemOffset.left;
15485
15486					$coords[$(this).index()] = $itemOffset;
15487					$(this).css('z-index',Math.abs(Math.floor($(this).offset().left/20)));
15488				});
15489
15490				var $corrdsArr = $.map($coords, function (value) { return value; });
15491
15492				$corrdsArr = removeDuplicates($corrdsArr);
15493				$corrdsArr.sort(function(a,b){return a-b});
15494		
15495				for(var i = 0; i < $corrdsArr.length; i++){
15496					$zindexRelation[$corrdsArr[i]] = i*1; 
15497				}
15498		
15499				$.each($coords,function(k,v){
15500					
15501					var $zindex;
15502					var $coordCache = v;
15503					$.each($zindexRelation,function(k,v){
15504						if($coordCache == k) {
15505							$zindex = v;
15506						}
15507					});
15508		
15509					$that.find('.masonry-blog-item:eq('+k+')').css('z-index',$zindex).attr('data-delay-amount',$zindex);
15510					
15511				});
15512			
15513			});
15514			
15515		}
15516		
15517	}
15518	
15519	function matrixToArray(matrix) {
15520	    return matrix.substr(7, matrix.length - 8).split(', ');
15521	}
15522	
15523	function removeDuplicates(inputArray) {
15524        var i;
15525        var len = inputArray.length;
15526        var outputArray = [];
15527        var temp = {};
15528
15529        for (i = 0; i < len; i++) {
15530            temp[inputArray[i]] = 0;
15531        }
15532        for (i in temp) {
15533            outputArray.push(i);
15534        }
15535        return outputArray;
15536    }
15537
15538    //// filter items when filter link is clicked
15539	var clearIsoAnimation = null;
15540	var $checkForScrollBar = null;
15541
15542
15543	//number portfolios so multiple sortable ones can work easily on same page
15544	$('.portfolio-items:not(".carousel")').each(function(i){
15545		$(this).attr('instance',i);
15546		$(this).parent().parent().find('div[class^=portfolio-filters]').attr('instance',i);
15547	});
15548
15549    function isoClickFilter(){
15550		 var $timeout;		 
15551		 if(window.innerWidth > 690 && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
15552		 	
15553			  
15554			 clearTimeout($timeout);
15555			 $timeout = setTimeout(function(){masonryZindex();  },600);
15556
15557			  
15558		 }
15559		  
15560		  var selector = $(this).attr('data-filter');
15561		  var $instance = $(this).parents('div[class^=portfolio-filters]').attr('instance');
15562
15563		  $.each($portfolio_containers,function(i){
15564		  	if($portfolio_containers[i].attr('instance') == $instance) { 
15565		  		$portfolio_containers[i].isotope({ filter: selector }).attr('data-current-cat',selector);
15566
15567		  		//fade in all incase user hasn't scrolled down yet
15568		  		if($portfolio_containers[i].find('.inner-wrap[data-animation="none"]').length == 0) {
15569			   		$portfolio_containers[i].find('.col').addClass('animated-in');
15570				}
15571		  	}
15572		  });
15573
15574
15575
15576
15577		  //active classes
15578		  $(this).parent().parent().find('li a').removeClass('active');
15579		  $(this).addClass('active');
15580		  
15581		  //update pp
15582		  if($('.portfolio-items a[rel^="prettyPhoto"]').length > 0) {
15583		  	setTimeout(updatePrettyPhotoGallery,170);
15584		  }
15585
15586		  else {
15587		  	setTimeout(updateMagPrettyPhotoGallery,170);
15588		  }
15589
15590		  return false;
15591	}
15592
15593	////filter event
15594	$('body').on('click','.portfolio-filters ul li a, .portfolio-filters-inline ul li a', isoClickFilter);
15595
15596
15597	function updatePrettyPhotoGallery(){
15598		$('.portfolio-items').each(function(){
15599
15600			if($(this).find('a[rel^="prettyPhoto"]').length > 0) {
15601
15602			var $unique_id = Math.floor(Math.random()*10000);
15603			var $currentCat = $(this).attr('data-current-cat');
15604			$(this).find('.col'+$currentCat).find('a[rel^="prettyPhoto"]').attr('rel','prettyPhoto['+$unique_id+'_sorted]');
15605			
15606			} 
15607			
15608		});
15609	}
15610
15611	function updateMagPrettyPhotoGallery(){
15612		$('.portfolio-items').each(function(){
15613
15614			var $currentCat = $(this).attr('data-current-cat');
15615			var $unique_id = Math.floor(Math.random()*10000);
15616			
15617			if($(this).is('[data-lightbox-only="true"]')){
15618				
15619					$(this).find('.col').each(function(){
15620		
15621						$(this).find('a.gallery').removeClass('gallery').removeClass('magnific');
15622						
15623						if($(this).is($currentCat)) {
15624							
15625							//parallax styles
15626							if($(this).find('.parallaxImg-wrap').length > 0) {
15627								
15628									if($('body[data-ls="fancybox"]').length > 0) {
15629										$(this).find('.work-item > a').attr('data-fancybox','group_'+$unique_id);
15630									} else {
15631										$(this).find('.work-item > a').addClass('gallery').addClass('magnific');
15632									}
15633									
15634							} else {
15635								//others
15636								
15637									if($('body[data-ls="fancybox"]').length > 0) {
15638										$(this).find('.work-item a').attr('data-fancybox','group_'+$unique_id);
15639									} else {
15640										$(this).find('.work-info a').addClass('gallery').addClass('magnific');
15641									}
15642									
15643							}
15644							
15645						}
15646		
15647					});
15648				
15649			}
15650			
15651			else if ($(this).find('.work-item.style-1').length > 0){
15652				
15653					$(this).find('.col').each(function(){
15654		
15655						$(this).find('a.gallery').removeClass('gallery').removeClass('magnific');
15656						
15657						if($(this).is($currentCat)) {
15658							
15659								if($('body[data-ls="fancybox"]').length > 0) {
15660									$(this).find('.work-info .vert-center a:first-of-type').attr('data-fancybox','group_'+$unique_id);
15661								} 
15662								else {
15663									$(this).find('.work-info .vert-center a:first-of-type').addClass('gallery').addClass('magnific');
15664								}
15665								
15666						}
15667		
15668					});
15669			}
15670			
15671		
15672			
15673		});
15674	}
15675
15676
15677
15678	var $blog_containers = [];
15679
15680	$('.posts-container').each(function(i){
15681		$blog_containers[i] = $(this);
15682	});
15683
15684  function masonryBlogInit() {
15685
15686		//// cache window
15687		var $window = jQuery(window);	
15688		
15689			
15690		$.each($blog_containers,function(i){
15691
15692			
15693				if($blog_containers[i].parent().hasClass('masonry') && !$blog_containers[i].parent().hasClass('auto_meta_overlaid_spaced')) { 
15694					
15695					$blog_containers[i].find('article').addClass('masonry-blog-item');
15696					
15697					if($blog_containers[i].parents('.masonry.classic').length > 0) {
15698						$blog_containers[i].find('article').prepend('<span class="bottom-line"></span>');
15699					}
15700					
15701					//move the meta to the bottom
15702					$blog_containers[i].find('article').each(function(){
15703						
15704						var $metaClone = $(this).find('.post-meta').clone();
15705
15706						$(this).find('.post-meta').remove();
15707
15708						if($blog_containers[i].parents('.post-area.meta_overlaid').length > 0){
15709							$(this).find('.post-header h2').after($metaClone);
15710						} else {
15711							$(this).find('.content-inner').after($metaClone);
15712						}
15713						
15714						$blog_containers[i].addClass('meta-moved');
15715						
15716					});
15717				
15718					
15719					if($blog_containers[i].parent().hasClass('masonry') && $blog_containers[i].parents('.blog-fullwidth-wrap').length > 0){
15720
15721						//page header animation fix
15722						if( $blog_containers[i].parents('.wpb_row').length > 0 ) $blog_containers[i].parents('.wpb_row').css('z-index',100);
15723
15724						if(!$blog_containers[i].parent().hasClass('meta_overlaid') && !$blog_containers[i].parent().hasClass('auto_meta_overlaid_spaced')) {
15725
15726							if($blog_containers[i].parent().hasClass('classic_enhanced')) {
15727								$blog_containers[i].parent().parents('.full-width-content').css({
15728									'padding' : '0px 0.2% 0px 2.4%'
15729								});
15730							} else {
15731								$blog_containers[i].parent().parents('.full-width-content').css({
15732									'padding' : '0px 0.2% 0px 3.2%'
15733								});
15734							}
15735							
15736						} else {
15737							$blog_containers[i].parent().parents('.full-width-content').addClass('meta-overlaid');
15738							$('.container-wrap').addClass('meta_overlaid_blog');
15739						}
15740
15741						fullWidthSections(); 
15742					}
15743					
15744					var $cols = 3;
15745					var $element = $blog_containers[i];
15746					
15747					if($blog_containers[i].find('img').length == 0) $element = $('<img />');
15748					
15749					imagesLoaded($element,function(instance){
15750						
15751						var $multiplier;
15752						
15753						if($('body').hasClass('mobile') || $blog_containers[i].parents('.post-area').hasClass('span_9')) {
15754							$cols = 2;
15755						}
15756
15757						//set img as BG if masonry classic enhanced
15758						if($blog_containers[i].parent().hasClass('classic_enhanced')){
15759							$blog_containers[i].find('.large_featured.has-post-thumbnail .post-featured-img, .wide_tall.has-post-thumbnail .post-featured-img').each(function(){
15760								var $src = $(this).find('img').attr('src');
15761								$(this).css('background-image','url('+$src+')');
15762							});
15763
15764							$blog_containers[i].find('.large_featured .nectar-flickity, .wide_tall .nectar-flickity').each(function(){
15765
15766								$(this).find('.cell').each(function(){
15767									var $src = $(this).find('img').attr('src');
15768									$(this).css('background-image','url('+$src+')');
15769								});
15770								
15771							});
15772						}
15773
15774						$cols = blogColumnNumbCalcs($blog_containers[i]);
15775						blogHeightCalcs($blog_containers[i], $cols);
15776
15777						if($blog_containers[i].parents('.post-area.meta_overlaid').length > 0) {
15778							$blog_containers[i].isotope({
15779							   itemSelector: 'article',
15780							   transitionDuration: '0s',
15781							   layoutMode: 'packery',
15782							   packery: { 
15783							   	 gutter: 0
15784							   	}
15785							}).isotope( 'layout' );
15786
15787						   
15788						} else if ($blog_containers[i].parents('.auto_meta_overlaid_spaced').length > 0) {
15789							
15790							$multiplier = .025;
15791							if($blog_containers[i].parents('.blog-fullwidth-wrap').length > 0) {
15792									$multiplier = .02;
15793							}
15794							
15795							$blog_containers[i].isotope({
15796								layoutMode: 'packery',
15797								transitionDuration: '0s',
15798								packery: {
15799									 gutter: 0
15800								}
15801						 });
15802						 
15803						}  else {
15804						   if($blog_containers[i].parent().hasClass('classic_enhanced')) {
15805							   	if($blog_containers[i].parents('.span_9.masonry').length == 0) {
15806							   		$multiplier = (window.innerWidth >= 1600) ? .015 : .02;
15807							   	} else {
15808							   		$multiplier = .04;
15809							    } 
15810						    }
15811							else {
15812 								 		$multiplier = ($blog_containers[i].parents('.span_9.masonry').length == 0) ? .03: .055;
15813 							 }
15814						   
15815							$blog_containers[i].isotope({
15816							   itemSelector: 'article',
15817							   transitionDuration: '0s',
15818							   layoutMode: 'packery',
15819							   packery: { 
15820							   	 gutter: $blog_containers[i].parents('.post-area').width()*$multiplier
15821							   	}
15822							}).isotope( 'layout' );
15823						}
15824
15825						blogLoadIn($blog_containers[i]);
15826						flickityBlogInit();
15827						
15828						$(window).trigger('resize');
15829
15830							
15831					});
15832					
15833					$(window).resize(function(){
15834						
15835
15836					   //size all items in grid 
15837					   //sizing for large items
15838						 if(typeof $blog_containers[i] !== 'undefined') { 
15839							  
15840								var $multiplier;
15841								
15842							  $cols = blogColumnNumbCalcs($blog_containers[i]);
15843								blogHeightCalcs($blog_containers[i], $cols);
15844								
15845								if($blog_containers[i].parents('.post-area.meta_overlaid').length > 0) {
15846								
15847								    $blog_containers[i].isotope({
15848								      layoutMode: 'packery',
15849								      packery: {
15850								      	 gutter: 0
15851								      }
15852								   });
15853								} else if ($blog_containers[i].parents('.auto_meta_overlaid_spaced').length > 0) {
15854									
15855									$multiplier = .025;
15856									if($blog_containers[i].parents('.blog-fullwidth-wrap').length > 0) {
15857											$multiplier = .02;
15858									}
15859									
15860									$blog_containers[i].isotope({
15861										layoutMode: 'packery',
15862										transitionDuration: '0s',
15863										packery: {
15864											 gutter: 0
15865										}
15866								 });
15867								} else {
15868								   
15869								   if($blog_containers[i].parent().hasClass('classic_enhanced')) {
15870								   		if($blog_containers[i].parents('.span_9.masonry').length == 0) {
15871									   		$multiplier = (window.innerWidth >= 1600) ? .015 : .02;
15872									   	} else {
15873									   		$multiplier = .04;
15874									    } 
15875								   } else {
15876										 		$multiplier = ($blog_containers[i].parents('.span_9.masonry').length == 0) ? .03: .055;
15877												if($blog_containers[i].parents('.blog-fullwidth-wrap').length > 0) {
15878														$multiplier = .02;
15879												}
15880									 } 
15881								  
15882								   $blog_containers[i].isotope({
15883								   	layoutMode: 'packery',
15884								      packery: { 
15885								      	gutter: $blog_containers[i].parents('.post-area').width()*$multiplier
15886								      }
15887								   });
15888								}
15889								
15890							} // if $blog_containers[i]
15891
15892					});
15893					
15894					
15895			    } else {
15896			    	blogLoadIn($blog_containers[i]);
15897			    }
15898
15899		});
15900		
15901		//set z-index / animation order only once
15902		setTimeout(blogMasonryZindex,700);
15903		$window.smartresize( function(){
15904			setTimeout(blogMasonryZindex,700);
15905		});
15906		
15907	}
15908	
15909	masonryBlogInit();
15910
15911	function blogLoadIn(post_container){
15912
15913
15914		if(post_container.attr('data-load-animation') == 'none') {
15915		
15916			post_container.find('.inner-wrap').removeClass('animated');
15917
15918		} else {
15919
15920			post_container.find('article').each(function(i){
15921
15922				//loaded visible
15923				if($(this).visible(true)) {
15924
15925					$(this).delay(110*i).queue(function(next){
15926					    $(this).addClass("animated-in");
15927					    next();
15928					});
15929
15930
15931				} else {
15932					//not already visible
15933					var $that = $(this);
15934					var waypoint = new Waypoint({
15935
15936			 			element: $that,
15937			 			 handler: function(direction) {
15938							
15939							setTimeout(function(){
15940							    $that.addClass("animated-in");
15941							},80*$that.attr('data-delay-amount'));
15942
15943							waypoint.destroy();
15944						},
15945						offset: '90%'
15946
15947					}); 
15948				}
15949
15950
15951			});
15952	
15953			
15954		}
15955
15956	}
15957
15958	function blogHeightCalcs($posts_container, cols) {
15959		if( $posts_container.parent().hasClass('meta_overlaid') && $posts_container.find('article[class*="regular"]').length > 0) {
15960
15961			//widths
15962			$.each($posts_container,function(i,v){
15963			 	var $colSize = 4;
15964			 	var $mult = (cols == 1) ? 1 : 2;
15965
15966			 	//check if higher than IE9 -- bugs out with width calc
15967			 	if($('html.no-csstransitions').length == 0) {
15968			 		$(v).find('article[class*="regular"]').css('width',Math.floor($(v).width()/cols) +'px');
15969			 		$(v).find('article[class*="tall"]').css('width',Math.floor($(v).width()/cols*$mult) +'px');
15970			 	} else {
15971			 		$('.post-area.masonry').css('width','100%');
15972			 	}
15973			 	
15974			 	
15975			 });
15976
15977			   //reset height for calcs
15978			   $posts_container.find('article[class*="regular"] img').css('height','auto');
15979
15980			   var tallColHeight = Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote") img').first().height());
15981			   var multipler = (window.innerWidth > 690) ? 2 : 1 ;
15982			   $posts_container.find('article[class*="tall"] img, .article.wide img, article.regular img').removeClass('auto-height');
15983			   $posts_container.find('article[class*="tall"] img').css('height',(tallColHeight*multipler));
15984			   $posts_container.find('article[class*="regular"] img').css('height',(tallColHeight));
15985			   //quote/links
15986			   $posts_container.find('article.regular.format-link,article.regular.format-quote').each(function(){
15987
15988			   		if(window.innerWidth > 690) {
15989			   			$(this).css({
15990			  	 			'height': tallColHeight
15991			   			});
15992			   		} else {
15993			   			$(this).css({
15994			  	 			'height': 'auto'
15995			   			});			 		
15996			   		}
15997			  	 	
15998			   	});
15999
16000
16001		} else {
16002			$posts_container.find('article[class*="tall"] img, article.regular img').addClass('auto-height');
16003		}
16004
16005
16006		if( $posts_container.parent().hasClass('classic_enhanced') && $posts_container.find('article[class*="regular"]').length > 0) {
16007			
16008			if($(window).width() > 690 ) {
16009				classicEnhancedSizing($posts_container.find('article:not(.large_featured):not(.wide_tall)'));
16010			}
16011			else { 
16012				classicEnhancedSizing($posts_container.find('article:not(.wide_tall)'));
16013			}
16014
16015			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;
16016
16017			if($(window).width() > 690 ) {
16018				$posts_container.find('article.large_featured, article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
16019			}
16020			else {
16021				$posts_container.find('article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
16022			}
16023
16024		//for when no regular articles exist	
16025		} else if( $posts_container.parent().hasClass('classic_enhanced') && $posts_container.find('article[class*="regular"]').length == 0) {
16026			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;
16027
16028			if($(window).width() > 690 ) {
16029				$posts_container.find('article.large_featured, article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
16030			}
16031			else {
16032				$posts_container.find('article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
16033			}
16034		}
16035
16036		//IE9 fix
16037		if($('html.no-csstransitions').length > 0) 		
16038			$('.post-area.masonry').css('width','100%');
16039			 	
16040			 	
16041	}
16042
16043	function classicEnhancedSizing(elements) {
16044
16045		var tallestCol = 0;
16046		elements.find('.article-content-wrap').css('height','auto');
16047		elements.filter('.has-post-thumbnail').each(function(){
16048			($(this).find('.article-content-wrap').outerHeight(true) > tallestCol) ? tallestCol = $(this).find('.article-content-wrap').outerHeight(true) : tallestCol = tallestCol;
16049		});	
16050		
16051		elements.filter('.has-post-thumbnail').find('.article-content-wrap').css('height',(tallestCol));
16052
16053	}
16054
16055
16056	function blogStickySS() {
16057		$('#sidebar[data-nectar-ss="true"], #sidebar[data-nectar-ss="1"]').each(function(){
16058
16059			//padding from top of screen
16060			var $ssExtraTopSpace = 50;
16061
16062			if($('#header-outer[data-remove-fixed="0"]').length > 0 && $('body[data-hhun="1"]').length == 0 && $('#header-outer[data-format="left-header"]').length == 0) { 
16063			 	$ssExtraTopSpace += $('#header-outer').outerHeight();	
16064				
16065				//resize effect
16066				if($('#header-outer[data-shrink-num][data-header-resize="1"]').length > 0 ) {
16067					 var shrinkNum = 6;		
16068					 var headerPadding2 = parseInt($('#header-outer').attr('data-padding')) - parseInt($('#header-outer').attr('data-padding'))/1.8;
16069					 shrinkNum = $('#header-outer').attr('data-shrink-num');
16070					 $ssExtraTopSpace -= shrinkNum;
16071					 $ssExtraTopSpace -= headerPadding2;
16072				}
16073				
16074				//condesne
16075				if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
16076					
16077						var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
16078						var $secondaryHeader = $('#header-secondary-outer');
16079						
16080						$ssExtraTopSpace = 50;
16081						$ssExtraTopSpace += $('#header-outer').height() - (parseInt($headerSpan9.position().top) - parseInt($('#header-outer #logo').css('margin-top')) ) - parseInt(nectarDOMInfo.secondaryHeaderHeight);
16082				}
16083				
16084
16085			}
16086
16087			if($('#wpadminbar').length > 0) {
16088				$ssExtraTopSpace += $('#wpadminbar').outerHeight();
16089			}
16090
16091 			if($('#header-outer').attr('data-using-secondary') == '1') {
16092				$ssExtraTopSpace += $('#header-secondary-outer').outerHeight();
16093			}
16094			
16095			if($(this).parents('.wpb_widgetised_column').length > 0) {
16096				
16097				if($('body.vc_editor').length > 0) {
16098
16099				} else {
16100						$(this).parents('.wpb_column').theiaStickySidebar({
16101							additionalMarginTop: $ssExtraTopSpace,
16102							updateSidebarHeight: false
16103						});
16104				}
16105				
16106			} 
16107			
16108			else {
16109				$(this).theiaStickySidebar({
16110			      additionalMarginTop: $ssExtraTopSpace,
16111						updateSidebarHeight: false
16112			    });
16113			}
16114			
16115		});
16116	}
16117
16118	if( $().theiaStickySidebar ) {
16119		blogStickySS();
16120	}
16121
16122	var blogMediaQuerySize;
16123	function blogColumnNumbCalcs(post_container){
16124		
16125			 var $cols = 3;
16126				
16127		   if($('body').hasClass('mobile') && window.innerWidth < 990 || post_container.parents('.post-area').hasClass('span_9') && post_container.parents('.post-area.meta_overlaid').length == 0) {
16128			   $cols = 2;
16129		   } 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 ){
16130		   		
16131				var windowSize = $(window).width();
16132
16133				
16134				if(window.innerWidth >= 1600){
16135					blogMediaQuerySize = (post_container.parents('.post-area.meta_overlaid').length > 0) ? 'four' :'five';
16136				} else if(window.innerWidth < 1600 && window.innerWidth >= 1300){
16137					blogMediaQuerySize = 'four';
16138				} else if(window.innerWidth < 1300 && window.innerWidth >= 990){
16139					blogMediaQuerySize = (post_container.parents('.post-area.meta_overlaid').length > 0) ? 'four' :'three';
16140				} else if(window.innerWidth < 990 && window.innerWidth >= 470){
16141					blogMediaQuerySize = 'two';
16142				} else if(window.innerWidth < 470){
16143					blogMediaQuerySize = (post_container.parents('.post-area.meta_overlaid').length > 0) ? 'two' :'one';
16144				}
16145			
16146				
16147				//boxed
16148				if($('#boxed').length > 0) {
16149					if(window.innerWidth > 1300){
16150						blogMediaQuerySize = 'four';
16151					} else if(window.innerWidth < 1300 && window.innerWidth > 990){
16152						blogMediaQuerySize = (post_container.parents('.post-area.meta_overlaid').length > 0) ? 'four' :'three';
16153					} else if(window.innerWidth < 990){
16154						blogMediaQuerySize = (post_container.parents('.post-area.meta_overlaid').length > 0) ? 'two' :'one';
16155					}
16156					
16157				}
16158				
16159				
16160				switch (blogMediaQuerySize) {
16161					case 'five':
16162						$cols = 5;
16163					break;
16164					
16165					case 'four':
16166						$cols = 4;
16167					break;
16168					
16169					case 'three':
16170						$cols = 3;
16171					break;
16172					
16173					case 'two':
16174						$cols = 2;
16175					break;
16176					
16177					case 'one':
16178						$cols = 1;
16179					break;
16180				}
16181		   		
16182			
16183		   } else {
16184
16185		   	   $cols = 3;
16186		   }
16187
16188		   return $cols;
16189
16190	}
16191
16192
16193var shrinkNum = 6;
16194		
16195if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
16196
16197headerPadding2 = headerPadding - headerPadding/1.8;
16198
16199$('body').on('click','.section-down-arrow',function(){
16200	
16201	if($(this).parents('.nectar-box-roll').length > 0) return false;
16202
16203	var $currentSection = $(this).parents('#page-header-bg');
16204	var $topDistance = $currentSection.height();
16205	var $offset = ($currentSection.parents('.first-section').length == 0 || $('body[data-transparent-header="false"]').length > 0) ? $currentSection.offset().top : 0;
16206	var $bodyBorderSize = ($('.body-border-top').length > 0 && $(window).width() > 1000) ? $('.body-border-top').height(): 0;
16207	var $headerNavSpace = ($('body[data-header-format="left-header"]').length > 0) ? 0 : $('#header-space').height();
16208	
16209	var $materialSecondary = 0;
16210	if($('body.material').length > 0 && $('#header-secondary-outer').length > 0) { $materialSecondary = $('#header-secondary-outer').height(); }
16211	
16212	if($('body[data-permanent-transparent="1"]').length == 0) {
16213		//regular
16214		if(!$('body').hasClass('mobile')){
16215			
16216			if($('body[data-hhun="1"]').length > 0 && $('#header-outer[data-remove-fixed="1"]').length == 0) {
16217				$('body,html').stop().animate({
16218					scrollTop: parseInt($topDistance) + $offset + 2 - $bodyBorderSize*2
16219				},1000,'easeInOutCubic')
16220			} 
16221			else {
16222				
16223				$resize = ($('#header-outer[data-header-resize="0"]').length > 0) ? 0 : parseInt(shrinkNum) + headerPadding2*2;
16224				if($('#header-outer[data-remove-fixed="1"]').length > 0) { 
16225					$headerNavSpace = 0;
16226					$offset = 0;
16227				}
16228					
16229				//condesne
16230				if($('body.mobile').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
16231					
16232						var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
16233						var $secondaryHeader = $('#header-secondary-outer');
16234						
16235						$headerNavSpace = $('#header-outer').height() - (parseInt($headerSpan9.position().top) - parseInt($('#header-outer #logo').css('margin-top')) ) - parseInt(nectarDOMInfo.secondaryHeaderHeight);
16236				}
16237				
16238				
16239				$('body,html').stop().animate({
16240					scrollTop: parseInt($topDistance - $headerNavSpace) +$resize + 3 + $offset + $materialSecondary
16241				},1000,'easeInOutCubic')
16242
16243			}
16244			
16245		} else {
16246			$scrollPos = ($('#header-outer[data-mobile-fixed="1"]').length > 0) ? parseInt($topDistance) - $headerNavSpace + parseInt($currentSection.offset().top) + 2 : parseInt($topDistance) + parseInt($currentSection.offset().top) + 2;
16247			$('body,html').stop().animate({
16248				scrollTop: $scrollPos - $bodyBorderSize*2
16249			},1000,'easeInOutCubic')
16250		}
16251	} else {
16252		//permanent transparent
16253		$('body,html').stop().animate({
16254			scrollTop: parseInt($topDistance) + parseInt($currentSection.offset().top) + 2 - $bodyBorderSize*2
16255		},1000,'easeInOutCubic')
16256	}
16257	return false;
16258});
16259
16260
16261$('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(){
16262	$(this).parents('.grav-wrap').find('img').addClass('hovered');
16263});
16264$('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(){
16265	$(this).parents('.grav-wrap').find('img').removeClass('hovered');
16266});  
16267
16268
16269
16270/*-------------------------------------------------------------------------*/
16271/*	7.	Cross Browser Fixes
16272/*-------------------------------------------------------------------------*/	
16273	 
16274	 function crossBrowserFixes() {
16275	
16276		 
16277		//Fix current class in menu 
16278		if ($("body").hasClass("single-portfolio") || $('body').hasClass("error404") || $('body').hasClass("search-results")) {   
16279			$("li").removeClass("current_page_parent").removeClass("current-menu-ancestor").removeClass('current_page_ancestor');   
16280		}
16281		
16282		//for users updating to 8 with a custom, old header template file
16283		if($('html.js').length == 0) { $('html').removeClass('no-js').addClass('js'); }
16284		
16285		//remove br's from code tag
16286		$('code').find('br').remove();	
16287		
16288		//if a clear is the last div, remove the padding
16289		if($('.container.main-content > .row > div:last-child').hasClass('clear')) {
16290			$('.container.main-content > .row > div:last-child').css('padding-bottom','0');
16291		}
16292		
16293		//homepage recent blog for IE8
16294		$('.container-wrap .blog-recent > div:last-child').addClass('col_last');
16295		
16296		//blog ascend bottom padding
16297		if($('.single .blog_next_prev_buttons').length > 0) $('.container-wrap').css('padding-bottom',0);
16298
16299		//contact form
16300		$('.wpcf7-form p:has(input[type=submit])').css('padding-bottom','0px');
16301
16302		$('.full-width-content .wpcf7-submit').on('click',function(){ setTimeout(function(){ fullWidthContentColumns() },1000); setTimeout(function(){ fullWidthContentColumns() },2000); });
16303		
16304		//no caption home slider fix
16305		$('#featured article').each(function(){
16306			if($(this).find('h2').attr('data-has-caption') == '0') {
16307				$(this).parents('.slide').addClass('no-caption');
16308			}
16309		});
16310		
16311		//add class for IE
16312		var ua = window.navigator.userAgent;
16313		var msie = ua.indexOf("Edge/");
16314		if(msie > 0) {
16315			$('body').addClass('msie');
16316		}
16317
16318		//gravity form inside fw content row
16319		$('.gform_body').on('click',function(e){
16320		   setTimeout(function(){ fullWidthContentColumns(); },200);
16321		 });
16322		 
16323		//pum salient close 
16324		$('.pum.pum-theme-salient-page-builder-optimized button.pum-close').wrapInner('<span />'); 
16325		
16326		//pum inside fspr
16327		if($('#nectar_fullscreen_rows').length > 0 && $('.pum-container .pum-content > .wpb_row .full-page-inner > .container > .span_12').length > 0) {
16328			$('.pum-container .pum-content > .wpb_row .full-page-inner > .container > .span_12').unwrap();
16329		}
16330
16331		//chat post format nth child color
16332		$('article.post.format-chat .content-inner dt:odd').css('color','#333');
16333		
16334		//remove margin on last cols inside of full width sections 
16335		$('.full-width-section').each(function(){
16336			$(this).find('> .span_12 > div.col_last').last().css('margin-bottom','0');
16337		});
16338		
16339		//remove p tags from extra content editor when warpping only an img 
16340		$('#portfolio-extra p').each(function(){
16341			if($(this).find('*').length == 1 && $(this).find('img').length == 1) {
16342				$(this).find('img').unwrap();
16343			}
16344		});
16345	
16346
16347		//vc text_separator color
16348		$('.vc_text_separator').each(function(){
16349			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'));
16350		});
16351		
16352		//carousel head button alignment  
16353		$('.carousel-heading').each(function(){
16354			if($(this).find('h2').length > 0) $(this).find('.carousel-prev, .carousel-next').css('top','7px');
16355		});
16356		
16357		//remove carousel heading if not being used
16358		$('.carousel-wrap').each(function(){
16359			if($(this).find('.carousel-heading .container:empty').length > 0) $(this).find('.carousel-heading').remove();
16360		});
16361		
16362		//woocommerce product thuimbnails
16363		$('.woocommerce div.product div.images div.thumbnails a:nth-child(4n+4)').css('margin-right','0px');
16364		
16365		//remove extra galleries when using the nectar gallery slider on projects and posts
16366		$('article.post .gallery-slider .gallery,  article.post .gallery-slider .jetpack-slideshow, .single-portfolio .gallery-slider .gallery, .single-portfolio .gallery-slider .jetpack-slideshow').remove();
16367		
16368		
16369		$('.woocommerce .span_9 .products.related .products li:nth-child(4), .woocommerce .span_9 .products.upsells .products li:nth-child(4)').remove();
16370		$('.woocommerce .span_9 .products.related .products li:nth-child(3), .woocommerce .span_9 .products.upsells .products li:nth-child(3)').css('margin-right','0');	
16371		
16372		$('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy');
16373
16374		//clients no hover if no link
16375		$('div.clients').each(function(){
16376			$(this).find('> div').each(function(){
16377				if($(this).find('a').length == 0) {
16378					$(this).addClass('no-link');
16379				}
16380			});
16381		});
16382
16383		//remove ajaxy from single posts when using disqus
16384		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');
16385
16386		//blog next color bg only 
16387		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();
16388		
16389		if($('#single-below-header').hasClass('fullscreen-header') && $('.blog_next_prev_buttons').length == 0 ) $('#author-bio, .comment-wrap').addClass('lighter-grey');
16390
16391		//shop header parallax margin 
16392		if($('body.woocommerce').find('#page-header-bg').length > 0){
16393			$('.container-wrap').css({'margin-top':'0px','padding-top':'30px'});
16394		}
16395		
16396		//if using wooCommerce sitewide notice
16397		if($('.demo_store').length > 0) $('#header-outer, #header-space').css('margin-top','32px');
16398	
16399		
16400		//nectar slider external links
16401		$('.swiper-slide.external-button-1 .buttons > div:nth-child(1) a').attr('target','_blank');
16402		$('.swiper-slide.external-button-2 .buttons > div:nth-child(2) a').attr('target','_blank');
16403		
16404		//portfolio external links
16405		$(".portfolio-items").find("a[href*='http://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank"); 
16406		$(".recent_projects_widget").find("a[href*='http://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank"); 
16407		
16408		$(".portfolio-items").find("a[href*='https://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank"); 
16409		$(".recent_projects_widget").find("a[href*='https://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank"); 
16410		
16411		//remove excess inner content when empty row
16412		$('.container-wrap .row > .wpb_row').each(function(){
16413			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();
16414		});
16415		
16416		//remove boxed style from full width content
16417		$('.full-width-content .col.boxed').removeClass('boxed');
16418		
16419		//remove full width attribute on slider in full width content section
16420		$('.full-width-content .wpb_column .nectar-slider-wrap[data-full-width="true"]').attr('data-full-width','false');	
16421
16422	    //neg marg z-index
16423	    $('.wpb_column.neg-marg').parents('.wpb_row').css('z-index','110');
16424
16425
16426	    //portfolio description remove on hover
16427	    var $tmpTitle = null;
16428	    $('.portfolio-items > .col a[title]').on('mouseenter',function(){
16429	    	$tmpTitle = $(this).attr('title');
16430	    	$(this).attr('title','');
16431	    });
16432			$('.portfolio-items > .col a[title]').on('mouseleave',function(){
16433	    	$(this).attr('title', $tmpTitle);
16434	    });
16435			
16436	    $('.portfolio-items > .col a[title]').on('click',function(e){
16437			$(this).attr('title', $tmpTitle);
16438	    });
16439
16440	};
16441
16442	crossBrowserFixes();
16443
16444
16445
16446	jQuery( document.body ).on( 'updated_cart_totals', function() { 
16447		if($('.plus').length == 0) 
16448			$( '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" />' );
16449	});
16450
16451	// Quantity buttons
16452	if($('.plus').length == 0) {
16453		$( '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" />' );
16454
16455		$( document ).on( 'click', '.plus, .minus', function() {
16456
16457			// Get values
16458			var $qty		= $( this ).closest( '.quantity' ).find( '.qty' ),
16459				currentVal	= parseFloat( $qty.val() ),
16460				max			= parseFloat( $qty.attr( 'max' ) ),
16461				min			= parseFloat( $qty.attr( 'min' ) ),
16462				step		= $qty.attr( 'step' );
16463
16464			// Format values
16465			if ( ! currentVal || currentVal === '' || currentVal === 'NaN' ) currentVal = 0;
16466			if ( max === '' || max === 'NaN' ) max = '';
16467			if ( min === '' || min === 'NaN' ) min = 0;
16468			if ( step === 'any' || step === '' || step === undefined || parseFloat( step ) 
16468=== 'NaN' ) step = 1;
16469
16470			// Change the value
16471			if ( $( this ).is( '.plus' ) ) {
16472
16473				if ( max && ( max == currentVal || currentVal > max ) ) {
16474					$qty.val( max );
16475				} else {
16476					$qty.val( currentVal + parseFloat( step ) );
16477				}
16478
16479			} else {
16480
16481				if ( min && ( min == currentVal || currentVal < min ) ) {
16482					$qty.val( min );
16483				} else if ( currentVal > 0 ) {
16484					$qty.val( currentVal - parseFloat( step ) );
16485				}
16486
16487			}
16488
16489			// Trigger change event
16490			$qty.trigger( 'change' );
16491
16492		});
16493	}
16494
16495	function wooPriceSlider(){
16496
16497
16498		// woocommerce_price_slider_params is required to continue, ensure the object exists
16499		if ( typeof woocommerce_price_slider_params === 'undefined' || !$('body').hasClass('woocommerce') ) {
16500			return false;
16501		}
16502
16503		// Get markup ready for slider
16504		$( 'input#min_price, input#max_price' ).hide();
16505		$( '.price_slider, .price_label' ).show();
16506
16507		// Price slider uses jquery ui
16508		var min_price = $( '.price_slider_amount #min_price' ).data( 'min' ),
16509			max_price = $( '.price_slider_amount #max_price' ).data( 'max' );
16510
16511		current_min_price = parseInt( min_price, 10 );
16512		current_max_price = parseInt( max_price, 10 );
16513
16514		if ( woocommerce_price_slider_params.min_price ) current_min_price = parseInt( woocommerce_price_slider_params.min_price, 10 );
16515		if ( woocommerce_price_slider_params.max_price ) current_max_price = parseInt( woocommerce_price_slider_params.max_price, 10 );
16516
16517		$( 'body' ).bind( 'price_slider_create price_slider_slide', function( event, min, max ) {
16518			if ( woocommerce_price_slider_params.currency_pos === 'left' ) {
16519
16520				$( '.price_slider_amount span.from' ).html( woocommerce_price_slider_params.currency_symbol + min );
16521				$( '.price_slider_amount span.to' ).html( woocommerce_price_slider_params.currency_symbol + max );
16522
16523			} else if ( woocommerce_price_slider_params.currency_pos === 'left_space' ) {
16524
16525				$( '.price_slider_amount span.from' ).html( woocommerce_price_slider_params.currency_symbol + " " + min );
16526				$( '.price_slider_amount span.to' ).html( woocommerce_price_slider_params.currency_symbol + " " + max );
16527
16528			} else if ( woocommerce_price_slider_params.currency_pos === 'right' ) {
16529
16530				$( '.price_slider_amount span.from' ).html( min + woocommerce_price_slider_params.currency_symbol );
16531				$( '.price_slider_amount span.to' ).html( max + woocommerce_price_slider_params.currency_symbol );
16532
16533			} else if ( woocommerce_price_slider_params.currency_pos === 'right_space' ) {
16534
16535				$( '.price_slider_amount span.from' ).html( min + " " + woocommerce_price_slider_params.currency_symbol );
16536				$( '.price_slider_amount span.to' ).html( max + " " + woocommerce_price_slider_params.currency_symbol );
16537
16538			}
16539
16540			$( 'body' ).trigger( 'price_slider_updated', min, max );
16541		});
16542
16543		$( '.price_slider' ).slider({
16544			range: true,
16545			animate: true,
16546			min: min_price,
16547			max: max_price,
16548			values: [ current_min_price, current_max_price ],
16549			create : function( event, ui ) {
16550
16551				$( '.price_slider_amount #min_price' ).val( current_min_price );
16552				$( '.price_slider_amount #max_price' ).val( current_max_price );
16553
16554				$( 'body' ).trigger( 'price_slider_create', [ current_min_price, current_max_price ] );
16555			},
16556			slide: function( event, ui ) {
16557
16558				$( 'input#min_price' ).val( ui.values[0] );
16559				$( 'input#max_price' ).val( ui.values[1] );
16560
16561				$( 'body' ).trigger( 'price_slider_slide', [ ui.values[0], ui.values[1] ] );
16562			},
16563			change: function( event, ui ) {
16564
16565				$( 'body' ).trigger( 'price_slider_change', [ ui.values[0], ui.values[1] ] );
16566
16567			},
16568		});
16569
16570	}
16571	
16572
16573//vc col mobile fixes
16574function vcMobileColumns() {
16575
16576	$('.wpb_row').each(function(){
16577		if(typeof $(this).find('.span_12').offset() != 'undefined' ) {
16578		
16579			$(this).find('[class*="vc_col-"]').each(function(){
16580
16581				var $firstChildOffset = $(this).parents('.span_12').offset().left;
16582				
16583				$(this).removeClass('no-left-margin');
16584				if($(this).offset().left < $firstChildOffset + 27) { 
16585					$(this).addClass('no-left-margin');
16586				} else {
16587					$(this).removeClass('no-left-margin');
16588				}
16589			});
16590		}
16591	});
16592}
16593
16594if( $('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) { vcMobileColumns(); }
16595
16596
16597/*-------------------------------------------------------------------------*/
16598/*	8.	Form Styling
16599/*-------------------------------------------------------------------------*/	
16600
16601
16602if($('body[data-fancy-form-rcs="1"]').length > 0) {
16603
16604
16605    //select only as of v9
16606    $('select:not(.comment-form-rating #rating)').each(function(){
16607			
16608			var $selector;
16609
16610    	//cf7
16611    	if($(this).parents('.wpcf7-form-control-wrap').length > 0) {
16612
16613    		//select 2 already initialized
16614	    	if($(this).parents('.wpcf7-form-control-wrap').find('.select2-container').length > 0) {
16615	    		$selector = $($(this).prev('.select2-container'));
16616	    	} else {
16617	    		$selector = $(this);
16618	    	}
16619
16620	    	//if label is found
16621	    	if($selector.parents('.wpcf7-form-control-wrap').parent().find('label').length == 1) {
16622	    		$selector.parents('.wpcf7-form-control-wrap').parent().wrapInner('<div class="fancy-select-wrap" />');
16623	    	} else {
16624	    		//default wrap
16625	    		$selector.wrap('<div class="fancy-select-wrap" />');
16626	    	}
16627    	} 
16628    	//default
16629    	else {
16630
16631	    	//select 2 already initialized
16632	    	if($(this).prev('.select2-container').length > 0) {
16633	    		$selector = $(this).prev('.select2-container');
16634	    	} else {
16635	    		$selector = $(this);
16636	    	}
16637				
16638				if($(this).parents('#buddypress').length == 0) {
16639			    	//if label is found
16640			    	if($selector.prev('label').length == 1) {
16641			    		$selector.prev('label').andSelf().wrapAll('<div class="fancy-select-wrap" />');
16642			    	} else if($selector.next('label').length == 1) {
16643			    		$selector.next('label').andSelf().wrapAll('<div class="fancy-select-wrap" />');
16644			    	} else {
16645			    		//default wrap
16646			    		$selector.wrap('<div class="fancy-select-wrap" />');
16647			    	}
16648				}
16649				
16650    	}
16651    });
16652	
16653	function select2Init(){
16654		$('select:not(.state_select):not(.country_select):not(.comment-form-rating #rating):not(#tribe-bar-form select):not(.woocommerce-currency-switcher)' ).each( function() {
16655			
16656			if($(this).parents('#buddypress').length == 0) {
16657			
16658						if($(this).parents('.woocommerce-ordering').length == 0) {
16659							$( this ).select2({
16660								minimumResultsForSearch: 7,
16661								width: '100%'
16662							});
16663						} else {
16664							$( this ).select2({
16665								minimumResultsForSearch: 7,
16666								dropdownAutoWidth: true
16667							});
16668						}
16669			}
16670
16671		});
16672	}
16673   
16674	select2Init();
16675
16676}
16677	
16678
16679
16680//Back/forward cache OCM close
16681if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
16682	
16683	window.onpageshow = function(event) {
16684		
16685			if(event.persisted) {
16686					
16687					//play video BGs
16688					$('.nectar-video-wrap, .nectar-slider-wrap .swiper-slide .video-wrap').each(function(i){
16689						
16690						if($(this).find('video').length > 0) {
16691							  $(this).find('video')[0].play();
16692						}
16693						
16694					});
16695	
16696
16697					//close mobile nav
16698					
16699					////material
16700					if($('body.material-ocm-open').length > 0) {	
16701							$('body > .slide_out_area_close').addClass('non-human-allowed').trigger('click');
16702
16703							setTimeout(function(){
16704								$('body > .slide_out_area_close').removeClass('non-human-allowed');
16705							},100);
16706						
16707					} 
16708					else if( $('#slide-out-widget-area.slide-out-from-right-hover.open').length > 0 && navigator.userAgent.match(/(iPod|iPhone|iPad)/) ) {
16709						mobileCloseNavCheck();
16710					}
16711					////others
16712					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 ) {
16713						
16714							$('#slide-out-widget-area .slide_out_area_close').addClass('non-human-allowed');
16715							$('.slide-out-widget-area-toggle:not(.std-menu) a.open').addClass('non-human-allowed').trigger('click');
16716							setTimeout(function(){
16717								$('#slide-out-widget-area .slide_out_area_close').removeClass('non-human-allowed');
16718							},100);
16719						
16720					}
16721
16722			} // if loaded from bf cache
16723			
16724		} //onpage show
16725		
16726} // only used on Safari or mobile
16727	
16728	
16729/*-------------------------------------------------------------------------*/
16730/*	10.	Page transitions
16731/*-------------------------------------------------------------------------*/	
16732
16733	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 ) {
16734
16735		$('#ajax-content-wrap').ajaxify({
16736			'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
16736([rel^="prettyPhoto"]):not(.pretty_photo), #header-outer li:not(.no-ajaxy) > a:not(.no-ajaxy), #header-outer #logo',
16737			'verbosity': 0, 
16738			requestDelay: 400,
16739			previewoff : true,
16740			memoryoff: true,
16741			turbo : false
16742		});
16743
16744		$(window).on("pronto.render", initPage)
16745		.on("pronto.load", destroyPage)
16746		.on("pronto.request", transitionPage);
16747
16748		if($('.nectar-box-roll').length == 0 && $('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) setTimeout(function() { waypoints(); }, 750);
16749		else if($('.nectar-box-roll').length == 0) setTimeout(function() { waypoints(); },300);
16750
16751		if($('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) {
16752			setTimeout(function(){ 
16753				$('#ajax-loading-screen').addClass('loaded');
16754			},30);
16755		}
16756
16757		initPage();
16758
16759	} else if($('body[data-ajax-transitions="true"]').length > 0 && $('#ajax-loading-screen[data-method="standard"]').length > 0 ) {
16760		
16761		//chrome white BG flash fix
16762		$('html').addClass('page-trans-loaded');
16763
16764		//fadeout loading animation
16765		if($('#ajax-loading-screen[data-effect="standard"]').length > 0) {
16766
16767			if($('.nectar-particles').length == 0) {
16768
16769					$('#ajax-loading-screen').transition({'opacity':0},500,function(){ 
16770						$(this).css({'display':'none'}); 
16771					}); 
16772					$('#ajax-loading-screen .loading-icon').transition({'opacity':0},500) 
16773				
16774			}
16775
16776			//bind waypoints after loading screen has left
16777			if($('.nectar-box-roll').length == 0) setTimeout(function() { waypoints(); },550);
16778
16779			//safari back/prev fix
16780			if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
16781				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) };
16782				window.onpageshow = function(event) {
16783					
16784		    		if (event.persisted) {
16785							
16786							
16787		    			$('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ 
16788		    				$(this).css({'display':'none'}); 
16789		    			}); 
16790		    			$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600);
16791							
16792		    		} //presisted
16793						
16794		    	}
16795					
16796			} else if(navigator.userAgent.indexOf('Firefox') != -1) {
16797				window.onunload = function(){};
16798			}
16799
16800	    		
16801	    	
16802			
16803		} else {
16804
16805			//for swipe trans add loaded immediately
16806			if($('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) {
16807				setTimeout(function(){ 
16808					$('#ajax-loading-screen').addClass('loaded');
16809				},60);
16810			}
16811
16812			if($('#page-header-wrap #page-header-bg[data-animate-in-effect="zoom-out"] .nectar-video-wrap').length == 0 && $('.first-nectar-slider').length == 0) {
16813				setTimeout(function(){ 
16814					$('#ajax-loading-screen:not(.loaded)').addClass('loaded');
16815					setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
16816				},150);
16817			}
16818
16819			//safari back/prev fix
16820			if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
16821				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) };
16822				window.onpageshow = function(event) {
16823		    		if (event.persisted) { 
16824		    			$('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ 
16825		    				$(this).css({'display':'none'}); 
16826		    			}); 
16827		    			$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600);
16828		    		}
16829		    	}
16830			} else if(navigator.userAgent.indexOf('Firefox') != -1) {
16831				window.onunload = function(){};
16832			}
16833			
16834			//bind waypoints after loading screen has left
16835			if($('.nectar-box-roll').length == 0 && $('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) { setTimeout(function() { waypoints(); }, 750); }
16836			else if($('.nectar-box-roll').length == 0) setTimeout(function() { waypoints(); },350);
16837
16838		}
16839
16840		//remove excess loading images now
16841		$('.portfolio-loading, .nectar-slider-loading .loading-icon').remove();
16842
16843
16844		if($('#ajax-loading-screen[data-disable-fade-on-click="1"]').length == 0) {
16845				
16846				if( $('body.using-mobile-browser #ajax-loading-screen[data-method="standard"][data-disable-mobile="1"]').length == 0) {
16847					
16848					var ignore_onbeforeunload = false;
16849					$('a[href^="mailto"], a[href^="tel"]').on('click',function(){
16850			        ignore_onbeforeunload = true;
16851			    });
16852					window.addEventListener('beforeunload', function () {
16853								
16854								if (!ignore_onbeforeunload){
16855									$('#ajax-loading-screen').addClass('set-to-fade');
16856									transitionPageStandard();
16857								}
16858								ignore_onbeforeunload = false;
16859					});
16860				}
16861
16862		} // if disable fade out is not on
16863		
16864		
16865	} else {	
16866		//bind waypoints regularly
16867		if($('.nectar-box-roll').length == 0 && !nectarDOMInfo.usingFrontEndEditor) setTimeout(function() { waypoints(); },100);
16868	}
16869
16870
16871	function transitionPage(e) {
16872		
16873		if($('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) {
16874
16875			if($(window).scrollTop() > 0) {
16876
16877				//stop nicescroll
16878				if($().niceScroll && $("html").getNiceScroll()){
16879					var nice = $("html").getNiceScroll();
16880					nice.stop();
16881				}
16882				
16883				$('body,html').stop(true,true).animate({
16884					scrollTop:0
16885				},500,'easeOutQuad',function(){ 
16886					
16887					//close widget area
16888					setTimeout(function(){  if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');  },400);
16889					$('#ajax-loading-screen').removeClass('loaded');
16890					$('#ajax-loading-screen').addClass('in-from-right');
16891					setTimeout(function(){
16892						$('#ajax-loading-screen').addClass('loaded');
16893					},30);
16894
16895				});
16896			}
16897			else { 
16898				//close widget area
16899				setTimeout(function(){  if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');  },400);
16900				$('#ajax-loading-screen').removeClass('loaded');
16901				$('#ajax-loading-screen').addClass('in-from-right');
16902				setTimeout(function(){
16903					$('#ajax-loading-screen').addClass('loaded');
16904				},30);
16905			}
16906
16907		} else {
16908			if($(window).scrollTop() > 0) {
16909
16910				//stop nicescroll
16911				if($().niceScroll && $("html").getNiceScroll()){
16912					var nice = $("html").getNiceScroll();
16913					nice.stop();
16914				}
16915				
16916				$('body,html').stop(true,true).animate({
16917					scrollTop:0
16918				},500,'easeOutQuad',function(){ 
16919					$('#ajax-loading-screen').css({'opacity':'1', 'display':'none'});
16920					$('#ajax-loading-screen').stop(true,true).fadeIn(600,function(){
16921						$('#ajax-loading-screen .loading-icon').animate({'opacity':1},400);
16922						//close widget area
16923						setTimeout(function(){  if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');  },400);
16924					});
16925				});
16926
16927			} else {
16928				$('#ajax-loading-screen').css('opacity','1').stop().fadeIn(600,function(){
16929					$('#ajax-loading-screen .loading-icon').animate({'opacity':1},400);
16930				});
16931
16932				//close widget area
16933				setTimeout(function(){  if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');  },400);
16934			}
16935		}
16936
16937		
16938	}
16939
16940	function transitionPageStandard(e) {
16941
16942		if($('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) {
16943			$('#ajax-loading-screen').removeClass('loaded');
16944			$('#ajax-loading-screen').addClass('in-from-right');
16945			setTimeout(function(){
16946				$('#ajax-loading-screen').addClass('loaded');
16947			},30);
16948		} else {
16949			if($('#ajax-loading-screen[data-effect="center_mask_reveal"]').length > 0) {
16950				$('#ajax-loading-screen').css('opacity','0').css('display','block').transition({'opacity':'1'},450);
16951			} else {
16952				$('#ajax-loading-screen').show().transition({'opacity':'1'},450);
16953			}
16954		}
16955		
16956	}
16957
16958	function destroyPage(e) {
16959		$(window).off('scroll.appear');
16960		if($('#nectar_fullscreen_rows').length > 0 && $().fullpage) 
16961			$.fn.fullpage.destroy('all');
16962	}
16963
16964	function initPage(e) {
16965
16966		if(!$('body').hasClass('ajax-loaded')) return false;
16967
16968
16969		//init js
16970		lightBoxInit();
16971		addOrRemoveSF();
16972		
16973		if($('body[data-header-format="left-header"]').length == 0) {
16974			$(".sf-menu").superfish('destroy');
16975		}
16976
16977		initSF();
16978		SFArrows();
16979		headerInit();
16980		var $effectTimeout = ($('#ajax-loading-screen').length > 0) ? 800 : 0;
16981		pageHeaderTextEffectInit();
16982		if($('#page-header-bg .nectar-video-wrap video').length == 0) { setTimeout(pageHeaderTextEffect,$effectTimeout); }
16983		coloredButtons();
16984		columnBGColors();
16985		fwCarouselLinkFix();
16986		if($('.carousel').length > 0) {
16987			standardCarouselInit();
16988			clientsCarouselInit();
16989			carouselHeightCalcs();
16990		}
16991		if($('.owl-carousel').length > 0) owlCarouselInit();
16992		if($('.products-carousel').length > 0 || $('.nectar-woo-flickity').length > 0) productCarouselInit();
16993		if($('#nectar_fullscreen_rows').length > 0 && $().fullpage) {
16994			setFPNames();
16995			initFullPageFooter();
16996			fullscreenRowLogic();
16997			initNectarFP();
16998		}
16999		flexsliderInit();
17000		accordionInit();
17001		tabbedInit();
17002		nectarLiquidBGs();
17003		tabbbedDeepLinking();
17004		accordionDeepLinking();
17005		ulChecks();
17006		oneFourthClasses();
17007		carouselfGrabbingClass();
17008		cascadingImageBGSizing();
17009		fullWidthSections();
17010		fwsClasses();
17011		fullwidthImgOnlySizingInit();
17012		fullwidthImgOnlySizing();
17013		if(nectarDOMInfo.usingMobileBrowser) {
17014			fullWidthRowPaddingAdjustCalc();
17015		}
17016		boxRollInit();
17017		setTimeout(function(){ 
17018		   waypoints();
17019		   flickityInit();
17020		},100); 
17021		if($('body[data-animated-anchors="true"]').length > 0) setTimeout(scrollSpyInit,200);
17022		socialSharingInit();
17023		hotSpotHoverBind();
17024		pricingTableHeight();
17025		createTestimonialControls();
17026		imageWithHotspotClickEvents();
17027		testimonialSliderHeight(); 
17028		largeIconHover();
17029		if($('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length == 0) {
17030			fullscreenMenuInit();
17031		}
17032		boxRollMouseWheelInit();
17033		midnightInit();
17034		responsiveVideoIframesInit();
17035		responsiveVideoIframes();
17036		fullWidthContentColumns();
17037		videoBGInit();
17038		$window.unbind('scroll.parallaxSections').unbind('resize.parallaxSections');
17039		parallaxScrollInit();
17040		
17041		$blog_containers = [];
17042		$('.posts-container').each(function(i){
17043			$blog_containers[i] = $(this);
17044		});
17045		
17046		nectarAccountPageTabs();
17047		masonryBlogInit();
17048		masonryPortfolioInit();
17049		portfolioAccentColor();
17050		portfolioHoverEffects();
17051		portfolioFiltersInit();
17052		style6Img();
17053		isotopeCatSelection();
17054		$(window).unbind('.infscr');
17055		infiniteScrollInit();
17056		toTopBind();
17057		centerLove();
17058		postNextButtonEffect();
17059		pageLoadHash();
17060		slideOutWidgetAreaScrolling();
17061		
17062		//search results
17063		if($('body.search-results').length > 0 && $('#search-results article').length > 0) { searchResultMasonry(); }
17064		
17065		//cf7
17066		if($().wpcf7InitForm) $('div.wpcf7 > form').wpcf7InitForm();
17067
17068		//woocommerce price slider
17069		wooPriceSlider();
17070
17071		//twitter widget 
17072		if(typeof twttr != 'undefined') { twttr.widgets.load(); }
17073
17074		//Calendarize.it
17075		if(typeof init_rhc === 'function') { init_rhc(); }
17076
17077		//unwrap post and protfolio videos
17078		$('.video-wrap iframe').unwrap();
17079		$('#sidebar iframe[src]').unwrap();
17080
17081		$('video:not(.slider-video)').attr('width','100%');
17082		$('video:not(.slider-video)').attr('height','100%'); 
17083
17084		$('.wp-video-shortcode.mejs-container').each(function(){
17085			$(this).attr('data-aspectRatio', parseInt($(this).css('height')) / parseInt($(this).css('width')));
17086		});
17087
17088		//mediaElement
17089		$('video.wp-media-shortcode-ajax, audio.wp-media-shortcode-ajax').each(function(){ 
17090			if(!$(this).parent().hasClass('mejs-mediaelement') && $().mediaelementplayer) {
17091				$(this).mediaelementplayer();  
17092			}
17093		});
17094
17095		$('.mejs-container').css({'height': '100%', 'width': '100%'});
17096		
17097		$('audio').attr('width','100%');
17098		$('audio').attr('height','100%');
17099
17100		$('audio').css('visibility','visible');
17101
17102		if($('body').hasClass('mobile')){
17103			$('video').css('visibility','hidden');
17104		} else {
17105			$('video').css('visibility','visible');
17106		}
17107
17108		$('.wpb_row:has(".nectar-video-wrap")').each(function(i){
17109			$(this).css('z-index',100 + i);
17110		});
17111
17112		mouseParallaxInit();
17113
17114		//chrome self hosted slider bg video correct
17115		 if(navigator.userAgent.indexOf('Chrome') > 0) { 
17116		 	$('.swiper-wrapper .video-wrap').each(function(i){
17117			  	var webmSource = jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
17118	          	var firstVideo = jQuery(this).find('video').get(0);
17119	          	firstVideo.src = webmSource;
17120	          	firstVideo.load();
17121            });
17122	    }
17123
17124
17125		if($('.nectar-video-bg').length > 0) {
17126			setTimeout(function(){
17127			    	resizeVideoToCover();
17128			    	$('.video-color-overlay').each(function(){
17129			    		$(this).css('background-color',$(this).attr('data-color'));
17130			    	});
17131			    	$('.nectar-video-wrap').transition({'opacity':'1'},0);
17132			    	$('.video-color-overlay').transition({'opacity':'0.7'},0);
17133			    	
17134			    },400);
17135		}
17136
17137		
17138		nectarPageHeader();
17139	
17140
17141		//cart dropdown
17142		$('#header-outer div.cart-outer').hoverIntent(function(){
17143			$('#header-outer .widget_shopping_cart').addClass('open').stop(true,true).fadeIn(400);
17144			$('#header-outer .cart_list').stop(true,true).fadeIn(400);
17145			clearTimeout(timeout);
17146			$('#header-outer .cart-notification').fadeOut(300);
17147		});
17148
17149
17150		//remove excess loading images now
17151		$('.portfolio-loading, .nectar-slider-loading .loading-icon').remove();
17152
17153		setTimeout(portfolioSidebarFollow,250);
17154		setTimeout(portfolioSidebarFollow,500);
17155		setTimeout(portfolioSidebarFollow,1000);
17156
17157		crossBrowserFixes();
17158
17159
17160		$(window).trigger('resize');
17161
17162		//fix admin bar
17163		$("#wpadminbar").show();	
17164
17165
17166		//close widget area
17167		if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click'); 
17168
17169		if($('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length > 0) {
17170			closeSearch();
17171			$('#ajax-loading-screen').removeClass('in-from-right').removeClass('loaded');
17172			setTimeout(function(){ $('#ajax-loading-screen').addClass('loaded'); },30);
17173		} else {
17174			//fade in page
17175			setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0}); }); closeSearch();  },200);
17176			setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0}); }); closeSearch(); },900);
17177		}
17178	} 
17179
17180
17181
17182(function($){
17183	if(!$.fn.textareaCount) { 
17184		$.fn.textareaCount = function(options, fn) {
17185	        var defaults = {
17186				maxCharacterSize: -1,
17187				originalStyle: 'originalTextareaInfo',
17188				warningStyle: 'warningTextareaInfo',
17189				warningNumber: 20,
17190				displayFormat: '#input characters | #words words'
17191			};
17192
17193			var options = $.extend(defaults, options);
17194
17195			var container = $(this);
17196
17197			$("<div class='charleft'>&nbsp;</div>").insertAfter(container);
17198
17199
17200			//create charleft css
17201			var charLeftCss = {
17202				'width' : container.width()
17203			};
17204
17205			var charLeftInfo = getNextCharLeftInformation(container);
17206			charLeftInfo.addClass(options.originalStyle);
17207			//charLeftInfo.css(charLeftCss);
17208
17209
17210			var numInput = 0;
17211			var maxCharacters = options.maxCharacterSize;
17212			var numLeft = 0;
17213			var numWords = 0;
17214
17215			container.on('keyup', function(event){limitTextAreaByCharacterCount();})
17216					 .on('mouseover', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);})
17217					 .on('paste', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);});
17218
17219	        limitTextAreaByCharacterCount();
17220
17221			function limitTextAreaByCharacterCount(){
17222				charLeftInfo.html(countByCharacters());
17223
17224				//function call back
17225				if(typeof fn != 'undefined'){
17226					fn.call(this, getInfo());
17227				}
17228				return true;
17229			}
17230
17231			function countByCharacters(){
17232				var content = container.val();
17233				var contentLength = content.length;
17234				//Start Cut
17235				if(options.maxCharacterSize > 0){
17236					//If copied content is already more than maxCharacterSize, chop it to maxCharacterSize.
17237					if(contentLength >= options.maxCharacterSize) {
17238						content = content.substring(0, options.maxCharacterSize);
17239					}
17240
17241					var newlineCount = getNewlineCount(content);
17242
17243					// newlineCount new line character. For windows, it occupies 2 characters
17244					var systemmaxCharacterSize = options.maxCharacterSize - newlineCount;
17245					if (!isWin()){
17246						 systemmaxCharacterSize = options.maxCharacterSize
17247					}
17248					if(contentLength > systemmaxCharacterSize){
17249						//avoid scroll bar moving
17250						var originalScrollTopPosition = this.scrollTop;
17251						container.val(content.substring(0, systemmaxCharacterSize));
17252						this.scrollTop = originalScrollTopPosition;
17253					}
17254					charLeftInfo.removeClass(options.warningStyle);
17255					if(systemmaxCharacterSize - contentLength <= options.warningNumber){
17256						charLeftInfo.addClass(options.warningStyle);
17257					}
17258
17259					numInput = container.val().length + newlineCount;
17260					if(!isWin()){
17261						numInput = container.val().length;
17262					}
17263
17264					numWords = countWord(getCleanedWordString(container.val()));
17265
17266					numLeft = maxCharacters - numInput;
17267				} else {
17268					//normal count, no cut
17269					var newlineCount = getNewlineCount(content);
17270					numInput = container.val().length + newlineCount;
17271					if(!isWin()){
17272						numInput = container.val().length;
17273					}
17274					numWords = countWord(getCleanedWordString(container.val()));
17275				}
17276
17277				return formatDisplayInfo();
17278			}
17279
17280			function formatDisplayInfo(){
17281				var format = options.displayFormat;
17282				format = format.replace('#input', numInput);
17283				format = format.replace('#words', numWords);
17284				//When maxCharacters <= 0, #max, #left cannot be substituted.
17285				if(maxCharacters > 0){
17286					format = format.replace('#max', maxCharacters);
17287					format = format.replace('#left', numLeft);
17288				}
17289				return format;
17290			}
17291
17292			function getInfo(){
17293				var info = {
17294					input: numInput,
17295					max: maxCharacters,
17296					left: numLeft,
17297					words: numWords
17298				};
17299				return info;
17300			}
17301
17302			function getNextCharLeftInformation(container){
17303					return container.next('.charleft');
17304			}
17305
17306			function isWin(){
17307				var strOS = navigator.appVersion;
17308				if (strOS.toLowerCase().indexOf('win') != -1){
17309					return true;
17310				}
17311				return false;
17312			}
17313
17314			function getNewlineCount(content){
17315				var newlineCount = 0;
17316				for(var i=0; i<content.length;i++){
17317					if(content.charAt(i) == '\n'){
17318						newlineCount++;
17319					}
17320				}
17321				return newlineCount;
17322			}
17323
17324			function getCleanedWordString(content){
17325				var fullStr = content + " ";
17326				var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
17327				var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "");
17328				var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
17329				var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " ");
17330				var splitString = cleanedStr.split(" ");
17331				return splitString;
17332			}
17333
17334			function countWord(cleanedWordString){
17335				var word_count = cleanedWordString.length-1;
17336				return word_count;
17337			}
17338		};
17339	}
17340})(jQuery);	
17341	
17342	
17343	
17344	
17345});
17346
17347
17348 }(window.jQuery, window, document));
17349
17350
17351function resizeIframe() {
17352	var element = document.getElementById("pp_full_res").getElementsByTagName("iframe");
17353	var height = element[0].contentWindow.document.body.scrollHeight;
17354    
17355    //iframe height
17356    element[0].style.height = height + 'px';
17357	
17358	//pp height
17359	document.getElementsByClassName("pp_content_container")[0].style.height = height+40+ 'px';
17360	document.getElementsByClassName("pp_content")[0].style.height = height+40+ 'px';
17361	
17362}
17363
17364
17365
17366/*!
17367 * hoverIntent v1.9.0 // 2017.09.01 // jQuery v1.7.0+
17368 * http://briancherne.github.io/jquery-hoverIntent/
17369 *
17370 * You may use hoverIntent under the terms of the MIT license. Basically that
17371 * means you are free to use hoverIntent as long as this header is left intact.
17372 * Copyright 2007-2017 Brian Cherne
17373 */
17374!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.