(function($){ "use strict"; function get_configs(){ if(typeof ttSubscrConfig!=='undefined'){ return ttSubscrConfig; }else{ return ''; }} function insert_subscription(form_data,form,options){ $.ajax({ type: 'POST', url: ajaxurl, data: form_data, success: function(response){ process_result(response,form,options); }, error: function (request, status, error){ process_result(request.responseText,form,options); }, dataType: 'json', }); } function process_result(result,form,options){ if(config.result_wrapper){ $(config.result_wrapper.tag,config.result_wrapper.attr).text(result).appendTo(config.result_container_selector); }else{ $(config.result_container_selector).html(result); } if(result==='Subscribed'||result===config.success_msg){ options.success(result,config,form); $(config.result_container_selector).addClass(config.success_class); form.reset(); }else{ options.error(result,config,form); $(config.result_container_selector).addClass(config.error_class); }} function check_required(form,configs){ var all_required_checker=true; $(form).find('[data-tt-subscription-required]').each(function(){ if(!$(this).val()){ all_required_checker=false; $(this).addClass(configs.required_class); }}); return all_required_checker; } function validate_emails(form,configs){ var all_emails_checker=true; $(form).find('[data-tt-subscription-type=email]').each(function(){ if(!validateEmail($(this).val())){ all_emails_checker=false; $(this).addClass(configs.invalid_email_class); }}); return all_emails_checker; } function validateEmail(sEmail){ var filter=/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; if(filter.test(sEmail)){ return true; }else{ return false; }} function clean_result_container(configs){ $(configs.result_container_selector).removeClass(configs.error_class+' '+configs.success_class+ ' ' +configs.animation_done_class).html(''); } function destroy_result_container(form,configs){ $(configs.result_container_selector).removeClass(configs.error_class+' '+configs.success_class).addClass(configs.animation_done_class); if(configs.input_timeout){ $(form).find('input').removeClass(configs.required_class+' '+configs.invalid_email_class); }} $.fn.extend({ tt_subscription: function(options,arg){ var defaults={ success:function(result,config,form){}, error:function(error,config,form){}, required:function(config,form){}, invalid_email:function(config,form){}}; options=$.extend({}, defaults, options); this.each(function(){ new $.tt_subscription(this, options, arg); }); return; }}); var config=get_configs(); $.tt_subscription=function(form, options, arg){ if(options&&typeof(options)==='string'){ if(options==='mymethod1'){ tt_subscription_method1(arg); } else if(options==='mymethod2'){ tt_subscription_method2(arg); } return; } var result_timeout_id; var input_timeout_id; if(config=='') get_configs(); $(form).on('submit',function(event){ event.preventDefault(); clearTimeout(result_timeout_id); var form_data=$(form).serialize(); form_data=form_data + "&action=insert_subscription&subscription-nonce=" + config.subscription_nonce; clean_result_container(config); if(check_required(form,config)){ if(validate_emails(form,config)){ var result=insert_subscription(form_data,form,options); }else{ options.invalid_email(config,form); $(config.result_container_selector).addClass(config.error_class); if(config.result_wrapper){ $(config.result_wrapper.tag,config.result_wrapper.attr).text(config.invalid_email_msg).appendTo(config.result_container_selector); }else{ $(config.result_container_selector).html(config.invalid_email_msg); }} }else{ options.required(config,form); $(config.result_container_selector).addClass(config.error_class); if(config.result_wrapper){ $(config.result_wrapper.tag,config.result_wrapper.attr).text(config.required_msg).appendTo(config.result_container_selector); }else{ $(config.result_container_selector).html(config.required_msg); }} result_timeout_id=setTimeout(function(){destroy_result_container(form,config);},config.result_timeout); }); function tt_subscription_method1(arg){ } function tt_subscription_method2(arg){ }}; $(document).ready(function($){ if(config=='') get_configs(); if($('form[data-tt-subscription]').length) $('form[data-tt-subscription]').tt_subscription() }); })(jQuery); !function(a){function b(){}function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(window),function(){"use strict";function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;be;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a,b){function c(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}function d(){}function e(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=h.length;c>b;b++){var d=h[b];a[d]=0}return a}function f(b){function d(){if(!m){m=!0;var d=a.getComputedStyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentStyle};return function(b){var c=a(b);return c||g("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=b("boxSizing")){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[k]="border-box";var f=document.body||document.documentElement;f.appendChild(e);var h=j(e);l=200===c(h.width),f.removeChild(e)}}}function f(a){if(d(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var b=j(a);if("none"===b.display)return e();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var g=f.isBorderBox=!(!k||!b[k]||"border-box"!==b[k]),m=0,n=h.length;n>m;m++){var o=h[m],p=b[o];p=i(a,p);var q=parseFloat(p);f[o]=isNaN(q)?0:q}var r=f.paddingLeft+f.paddingRight,s=f.paddingTop+f.paddingBottom,t=f.marginLeft+f.marginRight,u=f.marginTop+f.marginBottom,v=f.borderLeftWidth+f.borderRightWidth,w=f.borderTopWidth+f.borderBottomWidth,x=g&&l,y=c(b.width);y!==!1&&(f.width=y+(x?0:r+v));var z=c(b.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerWidth=f.width-(r+v),f.innerHeight=f.height-(s+w),f.outerWidth=f.width+t,f.outerHeight=f.height+u,f}}function i(b,c){if(a.getComputedStyle||-1===c.indexOf("%"))return c;var d=b.style,e=d.left,f=b.runtimeStyle,g=f&&f.left;return g&&(f.left=b.currentStyle.left),d.left=c,c=d.pixelLeft,d.left=e,g&&(f.left=g),c}var j,k,l,m=!1;return f}var g="undefined"==typeof console?d:function(a){console.error(a)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],f):"object"==typeof exports?module.exports=f(require("desandro-get-style-property")):a.getSize=f(a.getStyleProperty)}(window),function(a){function b(a){"function"==typeof a&&(b.isReady?a():g.push(a))}function c(a){var c="readystatechange"===a.type&&"complete"!==f.readyState;b.isReady||c||d()}function d(){b.isReady=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}}function e(e){return"complete"===f.readyState?d():(e.bind(f,"DOMContentLoaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)),b}var f=a.document,g=[];b.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docReady=e(a.eventie)}(window),function(a){"use strict";function b(a,b){return a[g](b)}function c(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}function d(a,b){c(a);for(var d=a.parentNode.querySelectorAll(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1}function e(a,d){return c(a),b(a,d)}var f,g=function(){if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"MatchesSelector";if(a[f])return f}}();if(g){var h=document.createElement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesSelector=f}(Element.prototype),function(a,b){"use strict";"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.docReady,a.matchesSelector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=Object.prototype.toString;d.isArray=function(a){return"[object Array]"==e.call(a)},d.makeArray=function(a){var b=[];if(d.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexOf=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},d.removeFrom=function(a,b){var c=d.indexOf(a,b);-1!=c&&a.splice(c,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1==a.nodeType&&"string"==typeof a.nodeName},d.setText=function(){function a(a,c){b=b||(void 0!==document.documentElement.textContent?"textContent":"innerText"),a[b]=c}var b;return a}(),d.getParent=function(a,b){for(;a!=document.body;)if(a=a.parentNode,c(a,b))return a},d.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},d.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterFindElements=function(a,b){a=d.makeArray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.isElement(h))if(b){c(h,b)&&e.push(h);for(var i=h.querySelectorAll(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)}return e},d.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var f=a.console;return d.htmlInit=function(c,e){b(function(){for(var b=d.toDashed(e),g=document.querySelectorAll(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getAttribute(h);try{k=m&&JSON.parse(m)}catch(n){f&&f.error("Error parsing "+h+" on "+l.nodeName.toLowerCase()+(l.id?"#"+l.id:"")+": "+n);continue}var o=new c(l,k),p=a.jQuery;p&&p.data(l,e,o)}})},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.Outlayer={},a.Outlayer.Item=b(a,a.EventEmitter,a.getSize,a.getStyleProperty,a.fizzyUIUtils))}(window,function(a,b,c,d,e){"use strict";function f(a){for(var b in a)return!1;return b=null,!0}function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}function h(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}var i=a.getComputedStyle,j=i?function(a){return i(a,null)}:function(a){return a.currentStyle},k=d("transition"),l=d("transform"),m=k&&l,n=!!d("perspective"),o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[k],p=["transform","transition","transitionDuration","transitionProperty"],q=function(){for(var a={},b=0,c=p.length;c>b;b++){var e=p[b],f=d(e);f&&f!==e&&(a[e]=f)}return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getSize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=q[c]||c;b[d]=a[c]}},g.prototype.getPosition=function(){var a=j(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=a[c?"left":"right"],f=a[d?"top":"bottom"],g=this.layout.size,h=-1!=e.indexOf("%")?parseFloat(e)/100*g.width:parseInt(e,10),i=-1!=f.indexOf("%")?parseFloat(f)/100*g.height:parseInt(f,10);h=isNaN(h)?0:h,i=isNaN(i)?0:i,h-=c?g.paddingLeft:g.paddingRight,i-=d?g.paddingTop:g.paddingBottom,this.position.x=h,this.position.y=i},g.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isOriginLeft?"paddingLeft":"paddingRight",e=b.isOriginLeft?"left":"right",f=b.isOriginLeft?"right":"left",g=this.position.x+a[d];c[e]=this.getXValue(g),c[f]="";var h=b.isOriginTop?"paddingTop":"paddingBottom",i=b.isOriginTop?"top":"bottom",j=b.isOriginTop?"bottom":"top",k=this.position.y+a[h];c[i]=this.getYValue(k),c[j]="",this.css(c),this.emitEvent("layout",[this])},g.prototype.getXValue=function(a){var b=this.layout.options;return b.percentPosition&&!b.isHorizontal?a/this.layout.size.width*100+"%":a+"px"},g.prototype.getYValue=function(a){var b=this.layout.options;return b.percentPosition&&b.isHorizontal?a/this.layout.size.height*100+"%":a+"px"},g.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={};j.transform=this.getTranslate(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},g.prototype.getTranslate=function(a,b){var c=this.layout.options;return a=c.isOriginLeft?a:-a,b=c.isOriginTop?b:-b,n?"translate3d("+a+"px, "+b+"px, 0)":"translate("+a+"px, "+b+"px)"},g.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},g.prototype.moveTo=m?g.prototype._transitionTo:g.prototype.goTo,g.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},g.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},g.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var r="opacity,"+h(q.transform||"transform");g.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:r,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(o,this,!1))},g.prototype.transition=g.prototype[k?"_transition":"_nonTransition"],g.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyName]||a.propertyName;if(delete b.ingProperties[c],f(b.ingProperties)&&this.disableTransition(),c in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[c]),c in b.onEnd){var d=b.onEnd[c];d.call(this),delete b.onEnd[c]}this.emitEvent("transitionEnd",[this])}},g.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},g.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionProperty:"",transitionDuration:""};return g.prototype.removeTransitionStyles=function(){this.css(t)},g.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},g.prototype.remove=function(){if(!k||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.once("transitionEnd",function(){a.removeElem()}),this.hide()},g.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("visibleStyle");b[c]=this.onRevealTransitionEnd,this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},g.prototype.getHideRevealTransitionEndProperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("hiddenStyle");b[c]=this.onHideTransitionEnd,this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.Outlayer=b(a,a.eventie,a.EventEmitter,a.getSize,a.fizzyUIUtils,a.Outlayer.Item)}(window,function(a,b,c,d,e,f){"use strict";function g(a,b){var c=e.getQueryElement(a);if(!c)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerGUID=d,l[d]=this,this._create(),this.options.isInitLayout&&this.layout()}var h=a.console,i=a.jQuery,j=function(){},k=0,l={};return g.namespace="outlayer",g.Item=f,g.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},g.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},g.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}return d},g.prototype._filterFindItemElements=function(a){return e.filterFindElements(a,this.options.itemSelector)},g.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.getSize()},g.prototype.getSize=function(){this.size=d(this.element)},g.prototype._getMeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.querySelector(f):e.isElement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},g.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}return b},g.prototype._layoutItems=function(a,b){if(this._emitCompleteOnItems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getItemLayoutPosition(f);g.item=f,g.isInstant=b||f.isLayoutInstant,c.push(g)}this._processLayoutQueue(c)}},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},g.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},g.prototype._postLayout=function(){this.resizeContainer()},g.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},g.prototype._getContainerSize=j,g.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},g.prototype._emitCompleteOnItems=function(a,b){function c(){e.dispatchEvent(a+"Complete",null,[b])}function d(){g++,g===f&&c()}var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.dispatchEvent=function(a,b,c){var d=b?[b].concat(c):c;if(this.emitEvent(a,d),i)if(this.$element=this.$element||i(this.element),b){var e=i.Event(b);e.type=a,this.$element.trigger(e,c)}else this.$element.trigger(a,c)},g.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},g.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored},g.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removeFrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=e.makeArray(a)):void 0},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},g.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},g.prototype._manageStamp=j,g.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,e=d(a),f={left:b.left-c.left-e.marginLeft,top:b.top-c.top-e.marginTop,right:c.right-b.right-e.marginRight,bottom:c.bottom-b.bottom-e.marginBottom};return f},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindResize=function(){this.isResizeBound||(b.bind(a,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){this.isResizeBound&&b.unbind(a,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},g.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},g.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},g.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},g.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},g.prototype.reveal=function(a){this._emitCompleteOnItems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitCompleteOnItems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealItemElements=function(a){var b=this.getItems(a);this.reveal(b)},g.prototype.hideItemElements=function(a){var b=this.getItems(a);this.hide(b)},g.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},g.prototype.getItems=function(a){a=e.makeArray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getItem(f);g&&b.push(g)}return b},g.prototype.remove=function(a){var b=this.getItems(a);if(this._emitCompleteOnItems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removeFrom(this.items,f)}},g.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}this.unbindResize();var e=this.element.outlayerGUID;delete l[e],delete this.element.outlayerGUID,i&&i.removeData(this.element,this.constructor.namespace)},g.data=function(a){a=e.getQueryElement(a);var b=a&&a.outlayerGUID;return b&&l[b]},g.create=function(a,b){function c(){g.apply(this,arguments)}return Object.create?c.prototype=Object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.Item=function(){f.apply(this,arguments)},c.Item.prototype=new f,e.htmlInit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.Item=f,g}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],b):"object"==typeof exports?module.exports=b(require("outlayer")):(a.Isotope=a.Isotope||{},a.Isotope.Item=b(a.Outlayer))}(window,function(a){"use strict";function b(){a.Item.apply(this,arguments)}b.prototype=new a.Item,b.prototype._create=function(){this.id=this.layout.itemGUID++,a.Item.prototype._create.call(this),this.sortData={}},b.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var a=this.layout.options.getSortData,b=this.layout._sorters;for(var c in a){var d=b[c];this.sortData[c]=d(this.element,this)}}};var c=b.prototype.destroy;return b.prototype.destroy=function(){c.apply(this,arguments),this.css({display:""})},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],b):"object"==typeof exports?module.exports=b(require("get-size"),require("outlayer")):(a.Isotope=a.Isotope||{},a.Isotope.LayoutMode=b(a.getSize,a.Outlayer))}(window,function(a,b){"use strict";function c(a){this.isotope=a,a&&(this.options=a.options[this.namespace],this.element=a.element,this.items=a.filteredItems,this.size=a.size)}return function(){function a(a){return function(){return b.prototype[a].apply(this.isotope,arguments)}}for(var d=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],e=0,f=d.length;f>e;e++){var g=d[e];c.prototype[g]=a(g)}}(),c.prototype.needsVerticalResizeLayout=function(){var b=a(this.isotope.element),c=this.isotope.size&&b;return c&&b.innerHeight!=this.isotope.size.innerHeight},c.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},c.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},c.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},c.prototype.getSegmentSize=function(a,b){var c=a+b,d="outer"+b;if(this._getMeasurement(c,d),!this[c]){var e=this.getFirstItemSize();this[c]=e&&e[d]||this.isotope.size["inner"+b]}},c.prototype.getFirstItemSize=function(){var b=this.isotope.filteredItems[0];return b&&b.element&&a(b.element)},c.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},c.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},c.modes={},c.create=function(a,b){function d(){c.apply(this,arguments)}return d.prototype=new c,b&&(d.options=b),d.prototype.namespace=a,c.modes[a]=d,d},c}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.Masonry=b(a.Outlayer,a.getSize,a.fizzyUIUtils)}(window,function(a,b,c){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}var d=this.columnWidth+=this.gutter,e=this.containerWidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=Math[h](f),this.cols=Math.max(f,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c.indexOf(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],b):"object"==typeof exports?module.exports=b(require("../layout-mode"),require("masonry-layout")):b(a.Isotope.LayoutMode,a.Masonry)}(window,function(a,b){"use strict";function c(a,b){for(var c in b)a[c]=b[c];return a}var d=a.create("masonry"),e=d.prototype._getElementOffset,f=d.prototype.layout,g=d.prototype._getMeasurement; c(d.prototype,b.prototype),d.prototype._getElementOffset=e,d.prototype.layout=f,d.prototype._getMeasurement=g;var h=d.prototype.measureColumns;d.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,h.call(this)};var i=d.prototype._manageStamp;return d.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,i.apply(this,arguments)},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],b):"object"==typeof exports?module.exports=b(require("../layout-mode")):b(a.Isotope.LayoutMode)}(window,function(a){"use strict";var b=a.create("fitRows");return b.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},b.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth+this.gutter,c=this.isotope.size.innerWidth+this.gutter;0!==this.x&&b+this.x>c&&(this.x=0,this.y=this.maxY);var d={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+a.size.outerHeight),this.x+=b,d},b.prototype._getContainerSize=function(){return{height:this.maxY}},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],b):"object"==typeof exports?module.exports=b(require("../layout-mode")):b(a.Isotope.LayoutMode)}(window,function(a){"use strict";var b=a.create("vertical",{horizontalAlignment:0});return b.prototype._resetLayout=function(){this.y=0},b.prototype._getItemLayoutPosition=function(a){a.getSize();var b=(this.isotope.size.innerWidth-a.size.outerWidth)*this.options.horizontalAlignment,c=this.y;return this.y+=a.size.outerHeight,{x:b,y:c}},b.prototype._getContainerSize=function(){return{height:this.y}},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","fizzy-ui-utils/utils","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],function(c,d,e,f,g,h){return b(a,c,d,e,f,g,h)}):"object"==typeof exports?module.exports=b(a,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("./item"),require("./layout-mode"),require("./layout-modes/masonry"),require("./layout-modes/fit-rows"),require("./layout-modes/vertical")):a.Isotope=b(a,a.Outlayer,a.getSize,a.matchesSelector,a.fizzyUIUtils,a.Isotope.Item,a.Isotope.LayoutMode)}(window,function(a,b,c,d,e,f,g){function h(a,b){return function(c,d){for(var e=0,f=a.length;f>e;e++){var g=a[e],h=c.sortData[g],i=d.sortData[g];if(h>i||i>h){var j=void 0!==b[g]?b[g]:b,k=j?1:-1;return(h>i?1:-1)*k}}return 0}}var i=a.jQuery,j=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^\s+|\s+$/g,"")},k=document.documentElement,l=k.textContent?function(a){return a.textContent}:function(a){return a.innerText},m=b.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});m.Item=f,m.LayoutMode=g,m.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),b.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var a in g.modes)this._initLayoutMode(a)},m.prototype.reloadItems=function(){this.itemGUID=0,b.prototype.reloadItems.call(this)},m.prototype._itemize=function(){for(var a=b.prototype._itemize.apply(this,arguments),c=0,d=a.length;d>c;c++){var e=a[c];e.id=this.itemGUID++}return this._updateItemsSortData(a),a},m.prototype._initLayoutMode=function(a){var b=g.modes[a],c=this.options[a]||{};this.options[a]=b.options?e.extend(b.options,c):c,this.modes[a]=new b(this)},m.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?void this.arrange():void this._layout()},m.prototype._layout=function(){var a=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,a),this._isLayoutInited=!0},m.prototype.arrange=function(a){function b(){d.reveal(c.needReveal),d.hide(c.needHide)}this.option(a),this._getIsInstant();var c=this._filter(this.items);this.filteredItems=c.matches;var d=this;this._bindArrangeComplete(),this._isInstant?this._noTransition(b):b(),this._sort(),this._layout()},m.prototype._init=m.prototype.arrange,m.prototype._getIsInstant=function(){var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=a,a},m.prototype._bindArrangeComplete=function(){function a(){b&&c&&d&&e.dispatchEvent("arrangeComplete",null,[e.filteredItems])}var b,c,d,e=this;this.once("layoutComplete",function(){b=!0,a()}),this.once("hideComplete",function(){c=!0,a()}),this.once("revealComplete",function(){d=!0,a()})},m.prototype._filter=function(a){var b=this.options.filter;b=b||"*";for(var c=[],d=[],e=[],f=this._getFilterTest(b),g=0,h=a.length;h>g;g++){var i=a[g];if(!i.isIgnored){var j=f(i);j&&c.push(i),j&&i.isHidden?d.push(i):j||i.isHidden||e.push(i)}}return{matches:c,needReveal:d,needHide:e}},m.prototype._getFilterTest=function(a){return i&&this.options.isJQueryFiltering?function(b){return i(b.element).is(a)}:"function"==typeof a?function(b){return a(b.element)}:function(b){return d(b.element,a)}},m.prototype.updateSortData=function(a){var b;a?(a=e.makeArray(a),b=this.getItems(a)):b=this.items,this._getSorters(),this._updateItemsSortData(b)},m.prototype._getSorters=function(){var a=this.options.getSortData;for(var b in a){var c=a[b];this._sorters[b]=n(c)}},m.prototype._updateItemsSortData=function(a){for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.updateSortData()}};var n=function(){function a(a){if("string"!=typeof a)return a;var c=j(a).split(" "),d=c[0],e=d.match(/^\[(.+)\]$/),f=e&&e[1],g=b(f,d),h=m.sortDataParsers[c[1]];return a=h?function(a){return a&&h(g(a))}:function(a){return a&&g(a)}}function b(a,b){var c;return c=a?function(b){return b.getAttribute(a)}:function(a){var c=a.querySelector(b);return c&&l(c)}}return a}();m.sortDataParsers={parseInt:function(a){return parseInt(a,10)},parseFloat:function(a){return parseFloat(a)}},m.prototype._sort=function(){var a=this.options.sortBy;if(a){var b=[].concat.apply(a,this.sortHistory),c=h(b,this.options.sortAscending);this.filteredItems.sort(c),a!=this.sortHistory[0]&&this.sortHistory.unshift(a)}},m.prototype._mode=function(){var a=this.options.layoutMode,b=this.modes[a];if(!b)throw new Error("No layout mode: "+a);return b.options=this.options[a],b},m.prototype._resetLayout=function(){b.prototype._resetLayout.call(this),this._mode()._resetLayout()},m.prototype._getItemLayoutPosition=function(a){return this._mode()._getItemLayoutPosition(a)},m.prototype._manageStamp=function(a){this._mode()._manageStamp(a)},m.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},m.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},m.prototype.appended=function(a){var b=this.addItems(a);if(b.length){var c=this._filterRevealAdded(b);this.filteredItems=this.filteredItems.concat(c)}},m.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){this._resetLayout(),this._manageStamps();var c=this._filterRevealAdded(b);this.layoutItems(this.filteredItems),this.filteredItems=c.concat(this.filteredItems),this.items=b.concat(this.items)}},m.prototype._filterRevealAdded=function(a){var b=this._filter(a);return this.hide(b.needHide),this.reveal(b.matches),this.layoutItems(b.matches,!0),b.matches},m.prototype.insert=function(a){var b=this.addItems(a);if(b.length){var c,d,e=b.length;for(c=0;e>c;c++)d=b[c],this.element.appendChild(d.element);var f=this._filter(b).matches;for(c=0;e>c;c++)b[c].isLayoutInstant=!0;for(this.arrange(),c=0;e>c;c++)delete b[c].isLayoutInstant;this.reveal(f)}};var o=m.prototype.remove;return m.prototype.remove=function(a){a=e.makeArray(a);var b=this.getItems(a);o.call(this,a);var c=b&&b.length;if(c)for(var d=0;c>d;d++){var f=b[d];e.removeFrom(this.filteredItems,f)}},m.prototype.shuffle=function(){for(var a=0,b=this.items.length;b>a;a++){var c=this.items[a];c.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},m.prototype._noTransition=function(a){var b=this.options.transitionDuration;this.options.transitionDuration=0;var c=a.call(this);return this.options.transitionDuration=b,c},m.prototype.getFilteredItemElements=function(){for(var a=[],b=0,c=this.filteredItems.length;c>b;b++)a.push(this.filteredItems[b].element);return a},m}); ; window.Modernizr=(function(window, document, undefined){ var version='2.7.1', Modernizr={}, enableClasses=true, docElement=document.documentElement, mod='modernizr', modElem=document.createElement(mod), mStyle=modElem.style, inputElem=document.createElement('input') , smile=':)', toString={}.toString, prefixes=' -webkit- -moz- -o- -ms- '.split(' '), omPrefixes='Webkit Moz O ms', cssomPrefixes=omPrefixes.split(' '), domPrefixes=omPrefixes.toLowerCase().split(' '), ns={'svg': 'http://www.w3.org/2000/svg'}, tests={}, inputs={}, attrs={}, classes=[], slice=classes.slice, featureName, injectElementWithStyles=function(rule, callback, nodes, testnames){ var style, ret, node, docOverflow, div=document.createElement('div'), body=document.body, fakeBody=body||document.createElement('body'); if(parseInt(nodes, 10)){ while(nodes--){ node=document.createElement('div'); node.id=testnames ? testnames[nodes]:mod + (nodes + 1); div.appendChild(node); }} style=['­',''].join(''); div.id=mod; (body ? div:fakeBody).innerHTML +=style; fakeBody.appendChild(div); if(!body){ fakeBody.style.background=''; fakeBody.style.overflow='hidden'; docOverflow=docElement.style.overflow; docElement.style.overflow='hidden'; docElement.appendChild(fakeBody); } ret=callback(div, rule); if(!body){ fakeBody.parentNode.removeChild(fakeBody); docElement.style.overflow=docOverflow; }else{ div.parentNode.removeChild(div); } return !!ret; }, isEventSupported=(function(){ var TAGNAMES={ 'select': 'input', 'change': 'input', 'submit': 'form', 'reset': 'form', 'error': 'img', 'load': 'img', 'abort': 'img' }; function isEventSupported(eventName, element){ element=element||document.createElement(TAGNAMES[eventName]||'div'); eventName='on' + eventName; var isSupported=eventName in element; if(!isSupported){ if(!element.setAttribute){ element=document.createElement('div'); } if(element.setAttribute&&element.removeAttribute){ element.setAttribute(eventName, ''); isSupported=is(element[eventName], 'function'); if(!is(element[eventName], 'undefined')){ element[eventName]=undefined; } element.removeAttribute(eventName); }} element=null; return isSupported; } return isEventSupported; })(), _hasOwnProperty=({}).hasOwnProperty, hasOwnProp; if(!is(_hasOwnProperty, 'undefined')&&!is(_hasOwnProperty.call, 'undefined')){ hasOwnProp=function (object, property){ return _hasOwnProperty.call(object, property); };}else{ hasOwnProp=function (object, property){ return ((property in object)&&is(object.constructor.prototype[property], 'undefined')); };} if(!Function.prototype.bind){ Function.prototype.bind=function bind(that){ var target=this; if(typeof target!="function"){ throw new TypeError(); } var args=slice.call(arguments, 1), bound=function (){ if(this instanceof bound){ var F=function(){}; F.prototype=target.prototype; var self=new F(); var result=target.apply(self, args.concat(slice.call(arguments)) ); if(Object(result)===result){ return result; } return self; }else{ return target.apply(that, args.concat(slice.call(arguments)) ); }}; return bound; };} function setCss(str){ mStyle.cssText=str; } function setCssAll(str1, str2){ return setCss(prefixes.join(str1 + ';') +(str2||'')); } function is(obj, type){ return typeof obj===type; } function contains(str, substr){ return !!~('' + str).indexOf(substr); } function testProps(props, prefixed){ for(var i in props){ var prop=props[i]; if(!contains(prop, "-")&&mStyle[prop]!==undefined){ return prefixed=='pfx' ? prop:true; }} return false; } function testDOMProps(props, obj, elem){ for(var i in props){ var item=obj[props[i]]; if(item!==undefined){ if(elem===false) return props[i]; if(is(item, 'function')){ return item.bind(elem||obj); } return item; }} return false; } function testPropsAll(prop, prefixed, elem){ var ucProp=prop.charAt(0).toUpperCase() + prop.slice(1), props=(prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); if(is(prefixed, "string")||is(prefixed, "undefined")){ return testProps(props, prefixed); }else{ props=(prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); return testDOMProps(props, prefixed, elem); }} tests['flexbox']=function(){ return testPropsAll('flexWrap'); }; tests['canvas']=function(){ var elem=document.createElement('canvas'); return !!(elem.getContext&&elem.getContext('2d')); }; tests['canvastext']=function(){ return !!(Modernizr['canvas']&&is(document.createElement('canvas').getContext('2d').fillText, 'function')); }; tests['webgl']=function(){ return !!window.WebGLRenderingContext; }; tests['touch']=function(){ var bool; if(('ontouchstart' in window)||window.DocumentTouch&&document instanceof DocumentTouch){ bool=true; }else{ injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function(node){ bool=node.offsetTop===9; }); } return bool; }; tests['geolocation']=function(){ return 'geolocation' in navigator; }; tests['postmessage']=function(){ return !!window.postMessage; }; tests['websqldatabase']=function(){ return !!window.openDatabase; }; tests['indexedDB']=function(){ return !!testPropsAll("indexedDB", window); }; tests['hashchange']=function(){ return isEventSupported('hashchange', window)&&(document.documentMode===undefined||document.documentMode > 7); }; tests['history']=function(){ return !!(window.history&&history.pushState); }; tests['draganddrop']=function(){ var div=document.createElement('div'); return ('draggable' in div)||('ondragstart' in div&&'ondrop' in div); }; tests['websockets']=function(){ return 'WebSocket' in window||'MozWebSocket' in window; }; tests['rgba']=function(){ setCss('background-color:rgba(150,255,150,.5)'); return contains(mStyle.backgroundColor, 'rgba'); }; tests['hsla']=function(){ setCss('background-color:hsla(120,40%,100%,.5)'); return contains(mStyle.backgroundColor, 'rgba')||contains(mStyle.backgroundColor, 'hsla'); }; tests['multiplebgs']=function(){ setCss('background:url(https://),url(https://),red url(https://)'); return (/(url\s*\(.*?){3}/).test(mStyle.background); }; tests['backgroundsize']=function(){ return testPropsAll('backgroundSize'); }; tests['borderimage']=function(){ return testPropsAll('borderImage'); }; tests['borderradius']=function(){ return testPropsAll('borderRadius'); }; tests['boxshadow']=function(){ return testPropsAll('boxShadow'); }; tests['textshadow']=function(){ return document.createElement('div').style.textShadow===''; }; tests['opacity']=function(){ setCssAll('opacity:.55'); return (/^0.55$/).test(mStyle.opacity); }; tests['cssanimations']=function(){ return testPropsAll('animationName'); }; tests['csscolumns']=function(){ return testPropsAll('columnCount'); }; tests['cssgradients']=function(){ var str1='background-image:', str2='gradient(linear,left top,right bottom,from(#9f9),to(white));', str3='linear-gradient(left top,#9f9, white);'; setCss( (str1 + '-webkit- '.split(' ').join(str2 + str1) + prefixes.join(str3 + str1)).slice(0, -str1.length) ); return contains(mStyle.backgroundImage, 'gradient'); }; tests['cssreflections']=function(){ return testPropsAll('boxReflect'); }; tests['csstransforms']=function(){ return !!testPropsAll('transform'); }; tests['csstransforms3d']=function(){ var ret = !!testPropsAll('perspective'); if(ret&&'webkitPerspective' in docElement.style){ injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function(node, rule){ ret=node.offsetLeft===9&&node.offsetHeight===3; }); } return ret; }; tests['csstransitions']=function(){ return testPropsAll('transition'); }; tests['fontface']=function(){ var bool; injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function(node, rule){ var style=document.getElementById('smodernizr'), sheet=style.sheet||style.styleSheet, cssText=sheet ? (sheet.cssRules&&sheet.cssRules[0] ? sheet.cssRules[0].cssText:sheet.cssText||''):''; bool=/src/i.test(cssText)&&cssText.indexOf(rule.split(' ')[0])===0; }); return bool; }; tests['generatedcontent']=function(){ var bool; injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function(node){ bool=node.offsetHeight >=3; }); return bool; }; tests['video']=function(){ var elem=document.createElement('video'), bool=false; try { if(bool = !!elem.canPlayType){ bool=new Boolean(bool); bool.ogg=elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,''); bool.h264=elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,''); bool.webm=elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,''); }} catch(e){ } return bool; }; tests['audio']=function(){ var elem=document.createElement('audio'), bool=false; try { if(bool = !!elem.canPlayType){ bool=new Boolean(bool); bool.ogg=elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,''); bool.mp3=elem.canPlayType('audio/mpeg;') .replace(/^no$/,''); bool.wav=elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,''); bool.m4a=(elem.canPlayType('audio/x-m4a;') || elem.canPlayType('audio/aac;')) .replace(/^no$/,''); }} catch(e){ } return bool; }; tests['localstorage']=function(){ try { localStorage.setItem(mod, mod); localStorage.removeItem(mod); return true; } catch(e){ return false; }}; tests['sessionstorage']=function(){ try { sessionStorage.setItem(mod, mod); sessionStorage.removeItem(mod); return true; } catch(e){ return false; }}; tests['webworkers']=function(){ return !!window.Worker; }; tests['applicationcache']=function(){ return !!window.applicationCache; }; tests['svg']=function(){ return !!document.createElementNS&&!!document.createElementNS(ns.svg, 'svg').createSVGRect; }; tests['inlinesvg']=function(){ var div=document.createElement('div'); div.innerHTML=''; return (div.firstChild&&div.firstChild.namespaceURI)==ns.svg; }; tests['smil']=function(){ return !!document.createElementNS&&/SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate'))); }; tests['svgclippaths']=function(){ return !!document.createElementNS&&/SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); }; function webforms(){ Modernizr['input']=(function(props){ for(var i=0, len=props.length; i < len; i++){ attrs[ props[i] ] = !!(props[i] in inputElem); } if(attrs.list){ attrs.list = !!(document.createElement('datalist')&&window.HTMLDataListElement); } return attrs; })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); Modernizr['inputtypes']=(function(props){ for(var i=0, bool, inputElemType, defaultView, len=props.length; i < len; i++){ inputElem.setAttribute('type', inputElemType=props[i]); bool=inputElem.type!=='text'; if(bool){ inputElem.value=smile; inputElem.style.cssText='position:absolute;visibility:hidden;'; if(/^range$/.test(inputElemType)&&inputElem.style.WebkitAppearance!==undefined){ docElement.appendChild(inputElem); defaultView=document.defaultView; bool=defaultView.getComputedStyle && defaultView.getComputedStyle(inputElem, null).WebkitAppearance!=='textfield' && (inputElem.offsetHeight!==0); docElement.removeChild(inputElem); }else if(/^(search|tel)$/.test(inputElemType)){ }else if(/^(url|email)$/.test(inputElemType)){ bool=inputElem.checkValidity&&inputElem.checkValidity()===false; }else{ bool=inputElem.value!=smile; }} inputs[ props[i] ] = !!bool; } return inputs; })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); } for(var feature in tests){ if(hasOwnProp(tests, feature)){ featureName=feature.toLowerCase(); Modernizr[featureName]=tests[feature](); classes.push((Modernizr[featureName] ? '':'no-') + featureName); }} Modernizr.input||webforms(); Modernizr.addTest=function(feature, test){ if(typeof feature=='object'){ for(var key in feature){ if(hasOwnProp(feature, key)){ Modernizr.addTest(key, feature[ key ]); }} }else{ feature=feature.toLowerCase(); if(Modernizr[feature]!==undefined){ return Modernizr; } test=typeof test=='function' ? test():test; if(typeof enableClasses!=="undefined"&&enableClasses){ docElement.className +=' ' + (test ? '':'no-') + feature; } Modernizr[feature]=test; } return Modernizr; }; setCss(''); modElem=inputElem=null; ;(function(window, document){ var version='3.7.0'; var options=window.html5||{}; var reSkip=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; var saveClones=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; var supportsHtml5Styles; var expando='_html5shiv'; var expanID=0; var expandoData={}; var supportsUnknownElements; (function(){ try { var a=document.createElement('a'); a.innerHTML=''; supportsHtml5Styles=('hidden' in a); supportsUnknownElements=a.childNodes.length==1||(function(){ (document.createElement)('a'); var frag=document.createDocumentFragment(); return ( typeof frag.cloneNode=='undefined' || typeof frag.createDocumentFragment=='undefined' || typeof frag.createElement=='undefined' ); }()); } catch(e){ supportsHtml5Styles=true; supportsUnknownElements=true; }}()); function addStyleSheet(ownerDocument, cssText){ var p=ownerDocument.createElement('p'), parent=ownerDocument.getElementsByTagName('head')[0]||ownerDocument.documentElement; p.innerHTML='x'; return parent.insertBefore(p.lastChild, parent.firstChild); } function getElements(){ var elements=html5.elements; return typeof elements=='string' ? elements.split(' '):elements; } function getExpandoData(ownerDocument){ var data=expandoData[ownerDocument[expando]]; if(!data){ data={}; expanID++; ownerDocument[expando]=expanID; expandoData[expanID]=data; } return data; } function createElement(nodeName, ownerDocument, data){ if(!ownerDocument){ ownerDocument=document; } if(supportsUnknownElements){ return ownerDocument.createElement(nodeName); } if(!data){ data=getExpandoData(ownerDocument); } var node; if(data.cache[nodeName]){ node=data.cache[nodeName].cloneNode(); }else if(saveClones.test(nodeName)){ node=(data.cache[nodeName]=data.createElem(nodeName)).cloneNode(); }else{ node=data.createElem(nodeName); } return node.canHaveChildren&&!reSkip.test(nodeName)&&!node.tagUrn ? data.frag.appendChild(node):node; } function createDocumentFragment(ownerDocument, data){ if(!ownerDocument){ ownerDocument=document; } if(supportsUnknownElements){ return ownerDocument.createDocumentFragment(); } data=data||getExpandoData(ownerDocument); var clone=data.frag.cloneNode(), i=0, elems=getElements(), l=elems.length; for(;is;s++)if(t=n[s]+e,"string"==typeof r[t])return t}}var n="Webkit Moz ms Ms O".split(" "),r=document.documentElement.style;"function"==typeof define&&define.amd?define(function(){return t}):e.getStyleProperty=t})(window),function(e){"use strict";function t(e){var t=parseFloat(e),n=-1===e.indexOf("%")&&!isNaN(t);return n&&t}function n(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0,n=o.length;n>t;t++){var r=o[t];e[r]=0}return e}function r(e){function r(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=s(e);if("none"===r.display)return n();var f={};f.width=e.offsetWidth,f.height=e.offsetHeight;for(var l=f.isBorderBox=!(!u||!r[u]||"border-box"!==r[u]),c=0,h=o.length;h>c;c++){var p=o[c],d=r[p],v=parseFloat(d);f[p]=isNaN(v)?0:v}var m=f.paddingLeft+f.paddingRight,g=f.paddingTop+f.paddingBottom,y=f.marginLeft+f.marginRight,b=f.marginTop+f.marginBottom,w=f.borderLeftWidth+f.borderRightWidth,E=f.borderTopWidth+f.borderBottomWidth,S=l&&i,x=t(r.width);x!==!1&&(f.width=x+(S?0:m+w));var T=t(r.height);return T!==!1&&(f.height=T+(S?0:g+E)),f.innerWidth=f.width-(m+w),f.innerHeight=f.height-(g+E),f.outerWidth=f.width+y,f.outerHeight=f.height+b,f}}var i,u=e("boxSizing");return function(){if(u){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[u]="border-box";var n=document.body||document.documentElement;n.appendChild(e);var r=s(e);i=200===t(r.width),n.removeChild(e)}}(),r}var i=document.defaultView,s=i&&i.getComputedStyle?function(e){return i.getComputedStyle(e,null)}:function(e){return e.currentStyle},o=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define(["get-style-property"],r):e.getSize=r(e.getStyleProperty)}(window),function(e){"use strict";var t=document.documentElement,n=function(){};t.addEventListener?n=function(e,t,n){e.addEventListener(t,n,!1)}:t.attachEvent&&(n=function(t,n,r){t[n+r]=r.handleEvent?function(){var t=e.event;t.target=t.target||t.srcElement,r.handleEvent.call(r,t)}:function(){var n=e.event;n.target=n.target||n.srcElement,r.call(t,n)},t.attachEvent("on"+n,t[n+r])});var r=function(){};t.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:t.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(r){e[t+n]=void 0}});var i={bind:n,unbind:r};"function"==typeof define&&define.amd?define(i):e.eventie=i}(this),function(e){"use strict";function t(e){"function"==typeof e&&(t.isReady?e():s.push(e))}function n(e){var n="readystatechange"===e.type&&"complete"!==i.readyState;if(!t.isReady&&!n){t.isReady=!0;for(var r=0,u=s.length;u>r;r++){var a=s[r];a()}}}function r(r){return r.bind(i,"DOMContentLoaded",n),r.bind(i,"readystatechange",n),r.bind(e,"load",n),t}var i=e.document,s=[];t.isReady=!1,"function"==typeof define&&define.amd?define(["eventie"],r):e.docReady=r(e.eventie)}(this),function(e){"use strict";function t(){}function n(e,t){if(i)return t.indexOf(e);for(var n=t.length;n--;)if(t[n]===e)return n;return-1}var r=t.prototype,i=Array.prototype.indexOf?!0:!1;r._getEvents=function(){return this._events||(this._events={})},r.getListeners=function(e){var t,n,r=this._getEvents();if("object"==typeof e){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[e]=[]);return t},r.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},r.addListener=function(e,t){var r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&-1===n(t,i[r])&&i[r].push(t);return this},r.on=r.addListener,r.defineEvent=function(e){return this.getListeners(e),this},r.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},r.removeListener=function(e,t){var r,i,s=this.getListenersAsObject(e);for(i in s)s.hasOwnProperty(i)&&(r=n(t,s[i]),-1!==r&&s[i].splice(r,1));return this},r.off=r.removeListener,r.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},r.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},r.manipulateListeners=function(e,t,n){var r,i,s=e?this.removeListener:this.addListener,o=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)s.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?s.call(this,r,i):o.call(this,r,i));return this},r.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if("object"===n)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},r.emitEvent=function(e,t){var n,r,i,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(n=s[r].length;n--;)i=t?s[r][n].apply(null,t):s[r][n](),i===!0&&this.removeListener(e,s[r][n]);return this},r.trigger=r.emitEvent,r.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},"function"==typeof define&&define.amd?define(function(){return t}):e.EventEmitter=t}(this),function(e){"use strict";function t(){}function n(e){function n(t){t.prototype.option||(t.prototype.option=function(t){e.isPlainObject(t)&&(this.options=e.extend(!0,this.options,t))})}function i(t,n){e.fn[t]=function(i){if("string"==typeof i){for(var o=r.call(arguments,1),u=0,a=this.length;a>u;u++){var f=this[u],l=e.data(f,t);if(l)if(e.isFunction(l[i])&&"_"!==i.charAt(0)){var c=l[i].apply(l,o);if(void 0!==c)return c}else s("no such method '"+i+"' for "+t+" instance");else s("cannot call methods on "+t+" prior to initialization; "+"attempted to call '"+i+"'")}return this}return this.each(function(){var r=e.data(this,t);r?(r.option(i),r._init()):(r=new n(this,i),e.data(this,t,r))})}}if(e){var s="undefined"==typeof console?t:function(e){console.error(e)};e.bridget=function(e,t){n(t),i(e,t)}}}var r=Array.prototype.slice;"function"==typeof define&&define.amd?define(["jquery"],n):n(e.jQuery)}(window),function(e,t){"use strict";function n(e,t){return e[u](t)}function r(e){if(!e.parentNode){var t=document.createDocumentFragment();t.appendChild(e)}}function i(e,t){r(e);for(var n=e.parentNode.querySelectorAll(t),i=0,s=n.length;s>i;i++)if(n[i]===e)return!0;return!1}function s(e,t){return r(e),n(e,t)}var o,u=function(){if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],n=0,r=e.length;r>n;n++){var i=e[n],s=i+"MatchesSelector";if(t[s])return s}}();if(u){var a=document.createElement("div"),f=n(a,"div");o=f?n:s}else o=i;"function"==typeof define&&define.amd?define(function(){return o}):window.matchesSelector=o}(this,Element.prototype),function(e){"use strict";function t(e,t){for(var n in t)e[n]=t[n];return e}function n(e,t){e&&(this.element=e,this.layout=t,this.position={x:0,y:0},this._create())}var r=e.getSize,i=e.getStyleProperty,s=e.EventEmitter,o=document.defaultView,u=o&&o.getComputedStyle?function(e){return o.getComputedStyle(e,null)}:function(e){return e.currentStyle},a=i("transition"),f=i("transform"),l=a&&f,c=!!i("perspective"),h={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[a],p=["transform","transition","transitionDuration","transitionProperty"],d=function(){for(var e={},t=0,n=p.length;n>t;t++){var r=p[t],s=i(r);s&&s!==r&&(e[r]=s)}return e}();t(n.prototype,s.prototype),n.prototype._create=function(){this.css({position:"absolute"})},n.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},n.prototype.getSize=function(){this.size=r(this.element)},n.prototype.css=function(e){var t=this.element.style;for(var n in e){var r=d[n]||n;t[r]=e[n]}},n.prototype.getPosition=function(){var e=u(this.element),t=this.layout.options,n=t.isOriginLeft,r=t.isOriginTop,i=parseInt(e[n?"left":"right"],10),s=parseInt(e[r?"top":"bottom"],10);i=isNaN(i)?0:i,s=isNaN(s)?0:s;var o=this.layout.size;i-=n?o.paddingLeft:o.paddingRight,s-=r?o.paddingTop:o.paddingBottom,this.position.x=i,this.position.y=s},n.prototype.layoutPosition=function(){var e=this.layout.size,t=this.layout.options,n={};t.isOriginLeft?(n.left=this.position.x+e.paddingLeft+"px",n.right=""):(n.right=this.position.x+e.paddingRight+"px",n.left=""),t.isOriginTop?(n.top=this.position.y+e.paddingTop+"px",n.bottom=""):(n.bottom=this.position.y+e.paddingBottom+"px",n.top=""),this.css(n),this.emitEvent("layout",[this])};var v=c?function(e,t){return"translate3d("+e+"px, "+t+"px, 0)"}:function(e,t){return"translate("+e+"px, "+t+"px)"};n.prototype._transitionTo=function(e,t){this.getPosition();var n=this.position.x,r=this.position.y,i=parseInt(e,10),s=parseInt(t,10),o=i===this.position.x&&s===this.position.y;if(this.setPosition(e,t),o&&!this.isTransitioning)return this.layoutPosition(),void 0;var u=e-n,a=t-r,f={},l=this.layout.options;u=l.isOriginLeft?u:-u,a=l.isOriginTop?a:-a,f.transform=v(u,a),this.transition({to:f,onTransitionEnd:this.layoutPosition,isCleaning:!0})},n.prototype.goTo=function(e,t){this.setPosition(e,t),this.layoutPosition()},n.prototype.moveTo=l?n.prototype._transitionTo:n.prototype.goTo,n.prototype.setPosition=function(e,t){this.position.x=parseInt(e,10),this.position.y=parseInt(t,10)},n.prototype._nonTransition=function(e){this.css(e.to),e.isCleaning&&this._removeStyles(e.to),e.onTransitionEnd&&e.onTransitionEnd.call(this)},n.prototype._transition=function(e){var t=this.layout.options.transitionDuration;if(!parseFloat(t))return this._nonTransition(e),void 0;var n=e.to,r=[];for(var i in n)r.push(i);var s={};if(s.transitionProperty=r.join(","),s.transitionDuration=t,this.element.addEventListener(h,this,!1),(e.isCleaning||e.onTransitionEnd)&&this.on("transitionEnd",function(t){return e.isCleaning&&t._removeStyles(n),e.onTransitionEnd&&e.onTransitionEnd.call(t),!0}),e.from){this.css(e.from);var o=this.element.offsetHeight;o=null}this.css(s),this.css(n),this.isTransitioning=!0},n.prototype.transition=n.prototype[a?"_transition":"_nonTransition"],n.prototype.onwebkitTransitionEnd=function(e){this.ontransitionend(e)},n.prototype.onotransitionend=function(e){this.ontransitionend(e)},n.prototype.ontransitionend=function(e){e.target===this.element&&(this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1,this.emitEvent("transitionEnd",[this]))},n.prototype._removeStyles=function(e){var t={};for(var n in e)t[n]="";this.css(t)};var m={transitionProperty:"",transitionDuration:""};n.prototype.removeTransitionStyles=function(){this.css(m)},n.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},n.prototype.remove=a?function(){var e=this;this.on("transitionEnd",function(){return e.removeElem(),!0}),this.hide()}:n.prototype.removeElem,n.prototype.reveal=function(){this.css({display:""});var e=this.layout.options;this.transition({from:e.hiddenStyle,to:e.visibleStyle,isCleaning:!0})},n.prototype.hide=function(){this.css({display:""});var e=this.layout.options;this.transition({from:e.visibleStyle,to:e.hiddenStyle,isCleaning:!0,onTransitionEnd:function(){this.css({display:"none"})}})},n.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},e.Outlayer={Item:n}}(window),function(e){"use strict";function t(e,t){for(var n in t)e[n]=t[n];return e}function n(e){return"[object Array]"===y.call(e)}function r(e){var t=[];if(n(e))t=e;else if("number"==typeof e.length)for(var r=0,i=e.length;i>r;r++)t.push(e[r]);else t.push(e);return t}function i(e){return e.replace(/(.)([A-Z])/g,function(e,t,n){return t+"-"+n}).toLowerCase()}function s(e,n){if("string"==typeof e&&(e=d.querySelector(e)),!e||!b(e))return v&&v.error("Bad "+this.settings.namespace+" element: "+e),void 0;this.element=e,this.options=t({},this.options),t(this.options,n);var r=++E;this.element.outlayerGUID=r,S[r]=this,this._create(),this.options.isInitLayout&&this.layout()}function o(e,n){e.prototype[n]=t({},s.prototype[n])}var u=e.Outlayer,a=u.Item,f=e.docReady,l=e.EventEmitter,c=e.eventie,h=e.getSize,p=e.matchesSelector,d=e.document,v=e.console,m=e.jQuery,g=function(){},y=Object.prototype.toString,b="object"==typeof HTMLElement?function(e){return e instanceof HTMLElement}:function(e){return e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName},w=Array.prototype.indexOf?function(e,t){return e.indexOf(t)}:function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},E=0,S={};s.prototype.settings={namespace:"outlayer",item:u.Item},s.prototype.options={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},t(s.prototype,l.prototype),s.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),t(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},s.prototype.reloadItems=function(){this.items=this._getItems(this.element.children)},s.prototype._getItems=function(e){for(var t=this._filterFindItemElements(e),n=this.settings.item,r=[],i=0,s=t.length;s>i;i++){var o=t[i],u=new n(o,this,this.options.itemOptions);r.push(u)}return r},s.prototype._filterFindItemElements=function(e){e=r(e);var t=this.options.itemSelector;if(!t)return e;for(var n=[],i=0,s=e.length;s>i;i++){var o=e[i];p(o,t)&&n.push(o);for(var u=o.querySelectorAll(t),a=0,f=u.length;f>a;a++)n.push(u[a])}return n},s.prototype.getItemElements=function(){for(var e=[],t=0,n=this.items.length;n>t;t++)e.push(this.items[t].element);return e},s.prototype.layout=function(){this._resetLayout(),this._manageStamps();var e=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},s.prototype._init=s.prototype.layout,s.prototype._resetLayout=function(){this.getSize()},s.prototype.getSize=function(){this.size=h(this.element)},s.prototype._getMeasurement=function(e,t){var n,r=this.options[e];r?("string"==typeof r?n=this.element.querySelector(r):b(r)&&(n=r),this[e]=n?h(n)[t]:r):this[e]=0},s.prototype.layoutItems=function(e,t){e=this._getItemsForLayout(e),this._layoutItems(e,t),this._postLayout()},s.prototype._getItemsForLayout=function(e){for(var t=[],n=0,r=e.length;r>n;n++){var i=e[n];i.isIgnored||t.push(i)}return t},s.prototype._layoutItems=function(e,t){if(!e||!e.length)return this.emitEvent("layoutComplete",[this,e]),void 0;this._itemsOn(e,"layout",function(){this.emitEvent("layoutComplete",[this,e])});for(var n=[],r=0,i=e.length;i>r;r++){var s=e[r],o=this._getItemLayoutPosition(s);o.item=s,o.isInstant=t,n.push(o)}this._processLayoutQueue(n)},s.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},s.prototype._processLayoutQueue=function(e){for(var t=0,n=e.length;n>t;t++){var r=e[t];this._positionItem(r.item,r.x,r.y,r.isInstant)}},s.prototype._positionItem=function(e,t,n,r){r?e.goTo(t,n):e.moveTo(t,n)},s.prototype._postLayout=function(){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))},s.prototype._getContainerSize=g,s.prototype._setContainerMeasure=function(e,t){if(void 0!==e){var n=this.size;n.isBorderBox&&(e+=t?n.paddingLeft+n.paddingRight+n.borderLeftWidth+n.borderRightWidth:n.paddingBottom+n.paddingTop+n.borderTopWidth+n.borderBottomWidth),e=Math.max(e,0),this.element.style[t?"width":"height"]=e+"px"}},s.prototype._itemsOn=function(e,t,n){function r(){return i++,i===s&&n.call(o),!0}for(var i=0,s=e.length,o=this,u=0,a=e.length;a>u;u++){var f=e[u];f.on(t,r)}},s.prototype.ignore=function(e){var t=this.getItem(e);t&&(t.isIgnored=!0)},s.prototype.unignore=function(e){var t=this.getItem(e);t&&delete t.isIgnored},s.prototype.stamp=function(e){if(e=this._find(e)){this.stamps=this.stamps.concat(e);for(var t=0,n=e.length;n>t;t++){var r=e[t];this.ignore(r)}}},s.prototype.unstamp=function(e){if(e=this._find(e))for(var t=0,n=e.length;n>t;t++){var r=e[t],i=w(this.stamps,r);-1!==i&&this.stamps.splice(i,1),this.unignore(r)}},s.prototype._find=function(e){return e?("string"==typeof e&&(e=this.element.querySelectorAll(e)),e=r(e)):void 0},s.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var e=0,t=this.stamps.length;t>e;e++){var n=this.stamps[e];this._manageStamp(n)}}},s.prototype._getBoundingRect=function(){var e=this.element.getBoundingClientRect(),t=this.size;this._boundingRect={left:e.left+t.paddingLeft+t.borderLeftWidth,top:e.top+t.paddingTop+t.borderTopWidth,right:e.right-(t.paddingRight+t.borderRightWidth),bottom:e.bottom-(t.paddingBottom+t.borderBottomWidth)}},s.prototype._manageStamp=g,s.prototype._getElementOffset=function(e){var t=e.getBoundingClientRect(),n=this._boundingRect,r=h(e),i={left:t.left-n.left-r.marginLeft,top:t.top-n.top-r.marginTop,right:n.right-t.right-r.marginRight,bottom:n.bottom-t.bottom-r.marginBottom};return i},s.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},s.prototype.bindResize=function(){this.isResizeBound||(c.bind(e,"resize",this),this.isResizeBound=!0)},s.prototype.unbindResize=function(){c.unbind(e,"resize",this),this.isResizeBound=!1},s.prototype.onresize=function(){function e(){t.resize()}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var t=this;this.resizeTimeout=setTimeout(e,100)},s.prototype.resize=function(){var e=h(this.element),t=this.size&&e;t&&e.innerWidth===this.size.innerWidth||(this.layout(),delete this.resizeTimeout)},s.prototype.addItems=function(e){var t=this._getItems(e);if(t.length)return this.items=this.items.concat(t),t},s.prototype.appended=function(e){var t=this.addItems(e);t.length&&(this.layoutItems(t,!0),this.reveal(t))},s.prototype.prepended=function(e){var t=this._getItems(e);if(t.length){var n=this.items.slice(0);this.items=t.concat(n),this._resetLayout(),this.layoutItems(t,!0),this.reveal(t),this.layoutItems(n)}},s.prototype.reveal=function(e){if(e&&e.length)for(var t=0,n=e.length;n>t;t++){var r=e[t];r.reveal()}},s.prototype.hide=function(e){if(e&&e.length)for(var t=0,n=e.length;n>t;t++){var r=e[t];r.hide()}},s.prototype.getItem=function(e){for(var t=0,n=this.items.length;n>t;t++){var r=this.items[t];if(r.element===e)return r}},s.prototype.getItems=function(e){if(e&&e.length){for(var t=[],n=0,r=e.length;r>n;n++){var i=e[n],s=this.getItem(i);s&&t.push(s)}return t}},s.prototype.remove=function(e){e=r(e);var t=this.getItems(e);this._itemsOn(t,"remove",function(){this.emitEvent("removeComplete",[this,t])});for(var n=0,i=t.length;i>n;n++){var s=t[n];s.remove();var o=w(this.items,s);this.items.splice(o,1)}},s.prototype.destroy=function(){var e=this.element.style;e.height="",e.position="",e.width="";for(var t=0,n=this.items.length;n>t;t++){var r=this.items[t];r.destroy()}this.unbindResize(),delete this.element.outlayerGUID},s.data=function(e){var t=e&&e.outlayerGUID;return t&&S[t]},s.create=function(e,n){function r(){s.apply(this,arguments)}return t(r.prototype,s.prototype),o(r,"options"),o(r,"settings"),t(r.prototype.options,n),r.prototype.settings.namespace=e,r.data=s.data,r.Item=function(){a.apply(this,arguments)},r.Item.prototype=new s.Item,r.prototype.settings.item=r.Item,f(function(){for(var t=i(e),n=d.querySelectorAll(".js-"+t),s="data-"+t+"-options",o=0,u=n.length;u>o;o++){var a,f=n[o],l=f.getAttribute(s);try{a=l&&JSON.parse(l)}catch(c){v&&v.error("Error parsing "+s+" on "+f.nodeName.toLowerCase()+(f.id?"#"+f.id:"")+": "+c);continue}var h=new r(f,a);m&&m.data(f,e,h)}}),m&&m.bridget&&m.bridget(e,r),r},s.Item=a,e.Outlayer=s}(window),function(e){"use strict";function t(e,t){var r=e.create("masonry");return r.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var e=this.cols;for(this.colYs=[];e--;)this.colYs.push(0);this.maxY=0},r.prototype.measureColumns=function(){var e=this.items[0].element;this.columnWidth=this.columnWidth||t(e).outerWidth,this.columnWidth+=this.gutter,this.cols=Math.floor((this.size.innerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},r.prototype._getItemLayoutPosition=function(e){e.getSize();var t=Math.ceil(e.size.outerWidth/this.columnWidth);t=Math.min(t,this.cols);for(var r=this._getColGroup(t),s=Math.min.apply(Math,r),o=n(r,s),u={x:this.columnWidth*o,y:s},a=s+e.size.outerHeight,f=this.cols+1-r.length,l=0;f>l;l++)this.colYs[o+l]=a;return u},r.prototype._getColGroup=function(e){if(1===e)return this.colYs;for(var t=[],n=this.cols+1-e,r=0;n>r;r++){var i=this.colYs.slice(r,r+e);t[r]=Math.max.apply(Math,i)}return t},r.prototype._manageStamp=function(e){var n=t(e),r=this._getElementOffset(e),i=this.options.isOriginLeft?r.left:r.right,s=i+n.outerWidth,o=Math.floor(i/this.columnWidth);o=Math.max(0,o);var u=Math.floor(s/this.columnWidth);u=Math.min(this.cols-1,u);for(var a=(this.options.isOriginTop?r.top:r.bottom)+n.outerHeight,f=o;u>=f;f++)this.colYs[f]=Math.max(a,this.colYs[f])},r.prototype._getContainerSize=function(){return this.maxY=Math.max.apply(Math,this.colYs),{height:this.maxY}},r}var n=Array.prototype.indexOf?function(e,t){return e.indexOf(t)}:function(e,t){for(var n=0,r=e.length;r>n;n++){var i=e[n];if(i===t)return n}return-1};"function"==typeof define&&define.amd?define(["outlayer","get-size"],t):e.Masonry=t(e.Outlayer,e.getSize)}(window);(function(e){"use strict";function n(){var n=t["clientHeight"],r=e["innerHeight"];if(n=o}function o(e,t){for(var n in t){if(t.hasOwnProperty(n)){e[n]=t[n]}}return e}function u(e,t){this.el=e;this.options=o(this.defaults,t);this._init()}var t=e.document.documentElement;u.prototype={defaults:{minDuration:0,maxDuration:0,viewportFactor:0},_init:function(){this.items=Array.prototype.slice.call(document.querySelectorAll("#"+this.el.id+" > li"));this.itemsCount=this.items.length;this.itemsRenderedCount=0;this.didScroll=false;var t=this;imagesLoaded(this.el,function(){new Masonry(t.el,{itemSelector:"#grid-effect > li",transitionDuration:0});if(Modernizr.cssanimations){t.items.forEach(function(e,n){if(s(e)){t._checkTotalRendered();classie.add(e,"shown")}});e.addEventListener("scroll",function(){t._onScrollFn()},false);e.addEventListener("resize",function(){t._resizeHandler()},false)}})},_onScrollFn:function(){var e=this;if(!this.didScroll){this.didScroll=true;setTimeout(function(){e._scrollPage()},60)}},_scrollPage:function(){var e=this;this.items.forEach(function(t,i){if(!classie.has(t,"shown")&&!classie.has(t,"animate")&&s(t,e.options.viewportFactor)){setTimeout(function(){var i=r()+n()/2;e.el.style.WebkitPerspectiveOrigin="50% "+i+"px";e.el.style.MozPerspectiveOrigin="50% "+i+"px";e.el.style.perspectiveOrigin="50% "+i+"px";e._checkTotalRendered();if(e.options.minDuration&&e.options.maxDuration){var s=Math.random()*(e.options.maxDuration-e.options.minDuration)+e.options.minDuration+"s";t.style.WebkitAnimationDuration=s;t.style.MozAnimationDuration=s;t.style.animationDuration=s}classie.add(t,"animate")},25)}});this.didScroll=false},_resizeHandler:function(){function t(){e._scrollPage();e.resizeTimeout=null}var e=this;if(this.resizeTimeout){clearTimeout(this.resizeTimeout)}this.resizeTimeout=setTimeout(t,1e3)},_checkTotalRendered:function(){++this.itemsRenderedCount;if(this.itemsRenderedCount===this.itemsCount){e.removeEventListener("scroll",this._onScrollFn)}}};e.AnimOnScroll=u})(window);(function(e,t){function b(e,t){return(i?t.originalEvent.touches[0]:t)["page"+e.toUpperCase()]}function w(t,n,r){var i=e.Event(n,c);e.event.trigger(i,{originalEvent:t},t.target);if(i.isDefaultPrevented())t.preventDefault();if(r){e.event.remove(f,u+"."+a,S);e.event.remove(f,o+"."+a,x)}}function E(t){var n=t.timeStamp||+(new Date);if(d==n)return;d=n;l.x=c.x=b("x",t);l.y=c.y=b("y",t);l.time=n;l.target=t.target;c.orientation=null;c.end=false;h=false;p=false;v=setTimeout(function(){p=true;w(t,"press")},e.Finger.pressDuration);e.event.add(f,u+"."+a,S);e.event.add(f,o+"."+a,x);if(y.preventDefault)t.preventDefault()}function S(t){c.x=b("x",t);c.y=b("y",t);c.dx=c.x-l.x;c.dy=c.y-l.y;c.adx=Math.abs(c.dx);c.ady=Math.abs(c.dy);h=c.adx>y.motionThreshold||c.ady>y.motionThreshold;if(!h)return;clearTimeout(v);if(!c.orientation){if(c.adx>c.ady){c.orientation="horizontal";c.direction=c.dx>0?+1:-1}else{c.orientation="vertical";c.direction=c.dy>0?+1:-1}}if(t.target!==l.target){t.target=l.target;x.call(this,e.Event(o+"."+a,t));return}w(t,"drag")}function x(e){var t=e.timeStamp||+(new Date),n=t-l.time,r;clearTimeout(v);if(e.target!==l.target)return;if(!h&&!p){var i=m===e.target&&t-g.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}";r.className="fit-vids-style";r.id="fit-vids-style";r.style.display="none";r.innerHTML=s;i.parentNode.insertBefore(r,i)}if(t){e.extend(n,t)}return this.each(function(){var t=["iframe[src*='player.vimeo.com']","iframe[src*='youtube.com']","iframe[src*='youtube-nocookie.com']","iframe[src*='kickstarter.com'][src*='video.html']","object","embed"];if(n.customSelector){t.push(n.customSelector)}var r=e(this).find(t.join(","));r=r.not("object object");r.each(function(){var t=e(this);if(this.tagName.toLowerCase()==="embed"&&t.parent("object").length||t.parent(".fluid-width-video-wrapper").length){return}var n=this.tagName.toLowerCase()==="object"||t.attr("height")&&!isNaN(parseInt(t.attr("height"),10))?parseInt(t.attr("height"),10):t.height(),r=!isNaN(parseInt(t.attr("width"),10))?parseInt(t.attr("width"),10):t.width(),i=n/r;if(!t.attr("id")){var s="fitvid"+Math.floor(Math.random()*999999);t.attr("id",s)}t.wrap('
').parent(".fluid-width-video-wrapper").css("padding-top",i*100+"%");t.removeAttr("height").removeAttr("width")})})}})(window.jQuery||window.Zepto);(function(e,t,n){var r=t.matchMedia;if(typeof module!=="undefined"&&module.exports){module.exports=n(r)}else if(typeof define==="function"&&define.amd){define(function(){return t[e]=n(r)})}else{t[e]=n(r)}})("enquire",this,function(e){"use strict";function t(e,t){var n=0,r=e.length,i;for(n;n');this.$.wrap(this.$div).before(this.$c);this.$div=this.$.parent();if(typeof G_vmlCanvasManager!=="undefined"){G_vmlCanvasManager.initElement(this.$c[0])}this.c=this.$c[0].getContext?this.$c[0].getContext("2d"):null;if(!this.c){throw{name:"CanvasNotSupportedException",message:"Canvas not supported. Please use excanvas on IE8.0.",toString:function(){return this.name+": "+this.message}}}this.scale=(window.devicePixelRatio||1)/(this.c.webkitBackingStorePixelRatio||this.c.mozBackingStorePixelRatio||this.c.msBackingStorePixelRatio||this.c.oBackingStorePixelRatio||this.c.backingStorePixelRatio||1);this.relativeWidth=this.o.width%1!==0&&this.o.width.indexOf("%");this.relativeHeight=this.o.height%1!==0&&this.o.height.indexOf("%");this.relative=this.relativeWidth||this.relativeHeight;this._carve();if(this.v instanceof Object){this.cv={};this.copy(this.v,this.cv)}else{this.cv=this.v}this.$.bind("configure",t).parent().bind("configure",t);this._listen()._configure()._xy().init();this.isInit=true;this._draw();return this};this._carve=function(){if(this.relative){var e=this.relativeWidth?this.$div.parent().width()*parseInt(this.o.width)/100:this.$div.parent().width(),t=this.relativeHeight?this.$div.parent().height()*parseInt(this.o.height)/100:this.$div.parent().height();this.w=this.h=Math.min(e,t)}else{this.w=this.o.width;this.h=this.o.height}this.$div.css({width:this.w+"px",height:this.h+"px"});this.$c.attr({width:this.w,height:this.h});if(this.scale!==1){this.$c[0].width=this.$c[0].width*this.scale;this.$c[0].height=this.$c[0].height*this.scale;this.$c.width(this.w);this.$c.height(this.h)}return this};this._draw=function(){var e=true;n.g=n.c;n.clear();n.dH&&(e=n.dH());e!==false&&n.draw()};this._touch=function(e){var r=function(e){var t=n.xy2val(e.originalEvent.touches[n.t].pageX,e.originalEvent.touches[n.t].pageY);if(t==n.cv)return;if(n.cH&&n.cH(t)===false)return;n.change(n._validate(t));n._draw()};this.t=t.c.t(e);r(e);t.c.d.bind("touchmove.k",r).bind("touchend.k",function(){t.c.d.unbind("touchmove.k touchend.k");n.val(n.cv)});return this};this._mouse=function(e){var r=function(e){var t=n.xy2val(e.pageX,e.pageY);if(t==n.cv)return;if(n.cH&&n.cH(t)===false)return;n.change(n._validate(t));n._draw()};r(e);t.c.d.bind("mousemove.k",r).bind("keyup.k",function(e){if(e.keyCode===27){t.c.d.unbind("mouseup.k mousemove.k keyup.k");if(n.eH&&n.eH()===false)return;n.cancel()}}).bind("mouseup.k",function(e){t.c.d.unbind("mousemove.k mouseup.k keyup.k");n.val(n.cv)});return this};this._xy=function(){var e=this.$c.offset();this.x=e.left;this.y=e.top;return this};this._listen=function(){if(!this.o.readOnly){this.$c.bind("mousedown",function(e){e.preventDefault();n._xy()._mouse(e)}).bind("touchstart",function(e){e.preventDefault();n._xy()._touch(e)});this.listen()}else{this.$.attr("readonly","readonly")}if(this.relative){e(window).resize(function(){n._carve().init();n._draw()})}return this};this._configure=function(){if(this.o.draw)this.dH=this.o.draw;if(this.o.change)this.cH=this.o.change;if(this.o.cancel)this.eH=this.o.cancel;if(this.o.release)this.rH=this.o.release;if(this.o.displayPrevious){this.pColor=this.h2rgba(this.o.fgColor,"0.4");this.fgColor=this.h2rgba(this.o.fgColor,"0.6")}else{this.fgColor=this.o.fgColor}return this};this._clear=function(){this.$c[0].width=this.$c[0].width};this._validate=function(e){return~~((e<0?-.5:.5)+e/this.o.step)*this.o.step};this.listen=function(){};this.extend=function(){};this.init=function(){};this.change=function(e){};this.val=function(e){};this.xy2val=function(e,t){};this.draw=function(){};this.clear=function(){this._clear()};this.h2rgba=function(e,t){var n;e=e.substring(1,7);n=[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)];return"rgba("+n[0]+","+n[1]+","+n[2]+","+t+")"};this.copy=function(e,t){for(var n in e){t[n]=e[n]}}};t.Dial=function(){t.o.call(this);this.startAngle=null;this.xy=null;this.radius=null;this.lineWidth=null;this.cursorExt=null;this.w2=null;this.PI2=2*Math.PI;this.extend=function(){this.o=e.extend({bgColor:this.$.data("bgcolor")||"#EEEEEE",angleOffset:this.$.data("angleoffset")||0,angleArc:this.$.data("anglearc")||360,inline:true},this.o)};this.val=function(e,t){if(null!=e){if(t!==false&&e!=this.v&&this.rH&&this.rH(e)===false)return;this.cv=this.o.stopper?n(r(e,this.o.max),this.o.min):e;this.v=this.cv;this.$.val(this.v);this._draw()}else{return this.v}};this.xy2val=function(e,t){var i,s;i=Math.atan2(e-(this.x+this.w2),-(t-this.y-this.w2))-this.angleOffset;if(this.angleArc!=this.PI2&&i<0&&i>-.5){i=0}else if(i<0){i+=this.PI2}s=~~(.5+i*(this.o.max-this.o.min)/this.angleArc)+this.o.min;this.o.stopper&&(s=n(r(s,this.o.max),this.o.min));return s};this.listen=function(){var t=this,i,s,o=function(e){e.preventDefault();var o=e.originalEvent,u=o.detail||o.wheelDeltaX,a=o.detail||o.wheelDeltaY,f=t._validate(t.$.val())+(u>0||a>0?t.o.step:u<0||a<0?-t.o.step:0);f=n(r(f,t.o.max),t.o.min);t.val(f,false);if(t.rH){clearTimeout(i);i=setTimeout(function(){t.rH(f);i=null},100);if(!s){s=setTimeout(function(){if(i)t.rH(f);s=null},200)}}},u,a,f=1,l={37:-t.o.step,38:t.o.step,39:t.o.step,40:-t.o.step};this.$.bind("keydown",function(i){var s=i.keyCode;if(s>=96&&s<=105){s=i.keyCode=s-48}u=parseInt(String.fromCharCode(s));if(isNaN(u)){s!==13&&s!==8&&s!==9&&s!==189&&(s!==190||t.$.val().match(/\./))&&i.preventDefault();if(e.inArray(s,[37,38,39,40])>-1){i.preventDefault();var o=parseFloat(t.$.val())+l[s]*f;t.o.stopper&&(o=n(r(o,t.o.max),t.o.min));t.change(o);t._draw();a=window.setTimeout(function(){f*=2},30)}}}).bind("keyup",function(e){if(isNaN(u)){if(a){window.clearTimeout(a);a=null;f=1;t.val(t.$.val())}}else{t.$.val()>t.o.max&&t.$.val(t.o.max)||t.$.val()this.o.max)this.v=this.o.min;this.$.val(this.v);this.w2=this.w/2;this.cursorExt=this.o.cursor/100;this.xy=this.w2*this.scale;this.lineWidth=this.xy*this.o.thickness;this.lineCap=this.o.lineCap;this.radius=this.xy-this.lineWidth/2;this.o.angleOffset&&(this.o.angleOffset=isNaN(this.o.angleOffset)?0:this.o.angleOffset);this.o.angleArc&&(this.o.angleArc=isNaN(this.o.angleArc)?this.PI2:this.o.angleArc);this.angleOffset=this.o.angleOffset*Math.PI/180;this.angleArc=this.o.angleArc*Math.PI/180;this.startAngle=1.5*Math.PI+this.angleOffset;this.endAngle=1.5*Math.PI+this.angleOffset+this.angleArc;var e=n(String(Math.abs(this.o.max)).length,String(Math.abs(this.o.min)).length,2)+2;this.o.displayInput&&this.i.css({width:(this.w/2+4>>0)+"px",height:(this.w/3>>0)+"px",position:"absolute","vertical-align":"middle","margin-top":(this.w/3>>0)+"px","margin-left":"-"+(this.w*3/4+2>>0)+"px",border:0,background:"none",font:this.o.fontWeight+" "+(this.w/e>>0)+"px "+this.o.font,"text-align":"center",color:this.o.inputColor||this.o.fgColor,padding:"0px","-webkit-appearance":"none"})||this.i.css({width:"0px",visibility:"hidden"})};this.change=function(e){this.cv=e;this.$.val(e)};this.angle=function(e){return(e-this.o.min)*this.angleArc/(this.o.max-this.o.min)};this.draw=function(){var e=this.g,t=this.angle(this.cv),n=this.startAngle,r=n+t,i,s,o=1;e.lineWidth=this.lineWidth;e.lineCap=this.lineCap;this.o.cursor&&(n=r-this.cursorExt)&&(r=r+this.cursorExt);e.beginPath();e.strokeStyle=this.o.bgColor;e.arc(this.xy,this.xy,this.radius,this.endAngle-1e-5,this.startAngle+1e-5,true);e.stroke();if(this.o.displayPrevious){s=this.startAngle+this.angle(this.v);i=this.startAngle;this.o.cursor&&(i=s-this.cursorExt)&&(s=s+this.cursorExt);e.beginPath();e.strokeStyle=this.pColor;e.arc(this.xy,this.xy,this.radius,i-1e-5,s+1e-5,false);e.stroke();o=this.cv==this.v}e.beginPath();e.strokeStyle=o?this.o.fgColor:this.fgColor;e.arc(this.xy,this.xy,this.radius,n-1e-5,r+1e-5,false);e.stroke()};this.cancel=function(){this.val(this.v)}};e.fn.dial=e.fn.knob=function(n){return this.each(function(){var r=new t.Dial;r.o=n;r.$=e(this);r.run()}).parent()}})(jQuery);(function(e){var t="Close",n="BeforeClose",r="AfterClose",i="BeforeAppend",s="MarkupParse",o="Open",u="Change",a="mfp",f="."+a,l="mfp-ready",c="mfp-removing",h="mfp-prevent-close";var p,d=function(){},v=!!window.jQuery,m,g=e(window),y,b,w,E,S;var x=function(e,t){p.ev.on(a+e+f,t)},T=function(t,n,r,i){var s=document.createElement("div");s.className="mfp-"+t;if(r){s.innerHTML=r}if(!i){s=e(s);if(n){s.appendTo(n)}}else if(n){n.appendChild(s)}return s},N=function(t,n){p.ev.triggerHandler(a+t,n);if(p.st.callbacks){t=t.charAt(0).toLowerCase()+t.slice(1);if(p.st.callbacks[t]){p.st.callbacks[t].apply(p,e.isArray(n)?n:[n])}}},C=function(t){if(t!==S||!p.currTemplate.closeBtn){p.currTemplate.closeBtn=e(p.st.closeMarkup.replace("%title%",p.st.tClose));S=t}return p.currTemplate.closeBtn},k=function(){if(!e.magnificPopup.instance){p=new d;p.init();e.magnificPopup.instance=p}},L=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(e["transition"]!==undefined){return true}while(t.length){if(t.pop()+"Transition"in e){return true}}return false};d.prototype={constructor:d,init:function(){var t=navigator.appVersion;p.isIE7=t.indexOf("MSIE 7.")!==-1;p.isIE8=t.indexOf("MSIE 8.")!==-1;p.isLowIE=p.isIE7||p.isIE8;p.isAndroid=/android/gi.test(t);p.isIOS=/iphone|ipad|ipod/gi.test(t);p.supportsTransition=L();p.probablyMobile=p.isAndroid||p.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent);b=e(document);p.popupsCache={}},open:function(t){if(!y){y=e(document.body)}var n;if(t.isObj===false){p.items=t.items.toArray();p.index=0;var r=t.items,i;for(n=0;n(e||g.height())},_setFocus:function(){(p.st.focus?p.content.find(p.st.focus).eq(0):p.wrap).focus()},_onFocusIn:function(t){if(t.target!==p.wrap[0]&&!e.contains(p.wrap[0],t.target)){p._setFocus();return false}},_parseMarkup:function(t,n,r){var i;if(r.data){n=e.extend(r.data,n)}N(s,[t,n,r]);e.each(n,function(e,n){if(n===undefined||n===false){return true}i=e.split("_");if(i.length>1){var r=t.find(f+"-"+i[0]);if(r.length>0){var s=i[1];if(s==="replaceWith"){if(r[0]!==n[0]){r.replaceWith(n)}}else if(s==="img"){if(r.is("img")){r.attr("src",n)}else{r.replaceWith('')}}else{r.attr(i[1],n)}}}else{t.find(f+"-"+e).html(n)}})},_getScrollbarSize:function(){if(p.scrollbarSize===undefined){var e=document.createElement("div");e.id="mfp-sbm";e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;";document.body.appendChild(e);p.scrollbarSize=e.offsetWidth-e.clientWidth;document.body.removeChild(e)}return p.scrollbarSize}};e.magnificPopup={instance:null,proto:d.prototype,modules:[],open:function(t,n){k();if(!t){t={}}else{t=e.extend(true,{},t)}t.isObj=true;t.index=n||0;return this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){if(n.options){e.magnificPopup.defaults[t]=n.options}e.extend(this.proto,n.proto);this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:false,mainClass:"",preloader:true,focus:"",closeOnContentClick:false,closeOnBgClick:true,closeBtnInside:true,showCloseBtn:true,enableEscapeKey:true,modal:false,alignTop:false,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading..."}};e.fn.magnificPopup=function(t){k();var n=e(this);if(typeof t==="string"){if(t==="open"){var r,i=v?n.data("magnificPopup"):n[0].magnificPopup,s=parseInt(arguments[1],10)||0;if(i.items){r=i.items[s]}else{r=n;if(i.delegate){r=r.find(i.delegate)}r=r.eq(s)}p._openClick({mfpEl:r},n,i)}else{if(p.isOpen)p[t].apply(p,Array.prototype.slice.call(arguments,1))}}else{t=e.extend(true,{},t);if(v){n.data("magnificPopup",t)}else{n[0].magnificPopup=t}p.addGroup(n,t)}return n};var A="inline",O,M,_,D=function(){if(_){M.after(_.addClass(O)).detach();_=null}};e.magnificPopup.registerModule(A,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){p.types.push(A);x(t+"."+A,function(){D()})},getInline:function(t,n){D();if(t.src){var r=p.st.inline,i=e(t.src);if(i.length){var s=i[0].parentNode;if(s&&s.tagName){if(!M){O=r.hiddenClass;M=T(O);O="mfp-"+O}_=i.after(M).detach().removeClass(O)}p.updateStatus("ready")}else{p.updateStatus("error",r.tNotFound);i=e("
")}t.inlineElement=i;return i}p.updateStatus("ready");p._parseMarkup(n,{},t);return n}}});var P="ajax",H,B=function(){if(H){y.removeClass(H)}},j=function(){B();if(p.req){p.req.abort()}};e.magnificPopup.registerModule(P,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){p.types.push(P);H=p.st.ajax.cursor;x(t+"."+P,j);x("BeforeChange."+P,j)},getAjax:function(t){if(H)y.addClass(H);p.updateStatus("loading");var n=e.extend({url:t.src,success:function(n,r,i){var s={data:n,xhr:i};N("ParseAjax",s);p.appendContent(e(s.data),P);t.finished=true;B();p._setFocus();setTimeout(function(){p.wrap.addClass(l)},16);p.updateStatus("ready");N("AjaxContentAdded")},error:function(){B();t.finished=t.loadError=true;p.updateStatus("error",p.st.ajax.tError.replace("%url%",t.src))}},p.st.ajax.settings);p.req=e.ajax(n);return""}}});var F,I=function(t){if(t.data&&t.data.title!==undefined)return t.data.title;var n=p.st.image.titleSrc;if(n){if(e.isFunction(n)){return n.call(p,t)}else if(t.el){return t.el.attr(n)||""}}return""};e.magnificPopup.registerModule("image",{options:{markup:'
'+'
'+"
"+'
'+"
"+'
'+'
'+'
'+"
"+"
"+"
"+"
",cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:true,tError:'The image could not be loaded.'},proto:{initImage:function(){var e=p.st.image,n=".image";p.types.push("image");x(o+n,function(){if(p.currItem.type==="image"&&e.cursor){y.addClass(e.cursor)}});x(t+n,function(){if(e.cursor){y.removeClass(e.cursor)}g.off("resize"+f)});x("Resize"+n,p.resizeImage);if(p.isLowIE){x("AfterChange",p.resizeImage)}},resizeImage:function(){var e=p.currItem;if(!e||!e.img)return;if(p.st.image.verticalFit){var t=0;if(p.isLowIE){t=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)}e.img.css("max-height",p.wH-t)}},_onImageHasSize:function(e){if(e.img){e.hasSize=true;if(F){clearInterval(F)}e.isCheckingImgSize=false;N("ImageHasSize",e);if(e.imgHidden){if(p.content)p.content.removeClass("mfp-loading");e.imgHidden=false}}},findImageSize:function(e){var t=0,n=e.img[0],r=function(i){if(F){clearInterval(F)}F=setInterval(function(){if(n.naturalWidth>0){p._onImageHasSize(e);return}if(t>200){clearInterval(F)}t++;if(t===3){r(10)}else if(t===40){r(50)}else if(t===100){r(500)}},i)};r(1)},getImage:function(t,n){var r=0,i=function(){if(t){if(t.img[0].complete){t.img.off(".mfploader");if(t===p.currItem){p._onImageHasSize(t);p.updateStatus("ready")}t.hasSize=true;t.loaded=true;N("ImageLoadComplete")}else{r++;if(r<200){setTimeout(i,100)}else{s()}}}},s=function(){if(t){t.img.off(".mfploader");if(t===p.currItem){p._onImageHasSize(t);p.updateStatus("error",o.tError.replace("%url%",t.src))}t.hasSize=true;t.loaded=true;t.loadError=true}},o=p.st.image;var u=n.find(".mfp-img");if(u.length){var a=document.createElement("img");a.className="mfp-img";t.img=e(a).on("load.mfploader",i).on("error.mfploader",s);a.src=t.src;if(u.is("img")){t.img=t.img.clone()}a=t.img[0];if(a.naturalWidth>0){t.hasSize=true}else if(!a.width){t.hasSize=false}}p._parseMarkup(n,{title:I(t),img_replaceWith:t.img},t);p.resizeImage();if(t.hasSize){if(F)clearInterval(F);if(t.loadError){n.addClass("mfp-loading");p.updateStatus("error",o.tError.replace("%url%",t.src))}else{n.removeClass("mfp-loading");p.updateStatus("ready")}return n}p.updateStatus("loading");t.loading=true;if(!t.hasSize){t.imgHidden=true;n.addClass("mfp-loading");p.findImageSize(t)}return n}}});var q,R=function(){if(q===undefined){q=document.createElement("p").style.MozTransform!==undefined}return q};e.magnificPopup.registerModule("zoom",{options:{enabled:false,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e=p.st.zoom,r=".zoom",i;if(!e.enabled||!p.supportsTransition){return}var s=e.duration,o=function(t){var n=t.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),r="all "+e.duration/1e3+"s "+e.easing,i={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},s="transition";i["-webkit-"+s]=i["-moz-"+s]=i["-o-"+s]=i[s]=r;n.css(i);return n},u=function(){p.content.css("visibility","visible")},a,f;x("BuildControls"+r,function(){if(p._allowZoom()){clearTimeout(a);p.content.css("visibility","hidden");i=p._getItemToZoom();if(!i){u();return}f=o(i);f.css(p._getOffset());p.wrap.append(f);a=setTimeout(function(){f.css(p._getOffset(true));a=setTimeout(function(){u();setTimeout(function(){f.remove();i=f=null;N("ZoomAnimationEnded")},16)},s)},16)}});x(n+r,function(){if(p._allowZoom()){clearTimeout(a);p.st.removalDelay=s;if(!i){i=p._getItemToZoom();if(!i){return}f=o(i)}f.css(p._getOffset(true));p.wrap.append(f);p.content.css("visibility","hidden");setTimeout(function(){f.css(p._getOffset())},16)}});x(t+r,function(){if(p._allowZoom()){u();if(f){f.remove()}i=null}})},_allowZoom:function(){return p.currItem.type==="image"},_getItemToZoom:function(){if(p.currItem.hasSize){return p.currItem.img}else{return false}},_getOffset:function(t){var n;if(t){n=p.currItem.img}else{n=p.st.zoom.opener(p.currItem.el||p.currItem)}var r=n.offset();var i=parseInt(n.css("padding-top"),10);var s=parseInt(n.css("padding-bottom"),10);r.top-=e(window).scrollTop()-i;var o={width:n.width(),height:(v?n.innerHeight():n[0].offsetHeight)-s-i};if(R()){o["-moz-transform"]=o["transform"]="translate("+r.left+"px,"+r.top+"px)"}else{o.left=r.left;o.top=r.top}return o}}});var U="iframe",z="//about:blank",W=function(e){if(p.currTemplate[U]){var t=p.currTemplate[U].find("iframe");if(t.length){if(!e){t[0].src=z}if(p.isIE8){t.css("display",e?"block":"none")}}}};e.magnificPopup.registerModule(U,{options:{markup:'
'+'
'+''+"
",srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){p.types.push(U);x("BeforeChange",function(e,t,n){if(t!==n){if(t===U){W()}else if(n===U){W(true)}}});x(t+"."+U,function(){W()})},getIframe:function(t,n){var r=t.src;var i=p.st.iframe;e.each(i.patterns,function(){if(r.indexOf(this.index)>-1){if(this.id){if(typeof this.id==="string"){r=r.substr(r.lastIndexOf(this.id)+this.id.length,r.length)}else{r=this.id.call(this,r)}}r=this.src.replace("%id%",r);return false}});var s={};if(i.srcAction){s[i.srcAction]=r}p._parseMarkup(n,s,t);p.updateStatus("ready");return n}}});var X=function(e){var t=p.items.length;if(e>t-1){return e-t}else if(e<0){return t+e}return e},V=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:false,arrowMarkup:'',preload:[0,2],navigateByImgClick:true,arrows:true,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=p.st.gallery,r=".mfp-gallery",i=Boolean(e.fn.mfpFastClick);p.direction=true;if(!n||!n.enabled)return false;E+=" mfp-gallery";x(o+r,function(){if(n.navigateByImgClick){p.wrap.on("click"+r,".mfp-img",function(){if(p.items.length>1){p.next();return false}})}b.on("keydown"+r,function(e){if(e.keyCode===37){p.prev()}else if(e.keyCode===39){p.next()}})});x("UpdateStatus"+r,function(e,t){if(t.text){t.text=V(t.text,p.currItem.index,p.items.length)}});x(s+r,function(e,t,r,i){var s=p.items.length;r.counter=s>1?V(n.tCounter,i.index,s):""});x("BuildControls"+r,function(){if(p.items.length>1&&n.arrows&&!p.arrowLeft){var t=n.arrowMarkup,r=p.arrowLeft=e(t.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(h),s=p.arrowRight=e(t.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(h);var o=i?"mfpFastClick":"click";r[o](function(){p.prev()});s[o](function(){p.next()});if(p.isIE7){T("b",r[0],false,true);T("a",r[0],false,true);T("b",s[0],false,true);T("a",s[0],false,true)}p.container.append(r.add(s))}});x(u+r,function(){if(p._preloadTimeout)clearTimeout(p._preloadTimeout);p._preloadTimeout=setTimeout(function(){p.preloadNearbyImages();p._preloadTimeout=null},16)});x(t+r,function(){b.off(r);p.wrap.off("click"+r);if(p.arrowLeft&&i){p.arrowLeft.add(p.arrowRight).destroyMfpFastClick()}p.arrowRight=p.arrowLeft=null})},next:function(){p.direction=true;p.index=X(p.index+1);p.updateItemHTML()},prev:function(){p.direction=false;p.index=X(p.index-1);p.updateItemHTML()},goTo:function(e){p.direction=e>=p.index;p.index=e;p.updateItemHTML()},preloadNearbyImages:function(){var e=p.st.gallery.preload,t=Math.min(e[0],p.items.length),n=Math.min(e[1],p.items.length),r;for(r=1;r<=(p.direction?n:t);r++){p._preloadItem(p.index+r)}for(r=1;r<=(p.direction?t:n);r++){p._preloadItem(p.index-r)}},_preloadItem:function(t){t=X(t);if(p.items[t].preloaded){return}var n=p.items[t];if(!n.parsed){n=p.parseEl(t)}N("LazyLoad",n);if(n.type==="image"){n.img=e('').on("load.mfploader",function(){n.hasSize=true}).on("error.mfploader",function(){n.hasSize=true;n.loadError=true;N("LazyLoadError",n)}).attr("src",n.src)}n.preloaded=true}}});var $="retina";e.magnificPopup.registerModule($,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=p.st.retina,t=e.ratio;t=!isNaN(t)?t:t();if(t>1){x("ImageHasSize"+"."+$,function(e,n){n.img.css({"max-width":n.img[0].naturalWidth/t,width:"100%"})});x("ElementParse"+"."+$,function(n,r){r.src=e.replaceSrc(r,t)})}}}}});(function(){var t=1e3,n="ontouchstart"in window,r=function(){g.off("touchmove"+s+" touchend"+s)},i="mfpFastClick",s="."+i;e.fn.mfpFastClick=function(i){return e(this).each(function(){var o=e(this),u;if(n){var a,f,l,c,h,p;o.on("touchstart"+s,function(e){c=false;p=1;h=e.originalEvent?e.originalEvent.touches[0]:e.touches[0];f=h.clientX;l=h.clientY;g.on("touchmove"+s,function(e){h=e.originalEvent?e.originalEvent.touches:e.touches;p=h.length;h=h[0];if(Math.abs(h.clientX-f)>10||Math.abs(h.clientY-l)>10){c=true;r()}}).on("touchend"+s,function(e){r();if(c||p>1){return}u=true;e.preventDefault();clearTimeout(a);a=setTimeout(function(){u=false},t);i()})})}o.on("click"+s,function(){if(!u){i()}})})};e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+s+" click"+s);if(n)g.off("touchmove"+s+" touchend"+s)}})();k()})(window.jQuery||window.Zepto);(function(e,t){var n={ratio:16/9,videoId:"ZCAnLxRvNNc",mute:true,repeat:true,width:e(t).width(),wrapperZIndex:99,playButtonClass:"tubular-play",pauseButtonClass:"tubular-pause",muteButtonClass:"tubular-mute",volumeUpClass:"tubular-volume-up",volumeDownClass:"tubular-volume-down",increaseVolumeBy:10,start:0};var r=function(r,i){var i=e.extend({},n,i),s=e(r).parent();$node=e(r);var o='
';t.tt_players.push(i);t.player_id++;s.prepend(o);$node.css({position:"relative","z-index":i.wrapperZIndex});t.onYouTubeIframeAPIReady=function(){var n="player";e.each(t.tt_players,function(e,r){var i=r;t[n+e]=new YT.Player("tubular-player-"+e,{width:i.width,height:Math.ceil(i.width/i.ratio),videoId:i.videoId,playerVars:{controls:0,showinfo:0,modestbranding:1,wmode:"transparent"},events:{onReady:onPlayerReady,onStateChange:onPlayerStateChange}})})};t.onPlayerReady=function(e){u();if(i.mute)e.target.mute();e.target.seekTo(i.start);e.target.playVideo()};t.onPlayerStateChange=function(e){if(e.data===0&&i.repeat){e.target.seekTo(i.start)}};var u=function(){var n=e(t).width(),r,s=e(t).height(),o,u=e("#tubular-player-"+t.player_id);if(n/i.ratio100-i.increaseVolumeBy)n=100-i.increaseVolumeBy;t["player"+player_id].setVolume(n+i.increaseVolumeBy)})};var i=document.createElement("script");i.src="//www.youtube.com/iframe_api";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(i,s);e.fn.tubular=function(e){return this.each(function(){r(this,e)})}})(jQuery,window);(function(e){e.belowthefold=function(t,n){var r=e(window).height()+e(window).scrollTop();return r<=e(t).offset().top-n.threshold};e.abovethetop=function(t,n){var r=e(window).scrollTop();return r>=e(t).offset().top+e(t).height()-n.threshold};e.rightofscreen=function(t,n){var r=e(window).width()+e(window).scrollLeft();return r<=e(t).offset().left-n.threshold};e.leftofscreen=function(t,n){var r=e(window).scrollLeft();return r>=e(t).offset().left+e(t).width()-n.threshold};e.inviewport=function(t,n){return!e.rightofscreen(t,n)&&!e.leftofscreen(t,n)&&!e.belowthefold(t,n)&&!e.abovethetop(t,n)};e.extend(e.expr[":"],{"below-the-fold":function(t,n,r){return e.belowthefold(t,{threshold:0})},"above-the-top":function(t,n,r){return e.abovethetop(t,{threshold:0})},"left-of-screen":function(t,n,r){return e.leftofscreen(t,{threshold:0})},"right-of-screen":function(t,n,r){return e.rightofscreen(t,{threshold:0})},"in-viewport":function(t,n,r){return e.inviewport(t,{threshold:0})}})})(jQuery);page=this;(function(e){e.fn.placeholder=function(){var t="v0.2";var n=false;var r="Type Here";var i=null;var s=null;var o=false;var u="#CFCFCF";var a=this;var f=false;var l=null;var c=null;this.init=function(t){this.parseArguments(t);l=this.placeHolderSupported();c=this.hasPlaceholder();if(this.placeHolderSupported()&&!this.hasPlaceholder()){o=true}if(o){this.attr("placeholder",s);_overidden=true}if(this.placeHolderSupported()){}else{a.addPlaceholderText();this.blur(this.blurHandler);this.focus(this.focusHandler)}var n=e("form");for(var r=0;r0){for(var f=0;f0){i=e;return true}}return false};this.getPlaceholderValue=function(){var e=null;if(i){if(o){e=s}else{e=i}}else{e=s}if(e==null||e==undefined){e=r}return e};this.addPlaceholderText=function(){var t=a;if(arguments[0])t=arguments[0];var n=this.getPlaceholderValue();if(e(t).val()==""||e(t).val()==n){if(arguments[0])n=arguments[0];this.css("color",u);this.val(n);this.addClass("placeholder")}};this.removePlaceholderText=function(){var t=a;if(arguments[0])t=arguments[0];if(e(t).val()==a.getPlaceholderValue()){this.val("");this.css("color","#000000");this.removeClass("placeholder")}};this.blurHandler=function(e){a.addPlaceholderText()};this.focusHandler=function(e){a.removePlaceholderText()};this.hasCSSStyle=function(){var e=".placeholder";if(arguments[0])e=arguments[0];var t=document.styleSheets;for(var n=0;nq+P*2&&tt===R){l.stop(true).animate({scrollTop:U},rt,it)}else if(a>q+P*2&&tt===z){l.stop(true).animate({scrollTop:W},rt,it)}else if(a>q+P*2&&tt===X){l.stop(true).animate({scrollTop:X},rt,it)}else{l.stop(true).animate({scrollTop:tt},rt,it)}}else if(Z===false){et=1}}else if(f>=et){if(D===false){if(a<=q){l.stop(true).animate({scrollTop:Q},G,Y)}else{l.stop(true).animate({scrollTop:K},rt,it)}}else if(D===true){if(a<=q+D&&Q===R){l.stop(true).animate({scrollTop:U},G,Y)}else if(a<=q+D&&Q===z){l.stop(true).animate({scrollTop:W},G,Y)}else if(a<=q+D*2&&Q===X){l.stop(true).animate({scrollTop:X},G,Y)}else if(a>q+D&&K===R){l.stop(true).animate({scrollTop:U},G,Y)}else if(a>q+D&&K===z){l.stop(true).animate({scrollTop:W},G,Y)}else if(a>q+D*2&&K===X){l.stop(true).animate({scrollTop:X},G,Y)}else{l.stop(true).animate({scrollTop:K},G,Y)}}}}});e(":animated").promise().done(function(){});return this}})(jQuery);(function(e){var t={topSpacing:0,bottomSpacing:0,className:"is-sticky",wrapperClassName:"sticky-wrapper",center:false,getWidthFrom:""},n=e(window),r=e(document),i=[],s=n.height(),o=function(){var t=n.scrollTop(),o=r.height(),u=o-s,a=t>u?u-t:0;for(var f=0;f
").attr("id",n+"-sticky-wrapper").addClass(r.wrapperClassName);t.wrapAll(s);if(r.center){t.parent().css({width:t.outerWidth(),marginLeft:"auto",marginRight:"auto"})}if(t.css("float")=="right"){t.css({"float":"none"}).parent().css({"float":"right"})}var o=t.parent();o.css("height",t.outerHeight());i.push({topSpacing:r.topSpacing,bottomSpacing:r.bottomSpacing,stickyElement:t,currentTop:null,stickyWrapper:o,className:r.className,getWidthFrom:r.getWidthFrom})})},update:o};if(window.addEventListener){window.addEventListener("scroll",o,false);window.addEventListener("resize",u,false)}else if(window.attachEvent){window.attachEvent("onscroll",o);window.attachEvent("onresize",u)}e.fn.sticky=function(t){if(a[t]){return a[t].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof t==="object"||!t){return a.init.apply(this,arguments)}else{e.error("Method "+t+" does not exist on jQuery.sticky")}};e(function(){setTimeout(o,0)})})(jQuery);!function(e,t,n,r){n.swipebox=function(i,s){var o={useCSS:!0,initialIndexOnArray:0,hideBarsDelay:3e3,videoMaxWidth:1140,vimeoColor:"CCCCCC",beforeOpen:null,afterClose:null},u=this,f=[],l=i.selector,h=n(l),p=navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i),v=null!==p||t.createTouch!==r||"ontouchstart"in e||"onmsgesturechange"in e||navigator.msMaxTouchPoints,m=!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,g=e.innerWidth?e.innerWidth:n(e).width(),y=e.innerHeight?e.innerHeight:n(e).height(),w='
';u.settings={},u.init=function(){u.settings=n.extend({},o,s),n.isArray(i)?(f=i,E.target=n(e),E.init(u.settings.initialIndexOnArray)):n(t).on("click",l,function(e){if("slide current"===e.target.parentNode.className)return!1;n.isArray(i)||(E.destroy(),$elem=n(l),E.actions()),f=[];var t,r,s;s||(r="rel",s=n(this).attr(r)),$elem=s&&""!==s&&"nofollow"!==s?h.filter("["+r+'="'+s+'"]'):n(l),$elem.each(function(){var e=null,t=null;n(this).attr("title")&&(e=n(this).attr("title")),n(this).attr("href")&&(t=n(this).attr("href")),f.push({href:t,title:e})}),t=$elem.index(n(this)),e.preventDefault(),e.stopPropagation(),E.target=n(e.target),E.init(t)})},u.refresh=function(){n.isArray(i)||(E.destroy(),$elem=n(l),E.actions())};var E={init:function(e){u.settings.beforeOpen&&u.settings.beforeOpen(),this.target.trigger("swipebox-start"),n.swipebox.isOpen=!0,this.build(),this.openSlide(e),this.openMedia(e),this.preloadMedia(e+1),this.preloadMedia(e-1)},build:function(){var e=this;if(n("body").append(w),e.doCssTrans()&&(n("#swipebox-slider").css({"-webkit-transition":"left 0.4s ease","-moz-transition":"left 0.4s ease","-o-transition":"left 0.4s ease","-khtml-transition":"left 0.4s ease",transition:"left 0.4s ease"}),n("#swipebox-overlay").css({"-webkit-transition":"opacity 1s ease","-moz-transition":"opacity 1s ease","-o-transition":"opacity 1s ease","-khtml-transition":"opacity 1s ease",transition:"opacity 1s ease"}),n("#swipebox-action, #swipebox-caption").css({"-webkit-transition":"0.5s","-moz-transition":"0.5s","-o-transition":"0.5s","-khtml-transition":"0.5s",transition:"0.5s"})),m){var t=n("#swipebox-action #swipebox-close").css("background-image");t=t.replace("png","svg"),n("#swipebox-action #swipebox-prev,#swipebox-action #swipebox-next,#swipebox-action #swipebox-close").css({"background-image":t})}n.each(f,function(){n("#swipebox-slider").append('
')}),e.setDim(),e.actions(),v?e.gesture():e.keyboard(),e.animBars(),e.resize()},setDim:function(){var t,r,i={};"onorientationchange"in e?e.addEventListener("orientationchange",function(){0===e.orientation?(t=g,r=y):(90===e.orientation||-90===e.orientation)&&(t=y,r=g)},!1):(t=e.innerWidth?e.innerWidth:n(e).width(),r=e.innerHeight?e.innerHeight:n(e).height()),i={width:t,height:r},n("#swipebox-overlay").css(i)},resize:function(){var t=this;n(e).resize(function(){t.setDim()}).resize()},supportTransition:function(){for(var e="transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition".split(" "),n=0;n=r?e.getPrev():-r>=t?e.getNext():o.hasClass("visible-bars")?(e.clearTimeout(),e.hideBars()):(e.showBars(),e.setTimeout()),n(".touching").off("touchmove").removeClass("touching")})},setTimeout:function(){if(u.settings.hideBarsDelay>0){var t=this;t.clearTimeout(),t.timeout=e.setTimeout(function(){t.hideBars()},u.settings.hideBarsDelay)}},clearTimeout:function(){e.clearTimeout(this.timeout),this.timeout=null},showBars:function(){var e=n("#swipebox-caption, #swipebox-action");this.doCssTrans()?e.addClass("visible-bars"):(n("#swipebox-caption").animate({top:0},500),n("#swipebox-action").animate({bottom:0},500),setTimeout(function(){e.addClass("visible-bars")},1e3))},hideBars:function(){var e=n("#swipebox-caption, #swipebox-action");this.doCssTrans()?e.removeClass("visible-bars"):(n("#swipebox-caption").animate({top:"-50px"},500),n("#swipebox-action").animate({bottom:"-50px"},500),setTimeout(function(){e.removeClass("visible-bars")},1e3))},animBars:function(){var e=this,t=n("#swipebox-caption, #swipebox-action");t.addClass("visible-bars"),e.setTimeout(),n("#swipebox-slider").click(function(){t.hasClass("visible-bars")||(e.showBars(),e.setTimeout())}),v||n("#swipebox-action").hover(function(){e.showBars(),t.addClass("visible-bars"),e.clearTimeout()},function(){t.removeClass("visible-bars"),e.setTimeout()})},keyboard:function(){var t=this;n(e).bind("keyup",function(e){e.preventDefault(),e.stopPropagation(),37===e.keyCode?t.getPrev():39===e.keyCode?t.getNext():27===e.keyCode&&t.closeSlide()})},actions:function(){var e=this,t=v?"touchend":"click";f.length<2?n("#swipebox-prev, #swipebox-next").hide():(n("#swipebox-prev").bind(t,function(t){t.preventDefault(),t.stopPropagation(),e.getPrev(),e.setTimeout()}),n("#swipebox-next").bind(t,function(t){t.preventDefault(),t.stopPropagation(),e.getNext(),e.setTimeout()})),n("#swipebox-close").bind(t,function(){e.closeSlide()})},setSlide:function(e,t){t=t||!1;var r=n("#swipebox-slider");this.doCssTrans()?r.css({left:100*-e+"%"}):r.animate({left:100*-e+"%"}),n("#swipebox-slider .slide").removeClass("current"),n("#swipebox-slider .slide").eq(e).addClass("current"),this.setTitle(e),t&&r.fadeIn(),n("#swipebox-prev, #swipebox-next").removeClass("disabled"),0===e?n("#swipebox-prev").addClass("disabled"):e===f.length-1&&n("#swipebox-next").addClass("disabled")},openSlide:function(t){n("html").addClass("swipebox-html"),v&&n("html").addClass("swipebox-touch"),n(e).trigger("resize"),this.setSlide(t,!0)},preloadMedia:function(e){var t=this,n=null;f[e]!==r&&(n=f[e].href),t.isVideo(n)?t.openMedia(e):setTimeout(function(){t.openMedia(e)},1e3)},openMedia:function(e){var t=this,i=null;return f[e]!==r&&(i=f[e].href),0>e||e>=f.length?!1:void (t.isVideo(i)?n("#swipebox-slider .slide").eq(e).html(t.getVideo(i)):t.loadMedia(i,function(){n("#swipebox-slider .slide").eq(e).html(this)}))},setTitle:function(e){var t=null;n("#swipebox-caption").empty(),f[e]!==r&&(t=f[e].title),t&&n("#swipebox-caption").append(t)},isVideo:function(e){return e&&(e.match(/youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/)||e.match(/vimeo\.com\/([0-9]*)/)||e.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/))?!0:void 0},getVideo:function(e){var t="",n=e.match(/watch\?v=([a-zA-Z0-9\-_]+)/),r=e.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/),i=e.match(/vimeo\.com\/([0-9]*)/);return n||r?(r&&(n=r),t=''):i&&(t=''),'
'+t+"
"},loadMedia:function(e,t){if(!this.isVideo(e)){var r=n("").on("load",function(){t.call(r)});r.attr("src",e)}},getNext:function(){var e=this;index=n("#swipebox-slider .slide").index(n("#swipebox-slider .slide.current")),index+10?(index--,this.setSlide(index),this.preloadMedia(index-1)):(n("#swipebox-slider").addClass("leftSpring"),setTimeout(function(){n("#swipebox-slider").removeClass("leftSpring")},500))},closeSlide:function(){n("html").removeClass("swipebox-html"),n("html").removeClass("swipebox-touch"),n(e).trigger("resize"),this.destroy()},destroy:function(){n(e).unbind("keyup"),n("body").unbind("touchstart"),n("body").unbind("touchmove"),n("body").unbind("touchend"),n("#swipebox-slider").unbind(),n("#swipebox-overlay").remove(),n.isArray(i)||i.removeData("_swipebox"),this.target&&this.target.trigger("swipebox-destroy"),n.swipebox.isOpen=!1,u.settings.afterClose&&u.settings.afterClose()}};u.init()},n.fn.swipebox=function(e){if(!n.data(this,"_swipebox")){var t=new n.swipebox(this,e);this.data("_swipebox",t)}return this.data("_swipebox")}}(window,document,jQuery);(function(e){function u(){r=false;for(var n=0;n=i&&a-(n.data("appear-top-offset")||0)<=i+s.height()&&u+n.width()>=r&&u-(n.data("appear-left-offset")||0)<=r+s.width()){return true}else{return false}};e.fn.extend({appear:function(s){var o=e.extend({},i,s||{});var a=this.selector||this;if(!n){var f=function(){if(r){return}r=true;setTimeout(u,o.interval)};e(window).scroll(f).resize(f);n=true}if(o.force_process){setTimeout(u,o.interval)}t.push(a);return e(a)}});e.extend({force_appear:function(){if(n){u();return true}return false}})})(jQuery);(function(e,t){function m(t,n,r,i,s){if(tt(n)){if(i){m(t,["","Up","Right","Down","Left",n],r,0,s)}else{t[r]=function(e){var t=[e].concat(s);var r=t.length-1;if(i===0&&t[r]==0){t[r]=F(e)}n.apply(this,t)}}}else if(nt(n)){var o=n.length-1;var u=n[o];for(var a=0;a=0&&xO;L--){E[M+=_]=m.eq(A*p+L)}L=O;for(A=h-O-1;A>O;A--){E[M+=_]=m.eq(A*p+L)}}}else{for(var D=0;D").css({left:r,top:n,width:s,height:i,opacity:0,overflow:"hidden",position:l,zIndex:o.options.animationzindex});u.append(t).addClass(h);return u}function R(t,n){var r=n?t.toSlides:t.fromSlides;var i=r.eq(0).position();var s=i.left;var o=i.top;var u=0;var a=0;var f=e("
").css({zIndex:t.options.animationzindex,position:l,top:0,left:0}).addClass(h);r.each(function(t,n){var r=e(n);var i=r.outerWidth(true);var c=r.outerHeight(true);var h=r.clone();var p=r.position();var d=p.left-s;var v=p.top-o;h.css({position:l,left:d,top:v,opacity:1});u=ut(u,v+c);a=ut(a,d+i);f.append(h)});f.width(a).height(u);return f}function U(t){var n=e.fn.jquery.split(".");var s=n.length;for(var o=0;o")[0].style);if(n===r){return r}var i=n.slice(0,n.length-t.length);if(i.length!=0){return"-"+i+"-"}return""}function V(e,t){return e.indexOf(t,e.length-t.length)!==-1}function $(e){var t=[];for(var n in e){t.push(n)}return t}function J(e){setTimeout(e,0)}function K(e,t){return e.indexOf(t)==0}function Q(e){return e.slice()}function G(e){return[].reverse.call(e)}function Y(e){return e.children().not("."+h)}function Z(e){var t={};for(var n in e)t[n.toLowerCase()]=e[n];return t}function et(e){for(var t,n,r=e.length;r;t=parseInt(Math.random()*r),n=e[--r],e[r]=e[t],e[t]=n){}return e}function tt(t){return e.isFunction(t)}function nt(t){return e.isArray(t)}function rt(e){return parseInt(e,10)}function it(e){return parseFloat(e)}function st(){return+(new Date)}function ot(e){return e<0?-e:e}function ut(e,t){return e>t?e:t}function ft(t){if(nt(t)){return lt(t)}else if(tt(t)){return t}else{t=W(t);if(t.indexOf(",")!=-1){var n=t.split(",");return lt(n)}else{var r=Z(e.fn.sudoSlider.effects);var i=t.toLowerCase();var s=r[i];if(s){return s}else{var n=[];for(var o in r){if(K(o,i)){n.push(r[o])}}if(!n.length){return at}return lt(n)}}}}function lt(e){return function(t){var n=ct(e);return ft(n)(t)}}function ct(e){return e[et($(e))[0]]}var n;var r=false;var i=true;var s="pages";var o="next";var u="prev";var a="last";var f="first";var l="absolute";var c=function(){};var h="sudo-box";var p=X();e.fn.sudoSlider=function(l){var d={effect:"slide",speed:1500,customLink:r,controlsShow:i,controlsFadeSpeed:400,controlsFade:i,insertAfter:i,vertical:r,slideCount:1,moveCount:1,startSlide:1,responsive:r,ease:"swing",auto:r,pause:2e3,resumePause:r,continuous:r,prevNext:i,numeric:r,numericText:[],slices:15,boxCols:8,boxRows:4,initCallback:c,ajaxLoad:c,beforeAnimation:c,afterAnimation:c,history:r,autoHeight:i,autoWidth:i,updateBefore:r,ajax:r,preloadAjax:100,loadingText:"",prevHtml:' previous ',nextHtml:' next ',controlsAttr:'id="controls"',numericAttr:'class="controls"',animationZIndex:1e4,interruptible:r,useCSS:i,loadStart:c,loadFinish:c};var v=this;l=e.extend(Z(d),Z(l));if(p===r||!U([1,8,0])){l.usecss=r}return this.each(function(){function nt(){var n=0;for(var a in tt){et[n]=tt[a];n++}c=i;d=Y(B);var f=d.length;var l=e("
");if(!f){B.append(d=l);p=r}else if(!(p=d.is("ul"))&&!Z){l.append(d);B.append(d=l)}Z=i;m=Y(d);y=m.length;if(et[31]){if(et[31].length>y){for(var h=1;h<=et[31].length-y;h++){var v;if(p){v="div"}else{v="li"}d.append("<"+v+">"+et[33]+"")}m=Y(d);y=m.length}}if(N===r){b=0}else{b=N}w=b;E=i;S=[];T=r;B.css({overflow:"hidden"});if(B.css("position")=="static")B.css({position:"relative"});m.css({"float":"left",listStyle:"none"});d.add(m).css({display:"block",position:"relative"});et[8]=rt(et[8]);_=et[8];et[8]+=et[9]-1;et[10]=rt(et[10])-1||0;et[0]=ft(et[0]);for(var h=0;h=1&&y>0;A--){var O=Gt(-et[8]+A-1);var D=Gt(et[8]-A);var P=m.eq(O).clone();M.push(P);var j=m.eq(D).clone();M.push(j);H[O].push(P);H[D].push(j);d.prepend(P).append(j)}}et[5]=et[5]&&!et[16];if(et[11]){at()}d[et[7]?"height":"width"](9e6);g=Y(d);et[29]=et[29]&&!et[11];if(et[11]){e(t).on("resize focus",at)}if(et[3]){C=e("");B[et[6]?"after":"before"](C);if(et[18]){x=e("
    ");C.prepend(x);var F=et[18]==s;var I=F?_:1;for(var h=0;h"+et[19][h]+"").appendTo(x).click(function(){yt(ct(this)-1,i);return r})}}if(et[17]){k=gt(et[35],o);L=gt(et[34],u)}}var q=[4,1,14];for(var h in q){et[q[h]]=mt(et[q[h]])}if(et[2]){e(document).on("click",et[2],function(){var e;if(e=ct(this)){if(e=="stop"){et[13]=r;vt()}else if(e=="start"){dt();et[13]=i}else if(e=="block"){E=r}else if(e=="unblock"){E=i}else{yt(e==rt(e)?e-1:e,i)}}return r})}var R=e();for(var A=0;A=0;n--){if(e==t-n){return i}}}else{return e==t}return r}).addClass("current")}}function xt(){var e=location.hash.substr(1);for(var t in et[19]){if(et[19][t]==e){return t}}return e?b:0}function Tt(t,r,i){function u(t){e(t).off("load error");if(t.naturalHeight&&!t.clientHeight){e(t).height(t.naturalHeight).width(t.naturalWidth)}if(r){o--;if(o==0){i()}}else{i()}}var s=t.add(t.find("img")).filter("img");var o=s.length;if(!o){i();return}s.each(function(){var t=this;e(t).on("load error",function(){u(t)});if(t.readyState=="complete"){e(t).trigger("load")}else if(t.readyState){t.src=t.src}else if(t.complete){e(t).trigger("load")}else if(t.complete===n){var r=t.src;t.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";t.src=r}})}function Nt(e,t){e=Gt(e);F=e;I=st()+t;if(t==0){j=e}else{j=r}if(et[28]||et[29]){Ct(e)}}function Ct(e){B.ready(function(){Lt(e);Tt(m.eq(e),r,function(){Lt(e)})})}function kt(e,t){var n=0;for(var r=e;rn){if(b==n&&t==o){return 0}else{return n}}else if(e<0){if(b==0&&t==u){return n}else{return 0}}else{return e}}}function qt(t,n){function a(){var n=new Image;n.src=o;var r=e(n);Tt(r,true,function(){Rt(function(){var e="";if(!r.height()){e=20}r.height(e).width(e);u.empty().append(n);Ut(t,i)})})}if(n){var s=X[t];if(!s){s=X[t]=[]}s.push(n)}if($[t]){if(n){J(n)}return}if(V[t]){return}V[t]=i;if(D)clearTimeout(D);var o=et[31][t];var u=m.eq(t);var f=r;e.ajax({url:o,success:function(e,n,s){f=i;Rt(function(){var n=s.getResponseHeader("Content-Type");if(n&&n.substr(0,1)!="i"){u.html(e);Ut(t,r)}else{a()}})},complete:function(){if(!f){a()}}});et[31][t]=r;tt.ajax[t]=r}function Rt(e){if(q){W.push(e)}else{J(e)}}function Ut(e,t){var n=m.eq(e);if(M){var s=r;for(var o in H[e]){if(s){var u=n.clone();M.push(u);H[e][o].replaceWith(u);H[e][o]=u}s=i}g=Y(d)}At(b);Nt(b,0);Tt(n,i,function(){Rt(function(){At(b);Nt(b,0);$[e]=i;var n=X[e];if(n){Wt(n)}pt();J(function(){et[24].call(jt(e),rt(e)+1,t)});if(c){c=r;J(zt)}})})}function zt(){Nt(b,0);At(b);_t();if(et[11]){at()}if(et[13]){dt()}et[23].call(v);Tt(g,false,function(){Rt(function(){Nt(b,0);At(b)})})}function Wt(e){while(e.length){e.splice(0,1)[0]()}}function Xt(e,t,n){var r=Ft(e);var i=e==o||e==u;var s=Gt(r);if(s==b){return}if(et[31]){var a=0;for(var f=s;f=y-et[8]&&ot(S)y){n=y}t=e(t||"
    ");if(p){t=e("
  1. ").prepend(t)}else{if(t.length!=1){t=e("
    ").prepend(t)}else{}}if(!n||n==0){d.prepend(t)}else{m.eq(n-1).after(t)}if(i){N=i-1}else if(n<=N||!n||n==0){N++}if(et[19].length
    ").css({width:"100%",height:"100%",backgroundColor:this.parent.options.backgroundColor,backgroundPosition:"fixed",position:t,zIndex:666999,top:0,left:0}).appendTo(this.parent.$element);this.loadbar=e("
    ").css({height:this.parent.options.barHeight+"px",marginTop:"-"+this.parent.options.barHeight/2+"px",backgroundColor:this.parent.options.barColor,width:"0%",position:"absolute",top:"0%"}).appendTo(this.container);if(this.parent.options.percentage==true){this.percentageContainer=e("
    ").text("0%").css({height:"40px",width:"100px",position:"absolute",fontSize:"3em",top:"50%",left:"50%",marginTop:"-"+(59+this.parent.options.barHeight)+"px",textAlign:"center",marginLeft:"-50px",color:this.parent.options.barColor}).appendTo(this.container)}if(!this.parent.preloadContainer.toPreload.length||this.parent.alreadyLoaded==true){this.parent.destroyContainers()}};t.prototype.updatePercentage=function(e){this.loadbar.stop().animate({width:e+"%",minWidth:e+"%"},200);if(this.parent.options.percentage==true){this.percentageContainer.text(Math.ceil(e)+"%")}};n.prototype.create=function(){this.container=e("
    ").appendTo("body").css({display:"none",width:0,height:0,overflow:"hidden"});this.processQueue()};n.prototype.processQueue=function(){for(var e=0;this.toPreload.length>e;e++){if(!this.parent.destroyed){this.preloadImage(this.toPreload[e])}}};n.prototype.addImage=function(e){this.toPreload.push(e)};n.prototype.preloadImage=function(e){var t=new r;t.addToPreloader(this,e);t.bindLoadEvent()};r.prototype.addToPreloader=function(t,n){this.element=e("").attr("src",n);this.element.appendTo(t.container);this.parent=t.parent};r.prototype.bindLoadEvent=function(){this.parent.imageCounter++;var e=this.element.attr("src");this.element.removeAttr("src");var t=this;setTimeout(function(){t.element.on("load error",t,function(e){e.data.completeLoading()});t.element.attr("src",e)},1)};r.prototype.completeLoading=function(){this.parent.imageDone++;var e=this.parent.imageDone/this.parent.imageCounter*100;this.parent.overlayLoader.updatePercentage(e);if(this.parent.imageDone==this.parent.imageCounter){this.parent.endLoader()}};i.prototype.init=function(){this.options=e.extend({},this.defaultOptions,this.options);var t=this.findImageInElement(this.element);if(this.options.deepSearch==true){var n=this.$element.find("*:not(script)");for(var r=0;r0&&!e.match(/^(data:)/i)){return true}else{return false}};i.prototype.urlIsNew=function(e){if(this.foundUrls.indexOf(e)==-1){return true}else{return false}};i.prototype.destroyContainers=function(){this.destroyed=true;this.preloadContainer.container.remove();this.overlayLoader.container.remove()};i.prototype.endLoader=function(){this.destroyed=true;this.onLoadComplete()};i.prototype.onLoadComplete=function(){this.options.onLoadComplete();if(this.options.completeAnimation=="grow"){var t=this.options.minimumTime;this.overlayLoader.loadbar[0].parent=this;this.overlayLoader.loadbar.stop().animate({width:"100%"},t,function(){e(this).animate({top:"0%",width:"100%",height:"100%"},500,function(){this.parent.overlayLoader.container[0].parent=this.parent;this.parent.overlayLoader.container.fadeOut(500,function(){this.parent.destroyContainers();this.parent.options.onComplete()})})})}else{this.overlayLoader.container[0].parent=this;this.overlayLoader.container.fadeOut(500,function(){this.parent.destroyContainers();this.parent.options.onComplete()})}};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(e){var t=this.length>>>0;var n=Number(arguments[1])||0;n=n<0?Math.ceil(n):Math.floor(n);if(n<0)n+=t;for(;n=0) ? html:body; activeElement=body; initTest(); initDone=true; if(top!=self){ isFrame=true; } else if(scrollHeight > windowHeight && (body.offsetHeight <=windowHeight || html.offsetHeight <=windowHeight)){ var pending=false; var refresh=function (){ if(!pending&&html.scrollHeight!=document.height){ pending=true; setTimeout(function (){ html.style.height=document.height + 'px'; pending=false; }, 500); }}; html.style.height='auto'; setTimeout(refresh, 10); if(root.offsetHeight <=windowHeight){ var underlay=document.createElement("div"); underlay.style.clear="both"; body.appendChild(underlay); }} if(!options.fixedBackground&&!isExcluded){ body.style.backgroundAttachment="scroll"; html.style.backgroundAttachment="scroll"; }} var que=[]; var pending=false; var lastScroll=+new Date; function scrollArray(elem, left, top, delay){ delay||(delay=1000); directionCheck(left, top); if(options.accelerationMax!=1){ var now=+new Date; var elapsed=now - lastScroll; if(elapsed < options.accelerationDelta){ var factor=(1 + (30 / elapsed)) / 2; if(factor > 1){ factor=Math.min(factor, options.accelerationMax); left *=factor; top *=factor; }} lastScroll=+new Date; } que.push({ x: left, y: top, lastX: (left < 0) ? 0.99:-0.99, lastY: (top < 0) ? 0.99:-0.99, start: +new Date }); if(pending){ return; } var scrollWindow=(elem===document.body); var step=function (time){ var now=+new Date; var scrollX=0; var scrollY=0; for (var i=0; i < que.length; i++){ var item=que[i]; var elapsed=now - item.start; var finished=(elapsed >=options.animationTime); var position=(finished) ? 1:elapsed / options.animationTime; if(options.pulseAlgorithm){ position=pulse(position); } var x=(item.x * position - item.lastX) >> 0; var y=(item.y * position - item.lastY) >> 0; scrollX +=x; scrollY +=y; item.lastX +=x; item.lastY +=y; if(finished){ que.splice(i, 1); i--; }} if(scrollWindow){ window.scrollBy(scrollX, scrollY); }else{ if(scrollX) elem.scrollLeft +=scrollX; if(scrollY) elem.scrollTop +=scrollY; } if(!left&&!top){ que=[]; } if(que.length){ requestFrame(step, elem, (delay / options.frameRate + 1)); }else{ pending=false; }}; requestFrame(step, elem, 0); pending=true; } function wheel(event){ if(!initDone){ init(); } var target=event.target; var overflowing=overflowingAncestor(target); if(!overflowing||event.defaultPrevented || isNodeName(activeElement, "embed") || (isNodeName(target, "embed")&&/\.pdf/i.test(target.src))){ return true; } var deltaX=event.wheelDeltaX||0; var deltaY=event.wheelDeltaY||0; if(!deltaX&&!deltaY){ deltaY=event.wheelDelta||0; } if(!options.touchpadSupport&&isTouchpad(deltaY)){ return true; } if(Math.abs(deltaX) > 1.2){ deltaX *=options.stepSize / 120; } if(Math.abs(deltaY) > 1.2){ deltaY *=options.stepSize / 120; } scrollArray(overflowing, -deltaX, -deltaY); event.preventDefault(); } function keydown(event){ var target=event.target; var modifier=event.ctrlKey||event.altKey||event.metaKey || (event.shiftKey&&event.keyCode!==key.spacebar); if(/input|textarea|select|embed/i.test(target.nodeName) || target.isContentEditable || event.defaultPrevented || modifier){ return true; } if(isNodeName(target, "button") && event.keyCode===key.spacebar){ return true; } var shift, x=0, y=0; var elem=overflowingAncestor(activeElement); var clientHeight=elem.clientHeight; if(elem==document.body){ clientHeight=window.innerHeight; } switch (event.keyCode){ case key.up: y=-options.arrowScroll; break; case key.down: y=options.arrowScroll; break; case key.spacebar: shift=event.shiftKey ? 1:-1; y=-shift * clientHeight * 0.9; break; case key.pageup: y=-clientHeight * 0.9; break; case key.pagedown: y=clientHeight * 0.9; break; case key.home: y=-elem.scrollTop; break; case key.end: var damt=elem.scrollHeight - elem.scrollTop - clientHeight; y=(damt > 0) ? damt+10:0; break; case key.left: x=-options.arrowScroll; break; case key.right: x=options.arrowScroll; break; default: return true; } scrollArray(elem, x, y); event.preventDefault(); } function mousedown(event){ activeElement=event.target; } var cache={}; setInterval(function (){ cache={};}, 10 * 1000); var uniqueID=(function (){ var i=0; return function (el){ return el.uniqueID||(el.uniqueID=i++); };})(); function setCache(elems, overflowing){ for (var i=elems.length; i--;) cache[uniqueID(elems[i])]=overflowing; return overflowing; } function overflowingAncestor(el){ var elems=[]; var rootScrollHeight=root.scrollHeight; do { var cached=cache[uniqueID(el)]; if(cached){ return setCache(elems, cached); } elems.push(el); if(rootScrollHeight===el.scrollHeight){ if(!isFrame||root.clientHeight + 10 < rootScrollHeight){ return setCache(elems, document.body); }}else if(el.clientHeight + 10 < el.scrollHeight){ overflow=getComputedStyle(el, "").getPropertyValue("overflow-y"); if(overflow==="scroll"||overflow==="auto"){ return setCache(elems, el); }} } while (el=el.parentNode); } function addEvent(type, fn, bubble){ window.addEventListener(type, fn, (bubble||false)); } function removeEvent(type, fn, bubble){ window.removeEventListener(type, fn, (bubble||false)); } function isNodeName(el, tag){ return (el.nodeName||"").toLowerCase()===tag.toLowerCase(); } function directionCheck(x, y){ x=(x > 0) ? 1:-1; y=(y > 0) ? 1:-1; if(direction.x!==x||direction.y!==y){ direction.x=x; direction.y=y; que=[]; lastScroll=0; }} var deltaBufferTimer; function isTouchpad(deltaY){ if(!deltaY) return; deltaY=Math.abs(deltaY) deltaBuffer.push(deltaY); deltaBuffer.shift(); clearTimeout(deltaBufferTimer); var allDivisable=(isDivisible(deltaBuffer[0], 120) && isDivisible(deltaBuffer[1], 120) && isDivisible(deltaBuffer[2], 120)); return !allDivisable; } function isDivisible(n, divisor){ return (Math.floor(n / divisor)==n / divisor); } var requestFrame=(function (){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function (callback, element, delay){ window.setTimeout(callback, delay||(1000/60)); };})(); function pulse_(x){ var val, start, expx; x=x * options.pulseScale; if(x < 1){ val=x - (1 - Math.exp(-x)); }else{ start=Math.exp(-1); x -=1; expx=1 - Math.exp(-x); val=start + (expx * (1 - start)); } return val * options.pulseNormalize; } function pulse(x){ if(x >=1) return 1; if(x <=0) return 0; if(options.pulseNormalize==1){ options.pulseNormalize /=pulse_(1); } return pulse_(x); } var isChrome=/chrome/i.test(window.navigator.userAgent); var wheelEvent=null; if("onwheel" in document.createElement("div")) wheelEvent="wheel"; else if("onmousewheel" in document.createElement("div")) wheelEvent="mousewheel"; if(wheelEvent&&isChrome){ addEvent(wheelEvent, wheel); addEvent("mousedown", mousedown); addEvent("load", init); }})(); (function ($){ 'use strict'; var teslaThemes={ init: function (){ this.module(); }, module: function (){ this.sticky(); this.modal(); this.flickr(); this.menu(); this.knob(); this.fitvids(); this.progressBar(); this.gridEffect(); this.customZoom(); this.zoomImage(); this.portfolioFilter(); this.scrolld(); this.contactForm(); this.closeAlert(); this.worksGrid(); this.simpleSlider(); this.shopMessage(); this.shopViewGallery(); this.mapHelper(); }, sticky: function (){ if(jQuery('.sticky-bar').length){ jQuery(".sticky-bar").sticky({topSpacing:0}); }}, fitvids: function (){ var video=jQuery('noscript').text(); if(video.trim().search('iframe')===1){ jQuery('noscript').parent().append(video); } jQuery("#main-wrapper").fitVids({ customSelector: "iframe[src^='//player.vimeo.com'], iframe[src^='//www.youtube.com']"}); }, modal: function (){ jQuery('.modal-link').magnificPopup({ type:'inline', midClick: true, gallery: { enabled: true }, mainClass: 'mfp-fade' }); }, scrolld: function (){ jQuery('.main-nav a').stop(true).on('click', function(e){ var idHash=jQuery(this).attr('href'); if(idHash.charAt(0)==='#'){ e.preventDefault(); if(jQuery(idHash).length){ var offset=jQuery(idHash).offset().top - $('.sticky-bar').innerHeight(); jQuery("html, body").animate({ scrollTop: offset }, 600); }} }); jQuery(window).on('scroll', function(e){ jQuery('#main-wrapper > section').each(function(){ var sectionID=jQuery(this).attr('id'); if(sectionID){ var targetEl=jQuery('#' + sectionID)[0].getBoundingClientRect(); if(targetEl.top < jQuery(window).innerHeight()){ jQuery('.main-nav > ul > li > a').parent().removeClass('current_page_item'); jQuery('.main-nav > ul > li > a[href="#' + sectionID + '"]').parent().addClass('current_page_item'); }} }); }); }, flickr: function (){ jQuery('.flickr-widget').each(function(){ var stream=jQuery(this), stream_userid=stream.attr('data-userid'), stream_items=parseInt(stream.attr('data-items')); jQuery.getJSON("https://api.flickr.com/services/feeds/photos_public.gne?lang=en-us&format=json&id="+stream_userid+"&jsoncallback=?", function(stream_feed){ for(var i=0;i').addClass('flickr-link').attr('href',stream_feed.items[i].link).attr('target','_blank'); var stream_img=jQuery('').addClass('flickr-img').attr('src',stream_feed.items[i].media.m).attr('alt','').each(function(){ var t_this=this; var j_this=jQuery(this); var t_loaded_function=function(){ stream_a.append(t_this); }; var t_loaded_ready=false; var t_loaded_check=function(){ if(!t_loaded_ready){ t_loaded_ready=true; t_loaded_function(); }} var t_loaded_status=function(){ if(t_this.complete&&j_this.height()!==0) t_loaded_check(); } t_loaded_status(); jQuery(this).load(function(){ t_loaded_check(); }); }); stream.append(jQuery('
  2. ').append(stream_a)); }} stream_function(); }}); }); }, menu: function (){ var menu=jQuery('.main-nav'); var bodyPosition, menuButtonHTML='', menuButton=jQuery('.mobile-menu-button'), menuButtonHolder=jQuery('.identity'), menuMarkup=menu.clone(), i=0, t=0; jQuery(document).on('click', '.mobile-menu-button', function(e){ e.preventDefault(); if(menuMarkup.hasClass('active-menu')){ menuMarkup.removeClass('active-menu'); }else{ menuMarkup.toggleClass('active-menu'); } if(jQuery('body').hasClass('active-menu')){ jQuery('body').removeClass('active-menu'); }else{ jQuery('body').toggleClass('menu-effect'); }}); jQuery(document).on('drag', 'body .main-nav', function(e){ bodyPosition=-(e.adx - 200); if(e.adx < 100){ jQuery('body.menu-effect .boxed-view').css({ '-webkit-transform': 'translate3d('+bodyPosition+'px,0,0)' }); } if(e.end===true){ jQuery('body.menu-effect .boxed-view').removeAttr("style"); if(e.adx > 100){ jQuery('body ').removeClass('menu-effect'); jQuery('body > .main-nav').removeClass('active-menu'); }} }); enquire.register("screen and (max-width:992px)", { match:function(){ menu.hide(); if(i===0){ jQuery('body').prepend(menuMarkup); i++; }else{ menuMarkup.show(); } if(t===0){ menuButtonHolder.append(menuButtonHTML); t++; }else{ jQuery('.identity .mobile-menu-button').show(); } jQuery(document).on('click', 'body > .main-nav > ul > li > a', function(e){ var checkParent=jQuery(this).next('ul'); var menuItem=jQuery(this)[0].outerHTML; if(checkParent.length===1){ e.preventDefault(); jQuery('body > .main-nav > ul > li > ul').removeClass('menu-items-active-mob'); checkParent.toggleClass('menu-items-active-mob'); jQuery('body > .main-nav > ul > li > a').removeClass('link-items-active-mob'); jQuery(this).toggleClass('link-items-active-mob'); if(checkParent.find('.prepended').length===0){ checkParent.prepend('
  3. '+menuItem+'
  4. '); }} }); jQuery(document).on('click', '.link-items-active-mob', function(e){ jQuery(this).removeClass('link-items-active-mob'); jQuery(this).next().removeClass('menu-items-active-mob'); }); }, unmatch:function(){ menuMarkup.hide(); menu.show(); jQuery('.identity .mobile-menu-button').hide(); }, setup:function(){}, deferSetup:true, destroy:function(){}}); }, simpleSlider: function (){ jQuery('#simple-slider').sudoSlider({ numeric: true, responsive: true, autoHeight: false, effect: "random", prevhtml: ' ', nexthtml: ' ', controlsattr: 'id="controls"', numericattr: 'class="slider-nav"', continuous: true, updateBefore: true, animationZIndex: 10, }); var portfolioSlider=jQuery('#portfolio-slider').sudoSlider({ numeric: false, responsive: true, slideCount: 4, moveCount: 1, speed: 500, continuous: false, updateBefore: true, prevhtml: ' ', nexthtml: ' ', controlsattr: 'id="controls-portfolio"' }); if(jQuery('#portfolio-slider').length){ jQuery(window).resize(function(){ if(jQuery(window).width() < 992){ portfolioSlider.setOption('slideCount', 1); }else{ portfolioSlider.setOption('slideCount', 4); }}); } jQuery('#testimonials-slider').sudoSlider({ numeric: false, responsive: true, moveCount: 1, speed: 1000, updateBefore: true, vertical: true, continuous: true, auto: false, prevhtml: ' ', nexthtml: ' ', controlsattr: 'id="controls-testimonials"' }); jQuery('.portfolio-slider').sudoSlider({ numeric: false, responsive: true, moveCount: 1, speed: 1000, auto: false, continuous: true, updateBefore: true, prevhtml: ' ', nexthtml: ' ', controlsattr: 'id="controls"', numericattr: 'class="slider-nav"', }); jQuery('.blog-slider').sudoSlider({ numeric: false, responsive: true, moveCount: 1, speed: 1000, auto: false, continuous: true, updateBefore: true, prevhtml: ' ', nexthtml: ' ', controlsattr: 'id="controls"', numericattr: 'class="slider-nav"', }); }, knob: function (){ jQuery(".statistic-item").knob({ thickness: '.1', lineCap: 'round', fgColor: '#ffffff', bgColor: 'rgba(255,255,255,0.2)', readOnly: true, displayInput: true, font: "Oxygen", fontWeight: '300', step: 1, }); function animate (){ jQuery(".statistic-item").each(function(){ var defaultVal=jQuery(this).val(), item=jQuery(this), i=0, statisticAnimation=setInterval(function(){ if(i<=defaultVal){ item.val(i).trigger("change"); i++; }else{ clearInterval(statisticAnimation); }}, 50); }); } animate(); }, progressBar: function (){ var target=jQuery('.progresive-bar-items > li'), bar=jQuery('.progresive-bar-items > li span'); target.each(function (e){ var data=bar.eq(e).data('progress'); var i=100; data=100-data; var progressVal=setInterval(function(){ if(i > data){ if(i%2==0){ i=i+3; }else{ i=i-5; } bar.eq(e).css('right', i+'%'); }else{ clearInterval(progressVal); }}, 20); }); }, gridEffect: function(){ if(jQuery('#grid-effect').length){ new AnimOnScroll(document.getElementById('grid-effect'), { minDuration:0.4, maxDuration:0.7, viewportFactor:0.2 }); }}, zoomImage: function (){ jQuery('.zoom-image').swipebox(); }, portfolioFilter: function (){ jQuery('.filter-tags > li a').click(function (e){ e.preventDefault(); var tag=jQuery(this).text(); var filters=jQuery(this).parent(); jQuery('.filter-tags > li').removeClass('active-filter') filters.addClass('active-filter'); jQuery('#sorted-tag').html(tag); }); }, closeAlert: function(){ var closeButton=jQuery('.close-alert'); closeButton.click(function(e){ e.preventDefault(); jQuery(this).parent().hide(); }); }, contactForm: function (){ var t=jQuery('#contact-from'); var t_result=jQuery('.result-message'); var t_result_init_val=t_result.val(); var validate_email=function validateEmail(email){ var re=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); }; var reseter; t.submit(function(event){ reseter=clearTimeout(); event.preventDefault(); var t_values={}; var t_values_items=t.find('input[name],textarea[name]'); t_values_items.each(function(){ t_values[this.name]=jQuery(this).val(); }); if(t_values['contact_name']===''||t_values['contact_email']===''||t_values['contact_mess']===''){ t_result.text('Please fill in all the required fields.'); } else if(!validate_email(t_values['contact_email'])) t_result.text('Please provide a valid e-mail.'); else{ jQuery.ajax({ url: ajaxurl, type:'POST', data: 'action=tt_ajax_contact_form&'+ t.serialize(), success: function(response){ t_result.text(response); }}); } reseter=setTimeout(function(){ t_result.text(t_result_init_val); }, 5000); }); }, worksGrid: function(){ setTimeout(function(){ jQuery('.portfolio-items').isotope({ itemSelector: '.portfolio-items > li', }); }, 300); jQuery('.works-filter > li > a').on('click', function(){ var selector=$(this).data('filter'); jQuery('.portfolio-items').isotope({ filter: selector }); }); }, shopMessage: function(){ var docHeight=jQuery('body').innerHeight(); jQuery(window).on('scroll', function(e){ var elPosition=docHeight - (jQuery(this).scrollTop() + jQuery(this).innerHeight()); if(elPosition < 500){ jQuery('.woocommerce-message, .woocommerce-info, .woocommerce-error').addClass('show-message'); }else{ jQuery('.woocommerce-message, .woocommerce-info, .woocommerce-error').removeClass('show-message'); }}); jQuery('.woocommerce-message').on('click', function(){ if(!jQuery(this).is('a')){ jQuery('.woocommerce-message').hide(); }}); jQuery('.showcoupon').on('click', function(e){ e.preventDefault(); jQuery('.checkout_coupon').appendTo('.woocommerce-info '); jQuery('.checkout_coupon').show(); jQuery(this).hide(); }); jQuery('.woocommerce-message, .woocommerce-info, .woocommerce-error').on('click', function(e){ if(!jQuery(e.target).is('a, button, input')){ jQuery(this).hide(); }}); }, shopViewGallery: function(){ var initImage=jQuery('.woocommerce-main-image').html(); jQuery('.shop-quick-view-hover').on('hover', function(){ var imageURL=jQuery(this).attr('href'); if(imageURL){ imageURL=imageURL.replace(); jQuery('.woocommerce-main-image > img').attr('srcset', ''); jQuery('.woocommerce-main-image > img').attr('src', imageURL); }}); }, mapHelper: function(){ jQuery(document).on('click', function(e){ if(jQuery(e.target).is('.wpb_map_wraper')){ jQuery(e.target).addClass('tt-active-map'); }else{ jQuery('.wpb_map_wraper').removeClass('tt-active-map'); }}); }, customZoom: function(){ if(jQuery('.prettyphoto').length){ jQuery('.prettyphoto').removeClass('prettyphoto').addClass('zoom-image'); }} }; jQuery('#main-wrapper').addClass('show-content'); teslaThemes.init(); }(jQuery)); var addComment={moveForm:function(a,b,c,d){var e,f,g,h,i=this,j=i.I(a),k=i.I(c),l=i.I("cancel-comment-reply-link"),m=i.I("comment_parent"),n=i.I("comment_post_ID"),o=k.getElementsByTagName("form")[0];if(j&&k&&l&&m&&o){i.respondId=c,d=d||!1,i.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",k.parentNode.insertBefore(e,k)),j.parentNode.insertBefore(k,j.nextSibling),n&&d&&(n.value=d),m.value=b,l.style.display="",l.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{for(var p=0;p1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document); function vc_js(){vc_toggleBehaviour(),vc_tabsBehaviour(),vc_accordionBehaviour(),vc_teaserGrid(),vc_carouselBehaviour(),vc_slidersBehaviour(),vc_prettyPhoto(),vc_googleplus(),vc_pinterest(),vc_progress_bar(),vc_plugin_flexslider(),vc_google_fonts(),vc_gridBehaviour(),vc_rowBehaviour(),vc_googleMapsPointer(),vc_ttaActivation(),jQuery(document).trigger("vc_js"),window.setTimeout(vc_waypoints,500)}function getSizeName(){var screen_w=jQuery(window).width();return 1170screen_w?"desktop":768screen_w?"tablet":300screen_w?"mobile":300>screen_w?"mobile_portrait":""}function loadScript(url,$obj,callback){var script=document.createElement("script");script.type="text/javascript",script.readyState&&(script.onreadystatechange=function(){"loaded"!==script.readyState&&"complete"!==script.readyState||(script.onreadystatechange=null,callback())}),script.src=url,$obj.get(0).appendChild(script)}function vc_ttaActivation(){jQuery("[data-vc-accordion]").on("show.vc.accordion",function(e){var $=window.jQuery,ui={};ui.newPanel=$(this).data("vc.accordion").getTarget(),window.wpb_prepare_tab_content(e,ui)})}function vc_accordionActivate(event,ui){if(ui.newPanel.length&&ui.newHeader.length){var $pie_charts=ui.newPanel.find(".vc_pie_chart:not(.vc_ready)"),$round_charts=ui.newPanel.find(".vc_round-chart"),$line_charts=ui.newPanel.find(".vc_line-chart"),$carousel=ui.newPanel.find('[data-ride="vc_carousel"]');void 0!==jQuery.fn.isotope&&ui.newPanel.find(".isotope, .wpb_image_grid_ul").isotope("layout"),ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),vc_carouselBehaviour(ui.newPanel),vc_plugin_flexslider(ui.newPanel),$pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(),$round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({reload:!1}),$line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({reload:!1}),$carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"),ui.newPanel.parents(".isotope").length&&ui.newPanel.parents(".isotope").each(function(){jQuery(this).isotope("layout")})}}function initVideoBackgrounds(){return window.console&&window.console.warn&&window.console.warn("this function is deprecated use vc_initVideoBackgrounds"),vc_initVideoBackgrounds()}function vc_initVideoBackgrounds(){jQuery("[data-vc-video-bg]").each(function(){var youtubeUrl,youtubeId,$element=jQuery(this);$element.data("vcVideoBg")?(youtubeUrl=$element.data("vcVideoBg"),youtubeId=vcExtractYoutubeId(youtubeUrl),youtubeId&&($element.find(".vc_video-bg").remove(),insertYoutubeVideoAsBackground($element,youtubeId)),jQuery(window).on("grid:items:added",function(event,$grid){$element.has($grid).length&&vcResizeVideoBackground($element)})):$element.find(".vc_video-bg").remove()})}function insertYoutubeVideoAsBackground($element,youtubeId,counter){if("undefined"==typeof YT||void 0===YT.Player)return 100<(counter=void 0===counter?0:counter)?void console.warn("Too many attempts to load YouTube api"):void setTimeout(function(){insertYoutubeVideoAsBackground($element,youtubeId,counter++)},100);var $container=$element.prepend('
    ').find(".inner");new YT.Player($container[0],{width:"100%",height:"100%",videoId:youtubeId,playerVars:{playlist:youtubeId,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1,wmode:"transparent"},events:{onReady:function(event){event.target.mute().setLoop(!0)}}}),vcResizeVideoBackground($element),jQuery(window).bind("resize",function(){vcResizeVideoBackground($element)})}function vcResizeVideoBackground($element){var iframeW,iframeH,marginLeft,marginTop,containerW=$element.innerWidth(),containerH=$element.innerHeight();containerW/containerH<16/9?(iframeW=containerH*(16/9),iframeH=containerH,marginLeft=-Math.round((iframeW-containerW)/2)+"px",marginTop=-Math.round((iframeH-containerH)/2)+"px",iframeW+="px",iframeH+="px"):(iframeW=containerW,iframeH=containerW*(9/16),marginTop=-Math.round((iframeH-containerH)/2)+"px",marginLeft=-Math.round((iframeW-containerW)/2)+"px",iframeW+="px",iframeH+="px"),$element.find(".vc_video-bg iframe").css({maxWidth:"1000%",marginLeft:marginLeft,marginTop:marginTop,width:iframeW,height:iframeH})}function vcExtractYoutubeId(url){if(void 0===url)return!1;var id=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);return null!==id&&id[1]}function vc_googleMapsPointer(){var $=window.jQuery,$wpbGmapsWidget=$(".wpb_gmaps_widget");$wpbGmapsWidget.click(function(){$("iframe",this).css("pointer-events","auto")}),$wpbGmapsWidget.mouseleave(function(){$("iframe",this).css("pointer-events","none")}),$(".wpb_gmaps_widget iframe").css("pointer-events","none")}document.documentElement.className+=" js_active ",document.documentElement.className+="ontouchstart"in document.documentElement?" vc_mobile ":" vc_desktop ",function(){for(var prefix=["-webkit-","-moz-","-ms-","-o-",""],i=0;iparseInt(ver[1]);$call.each(function(index){var $tabs,interval=jQuery(this).attr("data-interval"),tabs_array=[];if($tabs=jQuery(this).find(".wpb_tour_tabs_wrapper").tabs({show:function(event,ui){wpb_prepare_tab_content(event,ui)},beforeActivate:function(event,ui){1!==ui.newPanel.index()&&ui.newPanel.find(".vc_pie_chart:not(.vc_ready)")},activate:function(event,ui){wpb_prepare_tab_content(event,ui)}}),interval&&0index?index=$tabs.tabs("length")-1:index>=$tabs.tabs("length")&&(index=0),$tabs.tabs("select",index)}else{var index=$tabs.tabs("option","active"),length=$tabs.find(".wpb_tab").length;index=jQuery(this).parent().hasClass("wpb_next_slide")?index+1>=length?0:index+1:0>index-1?length-1:index-1,$tabs.tabs("option","active",index)}})})}}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(index){var $tabs,$this=jQuery(this),active_tab=($this.attr("data-interval"),!isNaN(jQuery(this).data("active-tab"))&&0 div > h3",autoHeight:!1,heightStyle:"content",active:active_tab,collapsible:collapsible,navigation:!0,activate:vc_accordionActivate,change:function(event,ui){void 0!==jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"),vc_carouselBehaviour(ui.newPanel)}}),!0===$this.data("vcDisableKeydown")&&($tabs.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var layout_modes={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var $container=jQuery(this),$thumbs=$container.find(".wpb_thumbnails"),layout_mode=$thumbs.attr("data-layout-mode");$thumbs.isotope({itemSelector:".isotope-item",layoutMode:void 0===layout_modes[layout_mode]?"fitRows":layout_modes[layout_mode]}),$container.find(".categories_filter a").data("isotope",$thumbs).click(function(e){e.preventDefault();var $thumbs=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),$thumbs.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).bind("load resize",function(){$thumbs.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){($parent?$parent.find(".wpb_carousel"):jQuery(".wpb_carousel")).each(function(){var $this=jQuery(this);if(!0!==$this.data("carousel_enabled")&&$this.is(":visible")){$this.data("carousel_enabled",!0),getColumnsCount(jQuery(this)),jQuery(this).hasClass("columns_count_1");var carousele_li=jQuery(this).find(".wpb_thumbnails-fluid li");carousele_li.css({"margin-right":carousele_li.css("margin-left"),"margin-left":0});var fluid_ul=jQuery(this).find("ul.wpb_thumbnails-fluid");fluid_ul.width(fluid_ul.width()+300),jQuery(window).resize(function(){var before_resize=screen_size;screen_size=getSizeName(),before_resize!=screen_size&&window.setTimeout("location.reload()",20)})}})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(index){var $imagesGrid,this_element=jQuery(this);if(this_element.hasClass("wpb_slider_nivo")){var sliderTimeout=1e3*this_element.attr("data-interval");0===sliderTimeout&&(sliderTimeout=9999999999),this_element.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:800,pauseTime:sliderTimeout,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next"})}else this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded?$imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){$imagesGrid.isotope({itemSelector:".isotope-item",layoutMode:"fitRows"})}):this_element.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows"}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){location.href.indexOf("#!prettyPhoto")>-1&&(location.hash="")},social_tools:""})}catch(err){window.console&&window.console.log&&console.log(err)}}),"function"!=typeof window.vc_google_fonts&&(window.vc_google_fonts=function(){return!1}),window.vcParallaxSkroll=!1,"function"!=typeof window.vc_rowBehaviour&&(window.vc_rowBehaviour=function(){function fullWidthRow(){var $elements=$('[data-vc-full-width="true"]');$.each($elements,function(key,item){var $el=$(this);$el.addClass("vc_hidden");var $el_full=$el.next(".vc_row-full-width");if($el_full.length||($el_full=$el.parent().next(".vc_row-full-width")),$el_full.length){var el_margin_left=parseInt($el.css("margin-left"),10),el_margin_right=parseInt($el.css("margin-right"),10),offset=0-$el_full.offset().left-el_margin_left,width=$(window).width();if($el.css({position:"relative",left:offset,"box-sizing":"border-box",width:$(window).width()}),!$el.data("vcStretchContent")){var padding=-1*offset;0>padding&&(padding=0);var paddingRight=width-padding-$el_full.width()+el_margin_left+el_margin_right;0>paddingRight&&(paddingRight=0),$el.css({"padding-left":padding+"px","padding-right":paddingRight+"px"})}$el.attr("data-vc-full-width-init","true"),$el.removeClass("vc_hidden"),$(document).trigger("vc-full-width-row-single",{el:$el,offset:offset,marginLeft:el_margin_left,marginRight:el_margin_right,elFull:$el_full,width:width})}}),$(document).trigger("vc-full-width-row",$elements)}function fullHeightRow(){var $element=$(".vc_row-o-full-height:first");if($element.length){var $window,windowHeight,offsetTop,fullHeight;$window=$(window),windowHeight=$window.height(),offsetTop=$element.offset().top,offsetTop0||navigator.userAgent.match(/Trident.*rv\:11\./))&&$(".vc_row-o-full-height").each(function(){"flex"===$(this).css("display")&&$(this).wrap('
    ')})}(),vc_initVideoBackgrounds(),function(){var vcSkrollrOptions,callSkrollInit=!1;window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),$(".vc_parallax-inner").remove(),$("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),$("[data-vc-parallax]").each(function(){var skrollrSpeed,skrollrSize,skrollrStart,skrollrEnd,$parallaxElement,parallaxImage,youtubeId;callSkrollInit=!0,"on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),skrollrSize=100*$(this).data("vcParallax"),$parallaxElement=$("
    ").addClass("vc_parallax-inner").appendTo($(this)),$parallaxElement.height(skrollrSize+"%"),parallaxImage=$(this).data("vcParallaxImage"),youtubeId=vcExtractYoutubeId(parallaxImage),youtubeId?insertYoutubeVideoAsBackground($parallaxElement,youtubeId):void 0!==parallaxImage&&$parallaxElement.css("background-image","url("+parallaxImage+")"),skrollrSpeed=skrollrSize-100,skrollrStart=-skrollrSpeed,skrollrEnd=0,$parallaxElement.attr("data-bottom-top","top: "+skrollrStart+"%;").attr("data-top-bottom","top: "+skrollrEnd+"%;")}),!(!callSkrollInit||!window.skrollr)&&(vcSkrollrOptions={forceHeight:!1,smoothScrolling:!1,mobileCheck:function(){return!1}},window.vcParallaxSkroll=skrollr.init(vcSkrollrOptions),window.vcParallaxSkroll)}()}),"function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()}),"function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(el){for(var find=!1,i=1;!1===find;){if(el.hasClass("columns_count_"+i))return find=!0,i;i++}});var screen_size=getSizeName();"function"!=typeof window.wpb_prepare_tab_content&&(window.wpb_prepare_tab_content=function(event,ui){var $ui_panel,$google_maps,panel=ui.panel||ui.newPanel,$pie_charts=panel.find(".vc_pie_chart:not(.vc_ready)"),$round_charts=panel.find(".vc_round-chart"),$line_charts=panel.find(".vc_line-chart"),$carousel=panel.find('[data-ride="vc_carousel"]');if(vc_carouselBehaviour(),vc_plugin_flexslider(panel),ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),panel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&panel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),$pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(),$round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({reload:!1}),$line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({reload:!1}),$carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"),$ui_panel=panel.find(".isotope, .wpb_image_grid_ul"),$google_maps=panel.find(".wpb_gmaps_widget"),0<$ui_panel.length&&$ui_panel.isotope("layout"),$google_maps.length&&!$google_maps.is(".map_ready")){var $frame=$google_maps.find("iframe");$frame.attr("src",$frame.attr("src")),$google_maps.addClass("map_ready")}panel.parents(".isotope").length&&panel.parents(".isotope").each(function(){jQuery(this).isotope("layout")})}),window.vc_googleMapsPointer,jQuery(document).ready(function($){window.vc_js()}); !function(a,b,c){"use strict";function d(c){if(e=b.documentElement,f=b.body,T(),ha=this,c=c||{},ma=c.constants||{},c.easing)for(var d in c.easing)W[d]=c.easing[d];ta=c.edgeStrategy||"set",ka={beforerender:c.beforerender,render:c.render,keyframe:c.keyframe},la=c.forceHeight!==!1,la&&(Ka=c.scale||1),na=c.mobileDeceleration||y,pa=c.smoothScrolling!==!1,qa=c.smoothScrollingDuration||A,ra={targetTop:ha.getScrollTop()},Sa=(c.mobileCheck||function(){return/Android|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent||navigator.vendor||a.opera)})(),Sa?(ja=b.getElementById(c.skrollrBody||z),ja&&ga(),X(),Ea(e,[s,v],[t])):Ea(e,[s,u],[t]),ha.refresh(),wa(a,"resize orientationchange",function(){var a=e.clientWidth,b=e.clientHeight;(b!==Pa||a!==Oa)&&(Pa=b,Oa=a,Qa=!0)});var g=U();return function h(){$(),va=g(h)}(),ha}var e,f,g={get:function(){return ha},init:function(a){return ha||new d(a)},VERSION:"0.6.29"},h=Object.prototype.hasOwnProperty,i=a.Math,j=a.getComputedStyle,k="touchstart",l="touchmove",m="touchcancel",n="touchend",o="skrollable",p=o+"-before",q=o+"-between",r=o+"-after",s="skrollr",t="no-"+s,u=s+"-desktop",v=s+"-mobile",w="linear",x=1e3,y=.004,z="skrollr-body",A=200,B="start",C="end",D="center",E="bottom",F="___skrollable_id",G=/^(?:input|textarea|button|select)$/i,H=/^\s+|\s+$/g,I=/^data(?:-(_\w+))?(?:-?(-?\d*\.?\d+p?))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/,J=/\s*(@?[\w\-\[\]]+)\s*:\s*(.+?)\s*(?:;|$)/gi,K=/^(@?[a-z\-]+)\[(\w+)\]$/,L=/-([a-z0-9_])/g,M=function(a,b){return b.toUpperCase()},N=/[\-+]?[\d]*\.?[\d]+/g,O=/\{\?\}/g,P=/rgba?\(\s*-?\d+\s*,\s*-?\d+\s*,\s*-?\d+/g,Q=/[a-z\-]+-gradient/g,R="",S="",T=function(){var a=/^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/;if(j){var b=j(f,null);for(var c in b)if(R=c.match(a)||+c==c&&b[c].match(a))break;if(!R)return void(R=S="");R=R[0],"-"===R.slice(0,1)?(S=R,R={"-webkit-":"webkit","-moz-":"Moz","-ms-":"ms","-o-":"O"}[R]):S="-"+R.toLowerCase()+"-"}},U=function(){var b=a.requestAnimationFrame||a[R.toLowerCase()+"RequestAnimationFrame"],c=Ha();return(Sa||!b)&&(b=function(b){var d=Ha()-c,e=i.max(0,1e3/60-d);return a.setTimeout(function(){c=Ha(),b()},e)}),b},V=function(){var b=a.cancelAnimationFrame||a[R.toLowerCase()+"CancelAnimationFrame"];return(Sa||!b)&&(b=function(b){return a.clearTimeout(b)}),b},W={begin:function(){return 0},end:function(){return 1},linear:function(a){return a},quadratic:function(a){return a*a},cubic:function(a){return a*a*a},swing:function(a){return-i.cos(a*i.PI)/2+.5},sqrt:function(a){return i.sqrt(a)},outCubic:function(a){return i.pow(a-1,3)+1},bounce:function(a){var b;if(.5083>=a)b=3;else if(.8489>=a)b=9;else if(.96208>=a)b=27;else{if(!(.99981>=a))return 1;b=91}return 1-i.abs(3*i.cos(a*b*1.028)/b)}};d.prototype.refresh=function(a){var d,e,f=!1;for(a===c?(f=!0,ia=[],Ra=0,a=b.getElementsByTagName("*")):a.length===c&&(a=[a]),d=0,e=a.length;e>d;d++){var g=a[d],h=g,i=[],j=pa,k=ta,l=!1;if(f&&F in g&&delete g[F],g.attributes){for(var m=0,n=g.attributes.length;n>m;m++){var p=g.attributes[m];if("data-anchor-target"!==p.name)if("data-smooth-scrolling"!==p.name)if("data-edge-strategy"!==p.name)if("data-emit-events"!==p.name){var q=p.name.match(I);if(null!==q){var r={props:p.value,element:g,eventType:p.name.replace(L,M)};i.push(r);var s=q[1];s&&(r.constant=s.substr(1));var t=q[2];/p$/.test(t)?(r.isPercentage=!0,r.offset=(0|t.slice(0,-1))/100):r.offset=0|t;var u=q[3],v=q[4]||u;u&&u!==B&&u!==C?(r.mode="relative",r.anchors=[u,v]):(r.mode="absolute",u===C?r.isEnd=!0:r.isPercentage||(r.offset=r.offset*Ka))}}else l=!0;else k=p.value;else j="off"!==p.value;else if(h=b.querySelector(p.value),null===h)throw'Unable to find anchor target "'+p.value+'"'}if(i.length){var w,x,y;!f&&F in g?(y=g[F],w=ia[y].styleAttr,x=ia[y].classAttr):(y=g[F]=Ra++,w=g.style.cssText,x=Da(g)),ia[y]={element:g,styleAttr:w,classAttr:x,anchorTarget:h,keyFrames:i,smoothScrolling:j,edgeStrategy:k,emitEvents:l,lastFrameIndex:-1},Ea(g,[o],[])}}}for(Aa(),d=0,e=a.length;e>d;d++){var z=ia[a[d][F]];z!==c&&(_(z),ba(z))}return ha},d.prototype.relativeToAbsolute=function(a,b,c){var d=e.clientHeight,f=a.getBoundingClientRect(),g=f.top,h=f.bottom-f.top;return b===E?g-=d:b===D&&(g-=d/2),c===E?g+=h:c===D&&(g+=h/2),g+=ha.getScrollTop(),g+.5|0},d.prototype.animateTo=function(a,b){b=b||{};var d=Ha(),e=ha.getScrollTop(),f=b.duration===c?x:b.duration;return oa={startTop:e,topDiff:a-e,targetTop:a,duration:f,startTime:d,endTime:d+f,easing:W[b.easing||w],done:b.done},oa.topDiff||(oa.done&&oa.done.call(ha,!1),oa=c),ha},d.prototype.stopAnimateTo=function(){oa&&oa.done&&oa.done.call(ha,!0),oa=c},d.prototype.isAnimatingTo=function(){return!!oa},d.prototype.isMobile=function(){return Sa},d.prototype.setScrollTop=function(b,c){return sa=c===!0,Sa?Ta=i.min(i.max(b,0),Ja):a.scrollTo(0,b),ha},d.prototype.getScrollTop=function(){return Sa?Ta:a.pageYOffset||e.scrollTop||f.scrollTop||0},d.prototype.getMaxScrollTop=function(){return Ja},d.prototype.on=function(a,b){return ka[a]=b,ha},d.prototype.off=function(a){return delete ka[a],ha},d.prototype.destroy=function(){var a=V();a(va),ya(),Ea(e,[t],[s,u,v]);for(var b=0,d=ia.length;d>b;b++)fa(ia[b].element);e.style.overflow=f.style.overflow="",e.style.height=f.style.height="",ja&&g.setStyle(ja,"transform","none"),ha=c,ja=c,ka=c,la=c,Ja=0,Ka=1,ma=c,na=c,La="down",Ma=-1,Oa=0,Pa=0,Qa=!1,oa=c,pa=c,qa=c,ra=c,sa=c,Ra=0,ta=c,Sa=!1,Ta=0,ua=c};var X=function(){var d,g,h,j,o,p,q,r,s,t,u,v;wa(e,[k,l,m,n].join(" "),function(a){var e=a.changedTouches[0];for(j=a.target;3===j.nodeType;)j=j.parentNode;switch(o=e.clientY,p=e.clientX,t=a.timeStamp,G.test(j.tagName)||a.preventDefault(),a.type){case k:d&&d.blur(),ha.stopAnimateTo(),d=j,g=q=o,h=p,s=t;break;case l:G.test(j.tagName)&&b.activeElement!==j&&a.preventDefault(),r=o-q,v=t-u,ha.setScrollTop(Ta-r,!0),q=o,u=t;break;default:case m:case n:var f=g-o,w=h-p,x=w*w+f*f;if(49>x){if(!G.test(d.tagName)){d.focus();var y=b.createEvent("MouseEvents");y.initMouseEvent("click",!0,!0,a.view,1,e.screenX,e.screenY,e.clientX,e.clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,0,null),d.dispatchEvent(y)}return}d=c;var z=r/v;z=i.max(i.min(z,3),-3);var A=i.abs(z/na),B=z*A+.5*na*A*A,C=ha.getScrollTop()-B,D=0;C>Ja?(D=(Ja-C)/B,C=Ja):0>C&&(D=-C/B,C=0),A*=1-D,ha.animateTo(C+.5|0,{easing:"outCubic",duration:A})}}),a.scrollTo(0,0),e.style.overflow=f.style.overflow="hidden"},Y=function(){var a,b,c,d,f,g,h,j,k,l,m,n=e.clientHeight,o=Ba();for(j=0,k=ia.length;k>j;j++)for(a=ia[j],b=a.element,c=a.anchorTarget,d=a.keyFrames,f=0,g=d.length;g>f;f++)h=d[f],l=h.offset,m=o[h.constant]||0,h.frame=l,h.isPercentage&&(l*=n,h.frame=l),"relative"===h.mode&&(fa(b),h.frame=ha.relativeToAbsolute(c,h.anchors[0],h.anchors[1])-l,fa(b,!0)),h.frame+=m,la&&!h.isEnd&&h.frame>Ja&&(Ja=h.frame);for(Ja=i.max(Ja,Ca()),j=0,k=ia.length;k>j;j++){for(a=ia[j],d=a.keyFrames,f=0,g=d.length;g>f;f++)h=d[f],m=o[h.constant]||0,h.isEnd&&(h.frame=Ja-h.offset+m);a.keyFrames.sort(Ia)}},Z=function(a,b){for(var c=0,d=ia.length;d>c;c++){var e,f,i=ia[c],j=i.element,k=i.smoothScrolling?a:b,l=i.keyFrames,m=l.length,n=l[0],s=l[l.length-1],t=ks.frame,v=t?n:s,w=i.emitEvents,x=i.lastFrameIndex;if(t||u){if(t&&-1===i.edge||u&&1===i.edge)continue;switch(t?(Ea(j,[p],[r,q]),w&&x>-1&&(za(j,n.eventType,La),i.lastFrameIndex=-1)):(Ea(j,[r],[p,q]),w&&m>x&&(za(j,s.eventType,La),i.lastFrameIndex=m)),i.edge=t?-1:1,i.edgeStrategy){case"reset":fa(j);continue;case"ease":k=v.frame;break;default:case"set":var y=v.props;for(e in y)h.call(y,e)&&(f=ea(y[e].value),0===e.indexOf("@")?j.setAttribute(e.substr(1),f):g.setStyle(j,e,f));continue}}else 0!==i.edge&&(Ea(j,[o,q],[p,r]),i.edge=0);for(var z=0;m-1>z;z++)if(k>=l[z].frame&&k<=l[z+1].frame){var A=l[z],B=l[z+1];for(e in A.props)if(h.call(A.props,e)){var C=(k-A.frame)/(B.frame-A.frame);C=A.props[e].easing(C),f=da(A.props[e].value,B.props[e].value,C),f=ea(f),0===e.indexOf("@")?j.setAttribute(e.substr(1),f):g.setStyle(j,e,f)}w&&x!==z&&("down"===La?za(j,A.eventType,La):za(j,B.eventType,La),i.lastFrameIndex=z);break}}},$=function(){Qa&&(Qa=!1,Aa());var a,b,d=ha.getScrollTop(),e=Ha();if(oa)e>=oa.endTime?(d=oa.targetTop,a=oa.done,oa=c):(b=oa.easing((e-oa.startTime)/oa.duration),d=oa.startTop+b*oa.topDiff|0),ha.setScrollTop(d,!0);else if(!sa){var f=ra.targetTop-d;f&&(ra={startTop:Ma,topDiff:d-Ma,targetTop:d,startTime:Na,endTime:Na+qa}),e<=ra.endTime&&(b=W.sqrt((e-ra.startTime)/qa),d=ra.startTop+b*ra.topDiff|0)}if(sa||Ma!==d){La=d>Ma?"down":Ma>d?"up":La,sa=!1;var h={curTop:d,lastTop:Ma,maxTop:Ja,direction:La},i=ka.beforerender&&ka.beforerender.call(ha,h);i!==!1&&(Z(d,ha.getScrollTop()),Sa&&ja&&g.setStyle(ja,"transform","translate(0, "+-Ta+"px) "+ua),Ma=d,ka.render&&ka.render.call(ha,h)),a&&a.call(ha,!1)}Na=e},_=function(a){for(var b=0,c=a.keyFrames.length;c>b;b++){for(var d,e,f,g,h=a.keyFrames[b],i={};null!==(g=J.exec(h.props));)f=g[1],e=g[2],d=f.match(K),null!==d?(f=d[1],d=d[2]):d=w,e=e.indexOf("!")?aa(e):[e.slice(1)],i[f]={value:e,easing:W[d]};h.props=i}},aa=function(a){var b=[];return P.lastIndex=0,a=a.replace(P,function(a){return a.replace(N,function(a){return a/255*100+"%"})}),S&&(Q.lastIndex=0,a=a.replace(Q,function(a){return S+a})),a=a.replace(N,function(a){return b.push(+a),"{?}"}),b.unshift(a),b},ba=function(a){var b,c,d={};for(b=0,c=a.keyFrames.length;c>b;b++)ca(a.keyFrames[b],d);for(d={},b=a.keyFrames.length-1;b>=0;b--)ca(a.keyFrames[b],d)},ca=function(a,b){var c;for(c in b)h.call(a.props,c)||(a.props[c]=b[c]);for(c in a.props)b[c]=a.props[c]},da=function(a,b,c){var d,e=a.length;if(e!==b.length)throw"Can't interpolate between \""+a[0]+'" and "'+b[0]+'"';var f=[a[0]];for(d=1;e>d;d++)f[d]=a[d]+(b[d]-a[d])*c;return f},ea=function(a){var b=1;return O.lastIndex=0,a[0].replace(O,function(){return a[b++]})},fa=function(a,b){a=[].concat(a);for(var c,d,e=0,f=a.length;f>e;e++)d=a[e],c=ia[d[F]],c&&(b?(d.style.cssText=c.dirtyStyleAttr,Ea(d,c.dirtyClassAttr)):(c.dirtyStyleAttr=d.style.cssText,c.dirtyClassAttr=Da(d),d.style.cssText=c.styleAttr,Ea(d,c.classAttr)))},ga=function(){ua="translateZ(0)",g.setStyle(ja,"transform",ua);var a=j(ja),b=a.getPropertyValue("transform"),c=a.getPropertyValue(S+"transform"),d=b&&"none"!==b||c&&"none"!==c;d||(ua="")};g.setStyle=function(a,b,c){var d=a.style;if(b=b.replace(L,M).replace("-",""),"zIndex"===b)isNaN(c)?d[b]=c:d[b]=""+(0|c);else if("float"===b)d.styleFloat=d.cssFloat=c;else try{R&&(d[R+b.slice(0,1).toUpperCase()+b.slice(1)]=c),d[b]=c}catch(e){}};var ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa=g.addEvent=function(b,c,d){var e=function(b){return b=b||a.event,b.target||(b.target=b.srcElement),b.preventDefault||(b.preventDefault=function(){b.returnValue=!1,b.defaultPrevented=!0}),d.call(this,b)};c=c.split(" ");for(var f,g=0,h=c.length;h>g;g++)f=c[g],b.addEventListener?b.addEventListener(f,d,!1):b.attachEvent("on"+f,e),Ua.push({element:b,name:f,listener:d})},xa=g.removeEvent=function(a,b,c){b=b.split(" ");for(var d=0,e=b.length;e>d;d++)a.removeEventListener?a.removeEventListener(b[d],c,!1):a.detachEvent("on"+b[d],c)},ya=function(){for(var a,b=0,c=Ua.length;c>b;b++)a=Ua[b],xa(a.element,a.name,a.listener);Ua=[]},za=function(a,b,c){ka.keyframe&&ka.keyframe.call(ha,a,b,c)},Aa=function(){var a=ha.getScrollTop();Ja=0,la&&!Sa&&(f.style.height=""),Y(),la&&!Sa&&(f.style.height=Ja+e.clientHeight+"px"),Sa?ha.setScrollTop(i.min(ha.getScrollTop(),Ja)):ha.setScrollTop(a,!0),sa=!0},Ba=function(){var a,b,c=e.clientHeight,d={};for(a in ma)b=ma[a],"function"==typeof b?b=b.call(ha):/p$/.test(b)&&(b=b.slice(0,-1)/100*c),d[a]=b;return d},Ca=function(){var a,b=0;return ja&&(b=i.max(ja.offsetHeight,ja.scrollHeight)),a=i.max(b,f.scrollHeight,f.offsetHeight,e.scrollHeight,e.offsetHeight,e.clientHeight),a-e.clientHeight},Da=function(b){var c="className";return a.SVGElement&&b instanceof a.SVGElement&&(b=b[c],c="baseVal"),b[c]},Ea=function(b,d,e){var f="className";if(a.SVGElement&&b instanceof a.SVGElement&&(b=b[f],f="baseVal"),e===c)return void(b[f]=d);for(var g=b[f],h=0,i=e.length;i>h;h++)g=Ga(g).replace(Ga(e[h])," ");g=Fa(g);for(var j=0,k=d.length;k>j;j++)-1===Ga(g).indexOf(Ga(d[j]))&&(g+=" "+d[j]);b[f]=Fa(g)},Fa=function(a){return a.replace(H,"")},Ga=function(a){return" "+a+" "},Ha=Date.now||function(){return+new Date},Ia=function(a,b){return a.frame-b.frame},Ja=0,Ka=1,La="down",Ma=-1,Na=Ha(),Oa=0,Pa=0,Qa=!1,Ra=0,Sa=!1,Ta=0,Ua=[];"function"==typeof define&&define.amd?define([],function(){return g}):"undefined"!=typeof module&&module.exports?module.exports=g:a.skrollr=g}(window,document); (function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="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:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){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(c&&(!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 a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);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=t.data(w))!=null?o:[];i.push(this.id);t.data(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=n(t).data(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;if(e==null){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=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(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(et.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);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(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.load(function(){return n[m]("refresh")})})}).call(this);