// JavaScript Document


 function getElementsByClass(maClass) {
       var tabRetour = new Array();
      var tabTmp = new Array();
      tabTmp = document.getElementsByTagName("*");
      j=0;
       for (i=0; i<tabTmp.length; i++) {
           if (tabTmp[i].className==maClass) {
             tabRetour[j]=tabTmp[i];
         j++;
           }
       }
       return tabRetour;
    }
	
function sortHauteur(a,b){
	return  b - a;
}

function ajustHauteur(){
	
	var listeH=new Array()
	var c2=getElementsByClass("contenu")[0];
	var c1=getElementsByClass("menu_int")[0];
	for(i=1;i<3;i++){
		listeH.push(eval("c"+i).offsetHeight)
	}
	listeH.sort(sortHauteur)
	for(i=1;i<3;i++){
		eval("c"+i).style.height=listeH[0]+"px";
	}

}

	

function lay(src){
	var divdezoom=getElementsByClass("zoom")[0];
     while(divdezoom.childNodes.length>0) {divdezoom.removeChild(divdezoom.childNodes[0]);}
 	if(src==0){divdezoom.style.visibility="hidden";return;}
	if(src==undefined)return;
	var imageZoomer =  document.createElement("IMG");
	imageZoomer.setAttribute("src",src);
	divdezoom.appendChild(imageZoomer)
	
	divdezoom.onclick=function(){lay(0)}
	divdezoom.style.visibility="visible";
	divdezoom.style.zIndex="10";
	
}


function lay(obj){
	liste=getElementsByClass("cach");
	 
	for(i in liste){
		liste[i].style.visibility="hidden";
		
	}
	
	
	if(obj==0)return;
	reference = document.getElementById(obj)	
	cible = document.getElementById(obj.toString())	
	if(cible==undefined)return;
	
	
	
	
	
	cible.style.visibility="visible";
	cible.style.top=yMousePos+30+"px";
	cible.style.left="60%";
	cible.style.zIndex="10";
	
	
}

function nav(obj){
	liste=getElementsByClass("sousmenu");
	 
	for(i in liste){
		liste[i].style.visibility="hidden";
		
	}
	
	
	if(obj==0)return;
	reference = document.getElementById(obj)	
	cible = document.getElementById("s"+obj.toString())	
	if(cible==undefined)return;
	cible.style.visibility="visible";
	
	
}




if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}

xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e) {
    if (document.layers) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}
