//Définition des variables
var Liste=new Menu();		//Menu contenant les menus princpaux
var Largeur=100,Hauteur=18;	//Largeur des menus et sous menus
var DivTop=20;DivLeft=20;	//Position du menu par rapport au bord de la feuille (en pixels)
var Open;					//Variable contenant la liste des sous menus affichés
var MOut='#bfbfbf';		//Couleur des menus non survolés
var MOver='#9e9e9e';		//Couleur des menus survolés
var SMOut='#bfbfbf';		//Couleur des sous menus non survolés
var SMOver='#ffffff';		//Couleur des sous menus survolés
var Timer=500,Time;		//Timer : Temps à attendre pour que le menu s'efface (nul => désactivé)
var LgID;
var Affichage,Com;

//Définition des menus et sous menus
Liste.State=1;
Liste.nb=0;
Liste.ID=Open="Liste";
LgID=Open.length;

Liste.AddM("Peintres");
    Liste.SMenu[0].AddM("Arcelin","http://www.artchic.com/jean-arcelin/index.htm");
	Liste.SMenu[0].AddM("Bahamon","http://www.artchic.com/bahamon/index.htm");
    Liste.SMenu[0].AddM("bordaries","http://www.artchic.com/bordaries/index.htm");
    Liste.SMenu[0].AddM("bourquin","http://www.artchic.com/bourquin/index.htm");
	Liste.SMenu[0].AddM("Braslins","http://www.artchic.com/braslins/index.htm");
	Liste.SMenu[0].AddM("Bravo","http://www.artchic.com/bravo/index.htm");
	Liste.SMenu[0].AddM("Burlet","http://www.artchic.com/burlet/index.htm");
	Liste.SMenu[0].AddM("Bravo","http://www.artchic.com/bravo/index.htm");
	Liste.SMenu[0].AddM("Calzolari","http://www.artchic.com/calzolari/index.htm");
	Liste.SMenu[0].AddM("Couarraze","http://www.artchic.com/couarraze/index.htm");
	Liste.SMenu[0].AddM("Desaché","http://www.artchic.com/desache/index.htm");
	Liste.SMenu[0].AddM("Falconi","http://www.artchic.com/falconi/index.htm");
	Liste.SMenu[0].AddM("Gazier","http://www.artchic.com/gazier/index.htm");
	Liste.SMenu[0].AddM("Hoffer","http://www.artchic.com/peterhoffer/index.htm");
	Liste.SMenu[0].AddM("Ivoy","http://www.artchic.com/ivoy/index.htm");
	Liste.SMenu[0].AddM("Kowalczuk","http://www.artchic.com/kowalczuk/index.htm");
	Liste.SMenu[0].AddM("Marchal","http://www.artchic.com/marchal/index.htm");
	Liste.SMenu[0].AddM("Monvoisin","http://www.artchic.com/monvoisin/index.htm");
	Liste.SMenu[0].AddM("Papisca","http://www.artchic.com/papisca/index.htm");
	Liste.SMenu[0].AddM("Quintavalla","http://www.artchic.com/quintavalla/index.htm");
	Liste.SMenu[0].AddM("Ranucci","http://www.artchic.com/ranucci/index.htm");
	Liste.SMenu[0].AddM("Skrypka","http://www.artchic.com/skrypka/index.htm");
	Liste.SMenu[0].AddM("Soler","http://www.artchic.com/soler/index.htm");
	Liste.SMenu[0].AddM("Zadorine","http://www.artchic.com/zadorine/index.htm");	
	Liste.SMenu[0].AddM("Zaslonov","http://www.artchic.com/zaslonov/index.htm");
				
Liste.AddM("Sculpteurs");
    Liste.SMenu[1].AddM("Bissara","http://www.artchic.com/bissara/index.htm");
	Liste.SMenu[1].AddM("Bloch","http://www.artchic.com/bloch/index.htm");
	Liste.SMenu[1].AddM("Britto","http://www.artchic.com/britto/britto-romero.htm");
	Liste.SMenu[1].AddM("Corby","http://www.artchic.com/corby/index.htm");
	Liste.SMenu[1].AddM("Guerrieri","http://www.artchic.com/guerrieri/guerrieri-veronique.htm");
	Liste.SMenu[1].AddM("Krug","http://www.artchic.com/laure-krug/index.htm");
	Liste.SMenu[1].AddM("Le Bescond","http://www.artchic.com/le-bescond/index.htm");
	Liste.SMenu[1].AddM("Mazel & Jalix","http://www.artchic.com/mazel-jalix/index.htm");
	Liste.SMenu[1].AddM("Lluis Roig Comas","http://www.artchic.com/lluis-roig-comas/index.htm");
	Liste.SMenu[1].AddM("Salcedo","http://www.artchic.com/salcedo/index.htm");
	Liste.SMenu[1].AddM("Tolla","http://www.artchic.com/Tolla/index.htm");
	Liste.SMenu[1].AddM("Youn","http://www.artchic.com/youn/index.htm");
	
Liste.AddM("Photographes");
    Liste.SMenu[2].AddM("Steve McCurry","http://www.artchic.com/photographe/steve-mccurry/index.htm");
    Liste.SMenu[2].AddM("Antony Crossfield","http://www.artchic.com/photographe/antony-crossfield/antonycrossfield.htm");
    Liste.SMenu[2].AddM("Anthony Gayton","http://www.artchic.com/photographe/anthony-gayton/gayton.htm");
	Liste.SMenu[2].AddM("Elliott Erwitt","http://www.artchic.com/photographe/elliotterwitt/index.htm");
	
function Menu(){
	this.Titre;				//Titre du menu
	this.State;				//Positif : Menu affiché ; Négatif : Menu masqué
	this.nb;				//Nombre de sous menus
	this.ID;				//Identifiant du menu ou sous menu
	this.SMenu=new Array();
	this.Lvl=Level;
	this.AddM=AddMenu;
	this.Aff=AffMenu;
	this.AffB=AffBetween;
}

	//Fonction chargée de créer les sous menus
		//Nom : Texte qui sera affiché sur la page HTML
		//Lien (optionel) : Lien hypertexte associé à l'entrée du menu
		//Dest (optionel) : Frame cible du lien
function AddMenu(Nom,Lien,Dest){
	this.SMenu[this.nb]=new Menu();
	if(Lien)
		if(Dest)this.SMenu[this.nb].Titre='<a href="'+Lien+'" target="'+Dest+'">'+Nom+'</a>';
		else this.SMenu[this.nb].Titre='<a href="'+Lien+'">'+Nom+'</a>';
	else this.SMenu[this.nb].Titre=Nom;
	this.SMenu[this.nb].State=-1;
	this.SMenu[this.nb].nb=0;
	this.SMenu[this.nb].ID=this.ID+'.SMenu['+this.nb+']';
	this.nb++;
}

	//Fonction chargée de donner le nombre de sous niveaux maximum
		//Level de l'objet
function Level(Lvl){
	var i;
	LvlMax=Lvl?LvlMax:0;
	LvlMax=LvlMax<Lvl?Lvl:LvlMax;
	if(this.nb)
		for(i=0;i<this.nb;i++){
			this.SMenu[i].Lvl(Lvl+1);
		}
	return LvlMax;
}

	//Fonction chargée d'afficher ou masquer les menus
		//Level : Place de la case en largeur
		//Num : Place de la case en hauteur
function AffMenu(Level,Num){
	var i,ColorOut,ColorOver;
	ColorOut=(Level)?SMOut:MOut;
	ColorOver=(Level)?SMOver:MOver;
	document.getElementById('ListeLvl'+Level).style.top=Num*Hauteur+DivTop;
	Affichage="";
	if(this.State>0){
		Affichage="<table bgColor="+ColorOut+">";
		for(i=0;i<this.nb;i++){
			Affichage+="<tr bgColor='";
			Affichage+=this.SMenu[i].State>0?ColorOver:ColorOut;
			Affichage+="' ";
			Affichage+="onMouseOut='"+this.SMenu[i].ID+".State>0?this.setAttribute(\"bgColor\",\""+ColorOver+"\"):this.setAttribute(\"bgColor\",\""+ColorOut+"\");";
			Affichage+=Timer?"Time=setTimeout(\""+Open.substring(0,LgID)+".AffB(0,0)\","+Timer+")' ":"' ";
			Affichage+="onMouseOver='this.setAttribute(\"bgColor\",\""+ColorOver+"\");";
			Affichage+=Timer?"clearTimeout(Time);":"";
			Affichage+=this.SMenu[i].Lvl(0)?this.SMenu[i].ID+".AffB("+(Level+1)+","+(Num+i)+")' ":"' ";
			Affichage+="><td width="+(Largeur+20)+" height="+Hauteur+">";
			Affichage+=this.SMenu[i].Titre;
			// Affichage+="</td><td width=10>";
			// Affichage+=this.SMenu[i].nb?">":"";
			Affichage+="</td></tr>";
		}
	Affichage+="</table>";
	}
	document.getElementById('ListeLvl'+Level).innerHTML=Affichage;
	document.getElementById('ListeLvl'+Level).style.visibility="visible";
}

	//Fonction chargée d'afficher le sous menu sélectionné
		//Level : Niveau du sous menu à afficher
		//Num : Numéro du sous menu à afficher
function AffBetween(Level,Num){
	for(i=(LgID+Level*9),j=0;i<=Open.length;i+=9,j++)eval(Open.substring(0,i)+".State=-1");
	this.State=-this.State;
	if(LgID+Level*9<=Open.length){
		if(Level>1){
			Com=Open.substring(0,LgID+(Level-1)*9)+".State=1;"+Open.substring(0,LgID+(Level-1)*9)+".Aff("+(Level-1)+",(";
			for(i=12;i<LgID+(Level-1)*9;i+=9)Com+=Open.charAt(i)+"+";
			Com+="0))";
		}
		else Com=Open.substring(0,LgID)+".State=1;"+Open.substring(0,LgID)+".Aff(0,0)";
		eval(Com);
	}
	for(i=Level;i<Liste.Lvl(0);i++){
		document.getElementById('ListeLvl'+i).style.visibility="hidden";
	}
	this.Aff(Level,Num);
	Open=this.ID;
}

	//Fonction chargée d'afficher les menus au chargement de la page
function InitMenu(){
	var i;
	for(i=0;i<Liste.Lvl(0);i++){
		document.write("<div ID='ListeLvl"+i+"' style='position:absolute;left:"+(i*(Largeur+4)+DivLeft)+"'></div>");
	}
	Liste.Aff(0,0);
}

