/* Javascripts utilisés sur le site
 * Mettez l'ensemble de vos fonctions générique javascript ici
 * 
 * La liaison avec les page se fait à l'aide du code ci-dessous :
 * <script type="text/javascript" src="css-js/scripts.js"></script>
 */

/* MENU CSS */
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

/* GESTION PIEDS DE PAGE */

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 setFooter(){

	var maxHeight = getWindowHeight();

	var footer = document.getElementById('footer');
	var footerHeight = footer.offsetHeight;
	var divHeight = (maxHeight - footerHeight);
	if(navigator.appName == 'Microsoft Internet Explorer'){
		document.getElementById('container').style.height=divHeight+'px';
		} else {
		document.getElementById('container').style.minHeight=divHeight+'px';
		document.getElementById('container').style.height='auto !important';
	}
}
function changeImage(idImage,nbImages){
		for(i = 1 ; i <= nbImages; i++){
			document.getElementById('img'+i).style.display = 'none';
		}
		document.getElementById('img'+idImage).style.display = 'block';
}
function ouvreFenetre(url,largeur,hauteur) {
	var haut=(screen.height-hauteur)/2;
	var gauche=(screen.width-largeur)/2;
	window.open(url,"fencent","top="+haut+",left="+gauche+",width="+largeur+",height="+hauteur+",menubar=no,scrollbars=yes,statusbar=no,resizable=yes"	);
}
