function(){varparsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};functionbenchmark(s,d){log(s+","+(newDate().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;functionlog(s){if(typeofconsole!="undefined"&&typeofconsole.debug!="undefined"){console.log(s);}else{alert(s);}}functionbuildParserCache(table,$headers){if(table.config.debug){varparsersDebug="";}if(table.tBodies.length==0)return;varrows=table.tBodies[0].rows;if(rows[0]){varlist=[],cells=rows[0].cells,l=cells.length;for(vari=0;i<l;i++){varp=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}elseif((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,rows,-1,i);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}returnlist;};functiondetectParserForColumn(table,rows,rowIndex,cellIndex){varl=parsers.length,node=false,nodeValue=false,keepLooking=true;while(nodeValue==''&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug){log('Checking if value was empty on row:'+rowIndex);}}else{keepLooking=false;}}for(vari=1;i<l;i++){if(parsers[i].is(nodeValue,table,node)){returnparsers[i];}}returnparsers[0];}functiongetNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){returnrows[rowIndex].cells[cellIndex];}functiontrimAndGetNodeText(config,node){return$.trim(getElementText(config,node));}functiongetParserById(name){varl=parsers.length;for(vari=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){returnparsers[i];}}returnfalse;}functionbuildCache(table){if(table.config.debug){varcacheTime=newDate();}vartotalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(vari=0;i<totalRows;++i){varc=$(table.tBodies[0].rows[i]),cols=[];if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue;}cache.row.push(c);for(varj=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]));}cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}returncache;};functiongetElementText(config,node){vartext="";if(!node)return"";if(!config.supportsTextContent)config.supportsTextContent=node.textContent||false;if(config.textExtraction=="simple"){if(config.supportsTextContent){text=node.textContent;}else{if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){text=node.childNodes[0].innerHTML;}else{text=node.innerHTML;}}}else{if(typeof(config.textExtraction)=="function"){text=config.textExtraction(node);}else{text=$(node).text();}}returntext;}functionappendToTable(table,cache){if(table.config.debug){varappendTime=newDate()}varc=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(vari=0;i<totalRows;i++){varpos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){varl=r[pos].length;for(varj=0;j<l;j++){tableBody[0].appendChild(r[pos][j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd"
$(document).ready(function(){varholdTheInterval;varnbEssai=25;varessai=0;varurl='';varpostUrl='';varmenuD;varcaseC;varcaseC2;vartype;varargv;$('#telechargementjs').click(function(e){e.preventDefault();postUrl=$(this).attr('href');if($('select[name=telechargementjsMenu]').val()=='invalide'){$('#telechargementjsMsg').html('Vous devez sélectionner une période.');return;}
$('select[name=telechargementjsMenu]').attr('disabled',true);$('input[name=telechargementjsCase]:checkbox').attr('disabled',true);$('input[name=telechargementjsCase2]:checkbox').attr('disabled',true);menuD=$('select[name=telechargementjsMenu]').val();caseC=$('input[name=telechargementjsCase]').prop('checked')?true:false;caseC2=$('input[name=telechargementjsCase2]').prop('checked')?true:false;type=$('input[name=page]').val();argv=$('input[name=argv]').val();checkFile();holdTheInterval=setInterval(checkFile,4000);});functioncheckFile(){essai++;if(essai>nbEssai){essai=0;updateInfo('Le temps maximum d\'attente a été atteint.'+' Merci de réessayez.');$('select[name=telechargementjsMenu]').removeAttr('disabled');$('input[name=telechargementjsCase]:checkbox').removeAttr('disabled');$('input[name=telechargementjsCase2]:checkbox').removeAttr('disabled');}else{$('#telechargementjsMsg').text('Patientez pendant la construction du fichier ('+