!function(t){t.fn.cardtable=function(a){var s=this,d={headIndex:0},e=t.extend({},d,a);return a&&a.headIndex?a.headIndex:0,s.each(function(){var a=t(this);if(!a.hasClass("stacktable")){var s=t(this).prop("class"),d=t("
");void 0!==e.myClass&&d.addClass(e.myClass);var l,n,r,i,h,o="";a.addClass("stacktable large-only"),l=a.find(">caption").clone(),n=a.find(">thead>tr,>tbody>tr,>tfoot>tr,>tr").eq(0),a.siblings().filter(".small-only").remove(),a.find(">tbody>tr").each(function(){r="",i="",h=t(this).prop("class"),t(this).find(">td,>th").each(function(a){""!==t(this).html()&&(i+='',n.find(">td,>th").eq(a).html()?i+=''+n.find(">td,>th").eq(a).html()+" | ":i+=' | ',i+=''+t(this).html()+" | ",i+="
")}),o+='"}),a.find(">tfoot>tr>td").each(function(a,d){""!==t.trim(t(d).text())&&(o+='")}),d.prepend(l),d.append(t(o)),a.before(d)}})},t.fn.stacktable=function(a){var s,d=this,e={headIndex:0,displayHeader:!0},l=t.extend({},e,a);return s=a&&a.headIndex?a.headIndex:0,d.each(function(){var a=t(this).prop("class"),d=t('');void 0!==l.myClass&&d.addClass(l.myClass);var e,n,r,i,h,o,c,f="";(e=t(this)).addClass("stacktable large-only"),n=e.find(">caption").clone(),r=e.find(">thead>tr,>tbody>tr,>tfoot>tr").eq(0),c=void 0===e.data("display-header")?l.displayHeader:e.data("display-header"),e.find(">tbody>tr").each(function(a){i="",h="",o=t(this).prop("class"),0===a?c&&(f+=''+t(this).find(">th,>td").eq(s).html()+" |
"):(t(this).find(">td,>th").each(function(a){a===s?i=''+t(this).html()+" |
":""!==t(this).html()&&(h+='',r.find(">td,>th").eq(a).html()?h+=''+r.find(">td,>th").eq(a).html()+" | ":h+=' | ',h+=''+t(this).html()+" | ",h+="
")}),f+=i+h)}),d.prepend(n),d.append(t(f)),e.before(d)})},t.fn.stackcolumns=function(a){var s=this,d={},e=t.extend({},d,a);return s.each(function(){var a=t(this),s=a.find(">thead>tr,>tbody>tr,>tfoot>tr").eq(0).find(">td,>th").length;if(!(s<3)){var d=t('');void 0!==e.myClass&&d.addClass(e.myClass),a.addClass("stacktable large-only");for(var l=t(""),n=1;nthead>tr,>tbody>tr,>tfoot>tr").each(function(a){var s=t("
");0===a&&s.addClass("st-head-row st-head-row-main");var d=t(this).find(">td,>th").eq(0).clone().addClass("st-key"),e=n;if(t(this).find("*[colspan]").length){var r=0;t(this).find(">td,>th").each(function(){var a=t(this).attr("colspan");if(a?(a=parseInt(a,10),e-=a-1,r+a>n&&(e+=r+a-n-1),r+=a):r++,r>n)return!1})}var i=t(this).find(">td,>th").eq(e).clone().addClass("st-val").removeAttr("colspan");s.append(d,i),l.append(s)}),++n;d.append(t(l)),a.before(d)}})}}(jQuery);