<!--
function PagingTool( id, pagingVarName, nbRecordset, nbRecordPerPage, handler , strHeader){

/* Identifiant des elements */
this.id = id;
this.pagingVarName = pagingVarName;
this.nbRecordset = nbRecordset;
this.nbRecordPerPage = nbRecordPerPage;
this.handler = handler;
this.pagingDOM = Object;
this.strHeader = strHeader;

this.currentIndex = 1;

/* Création et affichage des elements */
this.init = function (){
    var a = Object;
    var nbPage = Math.ceil( parseInt(this.nbRecordset) / parseInt(this.nbRecordPerPage) );
    var pagingVarName = this.pagingVarName;
    this.pagingDOM=$C("div");

    while( $(this.id).firstChild ){
      $(this.id).removeChild( $(this.id).firstChild );
    }

    if( this.nbRecordset>0 ){
      if( this.strHeader ){
        this.pagingDOM.appendChild( document.createTextNode( this.strHeader ) );
      }

      a = $C( "a" );
      a.setAttribute( "href", "#" );
      a.className = "pageIndexFirstDisable";
      a.id = "pageIndexFirst";
      a.appendChild( document.createTextNode( " " ) );
      this.pagingDOM.appendChild(a);

      a = $C( "a" );
      a.setAttribute( "href", "#" );
      a.className = "pageIndexPreviousDisable";
      a.id = "pageIndexPrevious";
      a.appendChild( document.createTextNode( " " ) );
      this.pagingDOM.appendChild(a);

      for( var i=1; i<(nbPage+1); i++ ){
        a = $C( "a" );
        a.setAttribute( "href", "#" );
        a.onclick = function(){var j=i;eval(pagingVarName+".selectionInfo("+this.id.substr(9, (this.id.length-9) )+")");eval(handler+"("+this.id.substr(9, (this.id.length-9) )+");");}
        if(i==this.currentIndex){
          a.className = "pageIndexSelected";
        }else{
          a.className = "pageIndex";
        }
        a.id = "pageIndex"+i;
        a.appendChild( document.createTextNode( i ) );
        this.pagingDOM.appendChild(a);
      }
  
  
      a = $C( "a" );
      a.setAttribute( "href", "#" );
      a.onclick = function(){eval(pagingVarName+".selectionInfo( "+( parseInt(this.currentIndex)+1 )+" )");eval(handler+"("+ (this.currentIndex) +");");};
      a.className = "pageIndexNext";
      a.id = "pageIndexNext";
      a.appendChild( document.createTextNode( " " ) );
      this.pagingDOM.appendChild(a);
  
      a = $C( "a" );
      a.setAttribute( "href", "#" );
      a.onclick = function(){eval(pagingVarName+".selectionInfo( "+nbPage+" )");eval(handler+"("+ nbPage +");");};
      a.className = "pageIndexLast";
      a.id = "pageIndexLast";
      a.appendChild( document.createTextNode( " " ) );
      this.pagingDOM.appendChild(a);
  //    this.pagingDOM.appendChild( document.createTextNode( " /"+nbPage ) );

      $( this.id ).appendChild( this.pagingDOM );
      this.selectionInfo( this.currentIndex );
    }
  }

/* Création du tableau */
this.selectionInfo = function ( i ){
//    if( $("pageIndex"+this.currentIndex) ){
      $("pageIndex"+this.currentIndex).className = "pageIndex";
//    }
//    if( $("pageIndex"+i) ){
      $("pageIndex"+i).className = "pageIndexSelected";
//    }
    this.currentIndex = i;
    this.checkNextPrevious ( i );
  }

this.checkNextPrevious = function ( i ){
    var nbPage = Math.ceil( parseInt(this.nbRecordset) / parseInt(this.nbRecordPerPage) );

    if( (i+1) > nbPage ){
      $("pageIndexLast").onclick = function(){};
      $("pageIndexLast").className = "pageIndexLastDisable";
      $("pageIndexNext").onclick = function(){};
      $("pageIndexNext").className = "pageIndexNextDisable";
    }else{
      $("pageIndexLast").onclick = function(){eval(pagingVarName+".selectionInfo( "+nbPage+" )");eval(handler+"("+nbPage+");");};
      $("pageIndexLast").className = "pageIndexLast";
      $("pageIndexNext").onclick = function(){eval(pagingVarName+".selectionInfo( "+( parseInt(i)+1 )+" )");eval(handler+"("+ (i+1) +");");};
      $("pageIndexNext").className = "pageIndexNext";
    }
    if( i < 2 ){
      $("pageIndexFirst").onclick = function(){};
      $("pageIndexFirst").className = "pageIndexFirstDisable";
      $("pageIndexPrevious").onclick = function(){};
      $("pageIndexPrevious").className = "pageIndexPreviousDisable";
    }else{
      $("pageIndexFirst").onclick = function(){eval(pagingVarName+".selectionInfo( "+( 1 )+" )");eval(handler+"("+ 1 +");");};
      $("pageIndexFirst").className = "pageIndexFirst";
      $("pageIndexPrevious").onclick = function(){eval(pagingVarName+".selectionInfo( "+( parseInt(i)-1 )+" )");eval(handler+"("+ (i-1) +");");};
      $("pageIndexPrevious").className = "pageIndexPrevious";
    }
  }

}
//-->
