var i=0;
var taille=0;
var crt=new Array();
var charger=false;

//-------------------------------------------------------------
function lst(nv,et,nb,dv,ab,nm,out,over,alt)
{
this.nv=nv;
this.et=et;
this.nb=nb;
this.dv=dv;
this.ab=ab;
this.nm=nm;
this.out=out;
this.over=over;
this.alt=alt;
}

//-------------------------------------------------------------
function bon()
{
charger=true;
}


//-------------------------------------------------------------

function demarre()
{
if (charger)
{
init();
tempo=setTimeout("affiche()",100);
}
else
{
tempo=setTimeout("demarre()",100);
}
}



//-------------------------------------------------------------
function init()
{
charger=true;
i=0;

crt[i++]=new lst(0,true,2,false,"accueil.htm","menqui","img/men-qui.gif","img/men-qui2.gif","Qui sommes-nous?");
crt[i++]=new lst(1,false,0,false,"vocation.htm","menqui1","#","#","Notre vocation");
crt[i++]=new lst(1,false,0,false,"groupe.htm","menqui2","#","#","Primexis");
crt[i++]=new lst(0,true,3,false,"dommaines.htm","mencomp","img/men-comp.gif","img/men-comp2.gif","Nos compétences");
crt[i++]=new lst(1,false,0,false,"dommaines.htm","mencomp1","#","#","Nos domaines <img src=\"./img/pix.gif\" width=\"10\" hspace=\"8\" height=\"1\" border=\"0\">d'intervention");
crt[i++]=new lst(1,false,0,false,"missions.htm","mencomp2","#","#","Exemples de missions");
crt[i++]=new lst(1,false,0,false,"contact.htm","mencomp3","#","#","Vos contacts");
//crt[i++]=new lst(0,true,0,false,"cgi/partenaire.pl","menpart","img/men-part.gif","img/men-part2.gif","Nos partenaires");
crt[i++]=new lst(0,true,0,false,"projet.htm","menproj","img/men-proj.gif","img/men-proj2.gif","Votre projet");
crt[i++]=new lst(0,true,0,false,"recrute.htm","menrecr","img/men-recr.gif","img/men-recr2.gif","Nous recrutons");
crt[i++]=new lst(0,true,0,false,"telecharger.htm","mendown","img/men-down.gif","img/men-down2.gif","Téléchargement");

taille=i;
}


//-------------------------------------------------------------
function devtout()
{
if (!charger) init();
for(i=0;i<taille;i++)
        {
        crt[i].et=true;
        if(crt[i].nb!=0) crt[i].dv=true;
        }
tempo=setTimeout("affiche()",100);
}

//-------------------------------------------------------------
function redtout()
{
if (!charger) init();
for(i=0;i<taille;i++)
        {
        if(crt[i].nv!=0) crt[i].et=false;
        crt[i].dv=false;
		
        }
tempo=setTimeout("affiche()",100);
}

//-------------------------------------------------------------
function affiche()
{

aff=self.menu.window.document;
aff.open("text/html");
aff.writeln("<html><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>");
aff.writeln("<head></head><link rel=stylesheet type=\"text/css\" href=\"../menu.css\">");
aff.writeln("<body bgcolor='#EE9C00' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' text='#ffffff' link='FFFFFF' vlink='FFFFFF' alink='ffffff'>");
aff.writeln("<table background='./img/fd-menu.gif' width='154' border=0 cellpadding=0 cellspacing=0><tr><td><img src='./img/pix.gif' width=1 height='429' border=0></td><td valign=top><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td height=\"260\" valign=top><img src=\"./img/pix.gif\" width=1 height=1 border=0><br><br>");

for(i=0;i<taille;i++)
        {
        if(crt[i].et)
	            {
                if(crt[i].nv==0)
                        {
                        aff.writeln("<br>"); 
                        aff.write("<a href=\"" + crt[i].ab + "\" target='corps\' onmouseover=\"document." + crt[i].nm + ".src=\'" + crt[i].over + "\';");
							for(k=0;k<taille;k++){
							if (k!=i && crt[k].nv==0 && crt[k].dv==false) aff.write("document." + crt[k].nm + ".src=\'" + crt[k].out + "\';");
							}
						aff.write("\" onclick=\"");
		                if(!crt[i].dv && i==0) aff.write("parent.devrep(1, 0);");
		                if(!crt[i].dv && i==3) aff.write("parent.devrep(2, 3);");
		                if(!crt[i].dv && i!=0 && i!=3) aff.write("parent.devrep(3, " + i + ");");
						if(!crt[i].dv) aff.write("\" onmouseout=\"document." + crt[i].nm + ".src=\'" + crt[i].out + "\';\" >");
						if(crt[i].dv) aff.write("\" onmouseout=\"document." + crt[i].nm + ".src=\'" + crt[i].over + "\';\" >");
                        aff.write("<img name=\"" + crt[i].nm + "\" src=\"");
						if(crt[i].dv) aff.write(crt[i].over);
						if(!crt[i].dv) aff.write(crt[i].out);
						aff.write("\" border=0 vspace=\"4\" alt=\"" + crt[i].alt + "\"></a>");
                        }
                else
                        {
                        aff.writeln("<br>"); 
                        aff.write("<img src=\"./img/carrej.gif\" width=\"6\" hspace=\"8\" height=\"6\" vspace=\"1\"><font face=\"arial\" size=1><a href=\"" + crt[i].ab + "\"  target='corps\' class=ssmenu>" + crt[i].alt + "</a></font>");
                        }
                }
        }
        
aff.writeln("</td></tr><tr><td align=\"right\" valign=\"top\" background=\"./img/pix.gif\"><a href=\"./plan.htm\" target=\"corps\"><img src=\"img/plan.gif\" hspace=\"10\" alt=\"Acces map\" border=0></a></td></table></tr></table>")
aff.writeln("</body>");
aff.writeln("</html>");
aff.close();
window.status="";
}


//-------------------------------------------------------------
function devrep(n, j)
{

var x;
if (!charger) init();


	if (n==1) {
		crt[0].dv=true; 
		crt[1].et=true; 
		crt[2].et=true; 
		crt[3].dv=false; 
		crt[4].et=false; 
		crt[5].et=false; 
		crt[6].et=false;
		crt[7].dv=false; 
		crt[8].dv=false; 
		crt[9].dv=false; 
	}

	if (n==2) {
		crt[0].dv=false; 
		crt[1].et=false; 
		crt[2].et=false; 
		crt[3].dv=true; 
		crt[4].et=true; 
		crt[5].et=true; 
		crt[6].et=true;
		crt[7].dv=false; 
		crt[8].dv=false; 
		crt[9].dv=false; 
	}

	if (n==3) {
		crt[0].dv=false; 
		crt[1].et=false; 
		crt[2].et=false; 
		crt[3].dv=false; 
		crt[4].et=false; 
		crt[5].et=false; 
		crt[6].et=false; 
		crt[j].dv=true; 
		if (j!=7) crt[7].dv=false; 
		if (j!=8) crt[8].dv=false; 
		if (j!=9) crt[9].dv=false; 
	}


	tempo=setTimeout("affiche()",400);
	
}

//-------------------------------------------------------------
function ferme(n)
{

var x;
if (!charger) init();

if (n!=null)
{
	if (crt[n].nv!=1) redtout(); 

	if(crt[n].dv)

       {

		   for(x=n;x<=(n+crt[n].nb);x++)
           {
              if(x!=n) crt[x].et=false;
              crt[x].dv=false;
           }
       }
	 
	 else
	 
	   {
        crt[n].dv=true;
        for(x=n;x<=(n+crt[n].nb);x++) if((crt[n].nv+1)==crt[x].nv) crt[x].et=true;
		tempo=setTimeout("affiche()",500);

	   }

	
}

}

//-------------------------------------------------------------


demarre();


