// init du nombre de rubriques dans le menu
// init autres var
var menunbr = 4;
var theDoc = document;
var y;
var hr;

function divmenu(divID,divHeight)
{
 if (theDoc.getElementById("p_div_"+divID).style.display!="")
 {
 for (i=1;i<(menunbr+1);i++)
 {
 eval ("document.getElementById('p_div_"+i+"').style.display='none';");
 eval ("document.getElementById('p"+i+"').style.color='#000000';");
 eval ("document.getElementById('p"+i+"').style.backgroundColor='';");
/* eval ("document.getElementById('p"+i+"').style.fontWeight='';");*/
 }
 theDoc.getElementById("p_div_"+divID).style.display="block";
 theDoc.getElementById("p"+divID).style.color="#c10435";
 theDoc.getElementById("p"+divID).style.backgroundColor="#f9f6ec";
/* theDoc.getElementById("p"+divID).style.fontWeight="bold";*/

 if (navigator.platform.indexOf("Mac") != 0)
 {
 theDoc.getElementById("p_div_"+divID).style.height="0";
 speed = ((divHeight/12.5)+8);
 open_it(divHeight,"p_div_"+divID,speed)
 }
 }
 else
 {
 theDoc.getElementById("p_div_"+divID).style.display="none";
 }
}

function swap_c(linkID) {
 theDoc.getElementById('p1a').style.color="#58585A";
 theDoc.getElementById('p1b').style.color="#58585A";
 theDoc.getElementById('p1c').style.color="#58585A";
 theDoc.getElementById('p1d').style.color="#58585A";
 theDoc.getElementById('p1e').style.color="#58585A";
 theDoc.getElementById('p1f').style.color="#58585A";
 theDoc.getElementById('p2a').style.color="#58585A";
 theDoc.getElementById('p2b').style.color="#58585A";
 theDoc.getElementById('p2c').style.color="#58585A";
 theDoc.getElementById('p2d').style.color="#58585A";
 theDoc.getElementById('p2e').style.color="#58585A";
 theDoc.getElementById('p2f').style.color="#58585A";
 theDoc.getElementById('p3a').style.color="#58585A";
 theDoc.getElementById('p3b').style.color="#58585A";
 theDoc.getElementById('p3c').style.color="#58585A";
 theDoc.getElementById('p3d').style.color="#58585A";
 theDoc.getElementById('p3e').style.color="#58585A";
 theDoc.getElementById('p3f').style.color="#58585A";
 theDoc.getElementById('p4a').style.color="#58585A";
 theDoc.getElementById('p4b').style.color="#58585A";
 theDoc.getElementById('p5a').style.color="#58585A";
 theDoc.getElementById('p5b').style.color="#58585A";
 theDoc.getElementById('p6a').style.color="#58585A";
 theDoc.getElementById(linkID).style.color="#FFFFFF";
}

function open_it(max,name,hm)
{
 if (hm<0) return;
 maxi = max;
 divname = name;
 act = theDoc.getElementById(divname).style.height;
 act2 = parseInt(act);

 if (act2>=maxi) { clearTimeout(tempoO); theDoc.getElementById(divname).style.height=maxi+"px"; return; };

 y = ((act2-1)+hm);
 hr = hm-1;
 theDoc.getElementById(divname).style.height=y+"px";
 tempoO = setTimeout('open_it(maxi,divname,hr)', 30);
}

function swap_jj(img_name,to_what) {
// alert (to_what);
 document.getElementById("telecharger").style.display="";
 var tmp = document.getElementById("telecharger2");
 var str=to_what;
 to_what2 = (str.replace(/fr/,""));
 tmp.href = "/visuels"+to_what2+".zip";

 var swap, towhat;
 swap = eval('document.images.'+img_name);
 towhat='/_img/'+to_what+'.jpg';
 swap.src = towhat;
}
