// JavaScript Document
var h1;
function menu(etat, no){
	var obj2 = document.getElementById("im_" + no);
	if(etat == 1) {
		obj2.style.visibility="visible";
	} else {
		obj2.style.visibility="hidden";
	}
}

function init(){
	h1 =  document.getElementById("cadre-droite").offsetHeight;
	
	majMenuDroite();
}

function majMenuDroite(){
	var windowHeight = getWindowHeight();
	var h2 = 55 +  (document.documentElement.scrollTop + windowHeight - 410 - h1);
	
	if(h2>document.body.clientHeight - 450 - h1){ 
		h2 = document.body.clientHeight - 450 - h1; 
	} 
	if(h2<55){ 
		h2 = 55; 
	}
		
	if(document.getElementById("cadre-droite")) document.getElementById("cadre-droite").style.paddingTop = h2 + 'px';
	
	
}


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;
}



onscroll=majMenuDroite;

function OuvreFenetreVisite() {
   var test=window.open("visite.html","visite","width=700, height=450, top=250, left=300, menubar=no, toolbar=0, titlebar=0, scrollbars=no, status=no, location=no, resizable=no")
}

function OuvreFenetrePiscine() {
   var test=window.open("piscine.html","visite","width=700, height=450, top=250, left=300, menubar=no, toolbar=0, titlebar=0, scrollbars=no, status=no, location=no, resizable=no")
}

function OuvreFenetreJacobins() {
   var test=window.open("jacobins.html","visite","width=700, height=450, top=250, left=300, menubar=no, toolbar=0, titlebar=0, scrollbars=no, status=no, location=no, resizable=no")
}