<!--
/***PARAMETRAGE***/
largTable=779;// largeur du tableau principal principal
Vspace=1;// décalage vertical des sousmenus du menu principal
Hspace=1;// décalage horizontal des sousmenus des autres sousmenus
/***FIN DE PARAMETRAGE***/


function findObj(n, d) { 
var i,x;  if(!d) d=document;
if(!(x=d[n])&&d.all) x=d.all[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n);
if(x)x.css=(d.layers)?x:x.style;
return x;
}

function bg(img,s){
var flip=s?"'norm','surv'":"'surv','norm'";
findObj(img).src=eval("findObj('"+img+"').src.replace("+flip+")");
}

function getBounds(obj,level){
obj=findObj(obj.img)
var bounds=[0,0,0,0];// x y witdh height
/**/
if(document.layers){
 if(level==0){
 bounds[0]=obj.x;
 bounds[1]=obj.y;
 bounds[3]=obj.whidth;
 bounds[3]=obj.height;
 }else{
 bounds[0]=findObj(moteur[level-1][1]).x+obj.x;
 bounds[1]=findObj(moteur[level-1][1]).y+obj.y;
 bounds[2]=obj.width;
 bounds[3]=obj.height;
 }
return bounds	
}
/**/
bounds[2]=obj.offsetWidth;
bounds[3]=obj.offsetHeight;
  while(obj.tagName!='BODY'){
  bounds[0]+=obj.offsetLeft;
  bounds[1]+=obj.offsetTop;
	if(!obj.offsetParent) break;
  obj=obj.offsetParent;
  }
return bounds
}

var moteur=[[,""],[,""],[,""]], Tx=0;
viz=document.layers?"show":"visible"; hid=document.layers?"hide":"hidden";

function eOver(obj,level,SM,img){
clearTimeout(Tx);
var argImg=",'"+img+"'";
obj.img=img;
  for (i=moteur.length-1;i>=level;i--){
	  if(moteur[i][0] && moteur[i][0]!=obj) bg(moteur[i][0].img);
    if(moteur[i][1] && moteur[i][1]!="" && i>=level) {var Zero=findObj(moteur[i][1]).css;Zero.visibility=hid;Zero.top=0;Zero.left=0}
  }
if(!obj) return;
bg(obj.img,'surv');
Wdoc=window.innerWidth||document.body.clientWidth;
Wdoc=(Wdoc<largTable)?largTable:Wdoc;
moteur[level][0]=obj;
  if(SM!=""){
 moteur[level][1]=SM;
 var kalc=findObj(SM), B=getBounds(obj,level,SM), dif, Larg, decal=0;
	/**/
 Larg=kalc.offsetWidth||kalc.clip.width;
 dif=Wdoc-(B[0]+Larg);
	/**/
 if(level==0 && dif<0)decal=dif;
 if(level>0 && (dif-B[2])<0)decal=((B[2]+Larg)*(-1));
 level==0?B[1]+=B[3]+Vspace:B[0]+=(B[2]+Hspace);
 kalc.css.top=B[1]; kalc.css.left=(B[0]+decal);
 kalc.css.visibility=viz;
	}
if(!obj.onmouseout)obj.onmouseout=Function("Tx=setTimeout(\"eOver(false,0,''"+argImg+")\", 400)");
}

function prelod(){
var d=document ,di=d.images, im=new Array();
 for(i=0;i<di.length;i++){
  if(di[i].src.indexOf("_norm.")!=-1){
   im[i]= new Image();
   im[i].src=di[i].src.replace("_norm.", "_surv.");
  }
 }
}
onload=function(){
prelod();
}


