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 of otoscopy</B>",0,"Y");


menu.AddFile("Normal Tympanic ",1,"../atlas_index/03.html");
menu.AddFile("Scarred eardrum ",1,"../atlas_index/18.html");
menu.AddFile("Operated ear ",1,"../atlas_index/15.html");

 menu.AddFolder("<B>Cholesteatoma</B>",1,"N");
   menu.AddFile("Cholesteatoma",2,"../atlas_index/01.html");
   menu.AddFile("Congenital",2,"../atlas_index/02.html");

 menu.AddFolder("<B>Miscellaneous</B>",1,"N");
   menu.AddFile("Glomus tumor",2,"../atlas_index/04.html");
   menu.AddFile("Facial neuroma",2,"../atlas_index/05.html");
   menu.AddFile("Miscellaneous",2,"../atlas_index/16.html");

 menu.AddFolder("<B>Otitis</B>",1,"N");
   menu.AddFile("Acute otitis media",2,"../atlas_index/06.html");
   menu.AddFile("Sero-mucinous",2,"../atlas_index/07.html");

 menu.AddFolder("<B>Tympanics perforations</B>",1,"N");
   menu.AddFile("Simple membrane",2,"../atlas_index/08.html");
   menu.AddFile("Marginales",2,"../atlas_index/09.html");
   menu.AddFile("With defect of ossicular chain",2,"../atlas_index/10.html");
   menu.AddFile("Traumatic",2,"../atlas_index/11.html");

 menu.AddFolder("<B>Tympanic membrane retraction</B>",1,"N");
   menu.AddFile("Stage 1",2,"../atlas_index/12.html");
   menu.AddFile("Stage 2",2,"../atlas_index/13.html");
   menu.AddFile("Stage 3",2,"../atlas_index/14.html");

 menu.AddFolder("<B>Exteral auditory canal pathology</B>",1,"N");
   menu.AddFile("Aspergillosis",2,"../atlas_index/22.html");
   menu.AddFile("Cerumen",2,"../atlas_index/20.html");
   menu.AddFile("Iatrogenic cholesteatoma",2,"../atlas_index/21.html");
   menu.AddFile("Foreign body",2,"../atlas_index/17.html");
   menu.AddFile("Exostosis",2,"../atlas_index/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();