mw.loader.implement("jquery.tablesorter",function(){(function($,mw){var ts,parsers=[];function getParserById(name){var len=parsers.length;for(var i=0;i4)?5:rows.length;while(i=needed){return parsers[i];}}else{i++;rowIndex=0;concurrent=0;}}else{rowIndex++;if( rowIndex>rows.length){rowIndex=0;i++;}}}return parsers[0];}function buildParserCache(table,$headers){var rows=table.tBodies[0].rows,sortType,parsers=[];if(rows[0]){var cells=rows[0].cells,len=cells.length,i,parser;for(i=0;i tbody > tr');if(!$table.get(0).tHead){var $thead=$('');$rows.each(function(){if($(this).children('td').length>0){return false;}$thead.append(this);});$table.find(' > tbody:first').before($thead);}if(!$table.get(0).tFoot){var $tfoot=$('');var len=$rows.length;for(var i=len-1;i>=0;i--){if($($rows[i]).children('td').length>0){break;}$tfoot.prepend($($rows[i]));}$table.append($tfoot);}}function buildHeaders(table,msg){var maxSeen=0,longest,realCellIndex =0,$tableHeaders=$('thead:eq(0) > tr',table);if($tableHeaders.length>1){$tableHeaders.each(function(){if(this.cells.length>maxSeen){maxSeen=this.cells.length;longest=this;}});$tableHeaders=$(longest);}$tableHeaders=$tableHeaders.children('th').each(function(index){this.column=realCellIndex;var colspan=this.colspan;colspan=colspan?parseInt(colspan,10):1;realCellIndex+=colspan;this.order=0;this.count=0;if($(this).is('.unsortable')){this.sortDisabled=true;}if(!this.sortDisabled){var $th=$(this).addClass(table.config.cssHeader).attr('title',msg[1]);}table.config.headerList[index]=this;});return $tableHeaders;}function isValueInArray(v,a){var l=a.length;for(var i=0;ib)?1:0));}function sortTextDesc(a,b){return((ba)?1:0));}function multisort(table,sortList,cache){var sortFn=[];var len=sortList.length;for(var i=0;i tbody > tr > [rowspan]').each(function(){var rowSpan=this.rowSpan;this.rowSpan=1;var cell=$(this);var next=cell.parent().nextAll();for(var i=0;i tbody > tr.sortbottom');if($sortbottoms.length){var $tfoot=$table.children('tfoot');if($tfoot.length){$tfoot.eq(0).prepend($sortbottoms);}else{$table.append($('').append($sortbottoms));}}explodeRowspans($table);table.config.parsers=buildParserCache(table,$headers);}cache=buildCache(table);var totalRows=($table[0].tBodies[0]&&$table[0].tBodies[0].rows.length)||0;if(!table.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count%2; this.count++;if(!e[config.sortMultiSortKey]){config.sortList=[];config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j