/**
@license Sticky-kit v1.1.3 | MIT | Leaf Corcoran 2015 | http://leafo.net
 */(function(){var a,s;a=window.jQuery,s=a(window),a.fn.stick_in_parent=function(n){var z,$,_,m,I,A,q,f,u,B,v,T,g;for(n==null&&(n={}),g=n.sticky_class,A=n.inner_scrolling,T=n.recalc_every,v=n.parent,u=n.offset_top,f=n.spacer,_=n.bottoming,u==null&&(u=0),v==null&&(v=void 0),A==null&&(A=!0),g==null&&(g="is_stuck"),z=a(document),_==null&&(_=!0),B=function(t){var r,h;return window.getComputedStyle?(t[0],r=window.getComputedStyle(t[0]),h=parseFloat(r.getPropertyValue("width"))+parseFloat(r.getPropertyValue("margin-left"))+parseFloat(r.getPropertyValue("margin-right")),r.getPropertyValue("box-sizing")!=="border-box"&&(h+=parseFloat(r.getPropertyValue("border-left-width"))+parseFloat(r.getPropertyValue("border-right-width"))+parseFloat(r.getPropertyValue("padding-left"))+parseFloat(r.getPropertyValue("padding-right"))),h):t.outerWidth(!0)},m=function(t,r,h,M,W,k,l,j){var y,D,c,S,H,o,e,x,P,V,i,d;if(!t.data("sticky_kit")){if(t.data("sticky_kit",!0),H=z.height(),e=t.parent(),v!=null&&(e=e.closest(v)),!e.length)throw"failed to find stick parent";if(c=!1,y=!1,i=f!=null?f&&t.closest(f):a("<div />"),i&&i.css("position",t.css("position")),x=function(){var p,F,b;if(!j&&(H=z.height(),p=parseInt(e.css("border-top-width"),10),F=parseInt(e.css("padding-top"),10),r=parseInt(e.css("padding-bottom"),10),h=e.offset().top+p+F,M=e.height(),c&&(c=!1,y=!1,f==null&&(t.insertAfter(i),i.detach()),t.css({position:"",top:"",width:"",bottom:""}).removeClass(g),b=!0),W=t.offset().top-(parseInt(t.css("margin-top"),10)||0)-u,k=t.outerHeight(!0),l=t.css("float"),i&&i.css({width:B(t),height:k,display:t.css("display"),"vertical-align":t.css("vertical-align"),float:l}),b))return d()},x(),k!==M)return S=void 0,o=u,V=T,d=function(){var p,F,b,w,C,Q;if(!j&&(b=!1,V!=null&&(V-=1,V<=0&&(V=T,x(),b=!0)),!b&&z.height()!==H&&(x(),b=!0),w=s.scrollTop(),S!=null&&(F=w-S),S=w,c?(_&&(C=w+k+o>M+h,y&&!C&&(y=!1,t.css({position:"fixed",bottom:"",top:o}).trigger("sticky_kit:unbottom"))),w<W&&(c=!1,o=u,f==null&&((l==="left"||l==="right")&&t.insertAfter(i),i.detach()),p={position:"",width:"",top:""},t.css(p).removeClass(g).trigger("sticky_kit:unstick")),A&&(Q=s.height(),k+u>Q&&(y||(o-=F,o=Math.max(Q-k,o),o=Math.min(u,o),c&&t.css({top:o+"px"}))))):w>W&&(c=!0,p={position:"fixed",top:o},p.width=t.css("box-sizing")==="border-box"?t.outerWidth()+"px":t.width()+"px",t.css(p).addClass(g),f==null&&(t.after(i),(l==="left"||l==="right")&&i.append(t)),t.trigger("sticky_kit:stick")),c&&_&&(C==null&&(C=w+k+o>M+h),!y&&C)))return y=!0,e.css("position")==="static"&&e.css({position:"relative"}),t.css({position:"absolute",bottom:r,top:"auto"}).trigger("sticky_kit:bottom")},P=function(){return x(),d()},D=function(){if(j=!0,s.off("touchmove",d),s.off("scroll",d),s.off("resize",P),a(document.body).off("sticky_kit:recalc",P),t.off("sticky_kit:detach",D),t.removeData("sticky_kit"),t.css({position:"",bottom:"",top:"",width:""}),e.position("position",""),c)return f==null&&((l==="left"||l==="right")&&t.insertAfter(i),i.remove()),t.removeClass(g)},s.on("touchmove",d),s.on("scroll",d),s.on("resize",P),a(document.body).on("sticky_kit:recalc",P),t.on("sticky_kit:detach",D),setTimeout(d,0)}},I=0,q=this.length;I<q;I++)$=this[I],m(a($));return this}}).call(void 0);
