/*------------------------------------------------------------------------------------
-  codes génériques utilisés sur plusieurs pages
-  EG / ES 20/09/05
--------------------------------------------------------------------------------------*/
function getWindowWidth() {
    var windowWidth=0;
    if (typeof(window.innerWidth)=='number') {
        windowWidth=window.innerWidth;
    }
    else {
     if (document.documentElement&&
       document.documentElement.clientWidth) {
         windowWidth = document.documentElement.clientWidth;
    }
    else {
     if (document.body&&document.body.clientWidth) {
         windowWidth=document.body.clientWidth;
      }
     }
    }
    return windowWidth;
}

function getWindowHeight() {
    var windowHeight=0;
    if (typeof(window.innerHeight)=='number') {
        windowHeight=window.innerHeight;
    }
    else {
     if (document.documentElement&&
       document.documentElement.clientHeight) {
         windowHeight = document.documentElement.clientHeight;
    }
    else {
     if (document.body&&document.body.clientHeight) {
         windowHeight=document.body.clientHeight;
      }
     }
    }
    return windowHeight;
}

function resizeHauteur(calque){
//alert("resizeHauteur(" + calque + ")");
	hauteur=getWindowHeight();
	if(!(basPage)){
		basPage=0;
	}
//alert("1 - " + document.getElementById(calque).style.height);
	document.getElementById(calque).style.height=(((hauteur-20)-basPage) - calqueTop) + "px";
//alert("2 - " + document.getElementById(calque).style.height);
}

function gereClick(type,bouton){
	//gere le type d'action sur le bouton
	switch(type){
	case "init":
		document.getElementById(bouton).src="_images/" + bouton + "_ON.png";
		oldBouton=bouton;
		break;
	case "over":
		document.getElementById(bouton).src="_images/" + bouton + "_ON.png";
		break;
	case "out":
		//alert(oldBouton+"!="+bouton);
		if(oldBouton!=bouton){
		document.getElementById(bouton).src="_images/" + bouton + "_OFF.png";
		}
		break;
	case "click":
		if(oldBouton!=""){
		document.getElementById(oldBouton).src="_images/" + oldBouton + "_OFF.png";
		}
		document.getElementById(bouton).src="_images/" + bouton + "_ON.png";
		oldBouton=bouton;
		document.getElementById(bouton).click();
		break;
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
// JavaScript Document