(function(d,g,k){var l=d(g),h=g.document,s=d(h),t=function(){for(var d=3,b=h.createElement("div"),a=b.getElementsByTagName("i");b.innerHTML="\x3c!--[if gt IE "+ ++d+"]><i></i><![endif]--\x3e",a[0];);return 4<d?d:void 0}(),f=function(){var d=g.pageXOffset!==k?g.pageXOffset:"CSS1Compat"==h.compatMode?g.document.documentElement.scrollLeft:g.document.body.scrollLeft,b=g.pageYOffset!==k?g.pageYOffset:"CSS1Compat"==h.compatMode?g.document.documentElement.scrollTop:g.document.body.scrollTop;"undefined"==
typeof f.x&&(f.x=d,f.y=b);"undefined"==typeof f.distanceX?(f.distanceX=d,f.distanceY=b):(f.distanceX=d-f.x,f.distanceY=b-f.y);var a=f.x-d,e=f.y-b;f.direction=0>a?"right":0<a?"left":0>=e?"down":0<e?"up":"first";f.x=d;f.y=b};l.on("scroll",f);d.fn.style=function(f){if(!f)return null;var b=d(this),a,e=b.clone().css("display","none");e.find("input:radio").attr("name","copy-"+Math.floor(100*Math.random()+1));b.after(e);var k=function(a,d){var e;a.currentStyle?e=a.currentStyle[d.replace(/-\w/g,function(b){return b.toUpperCase().replace("-",
"")})]:g.getComputedStyle&&(e=h.defaultView.getComputedStyle(a,null).getPropertyValue(d));return e=/margin/g.test(d)?parseInt(e)===b[0].offsetLeft?e:"auto":e};"string"==typeof f?a=k(e[0],f):(a={},d.each(f,function(b,d){a[d]=k(e[0],d)}));e.remove();return a||null};d.fn.extend({hcSticky:function(h){if(0==this.length)return this;this.pluginOptions("hcSticky",{top:0,bottom:0,bottomEnd:0,innerTop:0,innerSticker:null,className:"sticky",wrapperClassName:"wrapper-sticky",stickTo:null,responsive:!0,followScroll:!0,
offResolutions:null,onStart:d.noop,onStop:d.noop,on:!0,fn:null},h||{},{reinit:function(){d(this).hcSticky()},stop:function(){d(this).pluginOptions("hcSticky",{on:!1}).each(function(){var b=d(this),a=b.pluginOptions("hcSticky"),e=b.parent("."+a.wrapperClassName),e=b.offset().top-e.offset().top;b.css({position:"absolute",top:e,bottom:"auto",left:"auto",right:"auto"}).removeClass(a.className)})},off:function(){d(this).pluginOptions("hcSticky",{on:!1}).each(function(){var b=d(this),a=b.pluginOptions("hcSticky"),
e=b.parent("."+a.wrapperClassName);b.css({position:"relative",top:"auto",bottom:"auto",left:"auto",right:"auto"}).removeClass(a.className);e.css("height","auto")})},on:function(){d(this).each(function(){d(this).pluginOptions("hcSticky",{on:!0,remember:{offsetTop:l.scrollTop()}}).hcSticky()})},destroy:function(){var b=d(this),a=b.pluginOptions("hcSticky"),e=b.parent("."+a.wrapperClassName);b.removeData("hcStickyInit").css({position:e.css("position"),top:e.css("top"),bottom:e.css("bottom"),left:e.css("left"),
right:e.css("right")}).removeClass(a.className);l.off("resize",a.fn.resize).off("scroll",a.fn.scroll);b.unwrap()}});h&&"undefined"!=typeof h.on&&(h.on?this.hcSticky("on"):this.hcSticky("off"));return"string"==typeof h?this:this.each(function(){var b=d(this),a=b.pluginOptions("hcSticky"),e=function(){var c=b.parent("."+a.wrapperClassName);return 0<c.length?(c.css({height:b.outerHeight(!0),width:function(){var a=c.style("width");return 0<=a.indexOf("%")||"auto"==a?("border-box"==b.css("box-sizing")||
"border-box"==b.css("-moz-box-sizing")?b.css("width",c.width()):b.css("width",c.width()-parseInt(b.css("padding-left")-parseInt(b.css("padding-right")))),a):b.outerWidth(!0)}()}),c):!1}()||function(){var c=b.style("width margin-left left right top bottom float display".split(" ")),e=b.css("display"),f=d("<div>",{"class":a.wrapperClassName}).css({display:e,height:b.outerHeight(!0),width:function(){return 0<=c.width.indexOf("%")||"auto"==c.width&&"inline-block"!=e&&"inline"!=e?(b.css("width",parseFloat(b.css("width"))),
c.width):"auto"!=c.width||"inline-block"!=e&&"inline"!=e?"auto"==c["margin-left"]?b.outerWidth():b.outerWidth(!0):b.width()}(),margin:c["margin-left"]?"auto":null,position:function(){var a=b.css("position");return"static"==a?"relative":a}(),"float":c["float"]||null,left:c.left,right:c.right,top:c.top,bottom:c.bottom,"vertical-align":"top"});b.wrap(f);7===t&&0===d("head").find("style#hcsticky-iefix").length&&d('<style id="hcsticky-iefix">.'+a.wrapperClassName+" {zoom: 1;}</style>").appendTo("head");
return b.parent()}();if(!b.data("hcStickyInit")){b.data("hcStickyInit",!0);var h=a.stickTo&&("document"==a.stickTo||a.stickTo.nodeType&&9==a.stickTo.nodeType||"object"==typeof a.stickTo&&a.stickTo instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document))?!0:!1,v=a.stickTo?h?s:"string"==typeof a.stickTo?d(a.stickTo):a.stickTo:e.parent();b.css({top:"auto",bottom:"auto",left:"auto",right:"auto"});l.load(function(){b.outerHeight(!0)>v.height()&&(e.css("height",b.outerHeight(!0)),b.hcSticky("reinit"))});
var u=function(c){b.hasClass(a.className)||(c=c||{},b.css({position:"fixed",top:c.top||0,left:c.left||e.offset().left}).addClass(a.className),a.onStart.apply(b[0]),e.addClass("sticky-active"))},w=function(c){c=c||{};c.position=c.position||"absolute";c.top=c.top||0;c.left=c.left||0;if("fixed"==b.css("position")||parseInt(b.css("top"))!=c.top)b.css({position:c.position,top:c.top,left:c.left}).removeClass(a.className),a.onStop.apply(b[0]),e.removeClass("sticky-active")},x=!1,m=!1,A=function(){y();z();
if(a.on){if(a.responsive){m||(m=b.clone().attr("style","").css({visibility:"hidden",height:0,overflow:"hidden",paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0}),e.after(m));var c=e.style("width"),d=m.style("width");"auto"==d&&"auto"!=c&&(d=parseInt(b.css("width")));d!=c&&e.width(d);x&&clearTimeout(x);x=setTimeout(function(){x=!1;m.remove();m=!1},250)}"fixed"==b.css("position")?b.css("left",e.offset().left):b.css("left",0);b.outerWidth(!0)!=e.width()&&(c="border-box"==b.css("box-sizing")||
"border-box"==b.css("-moz-box-sizing")?e.width():e.width()-parseInt(b.css("padding-left"))-parseInt(b.css("padding-right")),c=c-parseInt(b.css("margin-left"))-parseInt(b.css("margin-right")),b.css("width",c))}};b.pluginOptions("hcSticky",{fn:{scroll:function(c){if(a.on&&!(b.outerHeight(!0)>=v.height())){c=a.innerSticker?d(a.innerSticker).position().top:a.innerTop?a.innerTop:0;var k=e.offset().top,g=v.height()-a.bottomEnd+(h?0:k),t=e.offset().top-a.top+c,n=b.outerHeight(!0)+a.bottom,p=l.height(),q=
l.scrollTop(),m=b.offset().top,s=m-q,r;"undefined"!=typeof a.remember&&a.remember?(r=m-a.top-c,n-c>p&&a.followScroll?r<q&&q+p<=r+b.height()&&(a.remember=!1):a.remember.offsetTop>r?q<=r&&(u({top:a.top-c}),a.remember=!1):q>=r&&(u({top:a.top-c}),a.remember=!1)):q>t?g+a.bottom-(a.followScroll&&p<n?0:a.top)<=q+n-c-(n-c>p-(t-c)&&a.followScroll?0<(r=n-p-c)?r:0:0)?w({top:g-n+a.bottom-k}):n-c>p&&a.followScroll?s+n<=p?"down"==f.direction?u({top:p-n}):0>s&&"fixed"==b.css("position")&&w({top:m-(t+a.top-c)-f.distanceY}):
"up"==f.direction&&m>=q+a.top-c?u({top:a.top-c}):"down"==f.direction&&m+n>p&&"fixed"==b.css("position")&&w({top:m-(t+a.top-c)-f.distanceY}):u({top:a.top-c}):w()}},resize:A}});var z=function(){if(a.offResolutions){d.isArray(a.offResolutions)||(a.offResolutions=[a.offResolutions]);var c=!0;d.each(a.offResolutions,function(a,d){0>d?l.width()<-1*d&&(c=!1,b.hcSticky("off")):l.width()>d&&(c=!1,b.hcSticky("off"))});c&&!a.on&&b.hcSticky("on")}};z();l.on("resize",A);var y=function(){if(b.outerHeight(!0)<v.height()){var c=
!1;d._data(g,"events").scroll!=k&&d.each(d._data(g,"events").scroll,function(b,d){d.handler==a.fn.scroll&&(c=!0)});c||(a.fn.scroll(!0),l.on("scroll",a.fn.scroll))}};y()}})}})})(jQuery,this);
(function(d,g){d.fn.extend({pluginOptions:function(k,l,h,s){this.data(k)||this.data(k,{});if(k&&"undefined"==typeof l)return this.data(k).options;h=h||l||{};return"object"==typeof h||h===g?this.each(function(){var g=d(this);g.data(k).options?g.data(k,d.extend(g.data(k),{options:d.extend(g.data(k).options,h||{})})):(g.data(k,{options:d.extend(l,h||{})}),s&&(g.data(k).commands=s))}):"string"==typeof h?this.each(function(){d(this).data(k).commands[h].call(this)}):this}})})(jQuery);