var menu=new CreerMenu("#000000","#660000","#000099","file.gif","folder_f.gif","folder_o.gif","vide18.gif","trait_vert.gif","trait_coud.gif","trait_droit.gif",18,"right");
//CreerMenu(ColorRubF,ColorRubO,ColorLien,imgFile,imgF,imgO,imgVide,imgVertic,imgCoud,imgDroit,hauteur,nomFrame)

menu.AddFolder("<B>Atlas d'Otoscopie</B>",0,"Y");


menu.AddFile("Tympan normal ",1,"../indexatlas_otosc/03.html");
menu.AddFile("Tympan cicatriciel",1,"../indexatlas_otosc/18.html");
menu.AddFile("Tympan opere",1,"../indexatlas_otosc/15.html");

 menu.AddFolder("<B>Cholesteatome</B>",1,"N");
   menu.AddFile("Otite chronique",2,"../indexatlas_otosc/01.html");
   menu.AddFile("Congenital",2,"../indexatlas_otosc/02.html");

 menu.AddFolder("<B>Divers</B>",1,"N");
   menu.AddFile("Tumeur glomique",2,"../indexatlas_otosc/04.html");
   menu.AddFile("Neurinome du VII",2,"../indexatlas_otosc/05.html");
   menu.AddFile("Divers",2,"../indexatlas_otosc/16.html");

 menu.AddFolder("<B>Otite</B>",1,"N");
   menu.AddFile("Moyenne aigue",2,"../indexatlas_otosc/06.html");
   menu.AddFile("Sero-muqueuse",2,"../indexatlas_otosc/07.html");

 menu.AddFolder("<B>Perforations tympaniques</B>",1,"N");
   menu.AddFile("Simples",2,"../indexatlas_otosc/08.html");
   menu.AddFile("Marginales",2,"../indexatlas_otosc/09.html");
   menu.AddFile("Avec atteinte ossiculaires",2,"../indexatlas_otosc/10.html");
   menu.AddFile("Traumatiques",2,"../indexatlas_otosc/11.html");

 menu.AddFolder("<B>Poches de retraction</B>",1,"N");
   menu.AddFile("Stade 1",2,"../indexatlas_otosc/12.html");
   menu.AddFile("Stade 2",2,"../indexatlas_otosc/13.html");
   menu.AddFile("Stade 3",2,"../indexatlas_otosc/14.html");

 menu.AddFolder("<B>Pathologies du CAE</B>",1,"N");
   menu.AddFile("Aspergillose",2,"../indexatlas_otosc/22.html");
   menu.AddFile("Bouchons de cerumen",2,"../indexatlas_otosc/20.html");
   menu.AddFile("Colesteatome du conduit",2,"../indexatlas_otosc/21.html");
   menu.AddFile("Corps etrangers",2,"../indexatlas_otosc/17.html");
   menu.AddFile("Exostoses",2,"../indexatlas_otosc/19.html");

function disp(txt) { parent.frames["left"].document.write(txt) }
function CreerMenu(ColorRubF,ColorRubO,ColorLien,imgFile,imgF,imgO,imgVide,imgVertic,imgCoud,imgDroit,hauteur,nomFrame) {
	this.colorRubF=ColorRubF
	this.colorRubO=ColorRubO
	this.colorLien=ColorLien
	this.imgFile=imgFile;
	this.imgF=imgF;
	this.imgO=imgO;
	this.imgVide=imgVide;
	this.imgVertic=imgVertic;
	this.imgCoud=imgCoud;
	this.imgDroit=imgDroit;
	this.hauteur=hauteur;
	this.nomFrame=nomFrame;

	this.nb_obj=0;

	this.AddFolder=AddFol;
	this.AddFile=AddFil;
	this.Aff=AffMenu;
}
function AddFil(txt,deep,act) {
	var obj = new Object;
		obj.txt=txt;
		obj.deep=deep;
		obj.type="file";
		obj.act=act;
		obj.last=false;
	this[this.nb_obj]=obj;
	this.nb_obj++;
}
function AddFol(txt,deep,open,page) {
	var obj = new Object;
		obj.txt=txt;
		obj.deep=deep;
		obj.open=open;
		obj.type="folder";
		obj.last=false;
		obj.page="";
		if ((page!=null)&&(page!='undefined')) {obj.page=page;}
	this[this.nb_obj]=obj;
	this.nb_obj++;
}
function IsLast() {
	for (var nb=1;nb<menu.nb_obj;nb++) {
		var last=true;
		for (var i=nb+1;i<menu.nb_obj;i++) {
			if (menu[i].deep<menu[nb].deep) {i=menu.nb_obj;}
			else if (menu[i].deep==menu[nb].deep) {last=false; i=menu.nb_obj;}
		}

		menu[nb].last=last;
	}
}
function Space(indice) {
	var deep_indice=menu[indice].deep;
	if (indice!=0) {
		if (menu[indice].last) {var aff="<IMG SRC='"+menu.imgCoud+"' height='18' BORDER=0 ALT='' ALIGN='top' vspace=0>";}
		else {var aff="<IMG SRC='"+menu.imgVertic+"' height='18' BORDER=0 ALT='' ALIGN='top' vspace=0>";}
		for (var i=indice;i>0;i--) {
			if (menu[i].deep==deep_indice-1) {
				deep_indice--;
				if (menu[i].last) {aff="<IMG SRC='"+menu.imgVide+"' height='18' BORDER=0 ALT='' ALIGN='top' vspace=0>"+aff;}
				else {aff="<IMG SRC='"+menu.imgDroit+"' height='18' BORDER=0 ALT='' ALIGN='top' vspace=0>"+aff;}
				if (deep_indice==1) {i=0;}
			}	
		}
	disp(aff);
	}
}

function AffImg(img) {
	disp("<IMG SRC='"+img+"' height='18' BORDER=0 ALT='' ALIGN='top' vspace=0>");
}
function IsOpen(men,i) {
	var deep_i=men[i].deep;
	var open="Y";
	for (var j=i-1;j>=0;j--) {
		if (men[j].deep<deep_i) {open=men[j].open;j=-1}
	}
	return open;
}
function AffMenu() {
	var img="";
	var obj="";
	var col="";

disp("<FONT size=1 face='Verdana, Arial, Helvetica, sans-serif' color='#000099'><BR>");
	for (var i=0;i<this.nb_obj;i++) {
		var obj=this[i];
		if (obj.type=="folder") {
			if (IsOpen(this,i)=="Y") {
				Space(i);
				if (obj.open=="Y") {AffImg(this.imgO); col=this.colorRubO;}
				if (obj.open=="N") {AffImg(this.imgF); col=this.colorRubF;}
				disp("<A href='javascript:Clic("+i+")'><FONT color='"+col+"'>");
				disp(obj.txt+"</FONT></A><BR>");
			}
		}
		if (obj.type=="file") {
			if (IsOpen(this,i)=="Y") {
				Space(i);
				AffImg(this.imgFile);
				disp("<A target='right' href='"+obj.act+"'><FONT color='"+this.colorLien+"'>"+obj.txt+"</FONT></A><BR>");
			}
		}
	}
	disp("</FONT>");
}
IsLast();