/* pour ne selectionner qu'une check box lors de la recherche par type de residence */
function recherche_check_type_res(i) {
	doc = document.form_recherche;
	for (j = 1; j < 4 ; j ++) {
		if (j != i) {
			eval("doc.type_res"+j+".checked = false;");
		}
	}
}
/*
function popupcentre(adresse, nomFenetre, largeur, hauteur, scroll){
	var largeurEcran = (screen.width - largeur) / 2;
	var hauteurEcran = (screen.height - hauteur) / 2;
	//window.open(adresse, nomFenetre, 'height=' + hauteur + ', width=' + largeur + ', top=' + hauteurEcran + ', left=' + largeurEcran + ', scrollbars=' + scroll + ', resizable')
}
*/

// Gestion des popup
function popup_rapide(PageUrl, PageName, height, width){
	window.open (PageUrl, PageName, config='height='+height+', width='+width+', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}

function popup_rapide_scrollable(PageUrl, PageName, height, width){
	window.open (PageUrl, PageName, config='height='+height+', width='+width+', toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')
}

function bug (){
	window.alert("bo");
}

//-------------------
function getTop(Object){
    if (Object.offsetParent)
        return (Object.offsetTop + getTop(Object.offsetParent));
    else
        return (Object.offsetTop);
}
//-------------------
function GetTopPage(){
	var Top;
	var DocRef;
	if(window.innerWidth){
		with( window){
		Top = pageYOffset;
		}
	}
	else{ 
		// Cas Explorer a part
		if( document.documentElement && document.documentElement.clientWidth)
			DocRef = document.documentElement;
		else
			DocRef = document.body;
		with( DocRef){
			Top = scrollTop;
		}
	}
	return(Top); 
}

//-------------------------------------
// MENU FLOTTANT //////////////////////
//------------------------------------- 
var IdTimer_1;
var Rapport = 1.0/5.0; // On divise par 20
var Mini = 2* Rapport;
//-----------------------
function DIV_Scroll( id_){
	var Obj = document.getElementById( id_);
	this.Obj = Obj;
	if( Obj){
		//-- Recup position de depart
		this.PosY = 0;
		this.DebY = this.PosY;
		this.NewY = 0;
		this.Move = DIV_Deplace;
	}
}
//---------------------------
function DIV_Deplace( y_ ){
	this.PosY = y_;
	this.Obj.style.top = parseInt(y_) +"px";
} 
//---------------------------
function DIV_Replace( y_ ){
	//-- Calcul Delta deplacement
	var Delta_Y = (y_ - DivScroll.PosY) *Rapport;
	//-- Test si fin deplacement
	if((( Delta_Y < Mini)&&( Delta_Y > -Mini))){
		clearInterval( IdTimer_1);
		DivScroll.Move( y_ );
	}
	else{
		DivScroll.Move( DivScroll.PosY + Delta_Y );
	}
}

//------------------------
function Menu_Scroll(){
	//-- New position du menu              // haut   
	DivScroll.NewY = (Math.max(0,GetTopPage()-(95 + Math.max(0, (1120 - screen.height))))) + DivScroll.DebY;
	//-- Si pas la bonne Position
	if(( DivScroll.PosY != DivScroll.NewY )){
		//-- Clear l'encours
		clearInterval( IdTimer_1);
		IdTimer_1 = setInterval("DIV_Replace("+ DivScroll.NewY +")", 30);
	}
	return( true);
} 