(function($){
$(function(){
if(typeof scrollBackToTop.autoFontSize!=='undefined'&&scrollBackToTop.autoFontSize){
$('.scroll-back-to-top-wrapper').textfill({ maxFontPixels: 36 });
}
$('.scroll-back-to-top-wrapper').on('click', function(){
if(typeof scrollBackToTop.scrollDuration!=='undefined'){
scrollToElement("body", scrollBackToTop.scrollDuration, 0);
}});
$(document).on('scroll', function(){
if($(window).scrollTop() > 100){
$('.scroll-back-to-top-wrapper').addClass('show');
}else{
$('.scroll-back-to-top-wrapper').removeClass('show');
}});
if(typeof scrollBackToTop.visibilityDuration!=='undefined'&&scrollBackToTop.visibilityDuration){
$(window).on('scroll', function(){
clearTimeout($.data(this, 'sbttScrollTimer'));
$.data(this, 'sbttScrollTimer', setTimeout(function(){
$('.scroll-back-to-top-wrapper').removeClass('show');
}, scrollBackToTop.visibilityDuration));
});
}});
function scrollToElement(selector, time, verticalOffset){
time=typeof(time)!='undefined' ? time:1000;
verticalOffset=typeof(verticalOffset)!='undefined' ? verticalOffset:0;
element=$(selector);
offset=element.offset();
offsetTop=offset.top + verticalOffset;
$('html, body').animate({scrollTop: offsetTop}, parseInt(time), 'linear');
}
function isFullyVisible(el){
if(! el.length){
return false;
}
if(el instanceof jQuery){
el=el[0];
}
var top=el.offsetTop;
var left=el.offsetLeft;
var width=el.offsetWidth;
var height=el.offsetHeight;
while(el.offsetParent){
el=el.offsetParent;
top +=el.offsetTop;
left +=el.offsetLeft;
}
return (
top >=window.pageYOffset &&
left >=window.pageXOffset &&
(top + height) <=(window.pageYOffset + window.innerHeight) &&
(left + width) <=(window.pageXOffset + window.innerWidth)
);
}
function isPartiallyVisible(el){
if(! el.length){
return false;
}
if(el instanceof jQuery){
el=el[0];
}
var top=el.offsetTop;
var left=el.offsetLeft;
var width=el.offsetWidth;
var height=el.offsetHeight;
while(el.offsetParent){
el=el.offsetParent;
top +=el.offsetTop;
left +=el.offsetLeft;
}
return (
top < (window.pageYOffset + window.innerHeight) &&
left < (window.pageXOffset + window.innerWidth) &&
(top + height) > window.pageYOffset &&
(left + width) > window.pageXOffset
);
}})(jQuery);
(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("object"==typeof a){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;b<a.length;b+=1)c.push(a[b].listener);return c},d.getListenersAsObject=function(a){var b,c=this.getListeners(a);return c instanceof Array&&(b={},b[a]=c),b||c},d.addListener=function(a,c){var d,e=this.getListenersAsObject(a),f="object"==typeof c;for(d in e)e.hasOwnProperty(d)&&-1===b(e[d],c)&&e[d].push(f?c:{listener:c,once:!1});return this},d.on=c("addListener"),d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})},d.once=c("addOnceListener"),d.defineEvent=function(a){return this.getListeners(a),this},d.defineEvents=function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this},d.removeListener=function(a,c){var d,e,f=this.getListenersAsObject(a);for(e in f)f.hasOwnProperty(e)&&(d=b(f[e],c),-1!==d&&f[e].splice(d,1));return this},d.off=c("removeListener"),d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)},d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)},d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener,g=a?this.removeListeners:this.addListeners;if("object"!=typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"==typeof e?f.call(this,d,e):g.call(this,d,e));return this},d.removeEvent=function(a){var b,c=typeof a,d=this._getEvents();if("string"===c)delete d[a];else if("object"===c)for(b in d)d.hasOwnProperty(b)&&a.test(b)&&delete d[b];else delete this._events;return this},d.removeAllListeners=c("removeEvent"),d.emitEvent=function(a,b){var c,d,e,f,g=this.getListenersAsObject(a);for(e in g)if(g.hasOwnProperty(e))for(d=g[e].length;d--;)c=g[e][d],c.once===!0&&this.removeListener(a,c.listener),f=c.listener.apply(this,b||[]),f===this._getOnceReturnValue()&&this.removeListener(a,c.listener);return this},d.trigger=c("emitEvent"),d.emit=function(a){var b=Array.prototype.slice.call(arguments,1);return this.emitEvent(a,b)},d.setOnceReturnValue=function(a){return this._onceReturnValue=a,this},d._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},d._getEvents=function(){return this._events||(this._events={})},a.noConflict=function(){return e.EventEmitter=f,a},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return a}):"object"==typeof module&&module.exports?module.exports=a:this.EventEmitter=a}).call(this),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):a.eventie=f}(this),function(a,b){"use strict";"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(a,require("wolfy87-eventemitter"),require("eventie")):a.imagesLoaded=b(a,a.EventEmitter,a.eventie)}(window,function(a,b,c){function d(a,b){for(var c in b)a[c]=b[c];return a}function e(a){return"[object Array]"==l.call(a)}function f(a){var b=[];if(e(a))b=a;else if("number"==typeof a.length)for(var c=0;c<a.length;c++)b.push(a[c]);else b.push(a);return b}function g(a,b,c){if(!(this instanceof g))return new g(a,b,c);"string"==typeof a&&(a=document.querySelectorAll(a)),this.elements=f(a),this.options=d({},this.options),"function"==typeof b?c=b:d(this.options,b),c&&this.on("always",c),this.getImages(),j&&(this.jqDeferred=new j.Deferred);var e=this;setTimeout(function(){e.check()})}function h(a){this.img=a}function i(a,b){this.url=a,this.element=b,this.img=new Image}var j=a.jQuery,k=a.console,l=Object.prototype.toString;g.prototype=new b,g.prototype.options={},g.prototype.getImages=function(){this.images=[];for(var a=0;a<this.elements.length;a++){var b=this.elements[a];this.addElementImages(b)}},g.prototype.addElementImages=function(a){"IMG"==a.nodeName&&this.addImage(a),this.options.background===!0&&this.addElementBackgroundImages(a);var b=a.nodeType;if(b&&m[b]){for(var c=a.querySelectorAll("img"),d=0;d<c.length;d++){var e=c[d];this.addImage(e)}if("string"==typeof this.options.background){var f=a.querySelectorAll(this.options.background);for(d=0;d<f.length;d++){var g=f[d];this.addElementBackgroundImages(g)}}}};var m={1:!0,9:!0,11:!0};g.prototype.addElementBackgroundImages=function(a){for(var b=n(a),c=/url\(['"]*([^'"\)]+)['"]*\)/gi,d=c.exec(b.backgroundImage);null!==d;){var e=d&&d[1];e&&this.addBackground(e,a),d=c.exec(b.backgroundImage)}};var n=a.getComputedStyle||function(a){return a.currentStyle};return g.prototype.addImage=function(a){var b=new h(a);this.images.push(b)},g.prototype.addBackground=function(a,b){var c=new i(a,b);this.images.push(c)},g.prototype.check=function(){function a(a,c,d){setTimeout(function(){b.progress(a,c,d)})}var b=this;if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();for(var c=0;c<this.images.length;c++){var d=this.images[c];d.once("progress",a),d.check()}},g.prototype.progress=function(a,b,c){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!a.isLoaded,this.emit("progress",this,a,b),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,a),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&k&&k.log("progress: "+c,a,b)},g.prototype.complete=function(){var a=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emit(a,this),this.emit("always",this),this.jqDeferred){var b=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[b](this)}},h.prototype=new b,h.prototype.check=function(){var a=this.getIsImageComplete();return a?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,c.bind(this.proxyImage,"load",this),c.bind(this.proxyImage,"error",this),c.bind(this.img,"load",this),c.bind(this.img,"error",this),void(this.proxyImage.src=this.img.src))},h.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},h.prototype.confirm=function(a,b){this.isLoaded=a,this.emit("progress",this,this.img,b)},h.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){c.unbind(this.proxyImage,"load",this),c.unbind(this.proxyImage,"error",this),c.unbind(this.img,"load",this),c.unbind(this.img,"error",this)},i.prototype=new h,i.prototype.check=function(){c.bind(this.img,"load",this),c.bind(this.img,"error",this),this.img.src=this.url;var a=this.getIsImageComplete();a&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},i.prototype.unbindEvents=function(){c.unbind(this.img,"load",this),c.unbind(this.img,"error",this)},i.prototype.confirm=function(a,b){this.isLoaded=a,this.emit("progress",this,this.element,b)},g.makeJQueryPlugin=function(b){b=b||a.jQuery,b&&(j=b,j.fn.imagesLoaded=function(a,b){var c=new g(this,a,b);return c.jqDeferred.promise(j(this))})},g.makeJQueryPlugin(),g});
!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(){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;b<a.length;b+=1)c.push(a[b].listener);return c},d.getListenersAsObject=function(a){var b,c=this.getListeners(a);return c instanceof Array&&(b={},b[a]=c),b||c},d.addListener=function(a,c){var d,e=this.getListenersAsObject(a),f="object"==typeof c;for(d in e)e.hasOwnProperty(d)&&-1===b(e[d],c)&&e[d].push(f?c:{listener:c,once:!1});return this},d.on=c("addListener"),d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})},d.once=c("addOnceListener"),d.defineEvent=function(a){return this.getListeners(a),this},d.defineEvents=function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this},d.removeListener=function(a,c){var d,e,f=this.getListenersAsObject(a);for(e in f)f.hasOwnProperty(e)&&(d=b(f[e],c),-1!==d&&f[e].splice(d,1));return this},d.off=c("removeListener"),d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)},d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)},d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener,g=a?this.removeListeners:this.addListeners;if("object"!=typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"==typeof e?f.call(this,d,e):g.call(this,d,e));return this},d.removeEvent=function(a){var b,c=typeof a,d=this._getEvents();if("string"===c)delete d[a];else if(a instanceof RegExp)for(b in d)d.hasOwnProperty(b)&&a.test(b)&&delete d[b];else delete this._events;return this},d.removeAllListeners=c("removeEvent"),d.emitEvent=function(a,b){var c,d,e,f,g=this.getListenersAsObject(a);for(e in g)if(g.hasOwnProperty(e))for(d=g[e].length;d--;)c=g[e][d],c.once===!0&&this.removeListener(a,c.listener),f=c.listener.apply(this,b||[]),f===this._getOnceReturnValue()&&this.removeListener(a,c.listener);return this},d.trigger=c("emitEvent"),d.emit=function(a){var b=Array.prototype.slice.call(arguments,1);return this.emitEvent(a,b)},d.setOnceReturnValue=function(a){return this._onceReturnValue=a,this},d._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},d._getEvents=function(){return this._events||(this._events={})},a.noConflict=function(){return e.EventEmitter=f,a},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return a}):"object"==typeof module&&module.exports?module.exports=a:e.EventEmitter=a}.call(this),function(a){function b(a){if(a){if("string"==typeof d[a])return a;a=a.charAt(0).toUpperCase()+a.slice(1);for(var b,e=0,f=c.length;f>e;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){function b(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}function c(){}function d(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=g.length;c>b;b++){var d=g[b];a[d]=0}return a}function e(c){function e(){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||f("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=c("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 g=document.body||document.documentElement;g.appendChild(e);var h=j(e);l=200===b(h.width),g.removeChild(e)}}}function h(a){if(e(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var c=j(a);if("none"===c.display)return d();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var h=f.isBorderBox=!(!k||!c[k]||"border-box"!==c[k]),m=0,n=g.length;n>m;m++){var o=g[m],p=c[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=h&&l,y=b(c.width);y!==!1&&(f.width=y+(x?0:r+v));var z=b(c.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 h}var f="undefined"==typeof console?c:function(a){console.error(a)},g=["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"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property")):a.getSize=e(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){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){"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){"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){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){"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){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){"function"==typeof define&&define.amd?define(["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){"use strict";var b=a.Masonry;b.prototype._remapV2Options=function(){this._remapOption("gutterWidth","gutter"),this._remapOption("isResizable","isResizeBound"),this._remapOption("isRTL","isOriginLeft",function(a){return!a});var a=this.options.isAnimated;if(void 0!==a&&(this.options.transitionDuration=a?this.options.transitionDuration:0),void 0===a||a){var b=this.options.animationOptions,c=b&&b.duration;c&&(this.options.transitionDuration="string"==typeof c?c:c+"ms")}},b.prototype._remapOption=function(a,b,c){var d=this.options[a];void 0!==d&&(this.options[b]=c?c(d):d)};var c=b.prototype._create;b.prototype._create=function(){var a=this;this._remapV2Options(),c.apply(this,arguments),setTimeout(function(){jQuery(a.element).addClass("masonry")},0)};var d=b.prototype.layout;b.prototype.layout=function(){this._remapV2Options(),d.apply(this,arguments)};var e=b.prototype.option;b.prototype.option=function(){e.apply(this,arguments),this._remapV2Options()};var f=b.prototype._itemize;b.prototype._itemize=function(a){var b=f.apply(this,arguments);return jQuery(a).addClass("masonry-brick"),b};var g=b.prototype.measureColumns;b.prototype.measureColumns=function(){var a=this.options.columnWidth;a&&"function"==typeof a&&(this.getContainerWidth(),this.columnWidth=a(this.containerWidth)),g.apply(this,arguments)},b.prototype.reload=function(){this.reloadItems.apply(this,arguments),this.layout.apply(this)};var h=b.prototype.destroy;b.prototype.destroy=function(){var a=this.getItemElements();jQuery(this.element).removeClass("masonry"),jQuery(a).removeClass("masonry-brick"),h.apply(this,arguments)}}(window);
(function($){
"use strict";
$(document).ready(function(){
$('.wc-shortcodes-rsvp').each(function(){
var $this;
$this=$(this);
$this.find('.rsvp-button').click(function(){
var $button=$(this);
var data=$this.find('.rsvp-data').serialize();
var $message=$this.find('.rsvp-message');
var $messageParent=$message.parent();
$message.text("Sending...");
$messageParent.removeClass('wc-shortcodes-box-warning wc-shortcodes-box-success').addClass('wc-shortcodes-box-info').show();
$.post(WCShortcodes.ajaxurl,
data,
function(response){
if(response.success){
$message.text(response.message);
$messageParent.removeClass('wc-shortcodes-box-warning wc-shortcodes-box-info').addClass('wc-shortcodes-box-success').show();
$button.hide();
}else{
$message.text(response.message);
$messageParent.removeClass('wc-shortcodes-box-success wc-shortcodes-box-info').addClass('wc-shortcodes-box-warning').show();
}}
);
});
});
});
})(jQuery);
(function (){
function EventEmitter(){}
var proto=EventEmitter.prototype;
var exports=this;
var originalGlobalValue=exports.EventEmitter;
function indexOfListener(listeners, listener){
var i=listeners.length;
while (i--){
if(listeners[i].listener===listener){
return i;
}}
return -1;
}
function alias(name){
return function aliasClosure(){
return this[name].apply(this, arguments);
};}
proto.getListeners=function getListeners(evt){
var events=this._getEvents();
var response;
var key;
if(typeof evt==='object'){
response={};
for (key in events){
if(events.hasOwnProperty(key)&&evt.test(key)){
response[key]=events[key];
}}
}else{
response=events[evt]||(events[evt]=[]);
}
return response;
};
proto.flattenListeners=function flattenListeners(listeners){
var flatListeners=[];
var i;
for (i=0; i < listeners.length; i +=1){
flatListeners.push(listeners[i].listener);
}
return flatListeners;
};
proto.getListenersAsObject=function getListenersAsObject(evt){
var listeners=this.getListeners(evt);
var response;
if(listeners instanceof Array){
response={};
response[evt]=listeners;
}
return response||listeners;
};
proto.addListener=function addListener(evt, listener){
var listeners=this.getListenersAsObject(evt);
var listenerIsWrapped=typeof listener==='object';
var key;
for (key in listeners){
if(listeners.hasOwnProperty(key)&&indexOfListener(listeners[key], listener)===-1){
listeners[key].push(listenerIsWrapped ? listener:{
listener: listener,
once: false
});
}}
return this;
};
proto.on=alias('addListener');
proto.addOnceListener=function addOnceListener(evt, listener){
return this.addListener(evt, {
listener: listener,
once: true
});
};
proto.once=alias('addOnceListener');
proto.defineEvent=function defineEvent(evt){
this.getListeners(evt);
return this;
};
proto.defineEvents=function defineEvents(evts){
for (var i=0; i < evts.length; i +=1){
this.defineEvent(evts[i]);
}
return this;
};
proto.removeListener=function removeListener(evt, listener){
var listeners=this.getListenersAsObject(evt);
var index;
var key;
for (key in listeners){
if(listeners.hasOwnProperty(key)){
index=indexOfListener(listeners[key], listener);
if(index!==-1){
listeners[key].splice(index, 1);
}}
}
return this;
};
proto.off=alias('removeListener');
proto.addListeners=function addListeners(evt, listeners){
return this.manipulateListeners(false, evt, listeners);
};
proto.removeListeners=function removeListeners(evt, listeners){
return this.manipulateListeners(true, evt, listeners);
};
proto.manipulateListeners=function manipulateListeners(remove, evt, listeners){
var i;
var value;
var single=remove ? this.removeListener:this.addListener;
var multiple=remove ? this.removeListeners:this.addListeners;
if(typeof evt==='object'&&!(evt instanceof RegExp)){
for (i in evt){
if(evt.hasOwnProperty(i)&&(value=evt[i])){
if(typeof value==='function'){
single.call(this, i, value);
}else{
multiple.call(this, i, value);
}}
}}else{
i=listeners.length;
while (i--){
single.call(this, evt, listeners[i]);
}}
return this;
};
proto.removeEvent=function removeEvent(evt){
var type=typeof evt;
var events=this._getEvents();
var key;
if(type==='string'){
delete events[evt];
}
else if(type==='object'){
for (key in events){
if(events.hasOwnProperty(key)&&evt.test(key)){
delete events[key];
}}
}else{
delete this._events;
}
return this;
};
proto.removeAllListeners=alias('removeEvent');
proto.emitEvent=function emitEvent(evt, args){
var listeners=this.getListenersAsObject(evt);
var listener;
var i;
var key;
var response;
for (key in listeners){
if(listeners.hasOwnProperty(key)){
i=listeners[key].length;
while (i--){
listener=listeners[key][i];
if(listener.once===true){
this.removeListener(evt, listener.listener);
}
response=listener.listener.apply(this, args||[]);
if(response===this._getOnceReturnValue()){
this.removeListener(evt, listener.listener);
}}
}}
return this;
};
proto.trigger=alias('emitEvent');
proto.emit=function emit(evt){
var args=Array.prototype.slice.call(arguments, 1);
return this.emitEvent(evt, args);
};
proto.setOnceReturnValue=function setOnceReturnValue(value){
this._onceReturnValue=value;
return this;
};
proto._getOnceReturnValue=function _getOnceReturnValue(){
if(this.hasOwnProperty('_onceReturnValue')){
return this._onceReturnValue;
}else{
return true;
}};
proto._getEvents=function _getEvents(){
return this._events||(this._events={});
};
EventEmitter.noConflict=function noConflict(){
exports.EventEmitter=originalGlobalValue;
return EventEmitter;
};
if(typeof define==='function'&&define.amd){
define('eventEmitter/EventEmitter',[],function (){
return EventEmitter;
});
}
else if(typeof module==='object'&&module.exports){
module.exports=EventEmitter;
}else{
this.EventEmitter=EventEmitter;
}}.call(this));
(function(window){
var docElem=document.documentElement;
var bind=function(){};
function getIEEvent(obj){
var event=window.event;
event.target=event.target||event.srcElement||obj;
return event;
}
if(docElem.addEventListener){
bind=function(obj, type, fn){
obj.addEventListener(type, fn, false);
};}else if(docElem.attachEvent){
bind=function(obj, type, fn){
obj[ type + fn ]=fn.handleEvent ?
function(){
var event=getIEEvent(obj);
fn.handleEvent.call(fn, event);
} :
function(){
var event=getIEEvent(obj);
fn.call(obj, event);
};
obj.attachEvent("on" + type, obj[ type + fn ]);
};}
var unbind=function(){};
if(docElem.removeEventListener){
unbind=function(obj, type, fn){
obj.removeEventListener(type, fn, false);
};}else if(docElem.detachEvent){
unbind=function(obj, type, fn){
obj.detachEvent("on" + type, obj[ type + fn ]);
try {
delete obj[ type + fn ];
} catch(err){
obj[ type + fn ]=undefined;
}};}
var eventie={
bind: bind,
unbind: unbind
};
if(typeof define==='function'&&define.amd){
define('eventie/eventie',eventie);
}else{
window.eventie=eventie;
}})(this);
(function(window, factory){
if(typeof define==='function'&&define.amd){
define([
'eventEmitter/EventEmitter',
'eventie/eventie'
], function(EventEmitter, eventie){
return factory(window, EventEmitter, eventie);
});
}else if(typeof exports==='object'){
module.exports=factory(
window,
require('eventEmitter'),
require('eventie')
);
}else{
window.imagesLoaded=factory(
window,
window.EventEmitter,
window.eventie
);
}})(this,
function factory(window, EventEmitter, eventie){
var $=window.jQuery;
var console=window.console;
var hasConsole=typeof console!=='undefined';
function extend(a, b){
for(var prop in b){
a[ prop ]=b[ prop ];
}
return a;
}
var objToString=Object.prototype.toString;
function isArray(obj){
return objToString.call(obj)==='[object Array]';
}
function makeArray(obj){
var ary=[];
if(isArray(obj)){
ary=obj;
}else if(typeof obj.length==='number'){
for(var i=0, len=obj.length; i < len; i++){
ary.push(obj[i]);
}}else{
ary.push(obj);
}
return ary;
}
function ImagesLoaded(elem, options, onAlways){
if(!(this instanceof ImagesLoaded)){
return new ImagesLoaded(elem, options);
}
if(typeof elem==='string'){
elem=document.querySelectorAll(elem);
}
this.elements=makeArray(elem);
this.options=extend({}, this.options);
if(typeof options==='function'){
onAlways=options;
}else{
extend(this.options, options);
}
if(onAlways){
this.on('always', onAlways);
}
this.getImages();
if($){
this.jqDeferred=new $.Deferred();
}
var _this=this;
setTimeout(function(){
_this.check();
});
}
ImagesLoaded.prototype=new EventEmitter();
ImagesLoaded.prototype.options={};
ImagesLoaded.prototype.getImages=function(){
this.images=[];
for(var i=0, len=this.elements.length; i < len; i++){
var elem=this.elements[i];
if(elem.nodeName==='IMG'){
this.addImage(elem);
}
var childElems=elem.querySelectorAll('img');
for(var j=0, jLen=childElems.length; j < jLen; j++){
var img=childElems[j];
this.addImage(img);
}}
};
ImagesLoaded.prototype.addImage=function(img){
var loadingImage=new LoadingImage(img);
this.images.push(loadingImage);
};
ImagesLoaded.prototype.check=function(){
var _this=this;
var checkedCount=0;
var length=this.images.length;
this.hasAnyBroken=false;
if(!length){
this.complete();
return;
}
function onConfirm(image, message){
if(_this.options.debug&&hasConsole){
console.log('confirm', image, message);
}
_this.progress(image);
checkedCount++;
if(checkedCount===length){
_this.complete();
}
return true;
}
for(var i=0; i < length; i++){
var loadingImage=this.images[i];
loadingImage.on('confirm', onConfirm);
loadingImage.check();
}};
ImagesLoaded.prototype.progress=function(image){
this.hasAnyBroken=this.hasAnyBroken||!image.isLoaded;
var _this=this;
setTimeout(function(){
_this.emit('progress', _this, image);
if(_this.jqDeferred&&_this.jqDeferred.notify){
_this.jqDeferred.notify(_this, image);
}});
};
ImagesLoaded.prototype.complete=function(){
var eventName=this.hasAnyBroken ? 'fail':'done';
this.isComplete=true;
var _this=this;
setTimeout(function(){
_this.emit(eventName, _this);
_this.emit('always', _this);
if(_this.jqDeferred){
var jqMethod=_this.hasAnyBroken ? 'reject':'resolve';
_this.jqDeferred[ jqMethod ](_this);
}});
};
if($){
$.fn.imagesLoaded=function(options, callback){
var instance=new ImagesLoaded(this, options, callback);
return instance.jqDeferred.promise($(this));
};}
function LoadingImage(img){
this.img=img;
}
LoadingImage.prototype=new EventEmitter();
LoadingImage.prototype.check=function(){
var resource=cache[ this.img.src ]||new Resource(this.img.src);
if(resource.isConfirmed){
this.confirm(resource.isLoaded, 'cached was confirmed');
return;
}
if(this.img.complete&&this.img.naturalWidth!==undefined){
this.confirm(this.img.naturalWidth!==0, 'naturalWidth');
return;
}
var _this=this;
resource.on('confirm', function(resrc, message){
_this.confirm(resrc.isLoaded, message);
return true;
});
resource.check();
};
LoadingImage.prototype.confirm=function(isLoaded, message){
this.isLoaded=isLoaded;
this.emit('confirm', this, message);
};
var cache={};
function Resource(src){
this.src=src;
cache[ src ]=this;
}
Resource.prototype=new EventEmitter();
Resource.prototype.check=function(){
if(this.isChecked){
return;
}
var proxyImage=new Image();
eventie.bind(proxyImage, 'load', this);
eventie.bind(proxyImage, 'error', this);
proxyImage.src=this.src;
this.isChecked=true;
};
Resource.prototype.handleEvent=function(event){
var method='on' + event.type;
if(this[ method ]){
this[ method ](event);
}};
Resource.prototype.onload=function(event){
this.confirm(true, 'onload');
this.unbindProxyEvents(event);
};
Resource.prototype.onerror=function(event){
this.confirm(false, 'onerror');
this.unbindProxyEvents(event);
};
Resource.prototype.confirm=function(isLoaded, message){
this.isConfirmed=true;
this.isLoaded=isLoaded;
this.emit('confirm', this, message);
};
Resource.prototype.unbindProxyEvents=function(event){
eventie.unbind(event.target, 'load', this);
eventie.unbind(event.target, 'error', this);
};
return ImagesLoaded;
});
(function($){
$.prettyPhoto={version: '3.1.6'};
$.fn.prettyPhoto=function(pp_settings){
pp_settings=jQuery.extend({
hook: 'rel', 
animation_speed: 'fast', 
ajaxcallback: function(){},
slideshow: 5000, 
autoplay_slideshow: false, 
opacity: 0.80, 
show_title: true, 
allow_resize: true, 
allow_expand: true, 
default_width: 500,
default_height: 344,
counter_separator_label: '/', 
theme: 'pp_default', 
horizontal_padding: 20, 
hideflash: false, 
wmode: 'opaque', 
autoplay: true, 
modal: false, 
deeplinking: true, 
overlay_gallery: true, 
overlay_gallery_max: 30, 
keyboard_shortcuts: true, 
changepicturecallback: function(){}, 
callback: function(){}, 
ie6_fallback: true,
markup: '<div class="pp_pic_holder"> \
<div class="ppt">&nbsp;</div> \
<div class="pp_top"> \
<div class="pp_left"></div> \
<div class="pp_middle"></div> \
<div class="pp_right"></div> \
</div> \
<div class="pp_content_container"> \
<div class="pp_left"> \
<div class="pp_right"> \
<div class="pp_content"> \
<div class="pp_loaderIcon"></div> \
<div class="pp_fade"> \
<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
<div class="pp_hoverContainer"> \
<a class="pp_next" href="#">next</a> \
<a class="pp_previous" href="#">previous</a> \
</div> \
<div id="pp_full_res"></div> \
<div class="pp_details"> \
<div class="pp_nav"> \
<a href="#" class="pp_arrow_previous">Previous</a> \
<p class="currentTextHolder">0/0</p> \
<a href="#" class="pp_arrow_next">Next</a> \
</div> \
<p class="pp_description"></p> \
<div class="pp_social">{pp_social}</div> \
<a class="pp_close" href="#">Close</a> \
</div> \
</div> \
</div> \
</div> \
</div> \
</div> \
<div class="pp_bottom"> \
<div class="pp_left"></div> \
<div class="pp_middle"></div> \
<div class="pp_right"></div> \
</div> \
</div> \
<div class="pp_overlay"></div>',
gallery_markup: '<div class="pp_gallery"> \
<a href="#" class="pp_arrow_previous">Previous</a> \
<div> \
<ul> \
{gallery} \
</ul> \
</div> \
<a href="#" class="pp_arrow_next">Next</a> \
</div>',
image_markup: '<img id="fullResImage" src="{path}" />',
flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
iframe_markup: '<iframe src="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
inline_markup: '<div class="pp_inline">{content}</div>',
custom_markup: '',
social_tools: '<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>' 
}, pp_settings);
var matchedObjects=this, percentBased=false, pp_dimensions, pp_open,
pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,
windowHeight=$(window).height(), windowWidth=$(window).width(),
pp_slideshow;
doresize=true, scroll_pos=_get_scroll();
$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){ _center_overlay(); _resize_overlay(); });
if(pp_settings.keyboard_shortcuts){
$(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){
if(typeof $pp_pic_holder!='undefined'){
if($pp_pic_holder.is(':visible')){
switch(e.keyCode){
case 37:
$.prettyPhoto.changePage('previous');
e.preventDefault();
break;
case 39:
$.prettyPhoto.changePage('next');
e.preventDefault();
break;
case 27:
if(!settings.modal)
$.prettyPhoto.close();
e.preventDefault();
break;
};};
};});
};
$.prettyPhoto.initialize=function(){
settings=pp_settings;
if(settings.theme=='pp_default') settings.horizontal_padding=16;
theRel=$(this).attr(settings.hook);
galleryRegExp=/\[(?:.*)\]/;
isSet=(galleryRegExp.exec(theRel)) ? true:false;
pp_images=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return $(n).attr('href'); }):$.makeArray($(this).attr('href'));
pp_titles=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt'):""; }):$.makeArray($(this).find('img').attr('alt'));
pp_descriptions=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return ($(n).attr('title')) ? $(n).attr('title'):""; }):$.makeArray($(this).attr('title'));
if(pp_images.length > settings.overlay_gallery_max) settings.overlay_gallery=false;
set_position=jQuery.inArray($(this).attr('href'), pp_images);
rel_index=(isSet) ? set_position:$("a["+settings.hook+"^='"+theRel+"']").index($(this));
_build_overlay(this);
if(settings.allow_resize)
$(window).bind('scroll.prettyphoto',function(){ _center_overlay(); });
$.prettyPhoto.open();
return false;
}
$.prettyPhoto.open=function(event){
if(typeof settings=="undefined"){
settings=pp_settings;
pp_images=$.makeArray(arguments[0]);
pp_titles=(arguments[1]) ? $.makeArray(arguments[1]):$.makeArray("");
pp_descriptions=(arguments[2]) ? $.makeArray(arguments[2]):$.makeArray("");
isSet=(pp_images.length > 1) ? true:false;
set_position=(arguments[3])? arguments[3]: 0;
_build_overlay(event.target);
}
if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden');
_checkPosition($(pp_images).size());
$('.pp_loaderIcon').show();
if(settings.deeplinking)
setHashtag();
if(settings.social_tools){
facebook_like_link=settings.social_tools.replace('{location_href}', encodeURIComponent(location.href));
$pp_pic_holder.find('.pp_social').html(facebook_like_link);
}
if($ppt.is(':hidden')) $ppt.css('opacity',0).show();
$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);
$pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).size());
if(typeof pp_descriptions[set_position]!='undefined'&&pp_descriptions[set_position]!=""){
$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));
}else{
$pp_pic_holder.find('.pp_description').hide();
}
movie_width=(parseFloat(getParam('width',pp_images[set_position]))) ? getParam('width',pp_images[set_position]):settings.default_width.toString();
movie_height=(parseFloat(getParam('height',pp_images[set_position]))) ? getParam('height',pp_images[set_position]):settings.default_height.toString();
percentBased=false;
if(movie_height.indexOf('%')!=-1){ movie_height=parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); percentBased=true; }
if(movie_width.indexOf('%')!=-1){ movie_width=parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased=true; }
$pp_pic_holder.fadeIn(function(){
(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined") ? $ppt.html(unescape(pp_titles[set_position])):$ppt.html('&nbsp;');
imgPreloader="";
skipInjection=false;
switch(_getFileType(pp_images[set_position])){
case 'image':
imgPreloader=new Image();
nextImage=new Image();
if(isSet&&set_position < $(pp_images).size() -1) nextImage.src=pp_images[set_position + 1];
prevImage=new Image();
if(isSet&&pp_images[set_position - 1]) prevImage.src=pp_images[set_position - 1];
$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);
imgPreloader.onload=function(){
pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height);
_showContent();
};
imgPreloader.onerror=function(){
alert('Image cannot be loaded. Make sure the path is correct and image exist.');
$.prettyPhoto.close();
};
imgPreloader.src=pp_images[set_position];
break;
case 'youtube':
pp_dimensions=_fitToViewport(movie_width,movie_height);
movie_id=getParam('v',pp_images[set_position]);
if(movie_id==""){
movie_id=pp_images[set_position].split('youtu.be/');
movie_id=movie_id[1];
if(movie_id.indexOf('?') > 0)
movie_id=movie_id.substr(0,movie_id.indexOf('?'));
if(movie_id.indexOf('&') > 0)
movie_id=movie_id.substr(0,movie_id.indexOf('&'));
}
movie='http://www.youtube.com/embed/'+movie_id;
(getParam('rel',pp_images[set_position])) ? movie+="?rel="+getParam('rel',pp_images[set_position]):movie+="?rel=1";
if(settings.autoplay) movie +="&autoplay=1";
toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);
break;
case 'vimeo':
pp_dimensions=_fitToViewport(movie_width,movie_height);
movie_id=pp_images[set_position];
var regExp=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;
var match=movie_id.match(regExp);
movie='http://player.vimeo.com/video/'+ match[3] +'?title=0&amp;byline=0&amp;portrait=0';
if(settings.autoplay) movie +="&autoplay=1;";
vimeo_width=pp_dimensions['width'] + '/embed/?moog_width='+ pp_dimensions['width'];
toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);
break;
case 'quicktime':
pp_dimensions=_fitToViewport(movie_width,movie_height);
pp_dimensions['height']+=15; pp_dimensions['contentHeight']+=15; pp_dimensions['containerHeight']+=15;
toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);
break;
case 'flash':
pp_dimensions=_fitToViewport(movie_width,movie_height);
flash_vars=pp_images[set_position];
flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10,pp_images[set_position].length);
filename=pp_images[set_position];
filename=filename.substring(0,filename.indexOf('?'));
toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);
break;
case 'iframe':
pp_dimensions=_fitToViewport(movie_width,movie_height);
frame_url=pp_images[set_position];
frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);
toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);
break;
case 'ajax':
doresize=false;
pp_dimensions=_fitToViewport(movie_width,movie_height);
doresize=true;
skipInjection=true;
$.get(pp_images[set_position],function(responseHTML){
toInject=settings.inline_markup.replace(/{content}/g,responseHTML);
$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;
_showContent();
});
break;
case 'custom':
pp_dimensions=_fitToViewport(movie_width,movie_height);
toInject=settings.custom_markup;
break;
case 'inline':
myClone=$(pp_images[set_position]).clone().append('<br clear="all" />').css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo($('body')).show();
doresize=false;
pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height());
doresize=true;
$(myClone).remove();
toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());
break;
};
if(!imgPreloader&&!skipInjection){
$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;
_showContent();
};});
return false;
};
$.prettyPhoto.changePage=function(direction){
currentGalleryPage=0;
if(direction=='previous'){
set_position--;
if(set_position < 0) set_position=$(pp_images).size()-1;
}else if(direction=='next'){
set_position++;
if(set_position > $(pp_images).size()-1) set_position=0;
}else{
set_position=direction;
};
rel_index=set_position;
if(!doresize) doresize=true;
if(settings.allow_expand){
$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');
}
_hideContent(function(){ $.prettyPhoto.open(); });
};
$.prettyPhoto.changeGalleryPage=function(direction){
if(direction=='next'){
currentGalleryPage ++;
if(currentGalleryPage > totalPage) currentGalleryPage=0;
}else if(direction=='previous'){
currentGalleryPage --;
if(currentGalleryPage < 0) currentGalleryPage=totalPage;
}else{
currentGalleryPage=direction;
};
slide_speed=(direction=='next'||direction=='previous') ? settings.animation_speed:0;
slide_to=currentGalleryPage * (itemsPerPage * itemWidth);
$pp_gallery.find('ul').animate({left:-slide_to},slide_speed);
};
$.prettyPhoto.startSlideshow=function(){
if(typeof pp_slideshow=='undefined'){
$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){
$.prettyPhoto.stopSlideshow();
return false;
});
pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);
}else{
$.prettyPhoto.changePage('next');
};}
$.prettyPhoto.stopSlideshow=function(){
$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){
$.prettyPhoto.startSlideshow();
return false;
});
clearInterval(pp_slideshow);
pp_slideshow=undefined;
}
$.prettyPhoto.close=function(){
if($pp_overlay.is(":animated")) return;
$.prettyPhoto.stopSlideshow();
$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');
$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){ $(this).remove(); });
$pp_overlay.fadeOut(settings.animation_speed, function(){
if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible');
$(this).remove();
$(window).unbind('scroll.prettyphoto');
clearHashtag();
settings.callback();
doresize=true;
pp_open=false;
delete settings;
});
};
function _showContent(){
$('.pp_loaderIcon').hide();
projectedTop=scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2));
if(projectedTop < 0) projectedTop=0;
$ppt.fadeTo(settings.animation_speed,1);
$pp_pic_holder.find('.pp_content')
.animate({
height:pp_dimensions['contentHeight'],
width:pp_dimensions['contentWidth']
},settings.animation_speed);
$pp_pic_holder.animate({
'top': projectedTop,
'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0:(windowWidth/2) - (pp_dimensions['containerWidth']/2),
width:pp_dimensions['containerWidth']
},settings.animation_speed,function(){
$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);
$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);
if(isSet&&_getFileType(pp_images[set_position])=="image"){ $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }
if(settings.allow_expand){
if(pp_dimensions['resized']){
$('a.pp_expand,a.pp_contract').show();
}else{
$('a.pp_expand').hide();
}}
if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open) $.prettyPhoto.startSlideshow();
settings.changepicturecallback();
pp_open=true;
});
_insert_gallery();
pp_settings.ajaxcallback();
};
function _hideContent(callback){
$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');
$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){
$('.pp_loaderIcon').show();
callback();
});
};
function _checkPosition(setCount){
(setCount > 1) ? $('.pp_nav').show():$('.pp_nav').hide();
};
function _fitToViewport(width,height){
resized=false;
_getDimensions(width,height);
imageWidth=width, imageHeight=height;
if(((pp_containerWidth > windowWidth)||(pp_containerHeight > windowHeight))&&doresize&&settings.allow_resize&&!percentBased){
resized=true, fitting=false;
while (!fitting){
if((pp_containerWidth > windowWidth)){
imageWidth=(windowWidth - 200);
imageHeight=(height/width) * imageWidth;
}else if((pp_containerHeight > windowHeight)){
imageHeight=(windowHeight - 200);
imageWidth=(width/height) * imageHeight;
}else{
fitting=true;
};
pp_containerHeight=imageHeight, pp_containerWidth=imageWidth;
};
if((pp_containerWidth > windowWidth)||(pp_containerHeight > windowHeight)){
_fitToViewport(pp_containerWidth,pp_containerHeight)
};
_getDimensions(imageWidth,imageHeight);
};
return {
width:Math.floor(imageWidth),
height:Math.floor(imageHeight),
containerHeight:Math.floor(pp_containerHeight),
containerWidth:Math.floor(pp_containerWidth) + (settings.horizontal_padding * 2),
contentHeight:Math.floor(pp_contentHeight),
contentWidth:Math.floor(pp_contentWidth),
resized:resized
};};
function _getDimensions(width,height){
width=parseFloat(width);
height=parseFloat(height);
$pp_details=$pp_pic_holder.find('.pp_details');
$pp_details.width(width);
detailsHeight=parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom'));
$pp_details=$pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({
'position':'absolute',
'top':-10000
});
detailsHeight +=$pp_details.height();
detailsHeight=(detailsHeight <=34) ? 36:detailsHeight;
$pp_details.remove();
$pp_title=$pp_pic_holder.find('.ppt');
$pp_title.width(width);
titleHeight=parseFloat($pp_title.css('marginTop')) + parseFloat($pp_title.css('marginBottom'));
$pp_title=$pp_title.clone().appendTo($('body')).css({
'position':'absolute',
'top':-10000
});
titleHeight +=$pp_title.height();
$pp_title.remove();
pp_contentHeight=height + detailsHeight;
pp_contentWidth=width;
pp_containerHeight=pp_contentHeight + titleHeight + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height();
pp_containerWidth=width;
}
function _getFileType(itemSrc){
if(itemSrc.match(/youtube\.com\/watch/i)||itemSrc.match(/youtu\.be/i)){
return 'youtube';
}else if(itemSrc.match(/vimeo\.com/i)){
return 'vimeo';
}else if(itemSrc.match(/\b.mov\b/i)){
return 'quicktime';
}else if(itemSrc.match(/\b.swf\b/i)){
return 'flash';
}else if(itemSrc.match(/\biframe=true\b/i)){
return 'iframe';
}else if(itemSrc.match(/\bajax=true\b/i)){
return 'ajax';
}else if(itemSrc.match(/\bcustom=true\b/i)){
return 'custom';
}else if(itemSrc.substr(0,1)=='#'){
return 'inline';
}else{
return 'image';
};};
function _center_overlay(){
if(doresize&&typeof $pp_pic_holder!='undefined'){
scroll_pos=_get_scroll();
contentHeight=$pp_pic_holder.height(), contentwidth=$pp_pic_holder.width();
projectedTop=(windowHeight/2) + scroll_pos['scrollTop'] - (contentHeight/2);
if(projectedTop < 0) projectedTop=0;
if(contentHeight > windowHeight)
return;
$pp_pic_holder.css({
'top': projectedTop,
'left': (windowWidth/2) + scroll_pos['scrollLeft'] - (contentwidth/2)
});
};};
function _get_scroll(){
if(self.pageYOffset){
return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){
return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){
return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};
};
function _resize_overlay(){
windowHeight=$(window).height(), windowWidth=$(window).width();
if(typeof $pp_overlay!="undefined") $pp_overlay.height($(document).height()).width(windowWidth);
};
function _insert_gallery(){
if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"){
itemWidth=52+5;
navWidth=(settings.theme=="facebook"||settings.theme=="pp_default") ? 50:30;
itemsPerPage=Math.floor((pp_dimensions['containerWidth'] - 100 - navWidth) / itemWidth);
itemsPerPage=(itemsPerPage < pp_images.length) ? itemsPerPage:pp_images.length;
totalPage=Math.ceil(pp_images.length / itemsPerPage) - 1;
if(totalPage==0){
navWidth=0;
$pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide();
}else{
$pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show();
};
galleryWidth=itemsPerPage * itemWidth;
fullGalleryWidth=pp_images.length * itemWidth;
$pp_gallery
.css('margin-left',-((galleryWidth/2) + (navWidth/2)))
.find('div:first').width(galleryWidth+5)
.find('ul').width(fullGalleryWidth)
.find('li.selected').removeClass('selected');
goToPage=(Math.floor(set_position/itemsPerPage) < totalPage) ? Math.floor(set_position/itemsPerPage):totalPage;
$.prettyPhoto.changeGalleryPage(goToPage);
$pp_gallery_li.filter(':eq('+set_position+')').addClass('selected');
}else{
$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');
}}
function _build_overlay(caller){
if(settings.social_tools)
facebook_like_link=settings.social_tools.replace('{location_href}', encodeURIComponent(location.href));
settings.markup=settings.markup.replace('{pp_social}','');
$('body').append(settings.markup);
$pp_pic_holder=$('.pp_pic_holder') , $ppt=$('.ppt'), $pp_overlay=$('div.pp_overlay');
if(isSet&&settings.overlay_gallery){
currentGalleryPage=0;
toInject="";
for (var i=0; i < pp_images.length; i++){
if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){
classname='default';
img_src='';
}else{
classname='';
img_src=pp_images[i];
}
toInject +="<li class='"+classname+"'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>";
};
toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);
$pp_pic_holder.find('#pp_full_res').after(toInject);
$pp_gallery=$('.pp_pic_holder .pp_gallery'), $pp_gallery_li=$pp_gallery.find('li');
$pp_gallery.find('.pp_arrow_next').click(function(){
$.prettyPhoto.changeGalleryPage('next');
$.prettyPhoto.stopSlideshow();
return false;
});
$pp_gallery.find('.pp_arrow_previous').click(function(){
$.prettyPhoto.changeGalleryPage('previous');
$.prettyPhoto.stopSlideshow();
return false;
});
$pp_pic_holder.find('.pp_content').hover(function(){
$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();
},
function(){
$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();
});
itemWidth=52+5;
$pp_gallery_li.each(function(i){
$(this)
.find('a')
.click(function(){
$.prettyPhoto.changePage(i);
$.prettyPhoto.stopSlideshow();
return false;
});
});
};
if(settings.slideshow){
$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
$pp_pic_holder.find('.pp_nav .pp_play').click(function(){
$.prettyPhoto.startSlideshow();
return false;
});
}
$pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme);
$pp_overlay
.css({
'opacity':0,
'height':$(document).height(),
'width':$(window).width()
})
.bind('click',function(){
if(!settings.modal) $.prettyPhoto.close();
});
$('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; });
if(settings.allow_expand){
$('a.pp_expand').bind('click',function(e){
if($(this).hasClass('pp_expand')){
$(this).removeClass('pp_expand').addClass('pp_contract');
doresize=false;
}else{
$(this).removeClass('pp_contract').addClass('pp_expand');
doresize=true;
};
_hideContent(function(){ $.prettyPhoto.open(); });
return false;
});
}
$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){
$.prettyPhoto.changePage('previous');
$.prettyPhoto.stopSlideshow();
return false;
});
$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){
$.prettyPhoto.changePage('next');
$.prettyPhoto.stopSlideshow();
return false;
});
_center_overlay();
};
if(!pp_alreadyInitialized&&getHashtag()){
pp_alreadyInitialized=true;
hashIndex=getHashtag();
hashRel=hashIndex;
hashIndex=hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1);
hashRel=hashRel.substring(0,hashRel.indexOf('/'));
setTimeout(function(){ $("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click'); },50);
}
return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);
};
function getHashtag(){
var url=location.href;
hashtag=(url.indexOf('#prettyPhoto')!==-1) ? decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)):false;
if(hashtag){  hashtag=hashtag.replace(/<|>/g,''); }
return hashtag;
};
function setHashtag(){
if(typeof theRel=='undefined') return;
location.hash=theRel + '/'+rel_index+'/';
};
function clearHashtag(){
if(location.href.indexOf('#prettyPhoto')!==-1) location.hash="prettyPhoto";
}
function getParam(name,url){
name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS="[\\?&]"+name+"=([^&#]*)";
var regex=new RegExp(regexS);
var results=regex.exec(url);
return(results==null) ? "":results[1];
}})(jQuery);
var pp_alreadyInitialized=false;
jQuery(document).ready(function(){
jQuery('#footer-core .widget-area:last-child').addClass("last");
jQuery('#footer-core.option2 .widget-area').addClass("one_half");
jQuery('#footer-core.option3 .widget-area').addClass("one_third");
jQuery('#footer-core.option4 .widget-area').addClass("one_fourth");
jQuery('#footer-core.option5 .widget-area').addClass("one_fifth");
jQuery('#footer-core.option6 .widget-area').addClass("one_sixth");
jQuery('#footer-core.option7 #footer-col1.widget-area').addClass("one_third");
jQuery('#footer-core.option7 #footer-col2.widget-area').addClass("two_third");
jQuery('#footer-core.option8 #footer-col1.widget-area').addClass("two_third");
jQuery('#footer-core.option8 #footer-col2.widget-area').addClass("one_third");
jQuery('#footer-core.option9 #footer-col1.widget-area').addClass("one_fourth");
jQuery('#footer-core.option9 #footer-col2.widget-area').addClass("three_fourth");
jQuery('#footer-core.option10 #footer-col1.widget-area').addClass("three_fourth");
jQuery('#footer-core.option10 #footer-col2.widget-area').addClass("one_fourth");
jQuery('#footer-core.option11 #footer-col1.widget-area').addClass("one_fifth");
jQuery('#footer-core.option11 #footer-col2.widget-area').addClass("four_fifth");
jQuery('#footer-core.option12 #footer-col1.widget-area').addClass("four_fifth");
jQuery('#footer-core.option12 #footer-col2.widget-area').addClass("one_fifth");
jQuery('#footer-core.option13 #footer-col1.widget-area').addClass("one_sixth");
jQuery('#footer-core.option13 #footer-col2.widget-area').addClass("one_sixth");
jQuery('#footer-core.option13 #footer-col3.widget-area').addClass("one_sixth");
jQuery('#footer-core.option13 #footer-col4.widget-area').addClass("one_half");
jQuery('#footer-core.option14 #footer-col1.widget-area').addClass("one_half");
jQuery('#footer-core.option14 #footer-col2.widget-area').addClass("one_sixth");
jQuery('#footer-core.option14 #footer-col3.widget-area').addClass("one_sixth");
jQuery('#footer-core.option14 #footer-col4.widget-area').addClass("one_sixth");
jQuery('#footer-core.option15 #footer-col1.widget-area').addClass("one_sixth");
jQuery('#footer-core.option15 #footer-col2.widget-area').addClass("one_third");
jQuery('#footer-core.option15 #footer-col3.widget-area').addClass("one_half");
jQuery('#footer-core.option16 #footer-col1.widget-area').addClass("one_half");
jQuery('#footer-core.option16 #footer-col2.widget-area').addClass("one_third");
jQuery('#footer-core.option16 #footer-col3.widget-area').addClass("one_sixth");
jQuery('#footer-core.option17 #footer-col1.widget-area').addClass("one_fourth");
jQuery('#footer-core.option17 #footer-col2.widget-area').addClass("one_fourth");
jQuery('#footer-core.option17 #footer-col3.widget-area').addClass("one_sixth");
jQuery('#footer-core.option17 #footer-col4.widget-area').addClass("one_sixth");
jQuery('#footer-core.option17 #footer-col5.widget-area').addClass("one_sixth");
jQuery('#footer-core.option18 #footer-col1.widget-area').addClass("one_sixth");
jQuery('#footer-core.option18 #footer-col2.widget-area').addClass("one_sixth");
jQuery('#footer-core.option18 #footer-col3.widget-area').addClass("one_sixth");
jQuery('#footer-core.option18 #footer-col4.widget-area').addClass("one_fourth");
jQuery('#footer-core.option18 #footer-col5.widget-area').addClass("one_fourth");
});
jQuery(document).ready(function(){
jQuery('#sub-footer-widgets .widget-area:last-child').addClass("last");
jQuery('#sub-footer-widgets .widget-area:last-child').after('<div class="clearboth"></div>');
jQuery('#sub-footer-widgets.option2 .widget-area').addClass("one_half");
jQuery('#sub-footer-widgets.option3 #sub-footer-col1.widget-area').addClass("one_third");
jQuery('#sub-footer-widgets.option3 #sub-footer-col2.widget-area').addClass("two_third");
jQuery('#sub-footer-widgets.option4 #sub-footer-col1.widget-area').addClass("two_third");
jQuery('#sub-footer-widgets.option4 #sub-footer-col2.widget-area').addClass("one_third");
jQuery('#sub-footer-widgets.option5 #sub-footer-col1.widget-area').addClass("one_fourth");
jQuery('#sub-footer-widgets.option5 #sub-footer-col2.widget-area').addClass("three_fourth");
jQuery('#sub-footer-widgets.option6 #sub-footer-col1.widget-area').addClass("three_fourth");
jQuery('#sub-footer-widgets.option6 #sub-footer-col2.widget-area').addClass("one_fourth");
jQuery('#sub-footer-widgets.option7 #sub-footer-col1.widget-area').addClass("one_fifth");
jQuery('#sub-footer-widgets.option7 #sub-footer-col2.widget-area').addClass("four_fifth");
jQuery('#sub-footer-widgets.option8 #sub-footer-col1.widget-area').addClass("four_fifth");
jQuery('#sub-footer-widgets.option8 #sub-footer-col2.widget-area').addClass("one_fifth");
});
jQuery(document).ready(function(){
(function($){
if($.isFunction($.fn.imagesLoaded)){
if($('#container').hasClass('portfolio-wrapper')){
var $container=$('#container-inner');
}else if($('body').hasClass('woo-shop-grid')){
var $container=$('#main-core > .products');
}else{
var $container=$('#container');
}
$container.imagesLoaded(function(){
if($.isFunction($.fn.masonry)){
$container.masonry();
}});
}}(jQuery));
});
function mainmenu(){
jQuery("header .header-links ul.menu > li").hover(function(){
jQuery(this).find('ul.sub-menu:first').css({visibility: "visible",display: "none"}).parent().addClass('menu-hover');
},function(){
jQuery(this).find('ul.sub-menu:first').css({visibility: "hidden",display: "none"}).parent().removeClass('menu-hover');
});
jQuery("header .header-links ul.menu > li").each(function(){
jQuery(this).find('ul.sub-menu').css({visibility: "visible",display: "none"}).parent().addClass('menu-parent');
});
jQuery("#pre-header").hover(function(){
jQuery(this).css({ 'z-index':'999991' });
},function(){
jQuery(this).css({ 'z-index':'999' });
});
jQuery("header .header-links li").hover(function(){
parentWidth=jQuery(this).width();
if(jQuery(this).hasClass('header-thinkupmega')){
jQuery(this).find('ul').addClass('header-thinkupmegachild');
megaColumnCount=jQuery(this).children("ul").children("li").length;
megaColumnWidth=100 / megaColumnCount;
jQuery(this).children("ul").children("li").outerWidth(megaColumnWidth + "%");
megaColumnHeight=jQuery(this).children("ul").height();
jQuery(this).children("ul").children("li").outerHeight(megaColumnHeight);
}
if(! jQuery(this).parent().hasClass('header-thinkupmegachild')){
jQuery(this).find('ul:first').css({visibility: "visible",display: "none","min-width": parentWidth}).slideToggle(400);
}},function(){
jQuery(this).find('ul:first').css({visibility: "hidden"});
});
}
jQuery(document).ready(function(){
mainmenu();
});
jQuery(document).ready(function(){
jQuery('#pre-header-search .search').focusin(function(){
jQuery('#pre-header-search').addClass('active');
});
jQuery('#pre-header-search .search').focusout(function(){
jQuery('#pre-header-search').removeClass('active');
});
});
jQuery(window).load(function(){
if(jQuery(window).width() > 768&&jQuery('body').hasClass('header-sticky')){
jQuery(window).scroll(function(){
var siteheader_height=jQuery('#site-header').height();
var preheader_height=jQuery('#pre-header').height();
var header_height=jQuery('#header').height();
var header_sticky_offset=jQuery('#header-sticky').offset();
if(!jQuery('body').hasClass('header-below')){
if(header_sticky_offset.top > preheader_height + header_height + 100){
jQuery('body').addClass('header-sticky-active');
}else{
jQuery('body').removeClass('header-sticky-active');
}}else{
if(header_sticky_offset.top > siteheader_height + 100){
jQuery('body').addClass('header-sticky-active');
}else{
jQuery('body').removeClass('header-sticky-active');
}}
});
}});
jQuery(document).ready(function(){
var all_videos=jQuery('iframe[src*="//player.vimeo.com"], iframe[src*="//www.youtube.com"], iframe[src*="//blip.tv"], iframe[src*="//www.slideshare.net"], iframe[src*="//www.scribd.com"], iframe[src*="//revision3.com"], iframe[src*="//www.hulu.com"], iframe[src*="//www.funnyordie.com"], iframe[src*="//www.dailymotion.com"], iframe[src*="//maps.google.com"], embed[src*="//v.wordpress.com"], object, embed');
all_videos.each(function(){
var el=jQuery(this);
el
.attr('data-aspectRatio', 360 / 640)
.attr('data-oldWidth', el.width());
});
jQuery(document).ready(function(){
all_videos.each(function(){
var el=jQuery(this),
newWidth=el.parents().width(),
oldWidth=el.attr('data-oldWidth');
el
.removeAttr('height')
.removeAttr('width')
.width(newWidth)
.height(newWidth * el.attr('data-aspectRatio'));
});
}).resize();
jQuery(window)
.resize(function(){
all_videos.each(function(){
var el=jQuery(this),
newWidth=el.parents().width(),
oldWidth=el.attr('data-oldWidth');
el
.removeAttr('height')
.removeAttr('width')
.width(newWidth)
.height(newWidth * el.attr('data-aspectRatio'));
});
}).resize();
});
jQuery(document).ready(function(){
var all_sounds=jQuery('iframe[src^="http://w.soundcloud.com"]');
all_sounds.each(function(){
var el=jQuery(this);
el
.attr('data-aspectRatio', el.attr('height') / el.attr('width'))
.attr('data-oldWidth', el.width());
});
jQuery(document).ready(function(){
all_sounds.each(function(){
var el=jQuery(this),
newWidth=el.parents().width(),
oldWidth=el.attr('data-oldWidth');
el
.removeAttr('width')
.width(newWidth)
});
}).resize();
jQuery(window)
.resize(function(){
all_sounds.each(function(){
var el=jQuery(this),
newWidth=el.parents().width(),
oldWidth=el.attr('data-oldWidth');
el
.removeAttr('width')
.width(newWidth)
});
}).resize();
});
jQuery(document).ready(function(){
jQuery('#container.portfolio-wrapper a').has('img.hover-zoom').addClass('prettyPhoto');
jQuery('#container.portfolio-wrapper a').has('img.hover-zoom').attr('rel','portfolio[gallery]');
jQuery('a.prettyPhoto').has('img').attr('rel','portfolio[gallery]');
jQuery('a.prettyPhoto').prettyPhoto();
});
jQuery(document).ready(function(){
jQuery('body.attachment .entry-attachment .attachment a').has('img').addClass('prettyPhoto');
jQuery('a.prettyPhoto').prettyPhoto();
});
jQuery(document).ready(function(){
jQuery('.thinkup_widget_flickr a[href^="http://"], .thinkup_widget_flickr a[href^="https://"]').attr('target','_blank');
jQuery('.thinkup_widget_socialshare a[href^="http://"], .thinkup_widget_socialshare a[href^="https://"]').attr('target','_blank');
jQuery('.thinkup_widget_socialprofiles a[href^="http://"], .thinkup_widget_socialprofiles a[href^="https://"]').attr('target','_blank');
jQuery('#pre-header-social a[href^="http://"], #pre-header-social a[href^="https://"]').attr('target','_blank');
jQuery('#shareicons a[href^="http://"], #shareicons a[href^="https://"]').attr('target','_blank');
});
jQuery(window).load(function(){
jQuery('.accordion-toggle').click(function(){
if(jQuery(this).hasClass('collapsed')){
jQuery(this).closest('.accordion').find('.accordion-toggle').not(this).addClass('collapsed');
}});
jQuery('.backtotop').click(function(){
jQuery('html, body').animate({scrollTop:0}, 'slow');
});
jQuery('[data-tip]').each(function(){jQuery(this).tooltip({ placement: jQuery(this).data('tip') });});
function isNumber(n){
return !isNaN(parseFloat(n))&&isFinite(n);
}
jQuery(window).bind('load resize', function(){
jQuery('.sc-carousel').each(function(i){
if(jQuery(this).hasClass('sc-postitem') ||
jQuery(this).hasClass('sc-featured') ||
jQuery(this).hasClass('sc-image')){
return;
};
var instanceID='sc-carousel-' + i;
jQuery(this).attr('id', instanceID);
jQuery(this).children('ul').attr('id', instanceID + '-inner');
var show=jQuery('#' + instanceID + '.sc-carousel').data('show');
var scroll=jQuery('#' + instanceID + '.sc-carousel').data('scroll');
var speed=jQuery('#' + instanceID + '.sc-carousel').data('speed');
var effect=jQuery('#' + instanceID + '.sc-carousel').data('effect');
if(show==0||isNaN(show)==true) show='3';
if(scroll==0||isNaN(scroll)==true) scroll='1';
if(speed==0) speed='500';
if(effect==0){
effect='"scroll"';
}else{
effect='"' + effect + '"';
}
var showItems=show;
var scrollItems=scroll;
var speedItems=speed;
var fxItems=effect;
var width=jQuery(window).width();
if(jQuery('body').hasClass('layout-responsive')){
if(width <=685){
showItems=2;
if(scrollItems >=2){
scrollItems=2;
}}
if(width <=480){
showItems=1;
scrollItems=1;
}}
if(jQuery(this).find('#' + instanceID + '-inner').length){
jQuery(this).find('#' + instanceID + '-inner').carouFredSel({
width: '100%',
items:{
visible:showItems,
minimum:3,
minimum:3,
start: 0
},
scroll:{
items:scrollItems,
fx:fxItems,
easing:"swing",
duration:speedItems,
},
responsive:true,
circular:true,
infinite:false,
auto:false,
prev:{
button:'#' + instanceID + ' .prev',
key:'left'
},
next:{
button:'#' + instanceID + ' .next',
key:'right'
},
pagination:'#' + instanceID + ' .pagination',
onCreate: function (){
jQuery(window).bind("load resize", function(){
parentWidthTestimonial=jQuery('#' + instanceID + '.carousel-testimonial li').height();
jQuery('#' + instanceID + '.carousel-testimonial').height('auto');
jQuery('#' + instanceID + '.carousel-testimonial .caroufredsel_wrapper').css({ 'height': parentWidthTestimonial });
parentWidthTestimonial=jQuery('#' + instanceID + '.carousel-testimonial.style1 .sc-carousel-thumbs').height();
jQuery('#' + instanceID + '.carousel-testimonial.style1').height('auto');
jQuery('#' + instanceID + '.carousel-testimonial.style1 .sc-carousel-thumbs').parent().height(parentWidthTestimonial);
});
}});
}
if(jQuery(this).find('.sc-carousel-thumbs').length){
jQuery(this).find('.sc-carousel-thumbs').carouFredSel({
responsive: true,
circular: false,
infinite: false,
auto: false,
prev: '#prev',
next: '#next',
items: {
visible: {
min: 2,
max: 6
},
width: 150,
height: 70
}});
}
jQuery(this).find('.sc-carousel-thumbs a').click(function(){
jQuery('#' + instanceID + '-inner').trigger('slideTo', '#' + this.href.split('#').pop());
jQuery('.sc-carousel-thumbs a').removeClass('selected');
jQuery(this).addClass('selected');
return false;
});
parentHeight=jQuery('#' + instanceID + ' li').height();
jQuery('#' + instanceID + ' li').each(function(){
var elementHeight=jQuery(this).height();
parentHeight=elementHeight > parentHeight ? elementHeight:parentHeight;
});
if(jQuery('#' + instanceID).closest('.sc-carousel').find('.sc-carousel-thumbs').length > 0){
parentHeightThumb=parentHeight + jQuery('#' + instanceID).closest('.sc-carousel').find('.sc-carousel-thumbs').height();
}else{
parentHeightThumb=parentHeight;
}
jQuery('#' + instanceID).height(Math.max(parentHeight, parentHeightThumb));
jQuery('#' + instanceID + '-inner').height(parentHeight);
jQuery('#' + instanceID + '-inner').parent().height(parentHeight);
if(jQuery('#' + instanceID + ' iframe').length > 0){
jQuery('#' + instanceID).addClass('carousel-iframe');
}});
}).resize();
});
jQuery(document).ready(function(){
jQuery('.rslides-sc').each(function(index, element){
jQuery(element).attr('id', 'thinkupbuilder-sliderimage-' + index);
var wide=jQuery(element).data('wide');
if(wide=='on'){
jQuery(element).closest('.panel-grid').css('padding', 0);
jQuery(element).closest('.panel-grid-core').css('margin', 0).css('maxWidth', '100%');
jQuery(element).closest('.panel-grid-cell').css('padding', 0);
}});
jQuery('.thinkupslider-sc').each(function(index, element){
jQuery(element).attr('id', 'thinkupbuilder-thinkupsliderimage-' + index);
var wide=jQuery(element).data('wide');
if(wide=='on'){
jQuery(element).closest('.panel-grid').css('padding', 0);
jQuery(element).closest('.panel-grid-core').css('margin', 0).css('maxWidth', '100%');
jQuery(element).closest('.panel-grid-cell').css('padding', 0);
}});
jQuery('.sc-grid ul').each(function(index, element){
var wide=jQuery(element).data('wide');
if(wide=='on'){
jQuery(element).closest('.panel-grid').css('padding', 0);
jQuery(element).closest('.panel-grid-core').css('margin', 0).css('maxWidth', '100%');
jQuery(element).closest('.panel-grid-cell').css('padding', 0);
}});
});
jQuery(document).ready(function(){
jQuery('#header-search a').click(function(){
if(! jQuery('#header-search').hasClass('active')){
jQuery('#header-search').addClass('active');
}else{
jQuery('#header-search').removeClass('active');
}});
});
jQuery(document).ready(function(){
if(jQuery('body').hasClass('scrollup-on')){
(function($){
$(function (){
$.scrollUp({
scrollName: 'scrollUp',
scrollText: '',
});
});
} (jQuery));
}});
jQuery('#sub-footer-close-core').click(function(){
if(jQuery(this).hasClass('collapsed')){
jQuery(this).removeClass('collapsed');
jQuery('#sub-footer-widgets').removeClass('collapsed');
}else{
jQuery(this).addClass('collapsed');
jQuery('#sub-footer-widgets').addClass('collapsed');
}});
jQuery(document).ready(function (){
if(jQuery('.featured-icon')){
jQuery('#slider').after('<div id="thinkupslider-after"></div>');
}
jQuery('.featured-icon a').click(function(e){
e.preventDefault();
jQuery('html, body').animate({ scrollTop: jQuery('#thinkupslider-after').offset().top },  1000);
});
});
jQuery(document).ready(function (){
jQuery('.woo-share').click(function(e){
if(jQuery(this).hasClass('active')){
jQuery(this).removeClass('active');
jQuery(this).closest('.woo-meta').find('.woo-meta-social').removeClass('active');
}else{
jQuery(this).addClass('active');
jQuery(this).closest('.woo-meta').find('.woo-meta-social').addClass('active');
}});
});
!function ($){
"use strict";
$(function (){
$.support.transition=(function (){
var transitionEnd=(function (){
var el=document.createElement('bootstrap')
, transEndEventNames={
'WebkitTransition':'webkitTransitionEnd'
,  'MozTransition':'transitionend'
,  'OTransition':'oTransitionEnd otransitionend'
,  'transition':'transitionend'
}
, name
for (name in transEndEventNames){
if(el.style[name]!==undefined){
return transEndEventNames[name]
}}
}())
return transitionEnd&&{
end: transitionEnd
}})()
})
}(window.jQuery);
!function ($){
"use strict";
var Modal=function (element, options){
this.options=options
this.$element=$(element)
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
this.options.remote&&this.$element.find('.modal-body').load(this.options.remote)
}
Modal.prototype={
constructor: Modal
, toggle: function (){
return this[!this.isShown ? 'show':'hide']()
}
, show: function (){
var that=this
, e=$.Event('show')
this.$element.trigger(e)
if(this.isShown||e.isDefaultPrevented()) return
this.isShown=true
this.escape()
this.backdrop(function (){
var transition=$.support.transition&&that.$element.hasClass('fade')
if(!that.$element.parent().length){
that.$element.appendTo(document.body)
}
that.$element.show()
if(transition){
that.$element[0].offsetWidth
}
that.$element
.addClass('in')
.attr('aria-hidden', false)
that.enforceFocus()
transition ?
that.$element.one($.support.transition.end, function (){ that.$element.focus().trigger('shown') }) :
that.$element.focus().trigger('shown')
})
}
, hide: function (e){
e&&e.preventDefault()
var that=this
e=$.Event('hide')
this.$element.trigger(e)
if(!this.isShown||e.isDefaultPrevented()) return
this.isShown=false
this.escape()
$(document).off('focusin.modal')
this.$element
.removeClass('in')
.attr('aria-hidden', true)
$.support.transition&&this.$element.hasClass('fade') ?
this.hideWithTransition() :
this.hideModal()
}
, enforceFocus: function (){
var that=this
$(document).on('focusin.modal', function (e){
if(that.$element[0]!==e.target&&!that.$element.has(e.target).length){
that.$element.focus()
}})
}
, escape: function (){
var that=this
if(this.isShown&&this.options.keyboard){
this.$element.on('keyup.dismiss.modal', function(e){
e.which==27&&that.hide()
})
}else if(!this.isShown){
this.$element.off('keyup.dismiss.modal')
}}
, hideWithTransition: function (){
var that=this
, timeout=setTimeout(function (){
that.$element.off($.support.transition.end)
that.hideModal()
}, 500)
this.$element.one($.support.transition.end, function (){
clearTimeout(timeout)
that.hideModal()
})
}
, hideModal: function (){
var that=this
this.$element.hide()
this.backdrop(function (){
that.removeBackdrop()
that.$element.trigger('hidden')
})
}
, removeBackdrop: function (){
this.$backdrop&&this.$backdrop.remove()
this.$backdrop=null
}
, backdrop: function (callback){
var that=this
, animate=this.$element.hasClass('fade') ? 'fade':''
if(this.isShown&&this.options.backdrop){
var doAnimate=$.support.transition&&animate
this.$backdrop=$('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
this.$backdrop.click(this.options.backdrop=='static' ?
$.proxy(this.$element[0].focus, this.$element[0])
: $.proxy(this.hide, this)
)
if(doAnimate) this.$backdrop[0].offsetWidth
this.$backdrop.addClass('in')
if(!callback) return
doAnimate ?
this.$backdrop.one($.support.transition.end, callback) :
callback()
}else if(!this.isShown&&this.$backdrop){
this.$backdrop.removeClass('in')
$.support.transition&&this.$element.hasClass('fade')?
this.$backdrop.one($.support.transition.end, callback) :
callback()
}else if(callback){
callback()
}}
}
var old=$.fn.modal
$.fn.modal=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('modal')
, options=$.extend({}, $.fn.modal.defaults, $this.data(), typeof option=='object'&&option)
if(!data) $this.data('modal', (data=new Modal(this, options)))
if(typeof option=='string') data[option]()
else if(options.show) data.show()
})
}
$.fn.modal.defaults={
backdrop: true
, keyboard: true
, show: true
}
$.fn.modal.Constructor=Modal
$.fn.modal.noConflict=function (){
$.fn.modal=old
return this
}
$(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e){
var $this=$(this)
, href=$this.attr('href')
, $target=$($this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/, '')))
, option=$target.data('modal') ? 'toggle':$.extend({ remote:!/#/.test(href)&&href }, $target.data(), $this.data())
e.preventDefault()
$target
.modal(option)
.one('hide', function (){
$this.focus()
})
})
}(window.jQuery);
!function ($){
"use strict";
var toggle='[data-toggle=dropdown]'
, Dropdown=function (element){
var $el=$(element).on('click.dropdown.data-api', this.toggle)
$('html').on('click.dropdown.data-api', function (){
$el.parent().removeClass('open')
})
}
Dropdown.prototype={
constructor: Dropdown
, toggle: function (e){
var $this=$(this)
, $parent
, isActive
if($this.is('.disabled, :disabled')) return
$parent=getParent($this)
isActive=$parent.hasClass('open')
clearMenus()
if(!isActive){
if('ontouchstart' in document.documentElement){
$('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
}
$parent.toggleClass('open')
}
$this.focus()
return false
}
, keydown: function (e){
var $this
, $items
, $active
, $parent
, isActive
, index
if(!/(38|40|27)/.test(e.keyCode)) return
$this=$(this)
e.preventDefault()
e.stopPropagation()
if($this.is('.disabled, :disabled')) return
$parent=getParent($this)
isActive=$parent.hasClass('open')
if(!isActive||(isActive&&e.keyCode==27)){
if(e.which==27) $parent.find(toggle).focus()
return $this.click()
}
$items=$('[role=menu] li:not(.divider):visible a', $parent)
if(!$items.length) return
index=$items.index($items.filter(':focus'))
if(e.keyCode==38&&index > 0) index--
if(e.keyCode==40&&index < $items.length - 1) index++
if(!~index) index=0
$items
.eq(index)
.focus()
}}
function clearMenus(){
$('.dropdown-backdrop').remove()
$(toggle).each(function (){
getParent($(this)).removeClass('open')
})
}
function getParent($this){
var selector=$this.attr('data-target')
, $parent
if(!selector){
selector=$this.attr('href')
selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/, '')
}
$parent=selector&&$(selector)
if(!$parent||!$parent.length) $parent=$this.parent()
return $parent
}
var old=$.fn.dropdown
$.fn.dropdown=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('dropdown')
if(!data) $this.data('dropdown', (data=new Dropdown(this)))
if(typeof option=='string') data[option].call($this)
})
}
$.fn.dropdown.Constructor=Dropdown
$.fn.dropdown.noConflict=function (){
$.fn.dropdown=old
return this
}
$(document)
.on('click.dropdown.data-api', clearMenus)
.on('click.dropdown.data-api', '.dropdown form', function (e){ e.stopPropagation() })
.on('click.dropdown.data-api'  , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
}(window.jQuery);
!function ($){
"use strict";
function ScrollSpy(element, options){
var process=$.proxy(this.process, this)
, $element=$(element).is('body') ? $(window):$(element)
, href
this.options=$.extend({}, $.fn.scrollspy.defaults, options)
this.$scrollElement=$element.on('scroll.scroll-spy.data-api', process)
this.selector=(this.options.target
|| ((href=$(element).attr('href'))&&href.replace(/.*(?=#[^\s]+$)/, ''))
|| '') + ' .nav li > a'
this.$body=$('body')
this.refresh()
this.process()
}
ScrollSpy.prototype={
constructor: ScrollSpy
, refresh: function (){
var self=this
, $targets
this.offsets=$([])
this.targets=$([])
$targets=this.$body
.find(this.selector)
.map(function (){
var $el=$(this)
, href=$el.data('target')||$el.attr('href')
, $href=/^#\w/.test(href)&&$(href)
return($href
&& $href.length
&& [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0))&&self.$scrollElement.scrollTop()), href ]])||null
})
.sort(function (a, b){ return a[0] - b[0] })
.each(function (){
self.offsets.push(this[0])
self.targets.push(this[1])
})
}
, process: function (){
var scrollTop=this.$scrollElement.scrollTop() + this.options.offset
, scrollHeight=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight
, maxScroll=scrollHeight - this.$scrollElement.height()
, offsets=this.offsets
, targets=this.targets
, activeTarget=this.activeTarget
, i
if(scrollTop >=maxScroll){
return activeTarget!=(i=targets.last()[0])
&& this.activate(i)
}
for (i=offsets.length; i--;){
activeTarget!=targets[i]
&& scrollTop >=offsets[i]
&& (!offsets[i + 1]||scrollTop <=offsets[i + 1])
&& this.activate(targets[i])
}}
, activate: function (target){
var active
, selector
this.activeTarget=target
$(this.selector)
.parent('.active')
.removeClass('active')
selector=this.selector
+ '[data-target="' + target + '"],'
+ this.selector + '[href="' + target + '"]'
active=$(selector)
.parent('li')
.addClass('active')
if(active.parent('.dropdown-menu').length){
active=active.closest('li.dropdown').addClass('active')
}
active.trigger('activate')
}}
var old=$.fn.scrollspy
$.fn.scrollspy=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('scrollspy')
, options=typeof option=='object'&&option
if(!data) $this.data('scrollspy', (data=new ScrollSpy(this, options)))
if(typeof option=='string') data[option]()
})
}
$.fn.scrollspy.Constructor=ScrollSpy
$.fn.scrollspy.defaults={
offset: 10
}
$.fn.scrollspy.noConflict=function (){
$.fn.scrollspy=old
return this
}
$(window).on('load', function (){
$('[data-spy="scroll"]').each(function (){
var $spy=$(this)
$spy.scrollspy($spy.data())
})
})
}(window.jQuery);
!function ($){
"use strict";
var Tab=function (element){
this.element=$(element)
}
Tab.prototype={
constructor: Tab
, show: function (){
var $this=this.element
, $ul=$this.closest('ul:not(.dropdown-menu)')
, selector=$this.attr('data-target')
, previous
, $target
, e
if(!selector){
selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/, '')
}
if($this.parent('li').hasClass('active')) return
previous=$ul.find('.active:last a')[0]
e=$.Event('show', {
relatedTarget: previous
})
$this.trigger(e)
if(e.isDefaultPrevented()) return
$target=$(selector)
this.activate($this.parent('li'), $ul)
this.activate($target, $target.parent(), function (){
$this.trigger({
type: 'shown'
, relatedTarget: previous
})
})
}
, activate: function(element, container, callback){
var $active=container.find('> .active')
, transition=callback
&& $.support.transition
&& $active.hasClass('fade')
function next(){
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active')
if(transition){
element[0].offsetWidth
element.addClass('in')
}else{
element.removeClass('fade')
}
if(element.parent('.dropdown-menu')){
element.closest('li.dropdown').addClass('active')
}
callback&&callback()
}
transition ?
$active.one($.support.transition.end, next) :
next()
$active.removeClass('in')
}}
var old=$.fn.tab
$.fn.tab=function(option){
return this.each(function (){
var $this=$(this)
, data=$this.data('tab')
if(!data) $this.data('tab', (data=new Tab(this)))
if(typeof option=='string') data[option]()
})
}
$.fn.tab.Constructor=Tab
$.fn.tab.noConflict=function (){
$.fn.tab=old
return this
}
$(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e){
e.preventDefault()
$(this).tab('show')
})
}(window.jQuery);
!function ($){
"use strict";
var Tooltip=function (element, options){
this.init('tooltip', element, options)
}
Tooltip.prototype={
constructor: Tooltip
, init: function (type, element, options){
var eventIn
, eventOut
, triggers
, trigger
, i
this.type=type
this.$element=$(element)
this.options=this.getOptions(options)
this.enabled=true
triggers=this.options.trigger.split(' ')
for (i=triggers.length; i--;){
trigger=triggers[i]
if(trigger=='click'){
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
}else if(trigger!='manual'){
eventIn=trigger=='hover' ? 'mouseenter':'focus'
eventOut=trigger=='hover' ? 'mouseleave':'blur'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}}
this.options.selector ?
(this._options=$.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixTitle()
}
, getOptions: function (options){
options=$.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
if(options.delay&&typeof options.delay=='number'){
options.delay={
show: options.delay
, hide: options.delay
}}
return options
}
, enter: function (e){
var defaults=$.fn[this.type].defaults
, options={}
, self
this._options&&$.each(this._options, function (key, value){
if(defaults[key]!=value) options[key]=value
}, this)
self=$(e.currentTarget)[this.type](options).data(this.type)
if(!self.options.delay||!self.options.delay.show) return self.show()
clearTimeout(this.timeout)
self.hoverState='in'
this.timeout=setTimeout(function(){
if(self.hoverState=='in') self.show()
}, self.options.delay.show)
}
, leave: function (e){
var self=$(e.currentTarget)[this.type](this._options).data(this.type)
if(this.timeout) clearTimeout(this.timeout)
if(!self.options.delay||!self.options.delay.hide) return self.hide()
self.hoverState='out'
this.timeout=setTimeout(function(){
if(self.hoverState=='out') self.hide()
}, self.options.delay.hide)
}
, show: function (){
var $tip
, pos
, actualWidth
, actualHeight
, placement
, tp
, e=$.Event('show')
if(this.hasContent()&&this.enabled){
this.$element.trigger(e)
if(e.isDefaultPrevented()) return
$tip=this.tip()
this.setContent()
if(this.options.animation){
$tip.addClass('fade')
}
placement=typeof this.options.placement=='function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
this.options.container ? $tip.appendTo(this.options.container):$tip.insertAfter(this.$element)
pos=this.getPosition()
actualWidth=$tip[0].offsetWidth
actualHeight=$tip[0].offsetHeight
switch (placement){
case 'bottom':
tp={top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
break
case 'top':
tp={top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
break
case 'left':
tp={top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
break
case 'right':
tp={top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
break
}
this.applyPlacement(tp, placement)
this.$element.trigger('shown')
}}
, applyPlacement: function(offset, placement){
var $tip=this.tip()
, width=$tip[0].offsetWidth
, height=$tip[0].offsetHeight
, actualWidth
, actualHeight
, delta
, replace
$tip
.offset(offset)
.addClass(placement)
.addClass('in')
actualWidth=$tip[0].offsetWidth
actualHeight=$tip[0].offsetHeight
if(placement=='top'&&actualHeight!=height){
offset.top=offset.top + height - actualHeight
replace=true
}
if(placement=='bottom'||placement=='top'){
delta=0
if(offset.left < 0){
delta=offset.left * -2
offset.left=0
$tip.offset(offset)
actualWidth=$tip[0].offsetWidth
actualHeight=$tip[0].offsetHeight
}
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
}else{
this.replaceArrow(actualHeight - height, actualHeight, 'top')
}
if(replace) $tip.offset(offset)
}
, replaceArrow: function(delta, dimension, position){
this
.arrow()
.css(position, delta ? (50 * (1 - delta / dimension) + "%"):'')
}
, setContent: function (){
var $tip=this.tip()
, title=this.getTitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html':'text'](title)
$tip.removeClass('fade in top bottom left right')
}
, hide: function (){
var that=this
, $tip=this.tip()
, e=$.Event('hide')
this.$element.trigger(e)
if(e.isDefaultPrevented()) return
$tip.removeClass('in')
function removeWithAnimation(){
var timeout=setTimeout(function (){
$tip.off($.support.transition.end).detach()
}, 500)
$tip.one($.support.transition.end, function (){
clearTimeout(timeout)
$tip.detach()
})
}
$.support.transition&&this.$tip.hasClass('fade') ?
removeWithAnimation() :
$tip.detach()
this.$element.trigger('hidden')
return this
}
, fixTitle: function (){
var $e=this.$element
if($e.attr('title')||typeof($e.attr('data-original-title'))!='string'){
$e.attr('data-original-title', $e.attr('title')||'').attr('title', '')
}}
, hasContent: function (){
return this.getTitle()
}
, getPosition: function (){
var el=this.$element[0]
return $.extend({}, (typeof el.getBoundingClientRect=='function') ? el.getBoundingClientRect():{
width: el.offsetWidth
, height: el.offsetHeight
}, this.$element.offset())
}
, getTitle: function (){
var title
, $e=this.$element
, o=this.options
title=$e.attr('data-original-title')
|| (typeof o.title=='function' ? o.title.call($e[0]):o.title)
return title
}
, tip: function (){
return this.$tip=this.$tip||$(this.options.template)
}
, arrow: function(){
return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")
}
, validate: function (){
if(!this.$element[0].parentNode){
this.hide()
this.$element=null
this.options=null
}}
, enable: function (){
this.enabled=true
}
, disable: function (){
this.enabled=false
}
, toggleEnabled: function (){
this.enabled = !this.enabled
}
, toggle: function (e){
var self=e ? $(e.currentTarget)[this.type](this._options).data(this.type):this
self.tip().hasClass('in') ? self.hide():self.show()
}
, destroy: function (){
this.hide().$element.off('.' + this.type).removeData(this.type)
}}
var old=$.fn.tooltip
$.fn.tooltip=function(option){
return this.each(function (){
var $this=$(this)
, data=$this.data('tooltip')
, options=typeof option=='object'&&option
if(!data) $this.data('tooltip', (data=new Tooltip(this, options)))
if(typeof option=='string') data[option]()
})
}
$.fn.tooltip.Constructor=Tooltip
$.fn.tooltip.defaults={
animation: true
, placement: 'top'
, selector: false
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
, trigger: 'hover focus'
, title: ''
, delay: 0
, html: false
, container: false
}
$.fn.tooltip.noConflict=function (){
$.fn.tooltip=old
return this
}}(window.jQuery);
!function ($){
"use strict";
var Popover=function (element, options){
this.init('popover', element, options)
}
Popover.prototype=$.extend({}, $.fn.tooltip.Constructor.prototype, {
constructor: Popover
, setContent: function (){
var $tip=this.tip()
, title=this.getTitle()
, content=this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html':'text'](title)
$tip.find('.popover-content')[this.options.html ? 'html':'text'](content)
$tip.removeClass('fade top bottom left right in')
}
, hasContent: function (){
return this.getTitle()||this.getContent()
}
, getContent: function (){
var content
, $e=this.$element
, o=this.options
content=(typeof o.content=='function' ? o.content.call($e[0]):o.content)
|| $e.attr('data-content')
return content
}
, tip: function (){
if(!this.$tip){
this.$tip=$(this.options.template)
}
return this.$tip
}
, destroy: function (){
this.hide().$element.off('.' + this.type).removeData(this.type)
}})
var old=$.fn.popover
$.fn.popover=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('popover')
, options=typeof option=='object'&&option
if(!data) $this.data('popover', (data=new Popover(this, options)))
if(typeof option=='string') data[option]()
})
}
$.fn.popover.Constructor=Popover
$.fn.popover.defaults=$.extend({} , $.fn.tooltip.defaults, {
placement: 'right'
, trigger: 'click'
, content: ''
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
})
$.fn.popover.noConflict=function (){
$.fn.popover=old
return this
}}(window.jQuery);
!function ($){
"use strict";
var Affix=function (element, options){
this.options=$.extend({}, $.fn.affix.defaults, options)
this.$window=$(window)
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.affix.data-api',  $.proxy(function (){ setTimeout($.proxy(this.checkPosition, this), 1) }, this))
this.$element=$(element)
this.checkPosition()
}
Affix.prototype.checkPosition=function (){
if(!this.$element.is(':visible')) return
var scrollHeight=$(document).height()
, scrollTop=this.$window.scrollTop()
, position=this.$element.offset()
, offset=this.options.offset
, offsetBottom=offset.bottom
, offsetTop=offset.top
, reset='affix affix-top affix-bottom'
, affix
if(typeof offset!='object') offsetBottom=offsetTop=offset
if(typeof offsetTop=='function') offsetTop=offset.top()
if(typeof offsetBottom=='function') offsetBottom=offset.bottom()
affix=this.unpin!=null&&(scrollTop + this.unpin <=position.top) ?
false:offsetBottom!=null&&(position.top + this.$element.height() >=scrollHeight - offsetBottom) ?
'bottom':offsetTop!=null&&scrollTop <=offsetTop ?
'top':false
if(this.affixed===affix) return
this.affixed=affix
this.unpin=affix=='bottom' ? position.top - scrollTop:null
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix:''))
}
var old=$.fn.affix
$.fn.affix=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('affix')
, options=typeof option=='object'&&option
if(!data) $this.data('affix', (data=new Affix(this, options)))
if(typeof option=='string') data[option]()
})
}
$.fn.affix.Constructor=Affix
$.fn.affix.defaults={
offset: 0
}
$.fn.affix.noConflict=function (){
$.fn.affix=old
return this
}
$(window).on('load', function (){
$('[data-spy="affix"]').each(function (){
var $spy=$(this)
, data=$spy.data()
data.offset=data.offset||{}
data.offsetBottom&&(data.offset.bottom=data.offsetBottom)
data.offsetTop&&(data.offset.top=data.offsetTop)
$spy.affix(data)
})
})
}(window.jQuery);
!function ($){
"use strict";
var dismiss='[data-dismiss="alert"]'
, Alert=function (el){
$(el).on('click', dismiss, this.close)
}
Alert.prototype.close=function (e){
var $this=$(this)
, selector=$this.attr('data-target')
, $parent
if(!selector){
selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/, '')
}
$parent=$(selector)
e&&e.preventDefault()
$parent.length||($parent=$this.hasClass('alert') ? $this:$this.parent())
$parent.trigger(e=$.Event('close'))
if(e.isDefaultPrevented()) return
$parent.removeClass('in')
function removeElement(){
$parent
.trigger('closed')
.remove()
}
$.support.transition&&$parent.hasClass('fade') ?
$parent.on($.support.transition.end, removeElement) :
removeElement()
}
var old=$.fn.alert
$.fn.alert=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('alert')
if(!data) $this.data('alert', (data=new Alert(this)))
if(typeof option=='string') data[option].call($this)
})
}
$.fn.alert.Constructor=Alert
$.fn.alert.noConflict=function (){
$.fn.alert=old
return this
}
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
}(window.jQuery);
!function ($){
"use strict";
var Button=function (element, options){
this.$element=$(element)
this.options=$.extend({}, $.fn.button.defaults, options)
}
Button.prototype.setState=function (state){
var d='disabled'
, $el=this.$element
, data=$el.data()
, val=$el.is('input') ? 'val':'html'
state=state + 'Text'
data.resetText||$el.data('resetText', $el[val]())
$el[val](data[state]||this.options[state])
setTimeout(function (){
state=='loadingText' ?
$el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d)
}, 0)
}
Button.prototype.toggle=function (){
var $parent=this.$element.closest('[data-toggle="buttons-radio"]')
$parent&&$parent
.find('.active')
.removeClass('active')
this.$element.toggleClass('active')
}
var old=$.fn.button
$.fn.button=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('button')
, options=typeof option=='object'&&option
if(!data) $this.data('button', (data=new Button(this, options)))
if(option=='toggle') data.toggle()
else if(option) data.setState(option)
})
}
$.fn.button.defaults={
loadingText: 'loading...'
}
$.fn.button.Constructor=Button
$.fn.button.noConflict=function (){
$.fn.button=old
return this
}
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e){
var $btn=$(e.target)
if(!$btn.hasClass('btn')) $btn=$btn.closest('.btn')
$btn.button('toggle')
})
}(window.jQuery);
!function ($){
"use strict";
var Collapse=function (element, options){
this.$element=$(element)
this.options=$.extend({}, $.fn.collapse.defaults, options)
if(this.options.parent){
this.$parent=$(this.options.parent)
}
this.options.toggle&&this.toggle()
}
Collapse.prototype={
constructor: Collapse
, dimension: function (){
var hasWidth=this.$element.hasClass('width')
return hasWidth ? 'width':'height'
}
, show: function (){
var dimension
, scroll
, actives
, hasData
if(this.transitioning||this.$element.hasClass('in')) return
dimension=this.dimension()
scroll=$.camelCase(['scroll', dimension].join('-'))
actives=this.$parent&&this.$parent.find('> .accordion-group > .in')
if(actives&&actives.length){
hasData=actives.data('collapse')
if(hasData&&hasData.transitioning) return
actives.collapse('hide')
hasData||actives.data('collapse', null)
}
this.$element[dimension](0)
this.transition('addClass', $.Event('show'), 'shown')
$.support.transition&&this.$element[dimension](this.$element[0][scroll])
}
, hide: function (){
var dimension
if(this.transitioning||!this.$element.hasClass('in')) return
dimension=this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass', $.Event('hide'), 'hidden')
this.$element[dimension](0)
}
, reset: function (size){
var dimension=this.dimension()
this.$element
.removeClass('collapse')
[dimension](size||'auto')
[0].offsetWidth
this.$element[size!==null ? 'addClass':'removeClass']('collapse')
return this
}
, transition: function (method, startEvent, completeEvent){
var that=this
, complete=function (){
if(startEvent.type=='show') that.reset()
that.transitioning=0
that.$element.trigger(completeEvent)
}
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented()) return
this.transitioning=1
this.$element[method]('in')
$.support.transition&&this.$element.hasClass('collapse') ?
this.$element.one($.support.transition.end, complete) :
complete()
}
, toggle: function (){
this[this.$element.hasClass('in') ? 'hide':'show']()
}}
var old=$.fn.collapse
$.fn.collapse=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('collapse')
, options=$.extend({}, $.fn.collapse.defaults, $this.data(), typeof option=='object'&&option)
if(!data) $this.data('collapse', (data=new Collapse(this, options)))
if(typeof option=='string') data[option]()
})
}
$.fn.collapse.defaults={
toggle: true
}
$.fn.collapse.Constructor=Collapse
$.fn.collapse.noConflict=function (){
$.fn.collapse=old
return this
}
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e){
var $this=$(this), href
, target=$this.attr('data-target')
|| e.preventDefault()
|| (href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/, '')
, option=$(target).data('collapse') ? 'toggle':$this.data()
$this[$(target).hasClass('in') ? 'addClass':'removeClass']('collapsed')
$(target).collapse(option)
})
}(window.jQuery);
!function ($){
"use strict";
var Carousel=function (element, options){
this.$element=$(element)
this.$indicators=this.$element.find('.carousel-indicators')
this.options=options
this.options.pause=='hover'&&this.$element
.on('mouseenter', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this))
}
Carousel.prototype={
cycle: function (e){
if(!e) this.paused=false
if(this.interval) clearInterval(this.interval);
this.options.interval
&& !this.paused
&& (this.interval=setInterval($.proxy(this.next, this), this.options.interval))
return this
}
, getActiveIndex: function (){
this.$active=this.$element.find('.item.active')
this.$items=this.$active.parent().children()
return this.$items.index(this.$active)
}
, to: function (pos){
var activeIndex=this.getActiveIndex()
, that=this
if(pos > (this.$items.length - 1)||pos < 0) return
if(this.sliding){
return this.$element.one('slid', function (){
that.to(pos)
})
}
if(activeIndex==pos){
return this.pause().cycle()
}
return this.slide(pos > activeIndex ? 'next':'prev', $(this.$items[pos]))
}
, pause: function (e){
if(!e) this.paused=true
if(this.$element.find('.next, .prev').length&&$.support.transition.end){
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
clearInterval(this.interval)
this.interval=null
return this
}
, next: function (){
if(this.sliding) return
return this.slide('next')
}
, prev: function (){
if(this.sliding) return
return this.slide('prev')
}
, slide: function (type, next){
var $active=this.$element.find('.item.active')
, $next=next||$active[type]()
, isCycling=this.interval
, direction=type=='next' ? 'left':'right'
, fallback=type=='next' ? 'first':'last'
, that=this
, e
this.sliding=true
isCycling&&this.pause()
$next=$next.length ? $next:this.$element.find('.item')[fallback]()
e=$.Event('slide', {
relatedTarget: $next[0]
, direction: direction
})
if($next.hasClass('active')) return
if(this.$indicators.length){
this.$indicators.find('.active').removeClass('active')
this.$element.one('slid', function (){
var $nextIndicator=$(that.$indicators.children()[that.getActiveIndex()])
$nextIndicator&&$nextIndicator.addClass('active')
})
}
if($.support.transition&&this.$element.hasClass('slide')){
this.$element.trigger(e)
if(e.isDefaultPrevented()) return
$next.addClass(type)
$next[0].offsetWidth
$active.addClass(direction)
$next.addClass(direction)
this.$element.one($.support.transition.end, function (){
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding=false
setTimeout(function (){ that.$element.trigger('slid') }, 0)
})
}else{
this.$element.trigger(e)
if(e.isDefaultPrevented()) return
$active.removeClass('active')
$next.addClass('active')
this.sliding=false
this.$element.trigger('slid')
}
isCycling&&this.cycle()
return this
}}
var old=$.fn.carousel
$.fn.carousel=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('carousel')
, options=$.extend({}, $.fn.carousel.defaults, typeof option=='object'&&option)
, action=typeof option=='string' ? option:options.slide
if(!data) $this.data('carousel', (data=new Carousel(this, options)))
if(typeof option=='number') data.to(option)
else if(action) data[action]()
else if(options.interval) data.pause().cycle()
})
}
$.fn.carousel.defaults={
interval: 5000
, pause: 'hover'
}
$.fn.carousel.Constructor=Carousel
$.fn.carousel.noConflict=function (){
$.fn.carousel=old
return this
}
$(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e){
var $this=$(this), href
, $target=$($this.attr('data-target')||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/, ''))
, options=$.extend({}, $target.data(), $this.data())
, slideIndex
$target.carousel(options)
if(slideIndex=$this.attr('data-slide-to')){
$target.data('carousel').pause().to(slideIndex).cycle()
}
e.preventDefault()
})
}(window.jQuery);
!function($){
"use strict";
var Typeahead=function (element, options){
this.$element=$(element)
this.options=$.extend({}, $.fn.typeahead.defaults, options)
this.matcher=this.options.matcher||this.matcher
this.sorter=this.options.sorter||this.sorter
this.highlighter=this.options.highlighter||this.highlighter
this.updater=this.options.updater||this.updater
this.source=this.options.source
this.$menu=$(this.options.menu)
this.shown=false
this.listen()
}
Typeahead.prototype={
constructor: Typeahead
, select: function (){
var val=this.$menu.find('.active').attr('data-value')
this.$element
.val(this.updater(val))
.change()
return this.hide()
}
, updater: function (item){
return item
}
, show: function (){
var pos=$.extend({}, this.$element.position(), {
height: this.$element[0].offsetHeight
})
this.$menu
.insertAfter(this.$element)
.css({
top: pos.top + pos.height
, left: pos.left
})
.show()
this.shown=true
return this
}
, hide: function (){
this.$menu.hide()
this.shown=false
return this
}
, lookup: function (event){
var items
this.query=this.$element.val()
if(!this.query||this.query.length < this.options.minLength){
return this.shown ? this.hide():this
}
items=$.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)):this.source
return items ? this.process(items):this
}
, process: function (items){
var that=this
items=$.grep(items, function (item){
return that.matcher(item)
})
items=this.sorter(items)
if(!items.length){
return this.shown ? this.hide():this
}
return this.render(items.slice(0, this.options.items)).show()
}
, matcher: function (item){
return ~item.toLowerCase().indexOf(this.query.toLowerCase())
}
, sorter: function (items){
var beginswith=[]
, caseSensitive=[]
, caseInsensitive=[]
, item
while (item=items.shift()){
if(!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
else if(~item.indexOf(this.query)) caseSensitive.push(item)
else caseInsensitive.push(item)
}
return beginswith.concat(caseSensitive, caseInsensitive)
}
, highlighter: function (item){
var query=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match){
return '<strong>' + match + '</strong>'
})
}
, render: function (items){
var that=this
items=$(items).map(function (i, item){
i=$(that.options.item).attr('data-value', item)
i.find('a').html(that.highlighter(item))
return i[0]
})
items.first().addClass('active')
this.$menu.html(items)
return this
}
, next: function (event){
var active=this.$menu.find('.active').removeClass('active')
, next=active.next()
if(!next.length){
next=$(this.$menu.find('li')[0])
}
next.addClass('active')
}
, prev: function (event){
var active=this.$menu.find('.active').removeClass('active')
, prev=active.prev()
if(!prev.length){
prev=this.$menu.find('li').last()
}
prev.addClass('active')
}
, listen: function (){
this.$element
.on('focus',    $.proxy(this.focus, this))
.on('blur',     $.proxy(this.blur, this))
.on('keypress', $.proxy(this.keypress, this))
.on('keyup',    $.proxy(this.keyup, this))
if(this.eventSupported('keydown')){
this.$element.on('keydown', $.proxy(this.keydown, this))
}
this.$menu
.on('click', $.proxy(this.click, this))
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
.on('mouseleave', 'li', $.proxy(this.mouseleave, this))
}
, eventSupported: function(eventName){
var isSupported=eventName in this.$element
if(!isSupported){
this.$element.setAttribute(eventName, 'return;')
isSupported=typeof this.$element[eventName]==='function'
}
return isSupported
}
, move: function (e){
if(!this.shown) return
switch(e.keyCode){
case 9:
case 13:
case 27:
e.preventDefault()
break
case 38:
e.preventDefault()
this.prev()
break
case 40:
e.preventDefault()
this.next()
break
}
e.stopPropagation()
}
, keydown: function (e){
this.suppressKeyPressRepeat=~$.inArray(e.keyCode, [40,38,9,13,27])
this.move(e)
}
, keypress: function (e){
if(this.suppressKeyPressRepeat) return
this.move(e)
}
, keyup: function (e){
switch(e.keyCode){
case 40:
case 38:
case 16:
case 17:
case 18:
break
case 9:
case 13:
if(!this.shown) return
this.select()
break
case 27:
if(!this.shown) return
this.hide()
break
default:
this.lookup()
}
e.stopPropagation()
e.preventDefault()
}
, focus: function (e){
this.focused=true
}
, blur: function (e){
this.focused=false
if(!this.mousedover&&this.shown) this.hide()
}
, click: function (e){
e.stopPropagation()
e.preventDefault()
this.select()
this.$element.focus()
}
, mouseenter: function (e){
this.mousedover=true
this.$menu.find('.active').removeClass('active')
$(e.currentTarget).addClass('active')
}
, mouseleave: function (e){
this.mousedover=false
if(!this.focused&&this.shown) this.hide()
}}
var old=$.fn.typeahead
$.fn.typeahead=function (option){
return this.each(function (){
var $this=$(this)
, data=$this.data('typeahead')
, options=typeof option=='object'&&option
if(!data) $this.data('typeahead', (data=new Typeahead(this, options)))
if(typeof option=='string') data[option]()
})
}
$.fn.typeahead.defaults={
source: []
, items: 8
, menu: '<ul class="typeahead dropdown-menu"></ul>'
, item: '<li><a href="#"></a></li>'
, minLength: 1
}
$.fn.typeahead.Constructor=Typeahead
$.fn.typeahead.noConflict=function (){
$.fn.typeahead=old
return this
}
$(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e){
var $this=$(this)
if($this.data('typeahead')) return
$this.typeahead($this.data())
})
}(window.jQuery);
window.Modernizr=(function(window, document, undefined){
var version='2.6.2',
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=['&#173;','<style id="s', mod, '">', rule, '</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;
},
testMediaQuery=function(mq){
var matchMedia=window.matchMedia||window.msMatchMedia;
if(matchMedia){
return matchMedia(mq).matches;
}
var bool;
injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; }}', function(node){
bool=(window.getComputedStyle ?
getComputedStyle(node, null) :
node.currentStyle)['position']=='absolute';
});
return bool;
},
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['flexboxlegacy']=function(){
return testPropsAll('boxDirection');
};
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='<svg/>';
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 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='<xyz></xyz>';
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<style>' + cssText + '</style>';
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) ? 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(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
function shivMethods(ownerDocument, data){
if(!data.cache){
data.cache={};
data.createElem=ownerDocument.createElement;
data.createFrag=ownerDocument.createDocumentFragment;
data.frag=data.createFrag();
}
ownerDocument.createElement=function(nodeName){
if(!html5.shivMethods){
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment=Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
getElements().join().replace(/\w+/g, function(nodeName){
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
function shivDocument(ownerDocument){
if(!ownerDocument){
ownerDocument=document;
}
var data=getExpandoData(ownerDocument);
if(html5.shivCSS&&!supportsHtml5Styles&&!data.hasCSS){
data.hasCSS = !!addStyleSheet(ownerDocument,
'article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
'mark{background:#FF0;color:#000}'
);
}
if(!supportsUnknownElements){
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
var html5={
'elements': options.elements||'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video',
'shivCSS': (options.shivCSS!==false),
'supportsUnknownElements': supportsUnknownElements,
'shivMethods': (options.shivMethods!==false),
'type': 'default',
'shivDocument': shivDocument,
createElement: createElement,
createDocumentFragment: createDocumentFragment
};
window.html5=html5;
shivDocument(document);
}(this, document));
Modernizr._version=version;
Modernizr._prefixes=prefixes;
Modernizr._domPrefixes=domPrefixes;
Modernizr._cssomPrefixes=cssomPrefixes;
Modernizr.mq=testMediaQuery;
Modernizr.hasEvent=isEventSupported;
Modernizr.testProp=function(prop){
return testProps([prop]);
};
Modernizr.testAllProps=testPropsAll;
Modernizr.testStyles=injectElementWithStyles;
Modernizr.prefixed=function(prop, obj, elem){
if(!obj){
return testPropsAll(prop, 'pfx');
}else{
return testPropsAll(prop, obj, elem);
}};
docElement.className=docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
(enableClasses ? ' js ' + classes.join(' '):'');
return Modernizr;
})(this, this.document);
!function(a,b,c){a.fn.scrollUp=function(b){a.data(c.body,"scrollUp")||(a.data(c.body,"scrollUp",!0),a.fn.scrollUp.init(b))},a.fn.scrollUp.init=function(d){var e,f=a.fn.scrollUp.settings=a.extend({},a.fn.scrollUp.defaults,d);e=f.scrollTrigger?a(f.scrollTrigger):a("<a/>",{id:f.scrollName,href:"#top"}),f.scrollTitle&&e.attr("title",f.scrollTitle),e.appendTo("body"),f.scrollImg||f.scrollTrigger||e.html(f.scrollText),e.css({display:"none",position:"fixed",zIndex:f.zIndex}),f.activeOverlay&&a("<div/>",{id:f.scrollName+"-active"}).css({position:"absolute",top:f.scrollDistance+"px",width:"100%",borderTop:"1px dotted"+f.activeOverlay,zIndex:f.zIndex}).appendTo("body");var g,h,i,j;switch(f.animation){case"fade":g="fadeIn",h="fadeOut",i=f.animationSpeed;break;case"slide":g="slideDown",h="slideUp",i=f.animationSpeed;break;default:g="show",h="hide",i=0}j="top"===f.scrollFrom?f.scrollDistance:a(c).height()-a(b).height()-f.scrollDistance;var k=!1;scrollEvent=a(b).scroll(function(){a(b).scrollTop()>j?k||(e[g](i),k=!0):k&&(e[h](i),k=!1)});var l;f.scrollTarget?"number"==typeof f.scrollTarget?l=f.scrollTarget:"string"==typeof f.scrollTarget&&(l=Math.floor(a(f.scrollTarget).offset().top)):l=0,e.click(function(b){b.preventDefault(),a("html, body").animate({scrollTop:l},f.scrollSpeed,f.easingType)})},a.fn.scrollUp.defaults={scrollName:"scrollUp",scrollDistance:300,scrollFrom:"top",scrollSpeed:300,easingType:"linear",animation:"fade",animationSpeed:200,scrollTrigger:!1,scrollTarget:!1,scrollText:"Scroll to top",scrollTitle:!1,scrollImg:!1,activeOverlay:!1,zIndex:2147483647},a.fn.scrollUp.destroy=function(d){a.removeData(c.body,"scrollUp"),a("#"+a.fn.scrollUp.settings.scrollName).remove(),a("#"+a.fn.scrollUp.settings.scrollName+"-active").remove(),a.fn.jquery.split(".")[1]>=7?a(b).off("scroll",d):a(b).unbind("scroll",d)},a.scrollUp=a.fn.scrollUp}(jQuery,window,document);
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(b,d){var e,f,g,h=b.nodeName.toLowerCase();return"area"===h?(e=b.parentNode,f=e.name,!(!b.href||!f||"map"!==e.nodeName.toLowerCase())&&(g=a("img[usemap='#"+f+"']")[0],!!g&&c(g))):(/^(input|select|textarea|button|object)$/.test(h)?!b.disabled:"a"===h?b.href||d:d)&&c(b)}function c(b){return a.expr.filters.visible(b)&&!a(b).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}a.ui=a.ui||{},a.extend(a.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({scrollParent:function(b){var c=this.css("position"),d="absolute"===c,e=b?/(auto|scroll|hidden)/:/(auto|scroll)/,f=this.parents().filter(function(){var b=a(this);return(!d||"static"!==b.css("position"))&&e.test(b.css("overflow")+b.css("overflow-y")+b.css("overflow-x"))}).eq(0);return"fixed"!==c&&f.length?f:a(this[0].ownerDocument||document)},uniqueId:function(){var a=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(c){return b(c,!isNaN(a.attr(c,"tabindex")))},tabbable:function(c){var d=a.attr(c,"tabindex"),e=isNaN(d);return(e||d>=0)&&b(c,!e)}}),a("<a>").outerWidth(1).jquery||a.each(["Width","Height"],function(b,c){function d(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.css(b,"padding"+this))||0,d&&(c-=parseFloat(a.css(b,"border"+this+"Width"))||0),f&&(c-=parseFloat(a.css(b,"margin"+this))||0)}),c}var e="Width"===c?["Left","Right"]:["Top","Bottom"],f=c.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+c]=function(b){return void 0===b?g["inner"+c].call(this):this.each(function(){a(this).css(f,d(this,b)+"px")})},a.fn["outer"+c]=function(b,e){return"number"!=typeof b?g["outer"+c].call(this,b):this.each(function(){a(this).css(f,d(this,b,!0,e)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=function(b){return function(c){return arguments.length?b.call(this,a.camelCase(c)):b.call(this)}}(a.fn.removeData)),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.fn.extend({focus:function(b){return function(c,d){return"number"==typeof c?this.each(function(){var b=this;setTimeout(function(){a(b).focus(),d&&d.call(b)},c)}):b.apply(this,arguments)}}(a.fn.focus),disableSelection:function(){var a="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(a+".ui-disableSelection",function(a){a.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(b){if(void 0!==b)return this.css("zIndex",b);if(this.length)for(var c,d,e=a(this[0]);e.length&&e[0]!==document;){if(c=e.css("position"),("absolute"===c||"relative"===c||"fixed"===c)&&(d=parseInt(e.css("zIndex"),10),!isNaN(d)&&0!==d))return d;e=e.parent()}return 0}}),a.ui.plugin={add:function(b,c,d){var e,f=a.ui[b].prototype;for(e in d)f.plugins[e]=f.plugins[e]||[],f.plugins[e].push([c,d[e]])},call:function(a,b,c,d){var e,f=a.plugins[b];if(f&&(d||a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType))for(e=0;e<f.length;e++)a.options[f[e][0]]&&f[e][1].apply(a.element,c)}}});
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){return function(){function b(a,b,c){return[parseFloat(a[0])*(n.test(a[0])?b/100:1),parseFloat(a[1])*(n.test(a[1])?c/100:1)]}function c(b,c){return parseInt(a.css(b,c),10)||0}function d(b){var c=b[0];return 9===c.nodeType?{width:b.width(),height:b.height(),offset:{top:0,left:0}}:a.isWindow(c)?{width:b.width(),height:b.height(),offset:{top:b.scrollTop(),left:b.scrollLeft()}}:c.preventDefault?{width:0,height:0,offset:{top:c.pageY,left:c.pageX}}:{width:b.outerWidth(),height:b.outerHeight(),offset:b.offset()}}a.ui=a.ui||{};var e,f,g=Math.max,h=Math.abs,i=Math.round,j=/left|center|right/,k=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,m=/^\w+/,n=/%$/,o=a.fn.position;a.position={scrollbarWidth:function(){if(void 0!==e)return e;var b,c,d=a("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),f=d.children()[0];return a("body").append(d),b=f.offsetWidth,d.css("overflow","scroll"),c=f.offsetWidth,b===c&&(c=d[0].clientWidth),d.remove(),e=b-c},getScrollInfo:function(b){var c=b.isWindow||b.isDocument?"":b.element.css("overflow-x"),d=b.isWindow||b.isDocument?"":b.element.css("overflow-y"),e="scroll"===c||"auto"===c&&b.width<b.element[0].scrollWidth,f="scroll"===d||"auto"===d&&b.height<b.element[0].scrollHeight;return{width:f?a.position.scrollbarWidth():0,height:e?a.position.scrollbarWidth():0}},getWithinInfo:function(b){var c=a(b||window),d=a.isWindow(c[0]),e=!!c[0]&&9===c[0].nodeType;return{element:c,isWindow:d,isDocument:e,offset:c.offset()||{left:0,top:0},scrollLeft:c.scrollLeft(),scrollTop:c.scrollTop(),width:d||e?c.width():c.outerWidth(),height:d||e?c.height():c.outerHeight()}}},a.fn.position=function(e){if(!e||!e.of)return o.apply(this,arguments);e=a.extend({},e);var n,p,q,r,s,t,u=a(e.of),v=a.position.getWithinInfo(e.within),w=a.position.getScrollInfo(v),x=(e.collision||"flip").split(" "),y={};return t=d(u),u[0].preventDefault&&(e.at="left top"),p=t.width,q=t.height,r=t.offset,s=a.extend({},r),a.each(["my","at"],function(){var a,b,c=(e[this]||"").split(" ");1===c.length&&(c=j.test(c[0])?c.concat(["center"]):k.test(c[0])?["center"].concat(c):["center","center"]),c[0]=j.test(c[0])?c[0]:"center",c[1]=k.test(c[1])?c[1]:"center",a=l.exec(c[0]),b=l.exec(c[1]),y[this]=[a?a[0]:0,b?b[0]:0],e[this]=[m.exec(c[0])[0],m.exec(c[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?s.left+=p:"center"===e.at[0]&&(s.left+=p/2),"bottom"===e.at[1]?s.top+=q:"center"===e.at[1]&&(s.top+=q/2),n=b(y.at,p,q),s.left+=n[0],s.top+=n[1],this.each(function(){var d,j,k=a(this),l=k.outerWidth(),m=k.outerHeight(),o=c(this,"marginLeft"),t=c(this,"marginTop"),z=l+o+c(this,"marginRight")+w.width,A=m+t+c(this,"marginBottom")+w.height,B=a.extend({},s),C=b(y.my,k.outerWidth(),k.outerHeight());"right"===e.my[0]?B.left-=l:"center"===e.my[0]&&(B.left-=l/2),"bottom"===e.my[1]?B.top-=m:"center"===e.my[1]&&(B.top-=m/2),B.left+=C[0],B.top+=C[1],f||(B.left=i(B.left),B.top=i(B.top)),d={marginLeft:o,marginTop:t},a.each(["left","top"],function(b,c){a.ui.position[x[b]]&&a.ui.position[x[b]][c](B,{targetWidth:p,targetHeight:q,elemWidth:l,elemHeight:m,collisionPosition:d,collisionWidth:z,collisionHeight:A,offset:[n[0]+C[0],n[1]+C[1]],my:e.my,at:e.at,within:v,elem:k})}),e.using&&(j=function(a){var b=r.left-B.left,c=b+p-l,d=r.top-B.top,f=d+q-m,i={target:{element:u,left:r.left,top:r.top,width:p,height:q},element:{element:k,left:B.left,top:B.top,width:l,height:m},horizontal:c<0?"left":b>0?"right":"center",vertical:f<0?"top":d>0?"bottom":"middle"};p<l&&h(b+c)<p&&(i.horizontal="center"),q<m&&h(d+f)<q&&(i.vertical="middle"),g(h(b),h(c))>g(h(d),h(f))?i.important="horizontal":i.important="vertical",e.using.call(this,a,i)}),k.offset(a.extend(B,{using:j}))})},a.ui.position={fit:{left:function(a,b){var c,d=b.within,e=d.isWindow?d.scrollLeft:d.offset.left,f=d.width,h=a.left-b.collisionPosition.marginLeft,i=e-h,j=h+b.collisionWidth-f-e;b.collisionWidth>f?i>0&&j<=0?(c=a.left+i+b.collisionWidth-f-e,a.left+=i-c):j>0&&i<=0?a.left=e:i>j?a.left=e+f-b.collisionWidth:a.left=e:i>0?a.left+=i:j>0?a.left-=j:a.left=g(a.left-h,a.left)},top:function(a,b){var c,d=b.within,e=d.isWindow?d.scrollTop:d.offset.top,f=b.within.height,h=a.top-b.collisionPosition.marginTop,i=e-h,j=h+b.collisionHeight-f-e;b.collisionHeight>f?i>0&&j<=0?(c=a.top+i+b.collisionHeight-f-e,a.top+=i-c):j>0&&i<=0?a.top=e:i>j?a.top=e+f-b.collisionHeight:a.top=e:i>0?a.top+=i:j>0?a.top-=j:a.top=g(a.top-h,a.top)}},flip:{left:function(a,b){var c,d,e=b.within,f=e.offset.left+e.scrollLeft,g=e.width,i=e.isWindow?e.scrollLeft:e.offset.left,j=a.left-b.collisionPosition.marginLeft,k=j-i,l=j+b.collisionWidth-g-i,m="left"===b.my[0]?-b.elemWidth:"right"===b.my[0]?b.elemWidth:0,n="left"===b.at[0]?b.targetWidth:"right"===b.at[0]?-b.targetWidth:0,o=-2*b.offset[0];k<0?(c=a.left+m+n+o+b.collisionWidth-g-f,(c<0||c<h(k))&&(a.left+=m+n+o)):l>0&&(d=a.left-b.collisionPosition.marginLeft+m+n+o-i,(d>0||h(d)<l)&&(a.left+=m+n+o))},top:function(a,b){var c,d,e=b.within,f=e.offset.top+e.scrollTop,g=e.height,i=e.isWindow?e.scrollTop:e.offset.top,j=a.top-b.collisionPosition.marginTop,k=j-i,l=j+b.collisionHeight-g-i,m="top"===b.my[1],n=m?-b.elemHeight:"bottom"===b.my[1]?b.elemHeight:0,o="top"===b.at[1]?b.targetHeight:"bottom"===b.at[1]?-b.targetHeight:0,p=-2*b.offset[1];k<0?(d=a.top+n+o+p+b.collisionHeight-g-f,(d<0||d<h(k))&&(a.top+=n+o+p)):l>0&&(c=a.top-b.collisionPosition.marginTop+n+o+p-i,(c>0||h(c)<l)&&(a.top+=n+o+p))}},flipfit:{left:function(){a.ui.position.flip.left.apply(this,arguments),a.ui.position.fit.left.apply(this,arguments)},top:function(){a.ui.position.flip.top.apply(this,arguments),a.ui.position.fit.top.apply(this,arguments)}}},function(){var b,c,d,e,g,h=document.getElementsByTagName("body")[0],i=document.createElement("div");b=document.createElement(h?"div":"body"),d={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},h&&a.extend(d,{position:"absolute",left:"-1000px",top:"-1000px"});for(g in d)b.style[g]=d[g];b.appendChild(i),c=h||document.documentElement,c.insertBefore(b,c.firstChild),i.style.cssText="position: absolute; left: 10.7432222px;",e=a(i).offset().left,f=e>10&&e<11,b.innerHTML="",c.removeChild(b)}()}(),a.ui.position});
!function(e){"use strict";void 0===e.fn.on&&(e.fn.on=function(e,o,t){return this.delegate(o,e,t)}),void 0===e.fn.off&&(e.fn.off=function(e,o,t){return this.undelegate(o,e,t)}),void 0===e.fn.bindFirst&&(e.fn.bindFirst=function(o,t){var n,i,s=e(this);s.unbind(o,t),s.bind(o,t),n=e._data(s[0]).events,i=n[o],i.unshift(i.pop()),n[o]=i}),void 0===e.fn.outerHtml&&(e.fn.outerHtml=function(){var o=e(this).clone(),t=e("<div/>").append(o);return t.html()}),void 0===Date.now&&(Date.now=function(){return(new Date).getTime()})}(jQuery);var PUM;!function(e,o,t){"use strict";function n(e){return!isNaN(e)&&parseInt(Number(e))===parseInt(e)&&!isNaN(parseInt(e,10))}function i(){var e={},o=function(o,n,i){"boolean"==typeof n&&(i=n,n=!1);var s=n?n.selector+" "+o:o;return(t===e[s]||i)&&(e[s]=n?n.find(o):jQuery(o)),e[s]};return o.elementCache=e,o}function s(e,o){function t(e,o,t){return o?e[o.slice(0,t?-1:o.length)]:e}function n(e,o){return o?o.split("[").reduce(t,e):e}return o.split(".").reduce(n,e)}PUM={get:new i,getPopup:function(o){var t;return t=n(o)?PUM.get("#pum-"+o):"current"===o?PUM.get(".pum-overlay.pum-active:eq(0)",!0):"open"===o?PUM.get(".pum-overlay.pum-active",!0):"closed"===o?PUM.get(".pum-overlay:not(.pum-active)",!0):o instanceof jQuery?o:e(o),t.hasClass("pum-overlay")?t:t.hasClass("popmake")?t.parents(".pum-overlay"):t.parents(".pum-overlay").length?t.parents(".pum-overlay"):e()},open:function(e,o){PUM.getPopup(e).popmake("open",o)},close:function(e,o){PUM.getPopup(e).popmake("close",o)},preventOpen:function(e){PUM.getPopup(e).addClass("preventOpen")},getSettings:function(e){var o=PUM.getPopup(e);return o.popmake("getSettings")},getSetting:function(e,o,n){var i=PUM.getSettings(e),p=s(i,o);return"undefined"!=typeof p?p:n!==t?n:null},checkConditions:function(e){return PUM.getPopup(e).popmake("checkConditions")},getCookie:function(o){return e.pm_cookie(o)},setCookie:function(e,o){var t=PUM.getPopup(e);t.popmake("setCookie",jQuery.extend({name:"pum-"+PUM.getSetting(e,"id"),expires:"+30 days"},o))},clearCookie:function(o,t){e.pm_remove_cookie(o),"function"==typeof t&&t()},clearCookies:function(o,n){var i,s=PUM.getPopup(o),p=s.popmake("getSettings"),r=p.cookies;if(r!==t&&r.length)for(i=0;r.length>i;i+=1)e.pm_remove_cookie(r[i].settings.name);"function"==typeof n&&n()},getClickTriggerSelector:function(e,o){var t=PUM.getPopup(e),n=PUM.getSettings(e),i=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];return o.extra_selectors&&""!==o.extra_selectors&&i.push(o.extra_selectors),i=pum.hooks.applyFilters("pum.trigger.click_open.selectors",i,o,t),i.join(", ")},disableClickTriggers:function(n,i){if(n!==t)if(i!==t){var s=PUM.getClickTriggerSelector(n,i);e(s).removeClass("pum-trigger"),e(o).off("click.pumTrigger click.popmakeOpen",s)}else{var p=PUM.getSetting(n,"triggers",[]);if(p.length)for(var r=0;p.length>r;r++)if(pum.hooks.applyFilters("pum.disableClickTriggers.clickTriggerTypes",["click_open"]).indexOf(p[r].type)!==-1){var s=PUM.getClickTriggerSelector(n,p[r].settings);e(s).removeClass("pum-trigger"),e(o).off("click.pumTrigger click.popmakeOpen",s)}}}},e.fn.popmake=function(t){return e.fn.popmake.methods[t]?(e(o).trigger("pumMethodCall",arguments),e.fn.popmake.methods[t].apply(this,Array.prototype.slice.call(arguments,1))):"object"!=typeof t&&t?void(window.console&&console.warn("Method "+t+" does not exist on $.fn.popmake")):e.fn.popmake.methods.init.apply(this,arguments)},e.fn.popmake.methods={init:function(){return this.each(function(){var o=PUM.getPopup(this),n=o.popmake("getSettings");return n.theme_id<=0&&(n.theme_id=pum_vars.default_theme),n.disable_reposition!==t&&n.disable_reposition||e(window).on("resize",function(){(o.hasClass("pum-active")||o.find(".popmake.active").length)&&e.fn.popmake.utilities.throttle(setTimeout(function(){o.popmake("reposition")},25),500,!1)}),o.find(".pum-container").data("popmake",n),o.data("popmake",n).trigger("pumInit"),this})},getOverlay:function(){return PUM.getPopup(this)},getContainer:function(){return PUM.getPopup(this).find(".pum-container")},getTitle:function(){return PUM.getPopup(this).find(".pum-title")||null},getContent:function(){return PUM.getPopup(this).find(".pum-content")||null},getClose:function(){return PUM.getPopup(this).find(".pum-content + .pum-close")||null},getSettings:function(){var o=PUM.getPopup(this);return e.extend(!0,{},e.fn.popmake.defaults,o.data("popmake")||{},pum_vars.popups[o.attr("id")]||{})},state:function(e){var o=PUM.getPopup(this);if(t!==e)switch(e){case"isOpen":return o.hasClass("pum-open")||o.popmake("getContainer").hasClass("active");case"isClosed":return!o.hasClass("pum-open")&&!o.popmake("getContainer").hasClass("active")}},open:function(o){var n=PUM.getPopup(this),i=n.popmake("getContainer"),s=n.popmake("getClose"),p=n.popmake("getSettings"),r=e("html");return n.trigger("pumBeforeOpen"),n.hasClass("preventOpen")||i.hasClass("preventOpen")?(console.log("prevented"),n.removeClass("preventOpen").removeClass("pum-active").trigger("pumOpenPrevented"),this):(p.stackable||n.popmake("close_all"),n.addClass("pum-active"),p.close_button_delay>0&&s.fadeOut(0),r.addClass("pum-open"),p.overlay_disabled?r.addClass("pum-open-overlay-disabled"):r.addClass("pum-open-overlay"),p.position_fixed?r.addClass("pum-open-fixed"):r.addClass("pum-open-scrollable"),n.popmake("setup_close").popmake("reposition").popmake("animate",p.animation_type,function(){p.close_button_delay>0&&setTimeout(function(){s.fadeIn()},p.close_button_delay),n.trigger("pumAfterOpen"),e.fn.popmake.last_open_popup=n,o!==t&&o()}),this)},setup_close:function(){var n=PUM.getPopup(this),i=n.popmake("getClose"),s=n.popmake("getSettings");return i=i.add(e(".popmake-close, .pum-close",n).not(i)),i.off("click.pum").on("click.pum",function(o){var i=e(this),s=i.hasClass("pum-do-default")||i.data("do-default")!==t&&i.data("do-default");s||o.preventDefault(),e.fn.popmake.last_close_trigger="Close Button",n.popmake("close")}),(s.close_on_esc_press||s.close_on_f4_press)&&e(window).off("keyup.popmake").on("keyup.popmake",function(o){27===o.keyCode&&s.close_on_esc_press&&(e.fn.popmake.last_close_trigger="ESC Key",n.popmake("close")),115===o.keyCode&&s.close_on_f4_press&&(e.fn.popmake.last_close_trigger="F4 Key",n.popmake("close"))}),s.close_on_overlay_click&&(n.on("pumAfterOpen",function(){e(o).on("click.pumCloseOverlay",function(o){var t=e(o.target),i=t.closest(".pum-container");i.length||(e.fn.popmake.last_close_trigger="Overlay Click",n.popmake("close"))})}),n.on("pumAfterClose",function(){e(o).off("click.pumCloseOverlay")})),n.trigger("pumSetupClose"),this},close:function(o){return this.each(function(){var n=PUM.getPopup(this),i=n.popmake("getContainer"),s=n.popmake("getClose");return s=s.add(e(".popmake-close, .pum-close",n).not(s)),n.trigger("pumBeforeClose"),n.hasClass("preventClose")||i.hasClass("preventClose")?(n.removeClass("preventClose").trigger("pumClosePrevented"),this):(i.fadeOut("fast",function(){n.is(":visible")&&n.fadeOut("fast"),e(window).off("keyup.popmake"),n.off("click.popmake"),s.off("click.popmake"),1===e(".pum-active").length&&e("html").removeClass("pum-open").removeClass("pum-open-scrollable").removeClass("pum-open-overlay").removeClass("pum-open-overlay-disabled").removeClass("pum-open-fixed"),n.removeClass("pum-active").trigger("pumAfterClose"),i.find("iframe").filter('[src*="youtube"],[src*="vimeo"]').each(function(){var o=e(this),t=o.attr("src"),n=t.replace("autoplay=1","1=1");n!==t&&(t=n),o.prop("src",t)}),i.find("video").each(function(){this.pause()}),o!==t&&o()}),this)})},close_all:function(){return e(".pum-active").popmake("close"),this},reposition:function(o){var t=PUM.getPopup(this).trigger("pumBeforeReposition"),n=t.popmake("getContainer"),i=t.popmake("getSettings"),s=i.location,p={my:"",at:"",of:window,collision:"none",using:"function"==typeof o?o:e.fn.popmake.callbacks.reposition_using},r={overlay:null,container:null},a=null;try{a=e(e.fn.popmake.last_open_trigger)}catch(u){a=e()}return i.position_from_trigger&&a.length?(p.of=a,s.indexOf("left")>=0&&(p.my+=" right",p.at+=" left"+(0!==i.position_left?"-"+i.position_left:"")),s.indexOf("right")>=0&&(p.my+=" left",p.at+=" right"+(0!==i.position_right?"+"+i.position_right:"")),s.indexOf("center")>=0&&(p.my="center"===s?"center":p.my+" center",p.at="center"===s?"center":p.at+" center"),s.indexOf("top")>=0&&(p.my+=" bottom",p.at+=" top"+(0!==i.position_top?"-"+i.position_top:"")),s.indexOf("bottom")>=0&&(p.my+=" top",p.at+=" bottom"+(0!==i.position_bottom?"+"+i.position_bottom:""))):(s.indexOf("left")>=0&&(p.my+=" left"+(0!==i.position_left?"+"+i.position_left:""),p.at+=" left"),s.indexOf("right")>=0&&(p.my+=" right"+(0!==i.position_right?"-"+i.position_right:""),p.at+=" right"),s.indexOf("center")>=0&&(p.my="center"===s?"center":p.my+" center",p.at="center"===s?"center":p.at+" center"),s.indexOf("top")>=0&&(p.my+=" top"+(0!==i.position_top?"+"+(e("body").hasClass("admin-bar")?parseInt(i.position_top,10)+32:i.position_top):""),p.at+=" top"),s.indexOf("bottom")>=0&&(p.my+=" bottom"+(0!==i.position_bottom?"-"+i.position_bottom:""),p.at+=" bottom")),p.my=e.trim(p.my),p.at=e.trim(p.at),t.is(":hidden")&&(r.overlay=t.css("opacity"),t.css({opacity:0}).show(0)),n.is(":hidden")&&(r.container=n.css("opacity"),n.css({opacity:0}).show(0)),i.position_fixed&&n.addClass("fixed"),"custom"===i.size?n.css({width:i.custom_width,height:i.custom_height_auto?"auto":i.custom_height}):"auto"!==i.size&&n.addClass("responsive").css({minWidth:""!==i.responsive_min_width?i.responsive_min_width:"auto",maxWidth:""!==i.responsive_max_width?i.responsive_max_width:"auto"}),t.trigger("pumAfterReposition"),n.addClass("custom-position").position(p).trigger("popmakeAfterReposition"),r.overlay&&t.css({opacity:r.overlay}).hide(0),r.container&&n.css({opacity:r.container}).hide(0),this},animation_origin:function(o){var t=PUM.getPopup(this),n=t.popmake("getContainer"),i={my:"",at:""};switch(o){case"top":i={my:"left+"+n.offset().left+" bottom-100",at:"left top"};break;case"bottom":i={my:"left+"+n.offset().left+" top+100",at:"left bottom"};break;case"left":i={my:"right top+"+n.offset().top,at:"left top"};break;case"right":i={my:"left top+"+n.offset().top,at:"right top"};break;default:o.indexOf("left")>=0&&(i={my:i.my+" right",at:i.at+" left"}),o.indexOf("right")>=0&&(i={my:i.my+" left",at:i.at+" right"}),o.indexOf("center")>=0&&(i={my:i.my+" center",at:i.at+" center"}),o.indexOf("top")>=0&&(i={my:i.my+" bottom-100",at:i.at+" top"}),o.indexOf("bottom")>=0&&(i={my:i.my+" top+100",at:i.at+" bottom"}),i.my=e.trim(i.my),i.at=e.trim(i.at)}return i.of=window,i.collision="none",i}}}(jQuery,document);var PUM_Accessibility;!function(e,o,t){"use strict";var n,i,s,p="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";PUM_Accessibility={forceFocus:function(e){s&&s.length&&!s[0].contains(e.target)&&(e.stopPropagation(),PUM_Accessibility.setFocusToFirstItem())},trapTabKey:function(o){if(9===o.keyCode){var t=s.find(".pum-container *").filter(p).filter(":visible"),n=e(":focus"),i=t.length,r=t.index(n);o.shiftKey?0===r&&(t.get(i-1).focus(),o.preventDefault()):r===i-1&&(t.get(0).focus(),o.preventDefault())}},setFocusToFirstItem:function(){s.find(".pum-container *").filter(p).filter(":visible").filter(":not(.pum-close)").first().focus()}},e(o).on("pumInit",".pum",function(){PUM.getPopup(this).find("[tabindex]").each(function(){var o=e(this);o.data("tabindex",o.attr("tabindex")).prop("tabindex","0")})}).on("pumBeforeOpen",".pum",function(){var t=PUM.getPopup(this),p=e(":focus");t.has(p).length||(i=p),s=t.on("keydown.pum_accessibility",PUM_Accessibility.trapTabKey).attr("aria-hidden","false"),n=e("body > *").filter(":visible").not(s),n.attr("aria-hidden","true"),e(o).one("focusin.pum_accessibility",PUM_Accessibility.forceFocus),PUM_Accessibility.setFocusToFirstItem()}).on("pumAfterOpen",".pum",function(){}).on("pumBeforeClose",".pum",function(){}).on("pumAfterClose",".pum",function(){var p=PUM.getPopup(this);p.off("keydown.pum_accessibility").attr("aria-hidden","true"),n&&(n.attr("aria-hidden","false"),n=null),i!==t&&i.length&&i.focus(),s=null,e(o).off("focusin.pum_accessibility")}).on("pumSetupClose",".pum",function(){}).on("pumOpenPrevented",".pum",function(){}).on("pumClosePrevented",".pum",function(){}).on("pumBeforeReposition",".pum",function(){})}(jQuery,document);var PUM_Analytics;!function(e){"use strict";e.fn.popmake.last_open_trigger=null,e.fn.popmake.last_close_trigger=null,e.fn.popmake.conversion_trigger=null;var o=!("undefined"==typeof pum_vars.restapi||!pum_vars.restapi);PUM_Analytics={beacon:function(t,n){var i=new Image,s=o?pum_vars.restapi:pum_vars.ajaxurl,p={route:"/analytics/",data:e.extend({event:"open",pid:null,_cache:+new Date},t),callback:"function"==typeof n?n:function(){}};o?s+=p.route:p.data.action="pum_analytics",s&&(e(i).on("error success load done",p.callback),i.src=s+"?"+e.param(p.data))}},"undefined"!=typeof pum_vars.disable_tracking&&pum_vars.disable_tracking||e(document).on("pumAfterOpen.core_analytics","body > .pum",function(){var o=PUM.getPopup(this),t={pid:parseInt(o.popmake("getSettings").id,10)||null};t.pid>0&&!e("body").hasClass("single-popup")&&PUM_Analytics.beacon(t)})}(jQuery),function(e,o,t){"use strict";e.fn.popmake.methods.animate_overlay=function(o,t,n){var i=PUM.getPopup(this).popmake("getSettings");return i.overlay_disabled?e.fn.popmake.overlay_animations.none.apply(this,[t,n]):e.fn.popmake.overlay_animations[o]?e.fn.popmake.overlay_animations[o].apply(this,[t,n]):(window.console&&console.warn("Animation style "+o+" does not exist."),this)},e.fn.popmake.methods.animate=function(o){return e.fn.popmake.animations[o]?e.fn.popmake.animations[o].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Animation style "+o+" does not exist."),this)},e.fn.popmake.animations={none:function(e){var o=PUM.getPopup(this);return o.popmake("getContainer").show(0),o.popmake("animate_overlay","none",0,function(){e!==t&&e()}),this},slide:function(e){var o=PUM.getPopup(this).show(0).css({opacity:0}),n=o.popmake("getContainer").show(0).css({opacity:0}),i=o.popmake("getSettings"),s=i.animation_speed/2,p=o.popmake("animation_origin",i.animation_origin);return n.position(p).css({opacity:1}),o.css({opacity:1}).popmake("animate_overlay","fade",s,function(){n.popmake("reposition",function(o){n.animate(o,s,"swing",function(){e!==t&&e()})})}),this},fade:function(e){var o=PUM.getPopup(this),n=o.popmake("getContainer"),i=o.popmake("getSettings"),s=i.animation_speed/2;return n.show(0).css({opacity:0}),o.popmake("animate_overlay","fade",s,function(){n.animate({opacity:1},s,"swing",function(){e!==t&&e()})}),this},fadeAndSlide:function(e){var o=PUM.getPopup(this).show(0).css({opacity:0}),n=o.popmake("getContainer").show(0).css({opacity:0}),i=o.popmake("getSettings"),s=i.animation_speed/2,p=o.popmake("animation_origin",i.animation_origin);return n.position(p),o.hide().css({opacity:1}).popmake("animate_overlay","fade",s,function(){n.popmake("reposition",function(o){o.opacity=1,n.animate(o,s,"swing",function(){e!==t&&e()})})}),this},grow:function(o){return e.fn.popmake.animations.fade.apply(this,arguments)},growAndSlide:function(o){return e.fn.popmake.animations.fadeAndSlide.apply(this,arguments)}},e.fn.popmake.overlay_animations={none:function(e,o){PUM.getPopup(this).show(e,o)},fade:function(e,o){PUM.getPopup(this).fadeIn(e,o)},slide:function(e,o){PUM.getPopup(this).slideDown(e,o)}}}(jQuery,document),function(e,o,t){"use strict";e(o).on("pumInit",".pum",function(){e(this).popmake("getContainer").trigger("popmakeInit")}).on("pumBeforeOpen",".pum",function(){e(this).popmake("getContainer").addClass("active").trigger("popmakeBeforeOpen")}).on("pumAfterOpen",".pum",function(){e(this).popmake("getContainer").trigger("popmakeAfterOpen")}).on("pumBeforeClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeClose")}).on("pumAfterClose",".pum",function(){e(this).popmake("getContainer").removeClass("active").trigger("popmakeAfterClose")}).on("pumSetupClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeSetupClose")}).on("pumOpenPrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventOpen").removeClass("active")}).on("pumClosePrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventClose")}).on("pumBeforeReposition",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeReposition")})}(jQuery,document),function(e,o,t){"use strict";e.fn.popmake.callbacks={reposition_using:function(o){e(this).css(o)}}}(jQuery,document),function(e,o,t){"use strict";var n,i=function(){return n===t&&(n="undefined"!=typeof MobileDetect?new MobileDetect(window.navigator.userAgent):{phone:function(){return!1},tablet:function(){return!1}}),n};e.extend(e.fn.popmake.methods,{checkConditions:function(){var o,t,n,s,p,r=PUM.getPopup(this),a=r.popmake("getSettings"),u=!0;if(a.disable_on_mobile&&i().phone())return!1;if(a.disable_on_tablet&&i().tablet())return!1;if(a.conditions.length)for(t=0;a.conditions.length>t;t++){for(s=a.conditions[t],o=!1,n=0;s.length>n&&(p=e.extend({},{not_operand:!1},s[n]),!p.not_operand&&r.popmake("checkCondition",p)?o=!0:p.not_operand&&!r.popmake("checkCondition",p)&&(o=!0),e(this).trigger("pumCheckingCondition",[o,p]),!o);n++);o||(u=!1)}return u},checkCondition:function(o){var t=o.target||null;o.settings||o;return t?e.fn.popmake.conditions[t]?e.fn.popmake.conditions[t].apply(this,[o]):window.console?(console.warn("Condition "+t+" does not exist."),!0):void 0:(console.warn("Condition type not set."),!1)}}),e.fn.popmake.conditions={}}(jQuery,document);var pm_cookie,pm_cookie_json,pm_remove_cookie;!function(e){"use strict";function o(o){function t(n,i,s){var p,r=new Date;if("undefined"!=typeof document){if(arguments.length>1){switch(s=e.extend({path:pum_vars.home_url},t.defaults,s),typeof s.expires){case"number":r.setMilliseconds(r.getMilliseconds()+864e5*s.expires),s.expires=r;break;case"string":r.setTime(1e3*e.fn.popmake.utilities.strtotime("+"+s.expires)),s.expires=r}try{p=JSON.stringify(i),/^[\{\[]/.test(p)&&(i=p)}catch(a){}return i=o.write?o.write(i,n):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)),n=n.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),n=n.replace(/[\(\)]/g,escape),document.cookie=[n,"=",i,s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("")}n||(p={});for(var u=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,l=0;l<u.length;l++){var m=u[l].split("="),d=m.slice(1).join("=");'"'===d.charAt(0)&&(d=d.slice(1,-1));try{var f=m[0].replace(c,decodeURIComponent);if(d=o.read?o.read(d,f):o(d,f)||d.replace(c,decodeURIComponent),this.json)try{d=JSON.parse(d)}catch(a){}if(n===f){p=d;break}n||(p[f]=d)}catch(a){}}return p}}return void 0===o&&(o=function(){}),t.set=t,t.get=function(e){return t.call(t,e)},t.getJSON=function(){return t.apply({json:!0},[].slice.call(arguments))},t.defaults={},t.remove=function(o,n){t(o,"",e.extend({},n,{expires:-1,path:""})),t(o,"",e.extend({},n,{expires:-1}))},t.process=function(e,o,n,i){return arguments.length>3&&"object"!=typeof arguments[2]&&void 0!==o?t.apply(t,[e,o,{expires:n,path:i}]):t.apply(t,[].slice.call(arguments,[0,2]))},t.withConverter=e.fn.popmake.cookie,t}e.extend(e.fn.popmake,{cookie:o()}),pm_cookie=e.pm_cookie=e.fn.popmake.cookie.process,pm_cookie_json=e.pm_cookie_json=e.fn.popmake.cookie.getJSON,pm_remove_cookie=e.pm_remove_cookie=e.fn.popmake.cookie.remove}(jQuery),function(e,o,t){"use strict";e.extend(e.fn.popmake.methods,{addCookie:function(o){return pum.hooks.doAction("popmake.addCookie",arguments),e.fn.popmake.cookies[o]?e.fn.popmake.cookies[o].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Cookie type "+o+" does not exist."),this)},setCookie:function(o){e.pm_cookie(o.name,!0,o.session?null:o.time,o.path?pum_vars.home_url||"/":null),pum.hooks.doAction("popmake.setCookie",o)},checkCookies:function(o){var n,i=!1;if(o.cookie_name===t||null===o.cookie_name||""===o.cookie_name)return!1;switch(typeof o.cookie_name){case"object":case"array":for(n=0;o.cookie_name.length>n;n+=1)e.pm_cookie(o.cookie_name[n])!==t&&(i=!0);break;case"string":e.pm_cookie(o.cookie_name)!==t&&(i=!0)}return pum.hooks.doAction("popmake.checkCookies",o,i),i}}),e.fn.popmake.cookies=e.fn.popmake.cookies||{},e.extend(e.fn.popmake.cookies,{on_popup_open:function(e){var o=PUM.getPopup(this);o.on("pumAfterOpen",function(){o.popmake("setCookie",e)})},on_popup_close:function(e){var o=PUM.getPopup(this);o.on("pumBeforeClose",function(){o.popmake("setCookie",e)})},manual:function(e){var o=PUM.getPopup(this);o.on("pumSetCookie",function(){o.popmake("setCookie",e)})},form_success:function(e){var o=PUM.getPopup(this);o.on("pumFormSuccess",function(){o.popmake("setCookie",e)})},pum_sub_form_success:function(e){var o=PUM.getPopup(this);o.find("form.pum-sub-form").on("success",function(){o.popmake("setCookie",e)})},pum_sub_form_already_subscribed:function(e){var o=PUM.getPopup(this);o.find("form.pum-sub-form").on("success",function(){o.popmake("setCookie",e)})},ninja_form_success:function(o){return e.fn.popmake.cookies.form_success.apply(this,arguments)},cf7_form_success:function(o){return e.fn.popmake.cookies.form_success.apply(this,arguments)},gforms_form_success:function(o){return e.fn.popmake.cookies.form_success.apply(this,arguments)}}),e(o).on("pumInit",".pum",function(){var e,o=PUM.getPopup(this),t=o.popmake("getSettings"),n=t.cookies||[],i=null;if(n.length)for(e=0;n.length>e;e+=1)i=n[e],o.popmake("addCookie",i.event,i.settings)})}(jQuery,document);var pum_debug_mode=!1,pum_debug;!function(e,o){if(o=window.pum_vars||{debug_mode:!1},pum_debug_mode=void 0!==o.debug_mode&&o.debug_mode,pum_debug_mode||window.location.href.indexOf("pum_debug")===-1||(pum_debug_mode=!0),pum_debug_mode){var t=!1,n=!1,i=window.pum_debug_vars||{};pum_debug={odump:function(o){return e.extend({},o)},logo:function(){console.log(" -------------------------------------------------------------\n|  ____                           __  __       _              |\n| |  _ \\ ___  _ __  _   _ _ __   |  \\/  | __ _| | _____ _ __  |\n| | |_) / _ \\| '_ \\| | | | '_ \\  | |\\/| |/ _` | |/ / _ \\ '__| |\n| |  __/ (_) | |_) | |_| | |_) | | |  | | (_| |   <  __/ |    |\n| |_|   \\___/| .__/ \\__,_| .__/  |_|  |_|\\__,_|_|\\_\\___|_|    |\n|            |_|         |_|                                  |\n -------------------------------------------------------------")},initialize:function(){t=!0,pum_debug.logo(),console.debug(i.debug_mode_enabled),console.log(i.debug_started_at,new Date),console.info(i.debug_more_info),pum_debug.divider(i.global_info),console.groupCollapsed(i.localized_vars),console.log("pum_vars:",pum_debug.odump(o)),e(document).trigger("pum_debug_initialize_localized_vars"),console.groupEnd(),e(document).trigger("pum_debug_initialize")},popup_event_header:function(e){var o=e.popmake("getSettings");n!==o.id&&(n=o.id,pum_debug.divider(i.single_popup_label+o.id+" - "+o.slug))},divider:function(e){var o=62,t=62,n=0,i=" "+new Array(o+1).join("-")+" ";"string"==typeof e?(t=o-e.length,n={left:Math.floor(t/2),right:Math.floor(t/2)},n.left+n.right===t-1&&n.right++,n.left=new Array(n.left+1).join(" "),n.right=new Array(n.right+1).join(" "),console.log(""+i+"\n|"+n.left+e+n.right+"|\n"+i)):console.log(i)},click_trigger:function(e,o){var t,n=e.popmake("getSettings"),s=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];o.extra_selectors&&""!==o.extra_selectors&&s.push(o.extra_selectors),s=pum.hooks.applyFilters("pum.trigger.click_open.selectors",s,o,e),t=s.join(", "),console.log(i.label_selector,t)},trigger:function(o,t){if("string"==typeof i.triggers[t.type]){switch(console.groupCollapsed(i.triggers[t.type]),t.type){case"auto_open":console.log(i.label_delay,t.settings.delay),console.log(i.label_cookie,t.settings.cookie_name);break;case"click_open":pum_debug.click_trigger(o,t.settings),console.log(i.label_cookie,t.settings.cookie_name)}e(document).trigger("pum_debug_render_trigger",o,t),console.groupEnd()}},cookie:function(o,t){if("string"==typeof i.cookies[t.event]){switch(console.groupCollapsed(i.cookies[t.event]),t.event){case"on_popup_open":case"on_popup_close":case"manual":case"ninja_form_success":console.log(i.label_cookie,pum_debug.odump(t.settings))}e(document).trigger("pum_debug_render_trigger",o,t),console.groupEnd()}}},e(document).on("pumInit",".pum",function(){var o=PUM.getPopup(e(this)),n=o.popmake("getSettings"),s=n.triggers||[],p=n.cookies||[],r=n.conditions||[],a=0;if(t||(pum_debug.initialize(),pum_debug.divider(i.popups_initializing)),console.groupCollapsed(i.single_popup_label+n.id+" - "+n.slug),console.log(i.theme_id,n.theme_id),s.length){for(console.groupCollapsed(i.label_triggers),a=0;s.length>a;a++)pum_debug.trigger(o,s[a]);console.groupEnd()}if(p.length){for(console.groupCollapsed(i.label_cookies),a=0;p.length>a;a+=1)pum_debug.cookie(o,p[a]);console.groupEnd()}r.length&&(console.groupCollapsed(i.label_conditions),console.log(r),console.groupEnd()),console.groupCollapsed(i.label_popup_settings),console.log(i.label_mobile_disabled,n.disable_on_mobile!==!1),console.log(i.label_tablet_disabled,n.disable_on_tablet!==!1),console.log(i.label_display_settings,pum_debug.odump(n)),o.trigger("pum_debug_popup_settings"),console.groupEnd(),console.groupEnd()}).on("pumBeforeOpen",".pum",function(){var o=PUM.getPopup(e(this)),t=e.fn.popmake.last_open_trigger;pum_debug.popup_event_header(o),console.groupCollapsed(i.label_event.replace("%s","pumBeforeOpen"));try{t=e(e.fn.popmake.last_open_trigger),t=t.length?t:e.fn.popmake.last_open_trigger.toString()}catch(n){t=""}finally{console.log(i.label_triggers,[t])}console.groupEnd()}).on("pumOpenPrevented",".pum",function(){var o=PUM.getPopup(e(this));pum_debug.popup_event_header(o),console.groupCollapsed(i.label_event.replace("%s","pumOpenPrevented")),console.groupEnd()}).on("pumAfterOpen",".pum",function(){var o=PUM.getPopup(e(this));pum_debug.popup_event_header(o),console.groupCollapsed(i.label_event.replace("%s","pumAfterOpen")),console.groupEnd()}).on("pumSetupClose",".pum",function(){var o=PUM.getPopup(e(this));pum_debug.popup_event_header(o),console.groupCollapsed(i.label_event.replace("%s","pumSetupClose")),console.groupEnd()}).on("pumClosePrevented",".pum",function(){var o=PUM.getPopup(e(this));pum_debug.popup_event_header(o),console.groupCollapsed(i.label_event.replace("%s","pumClosePrevented")),console.groupEnd()}).on("pumBeforeClose",".pum",function(){var o=PUM.getPopup(e(this));pum_debug.popup_event_header(o),console.groupCollapsed(i.label_event.replace("%s","pumBeforeClose")),console.groupEnd()}).on("pumAfterClose",".pum",function(){var o=PUM.getPopup(e(this));pum_debug.popup_event_header(o),console.groupCollapsed(i.label_event.replace("%s","pumAfterClose")),console.groupEnd()}).on("pumBeforeReposition",".pum",function(){var o=PUM.getPopup(e(this));pum_debug.popup_event_header(o),console.groupCollapsed(i.label_event.replace("%s","pumBeforeReposition")),console.groupEnd()}).on("pumAfterReposition",".pum",function(){var o=PUM.getPopup(e(this));pum_debug.popup_event_header(o),console.groupCollapsed(i.label_event.replace("%s","pumAfterReposition")),console.groupEnd()}).on("pumCheckingCondition",".pum",function(o,t,n){var s=PUM.getPopup(e(this));pum_debug.popup_event_header(s),console.groupCollapsed(i.label_event.replace("%s","pumCheckingCondition")),console.log((n.not_operand?"(!) ":"")+n.target+": "+t,n),console.groupEnd()})}}(jQuery),function(e,o,t){"use strict";e.fn.popmake.defaults={id:null,slug:"",theme_id:null,cookies:[],triggers:[],conditions:[],mobile_disabled:null,tablet_disabled:null,custom_height_auto:!1,scrollable_content:!1,position_from_trigger:!1,position_fixed:!1,overlay_disabled:!1,stackable:!1,disable_reposition:!1,close_on_overlay_click:!1,close_on_esc_press:!1,close_on_f4_press:!1,disable_on_mobile:!1,disable_on_tablet:!1,size:"medium",responsive_min_width:"0%",responsive_max_width:"100%",custom_width:"640px",custom_height:"380px",animation_type:"fade",animation_speed:"350",animation_origin:"center top",location:"center top",position_top:"100",position_bottom:"0",position_left:"0",position_right:"0",zindex:"1999999999",close_button_delay:"0",meta:{display:{stackable:!1,overlay_disabled:!1,size:"medium",responsive_max_width:"100",responsive_max_width_unit:"%",responsive_min_width:"0",responsive_min_width_unit:"%",custom_width:"640",custom_width_unit:"px",custom_height:"380",custom_height_unit:"px",custom_height_auto:!1,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:!1,animation_type:"fade",animation_speed:350,animation_origin:"center top",scrollable_content:!1,disable_reposition:!1,position_from_trigger:!1,overlay_zindex:!1,zindex:"1999999999"},close:{overlay_click:!1,esc_press:!1,f4_press:!1,text:"",button_delay:0},click_open:[]},container:{active_class:"active",attr:{"class":"popmake"}},title:{attr:{"class":"popmake-title"}},content:{attr:{"class":"popmake-content"}},close:{close_speed:0,attr:{"class":"popmake-close"}},overlay:{attr:{id:"popmake-overlay","class":"popmake-overlay"}}}}(jQuery,document),function(e){"use strict";var o={openpopup:!1,openpopup_id:0,closepopup:!1,closedelay:0,redirect_enabled:!1,redirect:"",cookie:!1};window.PUM=window.PUM||{},window.PUM.forms=window.PUM.forms||{},e.extend(window.PUM.forms,{form:{validation:{errors:[]},responseHandler:function(e,o){var t=o.data;o.success?window.PUM.forms.form.success(e,t):window.PUM.forms.form.errors(e,t)},display_errors:function(e,o){window.PUM.forms.messages.add(e,o||this.validation.errors,"error")},beforeAjax:function(o){var t=o.find('[type="submit"]'),n=t.find(".pum-form__loader");window.PUM.forms.messages.clear_all(o),n.length||(n=e('<span class="pum-form__loader"></span>'),""!==t.attr("value")?n.insertAfter(t):t.append(n)),t.prop("disabled",!0),n.show(),o.addClass("pum-form--loading").removeClass("pum-form--errors")},afterAjax:function(e){var o=e.find('[type="submit"]'),t=o.find(".pum-form__loader");o.prop("disabled",!1),t.hide(),e.removeClass("pum-form--loading")},success:function(e,o){void 0!==o.message&&""!==o.message&&window.PUM.forms.messages.add(e,[{message:o.message}]),e.trigger("success",[o]),!e.data("noredirect")&&void 0!==e.data("redirect_enabled")&&o.redirect&&(""!==o.redirect?window.location=o.redirect:window.location.reload(!0))},errors:function(e,o){void 0!==o.errors&&o.errors.length&&(console.log(o.errors),window.PUM.forms.form.display_errors(e,o.errors),window.PUM.forms.messages.scroll_to_first(e),e.addClass("pum-form--errors").trigger("errors",[o]))},submit:function(o){var t=e(this),n=t.pumSerializeObject();o.preventDefault(),o.stopPropagation(),window.PUM.forms.form.beforeAjax(t),e.ajax({type:"POST",dataType:"json",url:pum_vars.ajaxurl,data:{action:"pum_form",values:n}}).always(function(){window.PUM.forms.form.afterAjax(t)}).done(function(e){window.PUM.forms.form.responseHandler(t,e)}).error(function(e,o,t){console.log("Error: type of "+o+" with message of "+t)})}},messages:{add:function(o,t,n){var i=o.find(".pum-form__messages"),s=0;if(n=n||"success",t=t||[],!i.length)switch(i=e('<div class="pum-form__messages">').hide(),pum_vars.message_position){case"bottom":o.append(i.addClass("pum-form__messages--bottom"));break;case"top":o.prepend(i.addClass("pum-form__messages--top"))}if(["bottom","top"].indexOf(pum_vars.message_position)>=0)for(;t.length>s;s++)this.add_message(i,t[s].message,n);else for(;t.length>s;s++)void 0!==t[s].field?this.add_field_error(o,t[s]):this.add_message(i,t[s].message,n);i.is(":hidden")&&e(".pum-form__message",i).length&&i.slideDown();
},add_message:function(o,t,n){var i=e('<p class="pum-form__message">').html(t);n=n||"success",i.addClass("pum-form__message--"+n),o.append(i),o.is(":visible")&&i.hide().slideDown()},add_field_error:function(o,t){var n=e('[name="'+t.field+'"]',o),i=n.parents(".pum-form__field").addClass("pum-form__field--error");this.add_message(i,t.message,"error")},clear_all:function(o,t){var n=o.find(".pum-form__messages"),i=n.find(".pum-form__message"),s=o.find(".pum-form__field.pum-form__field--error");t=t||!1,n.length&&i.slideUp("fast",function(){e(this).remove(),t&&n.hide()}),s.length&&s.removeClass("pum-form__field--error").find("p.pum-form__message").remove()},scroll_to_first:function(o){window.PUM.utilities.scrollTo(e(".pum-form__field.pum-form__field--error",o).eq(0))}},success:function(t,n){if(n=e.extend({},o,n)){var i=PUM.getPopup(t),s={},p=function(){n.redirect_enabled&&(""!==n.redirect?window.location=n.redirect:window.location.reload(!0))},r=function(){n.openpopup&&PUM.getPopup(n.openpopup_id).length?PUM.open(n.openpopup_id):p()};i.length&&(i.trigger("pumFormSuccess"),n.cookie&&(s=e.extend({name:"pum-"+PUM.getSetting(i,"id"),expires:"+1 year"},"object"==typeof n.cookie?n.cookie:{}),PUM.setCookie(i,s))),i.length&&n.closepopup?setTimeout(function(){i.popmake("close",r)},1e3*parseInt(n.closedelay)):r()}}})}(jQuery),function(e,o){"use strict";var t=function(){function e(e,o,t,n){return"string"==typeof e&&"function"==typeof o&&(t=parseInt(t||10,10),r("actions",e,o,t,n)),l}function o(){var e=c.call(arguments),o=e.shift();return"string"==typeof o&&u("actions",o,e),l}function t(e,o){return"string"==typeof e&&p("actions",e,o),l}function n(e,o,t,n){return"string"==typeof e&&"function"==typeof o&&(t=parseInt(t||10,10),r("filters",e,o,t,n)),l}function i(){var e=c.call(arguments),o=e.shift();return"string"==typeof o?u("filters",o,e):l}function s(e,o){return"string"==typeof e&&p("filters",e,o),l}function p(e,o,t,n){var i,s,p;if(m[e][o])if(t)if(i=m[e][o],n)for(p=i.length;p--;)s=i[p],s.callback===t&&s.context===n&&i.splice(p,1);else for(p=i.length;p--;)i[p].callback===t&&i.splice(p,1);else m[e][o]=[]}function r(e,o,t,n,i){var s={callback:t,priority:n,context:i},p=m[e][o];p?(p.push(s),p=a(p)):p=[s],m[e][o]=p}function a(e){for(var o,t,n,i=1,s=e.length;i<s;i++){for(o=e[i],t=i;(n=e[t-1])&&n.priority>o.priority;)e[t]=e[t-1],--t;e[t]=o}return e}function u(e,o,t){var n,i,s=m[e][o];if(!s)return"filters"===e&&t[0];if(i=s.length,"filters"===e)for(n=0;n<i;n++)t[0]=s[n].callback.apply(s[n].context,t);else for(n=0;n<i;n++)s[n].callback.apply(s[n].context,t);return"filters"!==e||t[0]}var c=Array.prototype.slice,l={removeFilter:s,applyFilters:i,addFilter:n,removeAction:t,doAction:o,addAction:e},m={actions:{},filters:{}};return l};e.pum=e.pum||{},e.pum.hooks=e.pum.hooks||new t}(window),function(e){"use strict";function o(){"undefined"!=typeof Marionette&&"undefined"!=typeof nfRadio&&(n=Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("forms"),"submit:response",this.popupMaker)},popupMaker:function(o,t,n,i){var s=e("#nf-form-"+i+"-cont"),p={};o.errors.length||("undefined"!=typeof o.data.actions&&(p.openpopup="undefined"!=typeof o.data.actions.openpopup,p.openpopup_id=p.openpopup?parseInt(o.data.actions.openpopup):0,p.closepopup="undefined"!=typeof o.data.actions.closepopup,p.closedelay=p.closepopup?parseInt(o.data.actions.closepopup):0,p.closepopup&&o.data.actions.closedelay&&(p.closedelay=parseInt(o.data.actions.closedelay))),window.PUM.forms.success(s,p))}}))}var t={},n=!1;e(document).ready(function(){n===!1&&o(),n!==!1&&new n,e(".gform_wrapper > form").each(function(){var o=e(this),n=o.attr("id").replace("gform_",""),i=o.find("input.gforms-pum"),s=!!i.length&&JSON.parse(i.val());s&&"object"==typeof s&&("object"==typeof s&&void 0!==s.closedelay&&s.closedelay.toString().length>=3&&(s.closedelay=s.closedelay/1e3),t[n]=s)})}).on("gform_confirmation_loaded",function(o,n){var i=e("#gform_confirmation_wrapper_"+n+",#gforms_confirmation_message_"+n),s=t[n]||!1;window.PUM.forms.success(i,s)}).on("wpcf7:mailsent",".wpcf7",function(o){var t=e(o.target),n=t.find("input.wpcf7-pum"),i=!!n.length&&JSON.parse(n.val());"object"==typeof i&&void 0!==i.closedelay&&i.closedelay.toString().length>=3&&(i.closedelay=i.closedelay/1e3),window.PUM.forms.success(t,i)})}(jQuery),function(e){"use strict";pum_vars&&void 0!==pum_vars.core_sub_forms_enabled&&!pum_vars.core_sub_forms_enabled||(window.PUM=window.PUM||{},window.PUM.newsletter=window.PUM.newsletter||{},e.extend(window.PUM.newsletter,{form:e.extend({},window.PUM.forms.form,{submit:function(o){var t=e(this),n=t.pumSerializeObject();o.preventDefault(),o.stopPropagation(),window.PUM.newsletter.form.beforeAjax(t),e.ajax({type:"POST",dataType:"json",url:pum_vars.ajaxurl,data:{action:"pum_sub_form",values:n}}).always(function(){window.PUM.newsletter.form.afterAjax(t)}).done(function(e){window.PUM.newsletter.form.responseHandler(t,e)}).error(function(e,o,t){console.log("Error: type of "+o+" with message of "+t)})}})}),e(document).on("submit","form.pum-sub-form",window.PUM.newsletter.form.submit).on("success","form.pum-sub-form",function(o,t){var n=e(o.target),i=n.data("settings")||{};n.trigger("pumNewsletterSuccess",[t]).addClass("pum-newsletter-success"),n[0].reset(),window.pum.hooks.doAction("pum-sub-form.success",t,n),"string"==typeof i.redirect&&""!==i.redirect&&(i.redirect=atob(i.redirect)),window.PUM.forms.success(n,i)}).on("error","form.pum-sub-form",function(o,t){var n=e(o.target);n.trigger("pumNewsletterError",[t]),window.pum.hooks.doAction("pum-sub-form.errors",t,n)}))}(jQuery),function(e,o,t){"use strict";e.extend(e.fn.popmake.methods,{addTrigger:function(o){return e.fn.popmake.triggers[o]?e.fn.popmake.triggers[o].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Trigger type "+o+" does not exist."),this)}}),e.fn.popmake.triggers={auto_open:function(o){var t=PUM.getPopup(this);setTimeout(function(){t.popmake("state","isOpen")||!t.popmake("checkCookies",o)&&t.popmake("checkConditions")&&(e.fn.popmake.last_open_trigger="Auto Open - Delay: "+o.delay,t.popmake("open"))},o.delay)},click_open:function(t){var n,i=PUM.getPopup(this),s=i.popmake("getSettings"),p=[".popmake-"+s.id,".popmake-"+decodeURIComponent(s.slug),'a[href$="#popmake-'+s.id+'"]'];t.extra_selectors&&""!==t.extra_selectors&&p.push(t.extra_selectors),p=pum.hooks.applyFilters("pum.trigger.click_open.selectors",p,t,i),n=p.join(", "),e(n).addClass("pum-trigger").css({cursor:"pointer"}),e(o).on("click.pumTrigger",n,function(o){var n=e(this),s=t.do_default||!1;i.has(n).length>0||i.popmake("state","isOpen")||!i.popmake("checkCookies",t)&&i.popmake("checkConditions")&&(n.data("do-default")?s=n.data("do-default"):(n.hasClass("do-default")||n.hasClass("popmake-do-default")||n.hasClass("pum-do-default"))&&(s=!0),o.ctrlKey||pum.hooks.applyFilters("pum.trigger.click_open.do_default",s,i,n)||(o.preventDefault(),o.stopPropagation()),e.fn.popmake.last_open_trigger=n,i.popmake("open"))})},admin_debug:function(){PUM.getPopup(this).popmake("open")}},e(o).on("pumInit",".pum",function(){var e,o=PUM.getPopup(this),t=o.popmake("getSettings"),n=t.triggers||[],i=null;if(n.length)for(e=0;n.length>e;e+=1)i=n[e],o.popmake("addTrigger",i.type,i.settings)})}(jQuery,document),function(e,o,t){"use strict";function n(e,o,t){var i=o[0];o.length>1?(e[i]||(e[i]=o[1]?{}:[]),n(e[i],o.slice(1),t)):(i||(i=e.length),e[i]=t)}var i="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),s="select,textarea".split(","),p=/\[([^\]]*)\]/g;Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(void 0===this||null===this)throw new TypeError;var o=Object(this),t=o.length>>>0;if(0===t)return-1;var n=0;if(arguments.length>0&&(n=Number(arguments[1]),n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=t)return-1;for(var i=n>=0?n:Math.max(t-Math.abs(n),0);i<t;i++)if(i in o&&o[i]===e)return i;return-1}),e.fn.popmake.utilities={scrollTo:function(o,t){var n=e(o)||e();n.length&&e("html, body").animate({scrollTop:n.offset().top-100},1e3,"swing",function(){var e=n.find(':input:not([type="button"]):not([type="hidden"]):not(button)').eq(0);e.hasClass("wp-editor-area")?tinyMCE.execCommand ("mceFocus",!1,e.attr("id")):e.focus(),"function"==typeof t&&t()})},inArray:function(e,o){return!!~o.indexOf(e)},convert_hex:function(e,o){e=e.replace("#","");var t=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16);return"rgba("+t+","+n+","+i+","+o/100+")"},debounce:function(e,o){var t;return function(){var n=this,i=arguments;window.clearTimeout(t),t=window.setTimeout(function(){e.apply(n,i)},o)}},throttle:function(e,o){var t=!1,n=function(){t=!1};return function(){t||(e.apply(this,arguments),window.setTimeout(n,o),t=!0)}},getXPath:function(o){var t,n,i,s,p,r=[];return e.each(e(o).parents(),function(o,a){return t=e(a),n=t.attr("id")||"",i=t.attr("class")||"",s=t.get(0).tagName.toLowerCase(),p=t.parent().children(s).index(t),"body"!==s&&(i.length>0&&(i=i.split(" "),i=i[0]),void r.push(s+(n.length>0?"#"+n:i.length>0?"."+i.split(" ").join("."):":eq("+p+")")))}),r.reverse().join(" > ")},strtotime:function(e,o){function n(e,o,n){var i,s=c[o];s!==t&&(i=s-u.getDay(),0===i?i=7*n:i>0&&"last"===e?i-=7:i<0&&"next"===e&&(i+=7),u.setDate(u.getDate()+i))}function i(e){var o=e.split(" "),t=o[0],i=o[1].substring(0,3),s=/\d+/.test(t),p="ago"===o[2],r=("last"===t?-1:1)*(p?-1:1);if(s&&(r*=parseInt(t,10)),l.hasOwnProperty(i)&&!o[1].match(/^mon(day|\.)?$/i))return u["set"+l[i]](u["get"+l[i]]()+r);if("wee"===i)return u.setDate(u.getDate()+7*r);if("next"===t||"last"===t)n(t,i,r);else if(!s)return!1;return!0}var s,p,r,a,u,c,l,m,d,f,g,_=!1;if(!e)return _;if(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase(),p=e.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/),p&&p[2]===p[4])if(p[1]>1901)switch(p[2]){case"-":return p[3]>12||p[5]>31?_:new Date(p[1],parseInt(p[3],10)-1,p[5],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3;case".":return _;case"/":return p[3]>12||p[5]>31?_:new Date(p[1],parseInt(p[3],10)-1,p[5],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3}else if(p[5]>1901)switch(p[2]){case"-":return p[3]>12||p[1]>31?_:new Date(p[5],parseInt(p[3],10)-1,p[1],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3;case".":return p[3]>12||p[1]>31?_:new Date(p[5],parseInt(p[3],10)-1,p[1],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3;case"/":return p[1]>12||p[3]>31?_:new Date(p[5],parseInt(p[1],10)-1,p[3],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3}else switch(p[2]){case"-":return p[3]>12||p[5]>31||p[1]<70&&p[1]>38?_:(a=p[1]>=0&&p[1]<=38?+p[1]+2e3:p[1],new Date(a,parseInt(p[3],10)-1,p[5],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3);case".":return p[5]>=70?p[3]>12||p[1]>31?_:new Date(p[5],parseInt(p[3],10)-1,p[1],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3:p[5]<60&&!p[6]?p[1]>23||p[3]>59?_:(r=new Date,new Date(r.getFullYear(),r.getMonth(),r.getDate(),p[1]||0,p[3]||0,p[5]||0,p[9]||0)/1e3):_;case"/":return p[1]>12||p[3]>31||p[5]<70&&p[5]>38?_:(a=p[5]>=0&&p[5]<=38?+p[5]+2e3:p[5],new Date(a,parseInt(p[1],10)-1,p[3],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3);case":":return p[1]>23||p[3]>59||p[5]>59?_:(r=new Date,new Date(r.getFullYear(),r.getMonth(),r.getDate(),p[1]||0,p[3]||0,p[5]||0)/1e3)}if("now"===e)return null===o||isNaN(o)?(new Date).getTime()/1e3||0:o||0;if(s=Date.parse(e),!isNaN(s))return s/1e3||0;if(u=o?new Date(1e3*o):new Date,c={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},l={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},d="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",f="([+-]?\\d+\\s"+d+"|(last|next)\\s"+d+")(\\sago)?",p=e.match(new RegExp(f,"gi")),!p)return _;for(g=0,m=p.length;g<m;g+=1)if(!i(p[g]))return _;return u.getTime()/1e3},serializeObject:function(o){e.extend({},o);var t={},r=e.extend(!0,{include:[],exclude:[],includeByClass:""},o);return this.find(":input").each(function(){var o;!this.name||this.disabled||window.PUM.utilities.inArray(this.name,r.exclude)||r.include.length&&!window.PUM.utilities.inArray(this.name,r.include)||this.className.indexOf(r.includeByClass)===-1||(o=this.name.replace(p,"[$1").split("["),o[0]&&(this.checked||window.PUM.utilities.inArray(this.type,i)||window.PUM.utilities.inArray(this.nodeName.toLowerCase(),s))&&("checkbox"===this.type&&o.push(""),n(t,o,e(this).val())))}),t}},e.fn.pumSerializeObject=e.fn.popmake.utilities.serializeObject,e.fn.popmake.utilies=e.fn.popmake.utilities,window.PUM=window.PUM||{},window.PUM.utilities=window.PUM.utilities||{},window.PUM.utilities=e.extend(window.PUM.utilities,e.fn.popmake.utilities)}(jQuery,document),function(e,o,t){"use strict";e.fn.popmake.version=1.7,e.fn.popmake.last_open_popup=null,e(o).ready(function(){e(".pum").popmake(),e(o).trigger("pumInitialized"),"object"==typeof pum_vars.form_success&&(pum_vars.form_success=e.extend({popup_id:null,settings:{}}),PUM.forms.success(pum_vars.form_success.popup_id,pum_vars.form_success.settings))}),e(".pum").on("pumInit",function(){var e=PUM.getPopup(this),o=PUM.getSetting(e,"id"),t=e.find("form");t.length&&t.prepend('<input type="hidden" name="pum_form_popup_id" value="'+o+'" />')})}(jQuery);
!function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c<i.length;c++){if(d=i[c],!d.getAttribute("data-secret"))f=Math.random().toString(36).substr(2,10),d.src+="#?secret="+f,d.setAttribute("data-secret",f);if(g||h)a=d.cloneNode(!0),a.removeAttribute("security"),d.parentNode.replaceChild(a,d)}}}var d=!1,e=!1;if(b.querySelector)if(a.addEventListener)d=!0;if(a.wp=a.wp||{},!a.wp.receiveEmbedMessage)if(a.wp.receiveEmbedMessage=function(c){var d=c.data;if(d.secret||d.message||d.value)if(!/[^a-zA-Z0-9]/.test(d.secret)){var e,f,g,h,i,j=b.querySelectorAll('iframe[data-secret="'+d.secret+'"]'),k=b.querySelectorAll('blockquote[data-secret="'+d.secret+'"]');for(e=0;e<k.length;e++)k[e].style.display="none";for(e=0;e<j.length;e++)if(f=j[e],c.source===f.contentWindow){if(f.removeAttribute("style"),"height"===d.message){if(g=parseInt(d.value,10),g>1e3)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);