var cltsensTri = new Array(1,1,1,-1,0)
var cltptrs    = new Array()
var cltdata = new Array()
var clttitres = new Array()
var bgprec = ""
// =========================================================================
function generClassement(m) {
	iptrs=new Array()
	var buffer=""
	var nompilote=""
	var manchespilote=""
	var id=0
	var d=0
	var nd=0
	bgprec="'#f5f5f5'"
	var idclub=m	
	var isClub=false
	var isSerieB=false
	if(m>100)
		{
		isClub=true;
		m=trouve(regions,'A','"')
		cltsensTri = new Array(1,1,1,1,-1,0)
		clttitres = new Array('','serie','place','pilote','points','manches')
		}
	else
		clttitres = new Array('','place','pilote','points','manches')

	if (!m)
		m=0
		
	nl = classements[m].length

	// remplissage du tableau
	cltdata = new Array()
	for ( il = 0 ; il < nl ; il++ )
		{
		id=classements[m][il]
		regser=4+regions[m][0].length

		nompilote=pilotes[id][3]+' '+pilotes[id][4] //prenom nom
    afficheserie=''
    if (regions[m][0].length==2 && pilotes[id][5]=='A')
      afficheserie='<font color=red>(A)</font> '
		manchespilote=details[m][il]
		if(regions[m][0].length==1) manchespilote=manchespilote.substring(2,1000)
		buffer=(pilotes[id][0]==pilotecherche) ? "<A name=p id=p>" : ""

		//if (!isClub && pilotes[id][regser]==regions[m][0])
		if (!isClub)
		   cltdata[nd++]= new Array(pilotes[id][0],places[m][il],nompilote,points[m][il],"<font size=-1>"+afficheserie+manchespilote+"</font>")
		if (isClub && pilotes[id][7]==idclub)
		   cltdata[nd++]= new Array(pilotes[id][0],pilotes[id][regser],places[m][il],nompilote,points[m][il],"<font size=-1>"+manchespilote+"</font>")
		if(isClub && il==nl-1 && isSerieB==false)
			{
			m=trouve(regions,'B','"')
  			nl = classements[m].length
  			il=-1;
  			isSerieB=true;
			}	
		//else
		//   {nd++;cltdata[il]= new Array(pilotes[id][0],'','','')}
		}

	if(cltptrs.length==0)
		{
		dw("<DIV style='background:#f5f5f5' id='divclt'></DIV>")
		cltptrs=generGrid("clt")
		calc_podium(true)
		}
	else
		{
		cltsensTri[colprec]=cltsensTri[colprec]
		cltptrs=resultat("clt",colprec)
		}
	bool=true
}

