 //SCRIPT POUR LES CALQUES ET NETSCAPE
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


//SCRIPTS POUR AFFICHE/MASQUER DES CALQUES
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

function Affiche(nom) {

 if(ie4) { // Internet explorer
    var divie4 = document.getElementsByTagName("div")
    divie4[nom].style.visibility = 'visible';
  }
  else if(ns4) { // Netscape 4.x
    document.eval(nom).visibility = 'show';
  }
  else if(ns6) { // Netscape 6 (mozilla)
    var divns6 = document.getElementsByTagName("div")
    document.getElementsByTagName("div")[nom].style.visibility = 'visible';
	}
}


function Cache(nom) {

 if(ie4) { // Internet explorer
    var divie4 = document.getElementsByTagName("div")
    divie4[nom].style.visibility = 'hidden';
  }
  else if(ns4) { // Netscape 4.x
    document.eval(nom).visibility = 'hidden';
  }
  else if(ns6) { // Netscape 6 (mozilla)
    var divns6 = document.getElementsByTagName("div")
    document.getElementsByTagName("div")[nom].style.visibility = 'hidden';
	}
}


function affiche_menu(num,rubrique)
{

	if (ie4)
		doc=document.all.calque;
	else if (ns4)
		doc=document.layers.calque.document;
	else if (ns6)
	{
		doc=document.getElementById('calque') ;
	}
var rub=rubrique;
//alert(rub);

if(rub==1){
var nombre = bouton[num].nb_sous_rub;
var boutons = bouton[num].sous_rub;
var pos = 104+12*num;
}

if(rub==2){
var nombre = bouton2[num].nb_sous_rub2;
var boutons = bouton2[num].sous_rub;
var pos = 190+12*num;
}

if(rub==3){
var nombre = bouton3[num].nb_sous_rub3;
var boutons = bouton3[num].sous_rub;
var pos = 302+12*num;
}

if(rub==4){
var nombre = bouton4[num].nb_sous_rub4;
var boutons = bouton4[num].sous_rub;
var pos = 386+12*num;
}


ligne="";
for (j=1; j<=nombre; j++)
	{
	ligne+="<table border=0 cellspacing=0 cellpadding=0 background="+niveau+"img/pix.gif><tr><td width=5><img src="+niveau+"img/dhtml/chg_dhtml.gif width=5 height=5></td><td background="+niveau+"img/dhtml/h_dhtml.gif><img src="+niveau+"img/pix.gif width=1 height=5></td><td width=5><img src="+niveau+"img/dhtml/chd_dhtml.gif width=5 height=5></td></tr><tr><td background="+niveau+"img/dhtml/g_dhtml.gif width=5><img src="+niveau+"img/pix.gif width=5 height=1></td><td>";
	    ligne += "<table border=0 cellspacing=0 cellpadding=0>";
for (j=1; j<=nombre; j++)
	{           
		ligne+="     <tr> ";
		ligne+="           <td valign=top  bgcolor=#FFFFFF><img src="+niveau+"img/pix.gif width=4 height=5><br><img src="+niveau+"img/dhtml/carre_or.gif width=4 height=4></td>";
		ligne+="           <td  bgcolor=#FFFFFF><img src="+niveau+"img/pix.gif width=5 height=1></td>";
        if (boutons[j].lien=='#'){
		niveau2 = "";

		ligne+="           <td  bgcolor=#FFFFFF><a href="+niveau2+boutons[j].lien+"  class=textebleu2>"+boutons[j].nom+"</a></td>";
        }else{
		niveau2 = niveau;
		ligne+="           <td  bgcolor=#FFFFFF><a href="+niveau2+boutons[j].lien+"  class=textebleu2>"+boutons[j].nom+"</a></td>";
        }
		
	 	//ligne+="           <td><img src="+niveau+"img/pix.gif width=5 height=5></td>";
		//ligne+="           <td><img src="+niveau+"img/pix.gif width=1 height=1></td>";		
		ligne+="    </tr>";
	    
   }	
		    ligne+="  </table>";

		ligne+="</td><td background="+niveau+"img/dhtml/d_dhtml.gif width=5><img src="+niveau+"img/pix.gif width=5 height=1></td></tr><tr><td width=5><img src="+niveau+"img/dhtml/cbg_dhtml.gif width=5 height=5></td><td background="+niveau+"img/dhtml/b_dhtml.gif><img src="+niveau+"img/pix.gif width=1 height=5></td><td width=5><img src="+niveau+"img/dhtml/cbd_dhtml.gif width=5 height=5></td></tr></table>";
     	
		// Nécessaire pour IE Mac
		ligne += "<table border=0 cellspacing=0 cellpadding=0>";
		ligne+="     <tr> ";
		ligne+="           <td width=1><img src="+niveau+"img/pix.gif width=1 height=1></td>";
		ligne+="           <td width=5><img src="+niveau+"img/pix.gif width=1 height=1></td>";
		ligne+="           <td width=10><img src="+niveau+"img/pix.gif width=1 height=1></td>";
                                ligne+="           <td width=210><img src="+niveau+"img/pix.gif width=1 height=1></td>";
		ligne+="           <td width=5><img src="+niveau+"img/pix.gif width=1 height=1></td>";
		ligne+="           <td width=1><img src="+niveau+"img/pix.gif width=1 height=1></td>";		
		ligne+="    </tr>";
	    ligne+="  </table>";
  
  }

	if (ie4||ns6)
		doc.innerHTML = ligne;

	else 
	{
		doc.write(ligne);
		doc.close();
	}
    var place = pos
	if (ie4)
		calque.style.top=place
	else if (ns4)
		document.layers.calque.top=place
	else if (ns6)
		document.getElementById('calque').style.top=place

	Affiche('calque');
}

function checkData()
{
	if(ns4) {
		if (document.cadre.document.textederoule1.document.chxtheme.themes.options[0].selected == true)
		{
			alert("Choisissez un thème.");
			return;
		}
		else
		{
			document.location.href='app_them.jsp?theme='+document.cadre.document.textederoule1.document.chxtheme.themes.options[document.cadre.document.textederoule1.document.chxtheme.themes.options.selectedIndex].value;
		}
	} else if (ie4 || ns6){
		if (document.chxtheme.themes.options[0].selected == true)
		{
			alert("Choisissez un thème.");
			return;
		}
		else
		{
			document.location.href='app_them.jsp?theme='+document.chxtheme.themes.options[document.chxtheme.themes.options.selectedIndex].value;
		}
	}
}

function search(){
	if(ns4) {
		document.menu.document.search.submit();
	} else if (ie4 || ns6){
		document.search.submit();
	}
}
//-->