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