(function(t){"use strict";function e(t){return regexp("(^|\\s+)"+t+"(\\s+|$)")}function i(t,e){var i=n(t,e)?r:o;i(t,e)}var n,o,r;"classlist"in document.documentelement?(n=function(t,e){return t.classlist.contains(e)},o=function(t,e){t.classlist.add(e)},r=function(t,e){t.classlist.remove(e)}):(n=function(t,i){return e(i).test(t.classname)},o=function(t,e){n(t,e)||(t.classname=t.classname+" "+e)},r=function(t,i){t.classname=t.classname.replace(e(i)," ")});var s={hasclass:n,addclass:o,removeclass:r,toggleclass:i,has:n,add:o,remove:r,toggle:i};"function"==typeof define&&define.amd?define(s):t.classie=s})(window),function(t){"use strict";function e(e){var i=t.event;return i.target=i.target||i.srcelement||e,i}var i=document.documentelement,n=function(){};i.addeventlistener?n=function(t,e,i){t.addeventlistener(e,i,!1)}:i.attachevent&&(n=function(t,i,n){t[i+n]=n.handleevent?function(){var i=e(t);n.handleevent.call(n,i)}:function(){var i=e(t);n.call(t,i)},t.attachevent("on"+i,t[i+n])});var o=function(){};i.removeeventlistener?o=function(t,e,i){t.removeeventlistener(e,i,!1)}:i.detachevent&&(o=function(t,e,i){t.detachevent("on"+e,t[e+i]);try{delete t[e+i]}catch(n){t[e+i]=void 0}});var r={bind:n,unbind:o};"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){"use strict";function e(t){"function"==typeof t&&(e.isready?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==o.readystate;if(!e.isready&&!i){e.isready=!0;for(var n=0,s=r.length;s>n;n++){var a=r[n];a()}}}function n(n){return n.bind(o,"domcontentloaded",i),n.bind(o,"readystatechange",i),n.bind(t,"load",i),e}var o=t.document,r=[];e.isready=!1,"function"==typeof define&&define.amd?(e.isready="function"==typeof requirejs,define(["eventie/eventie"],n)):t.docready=n(t.eventie)}(this),function(t){"use strict";function e(t){if(t){if("string"==typeof n[t])return t;t=t.charat(0).touppercase()+t.slice(1);for(var e,o=0,r=i.length;r>o;o++)if(e=i[o]+t,"string"==typeof n[e])return e}}var i="webkit moz ms ms o".split(" "),n=document.documentelement.style;"function"==typeof define&&define.amd?define(function(){return e}):"object"==typeof exports?module.exports=e:t.getstyleproperty=e}(window),function(){"use strict";function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var n=t.prototype,o=this,r=o.eventemitter;n.getlisteners=function(t){var e,i,n=this._getevents();if(t instanceof regexp){e={};for(i in n)n.hasownproperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},n.flattenlisteners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},n.getlistenersasobject=function(t){var e,i=this.getlisteners(t);return i instanceof array&&(e={},e[t]=i),e||i},n.addlistener=function(t,i){var n,o=this.getlistenersasobject(t),r="object"==typeof i;for(n in o)o.hasownproperty(n)&&-1===e(o[n],i)&&o[n].push(r?i:{listener:i,once:!1});return this},n.on=i("addlistener"),n.addoncelistener=function(t,e){return this.addlistener(t,{listener:e,once:!0})},n.once=i("addoncelistener"),n.defineevent=function(t){return this.getlisteners(t),this},n.defineevents=function(t){for(var e=0;t.length>e;e+=1)this.defineevent(t[e]);return this},n.removelistener=function(t,i){var n,o,r=this.getlistenersasobject(t);for(o in r)r.hasownproperty(o)&&(n=e(r[o],i),-1!==n&&r[o].splice(n,1));return this},n.off=i("removelistener"),n.addlisteners=function(t,e){return this.manipulatelisteners(!1,t,e)},n.removelisteners=function(t,e){return this.manipulatelisteners(!0,t,e)},n.manipulatelisteners=function(t,e,i){var n,o,r=t?this.removelistener:this.addlistener,s=t?this.removelisteners:this.addlisteners;if("object"!=typeof e||e instanceof regexp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasownproperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},n.removeevent=function(t){var e,i=typeof t,n=this._getevents();if("string"===i)delete n[t];else if(t instanceof regexp)for(e in n)n.hasownproperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},n.removealllisteners=i("removeevent"),n.emitevent=function(t,e){var i,n,o,r,s=this.getlistenersasobject(t);for(o in s)if(s.hasownproperty(o))for(n=s[o].length;n--;)i=s[o][n],i.once===!0&&this.removelistener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getoncereturnvalue()&&this.removelistener(t,i.listener);return this},n.trigger=i("emitevent"),n.emit=function(t){var e=array.prototype.slice.call(arguments,1);return this.emitevent(t,e)},n.setoncereturnvalue=function(t){return this._oncereturnvalue=t,this},n._getoncereturnvalue=function(){return this.hasownproperty("_oncereturnvalue")?this._oncereturnvalue:!0},n._getevents=function(){return this._events||(this._events={})},t.noconflict=function(){return o.eventemitter=r,t},"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.eventemitter=t}.call(this),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["eventemitter/eventemitter","eventie/eventie"],function(i,n){return e(t,i,n)}):"object"==typeof exports?module.exports=e(t,require("eventemitter"),require("eventie")):t.imagesloaded=e(t,t.eventemitter,t.eventie)}(this,function(t,e,i){"use strict";function n(t,e){for(var i in e)t[i]=e[i];return t}function o(t){return"[object array]"===d.call(t)}function r(t){var e=[];if(o(t))e=t;else if("number"==typeof t.length)for(var i=0,n=t.length;n>i;i++)e.push(t[i]);else e.push(t);return e}function s(t,e,i){if(!(this instanceof s))return new s(t,e);"string"==typeof t&&(t=document.queryselectorall(t)),this.elements=r(t),this.options=n({},this.options),"function"==typeof e?i=e:n(this.options,e),i&&this.on("always",i),this.getimages(),h&&(this.jqdeferred=new h.deferred);var o=this;settimeout(function(){o.check()})}function a(t){this.img=t}function u(t){this.src=t,l[t]=this}var h=t.jquery,c=t.console,p=c!==void 0,d=object.prototype.tostring;s.prototype=new e,s.prototype.options={},s.prototype.getimages=function(){this.images=[];for(var t=0,e=this.elements.length;e>t;t++){var i=this.elements[t];"img"===i.nodename&&this.addimage(i);for(var n=i.queryselectorall("img"),o=0,r=n.length;r>o;o++){var s=n[o];this.addimage(s)}}},s.prototype.addimage=function(t){var e=new a(t);this.images.push(e)},s.prototype.check=function(){function t(t,o){return e.options.debug&&p&&c.log("confirm",t,o),e.progress(t),i++,i===n&&e.complete(),!0}var e=this,i=0,n=this.images.length;if(this.hasanybroken=!1,!n)return this.complete(),void 0;for(var o=0;n>o;o++){var r=this.images[o];r.on("confirm",t),r.check()}},s.prototype.progress=function(t){this.hasanybroken=this.hasanybroken||!t.isloaded;var e=this;settimeout(function(){e.emit("progress",e,t),e.jqdeferred&&e.jqdeferred.notify&&e.jqdeferred.notify(e,t)})},s.prototype.complete=function(){var t=this.hasanybroken?"fail":"done";this.iscomplete=!0;var e=this;settimeout(function(){if(e.emit(t,e),e.emit("always",e),e.jqdeferred){var i=e.hasanybroken?"reject":"resolve";e.jqdeferred[i](e)}})},h&&(h.fn.imagesloaded=function(t,e){var i=new s(this,t,e);return i.jqdeferred.promise(h(this))}),a.prototype=new e,a.prototype.check=function(){var t=l[this.img.src]||new u(this.img.src);if(t.isconfirmed)return this.confirm(t.isloaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalwidth)return this.confirm(0!==this.img.naturalwidth,"naturalwidth"),void 0;var e=this;t.on("confirm",function(t,i){return e.confirm(t.isloaded,i),!0}),t.check()},a.prototype.confirm=function(t,e){this.isloaded=t,this.emit("confirm",this,e)};var l={};return u.prototype=new e,u.prototype.check=function(){if(!this.ischecked){var t=new image;i.bind(t,"load",this),i.bind(t,"error",this),t.src=this.src,this.ischecked=!0}},u.prototype.handleevent=function(t){var e="on"+t.type;this[e]&&this[e](t)},u.prototype.onload=function(t){this.confirm(!0,"onload"),this.unbindproxyevents(t)},u.prototype.onerror=function(t){this.confirm(!1,"onerror"),this.unbindproxyevents(t)},u.prototype.confirm=function(t,e){this.isconfirmed=!0,this.isloaded=t,this.emit("confirm",this,e)},u.prototype.unbindproxyevents=function(t){i.unbind(t.target,"load",this),i.unbind(t.target,"error",this)},s}),function(t){"use strict";function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isplainobject(e)&&(this.options=t.extend(!0,this.options,e))})}function o(e,i){t.fn[e]=function(o){if("string"==typeof o){for(var s=n.call(arguments,1),a=0,u=this.length;u>a;a++){var h=this[a],c=t.data(h,e);if(c)if(t.isfunction(c[o])&&"_"!==o.charat(0)){var p=c[o].apply(c,s);if(void 0!==p)return p}else r("no such method '"+o+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+o+"'")}return this}return this.each(function(){var n=t.data(this,e);n?(n.option(o),n._init()):(n=new i(this,o),t.data(this,e,n))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),o(t,e)},t.bridget}}var n=array.prototype.slice;"function"==typeof define&&define.amd?define(["jquery"],i):i(t.jquery)}(window),function(t){"use strict";function e(t){var e=parsefloat(t),i=-1===t.indexof("%")&&!isnan(e);return i&&e}function i(){for(var t={width:0,height:0,innerwidth:0,innerheight:0,outerwidth:0,outerheight:0},e=0,i=s.length;i>e;e++){var n=s[e];t[n]=0}return t}function n(t){function n(t){if("string"==typeof t&&(t=document.queryselector(t)),t&&"object"==typeof t&&t.nodetype){var n=r(t);if("none"===n.display)return i();var o={};o.width=t.offsetwidth,o.height=t.offsetheight;for(var c=o.isborderbox=!(!h||!n[h]||"border-box"!==n[h]),p=0,d=s.length;d>p;p++){var l=s[p],f=n[l];f=a(t,f);var m=parsefloat(f);o[l]=isnan(m)?0:m}var y=o.paddingleft+o.paddingright,g=o.paddingtop+o.paddingbottom,v=o.marginleft+o.marginright,b=o.margintop+o.marginbottom,e=o.borderleftwidth+o.borderrightwidth,w=o.bordertopwidth+o.borderbottomwidth,l=c&&u,s=e(n.width);s!==!1&&(o.width=s+(l?0:y+e));var x=e(n.height);return x!==!1&&(o.height=x+(l?0:g+w)),o.innerwidth=o.width-(y+e),o.innerheight=o.height-(g+w),o.outerwidth=o.width+v,o.outerheight=o.height+b,o}}function a(t,e){if(o||-1===e.indexof("%"))return e;var i=t.style,n=i.left,r=t.runtimestyle,s=r&&r.left;return s&&(r.left=t.currentstyle.left),i.left=e,e=i.pixelleft,i.left=n,s&&(r.left=s),e}var u,h=t("boxsizing");return function(){if(h){var t=document.createelement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderstyle="solid",t.style.borderwidth="1px 2px 3px 4px",t.style[h]="border-box";var i=document.body||document.documentelement;i.appendchild(t);var n=r(t);u=200===e(n.width),i.removechild(t)}}(),n}var o=t.getcomputedstyle,r=o?function(t){return o(t,null)}:function(t){return t.currentstyle},s=["paddingleft","paddingright","paddingtop","paddingbottom","marginleft","marginright","margintop","marginbottom","borderleftwidth","borderrightwidth","bordertopwidth","borderbottomwidth"];"function"==typeof define&&define.amd?define(["get-style-property/get-style-property"],n):"object"==typeof exports?module.exports=n(require("get-style-property")):t.getsize=n(t.getstyleproperty)}(window),function(t,e){"use strict";function i(t,e){return t[a](e)}function n(t){if(!t.parentnode){var e=document.createdocumentfragment();e.appendchild(t)}}function o(t,e){n(t);for(var i=t.parentnode.queryselectorall(e),o=0,r=i.length;r>o;o++)if(i[o]===t)return!0;return!1}function r(t,e){return n(t),i(t,e)}var s,a=function(){if(e.matchesselector)return"matchesselector";for(var t=["webkit","moz","ms","o"],i=0,n=t.length;n>i;i++){var o=t[i],r=o+"matchesselector";if(e[r])return r}}();if(a){var u=document.createelement("div"),h=i(u,"div");s=h?i:r}else s=o;"function"==typeof define&&define.amd?define(function(){return s}):window.matchesselector=s}(this,element.prototype),function(t){"use strict";function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){for(var e in t)return!1;return e=null,!0}function n(t){return t.replace(/([a-z])/g,function(t){return"-"+t.tolowercase()})}function o(t,o,r){function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var u=r("transition"),h=r("transform"),c=u&&h,p=!!r("perspective"),d={webkittransition:"webkittransitionend",moztransition:"transitionend",otransition:"otransitionend",transition:"transitionend"}[u],l=["transform","transition","transitionduration","transitionproperty"],f=function(){for(var t={},e=0,i=l.length;i>e;e++){var n=l[e],o=r(n);o&&o!==n&&(t[n]=o)}return t}();e(a.prototype,t.prototype),a.prototype._create=function(){this._transn={ingproperties:{},clean:{},onend:{}},this.css({position:"absolute"})},a.prototype.handleevent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.getsize=function(){this.size=o(this.element)},a.prototype.css=function(t){var e=this.element.style;for(var i in t){var n=f[i]||i;e[n]=t[i]}},a.prototype.getposition=function(){var t=s(this.element),e=this.layout.options,i=e.isoriginleft,n=e.isorigintop,o=parseint(t[i?"left":"right"],10),r=parseint(t[n?"top":"bottom"],10);o=isnan(o)?0:o,r=isnan(r)?0:r;var a=this.layout.size;o-=i?a.paddingleft:a.paddingright,r-=n?a.paddingtop:a.paddingbottom,this.position.x=o,this.position.y=r},a.prototype.layoutposition=function(){var t=this.layout.size,e=this.layout.options,i={};e.isoriginleft?(i.left=this.position.x+t.paddingleft+"px",i.right=""):(i.right=this.position.x+t.paddingright+"px",i.left=""),e.isorigintop?(i.top=this.position.y+t.paddingtop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingbottom+"px",i.top=""),this.css(i),this.emitevent("layout",[this])};var m=p?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};a.prototype._transitionto=function(t,e){this.getposition();var i=this.position.x,n=this.position.y,o=parseint(t,10),r=parseint(e,10),s=o===this.position.x&&r===this.position.y;if(this.setposition(t,e),s&&!this.istransitioning)return this.layoutposition(),void 0;var a=t-i,u=e-n,h={},c=this.layout.options;a=c.isoriginleft?a:-a,u=c.isorigintop?u:-u,h.transform=m(a,u),this.transition({to:h,ontransitionend:{transform:this.layoutposition},iscleaning:!0})},a.prototype.goto=function(t,e){this.setposition(t,e),this.layoutposition()},a.prototype.moveto=c?a.prototype._transitionto:a.prototype.goto,a.prototype.setposition=function(t,e){this.position.x=parseint(t,10),this.position.y=parseint(e,10)},a.prototype._nontransition=function(t){this.css(t.to),t.iscleaning&&this._removestyles(t.to);for(var e in t.ontransitionend)t.ontransitionend[e].call(this)},a.prototype._transition=function(t){if(!parsefloat(this.layout.options.transitionduration))return this._nontransition(t),void 0;var e=this._transn;for(var i in t.ontransitionend)e.onend[i]=t.ontransitionend[i];for(i in t.to)e.ingproperties[i]=!0,t.iscleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetheight;n=null}this.enabletransition(t.to),this.css(t.to),this.istransitioning=!0};var y=h&&n(h)+",opacity";a.prototype.enabletransition=function(){this.istransitioning||(this.css({transitionproperty:y,transitionduration:this.layout.options.transitionduration}),this.element.addeventlistener(d,this,!1))},a.prototype.transition=a.prototype[u?"_transition":"_nontransition"],a.prototype.onwebkittransitionend=function(t){this.ontransitionend(t)},a.prototype.onotransitionend=function(t){this.ontransitionend(t)};var g={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};a.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=g[t.propertyname]||t.propertyname;if(delete e.ingproperties[n],i(e.ingproperties)&&this.disabletransition(),n in e.clean&&(this.element.style[t.propertyname]="",delete e.clean[n]),n in e.onend){var o=e.onend[n];o.call(this),delete e.onend[n]}this.emitevent("transitionend",[this])}},a.prototype.disabletransition=function(){this.removetransitionstyles(),this.element.removeeventlistener(d,this,!1),this.istransitioning=!1},a.prototype._removestyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var v={transitionproperty:"",transitionduration:""};return a.prototype.removetransitionstyles=function(){this.css(v)},a.prototype.removeelem=function(){this.element.parentnode.removechild(this.element),this.emitevent("remove",[this])},a.prototype.remove=function(){if(!u||!parsefloat(this.layout.options.transitionduration))return this.removeelem(),void 0;var t=this;this.on("transitionend",function(){return t.removeelem(),!0}),this.hide()},a.prototype.reveal=function(){delete this.ishidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenstyle,to:t.visiblestyle,iscleaning:!0})},a.prototype.hide=function(){this.ishidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visiblestyle,to:t.hiddenstyle,iscleaning:!0,ontransitionend:{opacity:function(){this.ishidden&&this.css({display:"none"})}}})},a.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}var r=t.getcomputedstyle,s=r?function(t){return r(t,null)}:function(t){return t.currentstyle};"function"==typeof define&&define.amd?define(["eventemitter/eventemitter","get-size/get-size","get-style-property/get-style-property"],o):(t.outlayer={},t.outlayer.item=o(t.eventemitter,t.getsize,t.getstyleproperty))}(window),function(t){"use strict";function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object array]"===p.call(t)}function n(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var n=0,o=t.length;o>n;n++)e.push(t[n]);else e.push(t);return e}function o(t,e){var i=l(e,t);-1!==i&&e.splice(i,1)}function r(t){return t.replace(/(.)([a-z])/g,function(t,e,i){return e+"-"+i}).tolowercase()}function s(i,s,p,l,f,m){function y(t,i){if("string"==typeof t&&(t=a.queryselector(t)),!t||!d(t))return u&&u.error("bad "+this.constructor.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.constructor.defaults),this.option(i);var n=++g;this.element.outlayerguid=n,v[n]=this,this._create(),this.options.isinitlayout&&this.layout()}var g=0,v={};return y.namespace="outlayer",y.item=m,y.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(y.prototype,p.prototype),y.prototype.option=function(t){e(this.options,t)},y.prototype._create=function(){this.reloaditems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerstyle),this.options.isresizebound&&this.bindresize()},y.prototype.reloaditems=function(){this.items=this._itemize(this.element.children)},y.prototype._itemize=function(t){for(var e=this._filterfinditemelements(t),i=this.constructor.item,n=[],o=0,r=e.length;r>o;o++){var s=e[o],a=new i(s,this);n.push(a)}return n},y.prototype._filterfinditemelements=function(t){t=n(t);for(var e=this.options.itemselector,i=[],o=0,r=t.length;r>o;o++){var s=t[o];if(d(s))if(e){f(s,e)&&i.push(s);for(var a=s.queryselectorall(e),u=0,h=a.length;h>u;u++)i.push(a[u])}else i.push(s)}return i},y.prototype.getitemelements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},y.prototype.layout=function(){this._resetlayout(),this._managestamps();var t=void 0!==this.options.islayoutinstant?this.options.islayoutinstant:!this._islayoutinited;this.layoutitems(this.items,t),this._islayoutinited=!0},y.prototype._init=y.prototype.layout,y.prototype._resetlayout=function(){this.getsize()},y.prototype.getsize=function(){this.size=l(this.element)},y.prototype._getmeasurement=function(t,e){var i,n=this.options[t];n?("string"==typeof n?i=this.element.queryselector(n):d(n)&&(i=n),this[t]=i?l(i)[e]:n):this[t]=0},y.prototype.layoutitems=function(t,e){t=this._getitemsforlayout(t),this._layoutitems(t,e),this._postlayout()},y.prototype._getitemsforlayout=function(t){for(var e=[],i=0,n=t.length;n>i;i++){var o=t[i];o.isignored||e.push(o)}return e},y.prototype._layoutitems=function(t,e){function i(){n.emitevent("layoutcomplete",[n,t])}var n=this;if(!t||!t.length)return i(),void 0;this._itemson(t,"layout",i);for(var o=[],r=0,s=t.length;s>r;r++){var a=t[r],u=this._getitemlayoutposition(a);u.item=a,u.isinstant=e||a.islayoutinstant,o.push(u)}this._processlayoutqueue(o)},y.prototype._getitemlayoutposition=function(){return{x:0,y:0}},y.prototype._processlayoutqueue=function(t){for(var e=0,i=t.length;i>e;e++){var n=t[e];this._positionitem(n.item,n.x,n.y,n.isinstant)}},y.prototype._positionitem=function(t,e,i,n){n?t.goto(e,i):t.moveto(e,i)},y.prototype._postlayout=function(){this.resizecontainer()},y.prototype.resizecontainer=function(){if(this.options.isresizingcontainer){var t=this._getcontainersize();t&&(this._setcontainermeasure(t.width,!0),this._setcontainermeasure(t.height,!1))}},y.prototype._getcontainersize=c,y.prototype._setcontainermeasure=function(t,e){if(void 0!==t){var i=this.size;i.isborderbox&&(t+=e?i.paddingleft+i.paddingright+i.borderleftwidth+i.borderrightwidth:i.paddingbottom+i.paddingtop+i.bordertopwidth+i.borderbottomwidth),t=math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},y.prototype._itemson=function(t,e,i){function n(){return o++,o===r&&i.call(s),!0}for(var o=0,r=t.length,s=this,a=0,u=t.length;u>a;a++){var h=t[a];h.on(e,n)}},y.prototype.ignore=function(t){var e=this.getitem(t);e&&(e.isignored=!0)},y.prototype.unignore=function(t){var e=this.getitem(t);e&&delete e.isignored},y.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var n=t[e];this.ignore(n)}}},y.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var n=t[e];o(n,this.stamps),this.unignore(n)}},y.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.queryselectorall(t)),t=n(t)):void 0},y.prototype._managestamps=function(){if(this.stamps&&this.stamps.length){this._getboundingrect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._managestamp(i)}}},y.prototype._getboundingrect=function(){var t=this.element.getboundingclientrect(),e=this.size;this._boundingrect={left:t.left+e.paddingleft+e.borderleftwidth,top:t.top+e.paddingtop+e.bordertopwidth,right:t.right-(e.paddingright+e.borderrightwidth),bottom:t.bottom-(e.paddingbottom+e.borderbottomwidth)}},y.prototype._managestamp=c,y.prototype._getelementoffset=function(t){var e=t.getboundingclientrect(),i=this._boundingrect,n=l(t),o={left:e.left-i.left-n.marginleft,top:e.top-i.top-n.margintop,right:i.right-e.right-n.marginright,bottom:i.bottom-e.bottom-n.marginbottom};return o},y.prototype.handleevent=function(t){var e="on"+t.type;this[e]&&this[e](t)},y.prototype.bindresize=function(){this.isresizebound||(i.bind(t,"resize",this),this.isresizebound=!0)},y.prototype.unbindresize=function(){this.isresizebound&&i.unbind(t,"resize",this),this.isresizebound=!1},y.prototype.onresize=function(){function t(){e.resize(),delete e.resizetimeout}this.resizetimeout&&cleartimeout(this.resizetimeout);var e=this;this.resizetimeout=settimeout(t,100)},y.prototype.resize=function(){this.isresizebound&&this.needsresizelayout()&&this.layout()},y.prototype.needsresizelayout=function(){var t=l(this.element),e=this.size&&t;return e&&t.innerwidth!==this.size.innerwidth},y.prototype.additems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},y.prototype.appended=function(t){var e=this.additems(t);e.length&&(this.layoutitems(e,!0),this.reveal(e))},y.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetlayout(),this._managestamps(),this.layoutitems(e,!0),this.reveal(e),this.layoutitems(i)}},y.prototype.reveal=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var n=t[i];n.reveal()}},y.prototype.hide=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var n=t[i];n.hide()}},y.prototype.getitem=function(t){for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];if(n.element===t)return n}},y.prototype.getitems=function(t){if(t&&t.length){for(var e=[],i=0,n=t.length;n>i;i++){var o=t[i],r=this.getitem(o);r&&e.push(r)}return e}},y.prototype.remove=function(t){t=n(t);var e=this.getitems(t);if(e&&e.length){this._itemson(e,"remove",function(){this.emitevent("removecomplete",[this,e])});for(var i=0,r=e.length;r>i;i++){var s=e[i];s.remove(),o(s,this.items)}}},y.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];n.destroy()}this.unbindresize(),delete this.element.outlayerguid,h&&h.removedata(this.element,this.constructor.namespace)},y.data=function(t){var e=t&&t.outlayerguid;return e&&v[e]},y.create=function(t,i){function n(){y.apply(this,arguments)}return object.create?n.prototype=object.create(y.prototype):e(n.prototype,y.prototype),n.prototype.constructor=n,n.defaults=e({},y.defaults),e(n.defaults,i),n.prototype.settings={},n.namespace=t,n.data=y.data,n.item=function(){m.apply(this,arguments)},n.item.prototype=new m,s(function(){for(var e=r(t),i=a.queryselectorall(".js-"+e),o="data-"+e+"-options",s=0,c=i.length;c>s;s++){var p,d=i[s],l=d.getattribute(o);try{p=l&&json.parse(l)}catch(f){u&&u.error("error parsing "+o+" on "+d.nodename.tolowercase()+(d.id?"#"+d.id:"")+": "+f);continue}var m=new n(d,p);h&&h.data(d,t,m)}}),h&&h.bridget&&h.bridget(t,n),n},y.item=m,y}var a=t.document,u=t.console,h=t.jquery,c=function(){},p=object.prototype.tostring,d="object"==typeof htmlelement?function(t){return t instanceof htmlelement}:function(t){return t&&"object"==typeof t&&1===t.nodetype&&"string"==typeof t.nodename},l=array.prototype.indexof?function(t,e){return t.indexof(e)}:function(t,e){for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["eventie/eventie","doc-ready/doc-ready","eventemitter/eventemitter","get-size/get-size","matches-selector/matches-selector","./item"],s):t.outlayer=s(t.eventie,t.docready,t.eventemitter,t.getsize,t.matchesselector,t.outlayer.item)}(window),function(t){"use strict";function e(t,e){var n=t.create("masonry");return n.prototype._resetlayout=function(){this.getsize(),this._getmeasurement("columnwidth","outerwidth"),this._getmeasurement("gutter","outerwidth"),this.measurecolumns();var t=this.cols;for(this.colys=[];t--;)this.colys.push(0);this.maxy=0},n.prototype.measurecolumns=function(){if(this.getcontainerwidth(),!this.columnwidth){var t=this.items[0],i=t&&t.element;this.columnwidth=i&&e(i).outerwidth||this.containerwidth}this.columnwidth+=this.gutter,this.cols=math.floor((this.containerwidth+this.gutter)/this.columnwidth),this.cols=math.max(this.cols,1)},n.prototype.getcontainerwidth=function(){var t=this.options.isfitwidth?this.element.parentnode:this.element,i=e(t);this.containerwidth=i&&i.innerwidth},n.prototype._getitemlayoutposition=function(t){t.getsize();var e=t.size.outerwidth%this.columnwidth,n=e&&1>e?"round":"ceil",o=math[n](t.size.outerwidth/this.columnwidth);o=math.min(o,this.cols);for(var r=this._getcolgroup(o),s=math.min.apply(math,r),a=i(r,s),u={x:this.columnwidth*a,y:s},h=s+t.size.outerheight,c=this.cols+1-r.length,p=0;c>p;p++)this.colys[a+p]=h;return u},n.prototype._getcolgroup=function(t){if(2>t)return this.colys;for(var e=[],i=this.cols+1-t,n=0;i>n;n++){var o=this.colys.slice(n,n+t);e[n]=math.max.apply(math,o)}return e},n.prototype._managestamp=function(t){var i=e(t),n=this._getelementoffset(t),o=this.options.isoriginleft?n.left:n.right,r=o+i.outerwidth,s=math.floor(o/this.columnwidth);s=math.max(0,s);var a=math.floor(r/this.columnwidth);a-=r%this.columnwidth?0:1,a=math.min(this.cols-1,a);for(var u=(this.options.isorigintop?n.top:n.bottom)+i.outerheight,h=s;a>=h;h++)this.colys[h]=math.max(u,this.colys[h])},n.prototype._getcontainersize=function(){this.maxy=math.max.apply(math,this.colys);var t={height:this.maxy};return this.options.isfitwidth&&(t.width=this._getcontainerfitwidth()),t},n.prototype._getcontainerfitwidth=function(){for(var t=0,e=this.cols;--e&&0===this.colys[e];)t++;return(this.cols-t)*this.columnwidth-this.gutter},n.prototype.needsresizelayout=function(){var t=this.containerwidth;return this.getcontainerwidth(),t!==this.containerwidth},n}var i=array.prototype.indexof?function(t,e){return t.indexof(e)}:function(t,e){for(var i=0,n=t.length;n>i;i++){var o=t[i];if(o===e)return i}return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):t.masonry=e(t.outlayer,t.getsize)}(window),function(t){"use strict";function e(t,e){t[s]=e}var i=t.md={};i.pages={};var n;docready(function(){n=document.queryselector("#notification");var t=document.body.getattribute("data-page");t&&"function"==typeof i[t]&&i[t]()}),i.getsomeitemelements=function(){for(var t=document.createdocumentfragment(),e=[],i=0;3>i;i++){var n=document.createelement("div"),o=math.random(),r=o>.85?"w4":o>.7?"w2":"",s=math.random(),a=s>.85?"h4":s>.7?"h2":"";n.classname="item "+r+" "+a,t.appendchild(n),e.push(n)}};var o,r=document.documentelement,s=void 0!==r.textcontent?"textcontent":"innertext",a=getstyleproperty("transition"),u=a?1e3:1500;i.notify=function(t,r){e(n,t),a&&(n.style[a]="none"),n.style.display="block",n.style.opacity="1",r&&(o&&cleartimeout(o),o=settimeout(i.hidenotify,u))},i.hidenotify=function(){a?(n.style[a]="opacity 1.0s",n.style.opacity="0"):n.style.display="none"}}(window),function(t){"use strict";function e(){var t=new date,e=t.getminutes();e=10>e?"0"+e:e;var i=t.getseconds();return i=10>i?"0"+i:i,[t.gethours(),e,i].join(":")}function i(t){n.notify(t+" at "+e(),!0)}var n=t.md;n.events=function(){(function(){var t=document.queryselector("#layout-complete-demo .masonry"),e=new masonry(t,{columnwidth:60});e.on("layoutcomplete",function(t,e){i("masonry layout completed on "+e.length+" items")}),eventie.bind(t,"click",function(t){classie.has(t.target,"item")&&(classie.toggle(t.target,"gigante"),e.layout())})})(),function(){var t=document.queryselector("#remove-complete-demo .masonry"),e=new masonry(t,{columnwidth:60});e.on("removecomplete",function(t,e){i("removed "+e.length+" items")}),eventie.bind(t,"click",function(t){classie.has(t.target,"item")&&e.remove(t.target)})}()}}(window),function(t){"use strict";var e=t.md,i=getstyleproperty("transition"),n={webkittransition:"webkittransitionend",moztransition:"transitionend",otransition:"otransitionend",transition:"transitionend"}[i];e.faq=function(){(function(){var t=document.queryselector("#animate-item-size .masonry"),e=new masonry(t,{columnwidth:60});eventie.bind(t,"click",function(t){var i=t.target;if(classie.has(i,"item-content")){var n=i.parentnode;classie.toggleclass(n,"is-expanded"),e.layout()}})})(),function(){var t=document.queryselector("#animate-item-size-responsive .masonry"),e=new masonry(t,{columnwidth:".grid-sizer",itemselector:".item"});eventie.bind(t,"click",function(t){var o=t.target;if(classie.has(o,"item-content")){var r=getsize(o);o.style[i]="none",o.style.width=r.width+"px",o.style.height=r.height+"px";var s=o.parentnode;classie.toggleclass(s,"is-expanded");var a=o.offsetwidth;if(o.style[i]="",i){var u=function(){o.style.width="",o.style.height="",o.removeeventlistener(n,u,!1)};o.addeventlistener(n,u,!1)}var h=getsize(s);o.style.width=h.width+"px",o.style.height=h.height+"px",a=null,e.layout()}})}()}}(window),function(t){"use strict";function e(){for(var t=[],e=document.createdocumentfragment(),r=a,s=0,u=r.length;u>s;s++){var h=i(r[s]);t.push(h),e.appendchild(h)}imagesloaded(e).on("progress",function(t,e){var i=e.img.parentnode.parentnode;n.appendchild(i),o.appended(i) })}function i(t){var e=document.createelement("div");e.classname="hero-item has-example is-hidden";var i=document.createelement("a");i.href=t.url;var n=document.createelement("img");n.src=t.image;var o=document.createelement("p");return o.classname="example-title",o.textcontent=t.title,i.appendchild(n),i.appendchild(o),e.appendchild(i),e}var n,o,r,s=t.md;s.index=function(){(function(){var t=document.queryselector("#hero");n=t.queryselector(".hero-masonry"),o=new masonry(n,{itemselector:".hero-item",columnwidth:".grid-sizer"}),e()})(),r=document.queryselector("#load-more-examples")};var a=[{title:"erik johansson",url:"http://erikjohanssonphoto.com/work/imagecats/personal/",image:"http://i.imgur.com/6lo8oun.jpg"},{title:"tumblr staff: archive",url:"http://staff.tumblr.com/archive",image:"http://i.imgur.com/igjvra3.jpg"},{title:"halcyon theme",url:"http://halcyon-theme.tumblr.com/",image:"http://i.imgur.com/a1rsohg.jpg"},{title:"resize.thatsh.it",url:"http://resize.thatsh.it/",image:"http://i.imgur.com/00xwxlg.png"},{title:"vox media",url:"http://www.voxmedia.com",image:"http://i.imgur.com/xsitfij.jpg"},{title:"kristian hammerstad",url:"http://www.kristianhammerstad.com/",image:"http://i.imgur.com/zwd7sch.jpg"},{title:"loading effects for grid items | demo 2",url:"http://tympanus.net/development/gridloadingeffects/index2.html",image:"http://i.imgur.com/ifbsb1t.jpg"}]}(window),function(t){"use strict";function e(){var t=document.createelement("div"),e=math.random(),i=math.random(),n=e>.92?"w4":e>.8?"w3":e>.6?"w2":"",o=i>.85?"h4":i>.6?"h3":i>.35?"h2":"";return t.classname="item "+n+" "+o,t}var i=t.md;i.methods=function(){(function(){var t=document.queryselector("#appended-demo"),i=t.queryselector(".masonry"),n=t.queryselector("button"),o=new masonry(i,{columnwidth:60});eventie.bind(n,"click",function(){for(var t=[],n=document.createdocumentfragment(),r=0;3>r;r++){var s=e();n.appendchild(s),t.push(s)}i.appendchild(n),o.appended(t)})})(),function(){var t=document.queryselector("#destroy-demo"),e=t.queryselector(".masonry"),i=t.queryselector("button"),n=new masonry(e,{columnwidth:60}),o=!0;eventie.bind(i,"click",function(){o?n.destroy():n=new masonry(e),o=!o})}(),function(){var t=document.queryselector("#layout-demo .masonry"),e=new masonry(t,{columnwidth:60});eventie.bind(t,"click",function(t){classie.has(t.target,"item")&&(classie.toggle(t.target,"gigante"),e.layout())})}(),function(){var t=document.queryselector("#prepended-demo"),i=t.queryselector(".masonry"),n=t.queryselector("button"),o=new masonry(i,{columnwidth:60});eventie.bind(n,"click",function(){for(var t=[],n=document.createdocumentfragment(),r=0;3>r;r++){var s=e();n.appendchild(s),t.push(s)}i.insertbefore(n,i.firstchild),o.prepended(t)})}(),function(){var t=document.queryselector("#stamp-demo"),e=t.queryselector(".stamp"),i=t.queryselector("button"),n=new masonry(t.queryselector(".masonry"),{columnwidth:60,itemselector:".item"}),o=!1;eventie.bind(i,"click",function(){o?n.unstamp(e):n.stamp(e),n.layout(),o=!o})}(),function(){var t=document.queryselector("#remove-demo .masonry"),e=new masonry(t,{columnwidth:60});eventie.bind(t,"click",function(t){classie.has(t.target,"item")&&(e.remove(t.target),e.layout())})}()}}(window);