nbrdata=3;
outstyle="";
outstyle+="<STYLE TYPE=\"text/css\">";
outstyle+="#lay0{POSITION:absolute;TOP:0px; LEFT:0px;width:147px;visibility:hidden;z-index:2;}";
output="";
output+="<DIV ID=\"lay0\"></DIV>";


current_level=0;
current_obj=new Array;
current_i=new Array;
current_obj[current_level]=Trubrique5;
current_i[current_level]=0;
explore();


function explore(){
	cptleve10=0;
	cptleve11=0;
	cptleve12=0;
	cptleve13=0;
	state=1;
	while (state>0)	state=explore_array();
	outstyle+="</STYLE>";
}


// fonction recursive
function explore_array(){

	for(i=current_i[current_level]; i<((current_obj[current_level].length)); i+=nbrdata){	
		if (current_obj[current_level][i+(nbrdata-1)].length !=0) picto="activites";
		else picto="fiches";
		switch(current_level) {
			case 0: cptleve10++;cptleve11=0;cptleve12=0;cptleve13=0;level0(current_obj[current_level][i],current_obj[current_level][i+1],picto,cptleve10);break;
			case 1: cptleve11++;cptleve12=0;cptleve13=0;level1(current_obj[current_level][i],current_obj[current_level][i+1],picto,cptleve11,cptleve10);break;
			case 2: cptleve12++;cptleve13=0;level2(current_obj[current_level][i],current_obj[current_level][i+1],picto,cptleve12,cptleve11,cptleve10);break;
			case 3: cptleve13++;level3(current_obj[current_level][i],current_obj[current_level][i+1],picto,cptleve13,cptleve12,cptleve11,cptleve10);break;
		}

		if (current_obj[current_level][i+(nbrdata-1)].length !=0){
			current_i[current_level]=i+nbrdata;			
			current_level++;
			current_i[current_level]=0;	
			current_obj[current_level]=current_obj[current_level-1][i+(nbrdata-1)];
			return true;
		}

	}
	current_i[current_level]=0;
	current_level--;

	if (current_level==0 && current_i[current_level]>=((current_obj[current_level].length))) return false;
	return true;
}


function level0(n,m,x,o){
	
	output+="<DIV ID=\"lay"+o+"\"><TABLE WIDTH=\"147\" CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\"><TR><TD CLASS=\"menuHigh\"><IMG SRC=\"" + 
repbase + "corporatesite.nsf/PictureList/pix_vide/$File/pix_vide.gif\" WIDTH=\"1\" HEIGHT=\"20\" BORDER=\"0\"></TR></TD><TR><TD CLASS=\"menuHigh\">";
	
	if (niveau1==n) { 
	output+="<TABLE CLASS=\"menuHigh\" WIDTH=\"147\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"4\"><TR><TD WIDTH=\"11\" VALIGN=\"top\"><IMG SRC=\"" + repbase + "corporatesite.nsf/PictureList/navg_particuliersentreprises/$File/navleft_off.gif\" ALT=\""+n+"\" BORDER=\"0\" VSPACE=\"3\" NAME=\"nav"+o+"\"></TD><TD CLASS=\"menuHigh\" WIDTH=\"100%\"><A HREF=\""+m+"\" CLASS=\"menuHigh\"><FONT COLOR=\"#F7E169\">"+n+"</FONT></A></TD></TR></TABLE>";
	}
	
	else
	{
	output+="<TABLE CLASS=\"menuHigh\" WIDTH=\"147\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"4\"><TR><TD WIDTH=\"11\" VALIGN=\"top\"><IMG SRC=\"" + repbase + "corporatesite.nsf/PictureList/navg_particuliersentreprises/$File/navleft_off.gif\" ALT=\""+n+"\" BORDER=\"0\" VSPACE=\"3\" NAME=\"nav"+o+"\"></TD><TD CLASS=\"menuHigh\" WIDTH=\"100%\"><A HREF=\""+m+"\"  CLASS=\"menuHigh\">"+n+"</A></TD></TR></TABLE>";
	}
	
	output+="</TD></TR></TABLE></DIV>";
	outstyle+="#lay"+o+"{POSITION:absolute;TOP:0px; LEFT:0px;width:147px;visibility:hidden;z-index:2}";
	
	if (o==(Trubrique5.length/nbrdata)) {
	output+="<DIV ID=\"lay"+(o+1)+"\"><TABLE WIDTH=\"147\" CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\"><TR><TD CLASS=\"menuHigh\"><IMG SRC=\"" + repbase + "corporatesite.nsf/PictureList/pix_vide/$File/pix_vide.gif\" WIDTH=\"1\" HEIGHT=\"20\" BORDER=\"0\"><BR><A HREF=\"https://extranet.fbf.fr/\" TARGET=\"_blank\"><IMG SRC=\"" + repbase + "corporatesite.nsf/PictureList/navg_particuliersentreprises/$File/navg_bas.gif\" BORDER=0></A></TD></TR></TABLE></DIV>";
	outstyle+="#lay"+(o+1)+"{POSITION:absolute;TOP:0px; LEFT:0px;width:147px;visibility:hidden;z-index:2}";
	}
}

function level1(n,m,x,o,p){
	output+="<DIV ID=\"lay"+p+"n"+o+"\"><TABLE WIDTH=\"147\" CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\"><TR><TD WIDTH=\"6\" NOWRAP CLASS=\"menuHigh\" VALIGN=\"top\"><IMG SRC=\"" + repbase + "corporatesite.nsf/PictureList/pix_vide/$File/pix_vide.gif\" WIDTH=\"6\" HEIGHT=\"1\" BORDER=\"0\"></TD><TD BGCOLOR=\"#FFFFFF\" WIDTH=\"1\"><IMG SRC=\"" + repbase + "corporatesite.nsf/PictureList/pix_vide/$File/pix_vide.gif\" WIDTH=\"1\" HEIGHT=\"1\" BORDER=\"0\"></TD><TD BGCOLOR=\"#FFFFFF\" CLASS=\"menuLow\" VALIGN=\"top\" ALIGN=\"center\" WIDTH=\"10\">></TD><TD CLASS=\"menuLow\" WIDTH=\"124\" NOWRAP VALIGN=\"top\">";

	if (niveau2==n) { 
	if (m!="") output+="<A HREF=\""+m+"\"><FONT COLOR=\"#F7E169\">"+n+"</FONT></A>";
	else output+="<A HREF=\"javascript:ouvre("+p+","+o+")\">"+n+"</A>";
	}
	
	else {
	if (m!="") output+="<A HREF=\""+m+"\">"+n+"</A>";
	else output+="<A HREF=\"javascript:ouvre("+p+","+o+")\">"+n+"</A>";
	}
	
	output+="</TD><TD WIDTH=\"2\" NOWRAP CLASS=\"menuLow\"><IMG SRC=\"" + repbase + "corporatesite.nsf/PictureList/pix_vide/$File/pix_vide.gif\" WIDTH=\"2\" HEIGHT=\"1\"  BORDER=\"0\"></TD></TR></TABLE></DIV>";
	outstyle+="#lay"+p+"n"+o+"{POSITION:absolute;TOP:0px; LEFT:0px;width:147px;visibility:hidden;z-index:2}";
}


function level2(n,m,x,o,p,q){
	output+="<DIV ID=\"lay"+q+"n"+p+"n"+o+"\"><TABLE WIDTH=\"147\" CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\"><TR><TD WIDTH=\"16\" NOWRAP CLASS=\"menuHigh\" VALIGN=\"top\"><IMG SRC=\"" + repbase + "corporatesite.nsf/PictureList/pix_vide/$File/pix_vide.gif\" WIDTH=\"6\" HEIGHT=\"1\" BORDER=\"0\"></TD><TD BGCOLOR=\"#FFFFFF\" WIDTH=\"1\"><IMG SRC=\"" + repbase + "corporatesite.nsf/PictureList/pix_vide/$File/pix_vide.gif\" WIDTH=\"1\" HEIGHT=\"1\" BORDER=\"0\"></TD><TD BGCOLOR=\"#FFFFFF\" CLASS=\"menuLow\" VALIGN=\"top\" ALIGN=\"center\" WIDTH=\"10\">></TD><TD CLASS=\"menuLow\" WIDTH=\"114\" NOWRAP VALIGN=\"top\">";

	if (niveau2==n)
	 output+="<A HREF=\""+m+"\"><FONT COLOR=\"#F7E169\">"+n+"</FONT></A>";
	else 
	  output+="<A HREF=\""+m+"\">"+n+"</A>";
	
	output+="</TD><TD WIDTH=\"2\" NOWRAP CLASS=\"menuLow\"><IMG SRC=\"" + repbase + "corporatesite.nsf/PictureList/pix_vide/$File/pix_vide.gif\" WIDTH=\"2\" HEIGHT=\"1\"  BORDER=\"0\"></TD></TR></TABLE></DIV>";
	outstyle+="#lay"+q+"n"+p+"n"+o+"{POSITION:absolute;TOP:0px; LEFT:0px;width:147px;visibility:hidden;z-index:2}";
}


// acccede à un objet layer
function accessobjlay(nomdulayer){
	obj =eval("(document.all)?document.all."+nomdulayer+".style:(document.layers)?document."+nomdulayer+":document.getElementById(\""+nomdulayer+"\").style");
	return obj;
}
// acccede à une image
function accessobjimg(nomdulayer,numero){
	obj =eval("document.nav"+numero);
	return obj;
}

//Calcul la hauteur des layers
function calcheight(nomdulayer){
	HduLayer = eval ("(document.layers) ? document."+nomdulayer+".document.height: (document.all)?document.all."+nomdulayer+".offsetHeight:document.getElementById(\""+nomdulayer+"\").offsetHeight;;");
	return HduLayer;
}

function init(m,n,o){
	posi=0;
	for(i=1; i<(Trubrique5.length/nbrdata)+1; i++){
		objlay=	accessobjlay("lay"+i);
		objlay.left=posleft;
		objlay.top=postop+posi;
		posi+=calcheight("lay"+i);
		objlay.visibility="visible";
	}
	objlay=	accessobjlay("lay"+i);
	objlay.left=posleft;
	objlay.top=postop+posi;
	posi+=calcheight("lay"+i);
	objlay.visibility="visible";
		
	if (m || n || o) ouvre(m,n,o);
}


// efface tous les layers
function reset_all(){
	for(i=1; i<(Trubrique5.length/nbrdata)+1; i++){
		objlay=	accessobjlay("lay"+i);
		objlay.visibility="hidden";
		objimg=accessobjimg("lay"+i,i)
		objimg.src="" + repbase + "corporatesite.nsf/PictureList/navg_particuliersentreprises/$File/navleft_off.gif";
		for(j=1; j<(Trubrique5[(i*nbrdata)-1].length/nbrdata)+1; j++){
			objlay=	accessobjlay("lay"+i+"n"+j);
			objlay.visibility="hidden";
			for(k=1; k<(Trubrique5[(i*nbrdata)-1][(j*nbrdata)-1].length/nbrdata)+1; k++){
				objlay=	accessobjlay("lay"+i+"n"+j+"n"+k);
				objlay.left=posleft;
				objlay.visibility="hidden";
				for(l=1; l<(Trubrique5[(i*nbrdata)-1][(j*nbrdata)-1][(k*nbrdata)-1].length/nbrdata)+1; l++){
					objlay=	accessobjlay("lay"+i+"n"+j+"n"+k+"n"+l);
					objlay.left=posleft;
					objlay.visibility="hidden";
				}
			}
		}

	}
}
// ouvre la nav
function ouvre(m,n,o){
	reset_all();
	posi=0;
	for(i=1; i<(Trubrique5.length/nbrdata)+1; i++){
		objlay=	accessobjlay("lay"+i);
		objlay.left=posleft;
		objlay.top=postop+posi;
		posi+=calcheight("lay"+i);
		objlay.visibility="visible";
		if (m==i){
			objimg=accessobjimg("lay"+i,i)
			objimg.src="" + repbase + "corporatesite.nsf/PictureList/navg_particuliersentreprises/$File/navleft_on.gif";
			for(j=1; j<(Trubrique5[(i*nbrdata)-1].length/nbrdata)+1; j++){
				objlay=	accessobjlay("lay"+i+"n"+j);
				objlay.left=posleft;
				objlay.top=postop+posi;
				posi+=calcheight("lay"+i+"n"+j);
				objlay.visibility="visible";
				if (n==j){
					for(k=1; k<(Trubrique5[(i*nbrdata)-1][(j*nbrdata)-1].length/nbrdata)+1; k++){
						objlay=	accessobjlay("lay"+i+"n"+j+"n"+k);
						objlay.left=posleft;
						objlay.top=postop+posi;
						posi+=calcheight("lay"+i+"n"+j+"n"+k);
						objlay.visibility="visible";
						if (o==k){
							for(l=1; l<(Trubrique5[(i*nbrdata)-1][(j*nbrdata)-1][(k*nbrdata)-1].length/nbrdata)+1; l++){
								objlay=	accessobjlay("lay"+i+"n"+j+"n"+k+"n"+l);
								objlay.left=posleft;
								objlay.top=postop+posi;
								posi+=calcheight("lay"+i+"n"+j+"n"+k+"n"+l);
								objlay.visibility="visible";
							}
						}
					}
				}			
			}
		}
	}
	objlay=	accessobjlay("lay"+i);
		objlay.left=posleft;
		objlay.top=postop+posi;
		posi+=calcheight("lay"+i);
		objlay.visibility="visible";
}
// fixe un bug netscape
if (document.layers)
window.onresize =
function (e) { history.go(0); };

