PageSourceSearch

https://albaconsul.com/wp-content/themes/salient/js/init.js?ver=5.5.3

js albaconsul.com collected 2026-10-06 13:15:19 UTC 452,868 bytes, 6,870 lines download raw bytes

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/*	1.	Plugin Init
17/*-------------------------------------------------------------------------*/
18
19
20/* Touch swipe */
21(function(d){var m="left",l="right",c="up",s="down",b="in",t="out",j="none",o="auto",i="swipe",p="pinch",u="tap",x="horizontal",q="vertical",g="all",e="start",h="move",f="end",n="cancel",a="ontouchstart" in window,v="TouchSwipe";var k={fingers:1,threshold:75,cancelThreshold:25,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"button, input, select, textarea, a, .noSwipe"};d.fn.swipe=function(A){var z=d(this),y=z.data(v);if(y&&typeof A==="string"){if(y[A]){return y[A].apply(this,Array.prototype.slice.call(arguments,1))}else{d.error("Method "+A+" does not exist on jQuery.swipe")}}else{if(!y&&(typeof A==="object"||!A)){return r.apply(this,arguments)}}return z};d.fn.swipe.defaults=k;d.fn.swipe.phases={PHASE_START:e,PHASE_MOVE:h,PHASE_END:f,PHASE_CANCEL:n};d.fn.swipe.directions={LEFT:m,RIGHT:l,UP:c,DOWN:s,IN:b,OUT:t};d.fn.swipe.pageScroll={NONE:j,HORIZONTAL:x,VERTICAL:q,AUTO:o};d.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:g};function r(y){if(y&&(y.allowPageScroll===undefined&&(y.swipe!==undefined||y.swipeStatus!==undefined))){y.allowPageScroll=j}if(y.click!==undefined&&y.tap===undefined){y.tap=y.click}if(!y){y={}}y=d.extend({},d.fn.swipe.defaults,y);return this.each(function(){var A=d(this);var z=A.data(v);if(!z){z=new w(this,y);A.data(v,z)}})}function w(S,ag){var aJ=(a||!ag.fallbackToMouseEvents),az=aJ?"touchstart":"mousedown",U=aJ?"touchmove":"mousemove",av=aJ?"touchend":"mouseup",D=aJ?null:"mouseleave",R="touchcancel";var ad=0,N=null,ah=0,aF=0,A=0,aj=1,aA=0,aN=0,Z=null;var H=d(S);var O="start";var aI=0;var ai=null;var I=0,Y=0,aD=0,aP=0;try{H.bind(az,at);H.bind(R,L)}catch(aG){d.error("events not supported "+az+","+R+" on jQuery.swipe")}this.enable=function(){H.bind(az,at);H.bind(R,L);return H};this.disable=function(){Q();return H};this.destroy=function(){Q();H.data(v,null);return H};this.option=function(aR,aQ){if(ag[aR]!==undefined){if(aQ===undefined){return ag[aR]}else{ag[aR]=aQ}}else{d.error("Option "+aR+" does not exist on jQuery.swipe.options")}};function at(aS){if(X()){return}if(d(aS.target).closest(ag.excludedElements,H).length>0){return}var aT=aS.originalEvent?aS.originalEvent:aS;var aR,aQ=a?aT.touches[0]:aT;O=e;if(a){aI=aT.touches.length}else{aS.preventDefault()}ad=0;N=null;aN=null;ah=0;aF=0;A=0;aj=1;aA=0;ai=T();Z=aE();z();if(!a||(aI===ag.fingers||ag.fingers===g)||ap()){aO(0,aQ);I=B();if(aI==2){aO(1,aT.touches[1]);aF=A=aa(ai[0].start,ai[1].start)}if(ag.swipeStatus||ag.pinchStatus){aR=aH(aT,O)}}else{aR=false}if(aR===false){O=n;aH(aT,O);return aR}else{ak(true)}}function P(aT){var aW=aT.originalEvent?aT.originalEvent:aT;if(O===f||O===n||af()){return}var aS,aR=a?aW.touches[0]:aW;var aU=V(aR);Y=B();if(a){aI=aW.touches.length}O=h;if(aI==2){if(aF==0){aO(1,aW.touches[1]);aF=A=aa(ai[0].start,ai[1].start)}else{V(aW.touches[1]);A=aa(ai[0].end,ai[1].end);aN=ao(ai[0].end,ai[1].end)}aj=y(aF,A);aA=Math.abs(aF-A)}if((aI===ag.fingers||ag.fingers===g)||!a||ap()){N=ar(aU.start,aU.end);C(aT,N);ad=G(aU.start,aU.end);ah=K();aK(N,ad);if(ag.swipeStatus||ag.pinchStatus){aS=aH(aW,O)}if(!ag.triggerOnTouchEnd||ag.triggerOnTouchLeave){var aQ=true;if(ag.triggerOnTouchLeave){var aV=au(this);aQ=aC(aU.end,aV)}if(!ag.triggerOnTouchEnd&&aQ){O=aM(h)}else{if(ag.triggerOnTouchLeave&&!aQ){O=aM(f)}}if(O==n||O==f){aH(aW,O)}}}else{O=n;aH(aW,O)}if(aS===false){O=n;aH(aW,O)}}function ab(aS){var aU=aS.originalEvent;if(a){if(aU.touches.length>0){aw();return true}}if(af()){aI=aP}aS.preventDefault();Y=B();if(ag.triggerOnTouchEnd||(ag.triggerOnTouchEnd==false&&O===h)){O=f;var aR=((aI===ag.fingers||ag.fingers===g)||!a);var aQ=ai[0].end.x!==0;var aT=aR&&aQ&&(an()||aB());if(aT){aH(aU,O)}else{O=n;aH(aU,O)}}else{if(!ag.triggerOnTouchEnd&&ay()){O=f;am(aU,O,u)}else{if(O===h){O=n;aH(aU,O)}}}ak(false)}function L(){aI=0;Y=0;I=0;aF=0;A=0;aj=1;z();ak(false)}function W(aQ){var aR=aQ.originalEvent;if(ag.triggerOnTouchLeave){O=aM(f);aH(aR,O)}}function Q(){H.unbind(az,at);H.unbind(R,L);H.unbind(U,P);H.unbind(av,ab);if(D){H.unbind(D,W)}ak(false)}function aM(aT){var aS=aT;var aR=aq();var aQ=ae();if(!aR){aS=n}else{if(aQ&&aT==h&&(!ag.triggerOnTouchEnd||ag.triggerOnTouchLeave)){aS=f}else{if(!aQ&&aT==f&&ag.triggerOnTouchLeave){aS=n}}}return aS}function aH(aS,aQ){var aR=undefined;if(ac()){aR=am(aS,aQ,i)}if(ap()&&aR!==false){aR=am(aS,aQ,p)}
21if(ay()&&aR!==false){aR=am(aS,aQ,u)}if(aQ===n){L(aS)}if(aQ===f){if(a){if(aS.touches.length==0){L(aS)}}else{L(aS)}}return aR}function am(aT,aQ,aS){var aR=undefined;if(aS==i){H.trigger("swipeStatus",[aQ,N||null,ad||0,ah||0,aI]);if(ag.swipeStatus){aR=ag.swipeStatus.call(H,aT,aQ,N||null,ad||0,ah||0,aI);if(aR===false){return false}}if(aQ==f&&aB()){H.trigger("swipe",[N,ad,ah,aI]);if(ag.swipe){aR=ag.swipe.call(H,aT,N,ad,ah,aI);if(aR===false){return false}}switch(N){case m:H.trigger("swipeLeft",[N,ad,ah,aI]);if(ag.swipeLeft){aR=ag.swipeLeft.call(H,aT,N,ad,ah,aI)}break;case l:H.trigger("swipeRight",[N,ad,ah,aI]);if(ag.swipeRight){aR=ag.swipeRight.call(H,aT,N,ad,ah,aI)}break;case c:H.trigger("swipeUp",[N,ad,ah,aI]);if(ag.swipeUp){aR=ag.swipeUp.call(H,aT,N,ad,ah,aI)}break;case s:H.trigger("swipeDown",[N,ad,ah,aI]);if(ag.swipeDown){aR=ag.swipeDown.call(H,aT,N,ad,ah,aI)}break}}}if(aS==p){H.trigger("pinchStatus",[aQ,aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchStatus){aR=ag.pinchStatus.call(H,aT,aQ,aN||null,aA||0,ah||0,aI,aj);if(aR===false){return false}}if(aQ==f&&an()){switch(aN){case b:H.trigger("pinchIn",[aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchIn){aR=ag.pinchIn.call(H,aT,aN||null,aA||0,ah||0,aI,aj)}break;case t:H.trigger("pinchOut",[aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchOut){aR=ag.pinchOut.call(H,aT,aN||null,aA||0,ah||0,aI,aj)}break}}}if(aS==u){if(aQ===n||aQ===f){if((aI===1||!a)&&(isNaN(ad)||ad===0)){H.trigger("tap",[aT.target]);if(ag.tap){aR=ag.tap.call(H,aT,aT.target)}}}}return aR}function ae(){var aQ=true;if(ag.threshold!==null){aQ=ad>=ag.threshold}if(aQ&&ag.cancelThreshold!==null){aQ=(M(N)-ad)<ag.cancelThreshold}return aQ}function al(){if(ag.pinchThreshold!==null){return aA>=ag.pinchThreshold}return true}function aq(){var aQ;if(ag.maxTimeThreshold){if(ah>=ag.maxTimeThreshold){aQ=false}else{aQ=true}}else{aQ=true}return aQ}function C(aQ,aR){if(ag.allowPageScroll===j||ap()){aQ.preventDefault()}else{var aS=ag.allowPageScroll===o;switch(aR){case m:if((ag.swipeLeft&&aS)||(!aS&&ag.allowPageScroll!=x)){aQ.preventDefault()}break;case l:if((ag.swipeRight&&aS)||(!aS&&ag.allowPageScroll!=x)){aQ.preventDefault()}break;case c:if((ag.swipeUp&&aS)||(!aS&&ag.allowPageScroll!=q)){aQ.preventDefault()}break;case s:if((ag.swipeDown&&aS)||(!aS&&ag.allowPageScroll!=q)){aQ.preventDefault()}break}}}function an(){return al()}function ap(){return !!(ag.pinchStatus||ag.pinchIn||ag.pinchOut)}function ax(){return !!(an()&&ap())}function aB(){var aQ=aq();var aS=ae();var aR=aS&&aQ;return aR}function ac(){return !!(ag.swipe||ag.swipeStatus||ag.swipeLeft||ag.swipeRight||ag.swipeUp||ag.swipeDown)}function E(){return !!(aB()&&ac())}function ay(){return !!(ag.tap)}function aw(){aD=B();aP=event.touches.length+1}function z(){aD=0;aP=0}function af(){var aQ=false;if(aD){var aR=B()-aD;if(aR<=ag.fingerReleaseThreshold){aQ=true}}return aQ}function X(){return !!(H.data(v+"_intouch")===true)}function ak(aQ){if(aQ===true){H.bind(U,P);H.bind(av,ab);if(D){H.bind(D,W)}}else{H.unbind(U,P,false);H.unbind(av,ab,false);if(D){H.unbind(D,W,false)}}H.data(v+"_intouch",aQ===true)}function aO(aR,aQ){var aS=aQ.identifier!==undefined?aQ.identifier:0;ai[aR].identifier=aS;ai[aR].start.x=ai[aR].end.x=aQ.pageX||aQ.clientX;ai[aR].start.y=ai[aR].end.y=aQ.pageY||aQ.clientY;return ai[aR]}function V(aQ){var aS=aQ.identifier!==undefined?aQ.identifier:0;var aR=J(aS);aR.end.x=aQ.pageX||aQ.clientX;aR.end.y=aQ.pageY||aQ.clientY;return aR}function J(aR){for(var aQ=0;aQ<ai.length;aQ++){if(ai[aQ].identifier==aR){return ai[aQ]}}}function T(){var aQ=[];for(var aR=0;aR<=5;aR++){aQ.push({start:{x:0,y:0},end:{x:0,y:0},identifier:0})}return aQ}function aK(aQ,aR){aR=Math.max(aR,M(aQ));Z[aQ].distance=aR}function M(aQ){return Z[aQ].distance}function aE(){var aQ={};aQ[m]=aL(m);aQ[l]=aL(l);aQ[c]=aL(c);aQ[s]=aL(s);return aQ}function aL(aQ){return{direction:aQ,distance:0}}function K(){return Y-I}function aa(aT,aS){var aR=Math.abs(aT.x-aS.x);var aQ=Math.abs(aT.y-aS.y);return Math.round(Math.sqrt(aR*aR+aQ*aQ))}function y(aQ,aR){var aS=(aR/aQ)*1;return aS.toFixed(2)}function ao(){if(aj<1){return t}else{return b}}function G(aR,aQ){return Math.round(Math.sqrt(Math.pow(aQ.x-aR.x,2)+Math.pow(aQ.y-aR.y,2)))}function F(aT,aR){var aQ=aT.x-aR.x;var aV=aR.y-aT.y;var aS=Math.atan2(aV,aQ);var aU=Math.round(aS*180/Math.PI);if(aU<0){aU=360-Math.abs(aU)}return aU}function ar(aR,aQ){var aS=F(aR,aQ);if((aS<=45)&&(aS>=0)){return m}else{if((aS<=360)&&(aS>=315)){return m}else{if((aS>=135)&&(aS<=225)){return l}else{if((aS>45)&&(aS<135)){return s}else{return c}}}}}function B(){var aQ=new Date();return aQ.getTime()}function au(aQ){aQ=d(aQ);var aS=aQ.offset();var aR={left:aS.left,right:aS.left+aQ.outerWidth(),top:aS.top,bottom:aS.top+aQ.outerHeight()};return aR}function aC(aQ,aR){return(aQ.x>aR.left&&aQ.x<aR.right&&aQ.y>aR.top&&aQ.y<aR.bottom)}}})(jQuery);
22
23
24/*!
25 * imagesLoaded PACKAGED v3.1.1
26 * JavaScript is all like "You images are done yet or what?"
27 * MIT License
28 */
29
30(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1
30);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e){function t(e,t){for(var n in t)e[n]=t[n];return e}function n(e){return"[object Array]"===f.call(e)}function i(e){var t=[];if(n(e))t=e;else if("number"==typeof e.length)for(var i=0,r=e.length;r>i;i++)t.push(e[i]);else t.push(e);return t}function r(e,n){function r(e,n,s){if(!(this instanceof r))return new r(e,n);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=i(e),this.options=t({},this.options),"function"==typeof n?s=n:t(this.options,n),s&&this.on("always",s),this.getImages(),o&&(this.jqDeferred=new o.Deferred);var c=this;setTimeout(function(){c.check()})}function f(e){this.img=e}function a(e){this.src=e,h[e]=this}r.prototype=new e,r.prototype.options={},r.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);for(var i=n.querySelectorAll("img"),r=0,o=i.length;o>r;r++){var s=i[r];this.addImage(s)}}},r.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},r.prototype.check=function(){function e(e,r){return t.options.debug&&c&&s.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},r.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify(t,e)})},r.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},o&&(o.fn.imagesLoaded=function(e,t){var n=new r(this,e,t);return n.jqDeferred.promise(o(this))}),f.prototype=new e,f.prototype.check=function(){var e=h[this.img.src]||new a(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var h={};return a.prototype=new e,a.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},a.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},a.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},a.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},a.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},a.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},r}var o=e.jQuery,s=e.console,c=s!==void 0,f=Object.prototype.toString;"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],r):e.imagesLoaded=r(e.EventEmitter,e.eventie)}(window);	
31
32
33/*jQuery Waypoints */
34(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++){if(e in this&&this[e]===t)return e}return-1},e=[].slice;(function(t,e){if(typeof define==="function"&&define.amd){return define("waypoints",["jquery"],function(n){return e(n,t)})}else{return e(t.jQuery,t)}})(window,function(n,r){var i,o,l,s,f,u,c,a,h,d,p,y,v,w,g,m;i=n(r);a=t.call(r,"ontouchstart")>=0;s={horizontal:{},vertical:{}};f=1;c={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;
vendor: 6,764 bytes, line 34
34w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};this.element[u]=this.id;c[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||a)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(a&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete c[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=this.element[w])!=null?o:[];i.push(this.id);this.element[w]=i}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=t[w];if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;e=n.extend({},n.fn[g].defaults,e);if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=c[i[0][u]];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke.call(this,"disable")},enable:function(){return d._invoke.call(this,"enable")},destroy:function(){return d._invoke.call(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e<n.length-1){return t.push(n[e+1])}})},_traverse:function(t,e,i){var o,l;if(t==null){t="vertical"}if(e==null){e=r}l=h.aggregate(e);o=[];this.each(function(){var e;e=n.inArray(this,l[t]);return i(o,e,l[t])});return this.pushStack(o)},_invoke:function(t){this.each(function(){var e;e=l.getWaypointsByElement(this);return n.each(e,function(e,n){n[t]();return true})});return this}};n.fn[g]=function(){var t,r;r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(d[r]){return d[r].apply(this,t)}else if(n.isFunction(r)){return d.init.apply(this,arguments)}else if(n.isPlainObject(r)){return d.init.apply(this,[null,r])}else if(!r){return n.error("jQuery Waypoints needs a callback function or handler option.")}else{return n.error("The "+r+" method does not exist in jQuery Waypoints.")}};n.fn[g].defaults={context:r,continuous:true,enabled:true,horizontal:false,offset:0,triggerOnce:false};h={refresh:function(){return n.each(c,function(t,e){return e.refresh()})},viewportHeight:function(){var t;return(t=r.innerHeight)!=null?t:i.height()},aggregate:function(t){var e,r,i;e=s;if(t){e=(i=c[n(t)[0][u]])!=null?i.waypoints:void 0}if(!e){return[]}r={horizontal:[],vertical:[]};n.each(r,function(t,i){n.each(e[t],function(t,e){return i.push(e)});i.sort(function(t,e){return t.offset-e.offset});r[t]=n.map(i,function(t){return t.element});return r[t]=n.unique(r[t])});return r},above:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset<=t.oldScroll.y})},below:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset>t.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);
vendor: 4,486 bytes, lines 34-51
34return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=c[n(t)[0][u]];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.on("load.waypoints",function(){return n[m]("refresh")})})}).call(this);
35
36
37/*
38* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
39*/
40
41jQuery.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}})
42
43
44
45/*!
46 * Packery layout mode PACKAGED v1.1.1
47 * sub-classes Packery
48 * http://packery.metafizzy.co
49 */
50
51!function(a){function b(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function c(a,b){var c=d(a,b)?f:e;c(a,b)}var d,e,f;"classList"in document.documentElement?(d=function(a,b){return a.classList.contains(b)}
51,e=function(a,b){a.classList.add(b)},f=function(a,b){a.classList.remove(b)}):(d=function(a,c){return b(c).test(a.className)},e=function(a,b){d(a,b)||(a.className=a.className+" "+b)},f=function(a,c){a.className=a.className.replace(b(c)," ")});var g={hasClass:d,addClass:e,removeClass:f,toggleClass:c,has:d,add:e,remove:f,toggle:c};"function"==typeof define&&define.amd?define("classie/classie",g):"object"==typeof exports?module.exports=g:a.classie=g}(window),function(a){function b(){function a(b){for(var c in a.defaults)this[c]=a.defaults[c];for(c in b)this[c]=b[c]}return c.Rect=a,a.defaults={x:0,y:0,width:0,height:0},a.prototype.contains=function(a){var b=a.width||0,c=a.height||0;return this.x<=a.x&&this.y<=a.y&&this.x+this.width>=a.x+b&&this.y+this.height>=a.y+c},a.prototype.overlaps=function(a){var b=this.x+this.width,c=this.y+this.height,d=a.x+a.width,e=a.y+a.height;return this.x<d&&b>a.x&&this.y<e&&c>a.y},a.prototype.getMaximalFreeRects=function(b){if(!this.overlaps(b))return!1;var c,d=[],e=this.x+this.width,f=this.y+this.height,g=b.x+b.width,h=b.y+b.height;return this.y<b.y&&(c=new a({x:this.x,y:this.y,width:this.width,height:b.y-this.y}),d.push(c)),e>g&&(c=new a({x:g,y:this.y,width:e-g,height:this.height}),d.push(c)),f>h&&(c=new a({x:this.x,y:h,width:this.width,height:f-h}),d.push(c)),this.x<b.x&&(c=new a({x:this.x,y:this.y,width:b.x-this.x,height:this.height}),d.push(c)),d},a.prototype.canFit=function(a){return this.width>=a.width&&this.height>=a.height},a}var c=a.Packery=function(){};"function"==typeof define&&define.amd?define("packery/js/rect",b):"object"==typeof exports?module.exports=b():(a.Packery=a.Packery||{},a.Packery.Rect=b())}(window),function(a){function b(a){function b(a,b,c){this.width=a||0,this.height=b||0,this.sortDirection=c||"downwardLeftToRight",this.reset()}b.prototype.reset=function(){this.spaces=[],this.newSpaces=[];var b=new a({x:0,y:0,width:this.width,height:this.height});this.spaces.push(b),this.sorter=c[this.sortDirection]||c.downwardLeftToRight},b.prototype.pack=function(a){for(var b=0,c=this.spaces.length;c>b;b++){var d=this.spaces[b];if(d.canFit(a)){this.placeInSpace(a,d);break}}},b.prototype.placeInSpace=function(a,b){a.x=b.x,a.y=b.y,this.placed(a)},b.prototype.placed=function(a){for(var b=[],c=0,d=this.spaces.length;d>c;c++){var e=this.spaces[c],f=e.getMaximalFreeRects(a);f?b.push.apply(b,f):b.push(e)}this.spaces=b,this.mergeSortSpaces()},b.prototype.mergeSortSpaces=function(){b.mergeRects(this.spaces),this.spaces.sort(this.sorter)},b.prototype.addSpace=function(a){this.spaces.push(a),this.mergeSortSpaces()},b.mergeRects=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];if(d){var e=a.slice(0);e.splice(b,1);for(var f=0,g=0,h=e.length;h>g;g++){var i=e[g],j=b>g?0:1;d.contains(i)&&(a.splice(g+j-f,1),f++)}}}return a};var c={downwardLeftToRight:function(a,b){return a.y-b.y||a.x-b.x},rightwardTopToBottom:function(a,b){return a.x-b.x||a.y-b.y}};return b}if("function"==typeof define&&define.amd)define("packery/js/packer",["./rect"],b);else if("object"==typeof exports)module.exports=b(require("./rect"));else{var c=a.Packery=a.Packery||{};c.Packer=b(c.Rect)}}(window),function(a){function b(a,b,c){var d=a("transform"),e=function(){b.Item.apply(this,arguments)};e.prototype=new b.Item;var f=e.prototype._create;return e.prototype._create=function(){f.call(this),this.rect=new c,this.placeRect=new c},e.prototype.dragStart=function(){this.getPosition(),this.removeTransitionStyles(),this.isTransitioning&&d&&(this.element.style[d]="none"),this.getSize(),this.isPlacing=!0,this.needsPositioning=!1,this.positionPlaceRect(this.position.x,this.position.y),this.isTransitioning=!1,this.didDrag=!1},e.prototype.dragMove=function(a,b){this.didDrag=!0;var c=this.layout.size;a-=c.paddingLeft,b-=c.paddingTop,this.positionPlaceRect(a,b)},e.prototype.dragStop=function(){this.getPosition();var a=this.position.x!==this.placeRect.x,b=this.position.y!==this.placeRect.y;this.needsPositioning=a||b,this.didDrag=!1},e.prototype.positionPlaceRect=function(a,b,c){this.placeRect.x=this.getPlaceRectCoord(a,!0),this.placeRect.y=this.getPlaceRectCoord(b,!1,c)},e.prototype.getPlaceRectCoord=function(a,b,c){var d=b?"Width":"Height",e=this.size["outer"+d],f=this.layout[b?"columnWidth":"rowHeight"],g=this.layout.size["inner"+d];b||(g=Math.max(g,this.layout.maxY),this.layout.rowHeight||(g-=this.layout.gutter));var h;if(f){f+=this.layout.gutter,g+=b?this.layout.gutter:0,a=Math.round(a/f);var i;i=this.layout.options.isHorizontal?b?"ceil":"floor":b?"floor":"ceil";var j=Math[i](g/f);j-=Math.ceil(e/f),h=j}else h=g-e;return a=c?a:Math.min(a,h),a*=f||1,Math.max(0,a)},e.prototype.copyPlaceRectPosition=function(){this.rect.x=this.placeRect.x,this.rect.y=this.placeRect.y},e.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},e}"function"==typeof define&&define.amd?define("packery/js/item",["get-style-property/get-style-property","outlayer/outlayer","./rect"],b):"object"==typeof exports?module.exports=b(require("desandro-get-style-property"),require("outlayer"),require("./rect")):a.Packery.Item=b(a.getStyleProperty,a.Outlayer,a.Packery.Rect)}(window),function(a){function b(a,b,c,d,e,f){function g(a,b){return a.position.y-b.position.y||a.position.x-b.position.x}function h(a,b){return a.position.x-b.position.x||a.position.y-b.position.y}d.prototype.canFit=function(a){return this.width>=a.width-1&&this.height>=a.height-1};var i=c.create("packery");return i.Item=f,i.prototype._create=function(){c.prototype._create.call(this),this.packer=new e,this.stamp(this.options.stamped);var a=this;this.handleDraggabilly={dragStart:function(b){a.itemDragStart(b.element)},dragMove:function(b){a.itemDragMove(b.element,b.position.x,b.position.y)},dragEnd:function(b){a.itemDragEnd(b.element)}},this.handleUIDraggable={start:function(b){a.itemDragStart(b.currentTarget)},drag:function(b,c){a.itemDragMove(b.currentTarget,c.position.left,c.position.top)},stop:function(b){a.itemDragEnd(b.currentTarget)}}}
51,i.prototype._resetLayout=function(){this.getSize(),this._getMeasurements();var a=this.packer;this.options.isHorizontal?(a.width=Number.POSITIVE_INFINITY,a.height=this.size.innerHeight+this.gutter,a.sortDirection="rightwardTopToBottom"):(a.width=this.size.innerWidth+this.gutter,a.height=Number.POSITIVE_INFINITY,a.sortDirection="downwardLeftToRight"),a.reset(),this.maxY=0,this.maxX=0},i.prototype._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},i.prototype._getItemLayoutPosition=function(a){return this._packItem(a),a.rect},i.prototype._packItem=function(a){this._setRectSize(a.element,a.rect),this.packer.pack(a.rect),this._setMaxXY(a.rect)},i.prototype._setMaxXY=function(a){this.maxX=Math.max(a.x+a.width,this.maxX),this.maxY=Math.max(a.y+a.height,this.maxY)},i.prototype._setRectSize=function(a,c){var d=b(a),e=d.outerWidth,f=d.outerHeight;(e||f)&&(e=this._applyGridGutter(e,this.columnWidth),f=this._applyGridGutter(f,this.rowHeight)),c.width=Math.min(e,this.packer.width),c.height=Math.min(f,this.packer.height)},i.prototype._applyGridGutter=function(a,b){if(!b)return a+this.gutter;b+=this.gutter;var c=a%b,d=c&&1>c?"round":"ceil";return a=Math[d](a/b)*b},i.prototype._getContainerSize=function(){return this.options.isHorizontal?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},i.prototype._manageStamp=function(a){var b,c=this.getItem(a);if(c&&c.isPlacing)b=c.placeRect;else{var e=this._getElementOffset(a);b=new d({x:this.options.isOriginLeft?e.left:e.right,y:this.options.isOriginTop?e.top:e.bottom})}this._setRectSize(a,b),this.packer.placed(b),this._setMaxXY(b)},i.prototype.sortItemsByPosition=function(){var a=this.options.isHorizontal?h:g;this.items.sort(a)},i.prototype.fit=function(a,b,c){var d=this.getItem(a);d&&(this._getMeasurements(),this.stamp(d.element),d.getSize(),d.isPlacing=!0,b=void 0===b?d.rect.x:b,c=void 0===c?d.rect.y:c,d.positionPlaceRect(b,c,!0),this._bindFitEvents(d),d.moveTo(d.placeRect.x,d.placeRect.y),this.layout(),this.unstamp(d.element),this.sortItemsByPosition(),d.isPlacing=!1,d.copyPlaceRectPosition())},i.prototype._bindFitEvents=function(a){function b(){d++,2===d&&c.emitEvent("fitComplete",[c,a])}var c=this,d=0;a.on("layout",function(){return b(),!0}),this.on("layoutComplete",function(){return b(),!0})},i.prototype.resize=function(){var a=b(this.element),c=this.size&&a,d=this.options.isHorizontal?"innerHeight":"innerWidth";c&&a[d]===this.size[d]||this.layout()},i.prototype.itemDragStart=function(a){this.stamp(a);var b=this.getItem(a);b&&b.dragStart()},i.prototype.itemDragMove=function(a,b,c){function d(){f.layout(),delete f.dragTimeout}var e=this.getItem(a);e&&e.dragMove(b,c);var f=this;this.clearDragTimeout(),this.dragTimeout=setTimeout(d,40)},i.prototype.clearDragTimeout=function(){this.dragTimeout&&clearTimeout(this.dragTimeout)},i.prototype.itemDragEnd=function(b){var c,d=this.getItem(b);if(d&&(c=d.didDrag,d.dragStop()),!d||!c&&!d.needsPositioning)return void this.unstamp(b);a.add(d.element,"is-positioning-post-drag");var e=this._getDragEndLayoutComplete(b,d);d.needsPositioning?(d.on("layout",e),d.moveTo(d.placeRect.x,d.placeRect.y)):d&&d.copyPlaceRectPosition(),this.clearDragTimeout(),this.on("layoutComplete",e),this.layout()},i.prototype._getDragEndLayoutComplete=function(b,c){var d=c&&c.needsPositioning,e=0,f=d?2:1,g=this;return function(){return e++,e!==f?!0:(c&&(a.remove(c.element,"is-positioning-post-drag"),c.isPlacing=!1,
51c.copyPlaceRectPosition()),g.unstamp(b),g.sortItemsByPosition(),d&&g.emitEvent("dragItemPositioned",[g,c]),!0)}},i.prototype.bindDraggabillyEvents=function(a){a.on("dragStart",this.handleDraggabilly.dragStart),a.on("dragMove",this.handleDraggabilly.dragMove),a.on("dragEnd",this.handleDraggabilly.dragEnd)},i.prototype.bindUIDraggableEvents=function(a){a.on("dragstart",this.handleUIDraggable.start).on("drag",this.handleUIDraggable.drag).on("dragstop",this.handleUIDraggable.stop)},i.Rect=d,i.Packer=e,i}"function"==typeof define&&define.amd?define("packery/js/packery",["classie/classie","get-size/get-size","outlayer/outlayer","./rect","./packer","./item"],b):"object"==typeof exports?module.exports=b(require("desandro-classie"),require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):a.Packery=b(a.classie,a.getSize,a.Outlayer,a.Packery.Rect,a.Packery.Packer,a.Packery.Item)}(window),function(a){function b(a,b){for(var c in b)a[c]=b[c];return a}function c(a,c,d){var e=a.create("packery"),f=e.prototype._getElementOffset,g=e.prototype._getMeasurement;b(e.prototype,c.prototype),e.prototype._getElementOffset=f,e.prototype._getMeasurement=g;var h=e.prototype._resetLayout;e.prototype._resetLayout=function(){this.packer=this.packer||new c.Packer,h.apply(this,arguments)};var i=e.prototype._getItemLayoutPosition;e.prototype._getItemLayoutPosition=function(a){return a.rect=a.rect||new c.Rect,i.call(this,a)};var j=e.prototype._manageStamp;return e.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,j.apply(this,arguments)},e.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a,c=this.options.isHorizontal?"innerHeight":"innerWidth";return b&&a[c]!==this.size[c]},e}"function"==typeof define&&define.amd?define(["isotope/js/layout-mode","packery/js/packery","get-size/get-size"],c):"object"==typeof exports?module.exports=c(require("isotope-layout/js/layout-mode"),require("packery"),require("get-size")):c(a.Isotope.LayoutMode,a.Packery,a.getSize)}(window);
52
53
54/*! Mousewheel by Brandon Aaron (http://brandon.aaron.sh) */
55!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)}})});
56
57
58/*
59 * jQuery FlexSlider v2.1
60 * http://www.woothemes.com/flexslider/
61 *
62 * Copyright 2012 WooThemes
63 * Free to use under the GPLv2 license.
64 * http://www.gnu.org/licenses/gpl-2.0.html
65 *
66 * Contributing author: Tyler Smith (@mbmufffin)
67 */
68!function(e){e.flexslider=function(t,n){var a=e(t),i=e.extend({},e.flexslider.defaults,n),o=i.namespace,s="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,r=s?"touchend":"click",l="vertical"===i.direction,c=i.reverse,d=0<i.itemWidth,u="fade"===i.animation,p=""!==i.asNavFor,m={};e.data(t,"flexslider",a),m={init:function(){a.animating=!1,a.currentSlide=i.startAt,a.animatingTo=a.currentSlide,a.atEnd=0===a.currentSlide||a.currentSlide===a.last,a.containerSelector=i.selector.substr(0,i.selector.search(" ")),a.slides=e(i.selector,a),a.container=e(a.containerSelector,a),a.count=a.slides.length,a.syncExists=0<e(i.sync).length,"slide"===i.animation&&(i.animation="swing"),a.prop=l?"top":"marginLeft",a.args={},a.manualPause=!1;var t,n=a;
68if((t=!i.video)&&(t=!u)&&(t=i.useCSS))e:{t=document.createElement("div");var o,r=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(o in r)if(void 0!==t.style[r[o]]){a.pfx=r[o].replace("Perspective","").toLowerCase(),a.prop="-"+a.pfx+"-transform",t=!0;break e}t=!1}n.transitions=t,""!==i.controlsContainer&&(a.controlsContainer=0<e(i.controlsContainer).length&&e(i.controlsContainer)),""!==i.manualControls&&(a.manualControls=0<e(i.manualControls).length&&e(i.manualControls)),i.randomize&&(a.slides.sort(function(){return Math.round(Math.random())-.5}),a.container.empty().append(a.slides)),a.doMath(),p&&m.asNav.setup(),a.setup("init"),i.controlNav&&m.controlNav.setup(),i.directionNav&&m.directionNav.setup(),i.keyboard&&(1===e(a.containerSelector).length||i.multipleKeyboard)&&e(document).bind("keyup",function(e){e=e.keyCode,a.animating||39!==e&&37!==e||(e=39===e?a.getTarget("next"):37===e?a.getTarget("prev"):!1,a.flexAnimate(e,i.pauseOnAction))}),i.mousewheel&&a.bind("mousewheel",function(e,t){e.preventDefault();var n=a.getTarget(0>t?"next":"prev");a.flexAnimate(n,i.pauseOnAction)}),i.pausePlay&&m.pausePlay.setup(),i.slideshow&&(i.pauseOnHover&&a.hover(function(){!a.manualPlay&&!a.manualPause&&a.pause()},function(){!a.manualPause&&!a.manualPlay&&a.play()}),0<i.initDelay?setTimeout(a.play,i.initDelay):a.play()),s&&i.touch&&m.touch(),(!u||u&&i.smoothHeight)&&e(window).bind("resize focus",m.resize),setTimeout(function(){i.start(a)},200)},asNav:{setup:function(){a.asNav=!0,a.animatingTo=Math.floor(a.currentSlide/a.move),a.currentItem=a.currentSlide,a.slides.removeClass(o+"active-slide").eq(a.currentItem).addClass(o+"active-slide"),a.slides.click(function(t){t.preventDefault(),t=e(this);var n=t.index();!e(i.asNavFor).data("flexslider").animating&&!t.hasClass("active")&&(a.direction=a.currentItem<n?"next":"prev",a.flexAnimate(n,i.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){a.manualControls?m.controlNav.setupManual():m.controlNav.setupPaging()},setupPaging:function(){var t,n=1;if(a.controlNavScaffold=e('<ol class="'+o+"control-nav "+o+("thumbnails"===i.controlNav?"control-thumbs":"control-paging")+'"></ol>'),1<a.pagingCount)for(var l=0;l<a.pagingCount;l++)t="thumbnails"===i.controlNav?'<img src="'+a.slides.eq(l).attr("data-thumb")+'"/>':"<a>"+n+"</a>",a.controlNavScaffold.append("<li>"+t+"</li>"),n++;a.controlsContainer?e(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold),m.controlNav.set(),m.controlNav.active(),a.controlNavScaffold.delegate("a, img",r,function(t){t.preventDefault(),t=e(this);var n=a.controlNav.index(t);t.hasClass(o+"active")||(a.direction=n>a.currentSlide?"next":"prev",a.flexAnimate(n,i.pauseOnAction))}),s&&a.controlNavScaffold.delegate("a","click touchstart",function(e){e.preventDefault()})},setupManual:function(){a.controlNav=a.manualControls,m.controlNav.active(),a.controlNav.live(r,function(t){t.preventDefault(),t=e(this);var n=a.controlNav.index(t);t.hasClass(o+"active")||(a.direction=n>a.currentSlide?"next":"prev",a.flexAnimate(n,i.pauseOnAction))}),s&&a.controlNav.live("click touchstart",function(e){e.preventDefault()})},set:function(){a.controlNav=e("."+o+"control-nav li "+("thumbnails"===i.controlNav?"img":"a"),a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(o+"active").eq(a.animatingTo).addClass(o+"active")},update:function(t,n){1<a.pagingCount&&"add"===t?a.controlNavScaffold.append(e("<li><a>"+a.count+"</a></li>")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(n).closest("li").remove(),m.controlNav.set(),1<a.pagingCount&&a.pagingCount!==a.controlNav.length?a.update(n,t):m.controlNav.active()}},directionNav:{setup:function(){var t=e('<ul class="'+o+'direction-nav"><li><a class="'+o+'prev" href="#">'+i.prevText+'</a></li><li><a class="'+o+'next" href="#">'+i.nextText+"</a></li></ul>");a.controlsContainer?(e(a.controlsContainer).append(t),a.directionNav=e("."+o+"direction-nav li a",a.controlsContainer)):(a.append(t),a.directionNav=e("."+o+"direction-nav li a",a)),m.directionNav.update(
68),a.directionNav.bind(r,function(t){t.preventDefault(),t=a.getTarget(e(this).hasClass(o+"next")?"next":"prev"),a.flexAnimate(t,i.pauseOnAction)}),s&&a.directionNav.bind("click touchstart",function(e){e.preventDefault()})},update:function(){var e=o+"disabled";1===a.pagingCount?a.directionNav.addClass(e):i.animationLoop?a.directionNav.removeClass(e):0===a.animatingTo?a.directionNav.removeClass(e).filter("."+o+"prev").addClass(e):a.animatingTo===a.last?a.directionNav.removeClass(e).filter("."+o+"next").addClass(e):a.directionNav.removeClass(e)}},pausePlay:{setup:function(){var t=e('<div class="'+o+'pauseplay"><a></a></div>');a.controlsContainer?(a.controlsContainer.append(t),a.pausePlay=e("."+o+"pauseplay a",a.controlsContainer)):(a.append(t),a.pausePlay=e("."+o+"pauseplay a",a)),m.pausePlay.update(i.slideshow?o+"pause":o+"play"),a.pausePlay.bind(r,function(t){t.preventDefault(),e(this).hasClass(o+"pause")?(a.manualPause=!0,a.manualPlay=!1,a.pause()):(a.manualPause=!1,a.manualPlay=!0,a.play())}),s&&a.pausePlay.bind("click touchstart",function(e){e.preventDefault()})},update:function(e){"play"===e?a.pausePlay.removeClass(o+"pause").addClass(o+"play").text(i.playText):a.pausePlay.removeClass(o+"play").addClass(o+"pause").text(i.pauseText)}},touch:function(){function e(e){m=l?o-e.touches[0].pageY:o-e.touches[0].pageX,f=l?Math.abs(m)<Math.abs(e.touches[0].pageX-s):Math.abs(m)<Math.abs(e.touches[0].pageY-s),(!f||500<Number(new Date)-v)&&(e.preventDefault(),!u&&a.transitions&&(i.animationLoop||(m/=0===a.currentSlide&&0>m||a.currentSlide===a.last&&m>0?Math.abs(m)/p+2:1),a.setProps(r+m,"setTouch")))}function n(){if(t.removeEventListener("touchmove",e,!1),a.animatingTo===a.currentSlide&&!f&&null!==m){var l=c?-m:m,d=a.getTarget(l>0?"next":"prev");a.canAdvance(d)&&(550>Number(new Date)-v&&50<Math.abs(l)||Math.abs(l)>p/2)?a.flexAnimate(d,i.pauseOnAction):u||a.flexAnimate(a.currentSlide,i.pauseOnAction,!0)}t.removeEventListener("touchend",n,!1),r=m=s=o=null}var o,s,r,p,m,v,f=!1;t.addEventListener("touchstart",function(u){a.animating?u.preventDefault():1===u.touches.length&&(a.pause(),p=l?a.h:a.w,v=Number(new Date),r=d&&c&&a.animatingTo===a.last?0:d&&c?a.limit-(a.itemW+i.itemMargin)*a.move*a.animatingTo:d&&a.currentSlide===a.last?a.limit:d?(a.itemW+i.itemMargin)*a.move*a.currentSlide:c?(a.last-a.currentSlide+a.cloneOffset)*p:(a.currentSlide+a.cloneOffset)*p,o=l?u.touches[0].pageY:u.touches[0].pageX,s=l?u.touches[0].pageX:u.touches[0].pageY,t.addEventListener("touchmove",e,!1),t.addEventListener("touchend",n,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(d||a.doMath(),u?m.smoothHeight():d?(a.slides.width(a.computedW),a.update(a.pagingCount),a.setProps()):l?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(i.smoothHeight&&m.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(e){if(!l||u){var t=u?a:a.viewport;e?t.animate({height:a.slides.eq(a.animatingTo).height()},e):t.height(a.slides.eq(a.animatingTo).height())}},sync:function(t){var n=e(i.sync).data("flexslider"),o=a.animatingTo;switch(t){case"animate":n.flexAnimate(o,i.pauseOnAction,!1,!0);break;case"play":!n.playing&&!n.asNav&&n.play();break;case"pause":n.pause()}}},a.flexAnimate=function(t,n,r,v,f){if(p&&1===a.pagingCount&&(a.direction=a.currentItem<t?"next":"prev"),!a.animating&&(a.canAdvance(t,f)||r)&&a.is(":visible")){if(p&&v){if(r=e(i.asNavFor).data("flexslider"),a.atEnd=0===t||t===a.count-1,r.flexAnimate(t,!0,!1,!0,f),a.direction=a.currentItem<t?"next":"prev",r.direction=a.direction,Math.ceil((t+1)/a.visible)-1===a.currentSlide||0===t)return a.currentItem=t,a.slides.removeClass(o+"active-slide").eq(t).addClass(o+"active-slide"),!1;a.currentItem=t,a.slides.removeClass(o+"active-slide").eq(t).addClass(o+"active-slide"),t=Math.floor(t/a.visible)}if(a.animating=!0,a.animatingTo=t,i.before(a),n&&a.pause(),a.syncExists&&!f&&m.sync("animate"),i.controlNav&&m.controlNav.active(),d||a.slides.removeClass(o+"active-slide").eq(t).addClass(o+"active-slide"),a.atEnd=0===t||t===a.last,i.directionNav&&m.directionNav.update(),t===a.last&&(i.end(a),i.animationLoop||a.pause()),u)s?(a.slides.eq(a.currentSlide).css({opacity:0,zIndex:1}),a.slides.eq(t).css({opacity:1,zIndex:2}),a.slides.unbind("webkitTransitionEnd transitionend"),a.slides.eq(a.currentSlide).bind("webkitTransitionEnd transitionend",function(){i.after(a)}),a.animating=!1,a.currentSlide=a.animatingTo):(a.slides.eq(a.currentSlide).fadeOut(i.animationSpeed,i.easing),a.slides.eq(t).fadeIn(i.animationSpeed,i.easing,a.wrapup));else{var g=l?a.slides.filter(":first").height():a.computedW;d?(t=i.itemWidth>a.w?2*i.itemMargin:i.itemMargin,t=(a.itemW+t)*a.move*a.animatingTo,t=t>a.limit&&1!==a.visible?a.limit:t):t=0===a.currentSlide&&t===a.count-1&&i.animationLoop&&"next"!==a.direction?c?(a.count+a.cloneOffset)*g:0:a.currentSlide===a.last&&0===t&&i.animationLoop&&"prev"!==a.direction?c?0:(a.c
68ount+1)*g:c?(a.count-1-t+a.cloneOffset)*g:(t+a.cloneOffset)*g,a.setProps(t,"",i.animationSpeed),a.transitions?(i.animationLoop&&a.atEnd||(a.animating=!1,a.currentSlide=a.animatingTo),a.container.unbind("webkitTransitionEnd transitionend"),a.container.bind("webkitTransitionEnd transitionend",function(){a.wrapup(g)})):a.container.animate(a.args,i.animationSpeed,i.easing,function(){a.wrapup(g)})}i.smoothHeight&&m.smoothHeight(i.animationSpeed)}},a.wrapup=function(e){!u&&!d&&(0===a.currentSlide&&a.animatingTo===a.last&&i.animationLoop?a.setProps(e,"jumpEnd"):a.currentSlide===a.last&&0===a.animatingTo&&i.animationLoop&&a.setProps(e,"jumpStart")),a.animating=!1,a.currentSlide=a.animatingTo,i.after(a)},a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))},a.pause=function(){clearInterval(a.animatedSlides),a.playing=!1,i.pausePlay&&m.pausePlay.update("play"),a.syncExists&&m.sync("pause")},a.play=function(){a.animatedSlides=setInterval(a.animateSlides,i.slideshowSpeed),a.playing=!0,i.pausePlay&&m.pausePlay.update("pause"),a.syncExists&&m.sync("play")},a.canAdvance=function(e,t){var n=p?a.pagingCount-1:a.last;return t?!0:p&&a.currentItem===a.count-1&&0===e&&"prev"===a.direction?!0:p&&0===a.currentItem&&e===a.pagingCount-1&&"next"!==a.direction?!1:e!==a.currentSlide||p?i.animationLoop?!0:a.atEnd&&0===a.currentSlide&&e===n&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===n&&0===e&&"next"===a.direction?!1:!0:!1},a.getTarget=function(e){return a.direction=e,"next"===e?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1},a.setProps=function(e,t,n){var o,s=e?e:(a.itemW+i.itemMargin)*a.move*a.animatingTo;o=-1*function(){if(d)return"setTouch"===t?e:c&&a.animatingTo===a.last?0:c?a.limit-(a.itemW+i.itemMargin)*a.move*a.animatingTo:a.animatingTo===a.last?a.limit:s;switch(t){case"setTotal":return c?(a.count-1-a.currentSlide+a.cloneOffset)*e:(a.currentSlide+a.cloneOffset)*e;case"setTouch":return e;case"jumpEnd":return c?e:a.count*e;case"jumpStart":return c?a.count*e:e;default:return e}}()+"px",a.transitions&&(o=l?"translate3d(0,"+o+",0)":"translate3d("+o+",0,0)",n=void 0!==n?n/1e3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",n)),a.args[a.prop]=o,(a.transitions||void 0===n)&&a.container.css(a.args)},a.setup=function(t){if(u)a.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===t&&(s?a.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+i.animationSpeed/1e3+"s ease",zIndex:1}).eq(a.currentSlide).css({opacity:1,zIndex:2}):a.slides.eq(a.currentSlide).fadeIn(i.animationSpeed,i.easing)),i.smoothHeight&&m.smoothHeight();else{var n,r;"init"===t&&(a.viewport=e('<div class="'+o+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=0,c&&(r=e.makeArray(a.slides).reverse(),a.slides=e(r),a.container.empty().append(a.slides))),i.animationLoop&&!d&&(a.cloneCount=2,a.cloneOffset=1,"init"!==t&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone"))),a.newSlides=e(i.selector,a),n=c?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset,l&&!d?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){a.newSlides.css({display:"block"}),a.doMath(),a.viewport.height(a.h),a.setProps(n*a.h,"init")},"init"===t?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(n*a.computedW,"init"),setTimeout(function(){a.doMath(),a.newSlides.css({width:a.computedW,"float":"left",display:"block"}),i.smoothHeight&&m.smoothHeight()},"init"===t?100:0))}d||a.slides.removeClass(o+"active-slide").eq(a.currentSlide).addClass(o+"active-slide")},a.doMath=function(){var e=a.slides.first(),t=i.itemMargin,n=i.minItems,o=i.maxItems;a.w=a.width(),a.h=e.height(),a.boxPadding=e.outerWidth()-e.width(),d?(a.itemT=i.itemWidth+t,a.minW=n?n*a.itemT:a.w,a.maxW=o?o*a.itemT:a.w,a.itemW=a.minW>a.w?(a.w-t*n)/n:a.maxW<a.w?(a.w-t*o)/o:i.itemWidth>a.w?a.w:i.itemWidth,a.visible=Math.floor(a.w/(a.itemW+t)),a.move=0<i.move&&i.move<a.visible?i.move:a.visible,a.pagingCount=Math.ceil((a.count-a.visible)/a.move+1),a.last=a.pagingCount-1,a.limit=1===a.pagingCount?0:i.itemWidth>a.w?(a.itemW+2*t)*a.count-a.w-t:(a.itemW+t)*a.count-a.w-t):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1),a.computedW=a.itemW-a.boxPadding},a.update=function(e,t){a.doMath(),d||(e<a.currentSlide?a.currentSlide+=1:e<=a.currentSlide&&0!==e&&(a.currentSlide-=1),a.animatingTo=a.currentSlide),i.c
vendor: 2,132 bytes, lines 68-71
68ontrolNav&&!a.manualControls&&("add"===t&&!d||a.pagingCount>a.controlNav.length?m.controlNav.update("add"):("remove"===t&&!d||a.pagingCount<a.controlNav.length)&&(d&&a.currentSlide>a.last&&(a.currentSlide-=1,a.animatingTo-=1),m.controlNav.update("remove",a.last))),i.directionNav&&m.directionNav.update()},a.addSlide=function(t,n){var o=e(t);a.count+=1,a.last=a.count-1,l&&c?void 0!==n?a.slides.eq(a.count-n).after(o):a.container.prepend(o):void 0!==n?a.slides.eq(n).before(o):a.container.append(o),a.update(n,"add"),a.slides=e(i.selector+":not(.clone)",a),a.setup(),i.added(a)},a.removeSlide=function(t){var n=isNaN(t)?a.slides.index(e(t)):t;a.count-=1,a.last=a.count-1,isNaN(t)?e(t,a.slides).remove():l&&c?a.slides.eq(a.last).remove():a.slides.eq(t).remove(),a.doMath(),a.update(n,"remove"),a.slides=e(i.selector+":not(.clone)",a),a.setup(),i.removed(a)},m.init()},e.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}},e.fn.flexslider=function(t){if(void 0===t&&(t={}),"object"==typeof t)return this.each(function(){var n=e(this),a=n.find(t.selector?t.selector:".slides > li");1===a.length?(a.fadeIn(400),t.start&&t.start(n)):void 0==n.data("flexslider")&&new e.flexslider(this,t)});var n=e(this).data("flexslider");switch(t){case"play":n.play();break;case"pause":n.pause();break;case"next":n.flexAnimate(n.getTarget("next"),!0);break;case"prev":case"previous":n.flexAnimate(n.getTarget("prev"),!0);break;default:"number"==typeof t&&n.flexAnimate(t,!0)}}}(jQuery);
69
70
71/* Caroufredsel */
vendor: 54,468 bytes, lines 71-73
71
72(function($){function sc_setScroll(a,b,c){return"transition"==c.transition&&"swing"==b&&(b="ease"),{anims:[],duration:a,orgDuration:a,easing:b,startTime:getTime()}}function sc_startScroll(a,b){for(var c=0,d=a.anims.length;d>c;c++){var e=a.anims[c];e&&e[0][b.transition](e[1],a.duration,a.easing,e[2])}}function sc_stopScroll(a,b){is_boolean(b)||(b=!0),is_object(a.pre)&&sc_stopScroll(a.pre,b);for(var c=0,d=a.anims.length;d>c;c++){var e=a.anims[c];e[0].stop(!0),b&&(e[0].css(e[1]),is_function(e[2])&&e[2]())}is_object(a.post)&&sc_stopScroll(a.post,b)}function sc_afterScroll(a,b,c){switch(b&&b.remove(),c.fx){case"fade":case"crossfade":case"cover-fade":case"uncover-fade":a.css("opacity",1),a.css("filter","")}}function sc_fireCallbacks(a,b,c,d,e){if(b[c]&&b[c].call(a,d),e[c].length)for(var f=0,g=e[c].length;g>f;f++)e[c][f].call(a,d);return[]}function sc_fireQueue(a,b,c){return b.length&&(a.trigger(cf_e(b[0][0],c),b[0][1]),b.shift()),b}function sc_hideHiddenItems(a){a.each(function(){var a=$(this);a.data("_cfs_isHidden",a.is(":hidden")).hide()})}function sc_showHiddenItems(a){a&&a.each(function(){var a=$(this);a.data("_cfs_isHidden")||a.show()})}function sc_clearTimers(a){return a.auto&&clearTimeout(a.auto),a.progress&&clearInterval(a.progress),a}function sc_mapCallbackArguments(a,b,c,d,e,f,g){return{width:g.width,height:g.height,items:{old:a,skipped:b,visible:c},scroll:{items:d,direction:e,duration:f}}}function sc_getDuration(a,b,c,d){var e=a.duration;return"none"==a.fx?0:("auto"==e?e=b.scroll.duration/b.scroll.items*c:10>e&&(e=d/e),1>e?0:("fade"==a.fx&&(e/=2),Math.round(e)))}function nv_showNavi(a,b,c){var d=is_number(a.items.minimum)?a.items.minimum:a.items.visible+1;if("show"==b||"hide"==b)var e=b;else if(d>b){debug(c,"Not enough items ("+b+" total, "+d+" needed): Hiding navigation.");var e="hide"}else var e="show";var f="show"==e?"removeClass":"addClass",g=cf_c("hidden",c);a.auto.button&&a.auto.button[e]()[f](g),a.prev.button&&a.prev.button[e]()[f](g),a.next.button&&a.next.button[e]()[f](g),a.pagination.container&&a.pagination.container[e]()[f](g)}function nv_enableNavi(a,b,c){if(!a.circular&&!a.infinite){var d="removeClass"==b||"addClass"==b?b:!1,e=cf_c("disabled",c);if(a.auto.button&&d&&a.auto.button[d](e),a.prev.button){var f=d||0==b?"addClass":"removeClass";a.prev.button[f](e)}if(a.next.button){var f=d||b==a.items.visible?"addClass":"removeClass";a.next.button[f](e)}}}function go_getObject(a,b){return is_function(b)?b=b.call(a):is_undefined(b)&&(b={}),b}function go_getItemsObject(a,b){return b=go_getObject(a,b),is_number(b)?b={visible:b}:"variable"==b?b={visible:b,width:b,height:b}:is_object(b)||(b={}),b}function go_getScrollObject(a,b){return b=go_getObject(a,b),is_number(b)?b=50>=b?{items:b}:{duration:b}:is_string(b)?b={easing:b}:is_object(b)||(b={}),b}function go_getNaviObject(a,b){if(b=go_getObject(a,b),is_string(b)){var c=cf_getKeyCode(b);b=-1==c?$(b):c}return b}function go_getAutoObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={button:b}:is_boolean(b)?b={play:b}:is_number(b)&&(b={timeoutDuration:b}),b.progress&&(is_string(b.progress)||is_jquery(b.progress))&&(b.progress={bar:b.progress}),b}function go_complementAutoObject(a,b){return is_function(b.button)&&(b.button=b.button.call(a)),is_string(b.button)&&(b.button=$(b.button)),is_boolean(b.play)||(b.play=!0),is_number(b.delay)||(b.delay=0),is_undefined(b.pauseOnEvent)&&(b.pauseOnEvent=!0),is_boolean(b.pauseOnResize)||(b.pauseOnResize=!0),is_number(b.timeoutDuration)||(b.timeoutDuration=10>b.duration?2500:5*b.duration),b.progress&&(is_function(b.progress.bar)&&(b.progress.bar=b.progress.bar.call(a)),is_string(b.progress.bar)&&(b.progress.bar=$(b.progress.bar)),b.progress.bar?(is_function(b.progress.updater)||(b.progress.updater=$.fn.carouFredSel.progressbarUpdater),is_number(b.progress.interval)||(b.progress.interval=50)):b.progress=!1),b}function go_getPrevNextObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={button:b}:is_number(b)&&(b={key:b}),b}function go_complementPrevNextObject(a,b){return is_function(b.button)&&(b.button=b.button.call(a)),is_string(b.button)&&(b.button=$(b.button)),is_string(b.key)&&(b.key=cf_getKeyCode(b.key)),b}function go_getPaginationObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={container:b}:is_boolean(b)&&(b={keys:b}),b}function go_complementPaginationObject(a,b){return is_function(b.container)&&(b.container=b.container.call(a)),is_string(b.container)&&(b.container=$(b.container)),is_number(b.items)||(b.items=!1),is_boolean(b.keys)||(b.keys=!1),is_function(b.anchorBuilder)||is_false(b.anchorBuilder)||(b.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder),is_number(b.deviation)||(b.deviation=0),b}function go_getSwipeObject(a,b){return is_function(b)&&(b=b.call(a)),is_undefined(b)&&(b={onTouch:!1}),is_true(b)?b={onTouch:b}:is_number(b)&&(b={items:b}),b}function go_complementSwipeObject(a,b){return is_boolean(b.onTouch)||(b.onTouch=!0),is_boolean(b.onMouse)||(b.onMouse=!1),is_object(b.options)||(b.options={}),is_boolean(b.options.triggerOnTouchEnd)||(b.options.triggerOnTouchEnd=!1),b}function go_getMousewheelObject(a,b){return is_function(b)&&(b=b.call(a)),is_true(b)?b={}:is_number(b)?b={items:b}:is_undefined(b)&&(b=!1),b}function go_complementMousewheelObject(a,b){return b}function gn_getItemIndex(a,b,c,d,e){if(is_string(a)&&(a=$(a,e)),is_object(a)&&(a=$(a,e)),is_jquery(a)?(a=e.children().index(a),is_boolean(c)||(c=!1)):is_boolean(c)||(c=!0),is_number(a)||(a=0),is_number(b)||(b=0),c&&(a+=d.first),a+=b,d.total>0){for(;a>=d.total;)a-=d.total;for(;0>a;)a+=d.total}return a}function gn_getVisibleItemsPrev(a,b,c){for(var d=0,e=0,f=c;f>=0;f--){var g=a.eq(f);if(d+=g.is(":visible")?g[b.d.outerWidth](!0):0,d>b.maxDimension)return e;0==f&&(f=a.length),e++}}function gn_getVisibleItemsPrevFilter(a,b,c){return gn_getItemsPrevFilter(a,b.items.filter,b.items.visibleConf.org,c)}function gn_getScrollItemsPrevFilter(a,b,c,d){return gn_getItemsPrevFilter(a,b.items.filter,d,c)}function gn_getItemsPrevFilter(a,b,c,d){for(var e=0,f=0,g=d,h=a.length;g>=0;g--){if(f++,f==h)return f;var i=a.eq(g);if(i.is(b)&&(e++,e==c))return f;0==g&&(g=h)}}function gn_getVisibleOrg(a,b){return b.items.visibleConf.org||a.children().slice(0,b.items.visible).filter(b.items.filter).length}function gn_getVisibleItemsNext(a,b,c){for(var d=0,e=0,f=c,g=a.length-1;g>=f;f++){var h=a.eq(f);if(d+=h.is(":visible")?h[b.d.outerWidth](!0):0,d>b.maxDimension)return e;if(e++,e==g+1)return e;f==g&&(f=-1)}}function gn_getVisibleItemsNextTestCircular(a,b,c,d){var e=gn_getVisibleItemsNext(a,b,c);return b.circular||c+e>d&&(e=d-c),e}function gn_getVisibleItemsNextFilter(a,b,c){return gn_getItemsNextFilter(a,b.items.filter,b.items.visibleConf.org,c,b.circular)}function gn_getScrollItemsNextFilter(a,b,c,d){return gn_getItemsNextFilter(a,b.items.filter,d+1,c,b.circular)-1}function gn_getItemsNextFilter(a,b,c,d){for(var f=0,g=0,h=d,i=a.length-1;i>=h;h++){if(g++,g>=i)return g;var j=a.eq(h);if(j.is(b)&&(f++,f==c))return g;h==i&&(h=-1)}}function gi_getCurrentItems(a,b){return a.slice(0,b.items.visible)}function gi_getOldItemsPrev(a,b,c){return a.slice(c,b.items.visibleConf.old+c)}function gi_getNewItemsPrev(a,b){return a.slice(0,b.items.visible)}function gi_getOldItemsNext(a,b){return a.slice(0,b.items.visibleConf.old)}function gi_getNewItemsNext(a,b,c){return a.slice(c,b.items.visible+c)}function sz_storeMargin(a,b,c){b.usePadding&&(is_string(c)||(c="_cfs_origCssMargin"),a.each(function(){var a=$(this),d=parseInt(a.css(b.d.marginRight),10);is_number(d)||(d=0),a.data(c,d)}))}function sz_resetMargin(a,b,c){if(b.usePadding){var d=is_boolean(c)?c:!1;is_number(c)||(c=0),sz_storeMargin(a,b,"_cfs_tempCssMargin"),a.each(function(){var a=$(this);a.css(b.d.marginRight,d?a.data("_cfs_tempCssMargin"):c+a.data("_cfs_origCssMargin"))})}}function sz_storeOrigCss(a){a.each(function(){var a=$(this);a.data("_cfs_origCss",a.attr("style")||"")})}function sz_restoreOrigCss(a){a.each(function(){var a=$(this);a.attr("style",a.data("_cfs_origCss")||"")})}function sz_setResponsiveSizes(a,b){var d=(a.items.visible,a.items[a.d.width]),e=a[a.d.height],f=is_percentage(e);b.each(function(){var b=$(this),c=d-ms_getPaddingBorderMargin(b,a,"Width");b[a.d.width](c),f&&b[a.d.height](ms_getPercentage(c,e))})}function sz_setSizes(a,b){var c=a.parent(),d=a.children(),e=gi_getCurrentItems(d,b),f=cf_mapWrapperSizes(ms_getSizes(e,b,!0),b,!1);if(c.css(f),b.usePadding){var g=b.padding,h=g[b.d[1]];b.align&&0>h&&(h=0);var i=e.last();i.css(b.d.marginRight,i.data("_cfs_origCssMargin")+h),a.css(b.d.top,g[b.d[0]]),a.css(b.d.left,g[b.d[3]])}return a.css(b.d.width,f[b.d.width]+2*ms_getTotalSize(d,b,"width")),a.css(b.d.height,ms_getLargestSize(d,b,"height")),f}function ms_getSizes(a,b,c){return[ms_getTotalSize(a,b,"width",c),ms_getLargestSize(a,b,"height",c)]}function ms_getLargestSize(a,b,c,d){return is_boolean(d)||(d=!1),is_number(b[b.d[c]])&&d?b[b.d[c]]:is_number(b.items[b.d[c]])?b.items[b.d[c]]:(c=c.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",ms_getTrueLargestSize(a,b,c))}function ms_getTrueLargestSize(a,b,c){for(var d=0,e=0,f=a.length;f>e;e++){var g=a.eq(e),h=g.is(":visible")?g[b.d[c]](!0):0;h>d&&(d=h)}return d}function ms_getTotalSize(a,b,c,d){if(is_boolean(d)||(d=!1),is_number(b[b.d[c]])&&d)return b[b.d[c]];if(is_number(b.items[b.d[c]]))return b.items[b.d[c]]*a.length;for(var e=c.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",f=0,g=0,h=a.length;h>g;g++){var i=a.eq(g);f+=i.is(":visible")?i[b.d[e]](!0):0}return f}function ms_getParentSize(a,b,c){var d=a.is(":visible");d&&a.hide();var e=a.parent()[b.d[c]]();return d&&a.show(),e}function ms_getMaxDimension(a,b){return is_number(a[a.d.width])?a[a.d.width]:b}function ms_hasVariableSizes(a,b,c){for(var d=!1,e=!1,f=0,g=a.length;g>f;f++){var h=a.eq(f),i=h.is(":visible")?h[b.d[c]](!0):0;d===!1?d=i:d!=i&&(e=!0),0==d&&(e=!0)}return e}function ms_getPaddingBorderMargin(a,b,c){return a[b.d["outer"+c]](!0)-a[b.d[c.toLowerCase()]]()}function ms_getPercentage(a,b){if(is_percentage(b)){if(b=parseInt(b.slice(0,-1),10),!is_number(b))return a;a*=b/100}return a}function cf_e(a,b,c,d,e){return is_boolean(c)||(c=!0),is_boolean(d)||(d=!0),is_boolean(e)||(e=!1),c&&(a=b.events.prefix+a),d&&(a=a+"."+b.events.namespace),d&&e&&(a+=b.serialNumber),a}function cf_c(a,b){return is_string(b.classnames[a])?b.classnames[a]:a}function cf_mapWrapperSizes(a,b,c){is_boolean(c)||(c=!0);var d=b.usePadding&&c?b.padding:[0,0,0,0],e={};return e[b.d.width]=a[0]+d[1]+d[3],e[b.d.height]=a[1]+d[0]+d[2],e}function cf_sortParams(a,b){for(var c=[],d=0,e=a.length;e>d;d++)for(var f=0,g=b.length;g>f;f++)if(b[f].indexOf(typeof a[d])>-1&&is_undefined(c[f])){c[f]=a[d];break}return c}function cf_getPadding(a){if(is_undefined(a))return[0,0,0,0];if(is_number(a))return[a,a,a,a];if(is_string(a)&&(a=a.split("px").join("").split("em").join("").split(" ")),!is_array(a))return[0,0,0,0];for(var b=0;4>b;b++)a[b]=parseInt(a[b],10);switch(a.length){case 0:return[0,0,0,0];case 1:return[a[0],a[0],a[0],a[0]];case 2:return[a[0],a[1],a[0],a[1]];case 3:return[a[0],a[1],a[2],a[1]];default:return[a[0],a[1],a[2],a[3]]}}function cf_getAlignPadding(a,b){var c=is_number(b[b.d.width])?Math.ceil(b[b.d.width]-ms_getTotalSize(a,b,"width")):0;switch(b.align){case"left":return[0,c];case"right":return[c,0];case"center":default:return[Math.ceil(c/2),Math.floor(c/2)]}}function cf_getDimensions(a){for(var b=[["width","innerWidth","outerWidth","height","innerHeight","outerHeight","left","top","marginRight",0,1,2,3],["height","innerHeight","outerHeight","width","innerWidth","outerWidth","top","left","marginBottom",3,2,1,0]],c=b[0].length,d="right"==a.direction||"left"==a.direction?0:1,e={},f=0;c>f;f++)e[b[0][f]]=b[d][f];return e}function cf_getAdjust(a,b,c,d){var e=a;if(is_function(c))e=c.call(d,e);else if(is_string(c)){var f=c.split("+"),g=c.split("-");if(g.length>f.length)var h=!0,i=g[0],j=g[1];else var h=!1,i=f[0],j=f[1];switch(i){case"even":e=1==a%2?a-1:a;break;case"odd":e=0==a%2?a-1:a;break;default:e=a}j=parseInt(j,10),is_number(j)&&(h&&(j=-j),e+=j)}return(!is_number(e)||1>e)&&(e=1),e}function cf_getItemsAdjust(a,b,c,d){return cf_getItemAdjustMinMax(cf_getAdjust(a,b,c,d),b.items.visibleConf)}function cf_getItemAdjustMinMax(a,b){return is_number(b.min)&&b.min>a&&(a=b.min),is_number(b.max)&&a>b.max&&(a=b.max),1>a&&(a=1),a}function cf_getSynchArr(a){is_array(a)||(a=[[a]]),is_array(a[0])||(a=[a]);for(var b=0,c=a.length;c>b;b++)is_string(a[b][0])&&(a[b][0]=$(a[b][0])),is_boolean(a[b][1])||(a[b][1]=!0),is_boolean(a[b][2])||(a[b][2]=!0),is_number(a[b][3])||(a[b][3]=0);return a}function cf_getKeyCode(a){return"right"==a?39:"left"==a?37:"up"==a?38:"down"==a?40:-1}function cf_setCookie(a,b,c){if(a){var d=b.triggerHandler(cf_e("currentPosition",c));$.fn.carouFredSel.cookie.set(a,d)}}function cf_getCookie(a){var b=$.fn.carouFredSel.cookie.get(a);return""==b?0:b}function in_mapCss(a,b){for(var c={},d=0,e=b.length;e>d;d++)c[b[d]]=a.css(b[d]);return c}function in_complementItems(a,b,c,d){return is_object(a.visibleConf)||(a.visibleConf={}),is_object(a.sizesConf)||(a.sizesConf={}),0==a.start&&is_number(d)&&(a.start=d),is_object(a.visible)?(a.visibleConf.min=a.visible.min,a.visibleConf.max=a.visible.max,a.visible=!1):is_string(a.visible)?("variable"==a.visible?a.visibleConf.variable=!0:a.visibleConf.adjust=a.visible,a.visible=!1):is_function(a.visible)&&(a.visibleConf.adjust=a.visible,a.visible=!1),is_string(a.filter)||(a.filter=c.filter(":hidden").length>0?":visible":"*"),a[b.d.width]||(b.responsive?(debug(!0,"Set a "+b.d.width+" for the items!"),a[b.d.width]=ms_getTrueLargestSize(c,b,"outerWidth")):a[b.d.width]=ms_hasVariableSizes(c,b,"outerWidth")?"variable":c[b.d.outerWidth](!0)),a[b.d.height]||(a[b.d.height]=ms_hasVariableSizes(c,b,"outerHeight")?"variable":c[b.d.outerHeight](!0)),a.sizesConf.width=a.width,a.sizesConf.height=a.height,a}function in_complementVisibleItems(a,b){return"variable"==a.items[a.d.width]&&(a.items.visibleConf.variable=!0),a.items.visibleConf.variable||(is_number(a[a.d.width])?a.items.visible=Math.floor(a[a.d.width]/a.items[a.d.width]):(a.items.visible=Math.floor(b/a.items[a.d.width]),a[a.d.width]=a.items.visible*a.items[a.d.width],a.items.visibleConf.adjust||(a.align=!1)),("Infinity"==a.items.visible||1>a.items.visible)&&(debug(!0,'Not a valid number of visible items: Set to "variable".'),a.items.visibleConf.variable=!0)),a}function in_complementPrimarySize(a,b,c){return"auto"==a&&(a=ms_getTrueLargestSize(c,b,"outerWidth")),a}function in_complementSecondarySize(a,b,c){return"auto"==a&&(a=ms_getTrueLargestSize(c,b,"outerHeight")),a||(a=b.items[b.d.height]),a}function in_getAlignPadding(a,b){var c=cf_getAlignPadding(gi_getCurrentItems(b,a),a);return a.padding[a.d[1]]=c[1],a.padding[a.d[3]]=c[0],a}function in_getResponsiveValues(a,b){var d=cf_getItemAdjustMinMax(Math.ceil(a[a.d.width]/a.items[a.d.width]),a.items.visibleConf);d>b.length&&(d=b.length);var e=Math.floor(a[a.d.width]/d);return a.items.visible=d,a.items[a.d.width]=e,a[a.d.width]=d*e,a}function bt_pauseOnHoverConfig(a){if(is_string(a))var b=a.indexOf("immediate")>-1?!0:!1,c=a.indexOf("resume")>-1?!0:!1;else var b=c=!1;return[b,c]}function bt_mousesheelNumber(a){return is_number(a)?a:null}function is_null(a){return null===a}function is_undefined(a){return is_null(a)||a===void 0||""===a||"undefined"===a}function is_array(a){return a instanceof Array}function is_jquery(a){return a instanceof jQuery}function is_object(a){return(a instanceof Object||"object"==typeof a)&&!is_null(a)&&!is_jquery(a)&&!is_array(a)&&!is_function(a)}function is_number(a){return(a instanceof Number||"number"==typeof a)&&!isNaN(a)}function is_string(a){return(a instanceof String||"string"==typeof a)&&!is_undefined(a)&&!is_true(a)&&!is_false(a)}function is_function(a){return a instanceof Function||"function"==typeof a}function is_boolean(a){return a instanceof Boolean||"boolean"==typeof a||is_true(a)||is_false(a)}function is_true(a){return a===!0||"true"===a}function is_false(a){return a===!1||"false"===a}function is_percentage(a){return is_string(a)&&"%"==a.slice(-1)}function getTime(){return(new Date).getTime()}function deprecated(a,b){debug(!0,a+" is DEPRECATED, support for it will be removed. Use "+b+" instead.")}function debug(a,b){if(!is_undefined(window.console)&&!is_undefined(window.console.log)){if(is_object(a)){var c=" ("+a.selector+")";a=a.debug}else var c="";if(!a)return!1;b=is_string(b)?"carouFredSel"+c+": "+b:["carouFredSel"+c+":",b],window.console.log(b)}return!1}$.fn.carouFredSel||($.fn.caroufredsel=$.fn.carouFredSel=function(options,configs){if(0==this.length)return debug(!0,'No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){$(this).carouFredSel(options,configs)});var $cfs=this,$tt0=this[0],starting_position=!1;$cfs.data("_cfs_isCarousel")&&(starting_position=$cfs.triggerHandler("_cfs_triggerEvent","currentPosition"),$cfs.trigger("_cfs_triggerEvent",["destroy",!0]));var FN={};FN._init=function(a,b,c){a=go_getObject($tt0,a),a.items=go_getItemsObject($tt0,a.items),a.scroll=go_getScrollObject($tt0,a.scroll),a.auto=go_getAutoObject($tt0,a.auto),a.prev=go_getPrevNextObject($tt0,a.prev),a.next=go_getPrevNextObject($tt0,a.next),a.pagination=go_getPaginationObject($tt0,a.pagination),a.swipe=go_getSwipeObject($tt0,a.swipe),a.mousewheel=go_getMousewheelObject($tt0,a.mousewheel),b&&(opts_orig=$.extend(!0,{},$.fn.carouFredSel.defaults,a)),opts=$.extend(!0,{},$.fn.carouFredSel.defaults,a),opts.d=cf_getDimensions(opts),crsl.direction="up"==opts.direction||"left"==opts.direction?"next":"prev";var d=$cfs.children(),e=ms_getParentSize($wrp,opts,"width");if(is_true(opts.cookie)&&(opts.cookie="caroufredsel_cookie_"+conf.serialNumber),opts.maxDimension=ms_getMaxDimension(opts,e),opts.items=in_complementItems(opts.items,opts,d,c),opts[opts.d.width]=in_complementPrimarySize(opts[opts.d.width],opts,d),opts[opts.d.height]=in_complementSecondarySize(opts[opts.d.height],opts,d),opts.responsive&&(is_percentage(opts[opts.d.width])||(opts[opts.d.width]="100%")),is_percentage(opts[opts.d.width])&&(crsl.upDateOnWindowResize=!0,crsl.primarySizePercentage=opts[opts.d.width],opts[opts.d.width]=ms_getPercentage(e,crsl.primarySizePercentage),opts.items.visible||(opts.items.visibleConf.variable=!0)),opts.responsive?(opts.usePadding=!1,opts.padding=[0,0,0,0],opts.align=!1,opts.items.visibleConf.variable=!1):(opts.items.visible||(opts=in_complementVisibleItems(opts,e)),opts[opts.d.width]||(!opts.items.visibleConf.variable&&is_number(opts.items[opts.d.width])&&"*"==opts.items.filter?(opts[opts.d.width]=opts.items.visible*opts.items[opts.d.width],opts.align=!1):opts[opts.d.width]="variable"),is_undefined(opts.align)&&(opts.align=is_number(opts[opts.d.width])?"center":!1),opts.items.visibleConf.variable&&(opts.items.visible=gn_getVisibleItemsNext(d,opts,0))),"*"==opts.items.filter||opts.items.visibleConf.variable||(opts.items.visibleConf.org=opts.items.visible,opts.items.visible=gn_getVisibleItemsNextFilter(d,opts,0)),opts.items.visible=cf_getItemsAdjust(opts.items.visible,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts.responsive)opts.items.visibleConf.min||(opts.items.visibleConf.min=opts.items.visible),opts.items.visibleConf.max||(opts.items.visibleConf.max=opts.items.visible),opts=in_getResponsiveValues(opts,d,e);else switch(opts.padding=cf_getPadding(opts.padding),"top"==opts.align?opts.align="left":"bottom"==opts.align&&(opts.align="right"),opts.align){case"center":case"left":case"right":"variable"!=opts[opts.d.width]&&(opts=in_getAlignPadding(opts,d),opts.usePadding=!0);break;default:opts.align=!1,opts.usePadding=0==opts.padding[0]&&0==opts.padding[1]&&0==opts.padding[2]&&0==opts.padding[3]?!1:!0}is_number(opts.scroll.duration)||(opts.scroll.duration=500),is_undefined(opts.scroll.items)&&(opts.scroll.items=opts.responsive||opts.items.visibleConf.variable||"*"!=opts.items.filter?"visible":opts.items.visible),opts.auto=$.extend(!0,{},opts.scroll,opts.auto),opts.prev=$.extend(!0,{},opts.scroll,opts.prev),opts.next=$.extend(!0,{},opts.scroll,opts.next),opts.pagination=$.extend(!0,{},opts.scroll,opts.pagination),opts.auto=go_complementAutoObject($tt0,opts.auto),opts.prev=go_complementPrevNextObject($tt0,opts.prev),opts.next=go_complementPrevNextObject($tt0,opts.next),opts.pagination=go_complementPaginationObject($tt0,opts.pagination),opts.swipe=go_complementSwipeObject($tt0,opts.swipe),opts.mousewheel=go_complementMousewheelObject($tt0,opts.mousewheel),opts.synchronise&&(opts.synchronise=cf_getSynchArr(opts.synchronise)),opts.auto.onPauseStart&&(opts.auto.onTimeoutStart=opts.auto.onPauseStart,deprecated("auto.onPauseStart","auto.onTimeoutStart")),opts.auto.onPausePause&&(opts.auto.onTimeoutPause=opts.auto.onPausePause,deprecated("auto.onPausePause","auto.onTimeoutPause")),opts.auto.onPauseEnd&&(opts.auto.onTimeoutEnd=opts.auto.onPauseEnd,deprecated("auto.onPauseEnd","auto.onTimeoutEnd")),opts.auto.pauseDuration&&(opts.auto.timeoutDuration=opts.auto.pauseDuration,deprecated("auto.pauseDuration","auto.timeoutDuration"))},FN._build=function(){$cfs.data("_cfs_isCarousel",!0);var a=$cfs.children(),b=in_mapCss($cfs,["textAlign","float","position","top","right","bottom","left","zIndex","width","height","marginTop","marginRight","marginBottom","marginLeft"]),c="relative";switch(b.position){case"absolute":case"fixed":c=b.position}"parent"==conf.wrapper?sz_storeOrigCss($wrp):$wrp.css(b),$wrp.css({overflow:"hidden",position:c}),sz_storeOrigCss($cfs),$cfs.data("_cfs_origCssZindex",b.zIndex),$cfs.css({textAlign:"left","float":"none",position:"absolute",top:0,right:"auto",bottom:"auto",left:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),sz_storeMargin(a,opts),sz_storeOrigCss(a),opts.responsive&&sz_setResponsiveSizes(opts,a)},FN._bind_events=function(){FN._unbind_events(),$cfs.bind(cf_e("stop",conf),function(a,b){return a.stopPropagation(),crsl.isStopped||opts.auto.button&&opts.auto.button.addClass(cf_c("stopped",conf)),crsl.isStopped=!0,opts.auto.play&&(opts.auto.play=!1,$cfs.trigger(cf_e("pause",conf),b)),!0}),$cfs.bind(cf_e("finish",conf),function(a){return a.stopPropagation(),crsl.isScrolling&&sc_stopScroll(scrl),!0}),$cfs.bind(cf_e("pause",conf),function(a,b,c){if(a.stopPropagation(),tmrs=sc_clearTimers(tmrs),b&&crsl.isScrolling){scrl.isStopped=!0;var d=getTime()-scrl.startTime;scrl.duration-=d,scrl.pre&&(scrl.pre.duration-=d),scrl.post&&(scrl.post.duration-=d),sc_stopScroll(scrl,!1)}if(crsl.isPaused||crsl.isScrolling||c&&(tmrs.timePassed+=getTime()-tmrs.startTime),crsl.isPaused||opts.auto.button&&opts.auto.button.addClass(cf_c("paused",conf)),crsl.isPaused=!0,opts.auto.onTimeoutPause){var e=opts.auto.timeoutDuration-tmrs.timePassed,f=100-Math.ceil(100*e/opts.auto.timeoutDuration);opts.auto.onTimeoutPause.call($tt0,f,e)}return!0}),$cfs.bind(cf_e("play",conf),function(a,b,c,d){a.stopPropagation(),tmrs=sc_clearTimers(tmrs);var e=[b,c,d],f=["string","number","boolean"],g=cf_sortParams(e,f);if(b=g[0],c=g[1],d=g[2],"prev"!=b&&"next"!=b&&(b=crsl.direction),is_number(c)||(c=0),is_boolean(d)||(d=!1),d&&(crsl.isStopped=!1,opts.auto.play=!0),!opts.auto.play)return a.stopImmediatePropagation(),debug(conf,"Carousel stopped: Not scrolling.");crsl.isPaused&&opts.auto.button&&(opts.auto.button.removeClass(cf_c("stopped",conf)),opts.auto.button.removeClass(cf_c("paused",conf))),crsl.isPaused=!1,tmrs.startTime=getTime();var h=opts.auto.timeoutDuration+c;return dur2=h-tmrs.timePassed,perc=100-Math.ceil(100*dur2/h),opts.auto.progress&&(tmrs.progress=setInterval(function(){var a=getTime()-tmrs.startTime+tmrs.timePassed,b=Math.ceil(100*a/h);opts.auto.progress.updater.call(opts.auto.progress.bar[0],b)},opts.auto.progress.interval)),tmrs.auto=setTimeout(function(){opts.auto.progress&&opts.auto.progress.updater.call(opts.auto.progress.bar[0],100),opts.auto.onTimeoutEnd&&opts.auto.onTimeoutEnd.call($tt0,perc,dur2),crsl.isScrolling?$cfs.trigger(cf_e("play",conf),b):$cfs.trigger(cf_e(b,conf),opts.auto)},dur2),opts.auto.onTimeoutStart&&opts.auto.onTimeoutStart.call($tt0,perc,dur2),!0}),$cfs.bind(cf_e("resume",conf),function(a){return a.stopPropagation(),scrl.isStopped?(scrl.isStopped=!1,crsl.isPaused=!1,crsl.isScrolling=!0,scrl.startTime=getTime(),sc_startScroll(scrl,conf)):$cfs.trigger(cf_e("play",conf)),!0}),$cfs.bind(cf_e("prev",conf)+" "+cf_e("next",conf),function(a,b,c,d,e){if(a.stopPropagation(),crsl.isStopped||$cfs.is(":hidden"))return a.stopImmediatePropagation(),debug(conf,"Carousel stopped or hidden: Not scrolling.");var f=is_number(opts.items.minimum)?opts.items.minimum:opts.items.visible+1;if(f>itms.total)return a.stopImmediatePropagation(),debug(conf,"Not enough items ("+itms.total+" total, "+f+" needed): Not scrolling.");var g=[b,c,d,e],h=["object","number/string","function","boolean"],i=cf_sortParams(g,h);b=i[0],c=i[1],d=i[2],e=i[3];var j=a.type.slice(conf.events.prefix.length);if(is_object(b)||(b={}),is_function(d)&&(b.onAfter=d),is_boolean(e)&&(b.queue=e),b=$.extend(!0,{},opts[j],b),b.conditions&&!b.conditions.call($tt0,j))return a.stopImmediatePropagation(),debug(conf,'Callback "conditions" returned false.');if(!is_number(c)){if("*"!=opts.items.filter)c="visible";else for(var k=[c,b.items,opts[j].items],i=0,l=k.length;l>i;i++)if(is_number(k[i])||"page"==k[i]||"visible"==k[i]){c=k[i];break}switch(c){case"page":return a.stopImmediatePropagation(),$cfs.triggerHandler(cf_e(j+"Page",conf),[b,d]);case"visible":opts.items.visibleConf.variable||"*"!=opts.items.filter||(c=opts.items.visible)}}if(scrl.isStopped)return $cfs.trigger(cf_e("resume",conf)),$cfs.trigger(cf_e("queue",conf),[j,[b,c,d]]),a.stopImmediatePropagation(),debug(conf,"Carousel resumed scrolling.");if(b.duration>0&&crsl.isScrolling)return b.queue&&("last"==b.queue&&(queu=[]),("first"!=b.queue||0==queu.length)&&$cfs.trigger(cf_e("queue",conf),[j,[b,c,d]])),a.stopImmediatePropagation(),debug(conf,"Carousel currently scrolling.");if(tmrs.timePassed=0,$cfs.trigger(cf_e("slide_"+j,conf),[b,c]),opts.synchronise)for(var m=opts.synchronise,n=[b,c],o=0,l=m.length;l>o;o++){var p=j;m[o][2]||(p="prev"==p?"next":"prev"),m[o][1]||(n[0]=m[o][0].triggerHandler("_cfs_triggerEvent",["configuration",p])),n[1]=c+m[o][3],m[o][0].trigger("_cfs_triggerEvent",["slide_"+p,n])}return!0}),$cfs.bind(cf_e("slide_prev",conf),function(a,b,c){a.stopPropagation();var d=$cfs.children();if(!opts.circular&&0==itms.first)return opts.infinite&&$cfs.trigger(cf_e("next",conf),itms.total-1),a.stopImmediatePropagation();if(sz_resetMargin(d,opts),!is_number(c)){if(opts.items.visibleConf.variable)c=gn_getVisibleItemsPrev(d,opts,itms.total-1);else if("*"!=opts.items.filter){var e=is_number(b.items)?b.items:gn_getVisibleOrg($cfs,opts);c=gn_getScrollItemsPrevFilter(d,opts,itms.total-1,e)}else c=opts.items.visible;c=cf_getAdjust(c,opts,b.items,$tt0)}if(opts.circular||itms.total-c<itms.first&&(c=itms.total-itms.first),opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){var f=cf_getItemsAdjust(gn_getVisibleItemsNext(d,opts,itms.total-c),opts,opts.items.visibleConf.adjust,$tt0);f>=opts.items.visible+c&&itms.total>c&&(c++,f=cf_getItemsAdjust(gn_getVisibleItemsNext(d,opts,itms.total-c),opts,opts.items.visibleConf.adjust,$tt0)),opts.items.visible=f}else if("*"!=opts.items.filter){var f=gn_getVisibleItemsNextFilter(d,opts,itms.total-c);opts.items.visible=cf_getItemsAdjust(f,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(d,opts,!0),0==c)return a.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+c+" items backward."),itms.first+=c;itms.first>=itms.total;)itms.first-=itms.total;opts.circular||(0==itms.first&&b.onEnd&&b.onEnd.call($tt0,"prev"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),$cfs.children().slice(itms.total-c,itms.total).prependTo($cfs),itms.total<opts.items.visible+c&&$cfs.children().slice(0,opts.items.visible+c-itms.total).clone(!0).appendTo($cfs);var d=$cfs.children(),g=gi_getOldItemsPrev(d,opts,c),h=gi_getNewItemsPrev(d,opts),i=d.eq(c-1),j=g.last(),k=h.last();sz_resetMargin(d,opts);var l=0,m=0;if(opts.align){var n=cf_getAlignPadding(h,opts);l=n[0],m=n[1]}var o=0>l?opts.padding[opts.d[3]]:0,p=!1,q=$();if(c>opts.items.visible&&(q=d.slice(opts.items.visibleConf.old,c),"directscroll"==b.fx)){var r=opts.items[opts.d.width];p=q,i=k,sc_hideHiddenItems(p),opts.items[opts.d.width]="variable"}var s=!1,t=ms_getTotalSize(d.slice(0,c),opts,"width"),u=cf_mapWrapperSizes(ms_getSizes(h,opts,!0),opts,!opts.usePadding),v=0,w={},x={},y={},z={},A={},B={},C={},D=sc_getDuration(b,opts,c,t);switch(b.fx){case"cover":case"cover-fade":v=ms_getTotalSize(d.slice(0,opts.items.visible),opts,"width")}p&&(opts.items[opts.d.width]=r),sz_resetMargin(d,opts,!0),m>=0&&sz_resetMargin(j,opts,opts.padding[opts.d[1]]),l>=0&&sz_resetMargin(i,opts,opts.padding[opts.d[3]]),opts.align&&(opts.padding[opts.d[1]]=m,opts.padding[opts.d[3]]=l),B[opts.d.left]=-(t-o),C[opts.d.left]=-(v-o),x[opts.d.left]=u[opts.d.width];var E=function(){},F=function(){},G=function(){},H=function(){},I=function(){},J=function(){},K=function(){},L=function(){},M=function(){},N=function(){},O=function(){};switch(b.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=$cfs.clone(!0).appendTo($wrp)}switch(b.fx){case"crossfade":case"uncover":case"uncover-fade":s.children().slice(0,c).remove(),s.children().slice(opts.items.visibleConf.old).remove();break;case"cover":case"cover-fade":s.children().slice(opts.items.visible).remove(),s.css(C)}if($cfs.css(B),scrl=sc_setScroll(D,b.easing,conf),w[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0,("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(E=function(){$wrp.css(u)},F=function(){scrl.anims.push([$wrp,u])}),opts.usePadding){switch(k.not(i).length&&(y[opts.d.marginRight]=i.data("_cfs_origCssMargin"),0>l?i.css(y):(K=function(){i.css(y)},L=function(){scrl.anims.push([i,y])})),b.fx){case"cover":case"cover-fade":s.children().eq(c-1).css(y)}k.not(j).length&&(z[opts.d.marginRight]=j.data("_cfs_origCssMargin"),G=function(){j.css(z)},H=function(){scrl.anims.push([j,z])}),m>=0&&(A[opts.d.marginRight]=k.data("_cfs_origCssMargin")+opts.padding[opts.d[1]],I=function(){k.css(A)},J=function(){scrl.anims.push([k,A])})}O=function(){$cfs.css(w)};var P=opts.items.visible+c-itms.total;N=function(){if(P>0&&($cfs.children().slice(itms.total).remove(),g=$($cfs.children().slice(itms.total-(opts.items.visible-P)).get().concat($cfs.children().slice(0,P).get()))),sc_showHiddenItems(p),opts.usePadding){var a=$cfs.children().eq(opts.items.visible+c-1);a.css(opts.d.marginRight,a.data("_cfs_origCssMargin"))}};var Q=sc_mapCallbackArguments(g,q,h,c,"prev",D,u);switch(M=function(){sc_afterScroll($cfs,s,b),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,b,"onAfter",Q,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,b,"onBefore",Q,clbk),b.fx){case"none":$cfs.css(w),E(),G(),I(),K(),O(),N(),M();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){E(),G(),I(),K(),O(),N(),scrl=sc_setScroll(D,b.easing,conf),scrl.anims.push([$cfs,{opacity:1},M]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},M]),F(),G(),I(),K(),O(),N();break;case"cover":scrl.anims.push([s,w,function(){G(),I(),K(),O(),N(),M()}]),F();break;case"cover-fade":scrl.anims.push([$cfs,{opacity:0}]),scrl.anims.push([s,w,function(){G(),I(),K(),O(),N(),M()}]),F();break;case"uncover":scrl.anims.push([s,x,M]),F(),G(),I(),K(),O(),N();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([s,x,M]),F(),G(),I(),K(),O(),N();break;default:scrl.anims.push([$cfs,w,function(){N(),M()}]),F(),H(),J(),L()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,u]),!0
73}),$cfs.bind(cf_e("slide_next",conf),function(a,b,c){a.stopPropagation();var d=$cfs.children();if(!opts.circular&&itms.first==opts.items.visible)return opts.infinite&&$cfs.trigger(cf_e("prev",conf),itms.total-1),a.stopImmediatePropagation();if(sz_resetMargin(d,opts),!is_number(c)){if("*"!=opts.items.filter){var e=is_number(b.items)?b.items:gn_getVisibleOrg($cfs,opts);c=gn_getScrollItemsNextFilter(d,opts,0,e)}else c=opts.items.visible;c=cf_getAdjust(c,opts,b.items,$tt0)}var f=0==itms.first?itms.total:itms.first;if(!opts.circular){if(opts.items.visibleConf.variable)var g=gn_getVisibleItemsNext(d,opts,c),e=gn_getVisibleItemsPrev(d,opts,f-1);else var g=opts.items.visible,e=opts.items.visible;c+g>f&&(c=f-e)}if(opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){for(var g=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(d,opts,c,f),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible-c>=g&&itms.total>c;)c++,g=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(d,opts,c,f),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible=g}else if("*"!=opts.items.filter){var g=gn_getVisibleItemsNextFilter(d,opts,c);opts.items.visible=cf_getItemsAdjust(g,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(d,opts,!0),0==c)return a.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+c+" items forward."),itms.first-=c;0>itms.first;)itms.first+=itms.total;opts.circular||(itms.first==opts.items.visible&&b.onEnd&&b.onEnd.call($tt0,"next"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),itms.total<opts.items.visible+c&&$cfs.children().slice(0,opts.items.visible+c-itms.total).clone(!0).appendTo($cfs);var d=$cfs.children(),h=gi_getOldItemsNext(d,opts),i=gi_getNewItemsNext(d,opts,c),j=d.eq(c-1),k=h.last(),l=i.last();sz_resetMargin(d,opts);var m=0,n=0;if(opts.align){var o=cf_getAlignPadding(i,opts);m=o[0],n=o[1]}var p=!1,q=$();if(c>opts.items.visibleConf.old&&(q=d.slice(opts.items.visibleConf.old,c),"directscroll"==b.fx)){var r=opts.items[opts.d.width];p=q,j=k,sc_hideHiddenItems(p),opts.items[opts.d.width]="variable"}var s=!1,t=ms_getTotalSize(d.slice(0,c),opts,"width"),u=cf_mapWrapperSizes(ms_getSizes(i,opts,!0),opts,!opts.usePadding),v=0,w={},x={},y={},z={},A={},B=sc_getDuration(b,opts,c,t);switch(b.fx){case"uncover":case"uncover-fade":v=ms_getTotalSize(d.slice(0,opts.items.visibleConf.old),opts,"width")}p&&(opts.items[opts.d.width]=r),opts.align&&0>opts.padding[opts.d[1]]&&(opts.padding[opts.d[1]]=0),sz_resetMargin(d,opts,!0),sz_resetMargin(k,opts,opts.padding[opts.d[1]]),opts.align&&(opts.padding[opts.d[1]]=n,opts.padding[opts.d[3]]=m),A[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0;var C=function(){},D=function(){},E=function(){},F=function(){},G=function(){},H=function(){},I=function(){},J=function(){},K=function(){};switch(b.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=$cfs.clone(!0).appendTo($wrp),s.children().slice(opts.items.visibleConf.old).remove()}switch(b.fx){case"crossfade":case"cover":case"cover-fade":$cfs.css("zIndex",1),s.css("zIndex",0)}if(scrl=sc_setScroll(B,b.easing,conf),w[opts.d.left]=-t,x[opts.d.left]=-v,0>m&&(w[opts.d.left]+=m),("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(C=function(){$wrp.css(u)},D=function(){scrl.anims.push([$wrp,u])}),opts.usePadding){var L=l.data("_cfs_origCssMargin");n>=0&&(L+=opts.padding[opts.d[1]]),l.css(opts.d.marginRight,L),j.not(k).length&&(z[opts.d.marginRight]=k.data("_cfs_origCssMargin")),E=function(){k.css(z)},F=function(){scrl.anims.push([k,z])};var M=j.data("_cfs_origCssMargin");m>0&&(M+=opts.padding[opts.d[3]]),y[opts.d.marginRight]=M,G=function(){j.css(y)},H=function(){scrl.anims.push([j,y])}}K=function(){$cfs.css(A)};var N=opts.items.visible+c-itms.total;J=function(){N>0&&$cfs.children().slice(itms.total).remove();var a=$cfs.children().slice(0,c).appendTo($cfs).last();if(N>0&&(i=gi_getCurrentItems(d,opts)),sc_showHiddenItems(p),opts.usePadding){if(itms.total<opts.items.visible+c){var b=$cfs.children().eq(opts.items.visible-1);b.css(opts.d.marginRight,b.data("_cfs_origCssMargin")+opts.padding[opts.d[1]])}a.css(opts.d.marginRight,a.data("_cfs_origCssMargin"))}};var O=sc_mapCallbackArguments(h,q,i,c,"next",B,u);switch(I=function(){$cfs.css("zIndex",$cfs.data("_cfs_origCssZindex")),sc_afterScroll($cfs,s,b),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,b,"onAfter",O,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,b,"onBefore",O,clbk),b.fx){case"none":$cfs.css(w),C(),E(),G(),K(),J(),I();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){C(),E(),G(),K(),J(),scrl=sc_setScroll(B,b.easing,conf),scrl.anims.push([$cfs,{opacity:1},I]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},I]),D(),E(),G(),K(),J();break;case"cover":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([$cfs,A,I]),D(),E(),G(),J();break;case"cover-fade":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,A,I]),D(),E(),G(),J();break;case"uncover":scrl.anims.push([s,x,I]),D(),E(),G(),K(),J();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([s,x,I]),D(),E(),G(),K(),J();break;default:scrl.anims.push([$cfs,w,function(){K(),J(),I()}]),D(),F(),H()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,u]),!0}),$cfs.bind(cf_e("slideTo",conf),function(a,b,c,d,e,f,g){a.stopPropagation();var h=[b,c,d,e,f,g],i=["string/number/object","number","boolean","object","string","function"],j=cf_sortParams(h,i);return e=j[3],f=j[4],g=j[5],b=gn_getItemIndex(j[0],j[1],j[2],itms,$cfs),0==b?!1:(is_object(e)||(e=!1),"prev"!=f&&"next"!=f&&(f=opts.circular?itms.total/2>=b?"next":"prev":0==itms.first||itms.first>b?"next":"prev"),"prev"==f&&(b=itms.total-b),$cfs.trigger(cf_e(f,conf),[e,b,g]),!0)}),$cfs.bind(cf_e("prevPage",conf),function(a,b,c){a.stopPropagation();var d=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[d-1,b,"prev",c])}),$cfs.bind(cf_e("nextPage",conf),function(a,b,c){a.stopPropagation();var d=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[d+1,b,"next",c])}),$cfs.bind(cf_e("slideToPage",conf),function(a,b,c,d,e){a.stopPropagation(),is_number(b)||(b=$cfs.triggerHandler(cf_e("currentPage",conf)));var f=opts.pagination.items||opts.items.visible,g=Math.ceil(itms.total/f)-1;return 0>b&&(b=g),b>g&&(b=0),$cfs.triggerHandler(cf_e("slideTo",conf),[b*f,0,!0,c,d,e])}),$cfs.bind(cf_e("jumpToStart",conf),function(a,b){if(a.stopPropagation(),b=b?gn_getItemIndex(b,0,!0,itms,$cfs):0,b+=itms.first,0!=b){if(itms.total>0)for(;b>itms.total;)b-=itms.total;$cfs.prepend($cfs.children().slice(b,itms.total))}return!0}),$cfs.bind(cf_e("synchronise",conf),function(a,b){if(a.stopPropagation(),b)b=cf_getSynchArr(b);else{if(!opts.synchronise)return debug(conf,"No carousel to synchronise.");b=opts.synchronise}for(var c=$cfs.triggerHandler(cf_e("currentPosition",conf)),d=!0,e=0,f=b.length;f>e;e++)b[e][0].triggerHandler(cf_e("slideTo",conf),[c,b[e][3],!0])||(d=!1);return d}),$cfs.bind(cf_e("queue",conf),function(a,b,c){return a.stopPropagation(),is_function(b)?b.call($tt0,queu):is_array(b)?queu=b:is_undefined(b)||queu.push([b,c]),queu}),$cfs.bind(cf_e("insertItem",conf),function(a,b,c,d,e){a.stopPropagation();var f=[b,c,d,e],g=["string/object","string/number/object","boolean","number"],h=cf_sortParams(f,g);if(b=h[0],c=h[1],d=h[2],e=h[3],is_object(b)&&!is_jquery(b)?b=$(b):is_string(b)&&(b=$(b)),!is_jquery(b)||0==b.length)return debug(conf,"Not a valid object.");is_undefined(c)&&(c="end"),sz_storeMargin(b,opts),sz_storeOrigCss(b);var i=c,j="before";"end"==c?d?(0==itms.first?(c=itms.total-1,j="after"):(c=itms.first,itms.first+=b.length),0>c&&(c=0)):(c=itms.total-1,j="after"):c=gn_getItemIndex(c,e,d,itms,$cfs);var k=$cfs.children().eq(c);return k.length?k[j](b):(debug(conf,"Correct insert-position not found! Appending item to the end."),$cfs.append(b)),"end"==i||d||itms.first>c&&(itms.first+=b.length),itms.total=$cfs.children().length,itms.first>=itms.total&&(itms.first-=itms.total),$cfs.trigger(cf_e("updateSizes",conf)),$cfs.trigger(cf_e("linkAnchors",conf)),!0}),$cfs.bind(cf_e("removeItem",conf),function(a,b,c,d){a.stopPropagation();var e=[b,c,d],f=["string/number/object","boolean","number"],g=cf_sortParams(e,f);if(b=g[0],c=g[1],d=g[2],b instanceof $&&b.length>1)return i=$(),b.each(function(){var e=$cfs.trigger(cf_e("removeItem",conf),[$(this),c,d]);e&&(i=i.add(e))}),i;if(is_undefined(b)||"end"==b)i=$cfs.children().last();else{b=gn_getItemIndex(b,d,c,itms,$cfs);var i=$cfs.children().eq(b);i.length&&itms.first>b&&(itms.first-=i.length)}return i&&i.length&&(i.detach(),itms.total=$cfs.children().length,$cfs.trigger(cf_e("updateSizes",conf))),i}),$cfs.bind(cf_e("onBefore",conf)+" "+cf_e("onAfter",conf),function(a,b){a.stopPropagation();var c=a.type.slice(conf.events.prefix.length);return is_array(b)&&(clbk[c]=b),is_function(b)&&clbk[c].push(b),clbk[c]}),$cfs.bind(cf_e("currentPosition",conf),function(a,b){if(a.stopPropagation(),0==itms.first)var c=0;else var c=itms.total-itms.first;return is_function(b)&&b.call($tt0,c),c}),$cfs.bind(cf_e("currentPage",conf),function(a,b){a.stopPropagation();var e,c=opts.pagination.items||opts.items.visible,d=Math.ceil(itms.total/c-1);return e=0==itms.first?0:itms.first<itms.total%c?0:itms.first!=c||opts.circular?Math.round((itms.total-itms.first)/c):d,0>e&&(e=0),e>d&&(e=d),is_function(b)&&b.call($tt0,e),e}),$cfs.bind(cf_e("currentVisible",conf),function(a,b){a.stopPropagation();var c=gi_getCurrentItems($cfs.children(),opts);return is_function(b)&&b.call($tt0,c),c}),$cfs.bind(cf_e("slice",conf),function(a,b,c,d){if(a.stopPropagation(),0==itms.total)return!1;var e=[b,c,d],f=["number","number","function"],g=cf_sortParams(e,f);if(b=is_number(g[0])?g[0]:0,c=is_number(g[1])?g[1]:itms.total,d=g[2],b+=itms.first,c+=itms.first,items.total>0){for(;b>itms.total;)b-=itms.total;for(;c>itms.total;)c-=itms.total;for(;0>b;)b+=itms.total;for(;0>c;)c+=itms.total}var i,h=$cfs.children();return i=c>b?h.slice(b,c):$(h.slice(b,itms.total).get().concat(h.slice(0,c).get())),is_function(d)&&d.call($tt0,i),i}),$cfs.bind(cf_e("isPaused",conf)+" "+cf_e("isStopped",conf)+" "+cf_e("isScrolling",conf),function(a,b){a.stopPropagation();var c=a.type.slice(conf.events.prefix.length),d=crsl[c];return is_function(b)&&b.call($tt0,d),d}),$cfs.bind(cf_e("configuration",conf),function(e,a,b,c){e.stopPropagation();var reInit=!1;if(is_function(a))a.call($tt0,opts);else if(is_object(a))opts_orig=$.extend(!0,{},opts_orig,a),b!==!1?reInit=!0:opts=$.extend(!0,{},opts,a);else if(!is_undefined(a))if(is_function(b)){var val=eval("opts."+a);is_undefined(val)&&(val=""),b.call($tt0,val)}else{if(is_undefined(b))return eval("opts."+a);"boolean"!=typeof c&&(c=!0),eval("opts_orig."+a+" = b"),c!==!1?reInit=!0:eval("opts."+a+" = b")}if(reInit){sz_resetMargin($cfs.children(),opts),FN._init(opts_orig),FN._bind_buttons();var sz=sz_setSizes($cfs,opts);$cfs.trigger(cf_e("updatePageStatus",conf),[!0,sz])}return opts}),$cfs.bind(cf_e("linkAnchors",conf),function(a,b,c){return a.stopPropagation(),is_undefined(b)?b=$("body"):is_string(b)&&(b=$(b)),is_jquery(b)&&0!=b.length?(is_string(c)||(c="a.caroufredsel"),b.find(c).each(function(){var a=this.hash||"";a.length>0&&-1!=$cfs.children().index($(a))&&$(this).unbind("click").click(function(b){b.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),a)})}),!0):debug(conf,"Not a valid object.")}),$cfs.bind(cf_e("updatePageStatus",conf),function(a,b){if(a.stopPropagation(),opts.pagination.container){var d=opts.pagination.items||opts.items.visible,e=Math.ceil(itms.total/d);b&&(opts.pagination.anchorBuilder&&(opts.pagination.container.children().remove(),opts.pagination.container.each(function(){for(var a=0;e>a;a++){var b=$cfs.children().eq(gn_getItemIndex(a*d,0,!0,itms,$cfs));$(this).append(opts.pagination.anchorBuilder.call(b[0],a+1))}})),opts.pagination.container.each(function(){$(this).children().unbind(opts.pagination.event).each(function(a){$(this).bind(opts.pagination.event,function(b){b.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[a*d,-opts.pagination.deviation,!0,opts.pagination])})})}));var f=$cfs.triggerHandler(cf_e("currentPage",conf))+opts.pagination.deviation;return f>=e&&(f=0),0>f&&(f=e-1),opts.pagination.container.each(function(){$(this).children().removeClass(cf_c("selected",conf)).eq(f).addClass(cf_c("selected",conf))}),!0}}),$cfs.bind(cf_e("updateSizes",conf),function(){var b=opts.items.visible,c=$cfs.children(),d=ms_getParentSize($wrp,opts,"width");if(itms.total=c.length,crsl.primarySizePercentage?(opts.maxDimension=d,opts[opts.d.width]=ms_getPercentage(d,crsl.primarySizePercentage)):opts.maxDimension=ms_getMaxDimension(opts,d),opts.responsive?(opts.items.width=opts.items.sizesConf.width,opts.items.height=opts.items.sizesConf.height,opts=in_getResponsiveValues(opts,c,d),b=opts.items.visible,sz_setResponsiveSizes(opts,c)):opts.items.visibleConf.variable?b=gn_getVisibleItemsNext(c,opts,0):"*"!=opts.items.filter&&(b=gn_getVisibleItemsNextFilter(c,opts,0)),!opts.circular&&0!=itms.first&&b>itms.first){if(opts.items.visibleConf.variable)var e=gn_getVisibleItemsPrev(c,opts,itms.first)-itms.first;else if("*"!=opts.items.filter)var e=gn_getVisibleItemsPrevFilter(c,opts,itms.first)-itms.first;else var e=opts.items.visible-itms.first;debug(conf,"Preventing non-circular: sliding "+e+" items backward."),$cfs.trigger(cf_e("prev",conf),e)}opts.items.visible=cf_getItemsAdjust(b,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts=in_getAlignPadding(opts,c);var f=sz_setSizes($cfs,opts);return $cfs.trigger(cf_e("updatePageStatus",conf),[!0,f]),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),f}),$cfs.bind(cf_e("destroy",conf),function(a,b){return a.stopPropagation(),tmrs=sc_clearTimers(tmrs),$cfs.data("_cfs_isCarousel",!1),$cfs.trigger(cf_e("finish",conf)),b&&$cfs.trigger(cf_e("jumpToStart",conf)),sz_restoreOrigCss($cfs.children()),sz_restoreOrigCss($cfs),FN._unbind_events(),FN._unbind_buttons(),"parent"==conf.wrapper?sz_restoreOrigCss($wrp):$wrp.replaceWith($cfs),!0}),$cfs.bind(cf_e("debug",conf),function(){return debug(conf,"Carousel width: "+opts.width),debug(conf,"Carousel height: "+opts.height),debug(conf,"Item widths: "+opts.items.width),debug(conf,"Item heights: "+opts.items.height),debug(conf,"Number of items visible: "+opts.items.visible),opts.auto.play&&debug(conf,"Number of items scrolled automatically: "+opts.auto.items),opts.prev.button&&debug(conf,"Number of items scrolled backward: "+opts.prev.items),opts.next.button&&debug(conf,"Number of items scrolled forward: "+opts.next.items),conf.debug}),$cfs.bind("_cfs_triggerEvent",function(a,b,c){return a.stopPropagation(),$cfs.triggerHandler(cf_e(b,conf),c)})},FN._unbind_events=function(){$cfs.unbind(cf_e("",conf)),$cfs.unbind(cf_e("",conf,!1)),$cfs.unbind("_cfs_triggerEvent")},FN._bind_buttons=function(){if(FN._unbind_buttons(),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),opts.auto.pauseOnHover){var a=bt_pauseOnHoverConfig(opts.auto.pauseOnHover);$wrp.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.auto.button&&opts.auto.button.bind(cf_e(opts.auto.event,conf,!1),function(a){a.preventDefault();var b=!1,c=null;crsl.isPaused?b="play":opts.auto.pauseOnEvent&&(b="pause",c=bt_pauseOnHoverConfig(opts.auto.pauseOnEvent)),b&&$cfs.trigger(cf_e(b,conf),c)}),opts.prev.button&&(opts.prev.button.bind(cf_e(opts.prev.event,conf,!1),function(a){a.preventDefault(),$cfs.trigger(cf_e("prev",conf))}),opts.prev.pauseOnHover)){var a=bt_pauseOnHoverConfig(opts.prev.pauseOnHover);opts.prev.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.next.button&&(opts.next.button.bind(cf_e(opts.next.event,conf,!1),function(a){a.preventDefault(),$cfs.trigger(cf_e("next",conf))}),opts.next.pauseOnHover)){var a=bt_pauseOnHoverConfig(opts.next.pauseOnHover);opts.next.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.pagination.container&&opts.pagination.pauseOnHover){var a=bt_pauseOnHoverConfig(opts.pagination.pauseOnHover);opts.pagination.container.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if((opts.prev.key||opts.next.key)&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(a){var b=a.keyCode;b==opts.next.key&&(a.preventDefault(),$cfs.trigger(cf_e("next",conf))),b==opts.prev.key&&(a.preventDefault(),$cfs.trigger(cf_e("prev",conf)))}),opts.pagination.keys&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(a){var b=a.keyCode;b>=49&&58>b&&(b=(b-49)*opts.items.visible,itms.total>=b&&(a.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[b,0,!0,opts.pagination])))}),$.fn.swipe){var b="ontouchstart"in window;if(b&&opts.swipe.onTouch||!b&&opts.swipe.onMouse){var c=$.extend(!0,{},opts.prev,opts.swipe),d=$.extend(!0,{},opts.next,opts.swipe),e=function(){$cfs.trigger(cf_e("prev",conf),[c])},f=function(){$cfs.trigger(cf_e("next",conf),[d])};switch(opts.direction){case"up":case"down":opts.swipe.options.swipeUp=f,opts.swipe.options.swipeDown=e;break;default:opts.swipe.options.swipeLeft=f,opts.swipe.options.swipeRight=e}crsl.swipe&&$cfs.swipe("destroy"),$wrp.swipe(opts.swipe.options),$wrp.css("cursor","move"),crsl.swipe=!0}}if($.fn.mousewheel&&opts.mousewheel){var g=$.extend(!0,{},opts.prev,opts.mousewheel),h=$.extend(!0,{},opts.next,opts.mousewheel);crsl.mousewheel&&$wrp.unbind(cf_e("mousewheel",conf,!1)),$wrp.bind(cf_e("mousewheel",conf,!1),function(a,b){a.preventDefault(),b>0?$cfs.trigger(cf_e("prev",conf),[g]):$cfs.trigger(cf_e("next",conf),[h])}),crsl.mousewheel=!0}if(opts.auto.play&&$cfs.trigger(cf_e("play",conf),opts.auto.delay),crsl.upDateOnWindowResize){var i=function(){$cfs.trigger(cf_e("finish",conf)),opts.auto.pauseOnResize&&!crsl.isPaused&&$cfs.trigger(cf_e("play",conf)),sz_resetMargin($cfs.children(),opts),$cfs.trigger(cf_e("updateSizes",conf))},j=$(window),k=null;if($.debounce&&"debounce"==conf.onWindowResize)k=$.debounce(200,i);else if($.throttle&&"throttle"==conf.onWindowResize)k=$.throttle(300,i);else{var l=0,m=0;k=function(){var a=j.width(),b=j.height();(a!=l||b!=m)&&(i(),l=a,m=b)}}j.bind(cf_e("resize",conf,!1,!0,!0),k)}},FN._unbind_buttons=function(){var b=(cf_e("",conf),cf_e("",conf,!1));ns3=cf_e("",conf,!1,!0,!0),$(document).unbind(ns3),$(window).unbind(ns3),$wrp.unbind(b),opts.auto.button&&opts.auto.button.unbind(b),opts.prev.button&&opts.prev.button.unbind(b),opts.next.button&&opts.next.button.unbind(b),opts.pagination.container&&(opts.pagination.container.unbind(b),opts.pagination.anchorBuilder&&opts.pagination.container.children().remove()),crsl.swipe&&($cfs.swipe("destroy"),$wrp.css("cursor","default"),crsl.swipe=!1),crsl.mousewheel&&(crsl.mousewheel=!1),nv_showNavi(opts,"hide",conf),nv_enableNavi(opts,"removeClass",conf)},is_boolean(configs)&&(configs={debug:configs});var crsl={direction:"next",isPaused:!0,isScrolling:!1,isStopped:!1,mousewheel:!1,swipe:!1},itms={total:$cfs.children().length,first:0},tmrs={auto:null,progress:null,startTime:getTime(),timePassed:0},scrl={isStopped:!1,duration:0,startTime:0,easing:"",anims:[]},clbk={onBefore:[],onAfter:[]},queu=[],conf=$.extend(!0,{},$.fn.carouFredSel.configs,configs),opts={},opts_orig=$.extend(!0,{},options),$wrp="parent"==conf.wrapper?$cfs.parent():$cfs.wrap("<"+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent();if(conf.selector=$cfs.selector,conf.serialNumber=$.fn.carouFredSel.serialNumber++,conf.transition=conf.transition&&$.fn.transition?"transition":"animate",FN._init(opts_orig,!0,starting_position),FN._build(),FN._bind_events(),FN._bind_buttons(),is_array(opts.items.start))var start_arr=opts.items.start;else{var start_arr=[];0!=opts.items.start&&start_arr.push(opts.items.start)}if(opts.cookie&&start_arr.unshift(parseInt(cf_getCookie(opts.cookie),10)),start_arr.length>0)for(var a=0,l=start_arr.length;l>a;a++){var s=start_arr[a];if(0!=s){if(s===!0){if(s=window.location.hash,1>s.length)continue}else"random"===s&&(s=Math.floor(Math.random()*itms.total));if($cfs.triggerHandler(cf_e("slideTo",conf),[s,0,!0,{fx:"none"}]))break}}var siz=sz_setSizes($cfs,opts),itm=gi_getCurrentItems($cfs.children(),opts);return opts.onCreate&&opts.onCreate.call($tt0,{width:siz.width,height:siz.height,items:itm}),$cfs.trigger(cf_e("updatePageStatus",conf),[!0,siz]),$cfs.trigger(cf_e("linkAnchors",conf)),conf.debug&&$cfs.trigger(cf_e("debug",conf)),$cfs},$.fn.carouFredSel.serialNumber=1,$.fn.carouFredSel.defaults={synchronise:!1,infinite:!0,circular:!0,responsive:!1,direction:"left",items:{start:0},scroll:{easing:"swing",duration:500,pauseOnHover:!1,event:"click",queue:!1}},$.fn.carouFredSel.configs={debug:!1,transition:!1,onWindowResize:"throttle",events:{prefix:"",namespace:"cfs"},wrapper:{element:"div",classname:"caroufredsel_wrapper"},classnames:{}},$.fn.carouFredSel.pageAnchorBuilder=function(a){return'<a href="#"><span>'+a+"</span></a>"},$.fn.carouFredSel.progressbarUpdater=function(a){$(this).css("width",a+"%")},$.fn.carouFredSel.cookie={get:function(a){a+="=";for(var b=document.cookie.split(";"),c=0,d=b.length;d>c;c++){for(var e=b[c];" "==e.charAt(0);)e=e.slice(1);if(0==e.indexOf(a))return e.slice(a.length)}return 0},set:function(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+1e3*60*60*24*c),d="; expires="+e.toGMTString()}document.cookie=a+"="+b+d+"; path=/"},remove:function(a){$.fn.carouFredSel.cookie.set(a,"",-1)}},$.extend($.easing,{quadratic:function(a){var b=a*a;return a*(-b*a+4*b-6*a+4)},cubic:function(a){return a*(4*a*a-9*a+6)},elastic:function(a){var b=a*a;return a*(33*b*b-106*b*a+126*b-67*a+15)}}))})(jQuery);
73
74
75
76jQuery(document).ready(function($){
77	
78
79/***************** Pretty Photo ******************/
80	
81	function prettyPhotoInit(){
82		
83		//add galleries to portfolios
84		$('.portfolio-items').each(function(){
85			var $unique_id = Math.floor(Math.random()*10000);
86			$(this).find('.pretty_photo').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo');
87		});
88		
89		$("a[data-rel='prettyPhoto[product-gallery]'], a[data-rel='prettyPhoto']").each(function(){
90			$(this).attr('rel',$(this).attr('data-rel'));
91			$(this).removeAttr('data-rel');
92		});
93		
94		//nectar auto lightbox
95		if($('body').hasClass('nectar-auto-lightbox')){
96			$('.gallery').each(function(){
97				if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length == 0) {
98					var $unique_id = Math.floor(Math.random()*10000);
99					$(this).find('.gallery-item .gallery-icon a[href*=".jpg"], .gallery-item .gallery-icon a[href*=".png"], .gallery-item .gallery-icon a[href*=".gif"], .gallery-item .gallery-icon a[href*=".jpeg"]').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo');
100				}
101			});
102			$('.main-content img').each(function(){
103				if($(this).parent().is("[href]") && !$(this).parent().is("[rel*='prettyPhoto']") && $(this).parents('.product-image').length == 0 && $(this).parents('.iosSlider.product-slider').length == 0) {
104					var match = $(this).parent().attr('href').match(/\.(jpg|png|gif)\b/);
105					if(match) $(this).parent().attr('rel','prettyPhoto');
106				} 
107			});
108		}
109		
110		
111		//convert class usage into rel
112		$('a.pp').removeClass('pp').attr('rel','prettyPhoto');
113		
114		 var loading_animation = ($('body[data-loading-animation]').attr('data-loading-animation') != 'none') ? $('body').attr('data-loading-animation') : null ;
115		 var ascend_loader = ($('body').hasClass('ascend')) ? '<span class="default-loading-icon spin"></span>' :'';
116		 var ascend_loader_class = ($('body').hasClass('ascend')) ? 'default_loader ' : '';
117		$("a[rel^='prettyPhoto']").prettyPhoto({
118			theme: 'dark_rounded',
119			allow_resize: true,
120			default_width: 690,
121			opacity: 0.85, 
122			animation_speed: 'normal',
123			deeplinking: false,
124			default_height: 388,
125			social_tools: '',
126			markup: '<div class="pp_pic_holder"> \
127						   <div class="ppt">&nbsp;</div> \
128							<div class="pp_details"> \
129								<div class="pp_nav"> \
130								    <a href="#" class="pp_arrow_previous"> <i class="icon-salient-left-arrow-thin icon-default-style"></i> </a> \
131									<a href="#" class="pp_arrow_next"> <i class="icon-salient-right-arrow-thin icon-default-style"></i> </a> \
132									<p class="currentTextHolder">0/0</p> \
133								</div> \
134								<a class="pp_close" href="#"><span class="icon-salient-x icon-default-style"></span></a> \
135							</div> \
136							<div class="pp_content_container"> \
137								<div class="pp_left"> \
138								<div class="pp_right"> \
139									<div class="pp_content"> \
140										<div class="pp_fade"> \
141											<div class="pp_hoverContainer"> \
142											</div> \
143											<div id="pp_full_res"></div> \
144											<p class="pp_description"></p> \
145										</div> \
146									</div> \
147								</div> \
148								</div> \
149							</div> \
150						</div> \
151						<div class="pp_loaderIcon ' + ascend_loader_class + loading_animation+'"> '+ascend_loader+' </div> \
152						<div class="pp_overlay"></div>'
153		});
154		
155	}
156
157	prettyPhotoInit();
158	//check for late links
159	setTimeout(prettyPhotoInit,500);
160	
161/*!
162 * jQuery Transit - CSS3 transitions and transformations
163 * (c) 2011-2012 Rico Sta. Cruz <[email protected]>
164 * MIT Licensed.
165 *
166 * http://ricostacruz.com/jquery.transit
167 * http://github.com/rstacruz/jquery.transit
168 */
169(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
169)",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")}
169this.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);
170
171
172/***************** Smooth Scrolling ******************/
173
174	function niceScrollInit(){
175		$("html").niceScroll({
176			scrollspeed: 60,
177			mousescrollstep: 40,
178			cursorwidth: 15,
179			cursorborder: 0,
180			cursorcolor: '#303030',
181			cursorborderradius: 6,
182			autohidemode: false,
183			horizrailenabled: false
184		});
185		
186		
187		if($('#boxed').length == 0){
188			$('body, body #header-outer, body #header-secondary-outer, body #search-outer').css('padding-right','16px');
189		} else if($('body[data-ext-responsive="true"]').length == 0 ) {
190			$('body').css('padding-right','16px');
191		}
192		
193		$('html').addClass('no-overflow-y');
194	}
195
196	var $smoothActive = $('body').attr('data-smooth-scrolling'); 
197	var $smoothCache = ( $smoothActive == 1 ) ? true : false;
198	
199	if( $smoothActive == 1 && $(window).width() > 690 && $('body').outerHeight(true) > $(window).height() && Modernizr.csstransforms3d && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ niceScrollInit(); } else {
200		$('body').attr('data-smooth-scrolling','0');
201	}
202	
203	//chrome ss
204	if($smoothCache == false && navigator.platform.toUpperCase().indexOf('MAC') === -1 && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/) && $(window).width() > 690) {
205		!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)}}
205v.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:400,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))}();
206	}
207
208
209
210
211
212
213
214/***************** Sliders ******************/
215
216	//gallery
217	function flexsliderInit(){
218		$('.flex-gallery').each(function(){
219			
220			var $that = $(this);
221			
222			imagesLoaded($(this),function(instance){
223			
224				 $that.flexslider({
225			        animation: 'fade',
226			        smoothHeight: false, 
227			        animationSpeed: 500,
228			        useCSS: false, 
229			        touch: true
230			    });
231				
232				////gallery slider add arrows
233				$('.flex-gallery .flex-direction-nav li a.flex-next').html('<i class="icon-angle-right"></i>');
234				$('.flex-gallery .flex-direction-nav li a.flex-prev').html('<i class="icon-angle-left"></i>');
235			
236			});
237			
238		});
239	}
240	flexsliderInit();
241	
242/***************** Home Slider ******************/
243
244	var sliderAdvanceSpeed = parseInt($('#featured').attr('data-advance-speed'));
245	var sliderAnimationSpeed = parseInt($('#featured').attr('data-animation-speed'));
246	var sliderAutoplay = parseInt($('#featured').attr('data-autoplay'));
247	
248	if( isNaN(sliderAdvanceSpeed) ) { sliderAdvanceSpeed = 5500;}
249	if( isNaN(sliderAnimationSpeed) ) { sliderAnimationSpeed = 800;}
250	
251	var $yPos;
252	
253
254	var img_urls=[];
255	$('[style*="background"]').each(function() {
256	    var style = $(this).attr('style');
257	    var pattern = /background.*?url\('(.*?)'\)/g
258	    var match = pattern.exec(style);
259	    if (match) {        
260	        img_urls.push(match[1]);
261	    }
262	});
263	
264	var imgArray = [];
265	
266	for(i=0;i<img_urls.length;i++){
267		imgArray[i] = new Image();
268		imgArray[i].src = img_urls[i];
269	}
270	 
271	
272	//home slider height
273	var sliderHeight = parseInt($('#featured').attr('data-slider-height'));
274	if( isNaN(sliderHeight) ) { sliderHeight = 650 } else { sliderHeight = sliderHeight -12 }; 
275	
276	////min height if video
277	if( $('#featured .video').length > 0 && sliderHeight < 500) sliderHeight = 500;
278	
279	function customSliderHeight(){
280		if(!$('body').hasClass('mobile')){
281			$('#featured').attr('style', 'height: '+sliderHeight+'px !important');
282			$('#featured article').css('height',sliderHeight+headerPadding2-23+'px')
283		}
284		else {
285			$('#featured').attr('style', 'height: '+sliderHeight+'px');
286		}
287
288		//transparent header fix
289		if($('#header-outer[data-transparent-header="true"]').length > 0) $('.orbit-wrapper').addClass('transparent-header');
290	}
291	
292	customSliderHeight();
293	
294	
295
296	
297	//take into account header height when calculating the controls and info positioning 
298	var logoHeight = parseInt($('#header-outer').attr('data-logo-height'));
299	var headerPadding = parseInt($('#header-outer').attr('data-padding'));
300	var headerPadding2 = parseInt($('#header-outer').attr('data-padding'));
301	var extraDef = 10;
302	var headerResize = ($('body').hasClass('pp-video-function')) ? '1' : $('#header-outer').attr('data-header-resize');
303	var headerResizeOffExtra = 0;
304	var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
305	var usingLogoImage = true;
306    var mediaElement = ($('.wp-video-shortcode').length > 0) ? 36 : 0;
307    var secondaryHeader = ($('#header-outer').attr('data-using-secondary') == '1') ? 32 : 0 ;
308    
309	if( isNaN(logoHeight) ) { usingLogoImage = false; logoHeight = 30;}
310	if( isNaN(headerPadding) ) { headerPadding = 28; headerPadding2 = 28;}
311	if( headerResize.length == 0 ) { extraDef = 0; headerResizeOffExtra = headerPadding2; }
312    if( $('header#top #logo img').length == 0 ) { logoHeight = 30; }
313    
314	var $captionPos = (((sliderHeight-70)/2 - $('div.slider-nav span.left span.white').height()/2) + headerPadding2 - headerResizeOffExtra) - 75;
315	var $controlsPos = (((sliderHeight-70)/2 - $('div.slider-nav span.left span.white').height()/2) + logoHeight + headerPadding*2 + extraHeight + secondaryHeader) -10;
316	
317	var $scrollTop = 0;
318	var $videoHeight; 
319	
320	
321	function homeSliderInit(){
322		$('#featured').orbit({
323         	 animation: 'fade',
324         	 advanceSpeed: sliderAdvanceSpeed,
325         	 animationSpeed: sliderAnimationSpeed, 
326         	 timer: sliderAutoplay
327    	 });
328    	 
329    	 customSliderHeight();
330		 sliderAfterSetup();
331		 
332		  //test for slider arrows
333	 	 if(!$('body').hasClass('mobile')){
334			$('.orbit-wrapper #featured article').css('top', ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader)  + 'px');
335			$('.orbit-wrapper div.slider-nav span.right, .orbit-wrapper div.slider-nav span.left').html('<span class="white"></span><span class="shadow"></span>');
336		 } else {
337			$('.orbit-wrapper div.slider-nav span.right').html('<i class="icon-angle-right"></i>');
338			$('.orbit-wrapper div.slider-nav span.left').html('<i class="icon-angle-left"></i>');
339		 }
340	}
341	
342	//home slider init
343	function homeSliderInit2(){
344		if($('#featured').length > 0 && $().orbit) {
345
346			$('#featured article .post-title h2 span').show();
347
348
349			//home slider bg color
350			var sliderBackgroundColor = $('#featured').attr('data-bg-color');
351			if( sliderBackgroundColor.length == 0 ) sliderBackgroundColor = '#000000'; 
352			
353			$('#featured article').css('background-color',sliderBackgroundColor);
354		
355	
356			 
357			 var $firstBg = $('#featured').find('.slide:first-child > article').attr('style');
358
359		     var pattern = /url\(["']?([^'")]+)['"]?\)/;
360		     var match = pattern.exec($firstBg);
361	 
362		     if (match && match[1].indexOf('.') !== -1) {       
363		        var slideImg = new Image();
364				slideImg.onload = function(){ 
365					homeSliderInit();
366				}
367				slideImg.src = match[1];
368			 } else {
369			 	homeSliderInit();
370			 }
371	 
372	    	////add hover effect to slider nav
373	    	if($('.slider-nav > span').find('.white').length == 0) {
374	    		$('.slider-nav > span').append('<span class="white"></span><span class="shadow"></span>');	
375	    	}
376
377	    	////swipe for home slider
378	    	if($('body').hasClass('mobile')){
379		    	$('#featured h2, #featured .video').swipe({
380		    		swipeRight : function(e) {
381						$('.slider-nav .left').trigger('click');
382						e.stopImmediatePropagation();
383						return false;
384					 },
385					 swipeLeft : function(e) {
386						$('.slider-nav .right').trigger('click');
387						e.stopImmediatePropagation();
388						return false;
389					 }    
390		    	})
391	    	}
392	   
393		
394		}
395	}
396	homeSliderInit2();
397	
398	
399	
400	//inital load
401	function sliderAfterSetup(){
402		//webkit video fix
403		$('#featured .mejs-container').css('width',$('#featured .video').width());
404		$('#featured .mejs-container').css('height',$('#featured .video').width()/1.7777);
405		//$(window).trigger('resize');
406		
407		$('body:not(.mobile) .orbit-wrapper #featured .orbit-slide:not(".has-video") article .container').css('top', $captionPos +"px");
408		$('body:not(.mobile) .orbit-wrapper #featured .orbit-slide.has-video article .container').css('top', $videoHeight +"px");
409		$('body:not(.mobile) .orbit-wrapper .slider-nav > span').css('top', $controlsPos +"px");	
410		$('body:not(.mobile) .orbit-wrapper #featured .slide article').css({'top': ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader)  + 'px' });
411		
412		//height fix for when resize on scroll if off
413		if(!$('body').hasClass('mobile') && headerResize.length == 0){
414			$('#featured article').css('height',sliderHeight-32+'px')
415		}
416		
417		$(window).trigger('resize');
418	}
419	
420	
421	function videoSlidePos(){
422		$('#featured > div').has('.video').each(function(){
423			if( $(window).width() > 1300 ) {
424				$('#featured .orbit-slide.has-video .video, #featured .orbit-slide.has-video h2').css('top','0');
425				$('#featured .orbit-slide.has-video .post-title > a').css('top','10px');
426
427				$videoHeight = ((sliderHeight-28)/2) - ((410-mediaElement)/2) + headerPadding2 - headerResizeOffExtra;
428			}
429			
430			else if( $(window).width() > 1000 && $(window).width() < 1081 ){
431				$('#featured .orbit-slide.has-video .video, #featured .orbit-slide.has-video h2').css('top','0');
432				$('#featured .orbit-slide.has-video .post-title > a').css('top','10px');
433				
434				$videoHeight = ((sliderHeight-28)/2) - ((290-mediaElement)/2) + headerPadding2 - headerResizeOffExtra;
435			}
436			
437			else {
438				$videoHeight = ((sliderHeight-28)/2) - ((336-mediaElement)/2) +headerPadding2 - headerResizeOffExtra;
439			}
440	
441		});
442	}
443	
444	videoSlidePos();
445	
446	//dynamic controls and info positioning
447	function controlsAndInfoPos(){
448		$scrollTop = $(window).scrollTop();
449		
450		$('body:not(.mobile) .orbit-wrapper #featured .orbit-slide:not(".has-video") article .container').css({ 
451			'opacity' : 1-($scrollTop/(sliderHeight-130)),
452			'top' : ($scrollTop*-0.2) + $captionPos +"px"
453		});
454		
455		//video slides
456		$('body:not(.mobile) .orbit-wrapper #featured .orbit-slide.has-video article .container').css({ 
457			'opacity' : 1-($scrollTop/(sliderHeight-130)),
458			'top' : ($scrollTop*-0.2) + $videoHeight +"px"
459		});
460		
461		if($('#boxed').length == 0){
462			$('body:not(.mobile) .orbit-wrapper .slider-nav > span').css({ 
463				'opacity' : 1-($scrollTop/(sliderHeight-130)),
464				'top' : ($scrollTop*-0.4) + $controlsPos +"px"
465			});
466		}
467		
468	}
469	
470	controlsInit();
471	function controlsInit(){
472
473		if($('#boxed').length > 0) {
474			if(1-$scrollTop/(sliderHeight-$controlsPos-20) >= 0){
475				$(window).off('scroll',hideControls);
476				$(window).on('scroll',showControls);
477			} else {
478				$(window).off('scroll',showControls);
479				$(window).on('scroll',hideControls);
480			}
481		} else {
482			$(window).off('scroll',showControls);
483			$(window).off('scroll',hideControls);
484		}
485	
486	}
487	
488	function showControls(){
489
490		if(1-$scrollTop/(sliderHeight-$controlsPos-20) >= 0){
491			$('body:not(.mobile) .orbit-wrapper .slider-nav > span.left').stop(true,true).animate({ 'left' : '0px'},450,'easeOutCubic');
492			if($('body').attr('data-smooth-scrolling')=='1'){
493				$('body:not(.mobile) .orbit-wrapper .slider-nav > span.right').stop(true,true).animate({ 'right' : '15px'},450,'easeOutCubic');
494			} else {
495				$('body:not(.mobile) .orbit-wrapper .slider-nav > span.right').stop(true,true).animate({ 'right' : '0px'},450,'easeOutCubic');
496			}
497			$(window).off('scroll',showControls);
498			$(window).on('scroll',hideControls);
499		}
500	}
501	
502	function hideControls(){
503		
504		if(1-$scrollTop/(sliderHeight-$controlsPos-20) < 0){
505			$('body:not(.mobile) .orbit-wrapper .slider-nav > span.left').stop(true,true).animate({ 'left' : '-80px'},450,'easeOutCubic');
506			$('body:not(.mobile) .orbit-wrapper .slider-nav > span.right').stop(true,true).animate({ 'right' : '-80px'},450,'easeOutCubic');
507			$(window).off('scroll',hideControls);
508			$(window).on('scroll',showControls);
509		}
510		
511	}
512	
513
514	function homeSliderParallaxScroll(){
515		    
516	    //hide video to not mess up parallax section
517	    $('#featured .mejs-mediaelement, #featured .iframe-embed').each(function(){
518	    
519	    	if( $(this).parents('.container').css('opacity') <= 0){
520		    	$(this).css('visibility','hidden').hide();
521		    } else {
522		    	$(this).css('visibility','visible').show();
523		    }
524	    });
525	    
526	    if(!$('body').hasClass('mobile')){
527	    	
528	    	controlsAndInfoPos();
529			$('body:not(.mobile) .orbit-wrapper #featured .slide:not(:transparent) article').css({'top': ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader)  + 'px' });	
530		
531		}
532	}
533
534	function homeSliderMobile() {
535
536		if(!$('body').hasClass('mobile')){
537			$('.orbit-wrapper #featured article').css('top', ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader)  + 'px');
538			$('.orbit-wrapper div.slider-nav span.right, .orbit-wrapper div.slider-nav span.left').html('<span class="white"></span><span class="shadow"></span>');
539		} else {
540			$('.orbit-wrapper div.slider-nav span.right').html('<i class="icon-angle-right"></i>');
541			$('.orbit-wrapper div.slider-nav span.left').html('<i class="icon-angle-left"></i>');
542		}
543
544		videoSlidePos();
545		controlsAndInfoPos();
546		customSliderHeight();
547		
548		//height fix for when resize on scroll if off
549		if(!$('body').hasClass('mobile') && headerResize.length == 0){
550			$('#featured article').css('height',sliderHeight-32+'px')
551		}
552		
553	}
554
555
556	if( $('#featured').length > 0){
557		
558		$(window).off('scroll.hsps');
559		$(window).on('scroll.hsps',homeSliderParallaxScroll);
560				
561		//disable parallax for mobile
562		$(window).off('resize.hsps');
563		$(window).on('resize.hsps',homeSliderMobile);
564		
565	}
566
567    
568    //webkit self-hosted video fix
569    $('.jp-video-container .jp-play, jp-video-container .jp-seek-bar').click(function(){
570    	$(this).parents('.jp-video-container').prev('.jp-jplayer').find('video').show().css('display','block');
571    	$(this).parents('.jp-video-container').prev('.jp-jplayer').find('.jp-jplayer > img').hide();
572    });
573    
574    //mobile video more info
575    $('#featured .span_12 a.more-info').click(function(){
576    	if( !$(this).find('.btv').is(":visible")){
577    		$(this).parent().parent().find('h2, > a').css('opacity',1);
578    		$(this).parent().parent().find('.video').stop().animate({'top':'-400px'},800,'easeOutCubic');
579	    	$(this).parent().parent().find('h2').stop().animate({'top':'-400px'},800,'easeOutCubic');
580	    	$(this).parent().parent().find('> a').stop().animate({'top':'-380px'},800,'easeOutCubic');
581	    	$(this).find('.btv').show();
582	    	$(this).find('.mi').hide();
583    	}
584    	else {
585    		$(this).parent().parent().find('.video').stop().animate({'top':'0px'},800,'easeOutCubic');
586	    	$(this).parent().parent().find('h2').stop().animate({'top':'0px'},800,'easeOutCubic');
587	    	$(this).parent().parent().find('> a').stop().animate({'top':'0px'},800,'easeOutCubic');
588	    	$(this).find('.mi').show();
589	    	$(this).find('.btv').hide();
590    	}
591    	
592    	return false;
593    });
594
595/***************** Superfish ******************/
596	
597	function initSF(){
598
599		$(".sf-menu").superfish({
600			 delay: 700,
601			 speed: 'fast',
602			 speedOut:      'fast',             
603			 animation:   {opacity:'show'}
604		}); 
605
606	}
607	
608	var $navLeave;
609	
610	/*$('header#top nav > ul > li').hover(function(){
611		if(!$(this).hasClass('megamenu')){
612			
613		}
614	});*/
615
616	
617	function addOrRemoveSF(){
618		
619		if( window.innerWidth < 1000 && $('body').attr('data-responsive') == '1'){
620			$('body').addClass('mobile');
621			$('header#top nav').hide();
622		}
623		
624		else {
625			$('body').removeClass('mobile');
626			$('header#top nav').show();
627			$('#mobile-menu').hide();
628			
629			//recalc height of dropdown arrow
630			$('.sf-sub-indicator').css('height',$('a.sf-with-ul').height());
631		}
632	}
633	
634	addOrRemoveSF();
635	initSF();
636	
637	$(window).resize(addOrRemoveSF);
638
639	
640	function SFArrows(){
641
642		//set height of dropdown arrow
643		$('.sf-sub-indicator').css('height',$('a.sf-with-ul').height());
644	}
645	
646	SFArrows();
647	
648
649	
650
651
652/***************** Caroufredsel ******************/
653	
654	function standardCarouselInit() {
655		$('.carousel:not(".clients")').each(function(){
656	    	var $that = $(this); 
657	    	var maxCols = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 'auto' : 3 ;
658	    	var scrollNum = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 'auto' : '' ;
659	    	var colWidth = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 500 : 353 ;
660	    	var scrollSpeed, easing;
661	    	var $autoplayBool = ($(this).attr('data-autorotate') == 'true') ? true : false;
662	
663			(parseInt($(this).attr('data-scroll-speed'))) ? scrollSpeed = parseInt($(this).attr('data-scroll-speed')) : scrollSpeed = 700;
664			($(this).attr('data-easing').length > 0) ? easing = $(this).attr('data-easing') : easing = 'linear';
665			
666			
667			var $element = $that;
668			if($that.find('img').length == 0) $element = $('body');
669			
670			imagesLoaded($element,function(instance){
671	
672				
673		    	$that.carouFredSel({
674		    		circular: true,
675		    		responsive: true,
676			        items       : {
677						width : colWidth,
678				        visible     : {
679				            min         : 1,
680				            max         : maxCols
681				        }
682				    },
683				    swipe       : {
684				        onTouch     : true,
685				        onMouse         : true,
686				        options      : {
687				        	excludedElements: "button, input, select, textarea, .noSwipe",
688				        	tap: function(event, target){ if($(target).attr('href') && !$(target).is('[target="_blank"]') && !$(target).is('[rel^="prettyPhoto"]')) window.open($(target).attr('href'), '_self'); }
689				        },
690				        onBefore : function(){
691				    		//hover effect fix
692				    		$that.find('.work-item').trigger('mouseleave');
693				    		$that.find('.work-item .work-info a').trigger('mouseup');
694				    	}
695				    },
696				    scroll: {
697				    	items			: scrollNum,
698				    	easing          : easing,
699			            duration        : scrollSpeed
700				    },
701			        prev    : {
702				        button  : function() {
703				           return $that.parents('.carousel-wrap').find('.carousel-prev');
704				        }
705			    	},
706				    next    : {
707			       		button  : function() {
708				           return $that.parents('.carousel-wrap').find('.carousel-next');
709				        }
710				    },
711				    auto    : {
712				    	play: $autoplayBool
713				    }
714			    }).animate({'opacity': 1},1300);
715			    
716			    $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">');
717			    
718			    $that.addClass('finished-loading');
719
720			    carouselHeightCalcs();
721			    
722			    //reinit panr
723			    if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)) {
724					$(".portfolio-items.carousel .work-item.style-3 img").panr({
725						scaleDuration: .28,
726					}); 
727				
728				}
729				
730			    
731		     });//images loaded
732		     	     
733	    });//each
734    }
735    standardCarouselInit();
736
737
738
739
740    function productCarouselInit() {
741		$('.products-carousel').each(function(){
742	    	var $that = $(this).find('ul'); 
743	    	var maxCols = 'auto';
744	    	var scrollNum = 'auto';
745	    	var colWidth = ($(this).parents('.full-width-content ').length > 0) ? 400 : 353 ;
746			var scrollSpeed = 800;
747			var easing = 'easeInOutQuart';
748			
749			
750			var $element = $that;
751			if($that.find('img').length == 0) $element = $('body');
752			
753			//controls on hover
754			$(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>')
755
756			imagesLoaded($element,function(instance){
757	
758				
759		    	$that.carouFredSel({
760		    		circular: true,
761		    		responsive: true,
762			        items       : {
763						width : colWidth,
764				        visible     : {
765				            min         : 1,
766				            max         : maxCols
767				        }
768				    },
769				    swipe       : {
770				        onTouch     : true,
771				        onMouse         : true,
772				        options      : {
773				        	excludedElements: "button, input, select, textarea, .noSwipe",
774				        	tap: function(event, target){ if($(target).attr('href') && !$(target).is('[target="_blank"]') && !$(target).hasClass('add_to_wishlist') && !$(target).hasClass('add_to_cart_button') && !$(target).is('[rel^="prettyPhoto"]')) window.open($(target).attr('href'), '_self'); }
775				        },
776				        onBefore : function(){
777				    		//hover effect fix
778				    		$that.find('.product-wrap').trigger('mouseleave');
779				    		$that.find('.product a').trigger('mouseup');
780				    	}
781				    },
782				    scroll: {
783				    	items			: scrollNum,
784				    	easing          : easing,
785			            duration        : scrollSpeed
786				    },
787			        prev    : {
788				        button  : function() {
789				           return $that.parents('.carousel-wrap').find('.carousel-prev');
790				        }
791			    	},
792				    next    : {
793			       		button  : function() {
794				           return $that.parents('.carousel-wrap').find('.carousel-next');
795				        }
796				    },
797				    auto    : {
798				    	play: false
799				    }
800			    }).animate({'opacity': 1},1300);
801			    
802			    $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">');
803			    
804			    $that.addClass('finished-loading');
805			    fullWidthContentColumns();
806
807		     });//images loaded
808		     	     
809	    });//each
810    }
811    productCarouselInit();
812
813
814
815
816    
817    //fullwidth carousel swipe link fix
818    function fwCarouselLinkFix() {
819	    var $mousePosStart = 0;
820	    var $mousePosEnd = 0;
821	    $('.carousel-wrap[data-full-width="true"] .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mousedown(function(e){
822	    	$mousePosStart = e.clientX;
823	    });
824	    
825	    $('.carousel-wrap[data-full-width="true"] .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mouseup(function(e){
826	    	$mousePosEnd = e.clientX;
827	    });
828	    
829	    $('.carousel-wrap[data-full-width="true"] .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').click(function(e){
830	    	if(Math.abs($mousePosStart - $mousePosEnd) > 10)  return false;
831	    });
832	}
833	fwCarouselLinkFix();
834    
835     
836	function carouselHeightCalcs(){
837		
838		//recent work carousel
839		$('.carousel.portfolio-items').each(function(){
840			
841			var bottomSpace = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true' && $(this).find('.style-2, .style-3, .style-4').length > 0) ? 0 : 28 ;
842			
843			var tallestMeta = 0;
844			
845			$(this).find('> li').each(function(){
846				($(this).find('.work-meta').height() > tallestMeta) ? tallestMeta = $(this).find('.work-meta').height() : tallestMeta = tallestMeta;
847			});	
848    	 	
849     		$(this).parents('.caroufredsel_wrapper').css({
850     			'height' : ($(this).find('.work-item').outerHeight() + tallestMeta + bottomSpace -2) + 'px'
851     		});
852   	  	});
853   	  	
854   	  	//standard carousel
855   	  	$('.carousel.finished-loading:not(".portfolio-items, .clients"), .caroufredsel_wrapper .products.finished-loading').each(function(){
856			
857			var tallestColumn = 0;
858			
859			$(this).find('> li').each(function(){
860				($(this).height() > tallestColumn) ? tallestColumn = $(this).height() : tallestColumn = tallestColumn;
861			});	
862
863         	$(this).css('height',tallestColumn + 5);
864         	$(this).parents('.caroufredsel_wrapper').css('height',tallestColumn + 5);
865			
866   	  	});
867   	  	
868	}
869
870
871	function clientsCarouselInit(){
872	     $('.carousel.clients').each(function(){
873	    	var $that = $(this);
874	    	var columns; 
875	    	var $autoRotate = (!$(this).hasClass('disable-autorotate')) ? true : false;
876	    	(parseInt($(this).attr('data-max'))) ? columns = parseInt($(this).attr('data-max')) : columns = 5;
877	    	if($(window).width() < 690 && $('body').attr('data-responsive') == '1') { columns = 2; $(this).addClass('phone') }
878	    	
879	    	var $element = $that;
880			if($that.find('img').length == 0) $element = $('body');
881			
882			imagesLoaded($element,function(instance){
883	    		
884		    	$that.carouFredSel({
885			    		circular: true,
886			    		responsive: true, 
887				        items       : {
888							
889							height : $that.find('> div:first').height(),
890							width  : $that.find('> div:first').width(),
891					        visible     : {
892					            min         : 1,
893					            max         : columns
894					        }
895					    },
896					    swipe       : {
897					        onTouch     : true,
898					        onMouse         : true
899					    },
900					    scroll: {
901					    	items           : 1,
902					    	easing          : 'easeInOutCubic',
903				            duration        : '800',
904				            pauseOnHover    : true
905					    },
906					    auto    : {
907					    	play            : $autoRotate,
908					    	timeoutDuration : 2700
909					    }
910			    }).animate({'opacity': 1},1300);
911			    
912			    $that.addClass('finished-loading');
913
914			    $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">');
915			     
916
917			    $(window).trigger('resize');
918			    
919		    
920		    });
921	
922	    });
923    }
924    clientsCarouselInit();
925    
926
927    function clientsCarouselHeightRecalc(){
928
929    	var tallestImage = 0;
930		  			
931    	 $('.carousel.clients.finished-loading').each(function(){
932    	 	
933    	 	$(this).find('> div').each(function(){
934				($(this).height() > tallestImage) ? tallestImage = $(this).height() : tallestImage = tallestImage;
935			});	
936    	 	
937         	$(this).css('height',tallestImage);
938         	$(this).parent().css('height',tallestImage);
939         });
940    }
941
942
943    //carousel grabbing class
944    function carouselfGrabbingClass() {
945	    $('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(){
946	    	$(this).addClass('active');
947	    });
948	    
949	    $('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(){
950	    	$(this).removeClass('active');
951	    });
952	}
953	carouselfGrabbingClass();
954	    
955
956	//fadein for clients / carousels
957	function clientsFadeIn() {
958
959		$('.clients.fade-in-animation').each(function() {
960
961			$(this).waypoint(function(direction) {
962
963			  $(this).find('> div').each(function(i){
964					$(this).delay(i*100).animate({'opacity':"1"},450);
965				});
966				
967				var $that = $(this);
968				
969				//add the css transition class back in after the aniamtion is done
970				setTimeout(function(){ $that.addClass('completed'); },($(this).find('> div').length*100) + 450);
971
972			}, { offset: '90%', triggerOnce: true });
973
974		}); 
975	}
976	 
977	clientsFadeIn();
978	
979	
980/*-------------------------------------------------------------------------*/
981/*	2.	Helper Functions
982/*-------------------------------------------------------------------------*/
983
984	jQuery.fn.setCursorPosition = function(position){
985	    if(this.lengh == 0) return this;
986	    return $(this).setSelection(position, position);
987	}
988	
989	jQuery.fn.setSelection = function(selectionStart, selectionEnd) {
990	    if(this.lengh == 0) return this;
991	    input = this[0];
992	
993	    if (input.createTextRange) {
994	        var range = input.createTextRange();
995	        range.collapse(true);
996	        range.moveEnd('character', selectionEnd);
997	        range.moveStart('character', selectionStart);
998	        range.select();
999	    } else if (input.setSelectionRange) {
1000	        input.focus();
1001	        input.setSelectionRange(selectionStart, selectionEnd);
1002	    }
1003	
1004	    return this;
1005	}
1006	
1007	
1008
1009	$.extend($.expr[':'], {
1010	    transparent: function(elem, i, attr){
1011	      return( $(elem).css("opacity") === "0" );
1012	    }
1013	});
1014	
1015
1016	function getQueryParams(qs) {
1017	    qs = qs.split("+").join(" ");
1018	    var params = {},
1019	        tokens,
1020	        re = /[?&]?([^=]+)=([^&]*)/g;
1021
1022	    while (tokens = re.exec(qs)) {
1023	        params[decodeURIComponent(tokens[1])]
1024	            = decodeURIComponent(tokens[2]);
1025	    }
1026
1027	    return params;
1028	}
1029
1030	var $_GET = getQueryParams(document.location.search);
1031
1032	
1033	//count
1034	$.fn.countTo = function (options) {
1035		options = options || {};
1036		
1037		return $(this).each(function () {
1038			// set options for current element
1039			var settings = $.extend({}, $.fn.countTo.defaults, {
1040				from:            $(this).data('from'),
1041				to:              $(this).data('to'),
1042				speed:           $(this).data('speed'),
1043				refreshInterval: $(this).data('refresh-interval'),
1044				decimals:        $(this).data('decimals')
1045			}, options);
1046			
1047			// how many times to update the value, and how much to increment the value on each update
1048			var loops = Math.ceil(settings.speed / settings.refreshInterval),
1049				increment = (settings.to - settings.from) / loops;
1050			
1051			// references & variables that will change with each update
1052			var self = this,
1053				$self = $(this),
1054				loopCount = 0,
1055				value = settings.from,
1056				data = $self.data('countTo') || {};
1057			
1058			$self.data('countTo', data);
1059			
1060			// if an existing interval can be found, clear it first
1061			if (data.interval) {
1062				clearInterval(data.interval);
1063			}
1064			data.interval = setInterval(updateTimer, settings.refreshInterval);
1065			
1066			// initialize the element with the starting value
1067			render(value);
1068			
1069			function updateTimer() {
1070				value += increment;
1071				loopCount++;
1072				
1073				render(value);
1074				
1075				if (typeof(settings.onUpdate) == 'function') {
1076					settings.onUpdate.call(self, value);
1077				}
1078				
1079				if (loopCount >= loops) {
1080					// remove the interval
1081					$self.removeData('countTo');
1082					clearInterval(data.interval);
1083					value = settings.to;
1084					
1085					if (typeof(settings.onComplete) == 'function') {
1086						settings.onComplete.call(self, value);
1087					}
1088				}
1089			}
1090			
1091			function render(value) {
1092				var formattedValue = settings.formatter.call(self, value, settings);
1093				$self.html(formattedValue);
1094			}
1095		});
1096	};
1097	
1098	$.fn.countTo.defaults = {
1099		from: 0,               // the number the element should start at
1100		to: 0,                 // the number the element should end at
1101		speed: 1000,           // how long it should take to count between the target numbers
1102		refreshInterval: 100,  // how often the element should be updated
1103		decimals: 0,           // the number of decimal places to show
1104		formatter: formatter,  // handler for formatting the value before rendering
1105		onUpdate: null,        // callback method for every time the element is updated
1106		onComplete: null       // callback method for when the element finishes updating
1107	};
1108	
1109	function formatter(value, settings) {
1110		return value.toFixed(settings.decimals);
1111	}
1112	
1113	
1114	
1115	
1116/*-------------------------------------------------------------------------*/
1117/*	3.	Shortcode Stuff
1118/*-------------------------------------------------------------------------*/
1119
1120
1121/***************** Milestone Counter ******************/
1122	
1123	function milestoneInit() {
1124		$('.nectar-milestone').each(function() {
1125			//symbol
1126			if($(this).has('[data-symbol]')) {
1127				if($(this).attr('data-symbol-pos') == 'before') {
1128					$(this).find('.number').prepend($(this).attr('data-symbol'));
1129				} else {
1130					$(this).find('.number').append($(this).attr('data-symbol'));
1131				}
1132			}
1133		});
1134		
1135		if(!$('body').hasClass('mobile')) {
1136			
1137			$('.nectar-milestone').each(function() {
1138				//animation
1139				$(this).waypoint(function(direction) {
1140					var $endNum = parseInt($(this).find('.number span').text());
1141					$(this).find('.number span').countTo({
1142						from: 0,
1143						to: $endNum,
1144						speed: 1500,
1145						refreshInterval: 30
1146					});
1147				}, { offset: '105%', triggerOnce: true });
1148			}); 
1149		}
1150	}
1151
1152	setTimeout(function(){ 
1153		milestoneInit();
1154	},100); 
1155	
1156/***************** Tabbed ******************/
1157
1158	$('body').on('click','.tabbed > ul li a',function(){
1159		var $id = $(this).parents('li').index()+1;
1160		
1161		if(!$(this).hasClass('active-tab') && !$(this).hasClass('loading')){
1162			$(this).parents('ul').find('a').removeClass('active-tab');
1163			$(this).addClass('active-tab');
1164			
1165			$(this).parents('.tabbed').find('> div:not(.clear)').css({'visibility':'hidden','position':'absolute','opacity':'0','left':'-9999px','display':'none'});
1166			$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').css({'visibility':'visible', 'position' : 'relative','left':'0','display':'block'}).stop().animate({'opacity':1});
1167			
1168			if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+') .iframe-embed').length > 0) responsiveVideoIframes();
1169		}
1170		
1171		return false;
1172	});
1173	
1174	//make sure the tabs don't have a nectar slider - we'll init this after the sliders load in that case
1175	function tabbedInit(){ 
1176		$('.tabbed').each(function(){
1177			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){
1178				$(this).find('> ul li:first-child a').click();
1179			}	
1180			if($(this).find('.testimonial_slider').length == 1 || $(this).find('.portfolio-items:not(".carousel")').length == 1 || $(this).find('.wpb_gallery .portfolio-items').length == 1 || $(this).find('iframe').length > 0 ){
1181				var $that = $(this);
1182				
1183				$(this).find('.wpb_tab').show().css({'opacity':0,'height':'1px'});
1184				$(this).find('> ul li a').addClass('loading');
1185				
1186				setTimeout(function(){ 
1187					$that.find('.wpb_tab').hide().css({'opacity':1,'height':'auto'}); 
1188					$that.find('> ul li a').removeClass('loading');
1189					$that.find('> ul li:first-child a').click(); 
1190				},900);
1191			}
1192		});
1193	}
1194	tabbedInit();
1195
1196	//deep linking
1197	function tabbbedDeepLinking(){
1198		if(typeof $_GET['tab'] != 'undefined'){
1199			$('.wpb_tabs_nav').each(function(){
1200
1201				$(this).find('li').each(function(){
1202					var $currentText = $(this).find('a').text();
1203					var $getText = $_GET['tab'];
1204					var $that = $(this);
1205
1206					$currentText = $currentText.replace(/\s+/g, '-').toLowerCase();
1207					$getText = $getText.replace(/\s+/g, '-').toLowerCase();
1208
1209					if($currentText == $getText)  { 
1210			          $(this).find('a').click(); 
1211			           setTimeout(function(){ 
1212			              $that.find('a').click(); 
1213			           },901);
1214			        }
1215				})
1216			});
1217		}
1218	}
1219	tabbbedDeepLinking();
1220
1221/***************** Toggle ******************/
1222	
1223	//toggles
1224	$('body').on('click','.toggle h3 a', function(){
1225		
1226		if(!$(this).parents('.toggles').hasClass('accordion')) { 
1227			$(this).parents('.toggle').find('> div').slideToggle(300);
1228			$(this).parents('.toggle').toggleClass('open');
1229			
1230			//switch icon
1231			if( $(this).parents('.toggle').hasClass('open') ){
1232				$(this).find('i').attr('class','icon-minus-sign');
1233			} else {
1234				$(this).find('i').attr('class','icon-plus-sign');
1235			}
1236
1237			if($(this).parents('.toggle').find('> div .iframe-embed').length > 0 && $(this).parents('.toggle').find('> div .iframe-embed iframe').height() == '0') responsiveVideoIframes();
1238			if($(this).parents('.full-width-content').length > 0) setTimeout(function(){ fullWidthContentColumns(); },300);
1239			return false;
1240		}
1241	});
1242	
1243	//accordion
1244	$('body').on('click','.accordion .toggle h3 a', function(){
1245		
1246		if($(this).parents('.toggle').hasClass('open')) return false;
1247		
1248		$(this).parents('.toggles').find('.toggle > div').slideUp(300);
1249		$(this).parents('.toggles').find('.toggle h3 a i').attr('class','icon-plus-sign');
1250		$(this).parents('.toggles').find('.toggle').removeClass('open');
1251		
1252		$(this).parents('.toggle').find('> div').slideDown(300);
1253		$(this).parents('.toggle').addClass('open');
1254		
1255		//switch icon
1256		if( $(this).parents('.toggle').hasClass('open') ){
1257			$(this).find('i').attr('class','icon-minus-sign');
1258		} else {
1259			$(this).find('i').attr('class','icon-plus-sign');
1260		}
1261
1262		if($(this).parents('.full-width-content').length > 0) { 
1263			clearTimeout($t);
1264			var $t = setTimeout(function(){ fullWidthContentColumns(); },400);
1265		}
1266		
1267		return false;
1268	});
1269	
1270	//accordion start open
1271	function accordionInit(){ 
1272		$('.accordion').each(function(){
1273			$(this).find('> .toggle').first().addClass('open').find('> div').show();
1274			$(this).find('> .toggle').first().find('a i').attr('class','icon-minus-sign');
1275		});
1276		
1277		
1278		$('.toggles').each(function(){
1279			
1280			var $isAccordion = ($(this).hasClass('accordion')) ? true : false;
1281			
1282			$(this).find('.toggle').each(function(){
1283				if($(this).find('> div .testimonial_slider').length > 0 || $(this).find('> div iframe').length > 0) {
1284					var $that = $(this);
1285					$(this).find('> div').show().css({'opacity':0,'height':'1px', 'padding':'0'});
1286					
1287					testimonialHeightResize();
1288					
1289					setTimeout(function(){
1290						$that.find('> div').hide().css({'opacity':1,'height':'auto', 'padding':'10px 14px'}); 
1291						if($isAccordion == true && $that.index() == 0) $that.find('> div').slideDown(300);
1292					},900);
1293				} 
1294			});
1295		})
1296	}
1297	accordionInit();
1298
1299	//deep linking
1300	function accordionDeepLinking(){
1301		if(typeof $_GET['toggle'] != 'undefined'){
1302			$('.toggles').each(function(){
1303
1304				$(this).find('.toggle').each(function(){
1305					var $currentText = $(this).find('h3 a').clone();
1306					var $getText = $_GET['toggle'];
1307
1308					$($currentText).find('i').remove();
1309					$currentText = $currentText.text();
1310					$currentText = $currentText.replace(/\s+/g, '-').toLowerCase();
1311					$getText = $getText.replace(/\s+/g, '-').toLowerCase();
1312
1313					if($currentText == $getText) $(this).find('h3 a').click();
1314				});
1315			});
1316		}
1317	}
1318	accordionDeepLinking();
1319
1320/***************** Button ******************/
1321	
1322	$.cssHooks.color = {
1323	    get: function(elem) {
1324	        if (elem.currentStyle)
1325	            var color = elem.currentStyle["color"];
1326	        else if (window.getComputedStyle)
1327	            var color = document.defaultView.getComputedStyle(elem,
1328	                null).getPropertyValue("color");
1329	        if (color.search("rgb") == -1)
1330	            return color;
1331	        else {
1332	            color = color.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
1333	            function hex(x) {
1334	                return ("0" + parseInt(x).toString(16)).slice(-2);
1335	            }
1336	            if(color) {
1337	            	return "#" + hex(color[1]) + hex(color[2]) + hex(color[3]);
1338	            }
1339	        }
1340	    }
1341	}
1342
1343	$.cssHooks.backgroundColor = {
1344	    get: function(elem) {
1345	        if (elem.currentStyle)
1346	            var bg = elem.currentStyle["backgroundColor"];
1347	        else if (window.getComputedStyle)
1348	            var bg = document.defaultView.getComputedStyle(elem,
1349	                null).getPropertyValue("background-color");
1350	        if (bg.search("rgb") == -1)
1351	            return bg;
1352	        else {
1353	            bg = bg.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
1354	            function hex(x) {
1355	                return ("0" + parseInt(x).toString(16)).slice(-2);
1356	            }
1357	            if(bg) {
1358	            	return "#" + hex(bg[1]) + hex(bg[2]) + hex(bg[3]);
1359	            }
1360	        }
1361	    }
1362	}
1363	
1364	function shadeColor(hex, lum) {
1365
1366	  // validate hex string
1367		hex = String(hex).replace(/[^0-9a-f]/gi, '');
1368		if (hex.length < 6) {
1369			hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];
1370		}
1371		lum = lum || 0;
1372
1373		// convert to decimal and change luminosity
1374		var rgb = "#", c, i;
1375		for (i = 0; i < 3; i++) {
1376			c = parseInt(hex.substr(i*2,2), 16);
1377			c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16);
1378			rgb += ("00"+c).substr(c.length);
1379		}
1380
1381		return rgb;
1382	}
1383
1384	//color
1385	function coloredButtons() {
1386		$('.nectar-button.see-through[data-color-override], .nectar-button.see-through-2[data-color-override]').each(function(){
1387			
1388			$(this).css('visibility','visible');
1389			
1390			//if($(this).attr('data-color-override') != 'false'){
1391
1392				if($(this).attr('data-color-override') != 'false') {
1393					var $color = $(this).attr('data-color-override') ;
1394				} else {
1395					if($(this).parents('.dark').length > 0) 
1396						var $color = '#000000';
1397					else 
1398						var $color = '#ffffff';
1399				}
1400
1401				$(this).css('color',$color);
1402				$(this).find('i').css('color',$color);
1403				
1404				var colorInt = parseInt($color.substring(1),16);
1405				var $hoverColor = ($(this).has('[data-hover-color-override]')) ? $(this).attr('data-hover-color-override') : 'no-override';
1406				var $hoverTextColor = ($(this).has('[data-hover-text-color-override]')) ? $(this).attr('data-hover-text-color-override') : '#fff';
1407				
1408		   		var R = (colorInt & 0xFF0000) >> 16;
1409		    	var G = (colorInt & 0x00FF00) >> 8;
1410		   		var B = (colorInt & 0x0000FF) >> 0;
1411		   		
1412				$(this).css('border-color','rgba('+R+','+G+','+B+',0.75)');
1413				
1414				if($(this).hasClass('see-through')) {
1415					$(this).hover(function(){
1416						$(this).css('border-color','rgba('+R+','+G+','+B+',1)');
1417					},function(){
1418						$(this).css('border-color','rgba('+R+','+G+','+B+',0.75)');
1419					});
1420				} else {
1421					
1422					$(this).find('i').css('color', $hoverTextColor);
1423					
1424					if($hoverColor != 'no-override'){
1425						$(this).hover(function(){
1426							$(this).css({
1427								'border-color': $hoverColor,
1428								'background-color': $hoverColor,
1429								'color': $hoverTextColor
1430							});
1431						},function(){
1432							$(this).css({
1433								'border-color':'rgba('+R+','+G+','+B+',0.75)',
1434								'background-color': 'transparent',
1435								'color': $color
1436							});
1437						});
1438					
1439					} else {
1440						$(this).hover(function(){
1441							$(this).css({
1442								'border-color': $hoverColor,
1443								'color': $hoverTextColor
1444							});
1445						},function(){
1446							$(this).css({
1447								'border-color':'rgba('+R+','+G+','+B+',0.75)',
1448								'color':  $hoverTextColor
1449							});
1450						});
1451					
1452					}
1453			//	}
1454			
1455			}
1456		});
1457		
1458		$('.nectar-button:not(.see-through):not(.see-through-2)[data-color-override]').each(function(){
1459			
1460			$(this).css('visibility','visible');
1461			
1462			if($(this).attr('data-color-override') != 'false'){
1463				
1464				var $color = $(this).attr('data-color-override');
1465				$(this).removeClass('accent-color').removeClass('extra-color-1').removeClass('extra-color-2').removeClass('extra-color-3');
1466				$(this).css('background-color',$color);
1467				
1468			}
1469			
1470		});
1471
1472
1473		//solid color tilt 
1474		if($('.swiper-slide .solid_color_2').length > 0 || $('.tilt-button-inner').length > 0) {
1475
1476			var $tiltButtonCssString = '';
1477
1478			$('.swiper-slide .solid_color_2 a').each(function(i){
1479				
1480				$(this).addClass('instance-'+i);
1481
1482				if($(this).attr('data-color-override') != 'false') {
1483					var $color = $(this).attr('data-color-override');
1484				} else {
1485					if($(this).parents('.dark').length > 0) 
1486						var $color = '#000000';
1487					else 
1488						var $color = '#ffffff';
1489				}
1490
1491				$(this).css('color',$color);
1492				$(this).find('i').css('color',$color);
1493				
1494				var $currentColor = $(this).css('background-color');
1495				var $topColor = shadeColor($currentColor, 0.13);
1496				var $bottomColor = shadeColor($currentColor, -0.15);
1497	
1498				$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+'; } ';
1499
1500			});
1501
1502
1503			$('.tilt-button-wrap a').each(function(i){
1504				
1505				$(this).addClass('instance-'+i);
1506
1507				var $currentColor = $(this).css('background-color');
1508
1509				if($(this).attr('data-color-override') != 'false') {
1510					var $color = $(this).attr('data-color-override');
1511					$(this).css('background-color',$color);
1512					$currentColor = $color;
1513				} 
1514			
1515				var $topColor = shadeColor($currentColor, 0.13);
1516				var $bottomColor = shadeColor($currentColor, -0.15);
1517	
1518				$tiltButtonCssString += '.tilt-button-wrap a.instance-'+i + ':after { background-color: '+$topColor+';  }' + ' .tilt-button-wrap a.instance-'+i + ':before { background-color: '+$bottomColor+'; } ';
1519
1520			});
1521
1522			var head = document.head || document.getElementsByTagName('head')[0];
1523   			var style = document.createElement('style');
1524
1525   			style.type = 'text/css';
1526			if (style.styleSheet){
1527			  style.styleSheet.cssText = $tiltButtonCssString;
1528			} else {
1529			  style.appendChild(document.createTextNode($tiltButtonCssString));
1530			}
1531
1532			head.appendChild(style);
1533		}
1534
1535	}
1536
1537	coloredButtons();
1538
1539
1540	//large icon hover
1541	function largeIconHover(){
1542		$('.icon-3x').each(function(){
1543			$(this).closest('.col').hover(function(){
1544				$(this).find('.icon-3x').addClass('hovered')
1545			},function(){
1546				$('.icon-3x').removeClass('hovered')
1547			});
1548		});
1549	}
1550	largeIconHover();
1551
1552
1553
1554/***************** Column Hover BG ******************/
1555
1556function columnHoverBG() {	
1557	$('.wpb_column[data-hover-bg^=#]').each(function(){
1558
1559		var $originalBG = $(this).css('background-color');
1560
1561		$(this).hover(function(){
1562			$(this).stop(true,true).css('background-color',$(this).attr('data-hover-bg'));
1563		},function(){
1564			$(this).stop(true,true).css('background-color',$originalBG);
1565		});
1566	});
1567}
1568columnHoverBG();
1569
1570/***************** fancy ul ******************/
1571	function nectar_fancy_ul_init() {
1572		$('.nectar-fancy-ul').each(function(){
1573			
1574			if($(this).find('li i').length == 0) {
1575				
1576				var $icon = $(this).attr('data-list-icon');
1577				var $color = $(this).attr('data-color');
1578				var $animation = $(this).attr('data-animation');
1579				
1580				$(this).find('li').prepend('<i class="icon-default-style '+$icon+ ' ' + $color +'"></i> ');
1581				
1582				if($animation == 'true') {
1583					$(this).waypoint(function(direction) {
1584					
1585						$(this).find('li').each(function(i){
1586							$(this).delay(i*250).animate({
1587								'opacity': '1',
1588								'left' : '0'
1589							},250,'easeOutCubic');
1590						});
1591						
1592					}, { offset: '90%', triggerOnce: true });
1593				} 
1594				
1595			}
1596			
1597		});
1598	}
1599	setTimeout(function(){ 
1600		nectar_fancy_ul_init();
1601	},100); 
1602
1603	
1604
1605/***************** PARALLAX SECTIONS ******************/
1606	
1607	// Create cross browser requestAnimationFrame method:
1608    window.requestAnimationFrame = window.requestAnimationFrame
1609     || window.mozRequestAnimationFrame
1610     || window.webkitRequestAnimationFrame
1611     || window.msRequestAnimationFrame
1612     || function(f){setTimeout(f, 1000/60)}
1613
1614
1615	var $window = $(window);
1616	var windowHeight = $window.height();
1617	
1618	$window.unbind('scroll.parallaxSections').unbind('resize.parallaxSections');
1619	$window.unbind('resize.parallaxSectionsUpdateHeight');
1620	$window.unbind('load.parallaxSectionsOffsetL');
1621	$window.unbind('resize.parallaxSectionsOffsetR');
1622
1623	$window.on('resize.parallaxSectionsUpdateHeight',psUpdateWindowHeight);
1624
1625	function psUpdateWindowHeight() {
1626		windowHeight = $window.height();
1627	}
1628
1629	function psUpdateOffset($this) {
1630		$this.each(function(){
1631	  	    firstTop = $this.offset().top;
1632		});
1633	}
1634	
1635	$.fn.parallaxScroll = function(xpos, speedFactor, outerHeight) {
1636		var $this = $(this);
1637		var getHeight;
1638		var firstTop;
1639		var paddingTop = 0;
1640		
1641		//get the starting position of each element to have parallax applied to it		
1642		$this.each(function(){
1643		    firstTop = $this.offset().top;
1644		});
1645		
1646		
1647		$window.on('resize.parallaxSectionsOffsetR',psUpdateOffset($this));
1648		$window.on('load.parallaxSectionsOffsetL',psUpdateOffset($this));
1649	
1650		getHeight = function(jqo) {
1651			return jqo.outerHeight(true);
1652		};
1653		 
1654			
1655		// setup defaults if arguments aren't specified
1656		if (arguments.length < 1 || xpos === null) xpos = "50%";
1657		if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1;
1658		if (arguments.length < 3 || outerHeight === null) outerHeight = true;
1659		
1660		// function to be called whenever the window is scrolled or resized
1661
1662		var $element, top, height, pos;
1663
1664		function update(){
1665
1666			pos = $window.scrollTop();				
1667			
1668			$this.each(function(){
1669
1670				firstTop = $this.offset().top;
1671				$element = $(this);
1672				top = $element.offset().top;
1673				height = getHeight($element);
1674
1675				// Check if totally above or totally below viewport
1676				if (top + height < pos || top > pos + windowHeight) {
1677					return;
1678				}
1679
1680				var ua = window.navigator.userAgent;
1681		        var msie = ua.indexOf("MSIE ");
1682
1683		        //for IE, Safari or any setup using the styled scrollbar default to animating the BG pos
1684		        if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./) || $smoothCache == true || navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) {
1685		        	$this.find('.row-bg.using-image').css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px");
1686		        }
1687		       	//for Firefox/Chrome use a higher performing method
1688		        else  {
1689		        	$this.find('.row-bg.using-image').transition({ 'y':  Math.round((firstTop - pos) * speedFactor) + "px"},0);
1690		        }              
1691				
1692			});
1693		}		
1694
1695		if (window.addEventListener) {
1696			 window.addEventListener('scroll', function(){ 
1697	          requestAnimationFrame(update); 
1698	        }, false);
1699		}
1700
1701		$window.on('resize.parallaxSections',update);
1702
1703		update();
1704	};
1705
1706
1707
1708	
1709/***************** Full Width Section ******************/
1710	function fullWidthSections(){
1711		
1712		var $scrollBar = ($('#ascrail2000').length > 0 && window.innerWidth > 1000) ? -13 : 4;
1713			 
1714		if($('#boxed').length == 1){
1715			$justOutOfSight = ((parseInt($('.container-wrap').width()) - parseInt($('.main-content').width())) / 2) + 4;
1716		} else {
1717			
1718			//if the ext responsive mode is on - add the extra padding into the calcs
1719			var $extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1000) ? 180 : 0;
1720			
1721			if($(window).width() <= parseInt($('.main-content').css('max-width'))) { 
1722				var $windowWidth = parseInt($('.main-content').css('max-width'));
1723
1724				//no need for the scrollbar calcs with ext responsive on desktop views
1725				if($extResponsivePadding == 180) $windowWidth = $windowWidth - $scrollBar;
1726
1727			} else { 
1728				var $windowWidth = $(window).width();
1729			}
1730
1731			
1732			$contentWidth = parseInt($('.main-content').css('max-width'));
1733
1734			//single post fullwidth
1735			if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 ) {
1736				$contentWidth = $('#post-area').width();
1737				$extResponsivePadding = 0;
1738			}
1739			
1740			$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
1741		}
1742		
1743		$('.full-width-section').each(function(){
1744			
1745			if(!$(this).parents('.span_9').length > 0 && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner' && $(this).parent().attr('id') != 'portfolio-extra' &&
1746			!$(this).hasClass('non-fw')){
1747
1748				$(this).css({
1749					'margin-left': - $justOutOfSight,
1750					'padding-left': $justOutOfSight,
1751					'padding-right': $justOutOfSight,
1752					'visibility': 'visible'
1753				});	
1754			}  else if($(this).parent().attr('id') == 'portfolio-extra' && $('#full_width_portfolio').length != 0) {
1755				$(this).css({
1756					'margin-left': - $justOutOfSight,
1757					'padding-left': $justOutOfSight,
1758					'padding-right': $justOutOfSight,
1759					'visibility': 'visible'
1760				});	
1761			}
1762			
1763			else {
1764				$(this).css({
1765					'margin-left': 0,
1766					'padding-left': 0,
1767					'padding-right': 0,
1768					'visibility': 'visible'
1769				});	
1770			}
1771			
1772		});
1773	
1774	
1775	    //full width content sections
1776	    $('.carousel-outer').has('.carousel-wrap[data-full-width="true"]').css('overflow','visible');
1777	    
1778	    $('.carousel-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"], .full-width-content').each(function(){
1779			
1780			//single post fullwidth
1781			if($('#boxed').length == 1){
1782				if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 && $(this).parents('#post-area').length > 0) {
1783					$contentWidth = $('#post-area').width();
1784					$extResponsivePadding = 0;
1785					$windowWidth = $(window).width();
1786					$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
1787				} else {
1788					$justOutOfSight = ((parseInt($('.container-wrap').width()) - parseInt($('.main-content').width())) / 2) + 4;
1789				}
1790			} else {
1791				if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 && $(this).parents('#post-area').length > 0) {
1792					$contentWidth = $('#post-area').width();
1793					$extResponsivePadding = 0;
1794					$windowWidth = $(window).width();
1795				} else {
1796
1797					if($(window).width() <= parseInt($('.main-content').css('max-width'))) { 
1798						$windowWidth = parseInt($('.main-content').css('max-width'));
1799						//no need for the scrollbar calcs with ext responsive on desktop views
1800						if($extResponsivePadding == 180) $windowWidth = $windowWidth - $scrollBar;
1801					}
1802					$contentWidth = parseInt($('.main-content').css('max-width'));
1803					$extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1000) ? 180 : 0;
1804				}
1805				$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
1806			}
1807
1808			$extraSpace = ($(this).hasClass('carousel-wrap')) ? 1 : 4;
1809	    	$carouselWidth = ($('#boxed').length == 1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2) : $(window).width() +$extraSpace  + $scrollBar ;
1810	    	
1811	    	if($(this).parent().hasClass('default-style')) { 
1812	    		
1813	    		if($('#boxed').length != 0) {
1814	    			$carouselWidth = ($('#boxed').length == 1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2) : $(window).width() + $extraSpace + $scrollBar ;
1815				}
1816				else {
1817					$carouselWidth = ($('#boxed').length == 1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2) : $(window).width()  - ($(window).width()*.02) + $extraSpace + $scrollBar ;
1818					$windowWidth = ($(window).width() <= parseInt($('.main-content').width())) ? parseInt($('.main-content').width()) : $(window).width() - ($(window).width()*.02);
1819					$justOutOfSight = Math.ceil( (($windowWidth + $scrollBar - parseInt($('.main-content').width())) / 2) )
1820				}
1821			}
1822	    	
1823	    	if(!$(this).parents('.span_9').length > 0 && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner' && $(this).parent().attr('id') != 'portfolio-extra' 
1824	        && !$(this).find('.carousel-wrap[data-full-width="true"]').length > 0
1825	    	&& !$(this).find('.portfolio-items:not(".carousel")[data-col-num="elastic"]').length > 0){
1826
1827	    		//escape if inside woocoommerce page and not using applicable layout
1828	    		if($('.single-product').length > 0 && $(this).parents('#tab-description').length > 0 && $(this).parents('.full-width-tabs').length == 0) {
1829	    			$(this).css({
1830						'visibility': 'visible'
1831					});	
1832	    		} else {
1833
1834					$(this).css({
1835						'margin-left': - $justOutOfSight,
1836						'width': $carouselWidth,
1837						'visibility': 'visible'
1838					});	
1839				}
1840			}  else if($(this).parent().attr('id') == 'portfolio-extra' && $('#full_width_portfolio').length != 0) {
1841				$(this).css({
1842					'margin-left': - $justOutOfSight,
1843					'width': $carouselWidth,
1844					'visibility': 'visible'
1845				});	
1846			}
1847			
1848			else {
1849				$(this).css({
1850					'margin-left': 0,
1851					'visibility': 'visible'
1852				});	
1853			}
1854	    	
1855	    });
1856
1857	}
1858	
1859	var $contentElementsNum = ($('#portfolio-extra').length == 0) ? $('.main-content > .row > *').length : $('.main-content > .row #portfolio-extra > *').length ;
1860
1861	function parallaxScrollInit(){
1862		$('.full-width-section.parallax_section, .full-width-content.parallax_section').each(function(){
1863		   var $id = $(this).attr('id');
1864		   $('#'+$id + ".parallax_section").parallaxScroll("50%", 0.2);
1865
1866		   parallaxRowsBGCals();
1867		});
1868	}
1869
1870	
1871	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
1872		parallaxScrollInit();
1873		$(window).load(parallaxRowsBGCals);
1874	}
1875
1876	function parallaxRowsBGCals(){
1877		$('.full-width-section.parallax_section, .full-width-content.parallax_section').each(function(){
1878			 $(this).find('.row-bg').css({'height': $(this).outerHeight(true)*2.5, 'margin-top': '-' + ($(this).outerHeight(true)*2.5)/2 + 'px' });
1879		});
1880	}
1881	
1882	//if fullwidth section is first or last, remove the margins so it fits flush against header/footer
1883	function fwsClasses() {
1884		
1885		$contentElementsNum = ($('#portfolio-extra').length == 0) ? $('.main-content > .row > *').length : $('.main-content > .row #portfolio-extra > *').length ;
1886
1887		$('.full-width-section, .full-width-content, .row > .nectar-slider-wrap[data-full-width="true"], .wpb_wrapper > .nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer, .portfolio-items[data-col-num="elastic"]').each(function(){
1888			
1889			if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){
1890				
1891				if($(this).parents('.wpb_row').length > 0){ 
1892				
1893					if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false;
1894					
1895					////first
1896					if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length != 0 || $(this).parents('.wpb_row').index() == '0' && $('.parallax_slider_outer').length != 0){
1897						//$(this).css('margin-top','-2.1em').addClass('first-section nder-page-header');
1898		
1899					} 
1900					else if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length == 0 && $('.page-header-no-bg').length == 0 
1901					         && $('.project-title').length == 0 && $(this).parents('.wpb_row').index() == '0' 
1902					         && $('.parallax_slider_outer').length == 0 && $('.project-title').length == 0 
1903					         && $('body[data-bg-header="true"]').length == 0 ){
1904					         	
1905						$(this).css('margin-top','-70px').addClass('first-section');
1906					} 
1907					
1908					//check if it's also last (i.e. the only fws)
1909					if($(this).parents('.wpb_row').index() == $contentElementsNum-1 && $('#respond').length == 0 ) { 
1910						if($(this).attr('id') != 'portfolio-filters-inline') {
1911							$('.container-wrap').css('padding-bottom','0px');
1912							$('#call-to-action .triangle').remove();
1913						}
1914					} 
1915				
1916				} else {
1917					
1918					if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false;
1919					
1920					if( $(this).find('.portfolio-filters-inline').length == 0 && $(this).attr('id') != 'post-area' ) {
1921						
1922						////first
1923						if($(this).index() == '0' && $('#page-header-bg').length != 0 || $(this).index() == '0' && $('.parallax_slider_outer').length != 0){
1924							//$(this).css('margin-top','-2.1em').addClass('first-section nder-page-header');
1925			
1926						} 
1927						else if($(this).index() == '0' && $('#page-header-bg').length == 0 && $(this).index() == '0' && $('.page-header-no-bg').length == 0 && 
1928						        $(this).index() == '0' && $('.parallax_slider_outer').length == 0) {
1929						        	
1930							$(this).css('margin-top','-70px').addClass('first-section');
1931						} 
1932						
1933						//check if it's also last (i.e. the only fws)
1934						if($(this).index() == $contentElementsNum-1 && $('#respond').length == 0 ) { 
1935							$('.container-wrap').css('padding-bottom','0px');
1936							$('#call-to-action .triangle').remove();
1937						} 
1938					}
1939					
1940				}
1941			}
1942		});
1943		
1944		$('#portfolio-extra > .nectar-slider-wrap[data-full-width="true"], .portfolio-wrap').each(function(){
1945			//check if it's last 
1946			if($(this).index() == $contentElementsNum-1 && $('#commentform').length == 0 && $('#pagination').length == 0) { 
1947				$(this).css('margin-bottom','-40px');
1948				$('#call-to-action .triangle').remove();
1949			}
1950		});
1951		
1952		
1953		
1954		$('.portfolio-filters').each(function(){
1955			////first
1956			if($(this).index() == '0' && $('#page-header-bg').length != 0 || $(this).index() == '0' && $('.parallax_slider_outer').length != 0){
1957				$(this).css({'margin-top':'-2.1em'}).addClass('first-section nder-page-header');
1958			}  else if($(this).index() == '0' && $('#page-header-bg').length == 0 || $(this).index() == '0' && $('.parallax_slider_outer').length == 0){
1959				$(this).css({'margin-top':'0px'}).addClass('first-section');
1960			}
1961		});
1962		
1963		$('.portfolio-filters-inline').each(function(){
1964			////first
1965			if($(this).parents('.wpb_row').length > 0){ 
1966				
1967				if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length != 0 || $(this).parents('.wpb_row').index() == '0' && $('.parallax_slider_outer').length != 0){
1968					$(this).css({'margin-top':'-2.1em', 'padding-top' : '19px'}).addClass('first-section nder-page-header');
1969				}  else if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length == 0 || $(this).parents('.wpb_row').index() == '0' && $('.parallax_slider_outer').length == 0){
1970					$(this).css({'margin-top':'-70px', 'padding-top' : '50px'}).addClass('first-section');
1971				}
1972				
1973			} else {
1974				if($(this).index() == '0' && $('#page-header-bg').length != 0 || $(this).index() == '0' && $('.parallax_slider_outer').length != 0){
1975					$(this).css({'margin-top':'-2.1em', 'padding-top' : '19px'}).addClass('first-section nder-page-header');
1976				}  else if($(this).index() == '0' && $('#page-header-bg').length == 0 || $(this).index() == '0' && $('.parallax_slider_outer').length == 0){
1977					$(this).css({'margin-top':'-70px', 'padding-top' : '50px'}).addClass('first-section');
1978				}
1979			}
1980			
1981		});
1982		
1983		
1984		
1985		$('.parallax_slider_outer').each(function(){
1986			if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){
1987				
1988				if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false;
1989				////first
1990				if($(this).parent().index() == '0' && $('#page-header-bg').length != 0){
1991					$(this).addClass('first-section nder-page-header');
1992
1993				} 
1994				else if($(this).parent().index() == '0' && $('#page-header-bg').length == 0){
1995					$(this).css('margin-top','-40px').addClass('first-section');
1996					if(!$('body').hasClass('single-post')) $('.container-wrap').css('padding-top', '0px');
1997				} 
1998				
1999				//check if it's also last (i.e. the only fws)
2000				if($(this).parent().index() == $contentElementsNum-1 && $('#post-area').length == 0) {
2001					$('#call-to-action .triangle').remove();
2002					$('.container-wrap').hide();
2003				}
2004			}
2005		});
2006	}
2007	
2008	//if not using a fullwidth slider first, ajdust the top padding
2009	//if( $('.nectar-slider-wrap.first-section').length > 0 && $('.nectar-slider-wrap.first-section').attr('data-full-width') != 'true' || $('.nectar-slider-wrap.first-section').length > 0 && $('.nectar-slider-wrap.first-section').attr('data-full-width') != 'boxed-full-width' ) $('body').attr('data-bg-header','false');
2010	//if( $('.wpb_row.first-section:not(".full-width-content") .nectar-slider-wrap').length > 0 && $('.wpb_row.first-section:not(".full-width-content") .nectar-slider-wrap').attr('data-full-width') != 'true' || $('.wpb_row.first-section:not(".full-width-content") .nectar-slider-wrap').length > 0 && $('.wpb_row.first-section:not(".full-width-content") .nectar-slider-wrap').attr('data-full-width') != 'boxed-full-width' ) $('body').attr('data-bg-header','false');
2011	
2012	
2013	//set sizes
2014	fullWidthSections();
2015	fwsClasses();
2016	
2017	//sizing for fullwidth sections that are image only
2018
2019	function fullwidthImgOnlySizingInit(){
2020		////set inital sizes
2021		$('.full-width-section:not(.custom-skip)').each(function(){
2022			
2023			var $fwsHeight = $(this).outerHeight(true);
2024
2025			//make sure it's empty and also not being used as a small dvider
2026			if($(this).find('.span_12 *').length == 0 && $.trim( $(this).find('.span_12').text() ).length == 0  && $fwsHeight > 40){
2027				$(this).addClass('bg-only');
2028				$(this).css({'height': $fwsHeight, 'padding-top': '0px', 'padding-bottom': '0px'});
2029				$(this).attr('data-image-height',$fwsHeight);
2030			}
2031
2032		});
2033	}
2034
2035	function fullwidthImgOnlySizing(){
2036
2037		$('.full-width-section.bg-only').each(function(){
2038			var $initialHeight = $(this).attr('data-image-height');
2039			
2040			if( window.innerWidth < 1000 && window.innerWidth > 690 ) {
2041				$(this).css('height', $initialHeight - $initialHeight*.60);
2042			} 
2043			
2044			else if( window.innerWidth <= 690 ) {
2045				$(this).css('height', $initialHeight - $initialHeight*.78);
2046			} 
2047			
2048			else if( window.innerWidth < 1300 && window.innerWidth >= 1000  ) {
2049				$(this).css('height', $initialHeight - $initialHeight*.33);
2050			} 
2051			
2052			else {
2053				$(this).css('height', $initialHeight);
2054			}
2055			
2056		});
2057		
2058	}
2059
2060	fullwidthImgOnlySizingInit();
2061	fullwidthImgOnlySizing();
2062	
2063	
2064	
2065	//change % padding on rows to be relative to screen
2066	function fullWidthRowPaddingAdjustInit(){
2067		if($('#boxed').length == 0){
2068			$('.full-width-section, .full-width-content').each(function(){
2069				var $topPadding = $(this)[0].style.paddingTop;
2070				var $bottomPadding = $(this)[0].style.paddingBottom;
2071
2072				if($topPadding.indexOf("%") >= 0) $(this).attr('data-top-percent',$topPadding);
2073				if($bottomPadding.indexOf("%") >= 0) $(this).attr('data-bottom-percent',$bottomPadding);
2074				
2075
2076			});
2077		}
2078	}
2079
2080	function fullWidthRowPaddingAdjustCalc(){
2081		if($('#boxed').length == 0){
2082			$('.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(){
2083
2084				var $windowHeight = $(window).width();
2085				var $topPadding = ($(this).attr('data-top-percent')) ? $(this).attr('data-top-percent') : 'skip';
2086				var $bottomPadding = ($(this).attr('data-bottom-percent')) ? $(this).attr('data-bottom-percent') : 'skip';
2087
2088				//top
2089				if($topPadding != 'skip') {
2090					$(this).css('padding-top',$windowHeight*(parseInt($topPadding)/100));
2091				}
2092
2093				//bottom
2094				if($bottomPadding != 'skip'){
2095					$(this).css('padding-bottom',$windowHeight*(parseInt($bottomPadding)/100));
2096				}
2097				
2098
2099			});
2100		}
2101	}
2102	fullWidthRowPaddingAdjustInit();
2103	fullWidthRowPaddingAdjustCalc();
2104
2105	
2106	//full width content column sizing
2107	function fullWidthContentColumns(){
2108
2109		//standard carousel
2110   	  	$('.main-content > .row > .full-width-content, #portfolio-extra > .full-width-content, .woocommerce-tabs #tab-description > .full-width-content').each(function(){
2111			
2112			//only set the height if more than one column
2113			if($(this).find('> .span_12 > .col').length > 1){
2114				
2115				var tallestColumn = 0;
2116				var $columnInnerHeight = 0;
2117				
2118				$(this).find('> .span_12 > .col').each(function(){
2119					
2120					var $padding = parseInt($(this).css('padding-top'));
2121					($(this).find('> .wpb_wrapper').height() + ($padding*2) > tallestColumn) ? tallestColumn = $(this).find('> .wpb_wrapper').height() + ($padding*2)  : tallestColumn = tallestColumn;
2122				});	
2123	    	 	
2124	    	 	$(this).find('> .span_12 > .col').each(function(){
2125
2126	    	 		//columns with content
2127		    	 	if($(this).find('> .wpb_wrapper > *').length > 0){
2128		    	 		$(this).css('height',tallestColumn);
2129		    	 	} 
2130		    	 	//empty columns
2131		    	 	else {
2132		    	 		$(this).css('min-height',tallestColumn);
2133		    	 	}
2134	    	 	});
2135	         	
2136	         	//nested column height
2137	         	var $childRows = $(this).find('> .span_12 > .col .wpb_row').length;
2138	         	if(window.innerWidth > 1000) { 
2139	         		
2140	         		var $padding = parseInt($(this).find('> .span_12 > .col').css('padding-top'));
2141	         		
2142	         		//$(this).find('> .span_12 > .col .wpb_row .col').css('min-height',(tallestColumn-($padding*2))/$childRows + 'px'); 
2143	         	} else {
2144	         		$(this).find('> .span_12 > .col .wpb_row .col').css('min-height','0px'); 
2145	         	}
2146	         	
2147	         	
2148	         	//vertically center
2149	         	if($(this).hasClass('vertically-align-columns') && window.innerWidth > 1000){
2150	         		
2151	         		//parent columns
2152		         	$(this).find('> .span_12 > .col').each(function(){
2153						
2154						$columnInnerHeight = $(this).find('> .wpb_wrapper').height();
2155						var $marginCalc = ($(this).height()/2)-($columnInnerHeight/2);
2156						if($marginCalc <= 0) $marginCalc = 0;
2157						
2158						$(this).find('> .wpb_wrapper').css('margin-top',$marginCalc);
2159						$(this).find('> .wpb_wrapper').css('margin-bottom',$marginCalc);
2160						
2161					});	
2162	
2163					
2164				}
2165			
2166			}
2167			
2168   	  	});
2169		
2170	}
2171	
2172	fullWidthContentColumns();
2173	
2174	
2175
2176
2177function mouseParallaxInit(){
2178	$('.wpb_row:has(.nectar-parallax-scene)').each(function(){
2179
2180		if($(this).hasClass('first-section')) { 
2181			$('body #header-outer[data-transparent-header="true"] .ns-loading-cover').show();
2182
2183			if($('body #header-outer[data-transparent-header="true"]').length > 0) { 
2184				$(this).css('overflow','hidden');
2185				$(this).find('.nectar-slider-loading').css({
2186					'top': $('#header-space').height(),
2187					'margin-top' : '-1px'
2188				});
2189				$(this).find('.nectar-slider-loading .loading-icon').css({
2190					'height' :  $('.first-section .nectar-parallax-scene').height() - $('#header-space').height() + 'px',
2191					'opacity' : '1'
2192				});
2193			}
2194		}
2195
2196		var $strength = parseInt($(this).find('.nectar-parallax-scene').attr('data-scene-strength'));
2197
2198		$(this).find('.nectar-parallax-scene').parallax({
2199			scalarX: $strength,
2200	  		scalarY: $strength
2201		});
2202
2203		//wait until the images in the scene have loaded
2204		var images = $(this).find('.nectar-parallax-scene li');
2205		
2206		$.each(images, function(){
2207			if($(this).find('div').length > 0) {
2208			    var el = $(this).find('div'),
2209			    image = el.css('background-image').replace(/"/g, '').replace(/url\(|\)$/ig, '');
2210			    if(image && image !== '' && image !== 'none')
2211			        images = images.add($('<img>').attr('src', image));
2212			}
2213		});
2214
2215		var $that = $(this);
2216		images.imagesLoaded(function(){
2217			$that.find('> .nectar-slider-loading').fadeOut(800,'easeInOutExpo');
2218			if($that.hasClass('first-section')) { 
2219				$('body #header-outer[data-transparent-header="true"] .ns-loading-cover').fadeOut(800,'easeInOutExpo',function(){
2220    				$(this).remove();
2221    			});
2222			}
2223		});
2224
2225	});
2226}
2227mouseParallaxInit();
2228
2229	
2230/***************** Checkmarks ******************/
2231
2232function ulChecks() {
2233	$('ul.checks li').prepend('<i class="icon-ok-sign"></i>');
2234}
2235ulChecks();
2236
2237/***************** Image with Animation / Col Animation *******************/
2238
2239
2240	
2241function colAndImgAnimations(){
2242	$('img.img-with-animation').each(function() {
2243	
2244		$(this).waypoint(function(direction) {
2245
2246			if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
2247				
2248				if($(this).attr('data-animation') == 'fade-in-from-left'){
2249					$(this).delay($(this).attr('data-delay')).animate({
2250						'opacity' : 1,
2251						'left' : '0px'
2252					},600,'easeOutSine');
2253				} else if($(this).attr('data-animation') == 'fade-in-from-right'){
2254					$(this).delay($(this).attr('data-delay')).animate({
2255						'opacity' : 1,
2256						'right' : '0px'
2257					},600,'easeOutSine');
2258				} else if($(this).attr('data-animation') == 'fade-in-from-bottom'){
2259					$(this).delay($(this).attr('data-delay')).animate({
2260						'opacity' : 1,
2261						'bottom' : '0px'
2262					},600,'easeOutSine');
2263				} else if($(this).attr('data-animation') == 'fade-in') {
2264					$(this).delay($(this).attr('data-delay')).animate({
2265						'opacity' : 1
2266					},600,'easeOutSine');	
2267				} else if($(this).attr('data-animation') == 'grow-in') {
2268					var $that = $(this);
2269					setTimeout(function(){ 
2270						$that.transition({ scale: 1, 'opacity':1 },900,'cubic-bezier(0.15, 0.84, 0.35, 1.25)');
2271					},$that.attr('data-delay'));
2272				}
2273				
2274				else if($(this).attr('data-animation') == 'flip-in') {
2275					var $that = $(this);
2276					setTimeout(function(){ 
2277						$that.transition({  rotateY: 0, 'opacity':1 },1100);
2278					},$that.attr('data-delay'));
2279				}
2280				
2281			}
2282			
2283		}, { offset: '90%', triggerOnce: true });
2284	
2285	});
2286
2287
2288
2289	$('.col.has-animation, .wpb_column.has-animation').each(function() {
2290	    
2291		$(this).waypoint(function(direction) {
2292			
2293			if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
2294			 	
2295				if($(this).attr('data-animation') == 'fade-in-from-left'){
2296					$(this).delay($(this).attr('data-delay')).animate({
2297						'opacity' : 1,
2298						'left' : '0px'
2299					},800,'easeOutSine');
2300				} else if($(this).attr('data-animation') == 'fade-in-from-right'){
2301					$(this).delay($(this).attr('data-delay')).animate({
2302						'opacity' : 1,
2303						'right' : '0px'
2304					},800,'easeOutSine');
2305				} else if($(this).attr('data-animation') == 'fade-in-from-bottom'){
2306					$(this).delay($(this).attr('data-delay')).animate({
2307						'opacity' : 1,
2308						'bottom' : '0px'
2309					},800,'easeOutSine');
2310				} else if($(this).attr('data-animation') == 'fade-in') {
2311					$(this).delay($(this).attr('data-delay')).animate({
2312						'opacity' : 1
2313					},800,'easeOutSine');	
2314				} else if($(this).attr('data-animation') == 'grow-in') {
2315					var $that = $(this);
2316					setTimeout(function(){ 
2317						$that.transition({ scale: 1, 'opacity':1 },900,'cubic-bezier(0.15, 0.84, 0.35, 1.25)');
2318					},$that.attr('data-delay'));
2319				} else if($(this).attr('data-animation') == 'flip-in') {
2320					var $that = $(this);
2321					setTimeout(function(){ 
2322						$that.transition({  rotateY: 0, 'opacity':1 },1100);
2323					},$that.attr('data-delay'));
2324				}
2325			
2326			}
2327			
2328	
2329		}, { offset: '90%', triggerOnce: true });
2330	
2331	}); 	
2332}
2333	
2334setTimeout(function(){ 
2335	colAndImgAnimations();
2336},100); 	
2337
2338
2339	
2340/***************** 4 Col Grid in iPad ******************/
2341	
2342	//add one-fourth class
2343	function oneFourthClasses() {
2344		$('.col.span_3, .vc_span3, .vc_col-sm-3').each(function(){
2345			var $currentDiv = $(this);
2346			var $nextDiv = $(this).next('div');
2347			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') ) {
2348				$currentDiv.addClass('one-fourths clear-both');
2349				$nextDiv.addClass('one-fourths right-edge');
2350			}
2351		});
2352		
2353		/*$('.vc_span4').each(function(){
2354			if($(this).find('.team-member').length > 0 && $(this).parents('.full-width-content').length > 0) {
2355				var $currentDiv = $(this);
2356				var $nextDiv = $(this).next('div');
2357				if( !$currentDiv.hasClass('one-fourths')) {
2358					$currentDiv.addClass('one-fourths clear-both');
2359					$nextDiv.addClass('one-fourths right-edge');
2360				}
2361			}
2362		});*/
2363		
2364		//make empty second 1/2 half columsn display right on iPad
2365		$('.span_12 .col.span_6').each(function(){
2366			if($(this).next('div').hasClass('span_6') && $.trim( $(this).next('div').html() ).length == 0 ) {
2367				$(this).addClass('empty-second')
2368			}
2369		}); 
2370	}
2371	oneFourthClasses();
2372	
2373/***************** Bar Graph ******************/
2374function progressBars(){
2375	$('.nectar-progress-bar').each(function(i){
2376		
2377		$(this).waypoint(function(direction) {
2378			
2379			var percent = $(this).find('span').attr('data-width');
2380			var $endNum = parseInt($(this).find('span strong i').text());
2381			var $that = $(this);
2382			
2383			$(this).find('span').animate({
2384				'width' : percent + '%'
2385			},1600, 'easeOutCirc',function(){
2386			});
2387			
2388			$(this).find('span strong').animate({
2389				'opacity' : 1
2390			},1350);
2391		
2392			
2393			$(this).find('span strong i').countTo({
2394				from: 0,
2395				to: $endNum,
2396				speed: 1100,
2397				refreshInterval: 30,
2398				onComplete: function(){
2399		
2400				}
2401			});	
2402			
2403			////100% progress bar 
2404				if(percent == '100'){
2405					$that.find('span strong').addClass('full');
2406				}
2407	
2408		}, { offset: '90%', triggerOnce: true });
2409
2410	});
2411}
2412progressBars();
2413	
2414
2415
2416
2417/***************** Pricing Tables ******************/
2418
2419
2420var $tallestCol;
2421
2422function pricingTableHeight(){
2423	$('.pricing-table').each(function(){
2424		$tallestCol = 0;
2425		
2426		$(this).find('> div ul').each(function(){
2427			($(this).height() > $tallestCol) ? $tallestCol = $(this).height() : $tallestCol = $tallestCol;
2428		});	
2429		
2430		//safety net incase pricing tables height couldn't be determined
2431		if($tallestCol == 0) $tallestCol = 'auto';
2432		
2433		//set even height
2434		$(this).find('> div ul').css('height',$tallestCol);
2435
2436	});
2437}
2438
2439pricingTableHeight();
2440
2441 
2442/***************** Testimonial Slider ******************/
2443
2444//testimonial slider controls
2445$('body').on('click','.testimonial_slider .controls li', function(){
2446	
2447	if($(this).find('span').hasClass('active')) return false;
2448	
2449	var $index = $(this).index();
2450	var currentHeight = $(this).parents('.testimonial_slider').find('.slides blockquote').eq($index).height();
2451	
2452	$(this).parents('.testimonial_slider').find('li span').removeClass('active');
2453	$(this).find('span').addClass('active');
2454	
2455	$(this).parents('.testimonial_slider').find('.slides blockquote').stop().css({'opacity':'0', 'left':'-25px', 'z-index': '1'});
2456	$(this).parents('.testimonial_slider').find('.slides blockquote').eq($index).stop(true,true).animate({'opacity':'1','left':'0'},550,'easeOutCubic').css('z-index','20');
2457	$(this).parents('.testimonial_slider:not(.disable-height-animation)').find('.slides').stop(true,true).animate({'height' : currentHeight + 20 + 'px' },450,'easeOutCubic');
2458	
2459	resizeVideoToCover();
2460});
2461
2462
2463var $tallestQuote;
2464
2465//create controls
2466function createTestimonialControls() {
2467
2468	//fadeIn
2469	$('.testimonial_slider').animate({'opacity':'1'},800);
2470
2471	$('.testimonial_slider').each(function(){
2472		
2473		if($(this).find('blockquote').length > 1 && $(this).find('.controls').length == 0) {
2474			$(this).append('<div class="controls"><ul></ul></div>');
2475			
2476			var slideNum = $(this).find('blockquote').length;
2477			var $that = $(this);
2478			
2479			for(var i=0;i<slideNum;i++) {
2480				$that.find('.controls ul').append('<li><span class="pagination-switch"></span></li>')
2481			}
2482			
2483			//activate first slide
2484			$(this).find('.controls ul li').first().click();
2485			
2486			//autorotate
2487			if($(this).attr('data-autorotate').length > 0) {
2488				slide_interval = (parseInt($(this).attr('data-autorotate')) < 100) ? 4000 : parseInt($(this).attr('data-autorotate'));
2489				var $that = $(this);
2490				var $rotate = setInterval(function(){ testimonialRotate($that) },slide_interval);
2491			}
2492			
2493			$(this).find('.controls li').click(function(e){
2494				if(typeof e.clientX != 'undefined') clearInterval($rotate);
2495			});
2496			
2497			////swipe for testimonials
2498			$(this).swipe({
2499			
2500				swipeLeft : function(e) {
2501					$(this).find('.controls ul li span.active').parent().next('li').find('span').trigger('click');
2502					e.stopImmediatePropagation();
2503					clearInterval($rotate);
2504					return false;
2505				 },
2506				 swipeRight : function(e) {
2507					$(this).find('.controls ul li span.active').parent().prev('li').find('span').trigger('click');
2508					e.stopImmediatePropagation();
2509					clearInterval($rotate);
2510					return false;
2511				 }    
2512			});
2513		} 
2514		//only one testimonial
2515		else if($(this).find('.controls').length == 0) {
2516			var currentHeight = $(this).find('.slides blockquote').height();
2517			$(this).find('.slides blockquote').stop().css({'opacity':'0', 'left':'-25px', 'z-index': '1'});
2518			$(this).find('.slides blockquote').stop(true,true).animate({'opacity':'1','left':'0'},550,'easeOutCubic').css('z-index','20');
2519			$(this).find('.slides').stop(true,true).animate({'height' : currentHeight + 20 + 'px' },450,'easeOutCubic');
2520		}
2521	});
2522}
2523createTestimonialControls();
2524
2525function testimonialRotate(slider){
2526	
2527	var $testimonialLength = slider.find('li').length;
2528	var $currentTestimonial = slider.find('.pagination-switch.active').parent().index();
2529	
2530	//stop the rotation when toggles are closed
2531	if( slider.parents('.toggle').length > 0 && slider.parents('.toggle').hasClass('open') ) {
2532
2533		if( $currentTestimonial+1 == $testimonialLength) {
2534			slider.find('ul li:first-child').click();
2535		} else {
2536			slider.find('.pagination-switch.active').parent().next('li').click();
2537		}
2538		
2539	} else {
2540		
2541		if( $currentTestimonial+1 == $testimonialLength) {
2542			slider.find('ul li:first-child').click();
2543		} else {
2544			slider.find('.pagination-switch.active').parent().next('li').click();
2545		}
2546	
2547	}
2548
2549}
2550
2551function testimonialHeightResize(){
2552	$('.testimonial_slider:not(.disable-height-animation)').each(function(){
2553		
2554		var $index = $(this).find('.controls ul li span.active').parent().index();
2555		var currentHeight = $(this).find('.slides blockquote').eq($index).height();
2556		$(this).find('.slides').stop(true,true).css({'height' : currentHeight + 20 + 'px' });
2557		
2558	});
2559}
2560
2561
2562function testimonialSliderHeight() {
2563		
2564	$('.testimonial_slider.disable-height-animation').each(function(){
2565		$tallestQuote = 0;
2566			
2567		$(this).find('blockquote').each(function(){
2568			($(this).height() > $tallestQuote) ? $tallestQuote = $(this).height() : $tallestQuote = $tallestQuote;
2569		});	
2570		
2571		//safety net incase height couldn't be determined
2572		if($tallestQuote == 0) $tallestQuote = 100;
2573		
2574		//set even height
2575		$(this).find('.slides').css('height',$tallestQuote+20+'px');
2576		
2577		//show the slider once height is set
2578		$(this).animate({'opacity':'1'});
2579
2580	});
2581
2582}
2583
2584testimonialSliderHeight(); 
2585
2586
2587
2588/***************** WP Media Embed / External Embed ******************/
2589
2590//this isn't the for the video shortcode* This is to help any external iframe embed fit & resize correctly 
2591function responsiveVideoIframesInit(){
2592	$('iframe').each(function(){
2593		
2594		//make sure the iframe has a src (things like adsense don't)
2595		if(typeof $(this).attr('src') != 'undefined' && !$(this).parent().hasClass('iframe-embed') && $(this).parents('.ls-slide').length == 0 && $(this).parents('.esg-entry-media').length == 0){
2596			
2597			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) {
2598				$(this).wrap('<div class="iframe-embed"/>');	
2599				
2600				$(this).attr('data-aspectRatio', this.height / this.width).removeAttr('height').removeAttr('width');
2601	
2602				//add wmode=transparent to all youytube embeds to fix z-index issues in IE
2603				if($(this).attr('src').indexOf('wmode=transparent') == -1) {
2604					if($(this).attr('src').indexOf('?') == -1){
2605						$(this).attr('src',$(this).attr('src') + '?wmode=transparent');
2606					} else {
2607						$(this).attr('src',$(this).attr('src') + '&wmode=transparent');
2608					}
2609				}
2610			}
2611			 
2612		} else {
2613			//if($(this).parents('ins').length == 0){ 
2614			//	$(this).wrap('<div class="iframe-embed-standard"/>');	
2615			//}
2616		}
2617		
2618	});
2619
2620
2621}
2622
2623function responsiveVideoIframes(){
2624	 $('iframe[data-aspectRatio]').each(function() {
2625	 	var newWidth = $(this).parent().width();
2626	 	 
2627		var $el = $(this);
2628		
2629		//in nectar slider
2630		if($(this).parents('.swiper-slide').length > 0) {
2631			if($(this).is(':visible')) $el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
2632		} 
2633		//all others
2634		else {
2635			$el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
2636		}
2637		
2638		
2639	});
2640}
2641
2642
2643function videoshortcodeSize(){
2644	$('.wp-video').each(function(){
2645
2646		$(this).attr('data-aspectRatio', parseInt($(this).find('.mejs-overlay').height()) / parseInt($(this).find('.wp-video-shortcode').css('width')));
2647
2648		var newWidth = $(this).width();
2649	 	 
2650		var $el = $(this).find('.wp-video-shortcode');
2651		$(this).width(newWidth).height(newWidth * $(this).attr('data-aspectRatio'));
2652	});
2653}
2654
2655responsiveVideoIframesInit();
2656responsiveVideoIframes();
2657fullWidthContentColumns();
2658videoshortcodeSize();
2659
2660//unwrap post and protfolio videos
2661$('.video-wrap iframe').unwrap();
2662$('#sidebar iframe[src]').unwrap();
2663
2664$('video:not(.slider-video)').attr('width','100%');
2665$('video:not(.slider-video)').attr('height','100%'); 
2666
2667$('audio').attr('width','100%');
2668$('audio').attr('height','100%');
2669
2670$('audio').css('visibility','visible');
2671
2672if($('body').hasClass('mobile')){
2673	$('video').css('visibility','hidden');
2674} else {
2675	$('video').css('visibility','visible');
2676}
2677
2678
2679$(window).load(function(){
2680	$('video').css('visibility','visible');
2681	showLateIframes();
2682	videoshortcodeSize();
2683});
2684
2685$('.wp-video').each(function(){
2686	 video = $(this).find('video').get(0);
2687	 video.addEventListener('loadeddata', function() {
2688	   videoshortcodeSize();
2689	   $(window).trigger('resize');
2690	 }, false);
2691});
2692
2693//webkit video back button fix 
2694$('iframe[src]').each(function(){
2695	$(this).attr('src',$(this).attr('src'));
2696	$(this).css({'opacity':'1', 'visibility':'visible'});
2697});
2698
2699showLateIframes();
2700
2701function showLateIframes(){
2702	$('iframe[src]').css('opacity','1');
2703	setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 100);
2704	setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 500);
2705	setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 1000);
2706	setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 1500);
2707	setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 2500);
2708}
2709
2710
2711/***************** Nectar Video BG ******************/
2712
2713
2714	
2715	$('.wpb_row:has(".nectar-video-wrap")').each(function(i){
2716		$(this).css('z-index',100 + i);
2717	});
2718
2719	var min_w = 1200; // minimum video width allowed
2720	var vid_w_orig;  // original video dimensions
2721	var vid_h_orig;
2722	
2723    vid_w_orig = 1280;
2724    vid_h_orig = 720;
2725 
2726	function resizeVideoToCover() {
2727		$('.nectar-video-wrap').each(function(i){
2728			
2729			var $containerHeight = $(this).parents('.wpb_row').outerHeight();			
2730			var $containerWidth = $(this).parents('.wpb_row').outerWidth();
2731
2732		    // set the video viewport to the window size
2733		    $(this).width($containerWidth);
2734		    $(this).height($containerHeight);
2735		
2736		    // use largest scale factor of horizontal/vertical
2737		    var scale_h = $containerWidth / vid_w_orig;
2738		    var scale_v = ($containerHeight - $containerHeight) / vid_h_orig; 
2739		    var scale = scale_h > scale_v ? scale_h : scale_v;
2740			
2741			//update minium width to never allow excess space
2742		    min_w = 1280/720 * ($containerHeight+40);
2743		    
2744		    // don't allow scaled width < minimum video width
2745		    if (scale * vid_w_orig < min_w) {scale = min_w / vid_w_orig;}
2746		        
2747		    // now scale the video
2748		    $(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * vid_w_orig +20));
2749		    $(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * vid_h_orig +20));
2750		    
2751		    // and center it by scrolling the video viewport
2752		    $(this).scrollLeft(($(this).find('video').width() - $containerWidth) / 2);
2753		    $(this).scrollTop(($(this).find('video').height() - ($containerHeight)) / 2);
2754		    $(this).find('.mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($containerHeight)) / 2);
2755
2756
2757		    //align bottom
2758		    if($(this).attr('data-bg-alignment') == 'center bottom'){
2759		    	$(this).scrollTop(($(this).find('video').height() - ($containerHeight+6)));
2760		    }
2761		    //align top
2762		    else if($(this).attr('data-bg-alignment') == 'center top') {
2763		    	$(this).scrollTop(0);
2764		    } 
2765
2766		});
2767	}
2768    
2769    //init
2770    function videoBGInit(){
2771	    setTimeout(function(){
2772	    	resizeVideoToCover();
2773	    	$('.video-color-overlay').each(function(){
2774	    		$(this).css('background-color',$(this).attr('data-color'));
2775	    	});
2776	    	$('.nectar-video-wrap').animate({'opacity':'1'},800,'easeInOutExpo');
2777	    	$('.video-color-overlay').animate({'opacity':'0.7'},800,'easeInOutExpo');
2778	    	
2779	    },400);
2780
2781		if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
2782			$('.wpb_row .mobile-video-image').show();
2783			$('.nectar-video-wrap').remove();
2784		}
2785
2786		 if(navigator.userAgent.indexOf('Chrome') > 0) { 
2787		 	$('.nectar-video-wrap').each(function(i){
2788			  	var webmSource = jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
2789	          	var firstVideo = jQuery(this).find('video').get(0);
2790	          	firstVideo.src = webmSource;
2791	          	firstVideo.load();
2792            });
2793	    }
2794	}
2795	videoBGInit();
2796
2797
2798/*-------------------------------------------------------------------------*/
2799/*	4.	Header + Search
2800/*-------------------------------------------------------------------------*/	 
2801
2802/***************** Slide Out Widget Area **********/
2803
2804$('body').on('click','.slide-out-widget-area-toggle a.closed:not(.animating)',function(){
2805
2806	var $that = $(this);
2807
2808	if($('#boxed').length == 0) {
2809		$('.container-wrap, .home-wrap, #header-secondary-outer, #footer-outer, #page-header-bg, .page-header-no-bg, div:not(.container) > .project-title').stop(true).transition({ x: '-300px' },750,'easeInOutCubic');
2810
2811		if($('#header-outer[data-transparency-option="1"]').length == 0) {
2812			$('#header-outer').stop(true).transition({ x: '-300px'},750,'easeInOutCubic');
2813		} else {
2814			$('#header-outer').stop(true).transition({ x: '-300px', 'background-color':'transparent', 'border-bottom': '1px solid rgba(255,255,255,0.22)' },750,'easeInOutCubic');
2815		}
2816
2817		$('.parallax_slider_outer .nectar-slider-wrap, #ascrail2000').stop(true).transition({ 'x': '-300px' },750,'easeInOutCubic');
2818		$('body:not(.ascend) #header-outer .cart-menu').stop(true).transition({ 'x': '300px' },650,'easeInOutCubic');
2819	}
2820
2821	$('#slide-out-widget-area').stop(true).transition({ x: '0' },750,'easeInOutCubic');
2822
2823	$('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).stop(true).transition({
2824		'opacity' : 1
2825	},750,'easeInOutCubic',function(){
2826		$that.removeClass('animating');
2827	});
2828	
2829
2830	if($('#boxed').length == 0) {
2831		//full width menu adjustments
2832		if($('#header-outer[data-full-width="true"]').length > 0 && !$('body').hasClass('mobile')) { 
2833			$('#header-outer').css({'z-index':'99999999'}); 
2834			$('#ascrail2000').addClass('z-index-adj');
2835			$('header#top #logo').stop(true).transition({ x: '300px' },750,'easeInOutCubic'); 
2836			$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': $(window).width() - 360, 'left': '300px' },750,'easeInOutCubic');
2837			$that.find('.lines-button').addClass('close');
2838
2839			if($('#header-outer[data-remove-border="true"]').length > 0) {
2840				$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '64px' },750,'easeInOutCubic');
2841			} else {
2842				$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '89px' },750,'easeInOutCubic'); 
2843			}
2844
2845			$('body #header-outer nav > ul > li > a').css({'margin-bottom':'0'});
2846			
2847		}
2848	}
2849
2850	//add open class
2851	$('#header-outer').removeClass('side-widget-closed').addClass('side-widget-open');
2852
2853	//hide menu if no space
2854	if($('header#top nav > .sf-menu').offset().left - $('#logo').width() - 300 < 20) $('#header-outer').addClass('hidden-menu');
2855
2856	//give header transparent state
2857	if($('#header-outer[data-transparency-option="1"]').length > 0 && $('#boxed').length == 0 && $('#header-outer[data-full-width="true"]').length > 0) {
2858		$('#header-outer').addClass('transparent');
2859	}
2860
2861	//dark slide transparent nav
2862	if($('#header-outer.dark-slide.transparent').length > 0  && $('#boxed').length == 0) $('#header-outer').removeClass('dark-slide').addClass('temp-removed-dark-slide');
2863	
2864	$(this).removeClass('closed').addClass('open');
2865	$(this).addClass('animating');
2866
2867	return false;
2868});
2869
2870$('body').on('click','.slide-out-widget-area-toggle a.open:not(.animating), #slide-out-widget-area .slide_out_area_close',function(){
2871
2872	var $that = $(this);
2873
2874	$('.container-wrap, .home-wrap, #header-secondary-outer, #footer-outer, #page-header-bg, .page-header-no-bg, div:not(.container) > .project-title').stop(true).transition({ x: '0px' },750,'easeInOutCubic');
2875
2876	if($('#header-outer[data-transparency-option="1"]').length > 0  && $('#boxed').length == 0) {
2877		$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');
2878		$('#header-outer').stop(true).transition({ x: '0px', 'background-color': $currentRowBG },750,'easeInOutCubic');
2879	} else {
2880		$('#header-outer').stop(true).transition({ x: '0px' },750,'easeInOutCubic');
2881	}
2882
2883	$('.parallax_slider_outer .nectar-slider-wrap, #ascrail2000').stop(true).transition({ 'x': '0px' },750,'easeInOutCubic');
2884	$('body:not(.ascend) #header-outer .cart-menu').stop(true).transition({ 'x': '0px' },750,'easeInOutCubic');
2885
2886	$('#slide-out-widget-area').stop(true).transition({ x: '301px' },750,'easeInOutCubic');
2887
2888	$('#slide-out-widget-area-bg').stop(true).transition({
2889		'opacity' : 0
2890	},750,'easeInOutCubic',function(){
2891		$('.slide-out-widget-area-toggle a').removeClass('animating');
2892		$(this).css({'height':'1px','width':'1px'});
2893	});
2894
2895	if($('#boxed').length == 0) {
2896		if($('#header-outer[data-full-width="true"]').length > 0) {  
2897			$('header#top #logo').stop(true).transition({ x: '0px' },750,'easeInOutCubic'); 
2898			$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': '100%', 'left': '0' },750,'easeInOutCubic');
2899			$('.lines-button').removeClass('close');
2900
2901			$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '0px' },750,'easeInOutCubic');
2902
2903		}
2904	}
2905
2906	//dark slide transparent nav
2907	if($('#header-outer.temp-removed-dark-slide.transparent').length > 0  && $('#boxed').length == 0) $('#header-outer').removeClass('temp-removed-dark-slide').addClass('dark-slide');
2908
2909	//remove header transparent state
2910	//if($('#header-outer[data-transparency-option="1"]').length > 0  && $('#boxed').length == 0 && $('#header-outer[data-full-width="true"]').length > 0) {
2911		if($('#header-outer.small-nav').length > 0 || $('#header-outer.scrolled-down').length > 0) $('#header-outer').removeClass('transparent');
2912	//} 
2913
2914	//remove hidden menu
2915	$('#header-outer').removeClass('hidden-menu');
2916
2917	$('#header-outer').removeClass('side-widget-open').addClass('side-widget-closed');
2918	$('.slide-out-widget-area-toggle a').removeClass('open').addClass('closed');
2919	$('.slide-out-widget-area-toggle a').addClass('animating');
2920
2921	return false;
2922});
2923
2924
2925function fullWidthHeaderSlidingWidgetMenuCalc() {
2926	$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': $(window).width() - 360, 'left': '300px' },750,'easeInOutCubic');
2927}
2928
2929//slide out widget area scrolling 
2930function slideOutWidgetAreaScrolling(){ 
2931	$('#slide-out-widget-area').mousewheel(function(event, delta) {
2932
2933	     this.scrollTop -= (delta * 30);
2934	    
2935	     event.preventDefault();
2936
2937	});
2938}
2939slideOutWidgetAreaScrolling();
2940
2941
2942//handle mobile scrolling
2943if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
2944	$('#slide-out-widget-area').addClass('mobile');
2945}
2946
2947/***************** Page Headers ******************/
2948
2949var pageHeaderHeight;
2950var pageHeaderHeightCopy;
2951var pageHeadingHeight;
2952
2953//full(ish) screen header
2954function fullScreenHeaderInit(){
2955
2956	pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height'));
2957	pageHeaderHeightCopy = parseInt($('#page-header-bg').attr('data-height'));
2958
2959	if($('body.single-post .fullscreen-header').length > 0) {
2960
2961		if($('#header-outer[data-transparency-option]').length > 0 && $('#header-outer').attr('data-transparency-option') != '0'){
2962			var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height()-13 : $(window).height() - parseInt($('#header-outer').height()) - 13;
2963		} else {
2964			var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height() - parseInt($('#header-space').height()) + 50 - 13 : $(window).height() - parseInt($('#header-outer').height()) - 13;
2965		}
2966		var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
2967		pageHeaderHeight =   calculatedNum  - extraHeight; 
2968		pageHeaderHeightCopy = calculatedNum - extraHeight; 
2969	}
2970
2971	$('#page-header-bg').css('height',pageHeaderHeight+'px').removeClass('not-loaded');
2972	setTimeout(function(){ $('#page-header-bg').css('overflow','visible') },800);
2973
2974}
2975
2976fullScreenHeaderInit();
2977
2978function pageHeader(){
2979	
2980	var $scrollTop = $(window).scrollTop();
2981
2982	//full screen(ish) header
2983	if($('body.single-post .fullscreen-header').length > 0) {
2984		if($('#header-outer[data-transparency-option]').length > 0 && $('#header-outer').attr('data-transparency-option') != '0'){
2985			var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height()-13 : $(window).height() - parseInt($('#header-outer').height()) - 13;
2986		} else {
2987			var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height() - parseInt($('#header-space').height()) + 50 - 13 : $(window).height() - parseInt($('#header-outer').height()) - 13;
2988		}
2989		var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
2990		pageHeaderHeight =   calculatedNum  - extraHeight; 
2991		pageHeaderHeightCopy = calculatedNum - extraHeight; 
2992	}
2993	
2994	if( window.innerWidth < 1000 && window.innerWidth > 690 && !$('body').hasClass('salient_non_responsive') ) {
2995		var $multiplier = ($('body.single-post .fullscreen-header').length > 0) ? 1 : 1.6;
2996		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
2997		$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
2998		
2999	} else if( window.innerWidth <= 690 && window.innerWidth > 480 && !$('body').hasClass('salient_non_responsive')) {
3000		var $multiplier = ($('body.single-post .fullscreen-header').length > 0) ? 1 : 2.1;
3001		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
3002		$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
3003		
3004	} else if( window.innerWidth <= 480 && !$('body').hasClass('salient_non_responsive')) {
3005		var $multiplier = ($('body.single-post .fullscreen-header').length > 0) ? 1 : 2.5;
3006		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
3007		$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
3008		
3009	} else {
3010		$('#page-header-bg').attr('data-height', pageHeaderHeightCopy).css('height',pageHeaderHeightCopy +'px');
3011		$('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
3012
3013		if($('#page-header-bg[data-parallax="1"]').length == 0) $('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
3014	}
3015	
3016	
3017	if(!$('body').hasClass('mobile')){
3018		
3019		//recalc
3020		pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height'));
3021		$('#page-header-bg .container > .row').css('top',0);
3022		var $divisionMultipler = ($('#header-outer[data-remove-border="true"]').length > 0) ? 2 : 1;
3023
3024		//center the heading
3025		pageHeadingHeight = $('#page-header-bg .col.span_6').height();
3026		
3027		if($('#header-outer[data-transparent-header="true"]').length > 0 && $('body.single-post .fullscreen-header').length == 0) {
3028			$('#page-header-bg:not("[data-parallax=1]") .col.span_6').css('top', ((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2));
3029		} else {
3030			$('#page-header-bg:not("[data-parallax=1]") .col.span_6').css('top', (pageHeaderHeight/2) - (pageHeadingHeight/2) + 22);
3031		}
3032		
3033		//center portfolio filters
3034		$('#page-header-bg:not("[data-parallax=1]") .portfolio-filters').css('top', (pageHeaderHeight/2) + 2);	
3035		
3036		if($('#page-header-bg[data-parallax="1"] .span_6').css('opacity') > 0) {
3037			
3038			if($('#header-outer[data-transparent-header="true"]').length > 0 && $('body.single-post .fullscreen-header').length == 0) {
3039				//center the parallax heading
3040
3041			    $('#page-header-bg[data-parallax="1"] .span_6').css({ 
3042					'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+60)),
3043					'top' : (((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2)) +"px"
3044			    });
3045			    
3046			    //center parllax portfolio filters
3047			    $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 
3048					'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
3049					'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
3050			    });
3051		  } else {
3052		  		//center the parallax heading
3053			    $('#page-header-bg[data-parallax="1"] .span_6').css({ 
3054					'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+60)),
3055					'top' : ((pageHeaderHeight/2) - (pageHeadingHeight/2)) +10 +"px"
3056			    });
3057			    
3058			    //center parllax portfolio filters
3059			    $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 
3060					'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
3061					'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
3062			    });
3063		  }
3064	   }
3065	}
3066	
3067	else {
3068		//recalc
3069		pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height'));
3070		
3071		//center the heading
3072		var pageHeadingHeight = $('#page-header-bg .container > .row').height();
3073		$('#page-header-bg .container > .row').css('top', (pageHeaderHeight/2) - (pageHeadingHeight/2) + 5);
3074		
3075	}
3076
3077
3078	$('#page-header-bg .container > .row').css('visibility','visible');
3079}
3080
3081pageHeader();
3082
3083
3084if($('#header-outer').attr('data-header-resize') == '' || $('#header-outer').attr('data-header-resize') == '0'){
3085	$('#page-header-wrap').css('margin-top','0');
3086}
3087
3088
3089function extractUrl(input) {
3090	return input.replace(/"/g,"").replace(/url\(|\)$/ig, "");
3091}
3092 
3093/***************** Parallax Page Headers ******************/
3094if($('#page-header-bg[data-parallax="1"]').length > 0) {
3095
3096	//fadeIn
3097
3098	var img = new Image();
3099	
3100	var imgX, imgY, aspectRatio;
3101	var diffX, diffY;
3102	var pageHeadingHeight = $('#page-header-bg .col.span_6').height();
3103	var pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height'));
3104	var headerPadding2 = parseInt($('#header-outer').attr('data-padding'))*2;
3105	var wooCommerceHeader = ($('.demo_store').length > 0) ? 32 : 0 ;
3106	
3107	
3108	var $initialImgCheck = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
3109	
3110	if ($initialImgCheck && $initialImgCheck.indexOf('.') !== -1) {    
3111		img.onload = function() {
3112		   pageHeaderInit(); 
3113		}
3114		
3115		img.src = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
3116		
3117	} else {
3118		 pageHeaderInit();
3119	}
3120	
3121	
3122	
3123	var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
3124
3125
3126	$(window).scroll(bindHeaderParallax);
3127}
3128
3129
3130function bindHeaderParallax(){
3131
3132	var $scrollTop = $(window).scrollTop();
3133	var pageHeadingHeight = $('#page-header-bg .col.span_6').height();
3134	
3135	
3136	if(!$('body').hasClass('mobile') && navigator.userAgent.match(/iPad/i) == null){
3137
3138		//calc bg pos
3139		//$('#page-header-bg[data-parallax="1"]').css({'top': ((- $scrollTop / 5)+logoHeight+headerPadding+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader)  + 'px' });
3140		$('#page-header-bg[data-parallax="1"]').transition({ y: $(window).scrollTop()*-.2 },0);	
3141		
3142		var multipler = ($('body').hasClass('single')) ? 1 : 2;
3143		$('#page-header-bg[data-parallax="1"] .span_6').css({ 
3144			'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*multipler)+60))
3145		});
3146		
3147		$('#page-header-bg[data-parallax="1"] .span_6').stop(true,true).transition({ y: $(window).scrollTop()*-.14 },0);
3148		
3149		
3150		if($('#page-header-bg[data-parallax="1"] .span_6').css('opacity') == 0){
3151			$('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"] .portfolio-filters').hide();
3152		} else {
3153			$('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"] .portfolio-filters').show();
3154		}
3155		
3156		//hide elements to allow other parallax sections to work in webkit browsers
3157		if( ($scrollTop / (pageHeaderHeight + $('#header-space').height() + extraHeight)) > 1 ) {
3158			$('#page-header-bg').css('visibility','hidden').hide();
3159		}
3160		else {
3161		 	$('#page-header-bg').css('visibility','visible').show();
3162	    }
3163		
3164		
3165	}
3166
3167}
3168
3169if($('#page-header-bg').length > 0) {
3170	var $initialImgCheckAscend = extractUrl($('#page-header-bg').css('background-image'));
3171	if ($initialImgCheckAscend && $initialImgCheckAscend.indexOf('.') !== -1) {    
3172		   $('#page-header-bg').addClass('has-bg');
3173	}
3174}
3175
3176
3177function pageHeaderInit(){
3178
3179	 var wooCommerceHeader = ($('.demo_store').length > 0) ? 32 : 0 ;
3180	 var centeredNavAltSpace = ($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) ? $('header#top nav > .sf-menu').height() -20 : null;
3181	 //transparent
3182	  if($('#header-outer[data-transparent-header="true"]').length > 0) {	
3183	     $('#page-header-bg[data-parallax="1"]').css({'top': extraHeight+wooCommerceHeader });
3184	  } else {
3185	  	 $('#page-header-bg[data-parallax="1"]').css({'top': (logoHeight+headerPadding+centeredNavAltSpace+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader+wooCommerceHeader)  + 'px' });
3186	  }
3187	  
3188	  //fade in header
3189	  if($('#ajax-content-wrap').length == 0 || !$('body').hasClass('ajax-loaded')){
3190	  	$('#page-header-bg[data-parallax="1"]').animate({ 'opacity' : 1},650,'easeInCubic');
3191	  } else if($('#ajax-content-wrap').length == 1) {
3192	  	$('#page-header-bg[data-parallax="1"]').css({ 'opacity' : 1});
3193	  }
3194
3195	  $('#page-header-wrap').css({'height' : pageHeaderHeight});
3196	  
3197	  //verify smooth scorlling
3198	  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') } 
3199	  
3200	  /* $('#page-header-bg[data-parallax="1"] .span_6').css({ 
3201			'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+60))
3202			'top' : ((pageHeaderHeight/2) - (pageHeadingHeight/2)) +10 +"px"
3203	   });
3204	   
3205	   $('#page-header-bg[data-parallax="1"] #portfolio-filters').css({ 
3206			'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
3207			'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
3208	   }); */
3209	  
3210}
3211
3212
3213
3214
3215function nectarPageHeader() {
3216
3217	if($('#page-header-bg').length > 0) {
3218		fullScreenHeaderInit();
3219		pageHeader();
3220	}
3221
3222
3223	if($('#page-header-bg[data-parallax="1"]').length > 0) {
3224
3225		var img = new Image();
3226		var $initialImgCheck = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
3227			
3228		if ($initialImgCheck && $initialImgCheck.indexOf('.') !== -1) {    
3229			img.onload = function() {
3230			   pageHeaderInit();    
3231					
3232			}
3233			
3234			img.src = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
3235			
3236		} else {
3237			 pageHeaderInit();
3238		}
3239
3240		$(window).unbind('scroll',bindHeaderParallax);
3241		//bindHeaderParallax();
3242		$('#page-header-bg[data-parallax="1"] .span_6').css({ 
3243			'opacity' : 1
3244		});
3245		$(window).scroll(bindHeaderParallax);
3246	} else {
3247		$(window).unbind('scroll',bindHeaderParallax);
3248	}
3249
3250	if($('#page-header-bg').length > 0) {
3251		var $initialImgCheckAscend = extractUrl($('#page-header-bg').css('background-image'));
3252		if ($initialImgCheckAscend && $initialImgCheckAscend.indexOf('.') !== -1) {    
3253			   $('#page-header-bg').addClass('has-bg');
3254		}
3255	}
3256}
3257
3258if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
3259	window.onunload = function(){ nectarPageHeader(); };
3260}
3261
3262
3263/***************** WooCommerce Cart *****************/
3264var timeout;
3265var productToAdd;
3266
3267//notification
3268$('body').on('click','.product .add_to_cart_button', function(){
3269	productToAdd = $(this).parents('li').find('h3').text();
3270	$('#header-outer .cart-notification span.item-name').html(productToAdd);
3271
3272	//if($('.cart-menu-wrap').hasClass('first-load')) $('.cart-menu-wrap').removeClass('first-load').addClass('static');
3273});
3274
3275//notification hover
3276$('body').on('mouseenter','#header-outer .cart-notification',function(){
3277	$(this).fadeOut(400);
3278	$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(400);
3279	$('#header-outer .cart_list').stop(true,true).fadeIn(400);
3280	clearTimeout(timeout);
3281});
3282
3283//cart dropdown
3284$('#header-outer div.cart-outer').hoverIntent(function(){
3285	$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(400);
3286	$('#header-outer .cart_list').stop(true,true).fadeIn(400);
3287	clearTimeout(timeout);
3288	$('#header-outer .cart-notification').fadeOut(300);
3289});
3290
3291
3292$('body').on('mouseleave','#header-outer div.cart-outer',function(){
3293	setTimeout(function(){
3294		if(!$('.cart-outer').is(':hover')){
3295			$('#header-outer .widget_shopping_cart').stop(true,true).fadeOut(300);
3296			$('#header-outer .cart_list').stop(true,true).fadeOut(300);
3297		}
3298	},100);
3299});
3300
3301$('body').on('added_to_cart', shopping_cart_dropdown_show);
3302$('body').on('added_to_cart', shopping_cart_dropdown);
3303
3304function shopping_cart_dropdown() {
3305		
3306		if(!$('.widget_shopping_cart .widget_shopping_cart_content .cart_list .empty').length && $('.widget_shopping_cart .widget_shopping_cart_content .cart_list').length > 0 ) {
3307			$('.cart-menu-wrap').addClass('has_products');
3308			$('header#top nav > ul, #search-outer #search #close a').addClass('product_added');
3309
3310			if(!$('.cart-menu-wrap').hasClass('static')) $('.cart-menu-wrap').addClass('first-load');
3311
3312			//nectar slider nav directional effect
3313			if($('#header-outer').hasClass('directional-nav-effect') && $('#header-outer .cart-icon-wrap .dark').length == 0 && $('body.ascend').length > 0){
3314				$('#header-outer .cart-outer .cart-icon-wrap').each(function(){
3315                    $(this).find('> i, > span.light, > span.dark, > span.original').remove();
3316                    $(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>');
3317                	$(this).find('.original').attr('data-w',$(this).find('span.original').width()+1);
3318                });
3319			}
3320		}
3321
3322}
3323
3324
3325function shopping_cart_dropdown_show(e) {
3326		
3327		clearTimeout(timeout);
3328		
3329		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' ) {
3330			//before cart has slide in
3331			if(!$('#header-outer .cart-menu-wrap').hasClass('has_products')) {
3332				setTimeout(function(){ $('#header-outer .cart-notification').fadeIn(400); },400);
3333			}
3334			else if(!$('#header-outer .cart-notification').is(':visible')) {
3335				$('#header-outer .cart-notification').fadeIn(400);
3336			} else {
3337				$('#header-outer .cart-notification').show();
3338			}
3339			timeout = setTimeout(hideCart,2700);
3340
3341			$('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy');
3342		}
3343}
3344
3345function hideCart() {
3346	$('#header-outer .cart-notification').stop(true,true).fadeOut();
3347}
3348
3349function checkForWooItems(){ 
3350	var checkForCartItems = setInterval(shopping_cart_dropdown,250);
3351	setTimeout(function(){ clearInterval(checkForCartItems); },4500);
3352}
3353checkForWooItems();
3354
3355var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
3356var secondaryHeader = ($('#header-outer').attr('data-using-secondary') == '1') ? 32 : 0 ;
3357function searchFieldCenter(){
3358	$('#search-outer').css('top',$('#header-outer').outerHeight() + extraHeight + secondaryHeader);
3359	$('#search-outer > #search #search-box').css('top',($(window).height()/2) - ($('#search-outer > #search input').height()/2) - $('#header-outer').outerHeight() );
3360}
3361
3362//text on hover effect
3363$('body').on('mouseover','.text_on_hover .product-wrap',function(){
3364	$(this).parent().addClass('hovered');
3365	//if($(this).find('.star-rating span').length > 0) $(this).find('.star-rating span').stop().animate({ width: $(this).find('.star-rating span').attr('data-width') },400,'easeOutCirc');
3366});
3367$('body').on('mouseover','.text_on_hover > a:first-child',function(){
3368	$(this).parent().addClass('hovered');
3369});
3370
3371$('body').on('mouseout','.text_on_hover .product-wrap',function(){
3372	$(this).parent().removeClass('hovered');
3373	//if($(this).find('.star-rating span').length > 0) $(this).find('.star-rating span').stop().animate({ width: $(this).find('.star-rating span').attr('data-width') - 40 },500);
3374});
3375$('body').on('mouseout','.text_on_hover > a:first-child',function(){
3376	$(this).parent().removeClass('hovered');
3377});
3378
3379/*
3380$('.text_on_hover.product .star-rating span').each(function(){
3381	$(this).attr('data-width',$(this).width());
3382	$(this).css('width', $(this).attr('data-width') - 40);
3383});*/
3384
3385
3386/***************** Search ******************/
3387	var $placeholder = $('#search input[type=text]').attr('data-placeholder');
3388	var logoHeight = parseInt($('#header-outer').attr('data-logo-height'));
3389	
3390	////search box event
3391	$('body').on('click', '#search-btn a', function(){ return false; });
3392	$('body').on('mousedown', '#search-btn a', function(){
3393		
3394		//$(this).removeClass();
3395
3396		if($(this).hasClass('open-search')) { return false; } 
3397
3398		if($('body').hasClass('ascend')){ 
3399			$('#search-outer > #search form, #search-outer #search .span_12 span').css('opacity',0);
3400			$('#search-outer > #search form').css('bottom','10px');
3401			$('#search-outer #search .span_12 span').css('top','10px');
3402			$('#search-outer').stop(true,true).show().transition({rotateX: '90deg'},0).transition({ rotateX: '0deg', opacity: 1},600,'easeOutCirc');
3403
3404			$('#search-outer > #search form').delay(300).animate({'opacity':1, 'bottom':0},'easeOutCirc');
3405			$('#search-outer #search .span_12 span').delay(370).animate({'opacity':1, 'top':0},'easeOutCirc');
3406			
3407		} else {
3408			$('#search-outer').stop(true).fadeIn(600,'easeOutExpo');
3409		}
3410
3411		$('body:not(.ascend) #search-outer > #search input[type="text"]').css({
3412			'top' : $('#search-outer').height()/2 - $('#search-outer > #search input[type="text"]').height()/2
3413		});
3414		
3415		$('#search input[type=text]').focus();
3416		
3417		if($('#search input[type=text]').attr('value') == $placeholder){
3418			$('#search input[type=text]').setCursorPosition(0);	
3419		}
3420
3421		//ascend
3422		if($('body').hasClass('ascend')){ 
3423			searchFieldCenter();
3424		}
3425
3426		$(this).toggleClass('open-search');
3427
3428		//close slide out widget area
3429		$('.slide-out-widget-area-toggle a.open:not(.animating)').trigger('click');
3430
3431		return false;
3432	});
3433	
3434	$('body').on('keydown','#search input[type=text]',function(){
3435		if($(this).attr('value') == $placeholder){
3436			$(this).attr('value', '');
3437		}
3438	});
3439	
3440	$('body').on('keyup','#search input[type=text]',function(){
3441		if($(this).attr('value') == ''){
3442			$(this).attr('value', $placeholder);
3443			$(this).setCursorPosition(0);
3444		}
3445	});
3446	
3447	
3448	////close search btn event
3449	$('body').on('click','#close',function(){
3450		closeSearch();
3451		$('#search-btn a').removeClass('open-search');
3452		return false;
3453	});
3454
3455	//if user clicks away from the search close it
3456	$('body').on('blur','#search-box input[type=text]',function(e){
3457		closeSearch();
3458		$('#search-btn a').removeClass('open-search');
3459	});
3460	
3461	
3462	function closeSearch(){
3463		if($('body').hasClass('ascend')){ 
3464			$('#search-outer').stop(true,true).transition({'opacity' :0},600,'easeOutExpo').transition({rotateX: '90deg'},0);
3465		} else {
3466			$('#search-outer').stop(true).fadeOut(450,'easeOutExpo');
3467		}
3468	}
3469	
3470	
3471	//mobile search
3472	$('body').on('click', '#mobile-menu #mobile-search .container a#show-search',function(){
3473		$('#mobile-menu .container > ul').slideUp(500);
3474		return false;
3475	});
3476	
3477/***************** Nav ******************/
3478	
3479	var logoHeight = parseInt($('#header-outer').attr('data-logo-height'));
3480	var headerPadding = parseInt($('#header-outer').attr('data-padding'));
3481	var usingLogoImage = $('#header-outer').attr('data-using-logo');
3482	
3483	if( isNaN(headerPadding) || headerPadding.length == 0 ) { headerPadding = 28; }
3484	if( isNaN(logoHeight) || usingLogoImage.length == 0 ) { usingLogoImage = false; logoHeight = 30;}
3485	
3486	//inital calculations
3487	function headerInit() {
3488			
3489		$('#header-outer #logo img').css({
3490			'height' : logoHeight,				
3491		});	
3492		
3493		$('#header-outer').css({
3494			'padding-top' : headerPadding
3495		});	
3496		
3497		$('header#top nav > ul > li > a').css({
3498			'padding-bottom' : Math.floor( ((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding),
3499			'padding-top' : Math.floor( (logoHeight/2) - ($('header#top nav > ul > li > a').height()/2))
3500		});	
3501		
3502		if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
3503			$('#header-outer .cart-menu').css({  
3504				'padding-bottom' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding),
3505				'padding-top' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding)
3506			});	
3507		} else {
3508			$('#header-outer .cart-menu').css({  
3509				'padding-bottom' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding + logoHeight/2 + 7),
3510				'padding-top' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding + logoHeight/2 + 7)
3511			});	
3512		}
3513		
3514			
3515		$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').css({
3516			'padding-bottom' : (logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2),
3517			'padding-top' : (logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2)
3518		});	
3519		
3520		if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) {
3521			$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').css({
3522				'padding-top': 0,
3523				'padding-bottom': 0
3524			});
3525
3526			$('header#top nav > ul.buttons').css({
3527				'margin-top' : - headerPadding,
3528				'height' : Math.floor(logoHeight + headerPadding*2) -1
3529			});
3530
3531			$('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').css({
3532				'visibility' : 'visible',
3533				'padding-top': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding),
3534				'padding-bottom': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding)
3535			});
3536		}
3537		
3538		$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').css({
3539			'top' : $('header#top nav > ul > li > a').outerHeight() 
3540		});	
3541		
3542		
3543		setTimeout(function(){ 
3544			$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').css({
3545				'top': parseInt($('#header-outer').outerHeight())+'px'
3546			}); 
3547		},1000);
3548		
3549		$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').css({
3550			'top': parseInt($('#header-outer').outerHeight())+'px'
3551		});
3552		
3553		//header space
3554		if($('.nectar-parallax-scene.first-section').length == 0) {
3555			if($('#header-outer').attr('data-using-secondary') == '1'){
3556				$('#header-space').css('height', parseInt($('#header-outer').outerHeight()) + 34);
3557			} else {
3558				$('#header-space').css('height', $('#header-outer').outerHeight());
3559			} 
3560		}
3561		
3562		$('#header-outer .container, #header-outer .cart-menu').css('visibility','visible');
3563		
3564		if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
3565			$('body:not(.ascend) #search-outer, #search .container').css({
3566				'height' : logoHeight + headerPadding*2
3567			});	
3568			
3569			$('body:not(.ascend) #search-outer > #search input[type="text"]').css({
3570				'font-size'  : 43,
3571				'height' : '59px',
3572				'top' : ((logoHeight + headerPadding*2)/2) - $('#search-outer > #search input[type="text"]').height()/2
3573			});
3574			
3575			$('body:not(.ascend) #search-outer > #search #close a').css({
3576				'top' : ((logoHeight + headerPadding*2)/2) - 8
3577			});	
3578		} else {
3579			$('body:not(.ascend) #search-outer, #search .container').css({
3580				'height' : logoHeight + headerPadding*2 + logoHeight + 17
3581			});	
3582			
3583			$('body:not(.ascend) #search-outer > #search input[type="text"]').css({
3584				'font-size'  : 43,
3585				'height' : '59px',
3586				'top' : ((logoHeight + headerPadding*2)/2) - ($('#search-outer > #search input[type="text"]').height()/2) + logoHeight/2 + 17
3587			});
3588			
3589			$('body:not(.ascend) #search-outer > #search #close a').css({
3590				'top' : ((logoHeight + headerPadding*2)/2) - 8 + logoHeight/2 + 17
3591			});	
3592		}
3593		
3594		//if no image is being used
3595		//if(usingLogoImage == false) $('header#top #logo').addClass('no-image');
3596		
3597	}
3598	
3599	//one last check to make sure the header space is correct (only if the user hasn't scrolled yet)
3600	$(window).load(function(){
3601		if($(window).scrollTop() == 0 ) { 
3602			if($('.nectar-parallax-scene.first-section').length == 0) {
3603				if($('#header-outer').attr('data-using-secondary') == '1'){
3604					$('#header-space').css('height', parseInt($('#header-outer').outerHeight()) + 34);
3605				} else {
3606					$('#header-space').css('height', $('#header-outer').outerHeight());
3607				}
3608			}
3609			
3610		}
3611	});
3612	
3613	
3614	//is header resize on scroll enabled?
3615	var headerResize = $('#header-outer').attr('data-header-resize');
3616	if( headerResize == 1 ){
3617		
3618		headerInit();
3619
3620		$(window).off('scroll.headerResizeEffect');
3621		$(window).on('scroll.headerResizeEffect',smallNav);
3622	} else {
3623		headerInit();
3624		$(window).off('scroll.headerResizeEffectOpaque');
3625		$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
3626	}
3627	
3628	//if user starts in mobile but resizes to large, don't break the nav
3629	if($('body').hasClass('mobile')){
3630		$(window).resize(headerInit);
3631	}
3632		
3633
3634	var shrinkNum = 6;
3635	var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
3636	
3637	if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
3638
3639	function smallNav(){
3640		var $offset = $(window).scrollTop();
3641		var $windowWidth = $(window).width();
3642		
3643
3644		if($offset > 0 && $windowWidth > 1000) {
3645			
3646
3647			if($('#header-outer').attr('data-transparent-header') == 'true' && $('#header-outer.side-widget-open').length == 0) $('#header-outer').removeClass('transparent');
3648			$('.ns-loading-cover').hide();
3649			
3650			$('#header-outer').addClass('small-nav');
3651			
3652			$('#header-outer #logo img').stop(true,true).animate({
3653				'height' : logoHeight - shrinkNum
3654			},{queue:false, duration:250, easing: 'easeOutCubic'});	
3655				
3656			$('#header-outer').stop(true,true).animate({
3657				'padding-top' : Math.ceil(headerPadding / 1.8)
3658			},{queue:false, duration:250, easing: 'easeOutCubic'});	
3659			
3660			$('header#top nav > ul > li > a').stop(true,true).animate({
3661				'padding-bottom' :  Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding / 1.8) ,
3662				'padding-top' :  Math.floor(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) 
3663			},{queue:false, duration:250, easing: 'easeOutCubic'});	 
3664			
3665			if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
3666				$('#header-outer .cart-menu').stop(true,true).animate({
3667					'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7),
3668					'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7) +1
3669				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3670			} else {
3671				$('#header-outer img.starting-logo').stop(true,true).animate({
3672					'margin-top' :  '-' + (logoHeight + 17 - shrinkNum) + 'px'
3673				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3674
3675				$('#header-outer .cart-menu').stop(true,true).animate({
3676					'padding-bottom' : Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding / 1.7) + (logoHeight-shrinkNum)/2 + 9,
3677					'padding-top' : Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding / 1.7) + (logoHeight-shrinkNum)/2 + 9
3678				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3679			}
3680			
3681			if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) {
3682				$('header#top nav > ul.buttons').stop(true,true).animate({
3683					'margin-top' : - Math.ceil(headerPadding/ 1.8),
3684					'height' : Math.floor((headerPadding*2)/ 1.8 + logoHeight-shrinkNum)
3685				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3686
3687				$('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').stop(true,true).animate({
3688					'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7),
3689					'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7) +1
3690				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3691
3692			} else {
3693				$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').stop(true,true).animate({
3694					'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2)),
3695					'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2))
3696				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3697			}
3698
3699			$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
3700				'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),
3701			},{queue:false, duration:250, easing: 'easeOutCubic'});		
3702			
3703			
3704			$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({
3705				'top': Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) +'px'
3706			},{queue:false, duration:250, easing: 'easeOutCubic'});	
3707		
3708
3709			if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
3710				$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
3711					'height' : Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8)
3712				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3713
3714				$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
3715					'font-size'  : 30,
3716					'line-height' : '30px',
3717					'height' : '44px',
3718					'top' : ((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2
3719				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3720			
3721				$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
3722					'top' : ((logoHeight-shrinkNum + headerPadding+5)/2) - 10
3723				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3724
3725			} else {
3726				$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
3727					'height' : Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) + logoHeight - shrinkNum + 17
3728				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3729
3730				$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
3731					'font-size'  : 30,
3732					'line-height' : '30px',
3733					'height' : '44px',
3734					'top' : ((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2 + (logoHeight- shrinkNum)/2 + 8
3735				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3736
3737				$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
3738					'top' : ((logoHeight-shrinkNum + headerPadding+5)/2) - 10 + (logoHeight- shrinkNum)/2 + 8
3739				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3740			}
3741
3742		
3743			
3744
3745			
3746			
3747			
3748			if($('body').hasClass('ascend')){ 
3749				$('#search-outer').stop(true,true).animate({
3750					'top' : Math.floor((logoHeight-shrinkNum) +(headerPadding*2)/ 1.8 + extraHeight + secondaryHeader)
3751				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3752			}
3753			
3754			//if no image is being used
3755			if(usingLogoImage == false) $('header#top #logo').stop(true,true).animate({
3756				'margin-top' : 0
3757			},{queue:false, duration:450, easing: 'easeOutExpo'});	
3758			
3759			$(window).off('scroll',smallNav);
3760			$(window).on('scroll',bigNav);
3761
3762			//dark slider coloring border fix
3763			$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease');
3764			$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none');
3765			setTimeout(function(){ 
3766				$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease, border-color 0.40s ease'); 
3767				$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.40s ease');
3768			},300);
3769
3770		}
3771
3772	}
3773	
3774	function bigNav(){
3775		var $offset = $(window).scrollTop();
3776		var $windowWidth = $(window).width();
3777		if($offset == 0 && $windowWidth > 1000) {
3778			
3779			$('#header-outer').removeClass('small-nav');
3780			
3781			if($('#header-outer').attr('data-transparent-header') == 'true') $('#header-outer').addClass('transparent');
3782			$('.ns-loading-cover').show();
3783			
3784			$('#header-outer #logo img').stop(true,true).animate({
3785				'height' : logoHeight,				
3786			},{queue:false, duration:250, easing: 'easeOutCubic'});	
3787			
3788
3789			$('#header-outer').stop(true,true).animate({
3790				'padding-top' : headerPadding 
3791			},{queue:false, duration:250, easing: 'easeOutCubic'});	
3792			
3793			$('header#top nav > ul > li > a').stop(true,true).animate({
3794				'padding-bottom' : ((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding,
3795				'padding-top' : (logoHeight/2) - ($('header#top nav > ul > li > a').height()/2) 
3796			},{queue:false, duration:250, easing: 'easeOutCubic'});	
3797			
3798			if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
3799				$('#header-outer .cart-menu').stop(true,true).animate({
3800					'padding-bottom' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding),
3801					'padding-top' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding)
3802				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3803			} else {
3804				$('#header-outer img.starting-logo').stop(true,true).animate({
3805					'margin-top' :  '-' + (logoHeight + 17) + 'px'
3806				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3807
3808				$('#header-outer .cart-menu').stop(true,true).animate({
3809					'padding-bottom' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding) + logoHeight/2 + 7,
3810					'padding-top' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding) + logoHeight/2 + 7
3811				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3812			}
3813
3814			if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) {
3815				$('header#top nav > ul.buttons').stop(true,true).animate({
3816					'margin-top' : - Math.ceil(headerPadding),
3817					'height' : Math.floor(headerPadding*2 + logoHeight) -1
3818				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3819
3820				$('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').stop(true,true).animate({
3821					'padding-top': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding),
3822					'padding-bottom': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding)
3823				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3824			} else {
3825				$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').stop(true,true).animate({
3826					'padding-bottom' : Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2)),
3827					'padding-top' : Math.ceil((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2))
3828				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3829			}
3830			
3831			$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
3832				'top' : Math.ceil($('header#top nav > ul > li > a').height() + (((logoHeight)/2) - ($('header#top nav > ul > li > a').height()/2))*2 + headerPadding),
3833			},{queue:false, duration:250, easing: 'easeOutCubic'});		
3834			
3835			$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({
3836				'top': Math.ceil(logoHeight + headerPadding*2) +'px'
3837			},{queue:false, duration:250, easing: 'easeOutCubic'});	
3838			
3839			
3840			if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) {
3841				$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
3842					'height' : Math.ceil(logoHeight + headerPadding*2)
3843				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3844				
3845				$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
3846					'font-size'  : 43,
3847					'line-height' : '43px',
3848					'height' : '59px',
3849					'top' : ((logoHeight + headerPadding*2)/2) - 30
3850				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3851				
3852				
3853				$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
3854					'top' : ((logoHeight + headerPadding*2)/2) - 8
3855				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3856				
3857			} else {
3858				$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
3859					'height' : Math.ceil(logoHeight + headerPadding*2) + logoHeight + 17
3860				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3861				
3862				$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
3863					'font-size'  : 43,
3864					'line-height' : '43px',
3865					'height' : '59px',
3866					'top' : ((logoHeight + headerPadding*2)/2) - 30 + (logoHeight)/2 + 8
3867				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3868				
3869				
3870				$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
3871					'top' : ((logoHeight + headerPadding*2)/2) - 8 + (logoHeight)/2 + 8
3872				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3873			}
3874
3875
3876			if($('body').hasClass('ascend')){ 
3877				$('#search-outer').stop(true,true).animate({
3878					'top' : (logoHeight) +(headerPadding*2) + extraHeight + secondaryHeader
3879				},{queue:false, duration:250, easing: 'easeOutCubic'});	
3880			}
3881
3882			//if no image is being used
3883			if(usingLogoImage == false) $('header#top #logo').stop(true,true).animate({
3884				'margin-top' : 4
3885			},{queue:false, duration:450, easing: 'easeOutExpo'});	
3886		
3887			$(window).off('scroll',bigNav);
3888			$(window).on('scroll',smallNav);
3889
3890
3891			//dark slider coloring border fix
3892			$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease');
3893			$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none');
3894			setTimeout(function(){ 
3895				$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease, border-color 0.40s ease'); 
3896				$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.40s ease');
3897			},300);
3898		}
3899
3900	}
3901	
3902	
3903	
3904	
3905	
3906	function opaqueCheck(){
3907		var $offset = $(window).scrollTop();
3908		var $windowWidth = $(window).width();
3909
3910		if($offset > 0 && $windowWidth > 1000) {
3911			
3912			if($('#header-outer').attr('data-transparent-header') == 'true') $('#header-outer').removeClass('transparent').addClass('scrolled-down');
3913			$('.ns-loading-cover').hide();
3914			
3915			$(window).off('scroll',opaqueCheck);
3916			$(window).on('scroll',transparentCheck);
3917		}
3918	}
3919	
3920	
3921	function transparentCheck(){
3922		var $offset = $(window).scrollTop();
3923		var $windowWidth = $(window).width();
3924
3925		if($offset == 0 && $windowWidth > 1000) {
3926			
3927			if($('#header-outer').attr('data-transparent-header') == 'true') $('#header-outer').addClass('transparent').removeClass('scrolled-down');
3928			$('.ns-loading-cover').show();
3929			
3930			$(window).off('scroll',transparentCheck);
3931			$(window).on('scroll',opaqueCheck);
3932		}
3933	}
3934	
3935	var adminBarHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar
3936
3937	//header inherit row color effect
3938	function headerRowColorInheritInit(){
3939		if($('body[data-header-inherit-rc="true"]').length > 0){
3940			$('.main-content > .row > .wpb_row').each(function(){
3941				$(this).waypoint(function(direction) {
3942
3943					if(direction == 'down') {
3944
3945						if($(this).find('.row-bg.using-bg-color').length > 0) {
3946							var $textColor = ($(this).find('> .col.span_12.light').length > 0) ? 'light-text' : 'dark-text';
3947							$('#header-outer').css('background-color',$(this).find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor);
3948							$('#header-outer').attr('data-current-row-bg-color',$(this).find('.row-bg').css('background-color'));
3949						} else {
3950							$('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text');
3951							$('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg'));
3952						}
3953					
3954					} else {
3955
3956						if($(this).prev('div.wpb_row').find('.row-bg.using-bg-color').length > 0) {
3957							var $textColor = ($(this).prev('div.wpb_row').find('> .col.span_12.light').length > 0) ? 'light-text' : 'dark-text';
3958							$('#header-outer').css('background-color',$(this).prev('div.wpb_row').find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor);
3959							$('#header-outer').attr('data-current-row-bg-color', $(this).prev('div.wpb_row').find('.row-bg').css('background-color'));
3960						} else {
3961							$('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text');
3962							$('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg'));
3963						}
3964
3965					} 
3966
3967				}
3967, { offset: (logoHeight - shrinkNum) + Math.ceil((headerPadding*2) / 1.8) + adminBarHeight });
3968			});
3969		}
3970	}
3971
3972	headerRowColorInheritInit();
3973
3974
3975	//responsive nav
3976	$('body').on('click','#toggle-nav',function(){
3977		
3978		$('#mobile-menu').stop(true,true).slideToggle(500);
3979		return false;
3980	});
3981	
3982	
3983	//add wpml to mobile menu
3984	if($('header#top nav > ul > li.menu-item-language').length > 0){
3985		var $langSelector = $('header#top nav > ul > li.menu-item-language').clone();
3986		$langSelector.insertBefore('#mobile-menu ul #mobile-search');
3987	}
3988	
3989	////append dropdown indicators / give classes
3990	$('#mobile-menu .container ul li').each(function(){
3991		if($(this).find('> ul').length > 0) {
3992			 $(this).addClass('has-ul');
3993			 $(this).find('> a').append('<span class="sf-sub-indicator"><i class="icon-angle-down"></i></span>');
3994		}
3995	});
3996	
3997	////events
3998	$('#mobile-menu .container ul li:has(">ul") > a .sf-sub-indicator').click(function(){
3999		$(this).parent().parent().toggleClass('open');
4000		$(this).parent().parent().find('> ul').stop(true,true).slideToggle();
4001		return false;
4002	});
4003	
4004
4005
4006/*-------------------------------------------------------------------------*/
4007/*	5.	Page Specific
4008/*-------------------------------------------------------------------------*/	
4009
4010	//recent work
4011	function piVertCenter() {
4012		$('.portfolio-items  > .col').each(function(){
4013			var $colHeight = $(this).find('.work-item').height();
4014			var $infoHeight = $(this).find('.vert-center').height();
4015		
4016			
4017			//style 3
4018			$(this).find('.style-3 .work-info .vert-center p').stop().animate({
4019				'margin-top' : '-'+$(this).find('.work-info .vert-center p').height()*1.5+'px',
4020				'opacity' : 0
4021			},350,'easeOutCubic');
4022			
4023			//style 4
4024			$(this).find('.style-4 .work-info .bottom-meta:not(.shown)').stop().animate({
4025				'bottom' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px'
4026			},420,'easeOutCubic');
4027
4028			
4029		});	 
4030	}
4031	
4032	$(window).load(function(){
4033	 	 portfolioCommentOrder();
4034	 	 fullWidthContentColumns();
4035	});
4036	
4037	
4038	//ie8 width fix
4039	function ie8Width(){
4040		if( $(window).width() >= 1300 ) {
4041			$('.container').css('max-width','1100px');
4042		} else {
4043			$('.container').css('max-width','880px');
4044		}
4045	}
4046	
4047	if( $(window).width() >= 1300 && $('html').hasClass('no-video')) { $('.container').css('max-width','1100px'); $(window).resize(ie8Width); };
4048	
4049
4050
4051	function smartResizeInit() {
4052
4053		 //carousel height calcs
4054		 carouselHeightCalcs();
4055		 
4056		 //portfolio comment order
4057		 portfolioCommentOrder();
4058		 
4059		 //testimonial slider height
4060		 testimonialHeightResize(); //animated
4061		 testimonialSliderHeight(); //non-animated
4062		 
4063		 //full width content columns sizing
4064		 fullWidthContentColumns();
4065
4066		 //parallax BG Calculations
4067		 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
4068		   parallaxRowsBGCals();
4069		 }
4070
4071		 //full width menu megamenu adjust
4072		if($('.slide-out-widget-area-toggle a.open').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) fullWidthHeaderSlidingWidgetMenuCalc();
4073		  
4074	}
4075
4076    $(window).off('smartresize.srInit'); 
4077	$(window).on('smartresize.srInit', smartResizeInit); 
4078	
4079	
4080	
4081	function resizeInit() {
4082		 portfolioDeviceCheck();
4083
4084		 clientsCarouselHeightRecalc();
4085
4086		 //fullwidth page section calcs
4087		 fullWidthSections(); 
4088		 fullwidthImgOnlySizing();
4089		 fullWidthContentColumns();
4090	  	 fullWidthRowPaddingAdjustCalc();
4091		 
4092		 //iframe video emebeds
4093		 responsiveVideoIframes();
4094		 videoshortcodeSize();
4095		 
4096		 if($('.nectar-video-bg').length > 0) {
4097		 	resizeVideoToCover();
4098		 }
4099		 
4100		 if($('.nectar-social.full-width').length > 0) {
4101		 	nectarLoveFWCenter();
4102		 }
4103
4104		 if($('body').hasClass('ascend')){ 
4105			searchFieldCenter();
4106		 }
4107
4108		 if($('body').hasClass('ascend') && $('body').hasClass('single-post')) centerPostNextButtonImg();
4109		 
4110		 //fixed sidebar for portfolio
4111		 sidebarPxConversion();
4112
4113		 //vc mobile columns
4114		 if($('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) vcMobileColumns();
4115
4116		 if($('#page-header-bg').length > 0) pageHeader();
4117	}
4118
4119	$(window).off('resize.srInit'); 
4120	$(window).on('resize.srInit', resizeInit); 
4121
4122	$(window).on("orientationchange",function(){
4123	  setTimeout(clientsCarouselHeightRecalc,200);
4124	});
4125	
4126	//blog next post button
4127	function postNextButtonEffect(){
4128
4129		$('.blog_next_prev_buttons').imagesLoaded(function(){
4130
4131			centerPostNextButtonImg();
4132			
4133			$('.blog_next_prev_buttons img').css('opacity','1');
4134
4135			if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
4136				$('.blog_next_prev_buttons img').panr({
4137					scaleDuration: .28,
4138					sensitivity: 22,
4139					scaleTo: 1.06
4140				}); 
4141			}
4142
4143		});
4144	}
4145
4146	function centerPostNextButtonImg(){
4147		if( $('.blog_next_prev_buttons img').height() >= $('.blog_next_prev_buttons').height() + 50 ) {
4148			var $height = 'auto';
4149			var $width = $('.blog_next_prev_buttons').width();
4150		} else {
4151
4152			if( $('.blog_next_prev_buttons').width() < $('.blog_next_prev_buttons img').width()) {
4153				var $height = $('.blog_next_prev_buttons').height() + 49;
4154				var $width = 'auto';
4155			} else {
4156				var $height = 'auto';
4157				var $width = '100%';
4158			}
4159			
4160		}
4161
4162		$('.blog_next_prev_buttons img').css({ 'height' : $height, 'width': $width });
4163
4164		$('.blog_next_prev_buttons img').css({
4165			'top' : ($('.blog_next_prev_buttons').height()/2) - ($('.blog_next_prev_buttons img').height()/2) + 'px',
4166			'left' : ($('.blog_next_prev_buttons').width()/2) - ($('.blog_next_prev_buttons img').width()/2) + 'px'
4167		});
4168
4169		$('.blog_next_prev_buttons .inner').each(function(){
4170			$(this).css({'top': $(this).parent().height()/2 - ($(this).height()/2), 'opacity':'1' });
4171		})
4172	}
4173	
4174	postNextButtonEffect();
4175
4176
4177	//portfolio item hover effect
4178	
4179	////desktop event 
4180	function portfolioHoverEffects() { 
4181
4182		if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(iPad|IEMobile)/)) {
4183			
4184			//style 1 & 2
4185			$('.portfolio-items .col .work-item:not(.style-3)').hover(function(){
4186				$(this).find('.work-info .vert-center').stop().animate({
4187					'margin-top' : 0
4188				},400,'easeOutCubic');
4189				$(this).find('.work-info, .work-info .vert-center *, .work-info > i').stop().animate({
4190					'opacity' : 1
4191				},250,'easeOutCubic');
4192				$(this).find('.work-info-bg').stop().animate({
4193					'opacity' : 0.85
4194				},250,'easeOutCubic');
4195			},function(){
4196				$(this).find('.work-info .vert-center').stop().animate({ 
4197					'margin-top' : -15
4198				},400,'easeOutCubic');
4199				$(this).find('.work-info, .work-info .vert-center *, .work-info > i').stop().animate({
4200					'opacity' : 0
4201				},250,'easeOutCubic');
4202				$(this).find('.work-info-bg').stop().animate({
4203					'opacity' : 0
4204				},250,'easeOutCubic');
4205			});
4206			
4207			
4208			//style 3
4209			$('.portfolio-items .col .work-item.style-3').hover(function(){
4210				$(this).find('.work-info .vert-center').stop().animate({
4211					'top' : '-' + $(this).find('.work-info .vert-center p').height() +'px'
4212				},350,'easeOutCubic');
4213				$(this).find('.work-info .vert-center *').stop().animate({
4214					'opacity' : 1
4215				},350,'easeOutCubic');
4216				
4217				$(this).find('.work-info .vert-center p').stop().animate({
4218					'margin-top' : '0px',
4219					'opacity' : 1
4220				},350,'easeOutCubic');
4221				
4222				$(this).find('.work-info-bg').stop(true).animate({
4223					'opacity' : 0
4224				},350,'swing');
4225			},function(){
4226				$(this).find('.work-info .vert-center').stop().animate({
4227					'top' : '0'
4228				},350,'easeOutCubic');
4229				$(this).find('.work-info .vert-center *').stop().animate({
4230					'opacity' : 0
4231				},350,'easeOutCubic');
4232				
4233				$(this).find('.work-info .vert-center p').stop().animate({
4234					'margin-top' : '-'+$(this).find('.work-info .vert-center p').height()*1.5+'px',
4235					'opacity' : 0
4236				},350,'easeOutCubic');
4237				
4238				$(this).find('.work-info-bg').stop(true).animate({
4239					'opacity' : 0.45
4240				},350,'swing');
4241			});
4242			
4243			
4244			//style 4
4245			$('.portfolio-items .col .work-item.style-4').hover(function(){
4246				
4247				$(this).find('img').stop().animate({
4248					'top' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()/2+'px'
4249				},250,'easeOutCubic');
4250				
4251				$(this).find('.work-info .bottom-meta').addClass('shown').stop().animate({
4252					'bottom' : '0px'
4253				},320,'easeOutCubic');
4254
4255			},function(){
4256				
4257				$(this).find('img').stop().animate({
4258					'top' : '0px'
4259				},250,'easeOutCubic');
4260				
4261				$(this).find('.work-info .bottom-meta').removeClass('shown').stop().animate({
4262					'bottom' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px'
4263				},320,'easeOutCubic');
4264				
4265			});
4266		
4267		} 
4268		////mobile event
4269		else {
4270			portfolioDeviceCheck();
4271		}
4272
4273	}
4274
4275	portfolioHoverEffects();
4276	
4277	function portfolioDeviceCheck(){
4278		if($('body').hasClass('mobile') || navigator.userAgent.match(/(iPad|IEMobile)/) ){
4279			
4280			//if using more details
4281			if($('.portfolio-items .col .work-item').find('a:not(".pp")').length > 0){
4282				$('.portfolio-items .col .work-item').find('a.pp').css('display','none');
4283			} 
4284			
4285			//if only using pp
4286			else {
4287				$('.portfolio-items .col .work-item').find('a:not(".pp")').css('display','none');
4288			}
4289		
4290		} else {
4291			$('.portfolio-items .col .work-item').find('a').css('display','inline');
4292		}
4293	}
4294	
4295	
4296	//portfolio accent color
4297	function portfolioAccentColor() {
4298		$('.portfolio-items .col').each(function(){
4299			if ($(this).has('[data-project-color]')) $(this).find('.work-info-bg, .bottom-meta').css('background-color',$(this).attr('data-project-color'));
4300		});
4301	}
4302	portfolioAccentColor();
4303	
4304	//portfolio sort
4305	$('body').on('mouseenter','.portfolio-filters',function(){
4306		$(this).find('> ul').stop(true,true).slideDown(500,'easeOutExpo');
4307		$(this).find('a#sort-portfolio span').html($(this).find('a#sort-portfolio').attr('data-sortable-label'));
4308	});
4309
4310	$('body').on('mouseleave','.portfolio-filters',function(){
4311		var $activeCat = $(this).find('a.active').html();
4312		if( typeof $activeCat == 'undefined' || $activeCat.length == 0) $activeCat = $(this).attr('data-sortable-label');
4313		$(this).find('a#sort-portfolio span').html($activeCat);
4314		$(this).find('>
4314 ul').stop(true,true).slideUp(500,'easeOutExpo');
4315	});
4316	
4317	//portfolio selected category
4318	$('body').on('click','.portfolio-filters ul li a', function(){
4319		$(this).parents('.portfolio-filters').find('#sort-portfolio span').html($(this).html());
4320	});
4321	
4322	//inline portfolio selected category
4323	$('body').on('click','.portfolio-filters-inline ul li a',function(){
4324
4325		$(this).parents('ul').find('li a').removeClass('active');
4326		$(this).addClass('active');
4327		$(this).parents('.portfolio-filters-inline').find('#current-category').html($(this).html());
4328		
4329	});
4330	
4331
4332	function portfolioFiltersInit() {
4333		//mobile sort menu fix
4334		if($('body').hasClass('mobile') || navigator.userAgent.match(/(iPad|IEMobile)/)){
4335			$('.portfolio-filters').unbind('mouseenter mouseleave');
4336			$('.portfolio-filters > a, .portfolio-filters ul li a').click(function(e){
4337				if(e.originalEvent !== undefined) $(this).parents('.portfolio-filters').find('> ul').stop(true,true).slideToggle(600,'easeOutCubic');
4338			});
4339		}
4340
4341		$('.portfolio-filters-inline .container > ul > li:nth-child(2) a').click();
4342		
4343		//portfolio more details page menu highlight
4344		$('body.single-portfolio #header-outer nav > ul > li > a:contains("Portfolio")').parents('li').addClass('current-menu-item');
4345		
4346		//blog page highlight
4347		$('body.single-post #header-outer nav > ul > li > a:contains("Blog")').parents('li').addClass('current-menu-item');
4348	}
4349
4350	portfolioFiltersInit();
4351
4352	
4353	//blog love center
4354	function centerLove(){
4355		$('.post').each(function(){
4356			
4357			var $loveWidth = $(this).find('.post-meta .nectar-love').outerWidth();
4358			var $loveWrapWidth = $(this).find('.post-meta  .nectar-love-wrap').width();
4359			
4360			//center
4361			$(this).find('.post-meta .nectar-love').css('margin-left', $loveWrapWidth/2 - $loveWidth/2 + 'px' );
4362			$(this).find('.nectar-love-wrap').css('visibility','visible');
4363		});
4364	}
4365	
4366	$('.nectar-love').on('click',function(){
4367		centerLove();
4368	});
4369	
4370	centerLove();	
4371	
4372	
4373	//portfolio single comment order
4374	function portfolioCommentOrder(){
4375	
4376		if($('body').hasClass('mobile') && $('body').hasClass('single-portfolio') && $('#respond').length > 0){
4377			$('#sidebar').insertBefore('.comments-section');
4378		}
4379		 
4380		else if($('body').hasClass('single-portfolio') && $('#respond').length > 0) {
4381			$('#sidebar').insertAfter('#post-area');
4382		}
4383		
4384	}
4385
4386	 portfolioCommentOrder();
4387	 
4388	
4389	//portfolio sidebar follow
4390	
4391	var sidebarFollow = $('.single-portfolio #sidebar').attr('data-follow-on-scroll');
4392	
4393	function portfolioSidebarFollow(){
4394
4395		sidebarFollow = $('.single-portfolio #sidebar').attr('data-follow-on-scroll');
4396	
4397		if( $('body.single-portfolio').length > 0 && sidebarFollow == 1 && !$('body').hasClass('mobile') && parseInt($('#sidebar').height()) + 50 <= parseInt($('#post-area').height())) {
4398			
4399			 $('#sidebar').addClass('fixed-sidebar');
4400			 
4401			 var $footer = ($('.comment-wrap.full-width-section').length == 0) ? '#footer-outer' : '.comment-wrap';
4402			 if( $('#call-to-action').length > 0 ) $footer = '#call-to-action';
4403			 
4404			 //convert width into px
4405			 sidebarPxConversion();
4406			 
4407			 $('#sidebar').stickyMojo({footerID: $footer, contentID: '#post-area'});
4408			 
4409		}
4410		
4411	}
4412	
4413	function sidebarPxConversion(){
4414		
4415		if( $('body.single-portfolio').length > 0 && sidebarFollow == 1 && !$('body').hasClass('mobile') ) {
4416			
4417			var $containerWidth = $('.main-content > .row').width();
4418			var $sidebarWidth = $containerWidth*.235;
4419			
4420			if(window.innerWidth > 1300){
4421				$sidebarWidth = $containerWidth*.235;
4422			} else if(window.innerWidth < 1300 && window.innerWidth > 1000 ) {
4423				$sidebarWidth = $containerWidth*.273;
4424			}
4425			
4426			$('#sidebar').css('width',$sidebarWidth+'px');
4427		}
4428	}
4429	
4430	$(window).load(function(){
4431		setTimeout(portfolioSidebarFollow,200);
4432	});
4433	
4434	
4435	//remove the portfolio filters that are not found in the current page
4436	function isotopeCatSelection() {
4437
4438
4439		$('.portfolio-items:not(".carousel")').each(function(){
4440
4441			var isotopeCatArr = [];
4442			var $portfolioCatCount = 0;
4443			$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(i){
4444				if($(this).find('a').length > 0) {
4445					isotopeCatArr[$portfolioCatCount] = $(this).find('a').attr('data-filter').substring(1);	
4446					$portfolioCatCount++;
4447				}
4448			});
4449			
4450			////ice the first (all)
4451			isotopeCatArr.shift();
4452			
4453			
4454			var itemCats = '';
4455			
4456			$(this).find('> div').each(function(i){
4457				itemCats += $(this).attr('data-project-cat');
4458			});
4459			itemCats = itemCats.split(' ');
4460			
4461			////remove the extra item on the end of blank space
4462			itemCats.pop();
4463			
4464			////make sure the array has no duplicates
4465			itemCats = $.unique(itemCats);
4466			
4467			////if user has chosen a set of filters to display - only show those
4468			if($(this).attr('data-categories-to-show').length != 0 && $(this).attr('data-categories-to-show') != 'all') {
4469				$userSelectedCats = $(this).attr('data-categories-to-show').replace(/,/g , ' ');
4470				$userSelectedCats = $userSelectedCats.split(' ');
4471				
4472				if(!$(this).hasClass('infinite_scroll')) $(this).removeAttr('data-categories-to-show');
4473			} else {
4474				$userSelectedCats = itemCats;
4475			}
4476			
4477			
4478			////Find which categories are actually on the current page
4479			var notFoundCats = [];
4480			$.grep(isotopeCatArr, function(el) {
4481
4482		    	if ($.inArray(el, itemCats) == -1) notFoundCats.push(el);
4483		    	if ($.inArray(el, $userSelectedCats) == -1) notFoundCats.push(el);
4484
4485			});
4486			
4487			//manipulate the list
4488			if(notFoundCats.length != 0){
4489				$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(){
4490					if($(this).find('a').length > 0) {
4491						if( $.inArray($(this).find('a').attr('data-filter').substring(1), notFoundCats) != -1 ){ 
4492							$(this).hide(); 
4493						} else {
4494							$(this).show();
4495						}
4496					}
4497				})
4498			}
4499		});
4500	}
4501	
4502	isotopeCatSelection();
4503	
4504	
4505	//sharing buttons
4506	/*jQuery.sharedCount = function(url, fn) {
4507		url = encodeURIComponent(url || location.href);
4508		var arg = {
4509			url: "//" + (location.protocol == "https:" ? "sharedcount.appspot" : "api.sharedcount") + ".com/?url=" + url,
4510			cache: true,
4511			dataType: "json"
4512		};
4513		if ('withCredentials' in new XMLHttpRequest) {
4514			arg.success = fn;
4515		}
4516		else {
4517			var cb = "sc_" + url.replace(/\W/g, '');
4518			window[cb] = fn;
4519			arg.jsonpCallback = cb;
4520			arg.dataType += "p";
4521		}
4522		return jQuery.ajax(arg);
4523	};*/
4524	
4525	
4526	
4527	
4528	var completed = 0;
4529	var windowLocation = window.location.href.replace(window.location.hash, '');
4530
4531	function facebookShare(){
4532		windowLocation = window.location.href.replace(window.location.hash, '');
4533		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" ) 
4534		return false;
4535	}
4536
4537	function googlePlusShare(){
4538		windowLocation = window.location.href.replace(window.location.hash, '');
4539		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" ) 
4540		return false;
4541	}
4542
4543	function twitterShare(){
4544        windowLocation = window.location.href.replace(window.location.hash, '');		
4545		if($(".section-title h1").length > 0) {
4546			var $pageTitle = encodeURIComponent($(".section-title h1").text());
4547		} else {
4548			var $pageTitle = encodeURIComponent($(document).find("title").text());
4549		}
4550		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" ) 
4551		return false;
4552	}
4553
4554	function wooTwitterShare(){
4555		windowLocation = window.location.href.replace(window.location.hash, '');
4556		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" ) 
4557		return false;
4558	}
4559
4560	function linkedInShare(){
4561	    windowLocation = window.location.href.replace(window.location.hash, '');	
4562		if($(".section-title h1").length > 0) {
4563			var $pageTitle = encodeURIComponent($(".section-title h1").text());
4564		} else {
4565			var $pageTitle = encodeURIComponent($(document).find("title").text());
4566		}
4567		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" ) 
4568		return false;
4569	}
4570
4571	function woolinkedInShare(){
4572	    windowLocation = window.location.href.replace(window.location.hash, '');	
4573		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" ) 
4574		return false;
4575	}
4576
4577	function pinterestShare(){
4578		windowLocation = window.location.href.replace(window.location.hash, '');
4579		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'); 
4580		
4581		if($(".section-title h1").length > 0) {
4582			var $pageTitle = encodeURIComponent($(".section-title h1").text());
4583		} else {
4584			var $pageTitle = encodeURIComponent($(document).find("title").text());
4585		}
4586		
4587		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" ) 
4588		return false;
4589	}
4590	
4591	function wooPinterestShare(){
4592		windowLocation = window.location.href.replace(window.location.hash, '');
4593		window.open( 'http://pinterest.com/pin/create/button/?url='+windowLocation+'&media='+$('img.attachment-shop_single').first().attr('src')+'&description='+$('h1.product_title').text(), "pinterestWindow", "height=640,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 
4594		return false;
4595	}
4596
4597
4598	function socialFade(){
4599			if(completed == $('a.nectar-sharing').length && $('a.nectar-sharing').parent().hasClass('in-sight')) {
4600
4601				$('.nectar-social > a').stop(true,true).animate({'padding-right':'15px'},350,'easeOutSine');
4602				
4603				//love fadein
4604				$('.nectar-social .nectar-love span').show(350,'easeOutSine',function(){
4605					$(this).stop().animate({'opacity':1},800);
4606				});
4607				
4608				//sharing loadin
4609				$('.nectar-social > a').each(function(i){
4610					var $that = $(this);
4611					
4612					$(this).find('> span').show(350,'easeOutSine',function(){
4613						$that.find('> span').stop().animate({'opacity':1},800);
4614					});
4615					
4616				});
4617
4618				//alt blog layout total share count
4619				var $totalShares = 0;
4620				$('.nectar-social > a .count').each(function(){
4621					$totalShares += parseInt($(this).html());
4622				});
4623
4624				if($totalShares != 1){
4625					$('.single-post #single-below-header.fullscreen-header .meta-share-count .plural').css({'opacity':'1'});
4626					$('.single-post #single-below-header.fullscreen-header .meta-share-count .singular').remove();
4627				} else {
4628					$('.single-post #single-below-header.fullscreen-header .meta-share-count .singular').
4628css({'opacity':'1', 'position':'relative'});
4629					$('.single-post #single-below-header.fullscreen-header .meta-share-count .plural').remove();
4630				}
4631
4632				$('.fullscreen-header .share-count-total').html($totalShares);
4633			}
4634		}
4635
4636	$('body').on('click','#single-below-header .nectar-social a', function(){ return false; });
4637
4638	$('body').on('click','.facebook-share:not(.inactive)', facebookShare);
4639	$('body').on('click','.google-plus-share:not(.inactive)', googlePlusShare);
4640	$('body').on('click','.nectar-social:not(".woo") .twitter-share:not(.inactive)', twitterShare);
4641	$('body').on('click','.nectar-social.woo .twitter-share', wooTwitterShare);
4642	$('body').on('click','.nectar-social:not(".woo") .linkedin-share:not(.inactive)', linkedInShare);
4643	$('body').on('click','.nectar-social.woo .linkedin-share', woolinkedInShare);
4644	$('body').on('click','.nectar-social:not(".woo") .pinterest-share:not(.inactive)', pinterestShare);
4645	$('body').on('click','.nectar-social.woo .pinterest-share', wooPinterestShare);
4646
4647
4648	function socialSharingInit() {
4649
4650		//mobile fullscreen blog class for click event fix
4651		if($('body').hasClass('mobile') && $('.single-post .fullscreen-header').length > 0) {
4652			$('#single-below-header .nectar-social .nectar-sharing, #single-below-header .nectar-social .nectar-sharing-alt').addClass('inactive');
4653		}
4654
4655		completed = 0;
4656
4657		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) {
4658  
4659		 
4660			////facebook
4661			if($('a.facebook-share').length > 0) {
4662				
4663				//load share count on load  
4664				$.getJSON("https://graph.facebook.com/?id="+ windowLocation +'&callback=?', function(data) {
4665					if((data.shares != 0) && (data.shares != undefined) && (data.shares != null)) { 
4666						$('.facebook-share a span.count, a.facebook-share span.count').html( data.shares );	
4667					}
4668					else {
4669						$('.facebook-share a span.count, a.facebook-share span.count').html( 0 );	
4670					}
4671					completed++;
4672					socialFade();
4673				});
4674			 
4675				
4676				
4677			}
4678			
4679			
4680			////twitter
4681			if($('a.twitter-share').length > 0) {
4682				//load tweet count on load 
4683				$.getJSON('https://cdn.api.twitter.com/1/urls/count.json?url='+windowLocation+'&callback=?', function(data) {
4684					if((data.count != 0) && (data.count != undefined) && (data.count != null)) { 
4685						$('.twitter-share a span.count, a.twitter-share span.count').html( data.count );
4686					}
4687					else {
4688						$('.twitter-share a span.count, a.twitter-share span.count').html( 0 );
4689					}
4690					completed++;
4691					socialFade();
4692				});
4693
4694
4695			}
4696			
4697			
4698			////linkedIn
4699			if($('a.linkedin-share').length > 0) {
4700				//load share count on load 
4701				$.getJSON('https://www.linkedin.com/countserv/count/share?url='+windowLocation+'&callback=?', function(data) {
4702					if((data.count != 0) && (data.count != undefined) && (data.count != null)) { 
4703						$('.linkedin-share a span.count, a.linkedin-share span.count').html( data.count );
4704					}
4705					else {
4706						$('.linkedin-share a span.count, a.linkedin-share span.count').html( 0 );
4707					}
4708					completed++;
4709					socialFade();
4710				});
4711
4712				
4713			}
4714			
4715			
4716			////pinterest
4717			if($('a.pinterest-share').length > 0) {
4718				//load pin count on load 
4719				$.getJSON('https://api.pinterest.com/v1/urls/count.json?url='+windowLocation+'&callback=?', function(data) {
4720					if((data.count != 0) && (data.count != undefined) && (data.count != null)) { 
4721						$('.pinterest-share a span.count, a.pinterest-share span.count').html( data.count );
4722					}
4723					else {
4724						$('.pinterest-share a span.count, a.pinterest-share span.count').html( 0 );
4725					}
4726					completed++;
4727					socialFade();
4728				});
4729
4730			}
4731			
4732			
4733			//fadeIn
4734			$('a.nectar-sharing > span.count, a.nectar-sharing-alt > span.count').hide().css('width','auto');
4735
4736
4737			//social light up
4738			$('.nectar-social').each(function() {
4739
4740				$(this).waypoint(function(direction) {
4741					
4742					$(this).addClass('in-sight');
4743					socialFade();
4744					
4745					$(this).find('> *').each(function(i){
4746						
4747						var $that = $(this);
4748						
4749						setTimeout(function(){ 
4750							
4751							$that.delay(i*80).queue(function(){ 
4752								
4753								var $that = $(this); $(this).addClass('hovered'); 
4754								
4755								setTimeout(function(){ 
4756									$that.removeClass('hovered');
4757								},300); 
4758								
4759							});
4760						
4761						},750);
4762					});
4763				
4764				}, { offset: '90%', triggerOnce: true });
4765			
4766			}); 
4767
4768		}
4769
4770	}
4771	
4772	socialSharingInit();
4773
4774
4775	$('body').on('mouseenter','.fullscreen-header  .meta-share-count', function(){
4776		$(this).find('> a, > i').stop(true).animate({'opacity': 0},400);
4777		$(this).find('.nectar-social > *').each(function(i){
4778			$(this).stop(true).delay(i*50).animate({'opacity':'1', 'top': '0px'},250,'easeOutCubic');
4779		});
4780		//allow clickable on mobile
4781		setTimeout(function(){ $('.meta-share-count .nectar-sharing, .meta-share-count .nectar-sharing-alt').removeClass('inactive'); },300);
4782		
4783	});
4784
4785	if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
4786		$('body').on('mouseleave','.fullscreen-header  .meta-share-count', function(){
4787			$(this).find('> a, > i').stop(true).animate({'opacity': 1},300,'easeInCubic');
4788			$(this).find('.nectar-social > *').each(function(i){
4789				$(this).stop(true).animate({'opacity':'0', 'top': '10px'},200,'easeInCubic');
4790			});
4791		});
4792	}
4793
4794
4795
4796
4797	//full width love center
4798	function nectarLoveFWCenter(){
4799		$('.nectar-social.full-width').each(function(){ 
4800			$(this).find('.n-shortcode .nectar-love').css('padding-top', $(this).find('> a').css('padding-top'));
4801		});
4802	}
4803	
4804	nectarLoveFWCenter();
4805	
4806
4807	//-----------------------------------------------------------------
4808	// NectarLove
4809	//-----------------------------------------------------------------
4810	
4811	$('body').on('click','.nectar-love', function() {
4812			
4813
4814			var $loveLink = $(this);
4815			var $id = $(this).attr('id');
4816			var $that = $(this);
4817			
4818			if($loveLink.hasClass('loved')) return false;
4819			if($(this).hasClass('inactive')) return false;
4820			
4821			var $dataToPass = {
4822				action: 'nectar-love', 
4823				loves_id: $id 
4824			}
4825			
4826			$.post(nectarLove.ajaxurl, $dataToPass, function(data){
4827				$loveLink.find('span').html(data);
4828				$loveLink.addClass('loved').attr('title','You already love this!');
4829				$loveLink.find('span').css({'opacity': 1,'width':'auto'});
4830				//ascend
4831				if($('body').hasClass('ascend')){
4832					$loveLink.find('.icon-salient-heart.loved').show().transition({ scale: 1 },800,'cubic-bezier(0.15, 0.84, 0.35, 1.5)');
4833					setTimeout(function(){ $loveLink.find('.icon-salient-heart-2').css('opacity','0'); },400);
4834				}
4835			});
4836			
4837			$(this).addClass('inactive');
4838			
4839			return false;
4840	});
4841
4842
4843	
4844	//infinite scroll
4845	function infiniteScrollInit() {
4846
4847		if($('.infinite_scroll').length > 0) {
4848			
4849			//portfolio
4850			$('.portfolio-items.infinite_scroll').infinitescroll({
4851		    	navSelector  : "div#pagination",            
4852		   	    nextSelector : "div#pagination a:first",    
4853		   	    itemSelector : ".portfolio-items.infinite_scroll .element",
4854		   	    finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
4855		        msgText: " ",         
4856		   },function(newElements){
4857		   	
4858
4859				var $container = $('.portfolio-items.infinite_scroll:not(.carousel)');
4860				//loading effect   
4861		        //// hide new items while they are loading
4862		        var $newElems = $( newElements ).css({ opacity: 0 });
4863		        //// ensure that images load before adding to masonry layout
4864		        $newElems.imagesLoaded(function(){
4865		        	
4866		          $container.isotope( 'appended', $( newElements ));
4867		          
4868		          $( newElements ).find('.work-item').css({ opacity: 0 }).addClass('ajax-loaded');
4869		          ///// show elems now they're ready
4870		          
4871		          $(newElements).find('.work-meta, .nectar-love-wrap').css({'opacity':1});
4872		          
4873		          //keep filtering
4874		          if($('.portfolio-filters-inline').length > 0 || $('.portfolio-filters').length > 0) {
4875		          	
4876		          	  if($('.portfolio-filters-inline').length > 0) {
4877		          	  	 var selector = $('.portfolio-filters-inline a.active').attr('data-filter');
4878		          	  } else {
4879		          	  	 var selector = $('.portfolio-filters a.active').attr('data-filter');
4880		          	  }
4881		          	  
4882		          	  $('.portfolio-filters-inline a.active').attr('data-filter');
4883			  	 	  $container.isotope({ filter: selector });
4884		          }
4885		          
4886			  
4887		          $(newElements).each(function(i){
4888		          	$(this).find('.work-item').delay(i*125).animate({ 'opacity':1 },700, 'easeOutCubic');
4889		          });
4890		          
4891		        
4892		          
4893		        portfolioHoverEffects();	
4894				portfolioAccentColor();
4895		         
4896		        //verify smooth scorlling
4897				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') } 
4898				
4899				
4900				//Panr 
4901				if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)) {
4902					
4903					$(".portfolio-items:not(.carousel) .work-item.style-3 img").panr({
4904						scaleDuration: .28,
4905					}); 
4906					
4907				}
4908				
4909				//prettyphoto
4910				$('.portfolio-items').each(function(){
4911					var $unique_id = Math.floor(Math.random()*10000);
4912					$(this).find('a[rel^="prettyPhoto"], a.pretty_photo').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo');
4913				});
4914		
4915				prettyPhotoInit();
4916				
4917				
4918				setTimeout(function(){masonryZindex(); reLayout(); },700);
4919		        
4920		        //recalc the filters
4921		        isotopeCatSelection();
4922
4923		        parallaxRowsBGCals();
4924	          
4925	          }); 
4926		          
4927		       
4928				
4929				
4930				
4931		   });
4932			
4933			
4934			
4935			//blog
4936			$('#post-area.infinite_scroll .posts-container').infinitescroll({
4937		    	navSelector  : "div#pagination",            
4938		   	    nextSelector : "div#pagination a:first",    
4939		   	    itemSelector : "#post-area .posts-container .post",
4940		   	    finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
4941		        msgText: " " 
4942		   },function(newElements){
4943		   	
4944		   	if($('.masonry.meta_overlaid').length == 0) { 
4945			   	//reinit js
4946			   	centerLove();
4947			   	
4948			   	//gallery
4949				$(newElements).find('.flex-gallery').each(function(){
4950					
4951					var $that = $(this);
4952					
4953					 $that.flexslider({
4954				        animation: 'fade',
4955				        smoothHeight: false, 
4956				        animationSpeed: 500,
4957				        useCSS: false, 
4958				        touch: true
4959				    });
4960					
4961					////gallery slider add arrows
4962					$('.flex-gallery .flex-direction-nav li a.flex-next').html('<i class="icon-angle-right"></i>');
4963					$('.flex-gallery .flex-direction-nav li a.flex-prev').html('<i class="icon-angle-left"></i>');
4964
4965				});
4966			   	
4967			   	
4968			   	//media players
4969			   	if($().mediaelementplayer) $(newElements).find('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer();
4970			   	
4971			   	
4972			   	//lightbox
4973			   	prettyPhotoInit();
4974			   	
4975			   	//carousels
4976			   	standardCarouselInit();
4977		    	clientsCarouselInit();
4978			   	
4979			   	//iframes
4980			   	showLateIframes();
4981
4982			   	//milestone
4983			   	$(newElements).find('.nectar-milestone').each(function() {
4984					//symbol
4985					if($(this).has('[data-symbol]')) {
4986						if($(this).attr('data-symbol-pos') == 'before') {
4987							$(this).find('.number').prepend($(this).attr('data-symbol'));
4988						} else {
4989							$(this).find('.number').append($(this).attr('data-symbol'));
4990						}
4991					}
4992				});
4993				
4994				if(!$('body').hasClass('mobile')) {
4995					
4996					$(newElements).find('.nectar-milestone').each(function() {
4997						//animation
4998						$(this).waypoint(function(direction) {
4999							var $endNum = parseInt($(this).find('.number span').text());
5000							$(this).find('.number span').countTo({
5001								from: 0,
5002								to: $endNum,
5003								speed: 1500,
5004								refreshInterval: 30
5005							});
5006						}, { offset: '90%', triggerOnce: true });
5007					}); 
5008				}
5009				
5010				//pie chart		
5011			    if($().vcChat) $(newElements).find('.vc_pie_chart').vcChat();
5012		    	
5013		    	//fancy ul
5014		    	nectar_fancy_ul_init();
5015		    	
5016		    	//testimonial slider
5017		    	$('.testimonial_slider').animate({'opacity':'1'},800);
5018		    	createTestimonialControls();
5019				testimonialSliderHeight(); 
5020				testimonialHeightResize();
5021		    	
5022				//bar graph
5023				$(newElements).find('.nectar-progress-bar').each(function(i){
5024					
5025					$(this).waypoint(function(direction) {
5026						
5027						var percent = $(this).find('span').attr('data-width');
5028						var $endNum = parseInt($(this).find('span strong i').text());
5029						var $that = $(this);
5030						
5031						$(this).find('span').animate({
5032							'width' : percent + '%'
5033						},1600, 'easeOutCirc',function(){
5034						});
5035						
5036						$(this).find('span strong').animate({
5037							'opacity' : 1
5038						},1350);
5039						
5040						
5041						$(this).find('span strong i').countTo({
5042							from: 0,
5043							to: $endNum,
5044							speed: 1100,
5045							refreshInterval: 30,
5046							onComplete: function(){
5047					
5048							}
5049						});	
5050						
5051						////100% progress bar 
5052							if(percent == '100'){
5053								$that.find('span strong').addClass('full');
5054							}
5055				
5056					}, { offset: '90%', triggerOnce: true });
5057					
5058			
5059				});
5060				
5061				
5062				//columns & images with animation
5063				colAndImgAnimations();
5064
5065				setTimeout(function(){
5066					videoshortcodeSize();
5067					responsiveVideoIframesInit();
5068					responsiveVideoIframes();
5069					$(window).trigger('resize');
5070				},500);
5071
5072
5073				parallaxRowsBGCals();
5074
5075				$(window).trigger('resize');
5076			   	
5077		   	}//non meta overlaid style 
5078		   	else {
5079		   		parallaxRowsBGCals();
5080
5081				$(window).trigger('resize');
5082		   	}
5083
5084		   	// trigger Masonry as a callback
5085		   	var $container = $('.posts-container');
5086		    if($container.parent().hasClass('masonry')) { 
5087		    	 
5088		    	$container.find('article').addClass('masonry-blog-item');
5089				$container.find('article').prepend('<span class="bottom-line"></span>');
5090				
5091				//move the meta to the bottom
5092				$container.find('article').each(function(){
5093					
5094					var $metaClone = $(this).find('.post-meta').clone();
5095		
5096					$(this).find('.post-meta').remove();
5097					
5098					if($('#post-area.meta_overlaid').length > 0){
5099						$(this).find('.post-header h2').after($metaClone);
5100					} else {
5101						$(this).find('.content-inner').after($metaClone);
5102					}
5103					
5104				});
5105			
5106		    	 
5107		    	//loading effect   
5108		    	
5109		        //// hide new items while they are loading
5110		        var $newElems = $( newElements ).css({ opacity: 0 });
5111		        //// ensure that images load before adding to masonry layout
5112		        $newElems.imagesLoaded(function(){
5113		          $container.isotope( 'appended', $( newElements ),function(){
5114
5115			          $( newElements ).css({ opacity: 0 }).addClass('ajax-loaded');
5116			          ///// show elems now they're ready
5117			          
5118			          $(newElements).each(function(i){
5119			          	$(this).delay(i*125).transition({ 'opacity':1 },700, 'easeOutCubic');
5120			          });
5121		          
5122		          }); 
5123		          
5124		        });
5125		        
5126		     }//if masonry
5127		   	
5128		   });
5129		   
5130	   }
5131
5132}
5133
5134infiniteScrollInit();
5135
5136function destroyInfiniteScroll(){
5137	$('#post-area.infinite_scroll .posts-container').infinitescroll('destroy');
5138	$('.portfolio-items.infinite_scroll').infinitescroll('destroy');
5139}
5140	
5141/*-------------------------------------------------------------------------*/
5142/*	6.	Scroll to top
5143/*-------------------------------------------------------------------------*/	
5144
5145var $scrollTop = $(window).scrollTop();
5146
5147//starting bind
5148function toTopBind() {
5149	if( $('#to-top').length > 0 && $(window).width() > 1020) {
5150		
5151		if($scrollTop > 350){
5152			$(window).on('scroll',hideToTop);
5153		}
5154		else {
5155			$(window).on('scroll',showToTop);
5156		}
5157	}
5158}
5159toTopBind();
5160
5161function showToTop(){
5162	
5163	if( $scrollTop > 350 ){
5164
5165		$('#to-top').stop(true,true).animate({
5166			'bottom' : '17px'
5167		},350,'easeInOutCubic');	
5168		
5169		$(window).off('scroll',showToTop);
5170		$(window).on('scroll',hideToTop);
5171	}
5172
5173}
5174
5175function hideToTop(){
5176	
5177	if( $scrollTop < 350 ){
5178
5179		$('#to-top').stop(true,true).animate({
5180			'bottom' : '-30px'
5181		},350,'easeInOutCubic');	
5182		
5183		$(window).off('scroll',hideToTop);
5184		$(window).on('scroll',showToTop);	
5185		
5186	}
5187}
5188
5189//to top color
5190if( $('#to-top').length > 0 ) {
5191	
5192	var $windowHeight, $pageHeight, $footerHeight, $ctaHeight;
5193	
5194	function calcToTopColor(){
5195		$scrollTop = $(window).scrollTop();
5196		$windowHeight = $(window).height();
5197		$pageHeight = $('body').height();
5198		$footerHeight = $('#footer-outer').height();
5199		$ctaHeight = ($('#call-to-action').length > 0) ? $('#call-to-action').height() : 0;
5200		
5201		if( ($scrollTop-35 + $windowHeight) >= ($pageHeight - $footerHeight) && $('#boxed').length == 0){
5202			$('#to-top').addClass('dark');
5203		}
5204		
5205		else {
5206			$('#to-top').removeClass('dark');
5207		}
5208	}
5209	
5210	//calc on scroll
5211	$(window).scroll(calcToTopColor);
5212	
5213	//calc on resize
5214	$(window).resize(calcToTopColor);
5215
5216}
5217
5218//scroll up event
5219$('body').on('click','#to-top, a[href="#top"]',function(){
5220	$('body,html').stop().animate({
5221		scrollTop:0
5222	},800,'easeOutQuad')
5223	return false;
5224});
5225
5226
5227/* one page scrolling */
5228function scrollSpyInit(){ 
5229
5230	//remove full page URLs from hash if located on same page to fix current menu class
5231	if(location.pathname.length > 1 && $('body.home').length == 0) {
5232		$("#header-outer a[href*='" + location.pathname + "']").each(function(){
5233			var $href = $(this).attr('href');
5234			if($href.indexOf("#") != -1) {
5235				$(this).attr('href',$href.substr($href.indexOf("#")));
5236				$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
5237			}
5238		});
5239	}
5240
5241	$('body').scrollspy({
5242		target: '#header-outer nav',
5243		offset: $('#header-outer').height() + adminBarHeight + 15
5244	});
5245}
5246
5247function pageLoadHash() {
5248	var $hash = window.location.hash;
5249	if($hash && $($hash).length > 0) {
5250		$('body,html').stop().animate({
5251			scrollTop: $($hash).offset().top - parseInt($('#header-space').height()) - adminBarHeight + (parseInt(shrinkNum) + headerPadding2*2 + 3) 
5252		},1000,'easeInOutCubic');
5253	}
5254}
5255
5256if($('body[data-animated-anchors="true"]').length > 0) { 
5257
5258+function(t){"use strict";function s(e,i){var r=t.proxy(this.process,this);this.$body=t("body"),this.$scrollElement=t(t(e).is("body")?window:e),this.options=t.extend({},s.DEFAULTS,i),this.selector=(this.options.target||"")+" ul li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",r),this.refresh(),this.process()}function e(e){return this.each(function(){var i=t(this),r=i.data("bs.scrollspy"),o="object"==typeof e&&e;r||i.data("bs.scrollspy",r=new s(this,o)),"string"==typeof e&&r[e]()})}s.VERSION="3.2.0",s.DEFAULTS={offset:10},s.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},s.prototype.refresh=function(){var s="offset",e=0;t.isWindow(this.$scrollElement[0])||(s="position",e=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var i=this;this.$body.find(this.selector).map(function(){var i=t(this),r=i.data("target")||i.attr("href"),o=/^#./.test(r)&&t(r);return o&&o.length&&o.is(":visible")&&[[o[s]().top+e,r]]||null}).sort(function(t,s){return t[0]-s[0]}).each(function(){i.offsets.push(this[0]),i.targets.push(this[1])})},s.prototype.process=function(){var t,s=this.$scrollElement.scrollTop()+this.options.offset,e=this.getScrollHeight(),i=this.options.offset+e-this.$scrollElement.height(),r=this.offsets,o=this.targets,l=this.activeTarget;if(this.scrollHeight!=e&&this.refresh(),s>=i)return l!=(t=o[o.length-1])&&this.activate(t);if(l&&s<=r[0])return l!=(t=o[0])&&this.activate(t);for(t=r.length;t--;)l!=o[t]&&s>=r[t]&&(!r[t+1]||s<=r[t+1])&&this.activate(o[t])},s.prototype.activate=function(s){this.activeTarget=s,t(this.selector).parentsUntil(this.options.target,".current-menu-item").removeClass("current-menu-item").removeClass('sfHover');var e=this.selector+'[data-target="'+s+'"],'+this.selector+'[href="'+s+'"]',i=t(e).parents("li").addClass("current-menu-item");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("current-menu-item")),i.trigger("activate.bs.scrollspy")};var i=t.fn.scrollspy;t.fn.scrollspy=e,t.fn.scrollspy.Constructor=s,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=i,this}}(jQuery);
5259
5260
5261var shrinkNum = 6;	
5262if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
5263headerPadding2 = headerPadding - headerPadding/1.8;
5264
5265setTimeout(scrollSpyInit,200);
5266
5267$('body').on('click','#header-outer nav .sf-menu a, .container-wrap a:not(.wpb_tabs_nav a), .swiper-slide .button a, #slide-out-widget-area a, #mobile-menu .container ul li a',function(e){
5268
5269	var $hash = $(this).prop("hash");	
5270	if($hash && $($hash).length > 0 && $hash != '#top' && $hash != '' && $(this).attr('href').indexOf(window.location.href.split("#")[0]) !== -1 || $(this).is('[href^=#]') && $hash != '' && $($hash).length > 0 && $hash != '#top') {
5271		
5272		//stop scrolling for certain elements
5273		if($(this).parents('.tabbed').length > 0) return false;
5274		
5275		//update hash
5276		if(history.pushState) {
5277		    history.pushState(null, null, $hash);
5278		}
5279		else {
5280		    location.hash = $hash;
5281		}
5282
5283		$('#header-outer nav li').removeClass('current-menu-item');
5284
5285		//side widget area click
5286		if($(this).parents('#slide-out-widget-area').length > 0){
5287			$('#slide-out-widget-area .slide_out_area_close').trigger('click');
5288		}
5289
5290		//mobile menu click
5291		if($(this).parents('#mobile-menu').length > 0) $('#toggle-nav').trigger('click');
5292		var $mobileMenuHeight = ($(this).parents('#mobile-menu').length > 0) ? $(this).parents('#mobile-menu').height() : null;
5293		
5294		
5295		//scrolling
5296		$('body,html').stop().animate({
5297			scrollTop: $($hash).offset().top - $mobileMenuHeight - parseInt($('#header-space').height()) - adminBarHeight + (parseInt(shrinkNum) + headerPadding2*2 + 3) 
5298		},1000,'easeInOutCubic');
5299
5300		e.preventDefault();
5301
5302	}
5303
5304});
5305
5306
5307$(window).load(pageLoadHash);
5308
5309}
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320	
5321
5322	// masonryPortfolio
5323
5324	var $portfolio_containers = [];
5325
5326	$('.portfolio-items:not(.carousel)').each(function(i){
5327		$portfolio_containers[i] = $(this);
5328	});
5329
5330	function masonryPortfolioInit() {
5331
5332		$portfolio_containers = [];
5333		$('.portfolio-items:not(.carousel)').each(function(i){
5334			$portfolio_containers[i] = $(this);
5335		});
5336
5337		//// cache window
5338		var $window = jQuery(window);	
5339		
5340			
5341			$.each($portfolio_containers,function(i){
5342
5343
5344				//// start up isotope with default settings
5345				$portfolio_containers[i].imagesLoaded(function(){
5346					
5347					//verify smooth scorlling
5348					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') } 
5349					
5350					//transformns enabled logic
5351					var $isoUseTransforms = true;
5352					
5353					//Panr 
5354					if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
5355						
5356						$(".portfolio-items:not(.carousel) .work-item.style-3 img").panr({
5357							scaleDuration: .28,
5358						}); 
5359						
5360						$isoUseTransforms = true;
5361						
5362					}
5363
5364
5365					//initial call to setup isotope
5366					var $layoutMode = ( $portfolio_containers[i].hasClass('masonry-items')) ? 'packery' : 'fitRows';
5367					var $startingFilter = ($portfolio_containers[i].attr('data-starting-filter') != '' && $portfolio_containers[i].attr('data-starting-filter') != 'default') ? '.' + $portfolio_containers[i].attr('data-starting-filter') : '*';
5368
5369					reLayout();
5370					
5371					$portfolio_containers[i].isotope({
5372					  resizable: false, 
5373					  itemSelector : '.element',
5374					  filter: $startingFilter,
5375					  transformsEnabled: $isoUseTransforms,
5376					  layoutMode: $layoutMode,
5377					  transitionDuration: '0.7s',
5378					  packery: {
5379						 gutter: 0
5380					  }
5381					}).isotope( 'layout' );
5382					
5383					
5384					if($startingFilter != '*'){
5385						$('.portfolio-filters ul a[data-filter="'+$startingFilter+'"], .portfolio-filters-inline ul a[data-filter="'+$startingFilter+'"]').click();
5386					}
5387
5388					//call the reLayout to get things rollin'
5389					masonryZindex();
5390					setTimeout(function(){masonryZindex(); },800);
5391					$window.resize( reLayout );
5392					$window.smartresize( function(){
5393						setTimeout(masonryZindex,700);
5394					});
5395				
5396					//fadeout the loading animation
5397					$('.portfolio-loading').stop(true,true).fadeOut(200);
5398					
5399					//fadeIn items one by one
5400					$('.portfolio-items .col').each(function(i){
5401						$(this).find('.work-item, .work-meta, .nectar-love-wrap').delay(i*90).animate({'opacity':1},450);
5402					});
5403			
5404				});
5405				
5406
5407
5408			});//each
5409			
5410		
5411
5412	}
5413
5414	masonryPortfolioInit();
5415		
5416	function reLayout() {
5417
5418		var mediaQuerySize; // = getComputedStyle(document.body, ':after').getPropertyValue('content'); 
5419		var windowSize = $window.width();
5420		var masonryObj;
5421
5422		//remove double quotes for FF
5423		//if (navigator.userAgent.match('MSIE 8') == null) {
5424		//	mediaQuerySize = mediaQuerySize.replace(/"/g, '');
5425		//}
5426		
5427		//user defined cols
5428		var userDefinedColWidth;
5429		
5430		$.each($portfolio_containers,function(i){
5431
5432			if( $portfolio_containers[i].attr('data-user-defined-cols') == 'span4') {
5433				userDefinedColWidth = 3
5434			} 
5435			
5436			else if( $portfolio_containers[i].attr('data-user-defined-cols') == 'span3') {
5437				userDefinedColWidth = 4
5438			} 
5439			
5440			var isFullWidth = $portfolio_containers[i].attr('data-col-num') == 'elastic';
5441			
5442			
5443			//chrome 33 approved method for getting column sizing
5444			if(window.innerWidth > 1600){
5445				
5446				if($portfolio_containers[i].hasClass('constrain-max-cols')) {
5447					mediaQuerySize = 'four';
5448				} else {
5449					mediaQuerySize = 'five';
5450				}
5451				
5452			} else if(window.innerWidth <= 1600 && window.innerWidth > 1300){
5453				mediaQuerySize = 'four';
5454			} else if(window.innerWidth <= 1300 && window.innerWidth > 990){
5455				
5456				if($portfolio_containers[i].hasClass('constrain-max-cols')) {
5457					mediaQuerySize = 'four';
5458				} else {
5459					mediaQuerySize = 'three';
5460				}
5461				
5462			} else if(window.innerWidth <= 990 && window.innerWidth > 470){
5463				mediaQuerySize = 'two';
5464			} else if(window.innerWidth <= 470){
5465				mediaQuerySize = 'one';
5466			}
5467			
5468			//boxed
5469			if($('#boxed').length > 0) {
5470				if(window.innerWidth > 1300){
5471					mediaQuerySize = 'four';
5472				} else if(window.innerWidth < 1300 && window.innerWidth > 990){
5473					
5474					if($portfolio_containers[i].hasClass('constrain-max-cols')) {
5475						mediaQuerySize = 'four';
5476					} else {
5477						mediaQuerySize = 'three';
5478					}
5479
5480				} else if(window.innerWidth < 990){
5481					mediaQuerySize = 'one';
5482				}
5483				
5484			}
5485			
5486			//change masonry columns depending on screen size
5487			switch (mediaQuerySize) {
5488				case 'five':
5489					(isFullWidth) ? colWidth = 5 : colWidth = userDefinedColWidth;
5490					masonryObj = { columnWidth: $portfolio_containers[i].width() / parseInt(colWidth) };
5491				break;
5492				
5493				case 'four':
5494					(isFullWidth) ? colWidth = 4 : colWidth = userDefinedColWidth;
5495
5496					masonryObj = { columnWidth: $portfolio_containers[i].width() / parseInt(colWidth) };
5497				break;
5498				
5499				case 'three':
5500					(isFullWidth) ? colWidth = 3 : colWidth = userDefinedColWidth;
5501					
5502					masonryObj = { columnWidth: $portfolio_containers[i].width() / parseInt(colWidth) };
5503				break;
5504				
5505				case 'two':
5506					masonryObj = { columnWidth: $portfolio_containers[i].width() / 2 };
5507				break;
5508				
5509				case 'one':
5510					masonryObj = { columnWidth: $portfolio_containers[i].width() / 1 };
5511				break;
5512			}
5513			
5514			//sizing for large items
5515			if( $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length > 0) {
5516
5517			//reset height for calcs
5518		    $portfolio_containers[i].find('.col.elastic-portfolio-item.regular img').css('height','auto');
5519
5520			var tallColHeight = $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible img').height();
5521			var multipler = (window.innerWidth > 470) ? 2 : 1 ;
5522			$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');
5523			 $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img').css('height',(tallColHeight*multipler));
5524			 $portfolio_containers[i].find('.col.elastic-portfolio-item.wide img, .col.elastic-portfolio-item.regular img').css('height',tallColHeight);
5525			} else {
5526				$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');
5527			}
5528
5529			//non masonry
5530			if($portfolio_containers[i].hasClass('no-masonry') && $portfolio_containers[i].find('.col.elastic-portfolio-item:first:visible').length > 0){
5531				//reset height for calcs
5532		   	   $portfolio_containers[i].find('.col.elastic-portfolio-item img').css('height','auto');
5533		   	   var tallColHeight = $portfolio_containers[i].find('.col.elastic-portfolio-item:first:visible img').height();
5534		   	   $portfolio_containers[i].find('.col.elastic-portfolio-item img').css('height',tallColHeight);
5535			}
5536
5537			$portfolio_containers[i].isotope({
5538			   packery: masonryObj
5539			}).isotope( 'layout' );
5540
5541		}); //each
5542	
5543	}
5544
5545
5546	//z-index for masonry
5547	function masonryZindex(){
5548		
5549		//escape if no browser support
5550		if($('body .portfolio-items:not(".carousel") .elastic-portfolio-item').css('left')) {
5551		
5552			var $coords = {};
5553			var $zindexRelation = {};
5554			
5555			$('body .portfolio-items:not(".carousel") .elastic-portfolio-item').each(function(){
5556				$coords[$(this).index()] = $(this).css('left').substring(0, $(this).css('left').length - 2);
5557			});
5558			
5559			var $corrdsArr = $.map($coords, function (value) { return value; });
5560			$corrdsArr = removeDuplicates($corrdsArr);
5561			$corrdsArr.sort(function(a,b){return a-b});
5562	
5563			for(var i = 0; i < $corrdsArr.length; i++){
5564				$zindexRelation[$corrdsArr[i]] = i*10; 
5565			}
5566	
5567			$.each($coords,function(k,v){
5568				
5569				var $zindex;
5570				var $coordCache = v;
5571				$.each($zindexRelation,function(k,v){
5572					if($coordCache == k) {
5573						$zindex = v;
5574					}
5575				});
5576	
5577				$('body .portfolio-items:not(".carousel") .elastic-portfolio-item:eq('+k+')').css('z-index',$zindex);
5578			});
5579			
5580		}
5581		
5582	}
5583
5584	function blogMasonryZindex(){
5585		
5586		//escape if no browser support
5587		if($('body .masonry.meta_overlaid .masonry-blog-item').css('left')) {
5588		
5589			var $coords = {};
5590			var $zindexRelation = {};
5591			
5592			$('body .masonry.meta_overlaid .masonry-blog-item').each(function(){
5593				$coords[$(this).index()] = $(this).css('left').substring(0, $(this).css('left').length - 2);
5594			});
5595			
5596			var $corrdsArr = $.map($coords, function (value) { return value; });
5597			$corrdsArr = removeDuplicates($corrdsArr);
5598			$corrdsArr.sort(function(a,b){return a-b});
5599	
5600			for(var i = 0; i < $corrdsArr.length; i++){
5601				$zindexRelation[$corrdsArr[i]] = i*10; 
5602			}
5603	
5604			$.each($coords,function(k,v){
5605				
5606				var $zindex;
5607				var $coordCache = v;
5608				$.each($zindexRelation,function(k,v){
5609					if($coordCache == k) {
5610						$zindex = v;
5611					}
5612				});
5613	
5614				$('body .masonry.meta_overlaid .masonry-blog-item:eq('+k+')').css('z-index',$zindex);
5615			});
5616			
5617		}
5618		
5619	}
5620	
5621	function matrixToArray(matrix) {
5622	    return matrix.substr(7, matrix.length - 8).split(', ');
5623	}
5624	
5625	function removeDuplicates(inputArray) {
5626        var i;
5627        var len = inputArray.length;
5628        var outputArray = [];
5629        var temp = {};
5630
5631        for (i = 0; i < len; i++) {
5632            temp[inputArray[i]] = 0;
5633        }
5634        for (i in temp) {
5635            outputArray.push(i);
5636        }
5637        return outputArray;
5638    }
5639
5640    //// filter items when filter link is clicked
5641	var clearIsoAnimation = null;
5642	var $checkForScrollBar = null;
5643
5644
5645	//number portfolios so multiple sortable ones can work easily on same page
5646	$('.portfolio-items:not(".carousel")').each(function(i){
5647		$(this).attr('instance',i);
5648		$(this).parent().parent().find('div[class^=portfolio-filters]').attr('instance',i);
5649	});
5650
5651    function isoClickFilter(){
5652		 		 
5653		 if(window.innerWidth > 690 && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
5654		 	
5655
5656		 	/*clearInterval($checkForScrollBar);
5657
5658		 	if($('html').outerHeight(true) > $(window).height()) {
5659
5660			 	$checkForScrollBar = null;
5661			 	$checkForScrollBar = setInterval(function(){ 
5662
5663			 		if($('body').height() <= $(window).height()) {
5664			 			fullWidthSections();
5665			 			$(window).trigger('resize');
5666			 			clearInterval($checkForScrollBar);
5667			 		} 
5668			 	},40);
5669			} else {
5670
5671				$checkForScrollBar = null;
5672			 	$checkForScrollBar = setInterval(function(){ 
5673
5674			 		if($('html').outerHeight(true) > $(window).height()) {
5675			 			fullWidthSections();
5676			 			$(window).trigger('resize');
5677			 			clearInterval($checkForScrollBar);
5678			 		} 
5679			 	},40);
5680			}*/	 
5681
5682			 //add css animation only for sorting	 
5683			/*  clearTimeout(clearIsoAnimation);
5684			  $('.isotope, .isotope .isotope-item').css('transition-duration','0.7s');
5685			  clearIsoAnimation = setTimeout(function(){  $('.isotope, .isotope .isotope-item').css('transition-duration','0s'); },700); */
5686			  
5687			  setTimeout(function(){masonryZindex();  },700);
5688			  
5689		 }
5690		  
5691		  var selector = $(this).attr('data-filter');
5692		  var $instance = $(this).parents('div[class^=portfolio-filters]').attr('instance');
5693		  $.each($portfolio_containers,function(i){
5694		  	if($portfolio_containers[i].attr('instance') == $instance) $portfolio_containers[i].isotope({ filter: selector });
5695		  });
5696
5697
5698		  //active classes
5699		  $(this).parent().parent().find('li a').removeClass('active');
5700		  $(this).addClass('active');
5701		  
5702		  //update pp
5703		  updatePrettyPhotoGallery();
5704
5705		  return false;
5706	}
5707
5708	////filter event
5709	$('body').on('click','.portfolio-filters ul li a, .portfolio-filters-inline ul li a', isoClickFilter);
5710
5711
5712	function updatePrettyPhotoGallery(){
5713		$('.portfolio-items').each(function(){
5714
5715			var $unique_id = Math.floor(Math.random()*10000);
5716			$('.col.isotope-item:not(.isotope-hidden) a[rel^="prettyPhoto"]').attr('rel','prettyPhoto['+$unique_id+'_sorted]');
5717		});
5718	}
5719
5720
5721
5722    function masonryBlogInit() {
5723
5724		var $posts_container = $('.posts-container')
5725		
5726		if($posts_container.parent().hasClass('masonry')) { 
5727			
5728			$posts_container.find('article').addClass('masonry-blog-item');
5729			$posts_container.find('article').prepend('<span class="bottom-line"></span>');
5730			
5731			//move the meta to the bottom
5732			$posts_container.find('article').each(function(){
5733				
5734				var $metaClone = $(this).find('.post-meta').clone();
5735
5736				$(this).find('.post-meta').remove();
5737
5738				if($('#post-area.meta_overlaid').length > 0){
5739					$(this).find('.post-header h2').after($metaClone);
5740				} else {
5741					$(this).find('.content-inner').after($metaClone);
5742				}
5743				
5744			});
5745		
5746			
5747			if($posts_container.parent().hasClass('masonry') && $posts_container.parent().hasClass('full-width-content')){
5748				$posts_container.parent().wrap('<div class="full-width-content blog-fullwidth-wrap"> </div>').removeClass('full-width-content').css({'margin-left':'0','width':'auto'});
5749				
5750				if($('.masonry.meta_overlaid').length == 0) {
5751					$posts_container.parent().parents('.full-width-content').css({
5752						'padding' : '0px 0.2% 0px 3.2%'
5753					});
5754				} else {
5755					$posts_container.parent().parents('.full-width-content').addClass('meta-overlaid');
5756					$('.container-wrap').addClass('meta_overlaid_blog');
5757				}
5758
5759				fullWidthSections(); 
5760			}
5761			
5762			var $cols = 3;
5763			var $element = $posts_container;
5764			
5765			if($posts_container.find('img').length == 0) $element = $('<img />');
5766		
5767			imagesLoaded($element,function(instance){
5768				
5769				if($('body').hasClass('mobile') || $('#post-area').hasClass('span_9')) {
5770					$cols = 2;
5771				}
5772
5773				$cols = blogColumnNumbCalcs;
5774				blogHeightCalcs($posts_container);
5775
5776				if($('#post-area.meta_overlaid').length > 0) {
5777					$posts_container.isotope({
5778					   itemSelector: 'article',
5779					   transitionDuration: '0.7s',
5780					   layoutMode: 'packery',
5781					   packery: { 
5782					   	 gutter: 0,
5783					   	 columnWidth: $('#post-area').width() / $cols 
5784					   	}
5785					}).isotope( 'layout' );
5786
5787				   
5788				} else {
5789					$multiplier = ($('.span_9.masonry').length == 0) ? .02: .04;
5790					$posts_container.isotope({
5791					   itemSelector: 'article',
5792					   transitionDuration: '0.7s',
5793					   layoutMode: 'packery',
5794					   packery: { 
5795					   	 gutter: $('#post-area').width()*$multiplier,
5796					   	 columnWidth: $('#post-area').width() / $cols 
5797					   	}
5798					}).isotope( 'layout' );
5799				}
5800
5801				setTimeout(function(){ $posts_container.parent().animate({'opacity': 1},1300); },200);
5802				
5803				$(window).trigger('resize');
5804
5805				blogMasonryZindex();
5806				setTimeout(blogMasonryZindex,700);
5807				$window.smartresize( function(){
5808					setTimeout(blogMasonryZindex,700);
5809				});
5810					
5811			});
5812			
5813			$(window).resize(function(){
5814				
5815
5816			   //size all items in grid 
5817			   //sizing for large items
5818			    $cols = blogColumnNumbCalcs;
5819				blogHeightCalcs($posts_container);
5820			});
5821			
5822			$(window).smartresize(function(){
5823				if($('#post-area.meta_overlaid').length > 0) {
5824				
5825				    $posts_container.isotope({
5826				      layoutMode: 'packery',
5827				      packery: { 
5828				      	columnWidth: $('#post-area').width() / $cols
5829				      }
5830				   });
5831				} else {
5832					
5833				   $multiplier = ($('.span_9.masonry').length == 0) ? .02: .04;
5834				   $posts_container.isotope({
5835				   	layoutMode: 'packery',
5836				      packery: { 
5837				      	gutter: $('#post-area').width()*$multiplier,
5838				      	columnWidth: $('#post-area').width() / $cols
5839				      }
5840				   });
5841				}
5842			});
5843			
5844	    }	
5845
5846	}
5847	
5848	masonryBlogInit();
5849
5850	function blogHeightCalcs($posts_container) {
5851		if( $posts_container.parent().hasClass('meta_overlaid') && $posts_container.find('article[class*="regular"]').length > 0) {
5852			   //reset height for calcs
5853
5854			   $posts_container.find('article[class*="regular"] img').css('height','auto');
5855
5856			   var tallColHeight = Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote"):first img').height());
5857			   var multipler = (window.innerWidth > 470) ? 2 : 1 ;
5858			   $posts_container.find('article[class*="tall"] img, .article.wide img, article.regular img').removeClass('auto-height');
5859			   $posts_container.find('article[class*="tall"] img').css('height',(tallColHeight*multipler));
5860			   $posts_container.find('article[class*="regular"] img').css('height',(tallColHeight));
5861			   //quote/links
5862			   $posts_container.find('article.regular.format-link,article.regular.format-quote').each(function(){
5863
5864			   		if(window.innerWidth > 470) {
5865			   			$(this).css({
5866			  	 			'height': tallColHeight
5867			   			});
5868			   		} else {
5869			   			$(this).css({
5870			  	 			'height': 'auto'
5871			   			});			 		
5872			   		}
5873			  	 	
5874			   	});
5875
5876			} else {
5877				$posts_container.find('article[class*="tall"] img, article.regular img').addClass('auto-height');
5878			}
5879	}
5880
5881	function blogColumnNumbCalcs(){
5882		   if($('body').hasClass('mobile') && window.innerWidth < 990 || $('#post-area').hasClass('span_9') && $('#post-area.meta_overlaid').length == 0) {
5883			   $cols = 2;
5884		   } else if( $('#post-area').hasClass('full-width-content') || $('#post-area').parent().hasClass('full-width-content') && $('#boxed').length == 0 || $('#post-area.meta_overlaid').length > 0 ){
5885		   		
5886		   		var mediaQuerySize; //= getComputedStyle(document.body, ':after').getPropertyValue('content'); 
5887				var windowSize = $(window).width();
5888
5889				
5890				if(window.innerWidth > 1600){
5891					mediaQuerySize = ($('#post-area.meta_overlaid').length > 0) ? 'four' :'five';
5892				} else if(window.innerWidth <= 1600 && window.innerWidth >= 1300){
5893					mediaQuerySize = 'four';
5894				} else if(window.innerWidth < 1300 && window.innerWidth >= 990){
5895					mediaQuerySize = ($('#post-area.meta_overlaid').length > 0) ? 'four' :'three';
5896				} else if(window.innerWidth < 990 && window.innerWidth >= 470){
5897					mediaQuerySize = 'two';
5898				} else if(window.innerWidth < 470){
5899					mediaQuerySize = ($('#post-area.meta_overlaid').length > 0) ? 'two' :'one';
5900				}
5901				
5902				
5903				//boxed
5904				if($('#boxed').length > 0) {
5905					if(window.innerWidth > 1300){
5906						mediaQuerySize = 'four';
5907					} else if(window.innerWidth < 1300 && window.innerWidth > 990){
5908						mediaQuerySize = ($('#post-area.meta_overlaid').length > 0) ? 'four' :'three';
5909					} else if(window.innerWidth < 990){
5910						mediaQuerySize = ($('#post-area.meta_overlaid').length > 0) ? 'two' :'one';
5911					}
5912					
5913				}
5914				
5915				
5916				switch (mediaQuerySize) {
5917					case 'five':
5918						$cols = 5;
5919					break;
5920					
5921					case 'four':
5922						$cols = 4;
5923					break;
5924					
5925					case 'three':
5926						$cols = 3;
5927					break;
5928					
5929					case 'two':
5930						$cols = 2;
5931					break;
5932					
5933					case 'one':
5934						$cols = 1;
5935					break;
5936				}
5937		   		
5938			
5939		   } else {
5940
5941		   	   $cols = 3;
5942		   }
5943
5944		   return $cols;
5945
5946	}
5947
5948
5949
5950
5951
5952
5953var shrinkNum = 6;
5954		
5955if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num');
5956
5957headerPadding2 = headerPadding - headerPadding/1.8;
5958
5959$('body').on('click','.section-down-arrow',function(){
5960		
5961	var $currentSection = $(this).parents('#page-header-bg');
5962	var $topDistance = $currentSection.attr('data-height');
5963	var $offset = ($currentSection.parents('.first-section').length == 0 || $('body[data-transparent-header="false"]').length > 0) ? $currentSection.offset().top : 0;
5964
5965	if(!$('body').hasClass('mobile')){
5966		$('body,html').stop().animate({
5967			scrollTop: parseInt($topDistance - $('#header-space').height()) + parseInt(shrinkNum) + headerPadding2*2 + 3 + $offset
5968		},1000,'easeInOutCubic')
5969	} else {
5970		$('body,html').stop().animate({
5971			scrollTop: parseInt($topDistance) + parseInt($currentSection.offset().top) + 2
5972		},1000,'easeInOutCubic')
5973	}
5974	return false;
5975});
5976
5977
5978
5979
5980
5981
5982
5983/*-------------------------------------------------------------------------*/
5984/*	7.	Cross Browser Fixes
5985/*-------------------------------------------------------------------------*/	
5986	 
5987	 function crossBrowserFixes() {
5988
5989		//Fix current class in menu 
5990		if ($("body").hasClass("single-portfolio") || $('body').hasClass("error404") || $('body').hasClass("search-results")) {   
5991			$("li").removeClass("current_page_parent").removeClass("current-menu-ancestor").removeClass('current_page_ancestor');   
5992		}
5993		
5994
5995		//fix for IE8 nth-child
5996		$('.recent_projects_widget div a:nth-child(3n+3), #sidebar #flickr div:nth-child(3n+3) a, #footer-outer #flickr div:nth-child(3n+3) a').css('margin-right','0px');
5997		
5998		//remove br's from code tag
5999		$('code').find('br').remove();	
6000		
6001		//if a clear is the last div, remove the padding
6002		if($('.container.main-content > .row > div:last-child').hasClass('clear')) {
6003			$('.container.main-content > .row > div:last-child').css('padding-bottom','0');
6004		}
6005		
6006		//homepage recent blog for IE8
6007		$('.container-wrap .blog-recent > div:last-child').addClass('col_last');
6008		
6009		//blog ascend bottom padding
6010		if($('.single .blog_next_prev_buttons').length > 0) $('.container-wrap').css('padding-bottom',0);
6011
6012		//contact form
6013		$('.wpcf7-form p:has(input[type=submit])').css('padding-bottom','0px');
6014
6015		$('.full-width-content .wpcf7-submit').on('click',function(){ setTimeout(function(){ fullWidthContentColumns() },1000); setTimeout(function(){ fullWidthContentColumns() },2000); });
6016		
6017		//no caption home slider fix
6018		$('#featured article').each(function(){
6019			if($(this).find('h2').attr('data-has-caption') == '0') {
6020				$(this).parents('.slide').addClass('no-caption');
6021			}
6022		});
6023		
6024		//gravity form inside fw content row
6025		$('.gform_body').click(function(){
6026		   setTimeout(function(){ fullWidthContentColumns(); },200);
6027		 });
6028
6029		//chat post format nth child color
6030		$('article.post.format-chat .content-inner dt:odd').css('color','#333');
6031		
6032		//remove margin on last cols inside of full width sections 
6033		$('.full-width-section').each(function(){
6034			$(this).find('> .span_12 > div.col_last').last().css('margin-bottom','0');
6035		});
6036		
6037		//remove p tags from extra content editor when warpping only an img 
6038		$('#portfolio-extra p').each(function(){
6039			if($(this).find('*').length == 1 && $(this).find('img').length == 1) {
6040				$(this).find('img').unwrap();
6041			}
6042		});
6043	
6044
6045		//vc text_separator color
6046		$('.vc_text_separator').each(function(){
6047			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'));
6048		});
6049		
6050		//carousel head button alignment  
6051		$('.carousel-heading').each(function(){
6052			if($(this).find('h2').length > 0) $(this).find('.carousel-prev, .carousel-next').css('top','7px');
6053		});
6054		
6055		//remove carousel heading if not being used
6056		$('.carousel-wrap').each(function(){
6057			if($(this).find('.carousel-heading .container:empty').length > 0) $(this).find('.carousel-heading').remove();
6058		});
6059		
6060		//woocommerce product thuimbnails
6061		$('.woocommerce div.product div.images div.thumbnails a:nth-child(4n+4)').css('margin-right','0px');
6062		
6063		//remove extra galleries when using the nectar gallery slider on projects and posts
6064		$('article.post .gallery-slider .gallery,  article.post .gallery-slider .jetpack-sli
6064deshow, .single-portfolio .gallery-slider .gallery, .single-portfolio .gallery-slider .jetpack-slideshow').remove();
6065		
6066		
6067		$('.woocommerce .span_9 .products.related .products li:nth-child(4), .woocommerce .span_9 .products.upsells .products li:nth-child(4)').remove();
6068		$('.woocommerce .span_9 .products.related .products li:nth-child(3), .woocommerce .span_9 .products.upsells .products li:nth-child(3)').css('margin-right','0');	
6069		
6070		$('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy');
6071
6072		//clients no hover if no link
6073		$('div.clients').each(function(){
6074			$(this).find('> div').each(function(){
6075				if($(this).find('a').length == 0) {
6076					$(this).addClass('no-link');
6077				}
6078			});
6079		});
6080
6081		//remove ajaxy from single posts when using disqus
6082		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');
6083
6084		//blog next color bg only 
6085		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();
6086		
6087		if($('#single-below-header').hasClass('fullscreen-header') && $('.blog_next_prev_buttons').length == 0 ) $('#author-bio, .comment-wrap').addClass('lighter-grey');
6088
6089		//shop header parallax margin 
6090		if($('body.woocommerce').find('#page-header-bg').length > 0){
6091			$('.container-wrap').css({'margin-top':'0px','padding-top':'30px'});
6092		}
6093
6094		//remove arrows on mega menu item
6095		$('header#top nav .megamenu .sub-menu a.sf-with-ul .sf-sub-indicator').remove();
6096		
6097		//if using wooCommerce sitewide notice
6098		if($('.demo_store').length > 0) $('#header-outer, #header-space').css('margin-top','32px');
6099		
6100		//footer last column class for IE8
6101		$('#footer-widgets .container .row > div:last-child').addClass('col_last');
6102		
6103		//nectar slider external links
6104		$('.swiper-slide.external-button-1 .buttons > div:nth-child(1) a').attr('target','_blank');
6105		$('.swiper-slide.external-button-2 .buttons > div:nth-child(2) a').attr('target','_blank');
6106		
6107		//portfolio external links
6108		$(".portfolio-items a[href*='http://']:not([href*='"+window.location.hostname+"']), .recent_projects_widget a[href*='http://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank"); 
6109		
6110		//remove excess inner content when empty row
6111		$('.container-wrap .row > .wpb_row').each(function(){
6112			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();
6113		});
6114		
6115		//remove boxed style from full width content
6116		$('.full-width-content .col.boxed').removeClass('boxed');
6117		
6118		//remove full width attribute on slider in full width content section
6119		$('.full-width-content .wpb_column .nectar-slider-wrap[data-full-width="true"]').attr('data-full-width','false');	
6120
6121		if( $('.nectar-slider-wrap.first-section').length == 0 && 
6122			$('.full-width-section.first-section > .span_12 > .vc_span12 > .wpb_wrapper > .nectar-slider-wrap').length == 0  && 
6123			$('.parallax_slider_outer.first-section').length == 0 && 
6124			$('.full-width-content.first-section .wpb_wrapper > .nectar-slider-wrap').length == 0  && 
6125			!($('.wpb_row.first-section > .nectar-parallax-scene').length == 1 && $('#header-outer[data-transparent-header="true"]').length == 1) ) { 
6126			$('#header-outer .ns-loading-cover').remove(); 
6127	    }
6128
6129	    //portfolio description remove on hover
6130	    var $tmpTitle = null;
6131	    $('.portfolio-items > .col a[title]').hover(function(){
6132	    	$tmpTitle = $(this).attr('title');
6133	    	$(this).attr('title',' ');
6134	    },function(){
6135	    	$(this).attr('title', $tmpTitle);
6136	    });
6137	    $('.portfolio-items > .col a[title]').click(function(){
6138			$(this).attr('title', $tmpTitle);
6139	    });
6140
6141	};
6142
6143	crossBrowserFixes();
6144
6145
6146
6147
6148	function wooPriceSlider(){
6149
6150
6151		// woocommerce_price_slider_params is required to continue, ensure the object exists
6152		if ( typeof woocommerce_price_slider_params === 'undefined' || !$('body').hasClass('woocommerce') ) {
6153			return false;
6154		}
6155
6156		// Get markup ready for slider
6157		$( 'input#min_price, input#max_price' ).hide();
6158		$( '.price_slider, .price_label' ).show();
6159
6160		// Price slider uses jquery ui
6161		var min_price = $( '.price_slider_amount #min_price' ).data( 'min' ),
6162			max_price = $( '.price_slider_amount #max_price' ).data( 'max' );
6163
6164		current_min_price = parseInt( min_price, 10 );
6165		current_max_price = parseInt( max_price, 10 );
6166
6167		if ( woocommerce_price_slider_params.min_price ) current_min_price = parseInt( woocommerce_price_slider_params.min_price, 10 );
6168		if ( woocommerce_price_slider_params.max_price ) current_max_price = parseInt( woocommerce_price_slider_params.max_price, 10 );
6169
6170		$( 'body' ).bind( 'price_slider_create price_slider_slide', function( event, min, max ) {
6171			if ( woocommerce_price_slider_params.currency_pos === 'left' ) {
6172
6173				$( '.price_slider_amount span.from' ).html( woocommerce_price_slider_params.currency_symbol + min );
6174				$( '.price_slider_amount span.to' ).html( woocommerce_price_slider_params.currency_symbol + max );
6175
6176			} else if ( woocommerce_price_slider_params.currency_pos === 'left_space' ) {
6177
6178				$( '.price_slider_amount span.from' ).html( woocommerce_price_slider_params.currency_symbol + " " + min );
6179				$( '.price_slider_amount span.to' ).html( woocommerce_price_slider_params.currency_symbol + " " + max );
6180
6181			} else if ( woocommerce_price_slider_params.currency_pos === 'right' ) {
6182
6183				$( '.price_slider_amount span.from' ).html( min + woocommerce_price_slider_params.currency_symbol );
6184				$( '.price_slider_amount span.to' ).html( max + woocommerce_price_slider_params.currency_symbol );
6185
6186			} else if ( woocommerce_price_slider_params.currency_pos === 'right_space' ) {
6187
6188				$( '.price_slider_amount span.from' ).html( min + " " + woocommerce_price_slider_params.currency_symbol );
6189				$( '.price_slider_amount span.to' ).html( max + " " + woocommerce_price_slider_params.currency_symbol );
6190
6191			}
6192
6193			$( 'body' ).trigger( 'price_slider_updated', min, max );
6194		});
6195
6196		$( '.price_slider' ).slider({
6197			range: true,
6198			animate: true,
6199			min: min_price,
6200			max: max_price,
6201			values: [ current_min_price, current_max_price ],
6202			create : function( event, ui ) {
6203
6204				$( '.price_slider_amount #min_price' ).val( current_min_price );
6205				$( '.price_slider_amount #max_price' ).val( current_max_price );
6206
6207				$( 'body' ).trigger( 'price_slider_create', [ current_min_price, current_max_price ] );
6208			},
6209			slide: function( event, ui ) {
6210
6211				$( 'input#min_price' ).val( ui.values[0] );
6212				$( 'input#max_price' ).val( ui.values[1] );
6213
6214				$( 'body' ).trigger( 'price_slider_slide', [ ui.values[0], ui.values[1] ] );
6215			},
6216			change: function( event, ui ) {
6217
6218				$( 'body' ).trigger( 'price_slider_change', [ ui.values[0], ui.values[1] ] );
6219
6220			},
6221		});
6222
6223	}
6224	
6225
6226//vc col mobile fixes
6227function vcMobileColumns() {
6228	$('.wpb_row').each(function(){
6229		var $firstChildOffset = $(this).find('[class*="vc_col-"]').first().offset().left;
6230		$(this).find('[class*="vc_col-"]').each(function(){
6231			if($(this).offset().left < $firstChildOffset + 15) { 
6232				$(this).addClass('no-left-margin');
6233			} else {
6234				$(this).removeClass('no-left-margin');
6235			}
6236		});
6237	});
6238}
6239
6240if($('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) vcMobileColumns();
6241
6242
6243	
6244
6245
6246
6247
6248	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 ) {
6249
6250		$('#ajax-content-wrap').ajaxify({
6251			'selector':'#ajax-content-wrap a:not(.no-ajaxy):not([target="_blank"]):not([href^="#"]):not(.comment-edit-link):not(#cancel-comment-reply-link):not(.comment-reply-link):not(#toggle-nav):not(.cart_list a):not(.logged-in-as a):not(.no-widget-added a):not(.add_to_cart_button):not(.product-wrap a):not(.section-down-arrow):not([data-filter]):not(.product_list_widget a):not(.pp):not([rel^="prettyPhoto"]):not(.pretty_photo), #header-outer li:not(.no-ajaxy) > a:not(.no-ajaxy), #header-outer #logo',
6252			'verbosity': 0, 
6253			requestDelay: 400,
6254			previewoff : true,
6255			memoryoff: true,
6256			turbo : false
6257		});
6258
6259		$(window).on("pronto.render", initPage)
6260		.on("pronto.load", destroyPage)
6261		.on("pronto.request", transitionPage);
6262
6263		initPage();
6264
6265	} else if($('body[data-ajax-transitions="true"]').length > 0 && $('#ajax-loading-screen[data-method="standard"]').length > 0 ) {
6266		
6267		//fadeout loading animation
6268		setTimeout(function(){ $('#ajax-loading-screen').stop().animate({'opacity':0},1000,function(){ $(this).css({'display':'none'}); }); $('#ajax-loading-screen .loading-icon').animate({'opacity':0},1000) },200);
6269
6270		//safari back/prev fix
6271		if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
6272			window.onunload = function(){ $('#ajax-loading-screen').stop().animate({'opacity':0},1000,function(){ $(this).css({'display':'none'}); }); $('#ajax-loading-screen .loading-icon').animate({'opacity':0},1000) };
6273		}
6274
6275		//remove excess loading images now
6276		$('.portfolio-loading, .nectar-slider-loading .loading-icon').remove();
6277
6278		$('a[href]:not(.no-ajaxy):not([target="_blank"]):not([href^="#"]):not(.comment-edit-link):not(.comments-link):not(#cancel-comment-reply-link):not(.comment-reply-link):not(#toggle-nav):not(.logged-in-as a):not(.add_to_cart_button):not(.section-down-arrow):not([data-filter]):not(.pp):not
6278([rel^="prettyPhoto"]):not(.pretty_photo)').click(function(e){
6279			
6280
6281			if($(this).parent().hasClass('no-ajaxy').length == 0) {
6282
6283				var $targetLocation = $(this).attr('href');
6284				var $timeOutDur = ($(window).scrollTop() > 0) ? 600 : 200;
6285				if($targetLocation != '') {
6286
6287					transitionPage();
6288
6289					setTimeout(function(){
6290						window.location = $targetLocation;
6291					},$timeOutDur)
6292
6293					return false;
6294				}
6295			}
6296
6297		});
6298	}
6299
6300
6301	function transitionPage(e) {
6302		
6303
6304		if($(window).scrollTop() > 0) {
6305
6306			//stop nicescroll
6307			if($().niceScroll && $("html").getNiceScroll()){
6308				var nice = $("html").getNiceScroll();
6309				nice.stop();
6310			}
6311			
6312			$('body,html').stop(true,true).animate({
6313				scrollTop:0
6314			},500,'easeOutQuad',function(){ 
6315				$('#ajax-loading-screen').css({'opacity':'1', 'display':'none'});
6316				$('#ajax-loading-screen').stop(true,true).fadeIn(600,function(){
6317					$('#ajax-loading-screen .loading-icon').animate({'opacity':1},400);
6318					//close widget area
6319					setTimeout(function(){  if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');  },400);
6320				});
6321			});
6322
6323		} else {
6324			$('#ajax-loading-screen').css('opacity','1').stop().fadeIn(600,function(){
6325				$('#ajax-loading-screen .loading-icon').animate({'opacity':1},400);
6326			});
6327
6328			//close widget area
6329			setTimeout(function(){  if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');  },400);
6330		}
6331
6332		
6333	}
6334
6335	function destroyPage(e) {
6336		$(window).off('scroll.appear');
6337	}
6338
6339	function initPage(e) {
6340
6341		if(!$('body').hasClass('ajax-loaded')) return false;
6342
6343
6344		//init js
6345		prettyPhotoInit();
6346		addOrRemoveSF();
6347		$(".sf-menu").superfish('destroy');
6348		$('#header-outer').removeClass('dark-slide');
6349		initSF();
6350		SFArrows();
6351		headerInit();
6352		videoSlidePos();
6353		controlsInit();
6354		coloredButtons();
6355		columnHoverBG();
6356		fwCarouselLinkFix();
6357		standardCarouselInit();
6358		productCarouselInit();
6359		clientsCarouselInit();
6360		carouselHeightCalcs();
6361		flexsliderInit();
6362		progressBars();
6363		milestoneInit();
6364		accordionInit();
6365		tabbedInit();
6366		tabbbedDeepLinking();
6367		accordionDeepLinking();
6368		ulChecks();
6369		oneFourthClasses();
6370		carouselfGrabbingClass();
6371		clientsFadeIn();
6372		fullWidthSections();
6373		fwsClasses();
6374		fullwidthImgOnlySizingInit();
6375		fullwidthImgOnlySizing();
6376		fullWidthRowPaddingAdjustInit();
6377		fullWidthRowPaddingAdjustCalc();
6378		setTimeout(function(){ 
6379		   colAndImgAnimations();
6380		},100); 
6381		if($('body[data-animated-anchors="true"]').length > 0) setTimeout(scrollSpyInit,200);
6382	    nectar_fancy_ul_init();
6383		socialSharingInit();
6384		pricingTableHeight();
6385		createTestimonialControls();
6386		testimonialSliderHeight(); 
6387		largeIconHover();
6388
6389		responsiveVideoIframesInit();
6390		responsiveVideoIframes();
6391		fullWidthContentColumns();
6392		videoBGInit();
6393		$window.unbind('scroll.parallaxSections').unbind('resize.parallaxSections');
6394		parallaxScrollInit();
6395		masonryBlogInit();
6396		masonryPortfolioInit();
6397		portfolioAccentColor();
6398		portfolioHoverEffects();
6399		portfolioFiltersInit();
6400		isotopeCatSelection();
6401		$(window).unbind('.infscr');
6402		infiniteScrollInit();
6403		toTopBind();
6404		centerLove();
6405		postNextButtonEffect();
6406		headerRowColorInheritInit();
6407		pageLoadHash();
6408		slideOutWidgetAreaScrolling();
6409
6410		//cf7
6411		if($().wpcf7InitForm) $('div.wpcf7 > form').wpcf7InitForm();
6412
6413		//woocommerce price slider
6414		wooPriceSlider();
6415
6416		//twitter widget 
6417		if(typeof twttr != 'undefined') { twttr.widgets.load(); }
6418
6419		//Calendarize.it
6420		if(typeof init_rhc === 'function') { init_rhc(); }
6421
6422		//unwrap post and protfolio videos
6423		$('.video-wrap iframe').unwrap();
6424		$('#sidebar iframe[src]').unwrap();
6425
6426		$('video:not(.slider-video)').attr('width','100%');
6427		$('video:not(.slider-video)').attr('height','100%'); 
6428
6429		$('.wp-video-shortcode.mejs-container').each(function(){
6430			$(this).attr('data-aspectRatio', parseInt($(this).css('height')) / parseInt($(this).css('width')));
6431		});
6432
6433		//mediaElement
6434		$('video.wp-media-shortcode-ajax, audio.wp-media-shortcode-ajax').each(function(){ 
6435			if(!$(this).parent().hasClass('mejs-mediaelement') && $().mediaelementplayer) {
6436				$(this).mediaelementplayer();  
6437			}
6438		});
6439
6440		$('.mejs-container').css({'height': '100%', 'width': '100%'});
6441		
6442		$('audio').attr('width','100%');
6443		$('audio').attr('height','100%');
6444
6445		$('audio').css('visibility','visible');
6446
6447		if($('body').hasClass('mobile')){
6448			$('video').css('visibility','hidden');
6449		} else {
6450			$('video').css('visibility','visible');
6451		}
6452
6453		$('.wpb_row:has(".nectar-video-wrap")').each(function(i){
6454			$(this).css('z-index',100 + i);
6455		});
6456
6457		showLateIframes();
6458
6459		mouseParallaxInit();
6460
6461		//chrome self hosted slider bg video correct
6462		 if(navigator.userAgent.indexOf('Chrome') > 0) { 
6463		 	$('.swiper-wrapper .video-wrap').each(function(i){
6464			  	var webmSource = jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
6465	          	var firstVideo = jQuery(this).find('video').get(0);
6466	          	firstVideo.src = webmSource;
6467	          	firstVideo.load();
6468            });
6469	    }
6470
6471
6472		if($('.nectar-video-bg').length > 0) {
6473			setTimeout(function(){
6474			    	resizeVideoToCover();
6475			    	$('.video-color-overlay').each(function(){
6476			    		$(this).css('background-color',$(this).attr('data-color'));
6477			    	});
6478			    	$('.nectar-video-wrap').animate({'opacity':'1'},800,'easeInOutExpo');
6479			    	$('.video-color-overlay').animate({'opacity':'0.7'},800,'easeInOutExpo');
6480			    	
6481			    },400);
6482		}
6483
6484		
6485		nectarPageHeader();
6486	
6487
6488		if( $('#featured').length > 0){
6489			
6490			customSliderHeight();
6491			homeSliderInit2();
6492			$(window).off('scroll.hsps');
6493			$(window).on('scroll.hsps',homeSliderParallaxScroll);
6494			$(window).off('resize.hsps');
6495			$(window).on('resize.hsps',homeSliderMobile);
6496			
6497		}
6498
6499		//cart dropdown
6500		$('#header-outer div.cart-outer').hoverIntent(function(){
6501			$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(400);
6502			$('#header-outer .cart_list').stop(true,true).fadeIn(400);
6503			clearTimeout(timeout);
6504			$('#header-outer .cart-notification').fadeOut(300);
6505		});
6506
6507
6508		//remove excess loading images now
6509		$('.portfolio-loading, .nectar-slider-loading .loading-icon').remove();
6510
6511		setTimeout(portfolioSidebarFollow,250);
6512		setTimeout(portfolioSidebarFollow,500);
6513		setTimeout(portfolioSidebarFollow,1000);
6514
6515		crossBrowserFixes();
6516
6517
6518		$(window).trigger('resize');
6519
6520		//fix admin bar
6521		$("#wpadminbar").show();	
6522
6523
6524		//close widget area
6525		if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click'); 
6526
6527		//fade in page
6528		setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0}); }); closeSearch();  },200);
6529		setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0}); }); closeSearch(); },900);
6530	} 
6531
6532
6533
6534
6535
6536
6537
6538/*
6539 * jQuery Textarea Characters Counter Plugin v 2.0
6540 * Examples and documentation at: http://roy-jin.appspot.com/jsp/textareaCounter.jsp
6541 * Copyright (c) 2010 Roy Jin
6542 * Version: 2.0 (11-JUN-2010)
6543 * Dual licensed under the MIT and GPL licenses:
6544 * http://www.opensource.org/licenses/mit-license.php
6545 * http://www.gnu.org/licenses/gpl.html
6546 * Requires: jQuery v1.4.2 or later
6547 */
6548(function($){
6549	if(!$.fn.textareaCount) { 
6550		$.fn.textareaCount = function(options, fn) {
6551	        var defaults = {
6552				maxCharacterSize: -1,
6553				originalStyle: 'originalTextareaInfo',
6554				warningStyle: 'warningTextareaInfo',
6555				warningNumber: 20,
6556				displayFormat: '#input characters | #words words'
6557			};
6558
6559			var options = $.extend(defaults, options);
6560
6561			var container = $(this);
6562
6563			$("<div class='charleft'>&nbsp;</div>").insertAfter(container);
6564
6565
6566			//create charleft css
6567			var charLeftCss = {
6568				'width' : container.width()
6569			};
6570
6571			var charLeftInfo = getNextCharLeftInformation(container);
6572			charLeftInfo.addClass(options.originalStyle);
6573			//charLeftInfo.css(charLeftCss);
6574
6575
6576			var numInput = 0;
6577			var maxCharacters = options.maxCharacterSize;
6578			var numLeft = 0;
6579			var numWords = 0;
6580
6581			container.bind('keyup', function(event){limitTextAreaByCharacterCount();})
6582					 .bind('mouseover', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);})
6583					 .bind('paste', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);});
6584
6585	        limitTextAreaByCharacterCount();
6586
6587			function limitTextAreaByCharacterCount(){
6588				charLeftInfo.html(countByCharacters());
6589
6590				//function call back
6591				if(typeof fn != 'undefined'){
6592					fn.call(this, getInfo());
6593				}
6594				return true;
6595			}
6596
6597			function countByCharacters(){
6598				var content = container.val();
6599				var contentLength = content.length;
6600				//Start Cut
6601				if(options.maxCharacterSize > 0){
6602					//If copied content is already more than maxCharacterSize, chop it to maxCharacterSize.
6603					if(contentLength >= options.maxCharacterSize) {
6604						content = content.substring(0, options.maxCharacterSize);
6605					}
6606
6607					var newlineCount = getNewlineCount(content);
6608
6609					// newlineCount new line character. For windows, it occupies 2 characters
6610					var systemmaxCharacterSize = options.maxCharacterSize - newlineCount;
6611					if (!isWin()){
6612						 systemmaxCharacterSize = options.maxCharacterSize
6613					}
6614					if(contentLength > systemmaxCharacterSize){
6615						//avoid scroll bar moving
6616						var originalScrollTopPosition = this.scrollTop;
6617						container.val(content.substring(0, systemmaxCharacterSize));
6618						this.scrollTop = originalScrollTopPosition;
6619					}
6620					charLeftInfo.removeClass(options.warningStyle);
6621					if(systemmaxCharacterSize - contentLength <= options.warningNumber){
6622						charLeftInfo.addClass(options.warningStyle);
6623					}
6624
6625					numInput = container.val().length + newlineCount;
6626					if(!isWin()){
6627						numInput = container.val().length;
6628					}
6629
6630					numWords = countWord(getCleanedWordString(container.val()));
6631
6632					numLeft = maxCharacters - numInput;
6633				} else {
6634					//normal count, no cut
6635					var newlineCount = getNewlineCount(content);
6636					numInput = container.val().length + newlineCount;
6637					if(!isWin()){
6638						numInput = container.val().length;
6639					}
6640					numWords = countWord(getCleanedWordString(container.val()));
6641				}
6642
6643				return formatDisplayInfo();
6644			}
6645
6646			function formatDisplayInfo(){
6647				var format = options.displayFormat;
6648				format = format.replace('#input', numInput);
6649				format = format.replace('#words', numWords);
6650				//When maxCharacters <= 0, #max, #left cannot be substituted.
6651				if(maxCharacters > 0){
6652					format = format.replace('#max', maxCharacters);
6653					format = format.replace('#left', numLeft);
6654				}
6655				return format;
6656			}
6657
6658			function getInfo(){
6659				var info = {
6660					input: numInput,
6661					max: maxCharacters,
6662					left: numLeft,
6663					words: numWords
6664				};
6665				return info;
6666			}
6667
6668			function getNextCharLeftInformation(container){
6669					return container.next('.charleft');
6670			}
6671
6672			function isWin(){
6673				var strOS = navigator.appVersion;
6674				if (strOS.toLowerCase().indexOf('win') != -1){
6675					return true;
6676				}
6677				return false;
6678			}
6679
6680			function getNewlineCount(content){
6681				var newlineCount = 0;
6682				for(var i=0; i<content.length;i++){
6683					if(content.charAt(i) == '\n'){
6684						newlineCount++;
6685					}
6686				}
6687				return newlineCount;
6688			}
6689
6690			function getCleanedWordString(content){
6691				var fullStr = content + " ";
6692				var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
6693				var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "");
6694				var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
6695				var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " ");
6696				var splitString = cleanedStr.split(" ");
6697				return splitString;
6698			}
6699
6700			function countWord(cleanedWordString){
6701				var word_count = cleanedWordString.length-1;
6702				return word_count;
6703			}
6704		};
6705	}
6706})(jQuery);	
6707	
6708	
6709	
6710	
6711});
6712
6713
6714
6715function resizeIframe() {
6716	var element = document.getElementById("pp_full_res").getElementsByTagName("iframe");
6717	var height = element[0].contentWindow.document.body.scrollHeight;
6718    
6719    //iframe height
6720    element[0].style.height = height + 'px';
6721	
6722	//pp height
6723	document.getElementsByClassName("pp_content_container")[0].style.height = height+40+ 'px';
6724	document.getElementsByClassName("pp_content")[0].style.height = height+40+ 'px';
6725	
6726}
6727
6728
6729//don't load if mobile
6730if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) && typeof window['TweenMax'] !== 'function' ){
6731		
6732	/*!
6733	 * VERSION: 1.11.5
6734	 * DATE: 2014-02-20
6735	 * UPDATES AND DOCS AT: http://www.greensock.com
6736	 * 
6737	 * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
6738	 *
6739	 * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
6740	 * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
6741	 * Club GreenSock members, the software agreement that was issued with your membership.
6742	 * 
6743	 * @author: Jack Doyle, [email protected]
6744	 **/
6745	(window._gsQueue||(window._gsQueue=[])).push(function(){"use strict";window._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var s=[].slice,r=function(t,e,s){i.call(this,t,e,s),this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._dirty=!0,this.render=r.prototype.render},n=1e-10,a=i._internals.isSelector,o=i._internals.isArray,h=r.prototype=i.to({},.1,{}),l=[];r.version="1.11.5",h.constructor=r,h.kill()._gc=!1,r.killTweensOf=r.killDelayedCallsTo=i.killTweensOf,r.getTweensOf=i.getTweensOf,r.ticker=i.ticker,h.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),i.prototype.invalidate.call(this)},h.updateTo=function(t,e){var s,r=this.ratio;e&&this._startTime<this._timeline._time&&(this._startTime=this._timeline._time,this._uncache(!1),this._gc?this._enabled(!0,!1):this._timeline.insert(this,this._startTime-this._delay));for(s in t)this.vars[s]=t[s];if(this._initted)if(e)this._initted=!1;else if(this._gc&&this._enabled(!0,!1),this._notifyPluginsOfEnabled&&this._firstPT&&i._onPluginEvent("_onDisable",this),this._time/this._duration>.998){var n=this._time;this.render(0,!0,!1),this._initted=!1,this.render(n,!0,!1)}else if(this._time>0){this._initted=!1,this._init();for(var a,o=1/(1-r),h=this._firstPT;h;)a=h.s+h.c,h.c*=o,h.s=a-h.c,h=h._next}return this},h.render=function(t,e,i){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var s,r,a,o,h,_,u,p,c=this._dirty?this.totalDuration():this._totalDuration,f=this._time,m=this._totalTime,d=this._cycle,g=this._duration;if(t>=c?(this._totalTime=c,this._cycle=this._repeat,this._yoyo&&0!==(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=g,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(s=!0,r="onComplete"),0===g&&(p=this._rawPrevTime,(0===t||0>p||p===n)&&p!==t&&(i=!0,p>n&&(r="onReverseComplete")),this._rawPrevTime=p=!e||t||0===p?t:n)):1e-7>t?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==m||0===g&&this._rawPrevTime>n)&&(r="onReverseComplete",s=this._reversed),0>t?(this._active=!1,0===g&&(this._rawPrevTime>=0&&(i=!0),this._rawPrevTime=p=!e||t||0===this._rawPrevTime?t:n)):this._initted||(i=!0)):(this._totalTime=this._time=t,0!==this._repeat&&(o=g+this._repeatDelay,this._cycle=this._totalTime/o>>0,0!==this._cycle&&this._cycle===this._totalTime/o&&this._cycle--,this._time=this._totalTime-this._cycle*o,this._yoyo&&0!==(1&this._cycle)&&(this._time=g-this._time),this._time>g?this._time=g:0>this._time&&(this._time=0)),this._easeType?(h=this._time/g,_=this._easeType,u=this._easePower,(1===_||3===_&&h>
vendor: 10,711 bytes, line 6745
6745=.5)&&(h=1-h),3===_&&(h*=2),1===u?h*=h:2===u?h*=h*h:3===u?h*=h*h*h:4===u&&(h*=h*h*h*h),this.ratio=1===_?1-h:2===_?h:.5>this._time/g?h/2:1-h/2):this.ratio=this._ease.getRatio(this._time/g)),f===this._time&&!i&&d===this._cycle)return m!==this._totalTime&&this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||l)),void 0;if(!this._initted){if(this._init(),!this._initted||this._gc)return;this._time&&!s?this.ratio=this._ease.getRatio(this._time/g):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._active||!this._paused&&this._time!==f&&t>=0&&(this._active=!0),0===m&&(this._startAt&&(t>=0?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._totalTime||0===g)&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||l))),a=this._firstPT;a;)a.f?a.t[a.p](a.c*this.ratio+a.s):a.t[a.p]=a.c*this.ratio+a.s,a=a._next;this._onUpdate&&(0>t&&this._startAt&&this._startTime&&this._startAt.render(t,e,i),e||(this._totalTime!==m||s)&&this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||l)),this._cycle!==d&&(e||this._gc||this.vars.onRepeat&&this.vars.onRepeat.apply(this.vars.onRepeatScope||this,this.vars.onRepeatParams||l)),r&&(this._gc||(0>t&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"Scope"]||this,this.vars[r+"Params"]||l),0===g&&this._rawPrevTime===n&&p!==n&&(this._rawPrevTime=0)))},r.to=function(t,e,i){return new r(t,e,i)},r.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new r(t,e,i)},r.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new r(t,e,s)},r.staggerTo=r.allTo=function(t,e,n,h,_,u,p){h=h||0;var c,f,m,d,g=n.delay||0,v=[],y=function(){n.onComplete&&n.onComplete.apply(n.onCompleteScope||this,arguments),_.apply(p||this,u||l)};for(o(t)||("string"==typeof t&&(t=i.selector(t)||t),a(t)&&(t=s.call(t,0))),c=t.length,m=0;c>m;m++){f={};for(d in n)f[d]=n[d];f.delay=g,m===c-1&&_&&(f.onComplete=y),v[m]=new r(t[m],e,f),g+=h}return v},r.staggerFrom=r.allFrom=function(t,e,i,s,n,a,o){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,r.staggerTo(t,e,i,s,n,a,o)},r.staggerFromTo=r.allFromTo=function(t,e,i,s,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,r.staggerTo(t,e,s,n,a,o,h)},r.delayedCall=function(t,e,i,s,n){return new r(e,0,{delay:t,onComplete:e,onCompleteParams:i,onCompleteScope:s,onReverseComplete:e,onReverseCompleteParams:i,onReverseCompleteScope:s,immediateRender:!1,useFrames:n,overwrite:0})},r.set=function(t,e){return new r(t,0,e)},r.isTweening=function(t){return i.getTweensOf(t,!0).length>0};var _=function(t,e){for(var s=[],r=0,n=t._first;n;)n instanceof i?s[r++]=n:(e&&(s[r++]=n),s=s.concat(_(n,e)),r=s.length),n=n._next;return s},u=r.getAllTweens=function(e){return _(t._rootTimeline,e).concat(_(t._rootFramesTimeline,e))};r.killAll=function(t,i,s,r){null==i&&(i=!0),null==s&&(s=!0);var n,a,o,h=u(0!=r),l=h.length,_=i&&s&&r;for(o=0;l>o;o++)a=h[o],(_||a instanceof e||(n=a.target===a.vars.onComplete)&&s||i&&!n)&&(t?a.totalTime(a.totalDuration()):a._enabled(!1,!1))},r.killChildTweensOf=function(t,e){if(null!=t){var n,h,l,_,u,p=i._tweenLookup;if("string"==typeof t&&(t=i.selector(t)||t),a(t)&&(t=s.call(t,0)),o(t))for(_=t.length;--_>-1;)r.killChildTweensOf(t[_],e);else{n=[];for(l in p)for(h=p[l].target.parentNode;h;)h===t&&(n=n.concat(p[l].tweens)),h=h.parentNode;for(u=n.length,_=0;u>_;_++)e&&n[_].totalTime(n[_].totalDuration()),n[_]._enabled(!1,!1)}}};var p=function(t,i,s,r){i=i!==!1,s=s!==!1,r=r!==!1;for(var n,a,o=u(r),h=i&&s&&r,l=o.length;--l>-1;)a=o[l],(h||a instanceof e||(n=a.target===a.vars.onComplete)&&s||i&&!n)&&a.paused(t)};return r.pauseAll=function(t,e,i){p(!0,t,e,i)},r.resumeAll=function(t,e,i){p(!1,t,e,i)},r.globalTimeScale=function(e){var s=t._rootTimeline,r=i.ticker.time;return arguments.length?(e=e||n,s._startTime=r-(r-s._startTime)*s._timeScale/e,s=t._rootFramesTimeline,r=i.ticker.frame,s._startTime=r-(r-s._startTime)*s._timeScale/e,s._timeScale=t._rootTimeline._timeScale=e,e):s._timeScale},h.progress=function(t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),!1):this._time/this.duration()},h.totalProgress=function(t){return arguments.length?this.totalTime(this.totalDuration()*t,!1):this._totalTime/this.totalDuration()},h.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},h.duration=function(e){return arguments.length?t.prototype.duration.call(this,e):this._duration},h.totalDuration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},h.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},h.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},h.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},r},!0),window._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var s=function(t){e.call(this,t),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var i,s,r=this.vars;for(s in r)i=r[s],a(i)&&-1!==i.join("").indexOf("{self}")&&(r[s]=this._swapSelfInParams(i));a(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},r=1e-10,n=i._internals.isSelector,a=i._internals.isArray,o=[],h=function(t){var e,i={};for(e in t)i[e]=t[e];return i},l=function(t,e,i,s){t._timeline.pause(t._startTime),e&&e.apply(s||t._timeline,i||o)},_=o.slice,u=s.prototype=new e;return s.version="1.11.5",u.constructor=s,u.kill()._gc=!1,u.to=function(t,e,s,r){return e?this.add(new i(t,e,s),r):this.set(t,s,r)},u.from=function(t,e,s,r){return this.add(i.from(t,e,s),r)},u.fromTo=function(t,e,s,r,n){return e?this.add(i.fromTo(t,e,s,r),n):this.set(t,r,n)},u.staggerTo=function(t,e,r,a,o,l,u,p){var c,f=new s({onComplete:l,onCompleteParams:u,onCompleteScope:p,smoothChildTiming:this.smoothChildTiming});for("string"==typeof t&&(t=i.selector(t)||t),n(t)&&(t=_.call(t,0)),a=a||0,c=0;t.length>c;c++)r.startAt&&(r.startAt=h(r.startAt)),f.to(t[c],e,h(r),c*a);return this.add(f,o)},u.staggerFrom=function(t,e,i,s,r,n,a,o){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(t,e,i,s,r,n,a,o)},u.staggerFromTo=function(t,e,i,s,r,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,this.staggerTo(t,e,s,r,n,a,o,h)},u.call=function(t,e,s,r){return this.add(i.delayedCall(0,t,e,s),r)},u.set=function(t,e,s){return s=this._parseTimeOrLabel(s,0,!0),null==e.immediateRender&&(e.immediateRender=s===this._time&&!this._paused),this.add(new i(t,0,e),s)},s.exportRoot=function(t,e){t=t||{},null==t.smoothChildTiming&&(t.smoothChildTiming=!0);var r,n,a=new s(t),o=a._timeline;for(null==e&&(e=!0),o._remove(a,!0),a._startTime=0,a._rawPrevTime=a._time=a._totalTime=o._time,r=o._first;r;)n=r._next,e&&r instanceof i&&r.target===r.vars.onComplete||a.add(r,r._startTime-r._delay),r=n;return o.add(a,0),a},u.add=function(r,n,o,h){var l,_,u,p,c,f;if("number"!=typeof n&&(n=this._parseTimeOrLabel(n,0,!0,r)),!(r instanceof t)){if(r instanceof Array||r&&r.push&&a(r)){for(o=o||"normal",h=h||0,l=n,_=r.length,u=0;_>u;u++)a(p=r[u])&&(p=new s({tweens:p})),this.add(p,l),"string"!=typeof p&&"function"!=typeof p&&("sequence"===o?l=p._startTime+p.totalDuration()/p._timeScale:"start"===o&&(p._startTime-=p.delay())),l+=h;return this._uncache(!0)}if("string"==typeof r)return this.addLabel(r,n);if("function"!=typeof r)throw"Cannot add "+r+" into the timeline; it is not a tween, timeline, function, or string.";r=i.delayedCall(0,r)}if(e.prototype.add.call(this,r,n),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(c=this,f=c.rawTime()>r._startTime;c._timeline;)f&&c._timeline.smoothChildTiming?c.totalTime(c._totalTime,!0):c._gc&&c._enabled(!0,!1),c=c._timeline;return this},u.remove=function(e){if(e instanceof t)return this._remove(e,!1);if(e instanceof Array||e&&e.push&&a(e)){for(var i=e.length;--i>-1;)this.remove(e[i]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},u._remove=function(t,i){e.prototype._remove.call(this,t,i);var s=this._last;return s?this._time>s._startTime+s._totalDuration/s._timeScale&&(this._time=this.duration(),this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},u.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},u.insert=u.insertMultiple=function(t,e,i,s){return this.add(t,e||0,i,s)},u.appendMultiple=function(t,e,i,s){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,s)},u.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},u.addPause=function(t,e,i,s){return this.call(l,["{self}",e,i,s],this,t)},u.removeLabel=function(t){return delete this._labels[t],this},u.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},u._parseTimeOrLabel=function(e,i,s,r){var n;if(r instanceof t&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&a(r)))for(n=r.length;--n>-1;)r[n]instanceof t&&r[n].timeline===this&&this.remove(r[n]);if("string"==typeof i)return this._parseTimeOrLabel(i,s&&"number"==typeof e&&null==this._labels[i]?e-this.duration():0,s);if(i=i||0,"string"!=typeof e||!isNaN(e)&&null==this._labels[e])null==e&&(e=this.duration());else{if(n=e.indexOf("="),-1===n)return null==this._labels[e]?s?this._labels[e]=this.duration()+i:i:this._labels[e]+i;i=parseInt(e.charAt(n-1)+"1",10)*Number(e.substr(n+1)),e=n>1?this._parseTimeOrLabel(e.substr(0,n-1),0,s):this.duration()}return Number(e)+i},u.seek=function(t,e){return this.totalTime("number"==typeof t?t:this._parseTimeOrLabel(t),e!==!1)},u.stop=function(){return this.paused(!0)},u.gotoAndPlay=function(t,e){return this.play(t,e)},u.gotoAndStop=function(t,e){return this.pause(t,e)}
6745,u.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,n,a,h,l,_=this._dirty?this.totalDuration():this._totalDuration,u=this._time,p=this._startTime,c=this._timeScale,f=this._paused;if(t>=_?(this._totalTime=this._time=_,this._reversed||this._hasPausedChild()||(n=!0,h="onComplete",0===this._duration&&(0===t||0>this._rawPrevTime||this._rawPrevTime===r)&&this._rawPrevTime!==t&&this._first&&(l=!0,this._rawPrevTime>r&&(h="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||0===this._rawPrevTime?t:r,t=_+1e-4):1e-7>t?(this._totalTime=this._time=0,(0!==u||0===this._duration&&(this._rawPrevTime>r||0>t&&this._rawPrevTime>=0))&&(h="onReverseComplete",n=this._reversed),0>t?(this._active=!1,0===this._duration&&this._rawPrevTime>=0&&this._first&&(l=!0),this._rawPrevTime=t):(this._rawPrevTime=this._duration||!e||t||0===this._rawPrevTime?t:r,t=0,this._initted||(l=!0))):this._totalTime=this._time=this._rawPrevTime=t,this._time!==u&&this._first||i||l){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==u&&t>0&&(this._active=!0),0===u&&this.vars.onStart&&0!==this._time&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||o)),this._time>=u)for(s=this._first;s&&(a=s._next,!this._paused||f);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;else for(s=this._last;s&&(a=s._prev,!this._paused||f);)(s._active||u>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||o)),h&&(this._gc||(p===this._startTime||c!==this._timeScale)&&(0===this._time||_>=this.totalDuration())&&(n&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[h]&&this.vars[h].apply(this.vars[h+"Scope"]||this,this.vars[h+"Params"]||o)))}},u._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof s&&t._hasPausedChild())return!0;t=t._next}return!1},u.getChildren=function(t,e,s,r){r=r||-9999999999;for(var n=[],a=this._first,o=0;a;)r>a._startTime||(a instanceof i?e!==!1&&(n[o++]=a):(s!==!1&&(n[o++]=a),t!==!1&&(n=n.concat(a.getChildren(!0,e,s)),o=n.length))),a=a._next;return n},u.getTweensOf=function(t,e){for(var s=i.getTweensOf(t),r=s.length,n=[],a=0;--r>-1;)(s[r].timeline===this||e&&this._contains(s[r]))&&(n[a++]=s[r]);return n},u._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},u.shiftChildren=function(t,e,i){i=i||0;for(var s,r=this._first,n=this._labels;r;)r._startTime>=i&&(r._startTime+=t),r=r._next;if(e)for(s in n)n[s]>=i&&(n[s]+=t);return this._uncache(!0)},u._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),s=i.length,r=!1;--s>-1;)i[s]._kill(t,e)&&(r=!0);return r},u.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;--i>-1;)e[i]._enabled(!1,!1);return t!==!1&&(this._labels={}),this._uncache(!0)},u.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return this},u._enabled=function(t,i){if(t===this._gc)for(var s=this._first;s;)s._enabled(t,!0),s=s._next;return e.prototype._enabled.call(this,t,i)},u.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},u.totalDuration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,s=0,r=this._last,n=999999999999;r;)e=r._prev,r._dirty&&r.totalDuration(),r._startTime>n&&this._sortChildren&&!r._paused?this.add(r,r._startTime-r._delay):n=r._startTime,0>r._startTime&&!r._paused&&(s-=r._startTime,this._timeline.smoothChildTiming&&(this._startTime+=r._startTime/this._timeScale),this.shiftChildren(-r._startTime,!1,-9999999999),n=0),i=r._startTime+r._totalDuration/r._timeScale,i>s&&(s=i),r=e;this._duration=this._totalDuration=s,this._dirty=!1}return this._totalDuration}return 0!==this.totalDuration()&&0!==t&&this.timeScale(this._totalDuration/t),this},u.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===t._rootFramesTimeline},u.rawTime=function(){return this._paused?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale},s},!0),window._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(t,e,
6745i){var s=function(e){t.call(this,e),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._dirty=!0},r=1e-10,n=[],a=new i(null,null,1,0),o=s.prototype=new t;return o.constructor=s,o.kill()._gc=!1,s.version="1.11.5",o.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),t.prototype.invalidate.call(this)},o.addCallback=function(t,i,s,r){return this.add(e.delayedCall(0,t,s,r),i)},o.removeCallback=function(t,e){if(t)if(null==e)this._kill(null,t);else for(var i=this.getTweensOf(t,!1),s=i.length,r=this._parseTimeOrLabel(e);--s>-1;)i[s]._startTime===r&&i[s]._enabled(!1,!1);return this},o.tweenTo=function(t,i){i=i||{};var s,r,o,h={ease:a,overwrite:2,useFrames:this.usesFrames(),immediateRender:!1};for(r in i)h[r]=i[r];return h.time=this._parseTimeOrLabel(t),s=Math.abs(Number(h.time)-this._time)/this._timeScale||.001,o=new e(this,s,h),h.onStart=function(){o.target.paused(!0),o.vars.time!==o.target.time()&&s===o.duration()&&o.duration(Math.abs(o.vars.time-o.target.time())/o.target._timeScale),i.onStart&&i.onStart.apply(i.onStartScope||o,i.onStartParams||n)},o},o.tweenFromTo=function(t,e,i){i=i||{},t=this._parseTimeOrLabel(t),i.startAt={onComplete:this.seek,onCompleteParams:[t],onCompleteScope:this},i.immediateRender=i.immediateRender!==!1;var s=this.tweenTo(e,i);return s.duration(Math.abs(s.vars.time-t)/this._timeScale||.001)},o.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,a,o,h,l,_,u=this._dirty?this.totalDuration():this._totalDuration,p=this._duration,c=this._time,f=this._totalTime,m=this._startTime,d=this._timeScale,g=this._rawPrevTime,v=this._paused,y=this._cycle;if(t>=u?(this._locked||(this._totalTime=u,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(a=!0,h="onComplete",0===this._duration&&(0===t||0>g||g===r)&&g!==t&&this._first&&(l=!0,g>r&&(h="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||0===this._rawPrevTime?t:r,this._yoyo&&0!==(1&this._cycle)?this._time=t=0:(this._time=p,t=p+1e-4)):1e-7>t?(this._locked||(this._totalTime=this._cycle=0),this._time=0,(0!==c||0===p&&(g>r||0>t&&g>=0)&&!this._locked)&&(h="onReverseComplete",a=this._reversed),0>t?(this._active=!1,0===p&&g>=0&&this._first&&(l=!0),this._rawPrevTime=t):(this._rawPrevTime=p||!e||t||0===this._rawPrevTime?t:r,t=0,this._initted||(l=!0))):(0===p&&0>g&&(l=!0),this._time=this._rawPrevTime=t,this._locked||(this._totalTime=t,0!==this._repeat&&(_=p+this._repeatDelay,this._cycle=this._totalTime/_>>0,0!==this._cycle&&this._cycle===this._totalTime/_&&this._cycle--,this._time=this._totalTime-this._cycle*_,this._yoyo&&0!==(1&this._cycle)&&(this._time=p-this._time),this._time>p?(this._time=p,t=p+1e-4):0>this._time?this._time=t=0:t=this._time))),this._cycle!==y&&!this._locked){var T=this._yoyo&&0!==(1&y),w=T===(this._yoyo&&0!==(1&this._cycle)),x=this._totalTime,b=this._cycle,P=this._rawPrevTime,S=this._time;if(this._totalTime=y*p,y>this._cycle?T=!T:this._totalTime+=p,this._time=c,this._rawPrevTime=0===p?g-1e-4:g,this._cycle=y,this._locked=!0,c=T?0:p,this.render(c,e,0===p),e||this._gc||this.vars.onRepeat&&this.vars.onRepeat.apply(this.vars.onRepeatScope||this,this.vars.onRepeatParams||n),w&&(c=T?p+1e-4:-1e-4,this.render(c,!0,!1)),this._locked=!1,this._paused&&!v)return;this._time=S,this._totalTime=x,this._cycle=b,this._rawPrevTime=P}if(!(this._time!==c&&this._first||i||l))return f!==this._totalTime&&this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n)),void 0;if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==f&&t>0&&(this._active=!0),0===f&&this.vars.onStart&&0!==this._totalTime&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||n)),this._time>=c)for(s=this._first;s&&(o=s._next,!this._paused||v);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=o;else for(s=this._last;s&&(o=s._prev,!this._paused||v);)(s._active||c>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=o;
vendor: 10,463 bytes, lines 6745-6746
6745this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n)),h&&(this._locked||this._gc||(m===this._startTime||d!==this._timeScale)&&(0===this._time||u>=this.totalDuration())&&(a&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[h]&&this.vars[h].apply(this.vars[h+"Scope"]||this,this.vars[h+"Params"]||n)))},o.getActive=function(t,e,i){null==t&&(t=!0),null==e&&(e=!0),null==i&&(i=!1);var s,r,n=[],a=this.getChildren(t,e,i),o=0,h=a.length;for(s=0;h>s;s++)r=a[s],r.isActive()&&(n[o++]=r);return n},o.getLabelAfter=function(t){t||0!==t&&(t=this._time);var e,i=this.getLabelsArray(),s=i.length;for(e=0;s>e;e++)if(i[e].time>t)return i[e].name;return null},o.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;--i>-1;)if(t>e[i].time)return e[i].name;return null},o.getLabelsArray=function(){var t,e=[],i=0;for(t in this._labels)e[i++]={time:this._labels[t],name:t};return e.sort(function(t,e){return t.time-e.time}),e},o.progress=function(t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),!1):this._time/this.duration()},o.totalProgress=function(t){return arguments.length?this.totalTime(this.totalDuration()*t,!1):this._totalTime/this.totalDuration()},o.totalDuration=function(e){return arguments.length?-1===this._repeat?this:this.duration((e-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(t.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},o.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},o.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},o.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},o.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},o.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.getLabelBefore(this._time+1e-8)},s},!0),function(){var t=180/Math.PI,e=[],i=[],s=[],r={},n=function(t,e,i,s){this.a=t,this.b=e,this.c=i,this.d=s,this.da=s-t,this.ca=i-t,this.ba=e-t},a=",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",o=function(t,e,i,s){var r={a:t},n={},a={},o={c:s},h=(t+e)/2,l=(e+i)/2,_=(i+s)/2,u=(h+l)/2,p=(l+_)/2,c=(p-u)/8;return r.b=h+(t-h)/4,n.b=u+c,r.c=n.a=(r.b+n.b)/2,n.c=a.a=(u+p)/2,a.b=p-c,o.b=_+(s-_)/4,a.c=o.a=(a.b+o.b)/2,[r,n,a,o]},h=function(t,r,n,a,h){var l,_,u,p,c,f,m,d,g,v,y,T,w,x=t.length-1,b=0,P=t[0].a;for(l=0;x>l;l++)c=t[b],_=c.a,u=c.d,p=t[b+1].d,h?(y=e[l],T=i[l],w=.25*(T+y)*r/(a?.5:s[l]||.5),f=u-(u-_)*(a?.5*r:0!==y?w/y:0),m=u+(p-u)*(a?.5*r:0!==T?w/T:0),d=u-(f+((m-f)*(3*y/(y+T)+.5)/4||0))):(f=u-.5*(u-_)*r,m=u+.5*(p-u)*r,d=u-(f+m)/2),f+=d,m+=d,c.c=g=f,c.b=0!==l?P:P=c.a+.6*(c.c-c.a),c.da=u-_,c.ca=g-_,c.ba=P-_,n?(v=o(_,P,g,u),t.splice(b,1,v[0],v[1],v[2],v[3]),b+=4):b++,P=m;c=t[b],c.b=P,c.c=P+.4*(c.d-P),c.da=c.d-c.a,c.ca=c.c-c.a,c.ba=P-c.a,n&&(v=o(c.a,P,c.c,c.d),t.splice(b,1,v[0],v[1],v[2],v[3]))},l=function(t,s,r,a){var o,h,l,_,u,p,c=[];if(a)for(t=[a].concat(t),h=t.length;--h>-1;)"string"==typeof(p=t[h][s])&&"="===p.charAt(1)&&(t[h][s]=a[s]+Number(p.charAt(0)+p.substr(2)));if(o=t.length-2,0>o)return c[0]=new n(t[0][s],0,0,t[-1>o?0:1][s]),c;for(h=0;o>h;h++)l=t[h][s],_=t[h+1][s],c[h]=new n(l,0,0,_),r&&(u=t[h+2][s],e[h]=(e[h]||0)+(_-l)*(_-l),i[h]=(i[h]||0)+(u-_)*(u-_));return c[h]=new n(t[h][s],0,0,t[h+1][s]),c},_=function(t,n,o,_,u,p){var c,f,m,d,g,v,y,T,w={},x=[],b=p||t[0];u="string"==typeof u?","+u+",":a,null==n&&(n=1);for(f in t[0])x.push(f);if(t.length>1){for(T=t[t.length-1],y=!0,c=x.length;--c>-1;)if(f=x[c],Math.abs(b[f]-T[f])>.05){y=!1;break}y&&(t=t.concat(),p&&t.unshift(p),t.push(t[1]),p=t[t.length-3])}for(e.length=i.length=s.length=0,c=x.length;--c>-1;)f=x[c],r[f]=-1!==u.indexOf(","+f+","),w[f]=l(t,f,r[f],p);for(c=e.length;--c>-1;)e[c]=Math.sqrt(e[c]),i[c]=Math.sqrt(i[c]);if(!_){for(c=x.length;--c>-1;)if(r[f])for(m=w[x[c]],v=m.length-1,d=0;v>d;d++)g=m[d+1].da/i[d]+m[d].da/e[d],s[d]=(s[d]||0)+g*g;for(c=s.length;--c>-1;)s[c]=Math.sqrt(s[c])}for(c=x.length,d=o?4:1;--c>-1;)f=x[c],m=w[f],h(m,n,o,_,r[f]),y&&(m.splice(0,d),m.splice(m.length-d,d));return w},u=function(t,e,i){e=e||"soft";var s,r,a,o,h,l,_,u,p,c,f,m={},d="cubic"===e?3:2,g="soft"===e,v=[];if(g&&i&&(t=[i].concat(t)),null==t||d+1>t.length)throw"invalid Bezier data";for(p in t[0])v.push(p);for(l=v.length;--l>-1;){for(p=v[l],m[p]=h=[],c=0,u=t.length,_=0;u>_;_++)s=null==i?t[_][p]:"string"==typeof(f=t[_][p])&&"="===f.charAt(1)?i[p]+Number(f.charAt(0)+f.substr(2)):Number(f),g&&_>1&&u-1>_&&(h[c++]=(s+h[c-2])/2),h[c++]=s;for(u=c-d+1,c=0,_=0;u>_;_+=d)s=h[_],r=h[_+1],a=h[_+2],o=2===d?0:h[_+3],h[c++]=f=3===d?new n(s,r,a,o):new n(s,(2*r+s)/3,(2*r+a)/3,a);h.length=c}return m},p=function(t,e,i){for(var s,r,n,a,o,h,l,_,u,p,c,f=1/i,m=t.length;--m>-1;)for(p=t[m],n=p.a,a=p.d-n,o=p.c-n,h=p.b-n,s=r=0,_=1;i>=_;_++)l=f*_,u=1-l,s=r-(r=(l*l*a+3*u*(l*o+u*h))*l),c=m*i+_-1,e[c]=(e[c]||0)+s*s},c=function(t,e){e=e>>0||6;var i,s,r,n,a=[],o=[],h=0,l=0,_=e-1,u=[],c=[];for(i in t)p(t[i],a,e);for(r=a.length,s=0;r>s;s++)h+=Math.sqrt(a[s]),n=s%e,c[n]=h,n===_&&(l+=h,n=s/e>>0,u[n]=c,o[n]=l,h=0,c=[]);return{length:l,lengths:o,segments:u}},f=window._gsDefine.plugin({propName:"bezier",priority:-1,API:2,global:!0,init:function(t,e,i){this._target=t,e instanceof Array&&(e={values:e}),this._func={},this._round={},this._props=[],this._timeRes=null==e.timeResolution?6:parseInt(e.timeResolution,10);var s,r,n,a,o,h=e.values||[],l={},p=h[0],f=e.autoRotate||i.vars.orientToBezier;this._autoRotate=f?f instanceof Array?f:[["x","y","rotation",f===!0?0:Number(f)||0]]:null;for(s in p)this._props.push(s);for(n=this._props.length;--n>-1;)s=this._props[n],this._overwriteProps.push(s),r=this._func[s]="function"==typeof t[s],l[s]=r?t[s.indexOf("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]():parseFloat(t[s]),o||l[s]!==h[0][s]&&(o=l);if(this._beziers="cubic"!==e.type&&"quadratic"!==e.type&&"soft"!==e.type?_(h,isNaN(e.curviness)?1:e.curviness,!1,"thruBasic"===e.type,e.correlate,o):u(h,e.type,l),this._segCount=this._beziers[s].length,this._timeRes){var m=c(this._beziers,this._timeRes);this._length=m.length,this._lengths=m.lengths,this._segments=m.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(f=this._autoRotate)for(f[0]instanceof Array||(this._autoRotate=f=[f]),n=f.length;--n>-1;)for(a=0;3>a;a++)s=f[n][a],this._func[s]="function"==typeof t[s]?t[s.indexOf("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]:!1;return!0},set:function(e){var i,s,r,n,a,o,h,l,_,u,p=this._segCount,c=this._func,f=this._target;if(this._timeRes){if(_=this._lengths,u=this._curSeg,e*=this._length,r=this._li,e>this._l2&&p-1>r){for(l=p-1;l>r&&e>=(this._l2=_[++r]););this._l1=_[r-1],this._li=r,this._curSeg=u=this._segments[r],this._s2=u[this._s1=this._si=0]}else if(this._l1>e&&r>0){for(;r>0&&(this._l1=_[--r])>=e;);0===r&&this._l1>e?this._l1=0:r++,this._l2=_[r],this._li=r,this._curSeg=u=this._segments[r],this._s1=u[(this._si=u.length-1)-1]||0,this._s2=u[this._si]}if(i=r,e-=this._l1,r=this._si,e>this._s2&&u.length-1>r){for(l=u.length-1;l>r&&e>=(this._s2=u[++r]););this._s1=u[r-1],this._si=r}else if(this._s1>e&&r>0){for(;r>0&&(this._s1=u[--r])>=e;);0===r&&this._s1>e?this._s1=0:r++,this._s2=u[r],this._si=r}o=(r+(e-this._s1)/(this._s2-this._s1))*this._prec}else i=0>e?0:e>=1?p-1:p*e>>0,o=(e-i*(1/p))*p;for(s=1-o,r=this._props.length;--r>-1;)n=this._props[r],a=this._beziers[n][i],h=(o*o*a.da+3*s*(o*a.ca+s*a.ba))*o+a.a,this._round[n]&&(h=h+(h>0?.5:-.5)>>0),c[n]?f[n](h):f[n]=h;if(this._autoRotate){var m,d,g,v,y,T,w,x=this._autoRotate;for(r=x.length;--r>-1;)n=x[r][2],T=x[r][3]||0,w=x[r][4]===!0?1:t,a=this._beziers[x[r][0]],m=this._beziers[x[r][1]],a&&m&&(a=a[i],m=m[i],d=a.a+(a.b-a.a)*o,v=a.b+(a.c-a.b)*o,d+=(v-d)*o,v+=(a.c+(a.d-a.c)*o-v)*o,g=m.a+(m.b-m.a)*o,y=m.b+(m.c-m.b)*o,g+=(y-g)*o,y+=(m.c+(m.d-m.c)*o-y)*o,h=Math.atan2(y-g,v-d)*w+T,c[n]?f[n](h):f[n]=h)}}}),m=f.prototype;f.bezierThrough=_,f.cubicToQuadratic=o,f._autoCSS=!0,f.quadraticToCubic=function(t,e,i){return new n(t,(2*e+t)/3,(2*e+i)/3,i)},f._cssRegister=function(){var t=window._gsDefine.globals.CSSPlugin;if(t){var e=t._internals,i=e._parseToProxy,s=e._setPluginRatio,r=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,n,a,o,h){e instanceof Array&&(e={values:e}),h=new f;var l,_,u,p=e.values,c=p.length-1,m=[],d={};if(0>c)return o;for(l=0;c>=l;l++)u=i(t,p[l],a,o,h,c!==l),m[l]=u.end;for(_ in e)d[_]=e[_];return d.values=m,o=new r(t,"bezier",0,0,u.pt,2),o.data=u,o.plugin=h,o.setRatio=s,0===d.autoRotate&&(d.autoRotate=!0),!d.autoRotate||d.autoRotate instanceof Array||(l=d.autoRotate===!0?0:Number(d.autoRotate),d.autoRotate=null!=u.end.left?[["left","top","rotation",l,!1]]:null!=u.end.x?[["x","y","rotation",l,!1]]:!1),d.autoRotate&&(a._transform||a._enableTransforms(!1),u.autoRotate=a._target._gsTransform),h._onInitTween(u.proxy,d,a._tween),o
6746	}})}},m._roundProps=function(t,e){for(var i=this._overwriteProps,s=i.length;--s>-1;)(t[i[s]]||t.bezier||t.bezierThrough)&&(this._round[i[s]]=e)},m._kill=function(t){var e,i,s=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=s.length;--i>-1;)s[i]===e&&s.splice(i,1);return this._super._kill.call(this,t)}}(),window._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(t,e){var i,s,r,n,a=function(){t.call(this,"css"),this._overwriteProps.length=0,this.setRatio=a.prototype.setRatio},o={},h=a.prototype=new t("css");h.constructor=a,a.version="1.11.5",a.API=2,a.defaultTransformPerspective=0,h="px",a.suffixMap={top:h,right:h,bottom:h,left:h,width:h,height:h,fontSize:h,padding:h,margin:h,perspective:h,lineHeight:""};var l,_,u,p,c,f,m=/(?:\d|\-\d|\.\d|\-\.\d)+/g,d=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,g=/(?
6746:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,v=/[^\d\-\.]/g,y=/(?:\d|\-|\+|=|#|\.)*/g,T=/opacity *= *([^)]*)/,w=/opacity:([^;]*)/,x=/alpha\(opacity *=.+?\)/i,b=/^(rgb|hsl)/,P=/([A-Z])/g,S=/-([a-z])/gi,k=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,R=function(t,e){return e.toUpperCase()},A=/(?:Left|Right|Width)/i,C=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,O=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,D=/,(?=[^\)]*(?:\(|$))/gi,M=Math.PI/180,I=180/Math.PI,E={},N=document,F=N.createElement("div"),L=N.createElement("img"),X=a._internals={_specialProps:o},z=navigator.userAgent,U=function(){var t,e=z.indexOf("Android"),i=N.createElement("div");return u=-1!==z.indexOf("Safari")&&-1===z.indexOf("Chrome")&&(-1===e||Number(z.substr(e+8,1))>3),c=u&&6>Number(z.substr(z.indexOf("Version/")+8,1)),p=-1!==z.indexOf("Firefox"),/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(z)&&(f=parseFloat(RegExp.$1)),i.innerHTML="<a style='top:1px;opacity:.55;'>a</a>",t=i.getElementsByTagName("a")[0],t?/^0.55/.test(t.style.opacity):!1}(),Y=function(t){return T.test("string"==typeof t?t:(t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100:1},j=function(t){window.console&&console.log(t)},B="",q="",V=function(t,e){e=e||F;var i,s,r=e.style;if(void 0!==r[t])return t;for(t=t.charAt(0).toUpperCase()+t.substr(1),i=["O","Moz","ms","Ms","Webkit"],s=5;--s>-1&&void 0===r[i[s]+t];);return s>=0?(q=3===s?"ms":i[s],B="-"+q.toLowerCase()+"-",q+t):null},W=N.defaultView?N.defaultView.getComputedStyle:function(){},G=a.getStyle=function(t,e,i,s,r){var n;return U||"opacity"!==e?(!s&&t.style[e]?n=t.style[e]:(i=i||W(t,null))?(t=i.getPropertyValue(e.replace(P,"-$1").toLowerCase()),n=t||i.length?t:i[e]):t.currentStyle&&(n=t.currentStyle[e]),null==r||n&&"none"!==n&&"auto"!==n&&"auto auto"!==n?n:r):Y(t)},$=function(t,e,i,s,r){if("px"===s||!s)return i;if("auto"===s||!i)return 0;var n,a=A.test(e),o=t,h=F.style,l=0>i;return l&&(i=-i),"%"===s&&-1!==e.indexOf("border")?n=i/100*(a?t.clientWidth:t.clientHeight):(h.cssText="border:0 solid red;position:"+G(t,"position")+";line-height:0;","%"!==s&&o.appendChild?h[a?"borderLeftWidth":"borderTopWidth"]=i+s:(o=t.parentNode||N.body,h[a?"width":"height"]=i+s),o.appendChild(F),n=parseFloat(F[a?"offsetWidth":"offsetHeight"]),o.removeChild(F),0!==n||r||(n=$(t,e,i,s,!0))),l?-n:n},Z=function(t,e,i){if("absolute"!==G(t,"position",i))return 0;var s="left"===e?"Left":"Top",r=G(t,"margin"+s,i);return t["offset"+s]-($(t,e,parseFloat(r),r.replace(y,""))||0)},Q=function(t,e){var i,s,r={};if(e=e||W(t,null))if(i=e.length)for(;--i>-1;)r[e[i].replace(S,R)]=e.getPropertyValue(e[i]);else for(i in e)r[i]=e[i];else if(e=t.currentStyle||t.style)for(i in e)"string"==typeof i&&void 0===r[i]&&(r[i.replace(S,R)]=e[i]);return U||(r.opacity=Y(t)),s=be(t,e,!1),r.rotation=s.rotation,r.skewX=s.skewX,r.scaleX=s.scaleX,r.scaleY=s.scaleY,r.x=s.x,r.y=s.y,xe&&(r.z=s.z,r.rotationX=s.rotationX,r.rotationY=s.rotationY,r.scaleZ=s.scaleZ),r.filters&&delete r.filters,r},H=function(t,e,i,s,r){var n,a,o,h={},l=t.style;for(a in i)"cssText"!==a&&"length"!==a&&isNaN(a)&&(e[a]!==(n=i[a])||r&&r[a])&&-1===a.indexOf("Origin")&&("number"==typeof n||"string"==typeof n)&&(h[a]="auto"!==n||"left"!==a&&"top"!==a?""!==n&&"auto"!==n&&"none"!==n||"string"!=typeof e[a]||""===e[a].replace(v,"")?n:0:Z(t,a),void 0!==l[a]&&(o=new ue(l,a,l[a],o)));if(s)for(a in s)"className"!==a&&(h[a]=s[a]);return{difs:h,firstMPT:o}},K={width:["Left","Right"],height:["Top","Bottom"]},J=["marginLeft","marginRight","marginTop","marginBottom"],te=function(t,e,i){var s=parseFloat("width"===e?t.offsetWidth:t.offsetHeight),r=K[e],n=r.length;for(i=i||W(t,null);--n>-1;)s-=parseFloat(G(t,"padding"+r[n],i,!0))||0,s-=parseFloat(G(t,"border"+r[n]+"Width",i,!0))||0;return s},ee=function(t,e){(null==t||""===t||"auto"===t||"auto auto"===t)&&(t="0 0");var i=t.split(" "),s=-1!==t.indexOf("left")?"0%":-1!==t.indexOf("right")?"100%":i[0],r=-1!==t.indexOf("top")?"0%":-1!==t.indexOf("bottom")?"100%":i[1];return null==r?r="0":"center"===r&&(r="50%"),("center"===s||isNaN(parseFloat(s))&&-1===(s+"").indexOf("="))&&(s="50%"),e&&(e.oxp=-1!==s.indexOf("%"),e.oyp=-1!==r.indexOf("%"),e.oxr="="===s.charAt(1),e.oyr="="===r.charAt(1),e.ox=parseFloat(s.replace(v,"")),e.oy=parseFloat(r.replace(v,""))),s+" "+r+(i.length>2?" "+i[2]:"")},ie=function(t,e){return"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2)):parseFloat(t)-parseFloat(e)},se=function(t,e){return null==t?e:"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*Number(t.substr(2))+e:parseFloat(t)}
6746,re=function(t,e,i,s){var r,n,a,o,h=1e-6;return null==t?o=e:"number"==typeof t?o=t:(r=360,n=t.split("_"),a=Number(n[0].replace(v,""))*(-1===t.indexOf("rad")?1:I)-("="===t.charAt(1)?0:e),n.length&&(s&&(s[i]=e+a),-1!==t.indexOf("short")&&(a%=r,a!==a%(r/2)&&(a=0>a?a+r:a-r)),-1!==t.indexOf("_cw")&&0>a?a=(a+9999999999*r)%r-(0|a/r)*r:-1!==t.indexOf("ccw")&&a>0&&(a=(a-9999999999*r)%r-(0|a/r)*r)),o=e+a),h>o&&o>-h&&(o=0),o},ne={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},ae=function(t,e,i){return t=0>t?t+1:t>1?t-1:t,0|255*(1>6*t?e+6*(i-e)*t:.5>t?i:2>3*t?e+6*(i-e)*(2/3-t):e)+.5},oe=function(t){var e,i,s,r,n,a;return t&&""!==t?"number"==typeof t?[t>>16,255&t>>8,255&t]:(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),ne[t]?ne[t]:"#"===t.charAt(0)?(4===t.length&&(e=t.charAt(1),i=t.charAt(2),s=t.charAt(3),t="#"+e+e+i+i+s+s),t=parseInt(t.substr(1),16),[t>>16,255&t>>8,255&t]):"hsl"===t.substr(0,3)?(t=t.match(m),r=Number(t[0])%360/360,n=Number(t[1])/100,a=Number(t[2])/100,i=.5>=a?a*(n+1):a+n-a*n,e=2*a-i,t.length>3&&(t[3]=Number(t[3])),t[0]=ae(r+1/3,e,i),t[1]=ae(r,e,i),t[2]=ae(r-1/3,e,i),t):(t=t.match(m)||ne.transparent,t[0]=Number(t[0]),t[1]=Number(t[1]),t[2]=Number(t[2]),t.length>3&&(t[3]=Number(t[3])),t)):ne.black},he="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b";for(h in ne)he+="|"+h+"\\b";he=RegExp(he+")","gi");var le=function(t,e,i,s){if(null==t)return function(t){return t};var r,n=e?(t.match(he)||[""])[0]:"",a=t.split(n).join("").match(g)||[],o=t.substr(0,t.indexOf(a[0])),h=")"===t.charAt(t.length-1)?")":"",l=-1!==t.indexOf(" ")?" ":",",_=a.length,u=_>0?a[0].replace(m,""):"";return _?r=e?function(t){var e,p,c,f;if("number"==typeof t)t+=u;else if(s&&D.test(t)){for(f=t.replace(D,"|").split("|"),c=0;f.length>c;c++)f[c]=r(f[c]);return f.join(",")}if(e=(t.match(he)||[n])[0],p=t.split(e).join("").match(g)||[],c=p.length,_>c--)for(;_>++c;)p[c]=i?p[0|(c-1)/2]:a[c];return o+p.join(l)+l+e+h+(-1!==t.indexOf("inset")?" inset":"")}:function(t){var e,n,p;if("number"==typeof t)t+=u;else if(s&&D.test(t)){for(n=t.replace(D,"|").split("|"),p=0;n.length>p;p++)n[p]=r(n[p]);return n.join(",")}if(e=t.match(g)||[],p=e.length,_>p--)for(;_>++p;)e[p]=i?e[0|(p-1)/2]:a[p];return o+e.join(l)+h}:function(t){return t}},_e=function(t){return t=t.split(","),function(e,i,s,r,n,a,o){var h,l=(i+"").split(" ");for(o={},h=0;4>h;h++)o[t[h]]=l[h]=l[h]||l[(h-1)/2>>0];return r.parse(e,o,n,a)}},ue=(X._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,s,r,n=this.data,a=n.proxy,o=n.firstMPT,h=1e-6;o;)e=a[o.v],o.r?e=e>0?0|e+.5:0|e-.5:h>e&&e>-h&&(e=0),o.t[o.p]=e,o=o._next;if(n.autoRotate&&(n.autoRotate.rotation=a.rotation),1===t)for(o=n.firstMPT;o;){if(i=o.t,i.type){if(1===i.type){for(r=i.xs0+i.s+i.xs1,s=1;i.l>s;s++)r+=i["xn"+s]+i["xs"+(s+1)];i.e=r}}else i.e=i.s+i.xs0;o=o._next}},function(t,e,i,s,r){this.t=t,this.p=e,this.v=i,this.r=r,s&&(s._prev=this,this._next=s)}),pe=(X._parseToProxy=function(t,e,i,s,r,n){var a,o,h,l,_,u=s,p={},c={},f=i._transform,m=E;for(i._transform=null,E=e,s=_=i.parse(t,e,s,r),E=m,n&&(i._transform=f,u&&(u._prev=null,u._prev&&(u._prev._next=null)));s&&s!==u;){if(1>=s.type&&(o=s.p,c[o]=s.s+s.c,p[o]=s.s,n||(l=new ue(s,"s",o,l,s.r),s.c=0),1===s.type))for(a=s.l;--a>0;)h="xn"+a,o=s.p+"_"+h,c[o]=s.data[h],p[o]=s[h],n||(l=new ue(s,h,o,l,s.rxp[h]));s=s._next}return{proxy:p,end:c,firstMPT:l,pt:_}},X.CSSPropTween=function(t,e,s,r,a,o,h,l,_,u,p){this.t=t,this.p=e,this.s=s,this.c=r,this.n=h||e,t instanceof pe||n.push(this.n),this.r=l,this.type=o||0,_&&(this.pr=_,i=!0),this.b=void 0===u?s:u,this.e=void 0===p?s+r:p,a&&(this._next=a,a._prev=this)}),ce=a.parseComplex=function(t,e,i,s,r,n,a,o,h,_){i=i||n||"",a=new pe(t,e,0,0,a,_?2:1,null,!1,o,i,s),s+="";var u,p,c,f,g,v,y,T,w,x,P,S,k=i.split(", ").join(",").split(" "),R=s.split(", ").join(",").split(" "),A=k.length,C=l!==!1;for((-1!==s.indexOf(",")||-1!==i.indexOf(","))&&(k=k.join(" ").replace(D,", ").split(" "),R=R.join(" ").replace(D,", ").split(" "),A=k.length),A!==R.length&&(k=(n||"").split(" "),A=k.length),a.plugin=h,a.setRatio=_,u=0;A>u;u++)if(f=k[u],g=R[u],T=parseFloat(f),T||0===T)a.appendXtra("",T,ie(g,T),g.replace(d,""),C&&-1!==g.indexOf("px"),!0);else if(r&&("#"===f.charAt(0)||ne[f]||b.test(f)))S=","===g.charAt(g.length-1)?"),":")",f=oe(f),g=oe(g),w=f.length+g.length>
67466,w&&!U&&0===g[3]?(a["xs"+a.l]+=a.l?" transparent":"transparent",a.e=a.e.split(R[u]).join("transparent")):(U||(w=!1),a.appendXtra(w?"rgba(":"rgb(",f[0],g[0]-f[0],",",!0,!0).appendXtra("",f[1],g[1]-f[1],",",!0).appendXtra("",f[2],g[2]-f[2],w?",":S,!0),w&&(f=4>f.length?1:f[3],a.appendXtra("",f,(4>g.length?1:g[3])-f,S,!1)));else if(v=f.match(m)){if(y=g.match(d),!y||y.length!==v.length)return a;for(c=0,p=0;v.length>p;p++)P=v[p],x=f.indexOf(P,c),a.appendXtra(f.substr(c,x-c),Number(P),ie(y[p],P),"",C&&"px"===f.substr(x+P.length,2),0===p),c=x+P.length;a["xs"+a.l]+=f.substr(c)}else a["xs"+a.l]+=a.l?" "+f:f;if(-1!==s.indexOf("=")&&a.data){for(S=a.xs0+a.data.s,u=1;a.l>u;u++)S+=a["xs"+u]+a.data["xn"+u];a.e=S+a["xs"+u]}return a.l||(a.type=-1,a.xs0=a.e),a.xfirst||a},fe=9;for(h=pe.prototype,h.l=h.pr=0;--fe>0;)h["xn"+fe]=0,h["xs"+fe]="";h.xs0="",h._next=h._prev=h.xfirst=h.data=h.plugin=h.setRatio=h.rxp=null,h.appendXtra=function(t,e,i,s,r,n){var a=this,o=a.l;return a["xs"+o]+=n&&o?" "+t:t||"",i||0===o||a.plugin?(a.l++,a.type=a.setRatio?2:1,a["xs"+a.l]=s||"",o>0?(a.data["xn"+o]=e+i,a.rxp["xn"+o]=r,a["xn"+o]=e,a.plugin||(a.xfirst=new pe(a,"xn"+o,e,i,a.xfirst||a,0,a.n,r,a.pr),a.xfirst.xs0=0),a):(a.data={s:e+i},a.rxp={},a.s=e,a.c=i,a.r=r,a)):(a["xs"+o]+=e+(s||""),a)};var me=function(t,e){e=e||{},this.p=e.prefix?V(t)||t:t,o[t]=o[this.p]=this,this.format=e.formatter||le(e.defaultValue,e.color,e.collapsible,e.multi),e.parser&&(this.parse=e.parser),this.clrs=e.color,this.multi=e.multi,this.keyword=e.keyword,this.dflt=e.defaultValue,this.pr=e.priority||0},de=X._registerComplexSpecialProp=function(t,e,i){"object"!=typeof e&&(e={parser:i});var s,r,n=t.split(","),a=e.defaultValue;for(i=i||[a],s=0;n.length>s;s++)e.prefix=0===s&&e.prefix,e.defaultValue=i[s]||a,r=new me(n[s],e)},ge=function(t){if(!o[t]){var e=t.charAt(0).toUpperCase()+t.substr(1)+"Plugin";de(t,{parser:function(t,i,s,r,n,a,h){var l=(window.GreenSockGlobals||window).com.greensock.plugins[e];return l?(l._cssRegister(),o[s].parse(t,i,s,r,n,a,h)):(j("Error: "+e+" js file not loaded."),n)}})}};h=me.prototype,h.parseComplex=function(t,e,i,s,r,n){var a,o,h,l,_,u,p=this.keyword;if(this.multi&&(D.test(i)||D.test(e)?(o=e.replace(D,"|").split("|"),h=i.replace(D,"|").split("|")):p&&(o=[e],h=[i])),h){for(l=h.length>o.length?h.length:o.length,a=0;l>a;a++)e=o[a]=o[a]||this.dflt,i=h[a]=h[a]||this.dflt,p&&(_=e.indexOf(p),u=i.indexOf(p),_!==u&&(i=-1===u?h:o,i[a]+=" "+p));e=o.join(", "),i=h.join(", ")}return ce(t,this.p,e,i,this.clrs,this.dflt,s,this.pr,r,n)},h.parse=function(t,e,i,s,n,a){return this.parseComplex(t.style,this.format(G(t,this.p,r,!1,this.dflt)),this.format(e),n,a)},a.registerSpecialProp=function(t,e,i){de(t,{parser:function(t,s,r,n,a,o){var h=new pe(t,r,0,0,a,2,r,!1,i);return h.plugin=o,h.setRatio=e(t,s,n._tween,r),h},priority:i})};var ve="scaleX,scaleY,scaleZ,x,y,z,skewX,rotation,rotationX,rotationY,perspective".split(","),ye=V("transform"),Te=B+"transform",we=V("transformOrigin"),xe=null!==V("perspective"),be=function(t,e,i,s){if(t._gsTransform&&i&&!s)return t._gsTransform;var r,n,o,h,l,_,u,p,c,f,m,d,g,v=i?t._gsTransform||{skewY:0}:{skewY:0},y=0>v.scaleX,T=2e-5,w=1e5,x=179.99,b=x*M,P=xe?parseFloat(G(t,we,e,!1,"0 0 0").split(" ")[2])||v.zOrigin||0:0;for(ye?r=G(t,Te,e,!0):t.currentStyle&&(r=t.currentStyle.filter.match(C),r=r&&4===r.length?[r[0].substr(4),Number(r[2].substr(4)),Number(r[1].substr(4)),r[3].substr(4),v.x||0,v.y||0].join(","):""),n=(r||"").match(/(?:\-|\b)[\d\-\.e]+\b/gi)||[],o=n.length;--o>-1;)h=Number(n[o]),n[o]=(l=h-(h|=0))?(0|l*w+(0>l?-.5:.5))/w+h:h;if(16===n.length){var S=n[8],k=n[9],R=n[10],A=n[12],O=n[13],D=n[14];if(v.zOrigin&&(D=-v.zOrigin,A=S*D-n[12],O=k*D-n[13],D=R*D+v.zOrigin-n[14]),!i||s||null==v.rotationX){var E,N,F,L,X,z,U,Y=n[0],j=n[1],B=n[2],q=n[3],V=n[4],W=n[5],$=n[6],Z=n[7],Q=n[11],H=Math.atan2($,R),K=-b>H||H>b;v.rotationX=H*I,H&&(L=Math.cos(-H),X=Math.sin(-H),E=V*L+S*X,N=W*L+k*X,F=$*L+R*X,S=V*-X+S*L,k=W*-X+k*L,R=$*-X+R*L,Q=Z*-X+Q*L,V=E,W=N,$=F),H=Math.atan2(S,Y),v.rotationY=H*I,H&&(z=-b>H||H>b,L=Math.cos(-H),X=Math.sin(-H),E=Y*L-S*X,N=j*L-k*X,F=B*L-R*X,k=j*X+k*L,R=B
6746*X+R*L,Q=q*X+Q*L,Y=E,j=N,B=F),H=Math.atan2(j,W),v.rotation=H*I,H&&(U=-b>H||H>b,L=Math.cos(-H),X=Math.sin(-H),Y=Y*L+V*X,N=j*L+W*X,W=j*-X+W*L,$=B*-X+$*L,j=N),U&&K?v.rotation=v.rotationX=0:U&&z?v.rotation=v.rotationY=0:z&&K&&(v.rotationY=v.rotationX=0),v.scaleX=(0|Math.sqrt(Y*Y+j*j)*w+.5)/w,v.scaleY=(0|Math.sqrt(W*W+k*k)*w+.5)/w,v.scaleZ=(0|Math.sqrt($*$+R*R)*w+.5)/w,v.skewX=0,v.perspective=Q?1/(0>Q?-Q:Q):0,v.x=A,v.y=O,v.z=D}}else if(!(xe&&!s&&n.length&&v.x===n[4]&&v.y===n[5]&&(v.rotationX||v.rotationY)||void 0!==v.x&&"none"===G(t,"display",e))){var J=n.length>=6,te=J?n[0]:1,ee=n[1]||0,ie=n[2]||0,se=J?n[3]:1;v.x=n[4]||0,v.y=n[5]||0,_=Math.sqrt(te*te+ee*ee),u=Math.sqrt(se*se+ie*ie),p=te||ee?Math.atan2(ee,te)*I:v.rotation||0,c=ie||se?Math.atan2(ie,se)*I+p:v.skewX||0,f=_-Math.abs(v.scaleX||0),m=u-Math.abs(v.scaleY||0),Math.abs(c)>90&&270>Math.abs(c)&&(y?(_*=-1,c+=0>=p?180:-180,p+=0>=p?180:-180):(u*=-1,c+=0>=c?180:-180)),d=(p-v.rotation)%180,g=(c-v.skewX)%180,(void 0===v.skewX||f>T||-T>f||m>T||-T>m||d>-x&&x>d&&false|d*w||g>-x&&x>g&&false|g*w)&&(v.scaleX=_,v.scaleY=u,v.rotation=p,v.skewX=c),xe&&(v.rotationX=v.rotationY=v.z=0,v.perspective=parseFloat(a.defaultTransformPerspective)||0,v.scaleZ=1)}v.zOrigin=P;for(o in v)T>v[o]&&v[o]>-T&&(v[o]=0);return i&&(t._gsTransform=v),v},Pe=function(t){var e,i,s=this.data,r=-s.rotation*M,n=r+s.skewX*M,a=1e5,o=(0|Math.cos(r)*s.scaleX*a)/a,h=(0|Math.sin(r)*s.scaleX*a)/a,l=(0|Math.sin(n)*-s.scaleY*a)/a,_=(0|Math.cos(n)*s.scaleY*a)/a,u=this.t.style,p=this.t.currentStyle;if(p){i=h,h=-l,l=-i,e=p.filter,u.filter="";var c,m,d=this.t.offsetWidth,g=this.t.offsetHeight,v="absolute"!==p.position,w="progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12="+h+", M21="+l+", M22="+_,x=s.x,b=s.y;if(null!=s.ox&&(c=(s.oxp?.01*d*s.ox:s.ox)-d/2,m=(s.oyp?.01*g*s.oy:s.oy)-g/2,x+=c-(c*o+m*h),b+=m-(c*l+m*_)),v?(c=d/2,m=g/2,w+=", Dx="+(c-(c*o+m*h)+x)+", Dy="+(m-(c*l+m*_)+b)+")"):w+=", sizingMethod='auto expand')",u.filter=-1!==e.indexOf("DXImageTransform.Microsoft.Matrix(")?e.replace(O,w):w+" "+e,(0===t||1===t)&&1===o&&0===h&&0===l&&1===_&&(v&&-1===w.indexOf("Dx=0, Dy=0")||T.test(e)&&100!==parseFloat(RegExp.$1)||-1===e.indexOf("gradient("&&e.indexOf("Alpha"))&&u.removeAttribute("filter")),!v){var P,S,k,R=8>f?1:-1;for(c=s.ieOffsetX||0,m=s.ieOffsetY||0,s.ieOffsetX=Math.round((d-((0>o?-o:o)*d+(0>h?-h:h)*g))/2+x),s.ieOffsetY=Math.round((g-((0>_?-_:_)*g+(0>l?-l:l)*d))/2+b),fe=0;4>fe;fe++)S=J[fe],P=p[S],i=-1!==P.indexOf("px")?parseFloat(P):$(this.t,S,parseFloat(P),P.replace(y,""))||0,k=i!==s[S]?2>fe?-s.ieOffsetX:-s.ieOffsetY:2>fe?c-s.ieOffsetX:m-s.ieOffsetY,u[S]=(s[S]=Math.round(i-k*(0===fe||2===fe?1:R)))+"px"}}},Se=function(){var t,e,i,s,r,n,a,o,h,l,_,u,c,f,m,d,g,v,y,T,w,x,b,P=this.data,S=this.t.style,k=P.rotation*M,R=P.scaleX,A=P.scaleY,C=P.scaleZ,O=P.perspective;if(p){var D=1e-4;D>R&&R>-D&&(R=C=2e-5),D>A&&A>-D&&(A=C=2e-5),!O||P.z||P.rotationX||P.rotationY||(O=0)}if(k||P.skewX)v=Math.cos(k),y=Math.sin(k),t=v,r=y,P.skewX&&(k-=P.skewX*M,v=Math.cos(k),y=Math.sin(k)),e=-y,n=v;else{if(!(P.rotationY||P.rotationX||1!==C||O))return S[ye]="translate3d("+P.x+"px,"+P.y+"px,"+P.z+"px)"+(1!==R||1!==A?" scale("+R+","+A+")":""),void 0;t=n=1,e=r=0}_=1,i=s=a=o=h=l=u=c=f=0,m=O?-1/O:0,d=P.zOrigin,g=1e5,k=P.rotationY*M,k&&(v=Math.cos(k),y=Math.sin(k),h=_*-y,c=m*-y,i=t*y,a=r*y,_*=v,m*=v,t*=v,r*=v),k=P.rotationX*M,k&&(v=Math.cos(k),y=Math.sin(k),T=e*v+i*y,w=n*v+a*y,x=l*v+_*y,b=f*v+m*y,i=e*-y+i*v,a=n*-y+a*v,_=l*-y+_*v,m=f*-y+m*v,e=T,n=w,l=x,f=b),1!==C&&(i*=C,a*=C,_*=C,m*=C),1!==A&&(e*=A,n*=A,l*=A,f*=A),1!==R&&(t*=R,r*=R,h*=R,c*=R),d&&(u-=d,s=i*u,o=a*u,u=_*u+d),s=(T=(s+=P.x)-(s|=0))?(0|T*g+(0>T?-.5:.5))/g+s:s,o=(T=(o+=P.y)-(o|=0))?(0|T*g+(0>T?-.5:.5))/g+o:o,u=(T=(u+=P.z)-(u|=0))?(0|T*g+(0>T?-.5:.5))/g+u:u,S[ye]="matrix3d("+[(0|t*g)/g,(0|r*g)/g,(0|h*g)/g,(0|c*g)/g,(0|e*g)/g,(0|n*g)/g,(0|l*g)/g,(0|f*g)/g,(0|i*g)/g,(0|a*g)/g,(0|_*g)/g,(0|m*g)/g,s,o,u,O?1+-u/O:1].join(",")+")"},ke=function(t){var e,i,s,r,n,a=this.data,o=this.t,h=o.style;return a.rotationX||a.rotationY||a.z||a.force3D?(this.setRatio=Se,Se.call(this,t),void 0):(a.rotation||a.skewX?(e=a.rotation*M,i=e-a.skewX*M,s=1e5,r=a.scaleX*s,n=a.scaleY*s,h[ye]="matrix("+(0|Math.cos(e)*r)/s+","+(0|Math.sin(e)*r)/s+","+(0|Math.sin(i)*-n)/s+","+(0|Math.cos(i)*n)/s+","+a.x+","+a.y+")"):h[ye]="matrix("+a.scaleX+",0,0,"+a.scaleY+","+a.x+","+a.y+")",void 0)};de("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,transformPerspective,directionalRotation,parseTransform,force3D",{parser:function(t,e,
6746i,s,n,a,o){if(s._transform)return n;var h,l,_,u,p,c,f,m=s._transform=be(t,r,!0,o.parseTransform),d=t.style,g=1e-6,v=ve.length,y=o,T={};if("string"==typeof y.transform&&ye)_=d.cssText,d[ye]=y.transform,d.display="block",h=be(t,null,!1),d.cssText=_;else if("object"==typeof y){if(h={scaleX:se(null!=y.scaleX?y.scaleX:y.scale,m.scaleX),scaleY:se(null!=y.scaleY?y.scaleY:y.scale,m.scaleY),scaleZ:se(y.scaleZ,m.scaleZ),x:se(y.x,m.x),y:se(y.y,m.y),z:se(y.z,m.z),perspective:se(y.transformPerspective,m.perspective)},f=y.directionalRotation,null!=f)if("object"==typeof f)for(_ in f)y[_]=f[_];else y.rotation=f;h.rotation=re("rotation"in y?y.rotation:"shortRotation"in y?y.shortRotation+"_short":"rotationZ"in y?y.rotationZ:m.rotation,m.rotation,"rotation",T),xe&&(h.rotationX=re("rotationX"in y?y.rotationX:"shortRotationX"in y?y.shortRotationX+"_short":m.rotationX||0,m.rotationX,"rotationX",T),h.rotationY=re("rotationY"in y?y.rotationY:"shortRotationY"in y?y.shortRotationY+"_short":m.rotationY||0,m.rotationY,"rotationY",T)),h.skewX=null==y.skewX?m.skewX:re(y.skewX,m.skewX),h.skewY=null==y.skewY?m.skewY:re(y.skewY,m.skewY),(l=h.skewY-m.skewY)&&(h.skewX+=l,h.rotation+=l)}for(xe&&null!=y.force3D&&(m.force3D=y.force3D,c=!0),p=m.force3D||m.z||m.rotationX||m.rotationY||h.z||h.rotationX||h.rotationY||h.perspective,p||null==y.scale||(h.scaleZ=1);--v>-1;)i=ve[v],u=h[i]-m[i],(u>g||-g>u||null!=E[i])&&(c=!0,n=new pe(m,i,m[i],u,n),i in T&&(n.e=T[i]),n.xs0=0,n.plugin=a,s._overwriteProps.push(n.n));return u=y.transformOrigin,(u||xe&&p&&m.zOrigin)&&(ye?(c=!0,i=we,u=(u||G(t,i,r,!1,"50% 50%"))+"",n=new pe(d,i,0,0,n,-1,"transformOrigin"),n.b=d[i],n.plugin=a,xe?(_=m.zOrigin,u=u.split(" "),m.zOrigin=(u.length>2&&(0===_||"0px"!==u[2])?parseFloat(u[2]):_)||0,n.xs0=n.e=d[i]=u[0]+" "+(u[1]||"50%")+" 0px",n=new pe(m,"zOrigin",0,0,n,-1,n.n),n.b=_,n.xs0=n.e=m.zOrigin):n.xs0=n.e=d[i]=u):ee(u+"",m)),c&&(s._transformType=p||3===this._transformType?3:2),n},prefix:!0}),de("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),de("borderRadius",{defaultValue:"0px",parser:function(t,e,i,n,a){e=this.format(e);var o,h,l,_,u,p,c,f,m,d,g,v,y,T,w,x,b=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],P=t.style;for(m=parseFloat(t.offsetWidth),d=parseFloat(t.offsetHeight),o=e.split(" "),h=0;b.length>h;h++)this.p.indexOf("border")&&(b[h]=V(b[h])),u=_=G(t,b[h],r,!1,"0px"),-1!==u.indexOf(" ")&&(_=u.split(" "),u=_[0],_=_[1]),p=l=o[h],c=parseFloat(u),v=u.substr((c+"").length),y="="===p.charAt(1),y?(f=parseInt(p.charAt(0)+"1",10),p=
vendor: 8,739 bytes, line 6746
6746p.substr(2),f*=parseFloat(p),g=p.substr((f+"").length-(0>f?1:0))||""):(f=parseFloat(p),g=p.substr((f+"").length)),""===g&&(g=s[i]||v),g!==v&&(T=$(t,"borderLeft",c,v),w=$(t,"borderTop",c,v),"%"===g?(u=100*(T/m)+"%",_=100*(w/d)+"%"):"em"===g?(x=$(t,"borderLeft",1,"em"),u=T/x+"em",_=w/x+"em"):(u=T+"px",_=w+"px"),y&&(p=parseFloat(u)+f+g,l=parseFloat(_)+f+g)),a=ce(P,b[h],u+" "+_,p+" "+l,!1,"0px",a);return a},prefix:!0,formatter:le("0px 0px 0px 0px",!1,!0)}),de("backgroundPosition",{defaultValue:"0 0",parser:function(t,e,i,s,n,a){var o,h,l,_,u,p,c="background-position",m=r||W(t,null),d=this.format((m?f?m.getPropertyValue(c+"-x")+" "+m.getPropertyValue(c+"-y"):m.getPropertyValue(c):t.currentStyle.backgroundPositionX+" "+t.currentStyle.backgroundPositionY)||"0 0"),g=this.format(e);if(-1!==d.indexOf("%")!=(-1!==g.indexOf("%"))&&(p=G(t,"backgroundImage").replace(k,""),p&&"none"!==p)){for(o=d.split(" "),h=g.split(" "),L.setAttribute("src",p),l=2;--l>-1;)d=o[l],_=-1!==d.indexOf("%"),_!==(-1!==h[l].indexOf("%"))&&(u=0===l?t.offsetWidth-L.width:t.offsetHeight-L.height,o[l]=_?parseFloat(d)/100*u+"px":100*(parseFloat(d)/u)+"%");d=o.join(" ")}return this.parseComplex(t.style,d,g,n,a)},formatter:ee}),de("backgroundSize",{defaultValue:"0 0",formatter:ee}),de("perspective",{defaultValue:"0px",prefix:!0}),de("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),de("transformStyle",{prefix:!0}),de("backfaceVisibility",{prefix:!0}),de("userSelect",{prefix:!0}),de("margin",{parser:_e("marginTop,marginRight,marginBottom,marginLeft")}),de("padding",{parser:_e("paddingTop,paddingRight,paddingBottom,paddingLeft")}),de("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(t,e,i,s,n,a){var o,h,l;return 9>f?(h=t.currentStyle,l=8>f?" ":",",o="rect("+h.clipTop+l+h.clipRight+l+h.clipBottom+l+h.clipLeft+")",e=this.format(e).split(",").join(l)):(o=this.format(G(t,this.p,r,!1,this.dflt)),e=this.format(e)),this.parseComplex(t.style,o,e,n,a)}}),de("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),de("autoRound,strictUnits",{parser:function(t,e,i,s,r){return r}}),de("border",{defaultValue:"0px solid #000",parser:function(t,e,i,s,n,a){return this.parseComplex(t.style,this.format(G(t,"borderTopWidth",r,!1,"0px")+" "+G(t,"borderTopStyle",r,!1,"solid")+" "+G(t,"borderTopColor",r,!1,"#000")),this.format(e),n,a)},color:!0,formatter:function(t){var e=t.split(" ");return e[0]+" "+(e[1]||"solid")+" "+(t.match(he)||["#000"])[0]}}),de("borderWidth",{parser:_e("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),de("float,cssFloat,styleFloat",{parser:function(t,e,i,s,r){var n=t.style,a="cssFloat"in n?"cssFloat":"styleFloat";return new pe(n,a,0,0,r,-1,i,!1,0,n[a],e)}});var Re=function(t){var e,i=this.t,s=i.filter||G(this.data,"filter"),r=0|this.s+this.c*t;100===r&&(-1===s.indexOf("atrix(")&&-1===s.indexOf("radient(")&&-1===s.indexOf("oader(")?(i.removeAttribute("filter"),e=!G(this.data,"filter")):(i.filter=s.replace(x,""),e=!0)),e||(this.xn1&&(i.filter=s=s||"alpha(opacity="+r+")"),-1===s.indexOf("opacity")?0===r&&this.xn1||(i.filter=s+" alpha(opacity="+r+")"):i.filter=s.replace(T,"opacity="+r))};de("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(t,e,i,s,n,a){var o=parseFloat(G(t,"opacity",r,!1,"1")),h=t.style,l="autoAlpha"===i;return"string"==typeof e&&"="===e.charAt(1)&&(e=("-"===e.charAt(0)?-1:1)*parseFloat(e.substr(2))+o),l&&1===o&&"hidden"===G(t,"visibility",r)&&0!==e&&(o=0),U?n=new pe(h,"opacity",o,e-o,n):(n=new pe(h,"opacity",100*o,100*(e-o),n),n.xn1=l?1:0,h.zoom=1,n.type=2,n.b="alpha(opacity="+n.s+")",n.e="alpha(opacity="+(n.s+n.c)+")",n.data=t,n.plugin=a,n.setRatio=Re),l&&(n=new pe(h,"visibility",0,0,n,-1,null,!1,0,0!==o?"inherit":"hidden",0===e?"hidden":"inherit"),n.xs0="inherit",s._overwriteProps.push(n.n),s._overwriteProps.push(i)),n}});var Ae=function(t,e){e&&(t.removeProperty?t.removeProperty(e.replace(P,"-$1").toLowerCase()):t.removeAttribute(e))},Ce=function(t){if(this.t._gsClassPT=this,1===t||0===t){this.t.className=0===t?this.b:this.e;for(var e=this.data,i=this.t.style;e;)e.v?i[e.p]=e.v:Ae(i,e.p),e=e._next;1===t&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.className!==this.e&&(this.t.className=this.e)};de("className",{parser:function(t,e,s,n,a,o,h){var l,_,u,p,c,f=t.className,m=t.style.cssText;if(a=n._classNamePT=new pe(t,s,0,0,a,2),a.setRatio=Ce,a.pr=-11,i=!0,a.b=f,_=Q(t,r),u=t._gsClassPT){for(p={},c=u.data;c;)p[c.p]=1,c=c._next;u.setRatio(1)}return t._gsClassPT=a,a.e="="!==e.charAt(1)?e:f.replace(RegExp("\\s*\\b"+e.substr(2)+"\\b"),"")+("+"===e.charAt(0)?" "+e.substr(2):""),n._tween._duration&&(t.className=a.e,l=H(t,_,Q(t),h,p),t.className=f,a.data=l.firstMPT,t.style.cssText=m,a=a.xfirst=n.parse(t,l.difs,a,o)),a}});var Oe=function(t){if((1===t||0===t)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var e,i,s,r,n=this.t.style,a=o.transform.parse;if("all"===this.e)n.cssText="",r=!0;else for(e=this.e.split(","),s=e.length;--s>-1;)i=e[s],o[i]&&(o[i].parse===a?r=!0:i="transformOrigin"===i?we:o[i].p),Ae(n,i);r&&(Ae(n,ye),this.t._gsTransform&&delete this.t._gsTransform)}};for(de("clearProps",{parser:function(t,e,s,r,n){return n=new pe(t,s,0,0,n,2),n.setRatio=Oe,n.e=e,n.pr=-10,n.data=r._tween,i=!0,n}}),h="bezier,throwProps,physicsProps,physics2D".split(","),fe=h.length;fe--;)ge(h[fe]);h=a.prototype,h._firstPT=null,h._onInitTween=function(t,e,o){if(!t.nodeType)return!1;this._target=t,this._tween=o,this._vars=e,l=e.autoRound,i=!1,s=e.suffixMap||a.suffixMap,r=W(t,""),n=this._overwriteProps;var h,p,f,m,d,g,v,y,T,x=t.style;if(_&&""===x.zIndex&&(h=G(t,"zIndex",r),("auto"===h||""===h)&&(x.zIndex=0)),"string"==typeof e&&(m=x.cssText,h=Q(t,r),x.cssText=m+";"+e,h=H(t,h,Q(t)).difs,!U&&w.test(e)&&(h.opacity=parseFloat(RegExp.$1)),e=h,x.cssText=m),this._firstPT=p=this.parse(t,e,null),this._transformType){for(T=3===this._transformType,ye?u&&(_=!0,""===x.zIndex&&(v=G(t,"zIndex",r),("auto"===v||""===v)&&(x.zIndex=0)),c&&(x.WebkitBackfaceVisibility=this._vars.WebkitBackfaceVisibility||(T?"visible":"hidden"))):x.zoom=1,f=p;f&&f._next;)f=f._next;y=new pe(t,"transform",0,0,null,2),this._linkCSSP(y,null,f),y.setRatio=T&&xe?Se:ye?ke:Pe,y.data=this._transform||be(t,r,!0),n.pop()}if(i){for(;p;){for(g=p._next,f=m;f&&f.pr>p.pr;)f=f._next;(p._prev=f?f._prev:d)?p._prev._next=p:m=p,(p._next=f)?f._prev=p:d=p,p=g}this._firstPT=m}return!0},h.parse=function(t,e,i,n){var a,h,_,u,p,c,f,m,d,g,v=t.style;for(a in e)c=e[a],h=o[a],h?i=h.parse(t,c,a,this,i,n,e):(p=G(t,a,r)+"",d="string"==typeof c,"color"===a||"fill"===a||"stroke"===a||-1!==a.indexOf("Color")||d&&b.test(c)?(d||(c=oe(c),c=(c.length>3?"rgba(":"rgb(")+c.join(",")+")"),i=ce(v,a,p,c,!0,"transparent",i,0,n)):!d||-1===c.indexOf(" ")&&-1===c.indexOf(",")?(_=parseFloat(p),f=_||0===_?p.substr((_+"").length):"",(""===p||"auto"===p)&&("width"===a||"height"===a?(_=te(t,a,r),f="px"):"left"===a||"top"===a?(_=Z(t,a,r),f="px"):(_="opacity"!==a?0:1,f="")),g=d&&"="===c.charAt(1),g?(u=parseInt(c.charAt(0)+"1",10),c=c.substr(2),u*=parseFloat(c),m=c.replace(y,"")):(u=parseFloat(c),m=d?c.substr((u+"").length)||"":""),""===m&&(m=a in s?s[a]:f),c=u||0===u?(g?u+_:u)+m:e[a],f!==m&&""!==m&&(u||0===u)&&(_||0===_)&&(_=$(t,a,_,f),"%"===m?(_/=$(t,a,100,"%")/100,e.strictUnits!==!0&&(p=_+"%")):"em"===m?_/=$(t,a,1,"em"):(u=$(t,a,u,m),m="px"),g&&(u||0===u)&&(c=u+_+m)),g&&(u+=_),!_&&0!==_||!u&&0!==u?void 0!==v[a]&&(c||"NaN"!=c+""&&null!=c)?(i=new pe(v,a,u||_||0,0,i,-1,a,!1,0,p,c),i.xs0="none"!==c||"display"!==a&&-1===a.indexOf("Style")?c:p):j("invalid "+a+" tween value: "+e[a]):(i=new pe(v,a,_,u-_,i,0,a,l!==!1&&("px"===m||"zIndex"===a),0,p,c),i.xs0=m)):i=ce(v,a,p,c,!0,null,i,0,n)),n&&i&&!i.plugin&&(i.plugin=n);return i},h.setRatio=function(t){var e,i,s,r=this._firstPT,n=1e-6;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;r;){if(e=r.c*t+r.s,r.r?e=e>0?0|e+.5:0|e-.5:n>e&&e>-n&&(e=0),r.type)if(1===r.type)if(s=r.l,2===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2;else if(3===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3;else if(4===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4;else if(5===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4+r.xn4+r.xs5;else{for(i=r.xs0+e+r.xs1,s=1;r.l>s;s++)i+=r["xn"+s]+r["xs"+(s+1)];r.t[r.p]=i}else-1===r.type?r.t[r.p]=r.xs0:r.setRatio&&r.setRatio(t);else r.t[r.p]=e+r.xs0;r=r._next}else for(;r;)2!==r.type?r.t[r.p]=r.b:r.setRatio(t),r=r._next;else for(;r;)2!==r.type?r.t[r.p]=r.e:r.setRatio(t),r=r._next},h._enableTransforms=function(t){this._transformType=t||3===this._transformType?3:2,this._transform=this._transform||be(this._target,r,!0)}
6746,h._linkCSSP=function(t,e,i,s){return t&&(e&&(e._prev=t),t._next&&(t._next._prev=t._prev),t._prev?t._prev._next=t._next:this._firstPT===t&&(this._firstPT=t._next,s=!0),i?i._next=t:s||null!==this._firstPT||(this._firstPT=t),t._next=e,t._prev=i),t},h._kill=function(e){var i,s,r,n=e;if(e.autoAlpha||e.alpha){n={};for(s in e)n[s]=e[s];n.opacity=1,n.autoAlpha&&(n.visibility=1)}return e.className&&(i=this._classNamePT)&&(r=i.xfirst,r&&r._prev?this._linkCSSP(r._prev,i._next,r._prev._prev):r===this._firstPT&&(this._firstPT=i._next),i._next&&this._linkCSSP(i._next,i._next._next,r._prev),this._classNamePT=null),t.prototype._kill.call(this,n)};var De=function(t,e,i){var s,r,n,a;if(t.slice)for(r=t.length;--r>-1;)De(t[r],e,i);else for(s=t.childNodes,r=s.length;--r>-1;)n=s[r],a=n.type,n.style&&(e.push(Q(n)),i&&i.push(n)),1!==a&&9!==a&&11!==a||!n.childNodes.length||De(n,e,i)};return a.cascadeTo=function(t,i,s){var r,n,a,o=e.to(t,i,s),h=[o],l=[],_=[],u=[],p=e._internals.reservedProps;for(t=o._targets||o.target,De(t,l,u),o.render(i,!0),De(t,_),o.render(0,!0),o._enabled(!0),r=u.length;--r>-1;)if(n=H(u[r],l[r],_[r]),n.firstMPT){n=n.difs;for(a in s)p[a]&&(n[a]=s[a]);h.push(e.to(u[r],i,n))}return h},t.activate([a]),a},!0),function(){var t=window._gsDefine.plugin({propName:"roundProps",priority:-1,API:2,init:function(t,e,i){return this._tween=i,!0}}),e=t.prototype;e._onInitAllProps=function(){for(var t,e,i,s=this._tween,r=s.vars.roundProps instanceof Array?s.vars.roundProps:s.vars.roundProps.split(","),n=r.length,a={},o=s._propLookup.roundProps;--n>-1;)a[r[n]]=1;for(n=r.length;--n>-1;)for(t=r[n],e=s._firstPT;e;)i=e._next,e.pg?e.t._roundProps(a,!0):e.n===t&&(this._add(e.t,t,e.s,e.c),i&&(i._prev=e._prev),e._prev?e._prev._next=i:s._firstPT===e&&(s._firstPT=i),e._next=e._prev=null,s._propLookup[t]=o),e=i;return!1},e._add=function(t,e,i,s){this._addTween(t,e,i,i+s,e,!0),this._overwriteProps.push(e)
6747	}}(),window._gsDefine.plugin({propName:"attr",API:2,version:"0.2.0",init:function(t,e){var i;if("function"!=typeof t.setAttribute)return!1;this._target=t,this._proxy={};for(i in e)this._addTween(this._proxy,i,parseFloat(t.getAttribute(i)),e[i],i)&&this._overwriteProps.push(i);return!0},set:function(t){this._super.setRatio.call(this,t);for(var e,i=this._overwriteProps,s=i.length;--s>-1;)e=i[s],this._target.setAttribute(e,this._proxy[e]+"")}}),window._gsDefine.plugin({propName:"directionalRotation",API:2,version:"0.2.0",init:function(t,e){"object"!=typeof e&&(e={rotation:e}),this.finals={};var i,s,r,n,a,o,h=e.useRadians===!0?2*Math.PI:360,l=1e-6;for(i in e)"useRadians"!==i&&(o=(e[i]+"").split("_"),s=o[0],r=parseFloat("function"!=typeof t[i]?t[i]:t[i.indexOf("set")||"function"!=typeof t["get"+i.substr(3)]?i:"get"+i.substr(3)]()),n=this.finals[i]="string"==typeof s&&"="===s.charAt(1)?r+parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)):Number(s)||0,a=n-r,o.length&&(s=o.join("_"),-1!==s.indexOf("short")&&(a%=h,a!==a%(h/2)&&(a=0>a?a+h:a-h)),-1!==s.indexOf("_cw")&&0>a?a=(a+9999999999*h)%h-(0|a/h)*h:-1!==s.indexOf("ccw")&&a>0&&(a=(a-9999999999*h)%h-(0|a/h)*h)),(a>l||-l>a)&&(this._addTween(t,i,r,r+a,i),this._overwriteProps.push(i)));return!0},set:function(t){var e;if(1!==t)this._super.setRatio.call(this,t);else for(e=this._firstPT;e;)e.f?e.t[e.p](this.finals[e.p]):e.t[e.p]=this.finals[e.p],e=e._next}})._autoCSS=!0,window._gsDefine("easing.Back",["easing.Ease"],function(t){var e,i,s,r=window.GreenSockGlobals||window,n=r.com.greensock,a=2*Math.PI,o=Math.PI/2,h=n._class,l=function(e,i){var s=h("easing."+e,function(){},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,s},_=t.register||function(){},u=function(t,e,i,s){var r=h("easing."+t,{easeOut:new e,easeIn:new i,easeInOut:new s},!0);return _(r,t),r},p=function(t,e,i){this.t=t,this.v=e,i&&(this.next=i,i.prev=this,this.c=i.v-e,this.gap=i.t-t)},c=function(e,i){var s=h("easing."+e,function(t){this._p1=t||0===t?t:1.70158,this._p2=1.525*this._p1},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,r.config=function(t){return new s(t)},s},f=u("Back",c("BackOut",function(t){return(t-=1)*t*((this._p1+1)*t+this._p1)+1}),c("BackIn",function(t){return t*t*((this._p1+1)*t-this._p1)}),c("BackInOut",function(t){return 1>(t*=2)?.5*t*t*((this._p2+1)*t-this._p2):.5*((t-=2)*t*((this._p2+1)*t+this._p2)+2)}
vendor: 4,327 bytes, line 6747
6747)),m=h("easing.SlowMo",function(t,e,i){e=e||0===e?e:.7,null==t?t=.7:t>1&&(t=1),this._p=1!==t?e:0,this._p1=(1-t)/2,this._p2=t,this._p3=this._p1+this._p2,this._calcEnd=i===!0},!0),d=m.prototype=new t;return d.constructor=m,d.getRatio=function(t){var e=t+(.5-t)*this._p;return this._p1>t?this._calcEnd?1-(t=1-t/this._p1)*t:e-(t=1-t/this._p1)*t*t*t*e:t>this._p3?this._calcEnd?1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},m.ease=new m(.7,.7),d.config=m.config=function(t,e,i){return new m(t,e,i)},e=h("easing.SteppedEase",function(t){t=t||1,this._p1=1/t,this._p2=t+1},!0),d=e.prototype=new t,d.constructor=e,d.getRatio=function(t){return 0>t?t=0:t>=1&&(t=.999999999),(this._p2*t>>0)*this._p1},d.config=e.config=function(t){return new e(t)},i=h("easing.RoughEase",function(e){e=e||{};for(var i,s,r,n,a,o,h=e.taper||"none",l=[],_=0,u=0|(e.points||20),c=u,f=e.randomize!==!1,m=e.clamp===!0,d=e.template instanceof t?e.template:null,g="number"==typeof e.strength?.4*e.strength:.4;--c>-1;)i=f?Math.random():1/u*c,s=d?d.getRatio(i):i,"none"===h?r=g:"out"===h?(n=1-i,r=n*n*g):"in"===h?r=i*i*g:.5>i?(n=2*i,r=.5*n*n*g):(n=2*(1-i),r=.5*n*n*g),f?s+=Math.random()*r-.5*r:c%2?s+=.5*r:s-=.5*r,m&&(s>1?s=1:0>s&&(s=0)),l[_++]={x:i,y:s};for(l.sort(function(t,e){return t.x-e.x}),o=new p(1,1,null),c=u;--c>-1;)a=l[c],o=new p(a.x,a.y,o);this._prev=new p(0,0,0!==o.t?o:o.next)},!0),d=i.prototype=new t,d.constructor=i,d.getRatio=function(t){var e=this._prev;if(t>e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&e.t>=t;)e=e.prev;return this._prev=e,e.v+(t-e.t)/e.gap*e.c},d.config=function(t){return new i(t)},i.ease=new i,u("Bounce",l("BounceOut",function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),l("BounceIn",function(t){return 1/2.75>(t=1-t)?1-7.5625*t*t:2/2.75>t?1-(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),l("BounceInOut",function(t){var e=.5>t;return t=e?1-2*t:2*t-1,t=1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),u("Circ",l("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),l("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),l("CircInOut",function(t){return 1>(t*=2)?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),s=function(e,i,s){var r=h("easing."+e,function(t,e){this._p1=t||1,this._p2=e||s,this._p3=this._p2/a*(Math.asin(1/this._p1)||0)},!0),n=r.prototype=new t;return n.constructor=r,n.getRatio=i,n.config=function(t,e){return new r(t,e)},r},u("Elastic",s("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*a/this._p2)+1},.3),s("ElasticIn",function(t){return-(this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*a/this._p2))},.3),s("ElasticInOut",function(t){return 1>(t*=2)?-.5*this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*a/this._p2):.5*this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*a/this._p2)+1},.45)),u("Expo",l("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),l("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),l("ExpoInOut",function(t){return 1>(t*=2)?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),u("Sine",l("SineOut",function(t){return Math.sin(t*o)}),l("SineIn",function(t){return-Math.cos(t*o)+1}),l("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),h("easing.EaseLookup",{find:function(e){return t.map[e]}},!0),_(r.SlowMo,"SlowMo","ease,"),_(i,"RoughEase","ease,"),_(e,"SteppedEase","ease,"),f},!0)}),function(t){"use strict";var e=t.GreenSockGlobals||t;if(!e.TweenLite){var i,s,r,n,a,o=function(t){var i,s=t.split("."),r=e;for(i=0;s.length>i;i++)r[s[i]]=r=r[s[i]]||{};return r},h=o("com.greensock"),l=1e-10,_=[].slice,u=function(){},p=function(){var t=Object.prototype.toString,e=t.call([]);return function(i){return null!=i&&(i instanceof Array||"object"==typeof i&&!!i.push&&t.call(i)===e)}}(),c={},f=function(i,s,r,n){this.sc=c[i]?c[i].sc:[],c[i]=this,this.gsClass=null,this.func=r;var a=[];this.check=function(h){for(var l,_,u,p,m=s.length,d=m;--m>-1;)(l=c[s[m]]||new f(s[m],[])).gsClass?(a[m]=l.gsClass,d--):h&&l.sc.push(this);if(0===d&&r)for(_=("com.greensock."+i).split("."),u=_.pop(),p=o(_.j
6747oin("."))[u]=this.gsClass=r.apply(r,a),n&&(e[u]=p,"function"==typeof define&&define.amd?define((t.GreenSockAMDPath?t.GreenSockAMDPath+"/":"")+i.split(".").join("/"),[],function(){return p}):"undefined"!=typeof module&&module.exports&&(module.exports=p)),m=0;this.sc.length>m;m++)this.sc[m].check()},this.check(!0)},m=t._gsDefine=function(t,e,i,s){return new f(t,e,i,s)},d=h._class=function(t,e,i){return e=e||function(){},m(t,[],function(){return e},i),e};m.globals=e;var g=[0,0,1,1],v=[],y=d("easing.Ease",function(t,e,i,s){this._func=t,this._type=i||0,this._power=s||0,this._params=e?g.concat(e):g},!0),T=y.map={},w=y.register=function(t,e,i,s){for(var r,n,a,o,l=e.split(","),_=l.length,u=(i||"easeIn,easeOut,easeInOut").split(",");--_>-1;)for(n=l[_],r=s?d("easing."+n,null,!0):h.easing[n]||{},a=u.length;--a>-1;)o=u[a],T[n+"."+o]=T[o+n]=r[o]=t.getRatio?t:t[o]||new t};for(r=y.prototype,r._calcEnd=!1,r.getRatio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,s=1===e?1-t:2===e?t:.5>t?2*t:2*(1-t);return 1===i?s*=s:2===i?s*=s*s:3===i?s*=s*s*s:4===i&&(s*=s*s*s*s),1===e?1-s:2===e?s:.5>t?s/2:1-s/2},i=["Linear","Quad","Cubic","Quart","Quint,Strong"],s=i.length;--s>-1;)r=i[s]+",Power"+s,w(new y(null,null,1,s),r,"easeOut",!0),w(new y(null,null,2,s),r,"easeIn"+(0===s?",easeNone":"")),w(new y(null,null,3,s),r,"easeInOut");T.linear=h.easing.Linear.easeIn,T.swing=h.easing.Quad.easeInOut;var x=d("events.EventDispatcher",function(t){this._listeners={},this._eventTarget=t||this});r=x.prototype,r.addEventListener=function(t,e,i,s,r){r=r||0;var o,h,l=this._listeners[t],_=0;for(null==l&&(this._listeners[t]=l=[]),h=l.length;--h>-1;)o=l[h],o.c===e&&o.s===i?l.splice(h,1):0===_&&r>o.pr&&(_=h+1);l.splice(_,0,{c:e,s:i,up:s,pr:r}),this!==n||a||n.wake()},r.removeEventListener=function(t,e){var i,s=this._listeners[t];if(s)for(i=s.length;--i>-1;)if(s[i].c===e)return s.splice(i,1),void 0},r.dispatchEvent=function(t){var e,i,s,r=this._listeners[t];if(r)for(e=r.length,i=this._eventTarget;--e>-1;)s=r[e],s.up?s.c.call(s.s||i,{type:t,target:i}):s.c.call(s.s||i)};var b=t.requestAnimationFrame,P=t.cancelAnimationFrame,S=Date.now||function(){return(new Date).getTime()},k=S();for(i=["ms","moz","webkit","o"],s=i.length;--s>-1&&!b;)b=t[i[s]+"RequestAnimationFrame"],P=t[i[s]+"CancelAnimationFrame"]||t[i[s]+"CancelRequestAnimationFrame"];d("Ticker",function(t,e){var i,s,r,o,h,l=this,_=S(),p=e!==!1&&b,c=function(t){k=S(),l.time=(k-_)/1e3;var e,n=l.time-h;(!i||n>0||t===!0)&&(l.frame++,h+=n+(n>=o?.004:o-n),e=!0),t!==!0&&(r=s(c)),e&&l.dispatchEvent("tick")};x.call(l),l.time=l.frame=0,l.tick=function(){c(!0)},l.sleep=function(){null!=r&&(p&&P?P(r):clearTimeout(r),s=u,r=null,l===n&&(a=!1))},l.wake=function(){null!==r&&l.sleep(),s=0===i?u:p&&b?b:function(t){return setTimeout(t,0|1e3*(h-l.time)+1)},l===n&&(a=!0),c(2)},l.fps=function(t){return arguments.length?(i=t,o=1/(i||60),h=this.time+o,l.wake(),void 0):i},l.useRAF=function(t){return arguments.length?(l.sleep(),p=t,l.fps(i),void 0):p},l.fps(t),setTimeout(function(){p&&(!r||5>l.frame)&&l.useRAF(!1)},1500)}),r=h.Ticker.prototype=new h.events.EventDispatcher,r.constructor=h.Ticker;var R=d("core.Animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=e.immediateRender===!0,this.data=e.data,this._reversed=e.reversed===!0,U){a||n.wake();var i=this.vars.useFrames?z:U;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});n=R.ticker=new h.Ticker,r=R.prototype,r._dirty=r._gc=r._initted=r._paused=!1,r._totalTime=r._time=0,r._rawPrevTime=-1,r._next=r._last=r._onUpdate=r._timeline=r.timeline=null,r._paused=!1;var A=function(){a&&S()-k>2e3&&n.wake(),setTimeout(A,2e3)};A(),r.play=function(t,e){return arguments.length&&this.seek(t,e),this.reversed(!1).paused(!1)},r.pause=function(t,e){return arguments.length&&this.seek(t,e),this.paused(!0)},r.resume=function(t,e){return arguments.length&&this.seek(t,e),this.paused(!1)},r.seek=function(t,e){return this.totalTime(Number(t),e!==!1)},r.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,e!==!1,!0)},r.reverse=function(t,e){return arguments.length&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},r.render=function(){},r.invalidate=function(){return this},r.isActive=function(){var t,e=this._timeline,i=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime())>=i&&i+this.totalDuration()/this._timeScale>t},r._enabled=function(t,e){return a||n.wake(),this._gc=!t,this._active=this.isActive(),e!==!0&&(t&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},r._kill=function(){return this._enabled(!1,!1)},r.kill=function(t,e){return this._kill(t,e),this},r._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},r._swapSelfInParams=function(t){for(var e=t.length,i=t.concat();--e>-1;)"{self}"===t[e]&&(i[e]=this);return i}
vendor: 4,570 bytes, line 6747
6747,r.eventCallback=function(t,e,i,s){if("on"===(t||"").substr(0,2)){var r=this.vars;if(1===arguments.length)return r[t];null==e?delete r[t]:(r[t]=e,r[t+"Params"]=p(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,r[t+"Scope"]=s),"onUpdate"===t&&(this._onUpdate=e)}return this},r.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},r.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._time<this._duration&&0!==t&&this.totalTime(this._totalTime*(t/this._duration),!0),this):(this._dirty=!1,this._duration)},r.totalDuration=function(t){return this._dirty=!1,arguments.length?this.duration(t):this._totalDuration},r.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(t>this._duration?this._duration:t,e)):this._time},r.totalTime=function(t,e,i){if(a||n.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>t&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var s=this._totalDuration,r=this._timeline;if(t>s&&!i&&(t=s),this._startTime=(this._paused?this._pauseTime:r._time)-(this._reversed?s-t:t)/this._timeScale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._startTime+r._totalTime)/r._timeScale&&r.totalTime(r._totalTime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==t||0===this._duration)&&this.render(t,e,!1)}return this},r.progress=r.totalProgress=function(t,e){return arguments.length?this.totalTime(this.duration()*t,e):this._time/this.duration()},r.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},r.timeScale=function(t){if(!arguments.length)return this._timeScale;if(t=t||l,this._timeline&&this._timeline.smoothChildTiming){var e=this._pauseTime,i=e||0===e?e:this._timeline.totalTime();this._startTime=i-(i-this._startTime)*this._timeScale/t}return this._timeScale=t,this._uncache(!1)},r.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},r.paused=function(t){if(!arguments.length)return this._paused;if(t!=this._paused&&this._timeline){a||t||n.wake();var e=this._timeline,i=e.rawTime(),s=i-this._pauseTime;!t&&e.smoothChildTiming&&(this._startTime+=s,this._uncache(!1)),this._pauseTime=t?i:null,this._paused=t,this._active=this.isActive(),!t&&0!==s&&this._initted&&this.duration()&&this.render(e.smoothChildTiming?this._totalTime:(i-this._startTime)/this._timeScale,!0,!0)}return this._gc&&!t&&this._enabled(!0,!1),this};var C=d("core.SimpleTimeline",function(t){R.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0});r=C.prototype=new R,r.constructor=C,r.kill()._gc=!1,r._first=r._last=null,r._sortChildren=!1,r.add=r.insert=function(t,e){var i,s;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=t._startTime+(this.rawTime()-t._startTime)/t._timeScale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),i=this._last,this._sortChildren)for(s=t._startTime;i&&i._startTime>s;)i=i._prev;return i?(t._next=i._next,i._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=i,this._timeline&&this._uncache(!0),this},r._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t.timeline=null,t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),this._timeline&&this._uncache(!0)),this},r.render=function(t,e,i){var s,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;r;)s=r._next,(r._active||t>=r._startTime&&!r._paused)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=s},r.rawTime=function(){return a||n.wake(),this._totalTime};var O=d("TweenLite",function(e,i,s){if(R.call(this,i,s),this.render=O.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:O.selector(e)||e;var r,n,a,o=e.jquery||e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType),h=this.vars.over
6747write;if(this._overwrite=h=null==h?X[O.defaultOverwrite]:"number"==typeof h?h>>0:X[h],(o||e instanceof Array||e.push&&p(e))&&"number"!=typeof e[0])for(this._targets=a=_.call(e,0),this._propLookup=[],this._siblings=[],r=0;a.length>r;r++)n=a[r],n?"string"!=typeof n?n.length&&n!==t&&n[0]&&(n[0]===t||n[0].nodeType&&n[0].style&&!n.nodeType)?(a.splice(r--,1),this._targets=a=a.concat(_.call(n,0))):(this._siblings[r]=Y(n,this,!1),1===h&&this._siblings[r].length>1&&j(n,this,null,1,this._siblings[r])):(n=a[r--]=O.selector(n),"string"==typeof n&&a.splice(r+1,1)):a.splice(r--,1);else this._propLookup={},this._siblings=Y(e,this,!1),1===h&&this._siblings.length>1&&j(e,this,null,1,this._siblings);(this.vars.immediateRender||0===i&&0===this._delay&&this.vars.immediateRender!==!1)&&this.render(-this._delay,!1,!0)},!0),D=function(e){return e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType)},M=function(t,e){var i,s={};for(i in t)L[i]||i in e&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!E[i]||E[i]&&E[i]._autoCSS)||(s[i]=t[i],delete t[i]);t.css=s};r=O.prototype=new R,r.constructor=O,r.kill()._gc=!1,r.ratio=0,r._firstPT=r._targets=r._overwrittenProps=r._startAt=null,r._notifyPluginsOfEnabled=!1,O.version="1.11.5",O.defaultEase=r._ease=new y(null,null,1,1),O.defaultOverwrite="auto",O.ticker=n,O.autoSleep=!0,O.selector=t.$||t.jQuery||function(e){return t.$?(O.selector=t.$,t.$(e)):t.document?t.document.getElementById("#"===e.charAt(0)?e.substr(1):e):e};var I=O._internals={isArray:p,isSelector:D},E=O._plugins={},N=O._tweenLookup={},F=0,L=I.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1},X={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},z=R._rootFramesTimeline=new C,U=R._rootTimeline=new C;U._startTime=n.time,z._startTime=n.frame,U._active=z._active=!0,R._updateRoot=function(){if(U.render((n.time-U._startTime)*U._timeScale,!1,!1),z.render((n.frame-z._startTime)*z._timeScale,!1,!1),!(n.frame%120)){var t,e,i;for(i in N){for(e=N[i].tweens,t=e.length;--t>-1;)e[t]._gc&&e.splice(t,1);0===e.length&&delete N[i]}if(i=U._first,(!i||i._paused)&&O.autoSleep&&!z._first&&1===n._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||n.sleep()}}},n.addEventListener("tick",R._updateRoot);var Y=function(t,e,i){var s,r,n=t._gsTweenID;if(N[n||(t._gsTweenID=n="t"+F++)]||(N[n]={target:t,tweens:[]}),e&&(s=N[n].tweens,s[r=s.length]=e,i))for(;--r>-1;)s[r]===e&&s.splice(r,1);return N[n].tweens},j=function(t,e,i,s,r){var n,a,o,h;if(1===s||s>=4){for(h=r.length,n=0;h>n;n++)if((o=r[n])!==e)o._gc||o._enabled(!1,!1)&&(a=!0);else if(5===s)break;return a}var _,u=e._startTime+l,p=[],c=0,f=0===e._duration;for(n=r.length;--n>-1;)(o=r[n])===e||o._gc||o._paused||(o._timeline!==e._timeline?(_=_||B(e,0,f),0===B(o,_,f)&&(p[c++]=o)):u>=o._startTime&&o._startTime+o.totalDuration()/o._timeScale>u&&((f||!o._initted)&&2e-10>=u-o._startTime||(p[c++]=o)));for(n=c;--n>-1;)o=p[n],2===s&&o._kill(i,t)&&(a=!0),(2!==s||!o._firstPT&&o._initted)&&o._enabled(!1,!1)&&(a=!0);return a},B=function(t,e,i){for(var s=t._timeline,r=s._timeScale,n=t._startTime;s._timeline;){if(n+=s._startTime,r*=s._timeScale,s._paused)return-100;s=s._timeline}return n/=r,n>e?n-e:i&&n===e||!t._initted&&2*l>n-e?l:(n+=t.totalDuration()/t._timeScale/r)>e+l?0:n-e-l};r._init=function(){var t,e,i,s,r=this.vars,n=this._overwrittenProps,a=this._duration,o=r.immediateRender,h=r.ease;if(r.startAt){if(this._startAt&&this._startAt.render(-1,!0),r.startAt.overwrite=0,r.startAt.immediateRender=!0,this._startAt=O.to(this.target,0,r.startAt),o)if(this._time>0)this._startAt=null;else if(0!==a)return}else if(r.runBackwards&&0!==a)if(this._startAt)this._startAt.render(-1,!0),this._startAt=null;else{i={};for(s in r)L[s]&&"autoCSS"!==s||(i[s]=r[s]);if(i.overwrite=0,i.data="isFromStart",this._startAt=O.to(this.target,0,i),r.immediateRender){if(0===this._time)return}else this._startAt.render(-1,!0)}if(this._ease=h?h instanceof y?r.easeParams instanceof Array?h.config.apply(h,r.easeParams):h:"function"==typeof h?new y(
6747h,r.easeParams):T[h]||O.defaultEase:O.defaultEase,this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(t=this._targets.length;--t>-1;)this._initProps(this._targets[t],this._propLookup[t]={},this._siblings[t],n?n[t]:null)&&(e=!0);else e=this._initProps(this.target,this._propLookup,this._siblings,n);if(e&&O._onPluginEvent("_onInitAllProps",this),n&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),r.runBackwards)for(i=this._firstPT;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onUpdate=r.onUpdate,this._initted=!0},r._initProps=function(e,i,s,r){var n,a,o,h,l,_;if(null==e)return!1;this.vars.css||e.style&&e!==t&&e.nodeType&&E.css&&this.vars.autoCSS!==!1&&M(this.vars,e);for(n in this.vars){if(_=this.vars[n],L[n])_&&(_ instanceof Array||_.push&&p(_))&&-1!==_.join("").indexOf("{self}")&&(this.vars[n]=_=this._swapSelfInParams(_,this));else if(E[n]&&(h=new E[n])._onInitTween(e,this.vars[n],this)){for(this._firstPT=l={_next:this._firstPT,t:h,p:"setRatio",s:0,c:1,f:!0,n:n,pg:!0,pr:h._priority},a=h._overwriteProps.length;--a>-1;)i[h._overwriteProps[a]]=this._firstPT;(h._priority||h._onInitAllProps)&&(o=!0),(h._onDisable||h._onEnable)&&(this._notifyPluginsOfEnabled=!0)}else this._firstPT=i[n]=l={_next:this._firstPT,t:e,p:n,f:"function"==typeof e[n],n:n,pg:!1,pr:0},l.s=l.f?e[n.indexOf("set")||"function"!=typeof e["get"+n.substr(3)]?n:"get"+n.substr(3)]():parseFloat(e[n]),l.c="string"==typeof _&&"="===_.charAt(1)?parseInt(_.charAt(0)+"1",10)*Number(_.substr(2)):Number(_)-l.s||0;l&&l._next&&(l._next._prev=l)}return r&&this._kill(r,e)?this._initProps(e,i,s,r):this._overwrite>1&&this._firstPT&&s.length>1&&j(e,this,i,this._overwrite,s)?(this._kill(i,e),this._initProps(e,i,s,r)):o},r.render=function(t,e,i){var s,r,n,a,o=this._time,h=this._duration;if(t>=h)this._totalTime=this._time=h,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(s=!0,r="onComplete"),0===h&&(a=this._rawPrevTime,(0===t||0>a||a===l)&&a!==t&&(i=!0,a>l&&(r="onReverseComplete")),this._rawPrevTime=a=!e||t||0===a?t:l);else if(1e-7>t)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==o||0===h&&this._rawPrevTime>l)&&(r="onReverseComplete",s=this._reversed),0>t?(this._active=!1,0===h&&(this._rawPrevTime>=0&&(i=!0),this._rawPrevTime=a=!e||t||0===this._rawPrevTime?t:l)):this._initted||(i=!0);else if(this._totalTime=this._time=t,this._easeType){var _=t/h,u=this._easeType,p=this._easePower;(1===u||3===u&&_>=.5)&&(_=1-_),3===u&&(_*=2),1===p?_*=_:2===p?_*=_*_:3===p?_*=_*_*_:4===p&&(_*=_*_*_*_),this.ratio=1===u?1-_:2===u?_:.5>t/h?_/2:1-_/2}else this.ratio=this._ease.getRatio(t/h);if(this._time!==o||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;this._time&&!s?this.ratio=this._ease.getRatio(this._time/h):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._active||!this._paused&&this._time!==o&&t>=0&&(this._active=!0),0===o&&(this._startAt&&(t>=0?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._time||0===h)&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||v))),n=this._firstPT;n;)n.f?n.t[n.p](n.c*this.ratio+n.s):n.t[n.p]=n.c*this.ratio+n.s,n=n._next;this._onUpdate&&(0>t&&this._startAt&&this._startTime&&this._startAt.render(t,e,i),e||(this._time!==o||s)&&this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||v)),r&&(this._gc||(0>t&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"Scope"]||this,this.vars[r+"Params"]||v),0===h&&this._rawPrevTime===l&&a!==l&&(this._rawPrevTime=0)))}},r._kill=function(t,e){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:O.selector(e)||e;var i,s,r,n,a,o,h,l;if((p(e)||D(e))&&"number"!=typeof e[0])for(i=e.length;--i>-1;)this._kill(t,e[i])&&(o=!0);else{if(this._targets){for(i=this._targets.length;--i>-1;)if(e===this._targets[i]){a=this._propLookup[i]||{},this._overwrittenProps=this._overwrittenProps||[],s=this._overwrittenProps[i]=t?this._overwrittenProps[i]||{}:"all";break}}else{if(e!==this.target)return!1;a=this._propLookup,s=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(a){h=t||a,l=t!==s&&"all"!==s&&t!==a&&("object"!=typeof t||!t._tempKill);for(r in h)(n=a[r])&&(n.pg&&n.t._kill(h)&&(o=!0),n.pg&&0!==n.t._overwriteProps.length||(n._prev?n._prev._next=n._next:n===this._firstPT&&(this._firstPT=n._next),n._next&&(n._next._prev=n._prev),n._next=n._prev=null),delete a[r]),l&&(s[r]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return o},r.invalidate=function(){return this._notifyPluginsOfEnabled&&O._onPluginEvent("_onDisable",this),this._firstPT=null,this._overwrittenProps=null,this._onUpdate=null,this._startAt=null,this._initted=this._active=this._notifyPluginsOfEnabled=!1,this._propLookup=this._targets?{}:[],this},r._enabled=function(t,e){if(a||n.wake(),t&&this._gc){var i,s=this._targets;if(s)for(i=s.length;--i>-1;)this._siblings[i]=Y(s[i],this,!0);else this._siblings=Y(this.target,this,!0)}return R.prototype._enabled.call(this,t,e),this._notifyPluginsOfEnabled&&this._firstPT?O._onPluginEvent(t?"_onEnable":"_onDisable",this):!1}
6747,O.to=function(t,e,i){return new O(t,e,i)},O.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new O(t,e,i)},O.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new O(t,e,s)},O.delayedCall=function(t,e,i,s,r){return new O(e,0,{delay:t,onComplete:e,onCompleteParams:i,onCompleteScope:s,onReverseComplete:e,onReverseCompleteParams:i,onReverseCompleteScope:s,immediateRender:!1,useFrames:r,overwrite:0})},O.set=function(t,e){return new O(t,0,e)},O.getTweensOf=function(t,e){if(null==t)return[];t="string"!=typeof t?t:O.selector(t)||t;var i,s,r,n;if((p(t)||D(t))&&"number"!=typeof t[0]){for(i=t.length,s=[];--i>-1;)s=s.concat(O.getTweensOf(t[i],e));for(i=s.length;--i>-1;)for(n=s[i],r=i;--r>-1;)n===s[r]&&s.splice(i,1)}else for(s=Y(t).concat(),i=s.length;--i>-1;)(s[i]._gc||e&&!s[i].isActive())&&s.splice(i,1);return s},O.killTweensOf=O.killDelayedCallsTo=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var s=O.getTweensOf(t,e),r=s.length;--r>-1;)s[r]._kill(i,t)};var q=d("plugins.TweenPlugin",function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=q.prototype},!0);if(r=q.prototype,q.version="1.10.1",q.API=2,r._firstPT=null,r._addTween=function(t,e,i,s,r,n){var a,o;return null!=s&&(a="number"==typeof s||"="!==s.charAt(1)?Number(s)-i:parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)))?(this._firstPT=o={_next:this._firstPT,t:t,p:e,s:i,c:a,f:"function"==typeof t[e],n:r||e,r:n},o._next&&(o._next._prev=o),o):void 0},r.setRatio=function(t){for(var e,i=this._firstPT,s=1e-6;i;)e=i.c*t+i.s,i.r?e=0|e+(e>0?.5:-.5):s>e&&e>-s&&(e=0),i.f?i.t[i.p](e):i.t[i.p]=e,i=i._next},r._kill=function(t){var e,i=this._overwriteProps,s=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(e=i.length;--e>-1;)null!=t[i[e]]&&i.splice(e,1);for(;s;)null!=t[s.n]&&(s._next&&(s._next._prev=s._prev),s._prev?(s._prev._next=s._next,s._prev=null):this._firstPT===s&&(this._firstPT=s._next)),s=s._next;return!1},r._roundProps=function(t,e){for(var i=this._firstPT;i;)(t[this._propName]||null!=i.n&&t[i.n.split(this._propName+"_").join("")])&&(i.r=e),i=i._next},O._onPluginEvent=function(t,e){var i,s,r,n,a,o=e._firstPT;if("_onInitAllProps"===t){for(;o;){for(a=o._next,s=r;s&&s.pr>o.pr;)s=s._next;(o._prev=s?s._prev:n)?o._prev._next=o:r=o,(o._next=s)?s._prev=o:n=o,o=a}o=e._firstPT=r}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},q.activate=function(t){for(var e=t.length;--e>-1;)t[e].API===q.API&&(E[(new t[e])._propName]=t[e]);return!0},m.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,s=t.priority||0,r=t.overwriteProps,n={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_roundProps",initAll:"_onInitAllProps"},a=d("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){q.call(this,i,s),this._overwriteProps=r||[]},t.global===!0),o=a.prototype=new q(i);o.constructor=a,a.API=t.API;for(e in n)"function"==typeof t[e]&&(o[n[e]]=t[e]);return a.version=t.version,q.activate([a]),a},i=t._gsQueue){for(s=0;i.length>s;s++)i[s]();for(r in c)c[r].func||t.console.log("GSAP encountered missing dependency: com.greensock."+r)}a=!1}}(window);
6748	
6749	
6750	/*
6751	panr - v0.0.1 by Robert Bue (@robert_bue)
6752	*/
6753	;(function ( $, window, document, undefined ) {
6754	// Create the defaults once
6755				
6756	var pluginName = "panr",
6757		defaults = {
6758		sensitivity: 10,
6759		moveTarget: "parent",
6760		scale: false,
6761		scaleOnHover: false,
6762		scaleTo: 1.1,
6763		scaleDuration: .28,
6764		panY: true,
6765		panX: true,
6766		panDuration: 1.25,
6767		resetPanOnMouseLeave: true,
6768		onEnter: function(){},
6769		onLeave: function(){}
6770	};
6771	// The actual plugin constructor
6772	function Plugin ( element, options ) {
6773		this.element = element;
6774		//console.log(element);
6775		this.settings = $.extend( {}, defaults, options );
6776		this._defaults = defaults;
6777		this._name = pluginName;
6778		this.init();
6779	}
6780	Plugin.prototype = {
6781		init: function () {
6782		if ( Modernizr.touch ) {
6783			return;
6784		}
6785		// call them like so: this.yourOtherFunction(this.element, this.settings).
6786		//console.log(this.settings);
6787		var settings = this.settings,
6788		target = $(this.element),
6789		w = target.width(),
6790		targetWidth = target.width() - settings.sensitivity,
6791		cx = (w-targetWidth)/targetWidth,
6792		x,
6793		y,
6794		panVars,
6795		xPanVars,
6796		yPanVars,
6797		mouseleaveVars;
6798		//console.log(cx);
6799		if ( settings.scale || (!settings.scaleOnHover && settings.scale) ) {
6800			TweenMax.set(target, { scale: settings.scaleTo });
6801		}
6802		// If no target provided we'll use the hovered element
6803		if ( !settings.moveTarget ) {
6804			settings.moveTarget = $(this.element);
6805		}
6806		if ( settings.moveTarget == "parent" ) {
6807			settings.moveTarget = $(this.element).parent();
6808		}
6809		if ( settings.moveTarget == "parent parent" ) {
6810			settings.moveTarget = $(this.element).parent().parent();
6811		}
6812		if ( settings.moveTarget == "parent parent parent" ) {
6813			settings.moveTarget = $(this.element).parent().parent().parent();
6814		}
6815	
6816		settings.moveTarget.on('mousemove', function(e){
6817			x = e.pageX - target.offset().left; // mouse x coordinate relative to the container
6818			y = e.pageY - target.offset().top; // mouse x coordinate relative to the container
6819			if ( settings.panX ) {
6820				xPanVars = { x: -cx*x };
6821			}
6822			if ( settings.panY ) {
6823				yPanVars = { y: -cx*y };
6824			}
6825			panVars = $.extend({}, xPanVars, yPanVars);
6826	
6827			// Pan element
6828			TweenMax.to(target, settings.panDuration, panVars);
6829		});
6830		// On mouseover
6831		settings.moveTarget.on('mouseenter', function(e){
6832			// Scale up element
6833			TweenMax.to(target, settings.scaleDuration, { scale: settings.scaleTo });
6834			settings.onEnter(target);
6835		});
6836		if ( !settings.scale || (!settings.scaleOnHover && !settings.scale) ) {
6837			mouseleaveVars = { scale: 1.005, x: 0, y: 0 };
6838		} else {
6839		
6840		if ( settings.resetPanOnMouseLeave ) {
6841			mouseleaveVars = { x: 0, y: 0 };
6842		}
6843		}
6844		settings.moveTarget.on('mouseleave', function(e){
6845		// Reset element
6846		TweenMax.to(target, .35, mouseleaveVars );
6847		settings.onLeave(target);
6848		});
6849		}
6850	};
6851	// A really lightweight plugin wrapper around the constructor,
6852	// preventing against multiple instantiations
6853	$.fn[ pluginName ] = function ( options ) {
6854		return this.each(function() {
6855			if ( !$.data( this, "plugin_" + pluginName ) ) {
6856			$.data( this, "plugin_" + pluginName, new Plugin( this, options ) );
6857		}
6858	  });
6859	};
6860	})( jQuery, window, document ); 
6861
6862}
6863
6864
6865
6866/*!
6867 * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+
6868 * http://cherne.net/brian/resources/jquery.hoverIntent.html
6869 */
6870(function(e){e.fn.hoverIntent=function(t,n,r){var i={interval:100,sensitivity:7,timeout:0};if(typeof t==="object"){i=e.extend(i,t)}else if(e.isFunction(n)){i=e.extend(i,{over:t,out:n,selector:r})}else{i=e.extend(i,{over:t,out:t,selector:n})}var s,o,u,a;var f=function(e){s=e.pageX;o=e.pageY};var l=function(t,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if(Math.abs(u-s)+Math.abs(a-o)<i.sensitivity){e(n).off("mousemove.hoverIntent",f);n.hoverIntent_s=1;return i.over.apply(n,[t])}else{u=s;a=o;n.hoverIntent_t=setTimeout(function(){l(t,n)},i.interval)}};var c=function(e,t){t.hoverIntent_t=clearTimeout(t.hoverIntent_t);t.hoverIntent_s=0;return i.out.apply(t,[e])};var h=function(t){var n=jQuery.extend({},t);var r=this;if(r.hoverIntent_t){r.hoverIntent_t=clearTimeout(r.hoverIntent_t)}if(t.type=="mouseenter"){u=n.pageX;a=n.pageY;e(r).on("mousemove.hoverIntent",f);if(r.hoverIntent_s!=1){r.hoverIntent_t=setTimeout(function(){l(n,r)},i.interval)}}else{e(r).off("mousemove.hoverIntent",f);if(r.hoverIntent_s==1){r.hoverIntent_t=setTimeout(function(){c(n,r)},i.timeout)}}};return this.on({"mouseenter.hoverIntent":h,"mouseleave.hoverIntent":h},i.selector)}})(jQuery)

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.