(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;bh;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;be;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a){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(){ var is_webkit=navigator.userAgent.toLowerCase().indexOf('webkit') > -1, is_opera=navigator.userAgent.toLowerCase().indexOf('opera') > -1, is_ie=navigator.userAgent.toLowerCase().indexOf('msie') > -1; if(( is_webkit||is_opera||is_ie)&&'undefined'!==typeof(document.getElementById)){ var eventMethod=(window.addEventListener) ? 'addEventListener':'attachEvent'; window[ eventMethod ]('hashchange', function(){ var element=document.getElementById(location.hash.substring(1)); if(element){ if(! /^(?:a|select|input|button|textarea)$/i.test(element.tagName)) element.tabIndex=-1; element.focus(); }}, false); }})(); if(typeof Object.create!=='function'){ Object.create=function(obj){ function F(){}; F.prototype=obj; return new F(); };} (function($, window, document, undefined){ var ElevateZoom={ init: function(options, elem){ var self=this; self.elem=elem; self.$elem=$(elem); self.imageSrc=self.$elem.data("zoom-image") ? self.$elem.data("zoom-image"):self.$elem.attr("src"); self.options=$.extend({}, $.fn.elevateZoom.options, options); if(self.options.tint){ self.options.lensColour="none", self.options.lensOpacity="1" } if(self.options.zoomType=="inner"){self.options.showLens=false;} self.$elem.parent().removeAttr('title').removeAttr('alt'); self.zoomImage=self.imageSrc; self.refresh(1); $('#'+self.options.gallery + ' a').click(function(e){ if(self.options.galleryActiveClass){ $('#'+self.options.gallery + ' a').removeClass(self.options.galleryActiveClass); $(this).addClass(self.options.galleryActiveClass); } e.preventDefault(); if($(this).data("zoom-image")){self.zoomImagePre=$(this).data("zoom-image")}else{self.zoomImagePre=$(this).data("image");} self.swaptheimage($(this).data("image"), self.zoomImagePre); return false; }); }, refresh: function(length){ var self=this; setTimeout(function(){ self.fetch(self.imageSrc); }, length||self.options.refresh); }, fetch: function(imgsrc){ var self=this; var newImg=new Image(); newImg.onload=function(){ self.largeWidth=newImg.width; self.largeHeight=newImg.height; self.startZoom(); self.currentImage=self.imageSrc; self.options.onZoomedImageLoaded(self.$elem); } newImg.src=imgsrc; return; }, startZoom: function(){ var self=this; self.nzWidth=self.$elem.width(); self.nzHeight=self.$elem.height(); self.isWindowActive=false; self.isLensActive=false; self.isTintActive=false; self.overWindow=false; if(self.options.imageCrossfade){ self.zoomWrap=self.$elem.wrap('
'); self.$elem.css('position', 'absolute'); } self.zoomLock=1; self.scrollingLock=false; self.changeBgSize=false; self.currentZoomLevel=self.options.zoomLevel; self.nzOffset=self.$elem.offset(); self.widthRatio=(self.largeWidth/self.currentZoomLevel) / self.nzWidth; self.heightRatio=(self.largeHeight/self.currentZoomLevel) / self.nzHeight; if(self.options.zoomType=="window"){ self.zoomWindowStyle="overflow: hidden;" + "background-position: 0px 0px;text-align:center;" + "background-color: " + String(self.options.zoomWindowBgColour) + ";width: " + String(self.options.zoomWindowWidth) + "px;" + "height: " + String(self.options.zoomWindowHeight) + "px;float: left;" + "background-size: "+ self.largeWidth/self.currentZoomLevel+ "px " +self.largeHeight/self.currentZoomLevel + "px;" + "display: none;z-index:100;" + "border: " + String(self.options.borderSize) + "px solid " + self.options.borderColour + ";background-repeat: no-repeat;" + "position: absolute;"; } if(self.options.zoomType=="inner"){ var borderWidth=self.$elem.css("border-left-width"); self.zoomWindowStyle="overflow: hidden;" + "margin-left: " + String(borderWidth) + ";" + "margin-top: " + String(borderWidth) + ";" + "background-position: 0px 0px;" + "width: " + String(self.nzWidth) + "px;" + "height: " + String(self.nzHeight) + "px;" + "px;float: left;" + "display: none;" + "cursor:"+(self.options.cursor)+";" + "px solid " + self.options.borderColour + ";background-repeat: no-repeat;" + "position: absolute;"; } if(self.options.zoomType=="window"){ if(self.nzHeight < self.options.zoomWindowWidth/self.widthRatio){ lensHeight=self.nzHeight; }else{ lensHeight=String((self.options.zoomWindowHeight/self.heightRatio)) } if(self.largeWidth < self.options.zoomWindowWidth){ lensWidth=self.nzWidth; }else{ lensWidth=(self.options.zoomWindowWidth/self.widthRatio); } self.lensStyle="background-position: 0px 0px;width: " + String((self.options.zoomWindowWidth)/self.widthRatio) + "px;height: " + String((self.options.zoomWindowHeight)/self.heightRatio) + "px;float: right;display: none;" + "overflow: hidden;" + "z-index: 999;" + "-webkit-transform: translateZ(0);" + "opacity:"+(self.options.lensOpacity)+";filter: alpha(opacity="+(self.options.lensOpacity*100)+"); zoom:1;" + "width:"+lensWidth+"px;" + "height:"+lensHeight+"px;" + "background-color:"+(self.options.lensColour)+";" + "cursor:"+(self.options.cursor)+";" + "border: "+(self.options.lensBorderSize)+"px" + " solid "+(self.options.lensBorderColour)+";background-repeat: no-repeat;position: absolute;"; } self.tintStyle="display: block;" + "position: absolute;" + "background-color: "+self.options.tintColour+";" + "filter:alpha(opacity=0);" + "opacity: 0;" + "width: " + self.nzWidth + "px;" + "height: " + self.nzHeight + "px;" ; self.lensRound=''; if(self.options.zoomType=="lens"){ self.lensStyle="background-position: 0px 0px;" + "float: left;display: none;" + "border: " + String(self.options.borderSize) + "px solid " + self.options.borderColour+";" + "width:"+ String(self.options.lensSize) +"px;" + "height:"+ String(self.options.lensSize)+"px;" + "background-repeat: no-repeat;position: absolute;"; } if(self.options.lensShape=="round"){ self.lensRound="border-top-left-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;" + "border-top-right-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;" + "border-bottom-left-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;" + "border-bottom-right-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;"; } self.zoomContainer=$('
'); $('body').append(self.zoomContainer); if(self.options.containLensZoom&&self.options.zoomType=="lens"){ self.zoomContainer.css("overflow", "hidden"); } if(self.options.zoomType!="inner"){ self.zoomLens=$("
 
") .appendTo(self.zoomContainer) .click(function (){ self.$elem.trigger('click'); }); if(self.options.tint){ self.tintContainer=$('
').addClass('tintContainer'); self.zoomTint=$("
"); self.zoomLens.wrap(self.tintContainer); self.zoomTintcss=self.zoomLens.after(self.zoomTint); self.zoomTintImage=$('') .appendTo(self.zoomLens) .click(function (){ self.$elem.trigger('click'); }); }} if(isNaN(self.options.zoomWindowPosition)){ self.zoomWindow=$("
 
") .appendTo('body') .click(function (){ self.$elem.trigger('click'); }); }else{ self.zoomWindow=$("
 
") .appendTo(self.zoomContainer) .click(function (){ self.$elem.trigger('click'); }); } self.zoomWindowContainer=$('
').addClass('zoomWindowContainer').css("width",self.options.zoomWindowWidth); self.zoomWindow.wrap(self.zoomWindowContainer); if(self.options.zoomType=="lens"){ self.zoomLens.css({ backgroundImage: "url('" + self.imageSrc + "')" }); } if(self.options.zoomType=="window"){ self.zoomWindow.css({ backgroundImage: "url('" + self.imageSrc + "')" }); } if(self.options.zoomType=="inner"){ self.zoomWindow.css({ backgroundImage: "url('" + self.imageSrc + "')" }); } self.$elem.bind('touchmove', function(e){ e.preventDefault(); var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0]; self.setPosition(touch); }); self.zoomContainer.bind('touchmove', function(e){ if(self.options.zoomType=="inner"){ self.showHideWindow("show"); } e.preventDefault(); var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0]; self.setPosition(touch); }); self.zoomContainer.bind('touchend', function(e){ self.showHideWindow("hide"); if(self.options.showLens){self.showHideLens("hide");} if(self.options.tint&&self.options.zoomType!="inner"){self.showHideTint("hide");}}); self.$elem.bind('touchend', function(e){ self.showHideWindow("hide"); if(self.options.showLens){self.showHideLens("hide");} if(self.options.tint&&self.options.zoomType!="inner"){self.showHideTint("hide");}}); if(self.options.showLens){ self.zoomLens.bind('touchmove', function(e){ e.preventDefault(); var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0]; self.setPosition(touch); }); self.zoomLens.bind('touchend', function(e){ self.showHideWindow("hide"); if(self.options.showLens){self.showHideLens("hide");} if(self.options.tint&&self.options.zoomType!="inner"){self.showHideTint("hide");}}); } self.$elem.bind('mousemove', function(e){ if(self.overWindow==false){self.setElements("show");} if(self.lastX!==e.clientX||self.lastY!==e.clientY){ self.setPosition(e); self.currentLoc=e; } self.lastX=e.clientX; self.lastY=e.clientY; }); self.zoomContainer.bind('mousemove', function(e){ if(self.overWindow==false){self.setElements("show");} if(self.lastX!==e.clientX||self.lastY!==e.clientY){ self.setPosition(e); self.currentLoc=e; } self.lastX=e.clientX; self.lastY=e.clientY; }); if(self.options.zoomType!="inner"){ self.zoomLens.bind('mousemove', function(e){ if(self.lastX!==e.clientX||self.lastY!==e.clientY){ self.setPosition(e); self.currentLoc=e; } self.lastX=e.clientX; self.lastY=e.clientY; }); } if(self.options.tint&&self.options.zoomType!="inner"){ self.zoomTint.bind('mousemove', function(e){ if(self.lastX!==e.clientX||self.lastY!==e.clientY){ self.setPosition(e); self.currentLoc=e; } self.lastX=e.clientX; self.lastY=e.clientY; }); } if(self.options.zoomType=="inner"){ self.zoomWindow.bind('mousemove', function(e){ if(self.lastX!==e.clientX||self.lastY!==e.clientY){ self.setPosition(e); self.currentLoc=e; } self.lastX=e.clientX; self.lastY=e.clientY; }); } self.zoomContainer.add(self.$elem).mouseenter(function(){ if(self.overWindow==false){self.setElements("show");}}).mouseleave(function(){ if(!self.scrollLock){ self.setElements("hide"); self.options.onDestroy(self.$elem); }}); if(self.options.zoomType!="inner"){ self.zoomWindow.mouseenter(function(){ self.overWindow=true; self.setElements("hide"); }).mouseleave(function(){ self.overWindow=false; }); } if(self.options.zoomLevel!=1){ } if(self.options.minZoomLevel){ self.minZoomLevel=self.options.minZoomLevel; }else{ self.minZoomLevel=self.options.scrollZoomIncrement * 2; } if(self.options.scrollZoom){ self.zoomContainer.add(self.$elem).bind('mousewheel DOMMouseScroll MozMousePixelScroll', function(e){ self.scrollLock=true; clearTimeout($.data(this, 'timer')); $.data(this, 'timer', setTimeout(function(){ self.scrollLock=false; }, 250)); var theEvent=e.originalEvent.wheelDelta||e.originalEvent.detail*-1 e.stopImmediatePropagation(); e.stopPropagation(); e.preventDefault(); if(theEvent /120 > 0){ if(self.currentZoomLevel >=self.minZoomLevel){ self.changeZoomLevel(self.currentZoomLevel-self.options.scrollZoomIncrement); }}else{ if(self.options.maxZoomLevel){ if(self.currentZoomLevel <=self.options.maxZoomLevel){ self.changeZoomLevel(parseFloat(self.currentZoomLevel)+self.options.scrollZoomIncrement); }}else{ self.changeZoomLevel(parseFloat(self.currentZoomLevel)+self.options.scrollZoomIncrement); }} return false; }); }}, setElements: function(type){ var self=this; if(!self.options.zoomEnabled){return false;} if(type=="show"){ if(self.isWindowSet){ if(self.options.zoomType=="inner"){self.showHideWindow("show");} if(self.options.zoomType=="window"){self.showHideWindow("show");} if(self.options.showLens){self.showHideLens("show");} if(self.options.tint&&self.options.zoomType!="inner"){self.showHideTint("show"); }} } if(type=="hide"){ if(self.options.zoomType=="window"){self.showHideWindow("hide");} if(!self.options.tint){self.showHideWindow("hide");} if(self.options.showLens){self.showHideLens("hide");} if(self.options.tint){ self.showHideTint("hide");}} }, setPosition: function(e){ var self=this; if(!self.options.zoomEnabled){return false;} self.nzHeight=self.$elem.height(); self.nzWidth=self.$elem.width(); self.nzOffset=self.$elem.offset(); if(self.options.tint&&self.options.zoomType!="inner"){ self.zoomTint.css({ top: 0}); self.zoomTint.css({ left: 0}); } if(self.options.responsive&&!self.options.scrollZoom){ if(self.options.showLens){ if(self.nzHeight < self.options.zoomWindowWidth/self.widthRatio){ lensHeight=self.nzHeight; }else{ lensHeight=String((self.options.zoomWindowHeight/self.heightRatio)) } if(self.largeWidth < self.options.zoomWindowWidth){ lensWidth=self.nzWidth; }else{ lensWidth=(self.options.zoomWindowWidth/self.widthRatio); } self.widthRatio=self.largeWidth / self.nzWidth; self.heightRatio=self.largeHeight / self.nzHeight; if(self.options.zoomType!="lens"){ if(self.nzHeight < self.options.zoomWindowWidth/self.widthRatio){ lensHeight=self.nzHeight; }else{ lensHeight=String((self.options.zoomWindowHeight/self.heightRatio)) } if(self.nzWidth < self.options.zoomWindowHeight/self.heightRatio){ lensWidth=self.nzWidth; }else{ lensWidth=String((self.options.zoomWindowWidth/self.widthRatio)); } self.zoomLens.css('width', lensWidth); self.zoomLens.css('height', lensHeight); if(self.options.tint){ self.zoomTintImage.css('width', self.nzWidth); self.zoomTintImage.css('height', self.nzHeight); }} if(self.options.zoomType=="lens"){ self.zoomLens.css({ width: String(self.options.lensSize) + 'px', height: String(self.options.lensSize) + 'px' }) }} } self.zoomContainer.css({ top: self.nzOffset.top}); self.zoomContainer.css({ left: self.nzOffset.left}); self.mouseLeft=parseInt(e.pageX - self.nzOffset.left); self.mouseTop=parseInt(e.pageY - self.nzOffset.top); if(self.options.zoomType=="window"){ self.Etoppos=(self.mouseTop < (self.zoomLens.height()/2)); self.Eboppos=(self.mouseTop > self.nzHeight - (self.zoomLens.height()/2)-(self.options.lensBorderSize*2)); self.Eloppos=(self.mouseLeft < 0+((self.zoomLens.width()/2))); self.Eroppos=(self.mouseLeft > (self.nzWidth - (self.zoomLens.width()/2)-(self.options.lensBorderSize*2))); } if(self.options.zoomType=="inner"){ self.Etoppos=(self.mouseTop < ((self.nzHeight/2)/self.heightRatio)); self.Eboppos=(self.mouseTop > (self.nzHeight - ((self.nzHeight/2)/self.heightRatio))); self.Eloppos=(self.mouseLeft < 0+(((self.nzWidth/2)/self.widthRatio))); self.Eroppos=(self.mouseLeft > (self.nzWidth - (self.nzWidth/2)/self.widthRatio-(self.options.lensBorderSize*2))); } if(self.mouseLeft < 0||self.mouseTop < 0||self.mouseLeft > self.nzWidth||self.mouseTop > self.nzHeight){ self.setElements("hide"); return; }else{ if(self.options.showLens){ self.lensLeftPos=String(Math.floor(self.mouseLeft - self.zoomLens.width() / 2)); self.lensTopPos=String(Math.floor(self.mouseTop - self.zoomLens.height() / 2)); } if(self.Etoppos){ self.lensTopPos=0; } if(self.Eloppos){ self.windowLeftPos=0; self.lensLeftPos=0; self.tintpos=0; } if(self.options.zoomType=="window"){ if(self.Eboppos){ self.lensTopPos=Math.max((self.nzHeight)-self.zoomLens.height()-(self.options.lensBorderSize*2), 0); } if(self.Eroppos){ self.lensLeftPos=(self.nzWidth-(self.zoomLens.width())-(self.options.lensBorderSize*2)); }} if(self.options.zoomType=="inner"){ if(self.Eboppos){ self.lensTopPos=Math.max(((self.nzHeight)-(self.options.lensBorderSize*2)), 0); } if(self.Eroppos){ self.lensLeftPos=(self.nzWidth-(self.nzWidth)-(self.options.lensBorderSize*2)); }} if(self.options.zoomType=="lens"){ self.windowLeftPos=String(((e.pageX - self.nzOffset.left) * self.widthRatio - self.zoomLens.width() / 2) * (-1)); self.windowTopPos=String(((e.pageY - self.nzOffset.top) * self.heightRatio - self.zoomLens.height() / 2) * (-1)); self.zoomLens.css({ backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px' }); if(self.changeBgSize){ if(self.nzHeight>self.nzWidth){ if(self.options.zoomType=="lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); }else{ if(self.options.zoomType=="lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } self.changeBgSize=false; } self.setWindowPostition(e); } if(self.options.tint&&self.options.zoomType!="inner"){ self.setTintPosition(e); } if(self.options.zoomType=="window"){ self.setWindowPostition(e); } if(self.options.zoomType=="inner"){ self.setWindowPostition(e); } if(self.options.showLens){ if(self.fullwidth&&self.options.zoomType!="lens"){ self.lensLeftPos=0; } self.zoomLens.css({ left: self.lensLeftPos + 'px', top: self.lensTopPos + 'px' }) }} }, showHideWindow: function(change){ var self=this; if(change=="show"){ if(!self.isWindowActive){ if(self.options.zoomWindowFadeIn){ self.zoomWindow.stop(true, true, false).fadeIn(self.options.zoomWindowFadeIn); }else{self.zoomWindow.show();} self.isWindowActive=true; }} if(change=="hide"){ if(self.isWindowActive){ if(self.options.zoomWindowFadeOut){ self.zoomWindow.stop(true, true).fadeOut(self.options.zoomWindowFadeOut, function (){ if(self.loop){ clearInterval(self.loop); self.loop=false; }}); }else{self.zoomWindow.hide();} self.isWindowActive=false; }} }, showHideLens: function(change){ var self=this; if(change=="show"){ if(!self.isLensActive){ if(self.options.lensFadeIn){ self.zoomLens.stop(true, true, false).fadeIn(self.options.lensFadeIn); }else{self.zoomLens.show();} self.isLensActive=true; }} if(change=="hide"){ if(self.isLensActive){ if(self.options.lensFadeOut){ self.zoomLens.stop(true, true).fadeOut(self.options.lensFadeOut); }else{self.zoomLens.hide();} self.isLensActive=false; }} }, showHideTint: function(change){ var self=this; if(change=="show"){ if(!self.isTintActive){ if(self.options.zoomTintFadeIn){ self.zoomTint.css({opacity:self.options.tintOpacity}).animate().stop(true, true).fadeIn("slow"); }else{ self.zoomTint.css({opacity:self.options.tintOpacity}).animate(); self.zoomTint.show(); } self.isTintActive=true; }} if(change=="hide"){ if(self.isTintActive){ if(self.options.zoomTintFadeOut){ self.zoomTint.stop(true, true).fadeOut(self.options.zoomTintFadeOut); }else{self.zoomTint.hide();} self.isTintActive=false; }} }, setLensPostition: function(e){ }, setWindowPostition: function(e){ var self=this; if(!isNaN(self.options.zoomWindowPosition)){ switch (self.options.zoomWindowPosition){ case 1: self.windowOffsetTop=(self.options.zoomWindowOffety); self.windowOffsetLeft=(+self.nzWidth); break; case 2: if(self.options.zoomWindowHeight > self.nzHeight){ self.windowOffsetTop=((self.options.zoomWindowHeight/2)-(self.nzHeight/2))*(-1); self.windowOffsetLeft=(self.nzWidth); }else{ } break; case 3: self.windowOffsetTop=(self.nzHeight - self.zoomWindow.height() - (self.options.borderSize*2)); self.windowOffsetLeft=(self.nzWidth); break; case 4: self.windowOffsetTop=(self.nzHeight); self.windowOffsetLeft=(self.nzWidth); break; case 5: self.windowOffsetTop=(self.nzHeight); self.windowOffsetLeft=(self.nzWidth-self.zoomWindow.width()-(self.options.borderSize*2)); break; case 6: if(self.options.zoomWindowHeight > self.nzHeight){ self.windowOffsetTop=(self.nzHeight); self.windowOffsetLeft=((self.options.zoomWindowWidth/2)-(self.nzWidth/2)+(self.options.borderSize*2))*(-1); }else{ } break; case 7: self.windowOffsetTop=(self.nzHeight); self.windowOffsetLeft=0; break; case 8: self.windowOffsetTop=(self.nzHeight); self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))* (-1); break; case 9: self.windowOffsetTop=(self.nzHeight - self.zoomWindow.height() - (self.options.borderSize*2)); self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))* (-1); break; case 10: if(self.options.zoomWindowHeight > self.nzHeight){ self.windowOffsetTop=((self.options.zoomWindowHeight/2)-(self.nzHeight/2))*(-1); self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))* (-1); }else{ } break; case 11: self.windowOffsetTop=(self.options.zoomWindowOffety); self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))* (-1); break; case 12: self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1); self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))* (-1); break; case 13: self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1); self.windowOffsetLeft=(0); break; case 14: if(self.options.zoomWindowHeight > self.nzHeight){ self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1); self.windowOffsetLeft=((self.options.zoomWindowWidth/2)-(self.nzWidth/2)+(self.options.borderSize*2))*(-1); }else{ } break; case 15: self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1); self.windowOffsetLeft=(self.nzWidth-self.zoomWindow.width()-(self.options.borderSize*2)); break; case 16: self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1); self.windowOffsetLeft=(self.nzWidth); break; default: self.windowOffsetTop=(self.options.zoomWindowOffety); self.windowOffsetLeft=(self.nzWidth); }}else{ self.externalContainer=$('#'+self.options.zoomWindowPosition); self.externalContainerWidth=self.externalContainer.width(); self.externalContainerHeight=self.externalContainer.height(); self.externalContainerOffset=self.externalContainer.offset(); self.windowOffsetTop=self.externalContainerOffset.top; self.windowOffsetLeft=self.externalContainerOffset.left; } self.isWindowSet=true; self.windowOffsetTop=self.windowOffsetTop + self.options.zoomWindowOffety; self.windowOffsetLeft=self.windowOffsetLeft + self.options.zoomWindowOffetx; self.zoomWindow.css({ top: self.windowOffsetTop}); self.zoomWindow.css({ left: self.windowOffsetLeft}); if(self.options.zoomType=="inner"){ self.zoomWindow.css({ top: 0}); self.zoomWindow.css({ left: 0}); } self.windowLeftPos=String(((e.pageX - self.nzOffset.left) * self.widthRatio - self.zoomWindow.width() / 2) * (-1)); self.windowTopPos=String(((e.pageY - self.nzOffset.top) * self.heightRatio - self.zoomWindow.height() / 2) * (-1)); if(self.Etoppos){self.windowTopPos=0;} if(self.Eloppos){self.windowLeftPos=0;} if(self.Eboppos){self.windowTopPos=(self.largeHeight/self.currentZoomLevel-self.zoomWindow.height())*(-1); } if(self.Eroppos){self.windowLeftPos=((self.largeWidth/self.currentZoomLevel-self.zoomWindow.width())*(-1));} if(self.fullheight){ self.windowTopPos=0; } if(self.fullwidth){ self.windowLeftPos=0; } if(self.options.zoomType=="window"||self.options.zoomType=="inner"){ if(self.zoomLock==1){ if(self.widthRatio <=1){ self.windowLeftPos=0; } if(self.heightRatio <=1){ self.windowTopPos=0; }} if(self.options.zoomType=="window"){ if(self.largeHeight < self.options.zoomWindowHeight){ self.windowTopPos=0; } if(self.largeWidth < self.options.zoomWindowWidth){ self.windowLeftPos=0; }} if(self.options.easing){ if(!self.xp){self.xp=0;} if(!self.yp){self.yp=0;} if(!self.loop){ self.loop=setInterval(function(){ self.xp +=(self.windowLeftPos - self.xp) / self.options.easingAmount; self.yp +=(self.windowTopPos - self.yp) / self.options.easingAmount; if(self.scrollingLock){ clearInterval(self.loop); self.xp=self.windowLeftPos; self.yp=self.windowTopPos self.xp=((e.pageX - self.nzOffset.left) * self.widthRatio - self.zoomWindow.width() / 2) * (-1); self.yp=(((e.pageY - self.nzOffset.top) * self.heightRatio - self.zoomWindow.height() / 2) * (-1)); if(self.changeBgSize){ if(self.nzHeight>self.nzWidth){ if(self.options.zoomType=="lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); }else{ if(self.options.zoomType!="lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } /* if(!self.bgxp){self.bgxp=self.largeWidth/self.newvalue;} if(!self.bgyp){self.bgyp=self.largeHeight/self.newvalue ;} if(!self.bgloop){ self.bgloop=setInterval(function(){ self.bgxp +=(self.largeWidth/self.newvalue - self.bgxp) / self.options.easingAmount; self.bgyp +=(self.largeHeight/self.newvalue - self.bgyp) / self.options.easingAmount; self.zoomWindow.css({ "background-size": self.bgxp + 'px ' + self.bgyp + 'px' }); }, 16); } */ self.changeBgSize=false; } self.zoomWindow.css({ backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px' }); self.scrollingLock=false; self.loop=false; } else if(Math.round(Math.abs(self.xp - self.windowLeftPos) + Math.abs(self.yp - self.windowTopPos)) < 1){ clearInterval(self.loop); self.zoomWindow.css({ backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px' }); self.loop=false; }else{ if(self.changeBgSize){ if(self.nzHeight>self.nzWidth){ if(self.options.zoomType=="lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); }else{ if(self.options.zoomType!="lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } self.changeBgSize=false; } self.zoomWindow.css({ backgroundPosition: self.xp + 'px ' + self.yp + 'px' }); }}, 16); }}else{ if(self.changeBgSize){ if(self.nzHeight>self.nzWidth){ if(self.options.zoomType=="lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); }else{ if(self.options.zoomType=="lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } if((self.largeHeight/self.newvaluewidth) < self.options.zoomWindowHeight){ self.zoomWindow.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); }else{ self.zoomWindow.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); }} self.changeBgSize=false; } self.zoomWindow.css({ backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px' }); }} }, setTintPosition: function(e){ var self=this; self.nzOffset=self.$elem.offset(); self.tintpos=String(((e.pageX - self.nzOffset.left)-(self.zoomLens.width() / 2)) * (-1)); self.tintposy=String(((e.pageY - self.nzOffset.top) - self.zoomLens.height() / 2) * (-1)); if(self.Etoppos){ self.tintposy=0; } if(self.Eloppos){ self.tintpos=0; } if(self.Eboppos){ self.tintposy=(self.nzHeight-self.zoomLens.height()-(self.options.lensBorderSize*2))*(-1); } if(self.Eroppos){ self.tintpos=((self.nzWidth-self.zoomLens.width()-(self.options.lensBorderSize*2))*(-1)); } if(self.options.tint){ if(self.fullheight){ self.tintposy=0; } if(self.fullwidth){ self.tintpos=0; } self.zoomTintImage.css({'left': self.tintpos+'px'}); self.zoomTintImage.css({'top': self.tintposy+'px'}); }}, swaptheimage: function(smallimage, largeimage){ var self=this; var newImg=new Image(); if(self.options.loadingIcon){ self.spinner=$('
'); self.$elem.after(self.spinner); } self.options.onImageSwap(self.$elem); newImg.onload=function(){ self.largeWidth=newImg.width; self.largeHeight=newImg.height; self.zoomImage=largeimage; self.zoomWindow.css({ "background-size": self.largeWidth + 'px ' + self.largeHeight + 'px' }); self.swapAction(smallimage, largeimage); return; } newImg.src=largeimage; }, swapAction: function(smallimage, largeimage){ var self=this; var newImg2=new Image(); newImg2.onload=function(){ self.nzHeight=newImg2.height; self.nzWidth=newImg2.width; self.options.onImageSwapComplete(self.$elem); self.doneCallback(); return; } newImg2.src=smallimage; self.currentZoomLevel=self.options.zoomLevel; self.options.maxZoomLevel=false; if(self.options.zoomType=="lens"){ self.zoomLens.css({ backgroundImage: "url('" + largeimage + "')" }); } if(self.options.zoomType=="window"){ self.zoomWindow.css({ backgroundImage: "url('" + largeimage + "')" }); } if(self.options.zoomType=="inner"){ self.zoomWindow.css({ backgroundImage: "url('" + largeimage + "')" }); } self.currentImage=largeimage; if(self.options.imageCrossfade){ var oldImg=self.$elem; var newImg=oldImg.clone(); self.$elem.attr("src",smallimage) self.$elem.after(newImg); newImg.stop(true).fadeOut(self.options.imageCrossfade, function(){ $(this).remove(); }); self.$elem.width("auto").removeAttr("width"); self.$elem.height("auto").removeAttr("height"); oldImg.fadeIn(self.options.imageCrossfade); if(self.options.tint&&self.options.zoomType!="inner"){ var oldImgTint=self.zoomTintImage; var newImgTint=oldImgTint.clone(); self.zoomTintImage.attr("src",largeimage) self.zoomTintImage.after(newImgTint); newImgTint.stop(true).fadeOut(self.options.imageCrossfade, function(){ $(this).remove(); }); oldImgTint.fadeIn(self.options.imageCrossfade); self.zoomTint.css({ height: self.$elem.height()}); self.zoomTint.css({ width: self.$elem.width()}); } self.zoomContainer.css("height", self.$elem.height()); self.zoomContainer.css("width", self.$elem.width()); if(self.options.zoomType=="inner"){ if(!self.options.constrainType){ self.zoomWrap.parent().css("height", self.$elem.height()); self.zoomWrap.parent().css("width", self.$elem.width()); self.zoomWindow.css("height", self.$elem.height()); self.zoomWindow.css("width", self.$elem.width()); }} if(self.options.imageCrossfade){ self.zoomWrap.css("height", self.$elem.height()); self.zoomWrap.css("width", self.$elem.width()); }}else{ self.$elem.attr("src",smallimage); if(self.options.tint){ self.zoomTintImage.attr("src",largeimage); self.zoomTintImage.attr("height",self.$elem.height()); self.zoomTintImage.css({ height: self.$elem.height()}); self.zoomTint.css({ height: self.$elem.height()}); } self.zoomContainer.css("height", self.$elem.height()); self.zoomContainer.css("width", self.$elem.width()); if(self.options.imageCrossfade){ self.zoomWrap.css("height", self.$elem.height()); self.zoomWrap.css("width", self.$elem.width()); }} if(self.options.constrainType){ if(self.options.constrainType=="height"){ self.zoomContainer.css("height", self.options.constrainSize); self.zoomContainer.css("width", "auto"); if(self.options.imageCrossfade){ self.zoomWrap.css("height", self.options.constrainSize); self.zoomWrap.css("width", "auto"); self.constwidth=self.zoomWrap.width(); }else{ self.$elem.css("height", self.options.constrainSize); self.$elem.css("width", "auto"); self.constwidth=self.$elem.width(); } if(self.options.zoomType=="inner"){ self.zoomWrap.parent().css("height", self.options.constrainSize); self.zoomWrap.parent().css("width", self.constwidth); self.zoomWindow.css("height", self.options.constrainSize); self.zoomWindow.css("width", self.constwidth); } if(self.options.tint){ self.tintContainer.css("height", self.options.constrainSize); self.tintContainer.css("width", self.constwidth); self.zoomTint.css("height", self.options.constrainSize); self.zoomTint.css("width", self.constwidth); self.zoomTintImage.css("height", self.options.constrainSize); self.zoomTintImage.css("width", self.constwidth); }} if(self.options.constrainType=="width"){ self.zoomContainer.css("height", "auto"); self.zoomContainer.css("width", self.options.constrainSize); if(self.options.imageCrossfade){ self.zoomWrap.css("height", "auto"); self.zoomWrap.css("width", self.options.constrainSize); self.constheight=self.zoomWrap.height(); }else{ self.$elem.css("height", "auto"); self.$elem.css("width", self.options.constrainSize); self.constheight=self.$elem.height(); } if(self.options.zoomType=="inner"){ self.zoomWrap.parent().css("height", self.constheight); self.zoomWrap.parent().css("width", self.options.constrainSize); self.zoomWindow.css("height", self.constheight); self.zoomWindow.css("width", self.options.constrainSize); } if(self.options.tint){ self.tintContainer.css("height", self.constheight); self.tintContainer.css("width", self.options.constrainSize); self.zoomTint.css("height", self.constheight); self.zoomTint.css("width", self.options.constrainSize); self.zoomTintImage.css("height", self.constheight); self.zoomTintImage.css("width", self.options.constrainSize); }} }}, doneCallback: function(){ var self=this; if(self.options.loadingIcon){ self.spinner.hide(); } self.nzOffset=self.$elem.offset(); self.nzWidth=self.$elem.width(); self.nzHeight=self.$elem.height(); self.currentZoomLevel=self.options.zoomLevel; self.widthRatio=self.largeWidth / self.nzWidth; self.heightRatio=self.largeHeight / self.nzHeight; if(self.options.zoomType=="window"){ if(self.nzHeight < self.options.zoomWindowWidth/self.widthRatio){ lensHeight=self.nzHeight; }else{ lensHeight=String((self.options.zoomWindowHeight/self.heightRatio)) } if(self.options.zoomWindowWidth < self.options.zoomWindowWidth){ lensWidth=self.nzWidth; }else{ lensWidth=(self.options.zoomWindowWidth/self.widthRatio); } if(self.zoomLens){ self.zoomLens.css('width', lensWidth); self.zoomLens.css('height', lensHeight); }} }, getCurrentImage: function(){ var self=this; return self.zoomImage; }, getGalleryList: function(){ var self=this; self.gallerylist=[]; if(self.options.gallery){ $('#'+self.options.gallery + ' a').each(function(){ var img_src=''; if($(this).data("zoom-image")){ img_src=$(this).data("zoom-image"); } else if($(this).data("image")){ img_src=$(this).data("image"); } if(img_src==self.zoomImage){ self.gallerylist.unshift({ href: ''+img_src+'', title: $(this).find('img').attr("title") }); }else{ self.gallerylist.push({ href: ''+img_src+'', title: $(this).find('img').attr("title") }); }}); }else{ self.gallerylist.push({ href: ''+self.zoomImage+'', title: $(this).find('img').attr("title") }); } return self.gallerylist; }, changeZoomLevel: function(value){ var self=this; self.scrollingLock=true; self.newvalue=parseFloat(value).toFixed(2); newvalue=parseFloat(value).toFixed(2); maxheightnewvalue=self.largeHeight/((self.options.zoomWindowHeight / self.nzHeight) * self.nzHeight); maxwidthtnewvalue=self.largeWidth/((self.options.zoomWindowWidth / self.nzWidth) * self.nzWidth); if(self.options.zoomType!="inner"){ if(maxheightnewvalue <=newvalue){ self.heightRatio=(self.largeHeight/maxheightnewvalue) / self.nzHeight; self.newvalueheight=maxheightnewvalue; self.fullheight=true; }else{ self.heightRatio=(self.largeHeight/newvalue) / self.nzHeight; self.newvalueheight=newvalue; self.fullheight=false; } if(maxwidthtnewvalue <=newvalue){ self.widthRatio=(self.largeWidth/maxwidthtnewvalue) / self.nzWidth; self.newvaluewidth=maxwidthtnewvalue; self.fullwidth=true; }else{ self.widthRatio=(self.largeWidth/newvalue) / self.nzWidth; self.newvaluewidth=newvalue; self.fullwidth=false; } if(self.options.zoomType=="lens"){ if(maxheightnewvalue <=newvalue){ self.fullwidth=true; self.newvaluewidth=maxheightnewvalue; }else{ self.widthRatio=(self.largeWidth/newvalue) / self.nzWidth; self.newvaluewidth=newvalue; self.fullwidth=false; }}} if(self.options.zoomType=="inner"){ maxheightnewvalue=parseFloat(self.largeHeight/self.nzHeight).toFixed(2); maxwidthtnewvalue=parseFloat(self.largeWidth/self.nzWidth).toFixed(2); if(newvalue > maxheightnewvalue){ newvalue=maxheightnewvalue; } if(newvalue > maxwidthtnewvalue){ newvalue=maxwidthtnewvalue; } if(maxheightnewvalue <=newvalue){ self.heightRatio=(self.largeHeight/newvalue) / self.nzHeight; if(newvalue > maxheightnewvalue){ self.newvalueheight=maxheightnewvalue; }else{ self.newvalueheight=newvalue; } self.fullheight=true; }else{ self.heightRatio=(self.largeHeight/newvalue) / self.nzHeight; if(newvalue > maxheightnewvalue){ self.newvalueheight=maxheightnewvalue; }else{ self.newvalueheight=newvalue; } self.fullheight=false; } if(maxwidthtnewvalue <=newvalue){ self.widthRatio=(self.largeWidth/newvalue) / self.nzWidth; if(newvalue > maxwidthtnewvalue){ self.newvaluewidth=maxwidthtnewvalue; }else{ self.newvaluewidth=newvalue; } self.fullwidth=true; }else{ self.widthRatio=(self.largeWidth/newvalue) / self.nzWidth; self.newvaluewidth=newvalue; self.fullwidth=false; }} scrcontinue=false; if(self.options.zoomType=="inner"){ if(self.nzWidth >=self.nzHeight){ if(self.newvaluewidth <=maxwidthtnewvalue){ scrcontinue=true; }else{ scrcontinue=false; self.fullheight=true; self.fullwidth=true; }} if(self.nzHeight > self.nzWidth){ if(self.newvaluewidth <=maxwidthtnewvalue){ scrcontinue=true; }else{ scrcontinue=false; self.fullheight=true; self.fullwidth=true; }} } if(self.options.zoomType!="inner"){ scrcontinue=true; } if(scrcontinue){ self.zoomLock=0; self.changeZoom=true; if(((self.options.zoomWindowHeight)/self.heightRatio) <=self.nzHeight){ self.currentZoomLevel=self.newvalueheight; if(self.options.zoomType!="lens"&&self.options.zoomType!="inner"){ self.changeBgSize=true; self.zoomLens.css({height: String((self.options.zoomWindowHeight)/self.heightRatio) + 'px' }) } if(self.options.zoomType=="lens"||self.options.zoomType=="inner"){ self.changeBgSize=true; }} if((self.options.zoomWindowWidth/self.widthRatio) <=self.nzWidth){ if(self.options.zoomType!="inner"){ if(self.newvaluewidth > self.newvalueheight){ self.currentZoomLevel=self.newvaluewidth; }} if(self.options.zoomType!="lens"&&self.options.zoomType!="inner"){ self.changeBgSize=true; self.zoomLens.css({width: String((self.options.zoomWindowWidth)/self.widthRatio) + 'px' }) } if(self.options.zoomType=="lens"||self.options.zoomType=="inner"){ self.changeBgSize=true; }} if(self.options.zoomType=="inner"){ self.changeBgSize=true; if(self.nzWidth > self.nzHeight){ self.currentZoomLevel=self.newvaluewidth; } if(self.nzHeight > self.nzWidth){ self.currentZoomLevel=self.newvaluewidth; }} } self.setPosition(self.currentLoc); }, closeAll: function(){ if(self.zoomWindow){self.zoomWindow.hide();} if(self.zoomLens){self.zoomLens.hide();} if(self.zoomTint){self.zoomTint.hide();}}, changeState: function(value){ var self=this; if(value=='enable'){self.options.zoomEnabled=true;} if(value=='disable'){self.options.zoomEnabled=false;}} }; $.fn.elevateZoom=function(options){ return this.each(function(){ var elevate=Object.create(ElevateZoom); elevate.init(options, this); $.data(this, 'elevateZoom', elevate); }); }; $.fn.elevateZoom.options={ zoomActivation: "hover", zoomEnabled: true, preloading: 1, zoomLevel: 1, scrollZoom: false, scrollZoomIncrement: 0.1, minZoomLevel: false, maxZoomLevel: false, easing: false, easingAmount: 12, lensSize: 200, zoomWindowWidth: 400, zoomWindowHeight: 400, zoomWindowOffetx: 0, zoomWindowOffety: 0, zoomWindowPosition: 1, zoomWindowBgColour: "#fff", lensFadeIn: false, lensFadeOut: false, debug: false, zoomWindowFadeIn: false, zoomWindowFadeOut: false, zoomWindowAlwaysShow: false, zoomTintFadeIn: false, zoomTintFadeOut: false, borderSize: 4, showLens: true, borderColour: "#888", lensBorderSize: 1, lensBorderColour: "#000", lensShape: "square", zoomType: "window", containLensZoom: false, lensColour: "white", lensOpacity: 0.4, lenszoom: false, tint: false, tintColour: "#333", tintOpacity: 0.4, gallery: false, galleryActiveClass: "zoomGalleryActive", imageCrossfade: false, constrainType: false, constrainSize: false, loadingIcon: false, cursor:"default", responsive:true, onComplete: $.noop, onDestroy: function(){}, onZoomedImageLoaded: function(){}, onImageSwap: $.noop, onImageSwapComplete: $.noop };})(jQuery, window, document); jQuery(document).ready(function($){ $(".parent_category > a").on('click',function(){ if($(this).hasClass("active")){ $(this).removeClass("active"); $(this).next().hide(); return false; }else{ $(this).addClass("active"); $(this).next().show(); return false; };}); $("a").bind("focus",function(){if(this.blur)this.blur();}); $("a.target_blank").attr("target","_blank"); $(".styled_post_list1 > li:last-child").addClass("last"); $('.footer_widget:nth-child(3n)').addClass('right_widget'); $('#global_menu > ul > li:nth-child(9)').addClass('hide_menu'); $('#global_menu > ul > li:nth-child(10)').addClass('hide_menu'); $('#global_menu > ul > li:nth-child(11)').addClass('hide_menu'); $('#global_menu > ul > li:nth-child(12)').addClass('hide_menu'); jQuery.easing.easeOutExpo=function (x, t, b, c, d){ return (t==d) ? b+c:c * (-Math.pow(2, -10 * t/d) + 1) + b; }; var topBtn=$('#return_top'); topBtn.hide(); $(window).scroll(function (){ if($(this).scrollTop() > 100){ topBtn.fadeIn(); }else{ topBtn.fadeOut(); }}); topBtn.click(function (){ $('body,html').animate({ scrollTop: 0 }, 1000, 'easeOutExpo'); return false; }); $("#comment_area ol > li:even").addClass("even_comment"); $("#comment_area ol > li:odd").addClass("odd_comment"); $(".even_comment > .children > li").addClass("even_comment_children"); $(".odd_comment > .children > li").addClass("odd_comment_children"); $(".even_comment_children > .children > li").addClass("odd_comment_children"); $(".odd_comment_children > .children > li").addClass("even_comment_children"); $(".even_comment_children > .children > li").addClass("odd_comment_children"); $(".odd_comment_children > .children > li").addClass("even_comment_children"); $("#trackback_switch").click(function(){ $("#comment_switch").removeClass("comment_switch_active"); $(this).addClass("comment_switch_active"); $("#comment_area").animate({opacity: 'hide'}, 0); $("#trackback_area").animate({opacity: 'show'}, 1000); return false; }); $("#comment_switch").click(function(){ $("#trackback_switch").removeClass("comment_switch_active"); $(this).addClass("comment_switch_active"); $("#trackback_area").animate({opacity: 'hide'}, 0); $("#comment_area").animate({opacity: 'show'}, 1000); return false; }); $("#index_post_list_tab a").click(function(){ $("#index_post_list_tab a").removeClass('active'); $(this).addClass("active"); return false; }); $("#index_post_list_tab > li:first-child a").addClass("active"); var index_post_list1=$('#index_post_list1'); var index_post_list2=$('#index_post_list2'); var index_post_list3=$('#index_post_list3'); var index_post_list_button1=$('#index_post_list_button1 a'); var index_post_list_button2=$('#index_post_list_button2 a'); var index_post_list_button3=$('#index_post_list_button3 a'); $('.index_post_list').hide(); $('#index_post_list_wrap .index_post_list:first-child').show(); index_post_list_button1.click(function (){ index_post_list1.show(); index_post_list2.hide(); index_post_list3.hide(); }); index_post_list_button2.click(function (){ index_post_list2.show(); index_post_list1.hide(); index_post_list3.hide(); }); index_post_list_button3.click(function (){ index_post_list3.show(); index_post_list1.hide(); index_post_list2.hide(); }); function mediaQueryClass(width){ if(width > 641){ $("html").removeClass("mobile"); $("html").addClass("pc"); $(".menu_button").css("display","none"); $("#global_menu").show(); $("#global_menu ul ul").hide(); $("#global_menu li").hover(function(){ $(">ul:not(:animated)",this).slideDown("fast"); }, function(){ $(">ul",this).slideUp("fast"); }); }else{ $("html").removeClass("pc"); $("html").addClass("mobile"); $("#global_menu li").off('hover'); $("#global_menu ul ul").show(); $(".menu_button").css("display", "block"); $('.menu_button').off('click'); if($(".menu_button").hasClass("active")){ $(".menu_button").removeClass("active") }; $(".menu_button").on('click',function(){ if($(this).hasClass("active")){ $(this).removeClass("active"); $('#global_menu').hide(); return false; }else{ $(this).addClass("active"); $('#global_menu').show(); return false; };}); };}; function viewport(){ var e=window, a='inner'; if(!('innerWidth' in window)){ a='client'; e=document.documentElement||document.body; } return { width:e[ a+'Width' ] , height:e[ a+'Height' ] };} var ww=viewport().width; var timer=false; mediaQueryClass(ww); $(window).bind("resize orientationchange", function(){ if(timer!==false){ clearTimeout(timer); } timer=setTimeout(function(){ var ww=viewport().width; mediaQueryClass(ww); }, 200); }) }); jQuery(function(){ jQuery(".zoom").elevateZoom({ zoomType:"inner", zoomWindowFadeIn: 500, zoomWindowFadeOut: 500, easing:true }); }); if(window.addEventListener){ window.addEventListener("load" , syncerTelephoneLink, false); }else{ window.attachEvent("onload", syncerTelephoneLink); } function syncerTelephoneLink(){ var width=window.innerWidth ; if(width>=640){ return false ; } var elms=document.getElementsByClassName("syncer-tel") ; for(var i=0,l=elms.length; l>i; i++){ var elm=elms[i] ; var number=elm.getAttribute("data-number") ; number=number.replace(/[A-Za-z0-9]/g, function(s){ return String.fromCharCode(s.charCodeAt(0) - 0xFEE0); }); number=number.replace(/(ー|‐|−|―)/g , "-") number=number.replace(/-/g , "") if(number!=null){ if(elm.tagName=="A"){ elm.href="tel:" + number ; }else{ var text=elm.innerHTML ; elm.innerHTML='' + text + '' ; }} }} ; jQuery(function(){ }); function uiAccordion(element){ var accContent=jQuery(element); var slideBtn=accContent.children(':first-child'); var slideContent=slideBtn.next(); jQuery.each(slideBtn, function(element){ if(!jQuery(this).hasClass('open')){ jQuery(this).next().hide(); }else{ jQuery(this).next().show(); }}); slideBtn.off("click"); slideBtn.click(function(){ if(jQuery(this).hasClass('open')){ jQuery(this).removeClass('open'); jQuery(this).next().slideUp(); }else{ jQuery(this).addClass('open'); jQuery(this).next().slideDown(); } return false; }); } var cat=null function fixStuff(){ jQuery(".heightaswidth").each(function(){ jQuery(this).css('height', jQuery(this).outerWidth()) }) } function page_ajax_get(){ var page=jQuery('.paged').last().attr('data-paged')||2; var ajaxurl=$('#admin-ajax').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: {"action": "load-filter", cat: cat, paged:page }, success: function(response){ if(response.length > 100){ var id=page - 1; id.toString(); jQuery("#infiniscroll").html(jQuery("#infiniscroll").html() + response); }else{ jQuery("#pagerlink").html("最終ページ") jQuery("#pagerbutton").attr("disabled", "disabled") }} }) } jQuery(document).ready(function(){ fixStuff(); jQuery('.heightasviewport').css('height', jQuery(window).height()) jQuery(".verticalcenter").each(function(){ var center=(jQuery(this).parent().outerHeight() / 2) - parseInt(jQuery(this).parent().css('padding-top')) var size=jQuery(this).outerHeight() / 2 jQuery(this).css('padding-top', center - size) }) }) jQuery(window).load(function(){ var currentSlide=-1; setInterval(function(){ currentSlide++ if(jQuery("[data-order='" + currentSlide + "']").length==0) currentSlide=0 jQuery('.slider, .parallax-mirror[data-order]').addClass('opaque'); jQuery("[data-order='" + currentSlide + "']").removeClass('opaque') fixStuff(); }, 3000) if(jQuery("#telephone").length&&jQuery("#logo").length){ jQuery("#telephone").css('left', jQuery("#logo").width() + 30) } jQuery('#loader').addClass('show-website'); jQuery('#topcover').addClass('topcover-visible'); jQuery("a[href*=#]:not([href=#])").click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var e=jQuery(this.hash);if(e=e.length?e:jQuery("[name="+this.hash.slice(1)+"]"),e.length)return jQuery("html,body").animate({scrollTop:e.offset().top},1e3),!1}}); jQuery(window).scroll(function(){ var center=jQuery(window).height() - 300 jQuery('.invisibletexteffect').each(function(){ var percentFromCenter=Math.abs(((jQuery(this).offset().top + jQuery(this).outerHeight() / 2) - jQuery(document).scrollTop()) - center) / center if(percentFromCenter < 1) jQuery(this).removeClass('offsetted') }) }) }) function smtel(telno){ if((navigator.userAgent.indexOf('iPhone') > 0)||(navigator.userAgent.indexOf('Android') > 0)){ document.write(''+telno+''); }else{ document.write(telno); }}; !function(a){a.fn.hoverIntent=function(b,c,d){var e={interval:100,sensitivity:6,timeout:0};e="object"==typeof b?a.extend(e,b):a.isFunction(c)?a.extend(e,{over:b,out:c,selector:d}):a.extend(e,{over:b,out:b,selector:c});var f,g,h,i,j=function(a){f=a.pageX,g=a.pageY},k=function(b,c){return c.hoverIntent_t=clearTimeout(c.hoverIntent_t),Math.sqrt((h-f)*(h-f)+(i-g)*(i-g)) ul.mega-sub-menu > li.mega-menu-item-has-children," + "li.mega-menu-flyout li.mega-menu-item-has-children", menu); plugin.hidePanel=function(anchor, immediate){ anchor.parent().triggerHandler("before_close_panel"); if((!immediate&&plugin.settings.effect=='slide')||(plugin.isMobileView()&&plugin.settings.effect_mobile=='slide')){ var speed=plugin.isMobileView() ? plugin.settings.effect_speed_mobile:plugin.settings.effect_speed; anchor.siblings(".mega-sub-menu").animate({'height':'hide', 'paddingTop':'hide', 'paddingBottom':'hide', 'minHeight':'hide'}, speed, function(){ anchor.siblings(".mega-sub-menu").css("display", ""); anchor.parent().removeClass("mega-toggle-on").triggerHandler("close_panel"); }); return; } if(immediate){ anchor.siblings(".mega-sub-menu").css("display", "none").delay(plugin.settings.effect_speed).queue(function(){ $(this).css("display", "").dequeue(); }); } anchor.siblings(".mega-sub-menu").find('.widget_media_video video').each(function(){ this.player.pause(); }); anchor.parent().removeClass("mega-toggle-on").triggerHandler("close_panel"); plugin.addAnimatingClass(anchor.parent()); }; plugin.addAnimatingClass=function(element){ if(plugin.settings.effect==="disabled"){ return; } $(".mega-animating").removeClass("mega-animating"); var timeout=plugin.settings.effect_speed + parseInt(megamenu.timeout, 10); element.addClass("mega-animating"); setTimeout(function(){ element.removeClass("mega-animating"); }, timeout); }; plugin.hideAllPanels=function(){ $(".mega-toggle-on > a.mega-menu-link", $menu).each(function(){ plugin.hidePanel($(this), false); }); }; plugin.hideSiblingPanels=function(anchor, immediate){ anchor.parent().parent().find(".mega-toggle-on").children("a.mega-menu-link").each(function(){ plugin.hidePanel($(this), immediate); }); }; plugin.isDesktopView=function(){ return Math.max(window.outerWidth, $(window).width()) > plugin.settings.breakpoint; }; plugin.isMobileView=function(){ return !plugin.isDesktopView(); }; plugin.showPanel=function(anchor){ anchor.parent().triggerHandler("before_open_panel"); $(".mega-animating").removeClass("mega-animating"); if(plugin.isMobileView()&&anchor.parent().hasClass("mega-hide-sub-menu-on-mobile")){ return; } if(plugin.isDesktopView()&&($menu.hasClass("mega-menu-horizontal")||$menu.hasClass("mega-menu-vertical"))){ plugin.hideSiblingPanels(anchor, true); } if((plugin.isMobileView()&&$menu.hasClass("mega-keyboard-navigation"))||plugin.settings.vertical_behaviour==="accordion"){ plugin.hideSiblingPanels(anchor, false); } plugin.calculateDynamicSubmenuWidths(anchor); if(plugin.settings.effect=="slide"||plugin.isMobileView()&&plugin.settings.effect_mobile=='slide'){ var speed=plugin.isMobileView() ? plugin.settings.effect_speed_mobile:plugin.settings.effect_speed; anchor.siblings(".mega-sub-menu").css("display", "none").animate({'height':'show', 'paddingTop':'show', 'paddingBottom':'show', 'minHeight':'show'}, speed, function(){ $(this).css("display", ""); }); } anchor.parent().addClass("mega-toggle-on").triggerHandler("open_panel"); }; plugin.calculateDynamicSubmenuWidths=function(anchor){ if(anchor.parent().hasClass("mega-menu-megamenu")&&anchor.parent().parent().hasClass('mega-menu')&&plugin.settings.panel_width&&$(plugin.settings.panel_width).length > 0){ if(plugin.isDesktopView()){ var submenu_offset=$menu.offset(); var target_offset=$(plugin.settings.panel_width).offset(); anchor.siblings(".mega-sub-menu").css({ width: $(plugin.settings.panel_width).outerWidth(), left: (target_offset.left - submenu_offset.left) + "px" }); }else{ anchor.siblings(".mega-sub-menu").css({ width: "", left: "" }); }} if(anchor.parent().hasClass("mega-menu-megamenu")&&anchor.parent().parent().hasClass('mega-menu')&&plugin.settings.panel_inner_width&&$(plugin.settings.panel_inner_width).length > 0){ var target_width=0; if($(plugin.settings.panel_inner_width).length){ target_width=parseInt($(plugin.settings.panel_inner_width).width(), 10); }else{ target_width=parseInt(plugin.settings.panel_inner_width, 10); } var submenu_width=parseInt(anchor.siblings(".mega-sub-menu").innerWidth(), 10); if(plugin.isDesktopView()&&target_width > 0&&target_width < submenu_width){ anchor.siblings(".mega-sub-menu").css({ "paddingLeft": (submenu_width - target_width) / 2 + "px", "paddingRight": (submenu_width - target_width) / 2 + "px" }); }else{ anchor.siblings(".mega-sub-menu").css({ "paddingLeft": "", "paddingRight": "" }); }} } var bindClickEvents=function(){ var dragging=false; $(document).on({ "touchmove": function(e){ dragging=true; }, "touchstart": function(e){ dragging=false; }}); $(document).on("click touchend", function(e){ if(!dragging&&plugin.settings.document_click==="collapse"&&! $(e.target).closest(".max-mega-menu li").length&&! $(e.target).closest(".mega-menu-toggle").length){ plugin.hideAllPanels(); } dragging=false; }); $("> a.mega-menu-link", items_with_submenus).on("click.megamenu touchend.megamenu", function(e){ if(e.type==='touchend'){ plugin.unbindHoverEvents(); plugin.unbindHoverIntentEvents(); } if(plugin.isDesktopView()&&$(this).parent().hasClass("mega-toggle-on")&&$(this).parent().parent().parent().hasClass("mega-menu-tabbed")){ if(plugin.settings.second_click==="go"){ return; }else{ e.preventDefault(); return; }} if(dragging){ return; } if(plugin.isMobileView()&&$(this).parent().hasClass("mega-hide-sub-menu-on-mobile")){ return; } if((plugin.settings.second_click==="go"||$(this).parent().hasClass("mega-click-click-go"))&&$(this).attr('href')!==undefined){ if(!$(this).parent().hasClass("mega-toggle-on")){ e.preventDefault(); plugin.showPanel($(this)); }}else{ e.preventDefault(); if($(this).parent().hasClass("mega-toggle-on")){ plugin.hidePanel($(this), false); }else{ plugin.showPanel($(this)); }} }); }; var bindHoverEvents=function(){ items_with_submenus.on({ "mouseenter.megamenu":function(){ plugin.unbindClickEvents(); if(! $(this).hasClass("mega-toggle-on")){ plugin.showPanel($(this).children("a.mega-menu-link")); }}, "mouseleave.megamenu":function(){ if($(this).hasClass("mega-toggle-on")&&! $(this).hasClass("mega-disable-collapse")&&! $(this).parent().parent().hasClass("mega-menu-tabbed")){ plugin.hidePanel($(this).children("a.mega-menu-link"), false); }} }); }; var bindHoverIntentEvents=function(){ items_with_submenus.hoverIntent({ over: function (){ plugin.unbindClickEvents(); if(! $(this).hasClass("mega-toggle-on")){ plugin.showPanel($(this).children("a.mega-menu-link")); }}, out: function (){ if($(this).hasClass("mega-toggle-on")&&! $(this).hasClass("mega-disable-collapse")&&! $(this).parent().parent().hasClass("mega-menu-tabbed")){ plugin.hidePanel($(this).children("a.mega-menu-link"), false); }}, timeout: megamenu.timeout, interval: megamenu.interval }); }; var bindKeyboardEvents=function(){ var tab_key=9; var escape_key=27; $("body").on("keyup", function(e){ var keyCode=e.keyCode||e.which; if(keyCode===escape_key){ $menu.parent().removeClass("mega-keyboard-navigation"); plugin.hideAllPanels(); } if($menu.parent().hasClass("mega-keyboard-navigation")&&!($(e.target).closest(".max-mega-menu li").length||$(e.target).closest(".mega-menu-toggle").length)){ $menu.parent().removeClass("mega-keyboard-navigation"); plugin.hideAllPanels(); if(plugin.isMobileView()){ $menu.siblings('.mega-menu-toggle').removeClass('mega-menu-open'); }} }); $menu.parent().on("keyup", function(e){ var keyCode=e.keyCode||e.which; var active_link=$(e.target); if(keyCode===tab_key){ $menu.parent().addClass("mega-keyboard-navigation"); if(active_link.parent().is(items_with_submenus)){ plugin.showPanel(active_link); }else{ plugin.hideSiblingPanels(active_link); } if(active_link.hasClass("mega-menu-toggle")){ active_link.addClass("mega-menu-open"); }} }); }; plugin.unbindAllEvents=function(){ $("ul.mega-sub-menu, li.mega-menu-item, a.mega-menu-link", menu).off().unbind(); }; plugin.unbindClickEvents=function(){ $("> a.mega-menu-link", items_with_submenus).off("click.megamenu touchend.megamenu"); }; plugin.unbindHoverEvents=function(){ items_with_submenus.unbind("mouseenter.megamenu mouseleave.megamenu"); }; plugin.unbindHoverIntentEvents=function(){ items_with_submenus.unbind("mouseenter mouseleave").removeProp('hoverIntent_t').removeProp('hoverIntent_s'); }; plugin.unbindMegaMenuEvents=function(){ if(plugin.settings.event==="hover_intent"){ plugin.unbindHoverIntentEvents(); } if(plugin.settings.event==="hover"){ plugin.unbindHoverEvents(); } plugin.unbindClickEvents(); } plugin.bindMegaMenuEvents=function(){ if(plugin.isDesktopView()&&plugin.settings.event==="hover_intent"){ bindHoverIntentEvents(); } if(plugin.isDesktopView()&&plugin.settings.event==="hover"){ bindHoverEvents(); } bindClickEvents(); bindKeyboardEvents(); }; plugin.monitorView=function(){ if(plugin.isDesktopView()){ $menu.data("view", "desktop"); }else{ $menu.data("view", "mobile"); plugin.switchToMobile(); } plugin.checkWidth(); $(window).resize(function(){ plugin.checkWidth(); }); }; plugin.checkWidth=function(){ if(plugin.isMobileView()&&$menu.data("view")==="desktop"){ $menu.data("view", "mobile"); plugin.switchToMobile(); } if(plugin.isDesktopView()&&$menu.data("view")==="mobile"){ $menu.data("view", "desktop"); plugin.switchToDesktop(); } plugin.calculateDynamicSubmenuWidths($("li.mega-menu-megamenu.mega-toggle-on > a.mega-menu-link", $menu)); }; plugin.reverseRightAlignedItems=function(){ if(! $('body').hasClass('rtl')){ $menu.append($menu.children("li.mega-item-align-right").get().reverse()); }}; plugin.addClearClassesToMobileItems=function(){ $(".mega-menu-row", $menu).each(function(){ $("> .mega-sub-menu > .mega-menu-column:not(.mega-hide-on-mobile)", $(this)).filter(":even").addClass('mega-menu-clear'); }); } plugin.switchToMobile=function(){ plugin.unbindMegaMenuEvents(); plugin.bindMegaMenuEvents(); plugin.reverseRightAlignedItems(); plugin.addClearClassesToMobileItems(); plugin.hideAllPanels(); }; plugin.switchToDesktop=function(){ plugin.unbindMegaMenuEvents(); plugin.bindMegaMenuEvents(); plugin.reverseRightAlignedItems(); plugin.hideAllPanels(); }; plugin.init=function(){ $menu.triggerHandler("before_mega_menu_init"); plugin.settings=$.extend({}, defaults, options); $menu.removeClass("mega-no-js"); $menu.siblings(".mega-menu-toggle").on("click", function(e){ if($(e.target).is(".mega-menu-toggle-block, .mega-toggle-blocks-left, .mega-toggle-blocks-center, .mega-toggle-blocks-right, .mega-toggle-label, .mega-toggle-label span")){ if(plugin.settings.effect_mobile=='slide'){ if($(this).hasClass("mega-menu-open")){ $menu.animate({'height':'hide'}, plugin.settings.effect_speed_mobile, function(){ $(this).css("display", ""); }); }else{ $menu.animate({'height':'show'}, plugin.settings.effect_speed_mobile); }} $(this).toggleClass("mega-menu-open"); }}); $("span.mega-indicator", $menu).on('click', function(e){ e.preventDefault(); e.stopPropagation(); plugin.hidePanel($(this).parent(), false); }); if(plugin.settings.unbind_events=='true'){ plugin.unbindAllEvents(); } plugin.bindMegaMenuEvents(); plugin.monitorView(); $menu.triggerHandler("after_mega_menu_init"); }; plugin.init(); }; $.fn.maxmegamenu=function(options){ return this.each(function(){ if(undefined===$(this).data("maxmegamenu")){ var plugin=new $.maxmegamenu(this, options); $(this).data("maxmegamenu", plugin); }}); }; $(function(){ $('.max-mega-menu').maxmegamenu(); }); })(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;c1e3)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);