function writeNavigation01(sTagUd, DataForm, sUrl, NbrEltByPage, iMaxPage, sFontFace, iSize, sColor,sImgPrec, sImgSuiv, bOnePage){

	/* NbrEltByPage = Nombre d'element par page			*/
	/* iMaxPage     = Nombre maximun de page à afficher		*/
	/* sFontFace    = la fonte d'affichae     (facultatif)		*/
	/* iSize        = taille des caracteres   (facultatif)		*/
	/* sColor       = couleur des caracteres  (facultatif)		*/
	/* sImgPrec     = fichier image pour precedent (facultatif)	*/
	/* sImgSuiv     = fichier image pour suivant (facultatif)	*/
	/* bOnePage     = Affiche ou non la pagination si il y'a une seule page (facultatif)	*/
	/*		bOnePage ='true' : affiche la pagination	*/
	/*		Sinon		 : N'affiche pas la pagination	*/

	var sPageActive=GetPageActive(sTagUd, DataForm);
	var sNombrePage= GetNombrePage(sTagUd, DataForm, NbrEltByPage);
	var sText = '';	
	if ((typeof(bOnePage)=='undefined')||(bOnePage=='')){
		bOnePage = 'true';
	}
	if ((sNombrePage > 1) || ((sNombrePage == 1) && (bOnePage=='true'))){
		var scote=String.fromCharCode(39);

		if ((typeof(sColor)=='undefined')||(sColor=='')){
			sColor = '#D88534';
		}
		if ((typeof(iSize)=='undefined')||(iSize=='')){
			iSize = 3;
		}
		if ((typeof(sFontFace)=='undefined')||(sFontFace=='')){
			sFontFace = 'Times New Roman';
		}
		if ((typeof(sImgPrec)=='undefined')||(sImgPrec=='')){
			sImgPrec = '';
		}
		if ((typeof(sImgSuiv)=='undefined')||(sImgSuiv=='')){
			sImgSuiv = '';
		}

		sText += '<TABLE cellspacing="0" cellpadding="0" border="0" width="100%"><TR>';
		sText += '<TD ALIGN=RIGHT><FONT face=' + sFontFace + ' size='+ iSize +' color=' + sColor + '><B>';
		sText += '<a href="javascript:Prev(' + scote + sTagUd + scote + ',';
		sText += scote + sUrl + scote + ', document.' + DataForm.name + ');">';
		if (sImgPrec!=''){
			sText += '<IMG ID="precedent" NAME="precedent" SRC="' + sImgPrec + '" BORDER="0">';
		}
		else{	
			sText += 'Precedent';
		}
		sText += '</a>';
		sText += '</B></FONT></TD>';
		sText += '<TD ALIGN=CENTER><FONT face=' + sFontFace + ' size='+ iSize +' color=' + sColor + '>';
		sText += '<B>| Page ' + sPageActive +' / ' + sNombrePage + ' |</B>';
		sText += '</FONT></TD>';
		sText += '<TD ALIGN=LEFT><FONT face=' + sFontFace + ' size='+ iSize +' color=' + sColor + '>';
		sText += '<B><a href="javascript:Next(' + scote + sTagUd + scote + ',' + scote + sUrl + scote + ',';
		sText += 'document.' + DataForm.name + ');">';
		if (sImgSuiv!=''){
			sText += '<IMG ID="suivant" NAME="suivant" SRC="' + sImgSuiv + '" BORDER="0">';
		}
		else{	
			sText += 'Suivant';
		}
		sText += '</a></B></FONT></TD>';
		sText += '</TR></TABLE>';
	}
	document.write(sText);
}

function writeNavigation02(sTagUd, DataForm, sUrl, NbrEltByPage, iMaxPage, sFontFace,iSize, sColor,sImgPrec, sImgSuiv, bOnePage){


	var nbrpage=0;
	var scote=String.fromCharCode(39);
	var sText='';
	var nb=0;
	var nPageActive=GetPageActive(sTagUd, DataForm);
	var nFirstpage=0;
	var nLastpage=0;

	if ((typeof(sColor)=='undefined')||(sColor=='')){
		sColor = '#D88534';
	}
	if ((typeof(iSize)=='undefined')||(iSize=='')){
		iSize = 3;
	}
	if ((typeof(sFontFace)=='undefined')||(sFontFace=='')){
		sFontFace = 'Times New Roman';
	}
	if ((typeof(sImgPrec)=='undefined')||(sImgPrec=='')){
		sImgPrec = '';
	}
	if ((typeof(sImgSuiv)=='undefined')||(sImgSuiv=='')){
		sImgSuiv = '';
	}
	if ((typeof(bOnePage)=='undefined')||(bOnePage=='')){
		bOnePage = 'true';
	}

	nbrpage = GetNombrePage(sTagUd, DataForm, NbrEltByPage);
	if ((nbrpage > 1) || ((nbrpage == 1) && (bOnePage=='true'))){
		if (nPageActive <= iMaxPage){
			nFirstpage = 1;
		}
		else{
			nFirstpage = Number(nPageActive - ((nPageActive-1) % iMaxPage));
		}
		/* nFirstpage = Number((( GetDivInt(nPageActive,(iMaxPage+1))  )*iMaxPage)+1); */

		nLastpage=nFirstpage + iMaxPage-1;
		if (nLastpage>nbrpage){
			nLastpage=nbrpage;
		}


		if (nbrpage>0){
			sText += '<TABLE cellspacing="0" cellpadding="0" border="0" width="100%">';
			sText += '<TR>';

			sText += '<TD WIDTH="30%" ALIGN=RIGHT VALIGN=MIDDLE>';
			sText += '<FONT face=' + sFontFace + ' size='+ iSize +' color=' + sColor + '><B>';
			if (nFirstpage > 1 ) {
				sText += '&nbsp;<a href="javascript:PaginationGoto(\'' + sTagUd + '\',' ;
				sText += '\'' + sUrl + '\', document.' + DataForm.name + ',' + Number(Number(nFirstpage)-iMaxPage) + ');">';
				if (sImgSuiv!=''){
					sText += '<IMG ID="precedent" NAME="precedent" SRC="' + sImgPrec + '" BORDER="0">';
				}
				else{	
					sText += '<<';
				}
				sText += '</a>';
			}
			sText+='</B></FONT>';
			sText += '</TD>';

			sText += '<TD WIDTH="40%" VALIGN=MIDDLE ALIGN=CENTER>';
			sText += '<FONT face=' + sFontFace + ' size='+ iSize +' color=' + sColor + '>';
			sText += '<B>Page ';

			for (var i=nFirstpage;i<=nLastpage;i++){
				if (i!=nPageActive){
					sText += '&nbsp;<a href="javascript:PaginationGoto(\'' + sTagUd + '\',' ;
					sText += '\'' + sUrl + '\', document.' + DataForm.name + ',' + i + ');">';
					sText += i;
					sText += "</a>&nbsp;|";
				}
				else{
					sText += '&nbsp;<FONT size=' + Number(iSize + 1) + '>' + i + "</FONT>&nbsp;|";
				}
			}
			sText+='</B></FONT>';
			sText += '</TD>';

			sText += '<TD WIDTH="30%" VALIGN=MIDDLE>';
			sText += '<FONT face=' + sFontFace + ' size='+ iSize +' color=' + sColor + '><B>';

			if (nLastpage<nbrpage ) {

				sText += '&nbsp;<a href="javascript:PaginationGoto(\'' + sTagUd + '\',' ;
				sText += '\'' + sUrl + '\', document.' + DataForm.name + ',' + Number(Number(nLastpage)+1) + ');">';
				if (sImgSuiv!=''){
					sText += '<IMG ID="suivant" NAME="suivant" SRC="' + sImgSuiv + '" BORDER="0">';
				}
				else{	
					sText += '>>';
				}
				sText += '</a>';
			}
			sText+='</B></FONT>';
			sText += '</TD>';
			sText+='</TR></TABLE>';

		}
	}
	document.write(sText);
}
function writeNavigation03(sTagUd, DataForm, sUrl, NbrEltByPage, iMaxPage, sFontFace,iSize, sColor,sImgPrec, sImgSuiv,iWidth, iLargeurBlock, iHeightBlock,bOnePage){


	var sPageActive=GetPageActive(sTagUd, DataForm);
	var sNombrePage= GetNombrePage(sTagUd, DataForm, NbrEltByPage);
	var sText = '';	
	if ((typeof(bOnePage)=='undefined')||(bOnePage=='')){
		bOnePage = 'true';
	}
	if ((sNombrePage > 1) || ((sNombrePage == 1) && (bOnePage == 'true'))){
		var scote=String.fromCharCode(39);
   
		if ((typeof(sColor)=='undefined')||(sColor=='')){
			sColor = '#D88534';
		}
		if ((typeof(iSize)=='undefined')||(iSize=='')){
			iSize = 3;
		}
		if ((typeof(sFontFace)=='undefined')||(sFontFace=='')){
			sFontFace = 'Times New Roman';
		}
		if ((typeof(sImgPrec)=='undefined')||(sImgPrec=='')){
			sImgPrec = '';
		}
		if ((typeof(sImgSuiv)=='undefined')||(sImgSuiv=='')){
			sImgSuiv = '';
		}
		if ((typeof(iWidth)=='undefined')||(iWidth=='')){
			iWidth = 200;
		}
		if ((typeof(iLargeurBlock)=='undefined')||(iLargeurBlock=='')){
			iLargeurBlock = 20;
		}
		if ((typeof(iHeightBlock)=='undefined')||(iHeightBlock=='')){
			iHeightBlock = 10;
		}

		sText += '<TABLE cellspacing="0" cellpadding="0" border="0" width="' + (iWidth+(iWidth/2)) + 'px"><TR>';
		sText += '<TD ALIGN=CENTER VALIGN=MIDDLE WIDTH="' + (iWidth/4) + 'px"><FONT face=' + sFontFace + ' size='+ iSize +' color=' + sColor + '><B>';
		sText += '<a href="javascript:Prev(' + scote + sTagUd + scote + ',';
		sText += scote + sUrl + scote + ', document.' + DataForm.name + ');">';
		if (sImgPrec!=''){
			sText += '<IMG ID="precedent" NAME="precedent" SRC="' + sImgPrec + '" BORDER="0">';
		}
		else{	
			sText += 'Precedent';
		}
		sText += '</a>';
		sText += '</B></FONT></TD>';

		sText += '<TD valign=middle ALIGN=center WIDTH="' + iWidth + 'px"><FONT face=' + sFontFace + ' size='+ iSize +' color=' + sColor + '>';
		sText += DrawBarre(sTagUd, DataForm, sUrl, NbrEltByPage, sPageActive, iWidth, iLargeurBlock, iHeightBlock);
		sText += '</FONT></TD>';

		sText += '<TD ALIGN=CENTER VALIGN=MIDDLE WIDTH="' + (iWidth/4) + 'px"><FONT face=' + sFontFace + ' size='+ iSize +' color=' + sColor + '>';
		sText += '<B><a href="javascript:Next(' + scote + sTagUd + scote + ',' + scote + sUrl + scote + ',';
		sText += 'document.' + DataForm.name + ');">';
		if (sImgSuiv!=''){
			sText += '<IMG ID="suivant" NAME="suivant" SRC="' + sImgSuiv + '" BORDER="0">';
		}
		else{	
			sText += 'Suivant';
		}
		sText += '</a></B></FONT></TD>';
		sText += '</TR></TABLE>';
	}
	document.write(sText);

}

function Next(sTagUd, sUrl, dataForm) {
	if (dataForm[sTagUd + "_page_next"].value != 0) {
		dataForm.action = sUrl + '&' + sTagUd + '_page=' +  dataForm[ sTagUd + "_page_next"].value;
		dataForm.method = "post";
		dataForm.submit();
	} else {
		alert('Vous avez atteint la fin de la liste !');
	}
}
function Prev(sTagUd, sUrl, dataForm) {
	if (dataForm[ sTagUd + "_page_prev"].value != 0) {
		dataForm.action = sUrl + '&' + sTagUd + '_page=' +  dataForm[ sTagUd + "_page_prev"].value;
		dataForm.method = "post";
		dataForm.submit();
	} else {
		alert('Vous avez atteint le début de la liste !');
	}
}

function PaginationGoto(sTagUd, sUrl, dataForm, Num) {
	dataForm.action = sUrl + '&' + sTagUd + '_page=' +  Num;
	dataForm.method = "post";
	dataForm.submit();
}

function GetDivInt(i, diviseur) {
	return Number((Number((i-(i %  diviseur)) /  diviseur)));
}
function GetNombrePage(sTagUd, dataForm, NbrEltByPage) {
	var i;
	i = GetNombreElementTotal(sTagUd, dataForm);
	return Number((Number((i-(i %  NbrEltByPage)) /  NbrEltByPage) + Number(((i %  NbrEltByPage)>0)?(1):(0))));
}
function GetPageActive(sTagUd, dataForm) {
	return Number(Number(dataForm[sTagUd + "_page_prev"].value)+1);
}
function GetNombreElementTotal(sTagUd, dataForm) {
	return dataForm[sTagUd + "_page_total"].value;
}
function GetTauxChargement(sTagUd, dataForm, NbrEltByPage) {
	if (GetNombrePage(sTagUd, dataForm, NbrEltByPage) > 0) {
		return 100 * (GetPageActive(sTagUd, dataForm) / GetNombrePage(sTagUd, dataForm, NbrEltByPage));
	} else {
		return 100;
	}
}

function DrawBarre(sTagUd, DataForm, sUrl, NbrEltByPage, sPageActive, iWidth, iLargeurBlock, iHeight) {

	var cmd = '';
	var sHref;
	var iNbrPage = GetNombrePage(sTagUd, DataForm, NbrEltByPage);
	var iNumPage=0;
	var sMapVar='';
	var sMapAll='';

	var iLarg1 = GetDivInt((sPageActive*iWidth), iNbrPage);
	if (GetDivInt(iLargeurBlock, (iWidth/iNbrPage)) == 0) {
		iLargeurBlock = GetDivInt(iWidth , iNbrPage);
	} else {
		iLargeurBlock = GetDivInt( iLargeurBlock, (iWidth/iNbrPage)); // Nbr page par block
		iLargeurBlock = iLargeurBlock * GetDivInt(iWidth , iNbrPage);
	}

	iWidth = iNbrPage * (GetDivInt(iWidth, iNbrPage));

	if ((sPageActive % ((iLargeurBlock * iNbrPage)/iWidth)) == 0) {
		iLarg1 = GetDivInt(sPageActive, ((iLargeurBlock * iNbrPage)/iWidth) );
		iLarg1 *= iLargeurBlock;
	} else {
		iLarg1 = GetDivInt(sPageActive, ((iLargeurBlock * iNbrPage)/iWidth) )+1;
		iLarg1 *= iLargeurBlock;
	}

	for (var i=0; i<iLarg1;i+=(iLargeurBlock)) {
		iNumPage = GetDivInt( ((i+1)*iNbrPage), iWidth)+1;

		sHref = '';
		sHref += '"javascript:PaginationGoto(\'' + sTagUd + '\',' ;
		sHref += '\'' + sUrl + '\', document.' + DataForm.name + ',' + iNumPage + ');"';
		sMapVar += '<AREA SHAPE="RECT" COORDS="' + i + ',0,' + (i+(iLargeurBlock-1)) + ',' + iHeight + '" HREF=' + sHref + '>';
	}
	for (var i=0; i<(iWidth - iLarg1);i+=(iLargeurBlock)) {
		iNumPage = GetDivInt( (((i+1)+iLarg1)*iNbrPage), iWidth)+1;
		sHref = '';
		sHref += '"javascript:PaginationGoto(\'' + sTagUd + '\',' ;
		sHref += '\'' + sUrl + '\', document.' + DataForm.name + ',' + iNumPage + ');"';
		sMapAll += '<AREA SHAPE="RECT" COORDS="' + i + ',0,' + (i+(iLargeurBlock-1)) + ',' + iHeight + '" HREF=' + sHref + '>';
	}

	cmd += '<MAP NAME="MapVar">';
	cmd += sMapVar;
	cmd += '</MAP>';

	cmd += '<MAP NAME="MapALL">';
	cmd += sMapAll;
	cmd += '</MAP>';

	cmd += '<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 VALIGN=TOP HEIGHT="' + iHeight + 'px" WIDTH="' + iWidth + 'px">';
	cmd += '<TR HEIGHT="' + iHeight + 'px">';
	cmd += '<TD valign=middle WIDTH="' + iLarg1 + 'px">';
	cmd += '<IMG BORDER=0 SRC="image/admin/barre_gauche.gif" WIDTH="' + iLarg1 + 'px" HEIGHT="' + iHeight + 'px" useMap=#MapVar>';
	cmd += '</TD>';
	if ((iWidth - iLarg1)>0) {
		cmd += '<TD  valign=middle WIDTH="' + (iWidth - iLarg1) + 'px">';
		cmd += '<IMG BORDER=0 SRC="image/admin/barre_droite.gif" WIDTH="' + (iWidth - iLarg1) + 'px" HEIGHT="' + iHeight + 'px" USEMAP=#MapALL>';
		cmd += '</TD>';
	}
	cmd += '</TR></TABLE>';
	return(cmd);
}
