-1)if(_[n.option]){if(e.removeClass(t,"pswp__element--disabled"),n.onInit)n.onInit(t)}else e.addClass(t,"pswp__element--disabled")}};o(s.children);var a=e.getChildByClass(s,"pswp__top-bar");if(a)o(a.children)};i.init=function(){if(e.extend(t.options,C,true),_=t.options,s=e.getChildByClass(t.scrollWrap,"pswp__ui"),g=t.listen,j(),g("beforeChange",i.update),g("doubleTap",(function(e){var i=t.currItem.initialZoomLevel;if(t.getZoomLevel()!==i)t.zoomTo(i,e,333);else t.zoomTo(_.getDoubleTapZoom(false,t.currItem),e,333)})),g("preventDragEvent",(function(t,e,i){var n=t.target||t.srcElement;if(n&&n.getAttribute("class")&&t.type.indexOf("mouse")>-1&&(n.getAttribute("class").indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(n.tagName)))i.prevent=false})),g("bindEvents",(function(){if(e.bind(s,"pswpTap click",A),e.bind(t.scrollWrap,"pswpTap",i.onGlobalTap),!t.likelyTouchDevice)e.bind(t.scrollWrap,"mouseover",i.onMouseOver)})),g("unbindEvents",(function(){if(!p)O();if(P)clearInterval(P);if(e.unbind(document,"mouseout",B),e.unbind(document,"mousemove",H),e.unbind(s,"pswpTap click",A),e.unbind(t.scrollWrap,"pswpTap",i.onGlobalTap),e.unbind(t.scrollWrap,"mouseover",i.onMouseOver),a){if(e.unbind(document,a.eventK,i.updateFullscreen),a.isFullscreen())_.hideAnimationDuration=0,a.exit();a=null}})),g("destroy",(function(){if(_.captionEl){if(u)s.removeChild(u);e.removeClass(l,"pswp__caption--empty")}if(h)h.children[0].onclick=null;e.removeClass(s,"pswp__ui--over-close"),e.addClass(s,"pswp__ui--hidden"),i.setIdle(false)})),!_.showAnimationDuration)e.removeClass(s,"pswp__ui--hidden");if(g("initialZoomIn",(function(){if(_.showAnimationDuration)e.removeClass(s,"pswp__ui--hidden")})),g("initialZoomOut",(function(){e.addClass(s,"pswp__ui--hidden")})),g("parseVerticalMargin",Z),Y(),_.shareEl&&f&&h)p=true;E(),X(),U(),V()},i.setIdle=function(t){v=t,I(s,"ui--idle",t)},i.update=function(){if(o&&t.currItem){if(i.updateIndexIndicator(),_.captionEl)_.addCaptionHTMLFn(t.currItem,l),I(l,"caption--empty",!t.currItem.title);n=true}else n=false;if(!p)O();E()},i.updateFullscreen=function(i){if(i)setTimeout((function(){t.setScrollOffset(0,e.getScrollY())}),50);e[(a.isFullscreen()?"add":"remove")+"Class"](t.template,"pswp--fs")},i.updateIndexIndicator=function(){if(_.counterEl)c.innerHTML=t.getCurrentIndex()+1+_.indexIndicatorSep+_.getNumItemsFn()},i.onGlobalTap=function(n){var a=(n=n||window.event).target||n.srcElement;if(!T)if(n.detail&&"mouse"===n.detail.pointerType){if(z(a))return t.close(),void 0;if(e.hasClass(a,"pswp__img"))if(1===t.getZoomLevel()&&t.getZoomLevel()<=t.currItem.fitRatio){if(_.clickToCloseNonZoomable)t.close()}else t.toggleDesktopZoom(n.detail.releasePoint)}else{if(_.tapToToggleControls)if(o)i.hideControls();else i.showControls();if(_.tapToClose&&(e.hasClass(a,"pswp__img")||z(a)))return t.close(),void 0}},i.onMouseOver=function(t){var e=(t=t||window.event).target||t.srcElement;I(s,"ui--over-close",z(e))},i.hideControls=function(){e.addClass(s,"pswp__ui--hidden"),o=false},i.showControls=function(){if(o=true,!n)i.update();e.removeClass(s,"pswp__ui--hidden")},i.supportsFullscreen=function(){var d=document;return!!(d.exitFullscreen||d.mozCancelFullScreen||d.webkitExitFullscreen||d.msExitFullscreen)},i.getFullscreenAPI=function(){var e=document.documentElement,i,n="fullscreenchange";if(e.requestFullscreen)i={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:n};else if(e.mozRequestFullScreen)i={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+n};else if(e.webkitRequestFullscreen)i={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+n};else if(e.msRequestFullscreen)i={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"};if(i)i.enter=function(){if(m=_.closeOnScroll,_.closeOnScroll=false,"webkitRequestFullscreen"===this.enterK)t.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT);else return t.template[this.enterK]()},i.exit=function(){return _.closeOnScroll=m,document[this.exitK]()},i.isFullscreen=function(){return document[this.elementK]};return i}}}))},7924:function(t,e,i){"use strict";var n=i(6);if(!window.Utility)window.Utility={};Utility.decodeJsonAttribute=function(t){return JSON.parse(decodeURIComponent(atob(t)))},n(window.loadMapsContent)},7925:function(t,e,i){"use strict";var n=i(6);i(7926),n(window).on("load",(function(){var t;if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent||navigator.vendor||window.opera)){var items=n(".u-parallax");if(items.length>0){items.each((function(){var t=n(this);if(t.css("background-attachment","fixed"),t.hasClass("u-shading"))t.attr("data-bottom-top","background-position: 50% 0, 50% 10vh;"),t.attr("data-top-bottom","background-position: 50% 0, 50% -10vh;");else t.attr("data-bottom-top","background-position: 50% 10vh;"),t.attr("data-top-bottom","background-position: 50% -10vh;")}));var e={forceHeight:false};skrollr.init(e)}}}))},7926:function(t,e){var e=void 0,t=void 0;(function(){
+/*!
+ * skrollr core
+ *
+ * Alexander Prinzhorn - https://github.com/Prinzhorn/skrollr
+ *
+ * Free to use under terms of MIT license
+ */
+!function(e,i,n){"use strict";function o(t){if(c=i.documentElement,f=i.body,G(),Ot=this,Nt=(t=t||{}).constants||{},t.easing)for(var n in t.easing)nt[n]=t.easing[n];if(Qt=t.edgeStrategy||"set",Mt={beforerender:t.beforerender,render:t.render,keyframe:t.keyframe},zt=false!==t.forceHeight)Rt=t.scale||1;if($t=t.mobileDeceleration||k,Xt=false!==t.smoothScrolling,jt=t.smoothScrollingDuration||E,Kt={targetTop:Ot.getScrollTop()},Jt=(t.mobileCheck||function(){return/Android|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent||navigator.vendor||e.opera)})()){if(Ft=i.getElementById(t.skrollrBody||I))mt();ot(),Tt(c,[x,T],[_])}else Tt(c,[x,C],[_]);Ot.refresh(),vt(e,"resize orientationchange",(function(){var t=c.clientWidth,e=c.clientHeight;if(e!==Vt||t!==Ut)Vt=e,Ut=t,Wt=true}));var o=J();return!function t(){st(),ne=o(t)}(),Ot}var a={get:function(){return Ot},init:function(t){return Ot||new o(t)},VERSION:"0.6.30"},s=Object.prototype.hasOwnProperty,l=e.Math,u=e.getComputedStyle,c,f,h="touchstart",p="touchmove",m="touchcancel",v="touchend",g="skrollable",y=g+"-before",w=g+"-between",b=g+"-after",x="skrollr",_="no-"+x,C=x+"-desktop",T=x+"-mobile",S="linear",A=1e3,k=.004,I="skrollr-body",E=200,L="start",O="end",F="center",M="bottom",z="___skrollable_id",P=/^(?:input|textarea|button|select)$/i,N=/^\s+|\s+$/g,$=/^data(?:-(_\w+))?(?:-?(-?\d*\.?\d+p?))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/,H=/\s*(@?[\w\-\[\]]+)\s*:\s*(.+?)\s*(?:;|$)/gi,B=/^(@?[a-z\-]+)\[(\w+)\]$/,U=/-([a-z0-9_])/g,V=function(t,e){return e.toUpperCase()},W=/[\-+]?[\d]*\.?[\d]+/g,Z=/\{\?\}/g,X=/rgba?\(\s*-?\d+\s*,\s*-?\d+\s*,\s*-?\d+/g,j=/[a-z\-]+-gradient/g,K="",Y="",G=function(){var t=/^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/;if(u){var style=u(f,null);for(var e in style)if(K=e.match(t)||+e==e&&style[e].match(t))break;if(!K)return K=Y="",void 0;if("-"===(K=K[0]).slice(0,1))Y=K,K={"-webkit-":"webkit","-moz-":"Moz","-ms-":"ms","-o-":"O"}[K];else Y="-"+K.toLowerCase()+"-"}},J=function(){var t=e.requestAnimationFrame||e[K.toLowerCase()+"RequestAnimationFrame"],i=kt();if(Jt||!t)t=function(t){var n=kt()-i,o=l.max(0,1e3/60-n);return e.setTimeout((function(){i=kt(),t()}),o)};return t},tt=function(){var t=e.cancelAnimationFrame||e[K.toLowerCase()+"CancelAnimationFrame"];if(Jt||!t)t=function(t){return e.clearTimeout(t)};return t},nt={begin:function(){return 0},end:function(){return 1},linear:function(t){return t},quadratic:function(t){return t*t},cubic:function(t){return t*t*t},swing:function(t){return-l.cos(t*l.PI)/2+.5},sqrt:function(t){return l.sqrt(t)},outCubic:function(t){return l.pow(t-1,3)+1},bounce:function(t){var e;if(t<=.5083)e=3;else if(t<=.8489)e=9;else if(t<=.96208)e=27;else if(t<=.99981)e=91;else return 1;return 1-l.abs(3*l.cos(t*e*1.028)/e)}};o.prototype.refresh=function(t){var e,o,a=false;if(t===n)a=true,Dt=[],Gt=0,t=i.getElementsByTagName("*");else if(t.length===n)t=[t];for(e=0,o=t.length;ePt)O=(Pt-L)/E,L=Pt;else if(L<0)O=-L/E,L=0;I*=1-O,Ot.animateTo(L+.5|0,{easing:"outCubic",duration:I});break}})),e.scrollTo(0,0),c.style.overflow=f.style.overflow="hidden"},rt=function(){var t=c.clientHeight,e=xt(),i,n,o,a,s,u,f,h,p,m,v;for(h=0,p=Dt.length;hPt)Pt=f.frame}for(Pt=l.max(Pt,_t()),h=0,p=Dt.length;h
p.frame,x=m?h:p,_=o.emitEvents,C=o.lastFrameIndex,T,S;if(m||v){if(m&&-1===o.edge||v&&1===o.edge)continue;if(m){if(Tt(l,[y],[b,w]),_&&C>-1)wt(l,h.eventType,Ht),o.lastFrameIndex=-1}else if(Tt(l,[b],[y,w]),_&&C=c[A].frame&&u<=c[A+1].frame){var k=c[A],I=c[A+1];for(T in k.props)if(s.call(k.props,T)){var E=(u-k.frame)/(I.frame-k.frame);if(E=k.props[T].easing(E),S=dt(k.props[T].value,I.props[T].value,E),S=ht(S),0===T.indexOf("@"))l.setAttribute(T.substr(1),S);else a.setStyle(l,T,S)}if(_)if(C!==A){if("down"===Ht)wt(l,k.eventType,Ht);else wt(l,I.eventType,Ht);o.lastFrameIndex=A}break}}},st=function(){if(Wt)Wt=false,bt();var t=Ot.getScrollTop(),e,i=kt(),o;if(Zt){if(i>=Zt.endTime)t=Zt.targetTop,e=Zt.done,Zt=n;else o=Zt.easing((i-Zt.startTime)/Zt.duration),t=Zt.startTop+o*Zt.topDiff|0;Ot.setScrollTop(t,true)}else if(!Yt){var s;if(Kt.targetTop-t)Kt={startTop:qt,topDiff:t-qt,targetTop:t,startTime:Bt,endTime:Bt+jt};if(i<=Kt.endTime)o=nt.sqrt((i-Kt.startTime)/jt),t=Kt.startTop+o*Kt.topDiff|0}if(Yt||qt!==t){Yt=false;var l={curTop:t,lastTop:qt,maxTop:Pt,direction:Ht=t>qt?"down":t=0;e--)ft(sk.keyFrames[e],t)},ft=function(t,e){var i;for(i in e)if(!s.call(t.props,i))t.props[i]=e[i];for(i in t.props)e[i]=t.props[i]},dt=function(t,e,i){var n,o=t.length;if(o!==e.length)throw"Can't interpolate between \""+t[0]+'" and "'+e[0]+'"';var a=[t[0]];for(n=1;n-1)e/=100;return(t=$.extend({},t)).offset=function(){return a(this.context,this.element,this.axis,e)},t}i(7928),n.prototype.initialize=function t(e){if(!this.waypoint)if(e&&e.element&&"function"==typeof e.handler)e=l(e),this.waypoint=new Waypoint(e)},n.prototype.destroy=function t(){if(this.waypoint)this.waypoint.destroy(),this.waypoint=null},window.WaypointAdapter=n},7928:function(t,e){var e=void 0,t=void 0;(function(){
+/*!
+Waypoints - 4.0.1
+Copyright © 2011-2016 Caleb Troughton
+Licensed under the MIT license.
+https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
+*/
+!function(){"use strict";function t(n){if(!n)throw new Error("No options passed to Waypoint constructor");if(!n.element)throw new Error("No element option passed to Waypoint constructor");if(!n.handler)throw new Error("No handler option passed to Waypoint constructor");if(this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,n),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=n.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset])this.options.offset=t.offsetAliases[this.options.offset];this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){if(this.enabled)if(this.callback)this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=false,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=true,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var n in i)e.push(i[n]);for(var o=0,a=e.length;on.oldScroll?n.forward:n.backward;for(var s in this.waypoints[i]){var l=this.waypoints[i][s];if(null!==l.triggerPoint){var u=n.oldScroll=l.triggerPoint,f,h;if(u&&c||!u&&!c)l.queueTrigger(a),t[l.group.id]=l.group}}}for(var p in t)t[p].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){if(this.element==this.element.window)return o.viewportHeight();else return this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){if(this.element==this.element.window)return o.viewportWidth();else return this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var n=0,o=t.length;n-1)c=Math.ceil(s.contextDimension*c/100);if(m=s.contextScroll-s.contextOffset,u.triggerPoint=Math.floor(h+m-c),v=f=s.oldScroll,w=!v&&!g,!p&&(y=v&&g))u.queueTrigger(s.backward),i[u.group.id]=u.group;else if(!p&&w)u.queueTrigger(s.forward),i[u.group.id]=u.group;else if(p&&s.oldScroll>=u.triggerPoint)u.queueTrigger(s.forward),i[u.group.id]=u.group}}return o.requestAnimationFrame((function(){for(var t in i)i[t].flushTriggers()})),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in n)n[t].refresh()},e.findByElement=function(t){return n[t.waypointContextKey]},window.onload=function(){if(a)a();e.refreshAll()},o.requestAnimationFrame=function(e){var i;(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t).call(window,e)},o.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function Group(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),i[this.axis][this.name]=this}var i={vertical:{},horizontal:{}},n=window.Waypoint;Group.prototype.add=function(t){this.waypoints.push(t)},Group.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},Group.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var n=this.triggerQueues[i],o="up"===i||"left"===i;n.sort(o?e:t);for(var a=0,s=n.length;a-1)this.waypoints.splice(index,1)},Group.prototype.first=function(){return this.waypoints[0]},Group.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},Group.findOrCreate=function(t){return i[t.axis][t.name]||new Group(t)},n.Group=Group}(),function(){"use strict";function t(t){return t===t.window}function e(e){if(t(e))return e;else return e.defaultView}function i(t){this.element=t,this.handlers={}}var n=window.Waypoint;i.prototype.innerHeight=function(){var e;return t(this.element)?this.element.innerHeight:this.element.clientHeight},i.prototype.innerWidth=function(){var e;return t(this.element)?this.element.innerWidth:this.element.clientWidth},i.prototype.off=function(t,e){function i(t,e,i){for(var n=0,o=e.length-1;n0&&"none"===o.css("display"));o.css("margin-top",parseFloat(o.css("margin-top"))-i+e+"px")}}))};update(),n(window).load(update),n(window).resize(update)}var a=n(".u-body");if(a.hasClass("u-overlap-transparent"))a.data("overlap-transparent",true);if(a.hasClass("u-overlap-contrast"))a.data("overlap-contrast",true);n(window).scroll((function e(){n("header.u-sticky").each((function(){var e=n(this),i=e.nextAll(":visible:first");if(i.length){var o=i.offset().top,s=e.offset().top,l,u=s+t(e)>o,c;if(a.toggleClass("u-sticky-fixed",u),s>o)a.addClass("u-sticky-scroll"),a.removeClass("u-overlap-transparent u-overlap-contrast");else a.toggleClass("u-overlap-transparent",!!a.data("overlap-transparent")),a.toggleClass("u-overlap-contrast",!!a.data("overlap-contrast")),a.removeClass("u-sticky-scroll")}}))}))}))},7930:function(t,e,i){"use strict";function n(t){function e(){c=[];var e=o("html").scrollTop();t.each((function(){var rect=this.getBoundingClientRect();c.push({height:rect.height,top:rect.top+e})}))}function i(index){for(var e=0,i=0;i");n.addClass(h),n.css("height",e+"px"),t.after(n),t.addClass(f),t.css("top",i+"px")}}function l(t){(t=o(t)).nextAll("."+h).remove(),t.removeClass(f),t.css("top","")}var u={},c=[],f="u-sticky-fixed",h="u-sticky-placeholder",p=null;return u.init=function init(){o(window).on("scroll",n),o(window).on("resize",a),e()},u.destroy=function t(){o(window).off("scroll",n),o(window).off("resize",a)},u.refresh=function e(){var n=o("html").scrollTop();t.each((function(t,el){var e=i(t);if(n+e>c[t].top)s(el,c[t].height,e);else l(el)}))},u}var o=i(6);o(window).on("load",(function(){var t,sticky=n(o(".u-section-row.u-sticky"));sticky.init(),sticky.refresh()})),window._npStickyStack=n},7931:function(t,e,i){"use strict";var n=i(6);n((function(){n(".u-nav-container .u-nav-link").each((function(){window._npInitMenuLink(n(this))})),n(".u-nav-container-collapse .u-nav-link").each((function(){window._npInitMenuLink(n(this),true)}))})),window._npInitMenuLink=function t(e,i){var o=n("body"),a=/#.*?$/,s=o.attr("data-home-page-name"),l=o.attr("data-home-page"),pageTitle=n("title").text().trim(),nav=e.closest(".u-menu"),u=nav.attr("data-submenu-level")||"on-click",c=nav.is(".u-menu-mega"),f=e.attr("href")||"",h=(e[0].href||"").replace(a,""),p=f.replace(a,""),m=s||pageTitle,v=e.text().trim(),g=f.replace(/^[^#]+/,"");if(!g||"#"===g||!n(g).length)if(p&&window.location.href.toString()===h||v&&m===v||l&&p===l){var y=e;if(!c||i)y=e.parents(".u-nav-item").children(".u-nav-link");if(y.addClass("active"),"with-reload"===u&&i)y.siblings(".u-nav-popup").addClass("open").css("max-height","none")}}},7932:function(t,e,i){"use strict";var n=i(6),o;if("Microsoft Internet Explorer"===navigator.appName||!!(navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/rv:11/))||void 0!==n.browser&&1===n.browser.msie)n((function(){n(".u-social-icons").each((function(t,e){var i=n(e),size=i.css("height");i.find(".u-svg-link").css("width",size)}))}))},7933:function(t,e,i){"use strict";var Animation=i(7934);window.uAnimation=(new Animation).init()},7934:function(t,e,i){"use strict";function Animation(){this.animationElements=null,this.animationEvents=[],this._section=null,this._sliderNode=null,this._slideNumber=null,this._slideEvent=null,this._animationInfo=null,this._animation=null,this._subscribeQueue=[],this.status="loading",this._onDOMContentLoaded=this._onDOMContentLoaded.bind(this),this._onLoadingComplete=this._onLoadingComplete.bind(this)}function n(t){var e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;if(!e)return t(),void 0;e.apply(window,arguments)}function o(t){return"string"==typeof t.name&&-1!==m.indexOf(t.name.toLowerCase())}function a(t){return"string"==typeof t.direction&&-1!==v.indexOf(t.direction.toLowerCase())}function s(section,t){if(t&&t.length)if(l())for(var e=0;e0)this._pauseAutoplay(),this._delay(e,function(){this._continueAutoplay(),this._clearDelays()}.bind(this))},n.prototype.startInAnimation=function t(){this.animations.forEach(function(animation){animation.start()}.bind(this))},n.prototype.needOutAnimation=function t(){for(var e=0,length=this.animations.length;e0)this._cancelDelays();if(this._continueAutoplay(),!this.needOutAnimation())return this.resetAnimations(),void 0;e.preventDefault();var i=this.countMaxOutAnimationTime(),n="number"==typeof e.to?e.to:null,o=e.direction;setTimeout(function(){if(this.resetAnimations(),null!==n)return $(e.target)["u-carousel"](n),void 0;if("left"===o)return $(e.target)["u-carousel"]("next"),void 0;if("right"===o)$(e.target)["u-carousel"]("prev")}.bind(this),i),this.startOutAnimations()},n.prototype._delay=function t(e,i){this._delays.push(setTimeout((function(){i()}),e))},n.prototype._cancelDelays=function t(){this._delays.forEach((function(id){clearTimeout(id)})),this._delays.length=0},n.prototype._clearDelays=function t(){this._delays.length=0},n.prototype._isAutoplayOnStart=function t(){var e=this.carousel.attr("data-u-ride");if(!e)return false;else return"carousel"===(e=e.toLowerCase())},n.prototype._pauseAutoplay=function t(){this.carousel["u-carousel"]("pause"),this._autoplayPaused=true},n.prototype._continueAutoplay=function t(){if(this._autoplayPaused)this.carousel["u-carousel"]("cycle"),this._autoplayPaused=false},t.exports=n,window.AnimationEventSlider=n},7937:function(t,e,i){"use strict";function n(t){var e=[];if(-1!==a.indexOf(t.name)||t.direction)e.push("transform");if(-1!==s.indexOf(t.name))e.push("opacity");if(-1!==l.indexOf(t.name))e.push("contents");if(0===e.length)e.push("auto");return e.join(", ")}var o={},a=["bounce","headShake","heartBeat","jello","pulse","rubberBand","shake","swing","tada","wobble","bounceIn","flip","flipInX","flipInY","flipOutX","flipOutY","lightSpeedIn","rotateIn","slideIn","hinge","jackInTheBox","rollIn","zoomIn","customAnimationIn","customAnimationOut"],s=["flash","bounceIn","fadeIn","flipInX","flipInY","flipOutX","flipOutY","lightSpeedIn","rotateIn","hinge","jackInTheBox","rollIn","zoomIn","customAnimationIn","customAnimationOut"],l=["counter"];o.hintBrowser=function t(e){if(e&&e.element)e.element.style.willChange=n(e)},o.removeHint=function t(e){e.element.style.willChange="auto"},t.exports=o,window.WillChangeHint=o},7938:function(t,e,i){"use strict";function n(){}var o=i(6);n.prototype.scroll=function(t){var e=o(".u-sticky").toArray().reduce((function(t,el){return t+(o(el).outerHeight(true)||0)}),0);o("html, body").animate({scrollTop:t.offset().top-e})},n.prototype.scrollTop=function(){o("html, body").animate({scrollTop:0})},n.prototype.update=function(t){var e="string"==typeof t?t:o(t.currentTarget).attr("href");if((e=(e||"").replace(/^[^#]+/,"")).match(/^#[\d\w-_]+$/i)){var i=o(e);if(i.length){if(t.preventDefault)t.preventDefault();this.scroll(i)}}},window._npScrollAnchor=new n,o(window).on("load",(function(){window._npScrollAnchor.update(window.location.hash),o("body").on("click","a:not([data-u-slide], [data-u-slide-to], [data-toggle], .u-tab-link, .u-quantity-button)",(function(t){if(!o(this).is(".u-dialog-link"))window._npScrollAnchor.update(t)})),o("body").on("click",".u-back-to-top",(function(){window._npScrollAnchor.scrollTop()}))}))},7939:function(t,e,i){"use strict";var n=i(6),o=i(7940),a="u-gdpr-cookie",s="u-cookies-consent",l="u-button-confirm",u="u-button-decline",c="_u_GDPRConfirmCode";n((function(){var t;try{t=o.get(a)}catch(e){t=false}var e=window[c]||function(){};if(!t){var i=n("."+s);i.addClass("show"),i.find("."+l).on("click",(function(t){t.preventDefault(),o.set(a,true,{expires:365,secure:true}),i.removeClass("show"),e()})),i.find("."+u).on("click",(function(t){t.preventDefault(),o.set(a,false,{expires:365,secure:false}),i.removeClass("show")}))}else if("true"===t)e()}))},7940:function(t,e,i){"use strict";var n,o;
+/*!
+ * JavaScript Cookie v2.2.1
+ * https://github.com/js-cookie/js-cookie
+ *
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
+ * Released under the MIT license
+ */!function(factory){var a;if(true)!(void 0!==(o="function"==typeof(n=factory)?n.call(e,i,e,t):n)&&(t.exports=o)),a=true;if(true)t.exports=factory(),a=true;if(!a){var s=window.Cookies,l=window.Cookies=factory();l.noConflict=function(){return window.Cookies=s,l}}}((function(){function t(){for(var t=0,e={};t100)$(selector).fadeIn().css("display","block");else $(selector).fadeOut()}))}))},7942:function(t,e,i){"use strict";var n=i(6),o=i(7943);window._npScrollSpyInit=function(){var t='.u-menu .u-nav-container .u-nav-link[href*="#"]',e='.u-menu .u-nav-container-collapse .u-nav-link[href*="#"]',i;if(document.querySelectorAll(t).length)try{o(t,{nested:true,offset:function(){return n(".u-header.u-sticky").outerHeight(true)||0}}),o(e,{nested:true,offset:function(){return n(".u-header.u-sticky").outerHeight(true)||0}})}catch(t){console.warn("ScrollSpy: has no items")}},document.addEventListener("gumshoeActivate",(function(t){var link;t.detail.link.classList.add("active")}),false),document.addEventListener("gumshoeDeactivate",(function(t){var link;t.detail.link.classList.remove("active")}),false),n((function(){window._npScrollSpyInit()}))},7943:function(t,e,i){"use strict";(function(i){var n,o;
+/*!
+ * gumshoejs v5.1.2
+ * A simple, framework-agnostic scrollspy script.
+ * (c) 2019 Chris Ferdinandi
+ * MIT License
+ * http://github.com/cferdinandi/gumshoe
+ */!function(i,factory){if(true)!(void 0!==(o=function(){return factory(i)}.apply(e,n=[]))&&(t.exports=o));else if("object"==typeof e)t.exports=factory(i);else i.Gumshoe=factory(i)}(void 0!==i?i:"undefined"!=typeof window?window:this,(function(t){var e={navClass:"active",contentClass:"active",nested:false,nestedClass:"active",offset:0,reflow:false,events:true},i=function(){var t={};return Array.prototype.forEach.call(arguments,(function(e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i]})),t},n=function(type,t,e){if(e.settings.events){var i=new CustomEvent(type,{bubbles:true,cancelable:true,detail:e});t.dispatchEvent(i)}},o=function(t){var e=0;if(t.offsetParent)for(;t;)e+=t.offsetTop,t=t.offsetParent;return e>=0?e:0},a=function(t){if(t)t.sort((function(t,e){var i,n;if(o(t.content)=l())return true;else return false},f=function(t,settings){if(c()&&u(t.content,settings,true))return true;else return false},h=function(t,settings){if(t.length){var e=t[t.length-1];if(f(e,settings))return e;for(var i=t.length-1;i>=0;i--)if(u(t[i].content,settings))return t[i]}},p=function(nav,settings){if(settings.nested&&nav.parentNode){var t=nav.parentNode.closest("li");if(t)t.classList.remove(settings.nestedClass),p(t,settings)}},m=function(items,settings){if(items){var t=items.nav.closest("li");if(t)t.classList.remove(settings.navClass),items.content.classList.remove(settings.contentClass),p(t,settings),n("gumshoeDeactivate",t,{link:items.nav,content:items.content,settings:settings})}},v=function(nav,settings){if(settings.nested){var t=nav.parentNode.closest("li");if(t)t.classList.add(settings.nestedClass),v(t,settings)}},g=function(items,settings){if(items){var t=items.nav.closest("li");if(t)t.classList.add(settings.navClass),items.content.classList.add(settings.contentClass),v(t,settings),n("gumshoeActivate",t,{link:items.nav,content:items.content,settings:settings})}},y;return function(selector,n){var o={},s,l,u,c,settings;o.setup=function(){s=document.querySelectorAll(selector),l=[],Array.prototype.forEach.call(s,(function(t){var e=document.getElementById(decodeURIComponent(t.hash.substr(1)));if(e)l.push({nav:t,content:e})})),a(l)},o.detect=function(){var t=h(l,settings);if(t){if(!u||t.content!==u.content)m(u,settings),g(t,settings),u=t}else if(u)m(u,settings),u=null};var f=function(){if(c)t.cancelAnimationFrame(c);c=t.requestAnimationFrame(o.detect)},p=function(){if(c)t.cancelAnimationFrame(c);c=t.requestAnimationFrame((function(){a(l),o.detect()}))},init;return o.destroy=function(){if(u)m(u,settings);if(t.removeEventListener("scroll",f,false),settings.reflow)t.removeEventListener("resize",p,false);l=null,s=null,u=null,c=null,settings=null},function(){if(settings=i(e,n||{}),o.setup(),o.detect(),t.addEventListener("scroll",f,false),settings.reflow)t.addEventListener("resize",p,false)}(),o}}))}).call(e,i(40))},7944:function(t,e,i){"use strict";var n=i(6),o=i(7945),HorizontalLayoutSlider=i(201);n(window).on("load",(function(){setTimeout((function(){n(".u-gallery").removeClass("u-no-transition"),n(".u-layout-horizontal").each((function(){var gallery=n(this),slider=new HorizontalLayoutSlider(gallery,true);gallery.children(".u-gallery-nav").click((function(t){t.preventDefault();var e=n(t.currentTarget);slider.navigate(e)}))}))}),250)})),n((function(){var t;n("body").on("mouseenter",".u-gallery.u-no-transition",(function(){n(this).closest(".u-gallery").removeClass("u-no-transition")})),new o([".u-gallery.u-product-zoom.u-layout-thumbnails",".u-gallery.u-product-zoom.u-layout-carousel"]).init()}))},7945:function(t,e,i){"use strict";function n(t){this.galleryZoomSelector=t}function o(t){var e=t.currentTarget,i,n=l(e).closest(".u-gallery-item").data("zoom_click"),o=e.getBoundingClientRect(),a=e.querySelector("img"),s=t.clientX,u=t.clientY,c=t.originalEvent.changedTouches;if(!n&&!c){l(e).addClass("hover");var f=s-o.x,h=u-o.y;requestAnimationFrame((function(){var t=f*(1-a.offsetWidth/e.offsetWidth),i=h*(1-a.offsetHeight/e.offsetHeight);a.style.left=t+"px",a.style.top=i+"px"}))}}function a(t){var e=l(t.currentTarget),i;l(e).removeClass("hover"),l(e).closest(".u-gallery-item").data("zoom_click")}function s(t){var e=l(t.currentTarget);l(e).removeClass("hover")}var l=i(6);t.exports=n,n.prototype.init=function(){var t=this.galleryZoomSelector.map((function(selector){return selector+" .u-back-slide"})).join(", "),e=this.galleryZoomSelector.map((function(selector){return selector+" .u-back-image"})).join(", ");l("body").on("mousedown touchstart",t,a),l("body").on("mousemove touchmove",t,o),l("body").on("click mouseup mouseout touchend touchcancel",t,s),l(e).each((function(t,e){var url=e.getAttribute("src");l(e).parent().css("background-image","url("+url+")")}))},window.ImageZoom=n},7946:function(t,e,i){"use strict";var n=i(6),TabsControl=i(181);window._npTabsInit=function(){function t(t){t.preventDefault(),t.stopPropagation();var link=n(t.currentTarget),tabsControl;new TabsControl(link).show()}n("body").on("click",".u-tab-link",t)},n((function(){window._npTabsInit()}))},7947:function(t,e,i){"use strict";var n=i(7948);window._npLazyImages={setup:function(){window.lazySizesConfig=window.lazySizesConfig||{},window.lazySizesConfig.init=false,document.addEventListener("lazybeforeunveil",(function(t){var el=t.target;if(el.matches("video")){var e=el.getAttribute("data-src"),i=el.querySelector("source");if(i&&e)i.setAttribute("src",e)}else{var n=el.getAttribute("data-bg");if(n){var list=cssBgParser.parseElementStyle(getComputedStyle(el));if(list.backgrounds.length)list.backgrounds[0].color="";list.backgrounds.push(new cssBgParser.Background({image:n})),el.style.backgroundImage=list.toString("image")}}}))},init:function(){n.init()}},window._npLazyImages.setup(),$((function(){window._npLazyImages.init()}))},7948:function(t,e,i){"use strict";!function(e,factory){var i=factory(e,e.document,Date);if(e.lazySizes=i,"object"==typeof t&&t.exports)t.exports=i}("undefined"!=typeof window?window:{},(function t(e,i,n){var o,a;if(!function(){var t,i={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:true,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:true,ricTimeout:0,throttleDelay:125};for(t in a=e.lazySizesConfig||e.lazysizesConfig||{},i)if(!(t in a))a[t]=i[t]}(),!i||!i.getElementsByClassName)return{init:function(){},cfg:a,noSupport:true};var s=i.documentElement,l=e.HTMLPictureElement,u="addEventListener",c="getAttribute",f=e[u].bind(e),h=e.setTimeout,p=e.requestAnimationFrame||h,m=e.requestIdleCallback,v=/^picture$/i,g=["load","error","lazyincluded","_lazyloaded"],y={},w=Array.prototype.forEach,b=function(t,e){if(!y[e])y[e]=new RegExp("(\\s|^)"+e+"(\\s|$)");return y[e].test(t[c]("class")||"")&&y[e]},x=function(t,e){if(!b(t,e))t.setAttribute("class",(t[c]("class")||"").trim()+" "+e)},_=function(t,e){var i;if(i=b(t,e))t.setAttribute("class",(t[c]("class")||"").replace(i," "))},C=function(t,e,add){var i=add?u:"removeEventListener";if(add)C(t,e);g.forEach((function(n){t[i](n,e)}))},T=function(t,e,n,a,s){var l=i.createEvent("Event");if(!n)n={};return n.instance=o,l.initEvent(e,!a,!s),l.detail=n,t.dispatchEvent(l),l},S=function(el,t){var i;if(!l&&(i=e.picturefill||a.pf)){if(t&&t.src&&!el[c]("srcset"))el.setAttribute("srcset",t.src);i({reevaluate:true,elements:[el]})}else if(t&&t.src)el.src=t.src},A=function(t,style){return(getComputedStyle(t,null)||{})[style]},k=function(t,e,i){for(i=i||t.offsetWidth;i49?function(){if(m(l,{timeout:s}),s!==a.ricTimeout)s=a.ricTimeout}:N((function(){h(l)}),true);return function(t){var a;if(t=true===t)s=33;if(!e){if(e=true,(a=o-(n.now()-i))<0)a=0;if(t||a<9)u();else h(u,a)}}},H=function(t){var e,i,o=99,a=function(){e=null,t()},s=function(){var t=n.now()-i;if(t0)&&"visible"!=A(o,"overflow"))n=o.getBoundingClientRect(),visible=G>n.left&&Yn.top-1&&K500&&s.clientWidth>500?500:370:a.expand,o._defEx=m,v=m*a.expFactor,g=a.hFac,tt=null,st2&&W>2&&!i.hidden)st=v,ut=0;else if(W>1&&ut>1&<<6)st=m;else st=at;if(p!==u)X=innerWidth+u*g,j=innerHeight+u,f=-1*u,p=u;if(rect=y[e].getBoundingClientRect(),(J=rect.bottom)>=f&&(K=rect.top)<=j&&(G=rect.right)>=f*g&&(Y=rect.left)<=X&&(J||G||Y||K)&&(a.loadHidden||ft(y[e]))&&(U&<<3&&!h&&(W<3||ut<4)||dt(y[e],u))){if(xt(y[e]),l=true,lt>9)break}else if(!l&&U&&!n&<<4&&ut<4&&W>2&&(B[0]||a.preloadAfterLoad)&&(B[0]||!h&&(J||G||Y||K||"auto"!=y[e][c](a.sizesAttr))))n=B[0]||y[e]}else xt(y[e]);if(n&&!l)xt(n)}}),vt=N(mt=function(t){var e=t.target;if(e._lazyCache)return delete e._lazyCache,void 0;ct(t),x(e,a.loadedClass),_(e,a.loadingClass),C(e,gt),T(e,"lazyloaded")}),gt=function(t){vt({target:t.target})},yt=function(t,e){try{t.contentWindow.location.replace(e)}catch(i){t.src=e}},wt=function(t){var e,i=t[c](a.srcsetAttr);if(e=a.customMedia[t[c]("data-media")||t[c]("media")])t.setAttribute("media",e);if(i)t.setAttribute("srcset",i)},bt=N((function(t,e,i,n,o){var s,l,u,f,p,m;if(!(p=T(t,"lazybeforeunveil",e)).defaultPrevented){if(n)if(i)x(t,a.autosizesClass);else t.setAttribute("sizes",n);if(l=t[c](a.srcsetAttr),s=t[c](a.srcAttr),o)f=(u=t.parentNode)&&v.test(u.nodeName||"");if(m=e.firesLoad||"src"in t&&(l||s||f),p={target:t},x(t,a.loadingClass),m)clearTimeout(V),V=h(ct,2500),C(t,gt,true);if(f)w.call(u.getElementsByTagName("source"),wt);if(l)t.setAttribute("srcset",l);else if(s&&!f)if(ot.test(t.nodeName))yt(t,s);else t.src=s;if(o&&(l||f))S(t,{src:s})}if(t._lazyRace)delete t._lazyRace;_(t,a.lazyClass),I((function(){var e=t.complete&&t.naturalWidth>1;if(!m||e){if(e)x(t,"ls-is-cached");mt(p),t._lazyCache=true,h((function(){if("_lazyCache"in t)delete t._lazyCache}),9)}if("lazy"==t.loading)lt--}),true)})),xt=function(t){if(!t._lazyRace){var e,i=nt.test(t.nodeName),n=i&&(t[c](a.sizesAttr)||t[c]("sizes")),o="auto"==n;if(!o&&U||!i||!t[c]("src")&&!t.srcset||t.complete||b(t,a.errorClass)||!b(t,a.lazyClass)){if(e=T(t,"lazyunveilread").detail,o)St.updateElem(t,true,t.offsetWidth);t._lazyRace=true,lt++,bt(t,e,o,n,i)}}},_t=H((function(){a.loadMode=3,pt()})),Tt=function(){if(!U){if(n.now()-Z<999)return h(Tt,999),void 0;U=true,a.loadMode=3,pt(),f("scroll",Ct,true)}},{_:function(){if(Z=n.now(),o.elements=i.getElementsByClassName(a.lazyClass),B=i.getElementsByClassName(a.lazyClass+" "+a.preloadClass),f("scroll",pt,true),f("resize",pt,true),f("pageshow",(function(t){if(t.persisted){var e=i.querySelectorAll("."+a.loadingClass);if(e.length&&e.forEach)p((function(){e.forEach((function(t){if(t.complete)xt(t)}))}))}})),e.MutationObserver)new MutationObserver(pt).observe(s,{childList:true,subtree:true,attributes:true});else s[u]("DOMNodeInserted",pt,true),s[u]("DOMAttrModified",pt,true),setInterval(pt,999);if(f("hashchange",pt,true),["focus","mouseover","click","load","transitionend","animationend"].forEach((function(t){i[u](t,pt,true)})),/d$|^c/.test(i.readyState))Tt();else f("load",Tt),i[u]("DOMContentLoaded",pt),h(Tt,2e4);if(o.elements.length)ht(),I._lsFlush();else pt()},checkElems:pt,unveil:xt,_aLSL:Ct=function(){if(3==a.loadMode)a.loadMode=2;_t()}}),B,U,V,W,Z,X,j,K,Y,G,J,tt,nt,ot,rt,at,st,lt,ut,ct,ft,dt,ht,pt,mt,vt,gt,yt,wt,bt,xt,_t,Ct,Tt,St=(kt=N((function(t,e,i,n){var o,a,s;if(t._lazysizesWidth=n,n+="px",t.setAttribute("sizes",n),v.test(e.nodeName||""))for(a=0,s=(o=e.getElementsByTagName("source")).length;a 'Form submitted from website: %s',
+ 'submitted_by' => 'Visitor IP address: %s',
+ 'too_many_submissions' => 'Too many recent submissions from this IP',
+ 'failed_to_send_email' => 'Failed to send email',
+ 'invalid_field_type' => 'Unknown field type \'%s\'.',
+ 'invalid_form_config' => 'Field \'%s\' has an invalid configuration.',
+ 'unknown_method' => 'Unknown server request method'
+ );
+
+ public function __construct($secret_key) {
+ $this->_secret_key = $secret_key;
+ }
+
+ public function process($form)
+ {
+ if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+ die($this->_getErrorResponse($this->_messages['unknown_method']));
+ }
+
+ if ($this->checkTooManySubmissions($_SERVER['REMOTE_ADDR'])) {
+ die($this->_getErrorResponse($this->_messages['too_many_submissions']));
+ }
+
+ // will die() if there are any errors
+ $this->_checkRequiredFields($form);
+
+ // will die() if there is recaptcha error
+ if ($this->_secret_key) {
+ $this->_checkRecaptcha($form);
+ }
+
+ // will die() if there is a send email problem
+ $this->_formSubmission($form);
+ }
+
+ public function checkTooManySubmissions($ip)
+ {
+ $tooManySubmissions = false;
+ try {
+ if (in_array("sqlite", PDO::getAvailableDrivers(), TRUE)) {
+ $db = new PDO('sqlite:muse-throttle-db.sqlite3');
+ } else if (function_exists("sqlite_open")) {
+ $db = new PDO('sqlite2:muse-throttle-db');
+ } else {
+ return false;
+ }
+ } catch(PDOException $Exception) {
+ return $tooManySubmissions;
+ }
+
+ if ($db)
+ {
+ $res = $db->query("SELECT 1 FROM sqlite_master WHERE type='table' AND name='Submission_History';");
+ if (!$res or $res->fetchColumn() == 0)
+ {
+ $db->exec("CREATE TABLE Submission_History (IP VARCHAR(39), Submission_Date TIMESTAMP)");
+ }
+ $db->exec("DELETE FROM Submission_History WHERE Submission_Date < DATETIME('now','-2 hours')");
+
+ $stmt = $db->prepare("INSERT INTO Submission_History (IP,Submission_Date) VALUES (:ip, DATETIME('now'))");
+ $stmt->bindParam(':ip', $ip);
+ $stmt->execute();
+ $stmt->closeCursor();
+
+ $stmt = $db->prepare("SELECT COUNT(1) FROM Submission_History WHERE IP = :ip;");
+ $stmt->bindParam(':ip', $ip);
+ $stmt->execute();
+ if ($stmt->fetchColumn() > 25) {
+ $tooManySubmissions = true;
+ }
+ // Close file db connection
+ $db = null;
+ }
+ return $tooManySubmissions;
+ }
+
+ private function _checkRequiredFields($form)
+ {
+ $errors = array();
+ foreach ($form['fields'] as $field => $properties) {
+ if (!$properties['required']) {
+ continue;
+ }
+ if (strpos($field, ' ')) {
+ $field = str_replace(' ', '_', $field);
+ }
+ if (!array_key_exists($field, $_REQUEST) || ($_REQUEST[$field] !== "0" && empty($_REQUEST[$field]))) {
+ array_push($errors, array('field' => $field, 'message' => $properties['errors']['required']));
+ } else if (!$this->_checkFieldValueFormat($field, $properties)) {
+ array_push($errors, array('field' => $field, 'message' => $properties['errors']['format']));
+ }
+ }
+ if (!empty($errors)) {
+ die($this->_getErrorResponse(array('fields' => $errors)));
+ }
+ }
+
+ private function _checkRecaptcha($form) {
+ $response = $_REQUEST[$this->_captcha_field];
+ if (empty($response)) {
+ die($this->_getErrorResponse($this->_messages['failed_to_send_email']));
+ }
+
+ $data = array (
+ 'secret' => $this->_secret_key,
+ 'response' => $response,
+ 'remoteip' => $_SERVER['REMOTE_ADDR']
+ );
+
+ if (function_exists('curl_init') && function_exists('curl_exec')) {
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $this->_recaptcha_server);
+ curl_setopt($ch, CURLOPT_HEADER, 0);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+ $r = curl_exec($ch);
+ curl_close($ch);
+ } else {
+ $req = "";
+ foreach ($data as $key => $value) {
+ $req .= $key . '=' . urlencode(stripslashes($value)) . '&';
+ }
+ // Cut the last '&'
+ $req = substr($req, 0, strlen($req)-1);
+
+ $r = file_get_contents($this->_recaptcha_server . '?' . $req);
+ }
+
+ $resp = json_decode($r);
+
+ if (!$resp->success) {
+ die($this->_getErrorResponse($this->_messages['failed_to_send_email']));
+ }
+ }
+
+ private function _checkFieldValueFormat($field, $properties)
+ {
+ if (strpos($field, ' ')) {
+ $field = str_replace(' ', '_', $field);
+ }
+ $value = $this->_getFormFieldValue($field, $properties);
+
+ switch($properties['type']) {
+ case 'checkbox':
+ case 'tel':
+ case 'string':
+ // no format to validate for those fields
+ return true;
+ case 'email':
+ return 1 == preg_match('/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i', $value);
+ default:
+ die($this->_getErrorResponse(sprintf($this->_messages['invalid_field_type'], $properties['type'])));
+ }
+ }
+
+ private function _getFormFieldValue($field, $properties)
+ {
+ $value = isset($_REQUEST[$field]) ? $_REQUEST[$field] : '';
+ switch($properties['type']) {
+ case 'checkbox':
+ return $value ? $value : '';
+ case 'string':
+ case 'tel':
+ case 'email':
+ $returnValues = '';
+ if (is_array($value)) {
+ foreach ($value as $key => $val) {
+ $returnValues .= $this->_encodeValue($val);
+ if ($key !== count($value) - 1) {
+ $returnValues .= ', ';
+ }
+ }
+ } else {
+ $returnValues = $this->_encodeValue($value);
+ }
+ return $returnValues;
+ default:
+ die($this->_getErrorResponse(sprintf($this->_messages['invalid_field_type'], $properties['type'])));
+ }
+ }
+
+ private function _formSubmission($form)
+ {
+ $emailFrom = $form['email']['from'];
+ $formEmail = $emailFrom ? $emailFrom : ((array_key_exists('email', $_REQUEST) && !empty($_REQUEST['email'])) ? $this->_cleanupEmail($_REQUEST['email']) : '');
+ $headers = $this->_getEmailHeaders($formEmail);
+
+ $to = $form['email']['to'];
+ $subject = $form['subject'];
+ $sendIpAddress = isset($form['sendIpAddress']) ? $form['sendIpAddress'] : true;
+ $message = $this->_getEmailBody($subject, $form['email_message'], $form['fields'], $sendIpAddress);
+
+ $sent = @mail($to, $subject, $message, $headers);
+
+ if(!$sent) {
+ die($this->_getErrorResponse($this->_messages['failed_to_send_email']));
+ }
+
+ $success_data = array(
+ 'redirect' => $form['success_redirect']
+ );
+ echo $this->_getFormResponse(true, $success_data);
+ }
+
+ private function _getEmailHeaders($formEmail) {
+ $headers = 'From: ' . $formEmail . PHP_EOL;
+ $headers .= 'Reply-To: ' . $formEmail . PHP_EOL;
+ $headers .= 'X-Mailer: PHP/' . phpversion() . PHP_EOL;
+ $headers .= 'Content-type: text/html; charset=utf-8' . PHP_EOL;
+ return $headers;
+ }
+
+ private function _getEmailBody($subject, $emailMsg, $fields, $sendIpAddress) {
+ $message = '';
+ $message .= '' . $this->_encodeValue($subject) . '';
+ $styles = <<
+ th, td, caption {
+ font-weight: 400;
+ vertical-align: top;
+ text-align: left;
+ }
+
+STYLES;
+
+ $message .= $styles;
+ $message .= '';
+
+ $message .= '';
+ $message .= '';
+
+ $message .= '';
+ $message .= '';
+
+ $message .= '';
+ $message .= '';
+
+ $message .= '';
+ $message .= '';
+ $message .= $emailMsg;
+ $message .= ' | ';
+
+ $message .= '';
+ $message .= '';
+
+ $message .= '';
+ $message .= '';
+
+ $message .= '';
+
+ $sortedFields = array();
+
+ foreach ($fields as $field => $properties) {
+ array_push($sortedFields, array('field' => $field, 'properties' => $properties));
+ }
+
+ // sort fields
+ usort($sortedFields, array(&$this, '_fieldComparer'));
+
+ foreach ($sortedFields as $fieldWrapper) {
+ $message .= '';
+ $message .= '' . $this->_encodeValue($fieldWrapper['properties']['label']) . ':';
+ $message .= '' . $this->_getFormFieldValue($fieldWrapper['field'], $fieldWrapper['properties']) . ' ';
+ $message .= ' | ';
+ }
+
+ $message .= ' ';
+ $message .= ' | ';
+
+ if ($sendIpAddress) {
+ $message .= '';
+ $message .= '';
+ $message .= ' ' . sprintf($this->_messages['submitted_from'], $this->_encodeValue($_SERVER['SERVER_NAME'])) . ' ';
+ $message .= '' . sprintf($this->_messages['submitted_by'], $this->_encodeValue($_SERVER['REMOTE_ADDR'])) . ' ';
+ $message .= ' | ';
+ }
+
+ $message .= ' ';
+ $message .= ' | ';
+ $message .= ' | ';
+ $message .= ' | ';
+ $message .= ' |
';
+ $message .= '