this.oldbouton="false";
this.oldmenu="false";
efface_menu=-1
this.chemin_menu="/images/interface/";

function entre(nom)
{
document.images[nom].src=chemin_menu+nom+"_f2.gif";
this.oldbouton=nom;
}

function sort()
{
if(this.oldbouton!="false" && this.oldbouton!=this.mapage)
{document.images[oldbouton].src=chemin_menu+oldbouton+".gif";
this.oldbouton="false";}
}


function montre(nomlayer)
{
	hideit(false,nomlayer);
	this.oldmenu=nomlayer;
}


function cache()
{

if(this.oldmenu!="false")
	{
	hideit(true,oldmenu);
	hideit(true,"menu1");
	hideit(true,"menu2");
	hideit(true,"menu3");
	hideit(true,"menu4");
	this.oldmenu="false";
	}
if (efface_menu > -1)
	{
	clearTimeout(efface_menu);
	}
if(this.oldbouton!="false" && this.oldbouton!=this.mapage)
{document.images[oldbouton].src=chemin_menu+oldbouton+".gif";
this.oldbouton="false";}
}


function cacheapres(depart)
{
for (i=depart; i<5; i++)
	{
	hideit(true,("menu"+i));
	}
}


function timeout()
{
efface_menu=setTimeout("cache()", 500);
}


function cleartime()
{
if (efface_menu > -1)
	{
	clearTimeout(efface_menu);
	}
}
	
function hideit(action,nom_layer) {
  if (document.layers) {
    // Netscape 4 stuff
    var cible = document.layers[nom_layer];
  } else if (document.getElementById) {
    // IE 5 and Netscape 6
    var cible = document.getElementById(nom_layer);
  } else if (document.all) {
    // IE 4 ??
    var cible = document.all(nom_layer);
  } else {
    alert("Probl&egrave;me avec votre navigateur");
  }
  if (cible.style) 
  {
    // IE4 ??, IE5, Netscape 6

    if (action) { cible.style.visibility = "hidden"; } 
	else { cible.style.visibility = "visible"; }
  } 
  else {
    // Netscape 4
    if (action) { cible.visibility = "hide";} 
	else { cible.visibility = "show"; }
  }
}



function parent_enfant()
{

for (i=1; i<90; i++)
 {
  cat_a_enfant[i]=0;
 }
for (i=1; i<90; i++)
 {
 if(cat_parent[i] > 2)
  {
  cat_a_enfant[cat_parent[i]]=(cat_a_enfant[cat_parent[cat_parent[i]]]) + 1;
  }
 }
}


function souscalque(numducalque,origine,la_ligne)
 
 {
indice[1]=145;
if(origine==1)
{arrivee = 'catalogue';
origineh=190;
document.getElementById('menu1').style.left = '190px';
}
if(origine==2)
{arrivee='thematique';
origineh=270;
document.getElementById('menu1').style.left = '270px';
}

 nomducalque='menu'+numducalque;
 cellule='cell'+numducalque+'_'+la_ligne;
 couleur1="#fbd972";
 couleur2="#ffffed";
 if (numducalque>1){
 indice[numducalque]=indice[(numducalque-1)]+la_ligne*15
 document.getElementById(nomducalque).style.top = indice[numducalque]+'px';
 document.getElementById(nomducalque).style.left = (origineh+(numducalque-1)*200)+'px';
 }
 montre(nomducalque);
 

 machaine = '<table class="tab_zero">';
  ligne=0;
  for (i=1; i<90; i++)
  {
  if(cat_parent[i] == origine)
   {
   image_fleche='spacer';
   lecalque="";
   lecalque2="cacheapres("+(numducalque+1)+");";
   lelien='style="cursor:pointer" onclick="window.location.replace(\'/'+arrivee+'/?cid='+i+'\' );"';
   if(cat_a_enfant[i])
     {
     image_fleche='fleche';
     lecalque="souscalque("+(cat_a_enfant[i]+1)+","+i+","+ligne+");";
     lelien='';
     }
     
    
    
  
   machaine = machaine+'<tr '+lelien+' onmouseover="javascript:style.background=couleur1;'+lecalque2+';'+lecalque+'" onmouseout="javascript:style.background=couleur2" ><td width="250">&nbsp;<span class="normal">'+cat_name[i]+'</span></td><td><img name="fleche'+i+'"  id="fleche'+i+'" src="/images/'+image_fleche+'.gif" hspace="5"/></td></tr>';
   ligne++;
   }
  }
  machaine = machaine+'</table>';
  document.getElementById(nomducalque).innerHTML = machaine;
 } 

function popup_page(vid)
{
window.open('/popup.donut?vid='+vid,'Infos','width=400,height=500,toolbar=0,location=0,menuBar=0,scrollbars=1,resizable=1');
}
