')},throttle:function(a,b,c){b=b||50;var d,e;return function(){var f=c||this,g=+new Date,h=arguments;d&&d+b>g?(clearTimeout(e),e=setTimeout(function(){d=g,a.apply(f,h)},b)):(d=g,a.apply(f,h))}},bindFixedColumnEvents:function(b,e){var f=c.scroller,g=b.namespace+"tsscrollerFixed",h="scroll"+g,i=e.scroller_$fixedColumns.find("."+d.scrollerTable),j=!0,k=!0;b.$table.parent().off(h).on(h,f.throttle(function(){if(!e.scroller_isBusy&&j){k=!1;var b=a(this);i[0].scrollTop=e.scroller_saved[1]=b.scrollTop(),e.scroller_saved[0]=b.scrollLeft(),setTimeout(function(){k=!0},20)}})),i.off(h).on(h,f.throttle(function(){!e.scroller_isBusy&&k&&(j=!1,b.$table.parent()[0].scrollTop=e.scroller_saved[1]=a(this).scrollTop(),setTimeout(function(){j=!0},20))})).scroll(),""!==e.scroller_rowHighlight&&(h="mouseover mouseleave ".split(" ").join(g+" "),b.$table.off(h,"tbody > tr").on(h,"tbody > tr",function(a){var c=b.$table.children("tbody").children("tr").index(this);i.children("table").children("tbody").children("tr").eq(c).add(this).toggleClass(e.scroller_rowHighlight,"mouseover"===a.type)}),i.find("table").off(h,"tbody > tr").on(h,"tbody > tr",function(a){var c=i.children("table").children("tbody").children("tr"),d=c.index(this);b.$table.children("tbody").children("tr").eq(d).add(this).toggleClass(e.scroller_rowHighlight,"mouseover"===a.type)}))},adjustWidth:function(a,b,e,f,g){var h=b.scroller_$container;h.children("."+d.scrollerTable).css(g?"right":"left",e),h.children("."+d.scrollerHeader+", ."+d.scrollerFooter).css(g?"right":"left",e+(g&&c.scroller.isSafari?f:0))},updateFixed:function(b,e){var f,g,h=e.scroller_$container,i=e.scroller_$header,j=e.scroller_$footer,k=b.$table,l=k.parent(),m=e.scroller_barSetWidth,n=k.hasClass(d.scrollerRtl);if(0===e.scroller_fixedColumns)return e.scroller_isBusy=!1,c.scroller.removeFixed(b,e),f=h.width(),l.width(f),g=c.scroller.hasScrollBar(l)?m:0,void i.parent().add(j.parent()).width(f-g);if(b.isScrolling){e.scroller_isBusy=!0,h.find("."+d.scrollerFixed).length||c.scroller.setupFixed(b,e);var o,p,q,r,s,t,u,v=e.scroller_$container.children("."+d.scrollerTable).children("table").children("tbody"),w=e.scroller_$header.children("thead").children("."+d.headerRow),x=e.scroller_$fixedColumns.addClass(d.scrollerHideElement),y=x.find("."+d.scrollerTable).children("table"),z=y.children("tbody"),A=c.scroller,B=e.scroller_fixedColumns,C=k.find("tbody td"),D=parseInt(C.css("border-right-width"),10)||1,E=parseInt((C.css("border-spacing")||"").split(/\s/)[0],10)/2||0,F=parseInt(k.css("padding-left"),10)+parseInt(k.css("padding-right"),10)-D,G=e.scroller_calcWidths;for(c.scroller.removeFixed(b,e,!1),o=0;B>o;o++)F+=G[o]+E;for(F=F+2*D-E,A.setWidth(x.add(x.children()),F),A.setWidth(x.children().children("table"),F),p=0;p
q;q++)s=a(w[q].outerHTML),s.children("td, th").slice(B).remove(),t.append(s);c.processTbody(y,t,!1)}for(g=c.scroller.hasScrollBar(l)?m:0,(A.isFirefox||A.isOldIE)&&y.css("width",F).parent().css("width",F+g),x.removeClass(d.scrollerHideElement),o=0;B>o;o++)h.children("div").children("table").find("th:nth-child("+(o+1)+"), td:nth-child("+(o+1)+")").addClass(d.scrollerHideColumn);F-=D,f=l.parent().innerWidth()-F,l.width(f),h.children("."+d.scrollerTable).css(n?"right":"left",F),h.children("."+d.scrollerHeader+", ."+d.scrollerFooter).css(n?"right":"left",F+(n&&c.scroller.isSafari?g:0)),i.parent().add(j.parent()).width(f-g),f=c.scroller.hasScrollBar(l,!0),g=f?m:0,!x.find("."+d.scrollerBarSpacer).length&&f?(C=a('').css("height",g+"px"),x.find("."+d.scrollerTable).append(C)):f||x.find("."+d.scrollerBarSpacer).remove(),c.scroller.updateRowHeight(b,e),x.height(h.height()),x.removeClass(d.scrollerHideElement),x.find("caption").height(e.scroller_$header.find("caption").height()),e.scroller_isBusy=!1}},fixHeight:function(a,b){var c,e,f,g,h,i=d.scrollerAddedHeight,j=a.length;for(c=0;j>c;c++)g=a.eq(c),h=b.eq(c),e=g.height(),f=h.height(),e>f?h.addClass(i).height(e):f>e&&g.addClass(i).height(f)},updateRowHeight:function(a,b){var e,f,g=b.scroller_$fixedColumns;b.scroller_$container.find("."+d.scrollerAddedHeight).removeClass(d.scrollerAddedHeight).height(""),e=b.scroller_$header.children("thead").children("tr"),f=g.children("."+d.scrollerHeader).children("table").children("thead").children("tr"),c.scroller.fixHeight(e,f),e=b.scroller_$footer.children("tfoot").children("tr"),f=g.children("."+d.scrollerFooter).children("table").children("tfoot").children("tr"),c.scroller.fixHeight(e,f),(c.scroller.isFirefox||c.scroller.isOldIE)&&(g=g.find("."+d.scrollerHack)),e=a.$table.children("tbody").children("tr"),f=g.children("."+d.scrollerTable).children("table").children("tbody").children("tr"),c.scroller.fixHeight(e,f)},removeFixed:function(a,b,c){var e=a.$table,f=b.scroller_$container,g=e.hasClass(d.scrollerRtl);(c||"undefined"==typeof c)&&f.find("."+d.scrollerFixed).remove(),f.find("."+d.scrollerHideColumn).removeClass(d.scrollerHideColumn),f.children(":not(."+d.scrollerFixed+")").css(g?"right":"left",0)},remove:function(c,e){var f=e.scroller_$container,g=c.namespace+"tsscroller";c.$table.off(g),a(b).off(g),f&&(c.$table.insertBefore(f).find("thead").removeClass(d.scrollerHideElement).children("tr."+d.headerRow).children().attr("tabindex",0).end().find("."+d.filterRow).removeClass(d.scrollerHideElement+" "+d.filterRowHide),c.$table.find("."+d.filter).not("."+d.filterDisabled).prop("disabled",!1),f.remove(),c.isScrolling=!1)}}}(jQuery,window);