function ajouterGestionnaire(e)
{
	alerte('ajouterGestionnaire');
	if ($('dt_notre_offre'))
	{
		Event.observe($('dt_notre_offre'), "mouseover", function(event) { montre('notre_offre');}, false);
		Event.observe($('dt_notre_offre'), "mouseout", function(event) { montre('');}, false);
		Event.observe($('notre_offre'), "mouseover", function(event) { montre('notre_offre');}, false);
		Event.observe($('notre_offre'), "mouseout", function(event) { montre('');}, false);
		
		Event.observe($('dt_avant_premiere'), "mouseover", function(event) { montre('');}, false);
		
		Event.observe($('dt_nos_conseils'), "mouseover", function(event) { montre('nos_conseils'); hideSelect(false, 2);}, false);
		Event.observe($('dt_nos_conseils'), "mouseout", function(event) { montre(''); hideSelect(true, 2);}, false);
		Event.observe($('nos_conseils'), "mouseover", function(event) { montre('nos_conseils'); hideSelect(false, 2);}, false);
		Event.observe($('nos_conseils'), "mouseout", function(event) { montre(''); hideSelect(true, 2);}, false);
		
		Event.observe($('dt_references'), "mouseover", function(event) { montre('references');hideSelect(false, 3);}, false);
		Event.observe($('dt_references'), "mouseout", function(event) { montre('');hideSelect(true, 3);}, false);
		Event.observe($('references'), "mouseover", function(event) { montre('references');hideSelect(false, 3);}, false);
		Event.observe($('references'), "mouseout", function(event) { montre('');hideSelect(true, 3);}, false);
		
		Event.observe($('dt_budget'), "mouseover", function(event) { montre('budget');hideSelect(false, 4);}, false);
		Event.observe($('dt_budget'), "mouseout", function(event) { montre('');hideSelect(true, 4);}, false);
		Event.observe($('budget'), "mouseover", function(event) { montre('budget');hideSelect(false, 4);}, false);
		Event.observe($('budget'), "mouseout", function(event) { montre('');hideSelect(true, 4);}, false);
		
		Event.observe($('dt_newsletter'), "mouseover", function(event) { montre('newsletter');}, false);
		Event.observe($('dt_newsletter'), "mouseout", function(event) { montre('');}, false);
		Event.observe($('newsletter'), "mouseover", function(event) { montre('newsletter');}, false);
		Event.observe($('newsletter'), "mouseout", function(event) { montre('');}, false);
		
		Event.observe($('dt_presentation'), "mouseover", function(event) { montre('presentation');}, false);
		Event.observe($('dt_presentation'), "mouseout", function(event) { montre('');}, false);
		Event.observe($('presentation'), "mouseover", function(event) { montre('presentation');}, false);
		Event.observe($('presentation'), "mouseout", function(event) { montre('');}, false);
		
		Event.observe($('dt_environnement'), "mouseover", function(event) { montre('environnement');}, false);
		Event.observe($('dt_environnement'), "mouseout", function(event) { montre('');}, false);
		Event.observe($('environnement'), "mouseover", function(event) { montre('environnement');}, false);
		Event.observe($('environnement'), "mouseout", function(event) { montre('');}, false);
		
		Event.observe($('dt_votre_residence'), "mouseover", function(event) { montre('votre_residence');}, false);
		Event.observe($('dt_votre_residence'), "mouseout", function(event) { montre('');}, false);
		Event.observe($('votre_residence'), "mouseover", function(event) { montre('votre_residence');}, false);
		Event.observe($('votre_residence'), "mouseout", function(event) { montre('');}, false);
		
		Event.observe($('dt_prestations'), "mouseover", function(event) { montre('prestations');}, false);
		Event.observe($('dt_prestations'), "mouseout", function(event) { montre('');}, false);
		Event.observe($('prestations'), "mouseover", function(event) { montre('prestations');}, false);
		Event.observe($('prestations'), "mouseout", function(event) { montre('');}, false);
		
		Event.observe($('dt_details_plans'), "mouseover", function(event) { montre('details_plans');}, false);
		Event.observe($('dt_details_plans'), "mouseout", function(event) { montre('');}, false);
		Event.observe($('details_plans'), "mouseover", function(event) { montre('details_plans');}, false);
		Event.observe($('details_plans'), "mouseout", function(event) { montre('');}, false);
		
		//Event.observe($('dt_espace_perso'), "mouseover", function(event) { montre('espace_perso');}, false);
		//Event.observe($('dt_espace_perso'), "mouseout", function(event) { montre(''); fermerEspacePerso();}, false);
		//Event.observe($('espace_perso'), "mouseover", function(event) { montre('espace_perso');}, false);
		//Event.observe($('espace_perso'), "mouseout", function(event) { montre(''); fermerEspacePerso();}, false);
		Event.observe($('dt_espace_perso'), "click", function(event) { montre('espace_perso'); }, false);
		Event.observe($('fermerEspacePerso'), "click", function(event) { fermerEspacePerso(); }, false);
		
		Event.observe($('header'), "mouseover", function(event) { montre(''); }, false);
		
		//Initialisation du menu
		montre('');
	}
	
	Event.observe($('#navTransversale .navTransMenuLvl1'), "mouseover", function(event) { montre('#navTransversale .navTransMenuLvl2'); hideSelect(false, 2);}, false);
	Event.observe($('#navTransversale .navTransMenuLvl1'), "mouseout", function(event) { montre(''); hideSelect(true, 2);}, false);
	
	//Lien pour la carte
	if ($('afficherCarte'))
	{
		Event.observe($('afficherCarte'), "click", afficheCarte, false);
	}
	/*if ($('contenuResultat'))
	{
		var newHeight=$('gaucheResultat').offsetHeight;
	//	newHeight+=189+189+7;
		newHeight =621;
		$('contenuResultat').style.height=newHeight + "px";
		//alert(newHeight);	
	}*/
	
	
	//Redimensionnement des pages programmes
	redimensionne();
	
	/*
	Chargement des flash dynamiquement.
	Corrige le problème sur IE pour charger le contenu
	Plus d'informations sur : http://wiki.mediabox.fr/documentation/swfobject
	*/
	chargerFlash();
	
	//Chargement du diaporama si on est sur la page présentration
	if ($('page_presentation'))
	{
		doPanorama();
	}
	if (($('recherche')) || ($('recherche_en')))
	{
	   specialOnLoad();
	   
	   //window.open("http://www.cogedim-logement.com/pub/pop-up-video2.html","COGEDIM_Grenoble_Portes_Ouvertes","width=672, height=565, scrollbars=yes");
	}
	
	
}

// Liste des id a cacher
var aSelectToHide = [null, null, ['type_log','sortingColumn'], ['type_log'], ['sortingColumn'], null, null, ['type_log'], ['type_log','sel_region','sel_ville1','sel_ville2','sel_ville3','type_commercialisation','typeLogement']];

function hideSelect(bAction, iId) {
	if (aSelectToHide[iId]) {
		for (var i = 0 ; i < aSelectToHide[iId].length ; i++ ) {
			if ($(aSelectToHide[iId][i])) {
				if (bAction) {
					$(aSelectToHide[iId][i]).style.visibility = 'visible';		
//					$(aSelectToHide[iId][i]).show();
				}
				else {
					$(aSelectToHide[iId][i]).style.visibility = 'hidden';
//					$(aSelectToHide[iId][i]).hide();
				}
			}
		}
	}
}

function montreNavTransversaleMenu(id) {
	var d = $(id);
	var doChange = true;
	$('#navTransversale .navTransMenuLvl2').style.display='none';
	d.style.display='block';
}

function montre(id) {
	var d = $(id);
	var doChange = true;
	$('notre_offre').style.display='none';
	$('nos_conseils').style.display='none';
	$('references').style.display='none';
	$('budget').style.display='none';
	$('newsletter').style.display='none';

	$('presentation').style.display='none';
	$('environnement').style.display='none';
	$('votre_residence').style.display='none';
	$('prestations').style.display='none';
	$('details_plans').style.display='none';
	//$('espace_perso').style.display='none';
	
//	if ($('sortingColumn'))
//	{
//		$('sortingColumn').style.visibility='visible';
//	}
//	if (/*$('budg_max') && */$('carte'))
//	{	
//		if ($('carte').style.display != "block")
//		{
//			//$('budg_max').style.display='inline';
//		}
//	}
//	/*else if ($('budg_max'))
//	{
//		$('budg_max').style.display='inline';
//	}*/
	if (d && doChange)
	{
		d.style.display='block';
//		if (id == "budget" || id == "newsletter")
//		{
//			if ($('sortingColumn'))
//			{
//				$('sortingColumn').style.visibility='hidden';
//			}
//		}
//		if (id == "nos_conseils")
//		{
//			/*if ($('budg_max'))
//			{
//				$('budg_max').style.display='none';
//			}*/
//		}
	}
}

function fermerEspacePerso()
{
	$('espace_perso').style.display='none';
}

function redimensionne()
{
	var divGauche = $('DivGaucheProgramme');
	var divDroite = $('DivDroitePresentationProgramme');
	var divDroite2 = $('DivDroitePresentationProgramme2');
	var divCentre = $('DivCentrePresentationProgramme');
	
	var divAvantPremiereGauche = $('avantPremiereGauche');
	var divCentral = $('contenuCentral');
	var divEncartGaucheLogement = $('encartGaucheLogement');
	var divContenuLogement = $('contenuLogement');
	var gaucheResultat = $('gaucheResultat');
	var contenuResultat = $('listeResultatsContenu');
	
	var heightGauche = 0;
	var heightDroite = 0;
	var heightCentre = 0;
	var heightGaucheResultat = 0;
	var heightContenuResultat = 0;
	
	if (divCentre || divCentral)
	{
		if (divCentre)
		{
			heightCentre = divCentre.offsetHeight;
		}
		if (divCentral)
		{
			var heightCentral = divCentral.offsetHeight;
		}
	}
	else if (divContenuLogement)
	{
	   heightCentre = divContenuLogement.offsetHeight;
	}
	else if (gaucheResultat && contenuResultat)
	{
	
	}
	else
	{
		return;
	}
	
	
	
	
	if (divGauche && divDroite)
	{
		heightGauche = divGauche.offsetHeight;
		heightDroite = divDroite.offsetHeight;
		if (heightGauche > heightCentre || heightDroite > heightCentre)
		{
			if (heightGauche > heightDroite)
			{
				heightDroite = heightGauche;
				heightCentre = heightGauche;
				divDroite.style.height = heightDroite + "px";
				divCentre.style.height = heightCentre + "px";
			}
			else
			{
				heightGauche = heightDroite;
				heightCentre = heightDroite;
				divGauche.style.height = heightGauche + "px";
				divCentre.style.height = heightCentre + "px";
			}
		} 
		if (heightCentre > heightGauche && heightCentre>heightDroite) {
                                heightDroite = heightCentre;
                                heightGauche = heightCentre;
                                divDroite.style.height = heightDroite + "px";
                                divGauche.style.height = heightGauche + "px";

                }
 
	}
	else if (divGauche && divDroite2)
        {
                heightGauche = divGauche.offsetHeight;
                heightDroite = divDroite2.offsetHeight+115;//+150;
                if (heightGauche > heightCentre || heightDroite > heightCentre)
                {
                        if (heightGauche > heightDroite)
                        {
                                heightDroite = heightGauche-115;//-150;
                                heightCentre = heightGauche;
                                divDroite2.style.height = heightDroite + "px";
                                divCentre.style.height = heightCentre + "px";
                        }
                        else
                        {
                                heightGauche = heightDroite;
                                heightCentre = heightDroite;
                                divGauche.style.height = heightGauche + "px";
                                divCentre.style.height = heightCentre + "px";
                        }
                }
                if (heightCentre > heightGauche && heightCentre>heightDroite) {
                    heightDroite = heightCentre-115;//-150;
                    heightGauche = heightCentre;
                    divDroite.style.height = heightDroite + "px";
                    divGauche.style.height = heightGauche + "px";
                }

        }
	
	else if(divGauche)
	{
		heightGauche = divGauche.offsetHeight;
		if (heightGauche > heightCentre)
		{
			heightCentre = heightGauche;
			divCentre.style.height = heightCentre + "px";
		}
	}
	else if (divAvantPremiereGauche)
	{
		heightGauche = divAvantPremiereGauche.offsetHeight;
		if (heightGauche > heightCentral)
		{
			heightCentral = heightGauche;
			divCentral.style.height = heightCentral + "px";
		}
	}
	else if (divDroite)
	{
		heightDroite = divDroite.offsetHeight;
		if (heightDroite > heightCentre)
		{
			heightCentre = heightDroite;
			divCentre.style.height = heightCentre + "px";
		}
	}
	else if (divDroite2)
        {
                heightDroite = divDroite2.offsetHeight-150;
                if (heightDroite > heightCentre)
                {
                        heightCentre = heightDroite;
                        divCentre.style.height = heightCentre + "px";
                }
        }

	else if (divEncartGaucheLogement)
	{
	   heightGauche = divEncartGaucheLogement.offsetHeight;
	   heightCentral = divContenuLogement.offsetHeight;
	   if (heightGauche > heightCentral)
	    {
	      heightCentral = heightGauche;
	      divContenuLogement.style.height = heightCentral + "px";
	    }
	}
	else if (gaucheResultat && contenuResultat)
	{
		heightGaucheResultat = gaucheResultat.offsetHeight;
		heightContenuResultat = contenuResultat.offsetHeight;
		if (heightGaucheResultat > heightContenuResultat)
		{
			heightGaucheResultat = heightGaucheResultat + 35;			
			contenuResultat.style.height = heightGaucheResultat + "px";
		}
	}
}

function afficherDetails(id)
{
	var src_image = "";
	var tab_image;
	var real_name_image = "";
	if ($('tr_listLot_' + id))
	{
		if ($('tr_listLot_' + id).className == "special")
		{
			document.getElementById('tr_listLot_' + id).className = "special2";
			src_image = $('image_listLot_'+ id).src;
			tab_image = src_image.split("/");
			real_name_image = tab_image[tab_image.length - 1];
			if (real_name_image == "fleche.png")
			{
				tab_image[tab_image.length - 1] = "flecheDepliee.png";
			}
			else
			{
				tab_image[tab_image.length - 1] = "flechegrisDepliee.png";
			}
			src_image = tab_image.join("/");
			$('image_listLot_'+ id).src = src_image;
		}
		else
		{
			$('tr_listLot_' + id).className = "special";
			src_image = $('image_listLot_'+ id).src;
			tab_image = src_image.split("/");
			real_name_image = tab_image[tab_image.length - 1];
			if (real_name_image == "flecheDepliee.png")
			{
				tab_image[tab_image.length - 1] = "fleche.png";
			}
			else
			{
				tab_image[tab_image.length - 1] = "flechegris.png";
			}
			src_image = tab_image.join("/");
			$('image_listLot_'+ id).src = src_image;
		}
	}
}

function changerFlash(src_flash, texte_flash)
{
	var url_serveur = "http://www.cogedim-logement.com";
	var url_flash = url_serveur + src_flash;
	
	var so_cest_beau = new SWFObject(url_flash, "c_est_beau", "781", "420", "7", "#094F82");
	so_cest_beau.addParam("loop", "true");
	so_cest_beau.addParam("allowScriptAccess", "sameDomain");
	so_cest_beau.addParam("align", "middle");
	so_cest_beau.addParam("wmode", "opaque");
	so_cest_beau.write("contenu_flash_cest_beau");
	
	$('contenu_text_cest_beau').innerHTML = texte_flash;
}

function chargerFlash()
{
	// Traitement du flash dans le header ...
	var header = $('header');
	var src_flash_header = $('src_flash_header');
	if (header && src_flash_header)
	{
		//var so_header = new SWFObject(src_flash_header.value, "header_flash", "926", "97", "8", "#9099a2");
		var so_header = new SWFObject(src_flash_header.value, "header_flash", "1005", "83", "8", "#ffffff");
		so_header.addParam("loop", "true");
		so_header.addParam("allowScriptAccess", "sameDomain");
		so_header.addParam("wmode", "transparent");
		so_header.write("header");
		Event.observe($('header_flash'), "mouseover", function(event) { montre('');}, false);
	}
	
	// Traitement du flash opportunités ...
	var opportunites = $('opportunite');
	var src_flash_opportunites = $('src_flash_opportunites');
	if (opportunites && src_flash_opportunites)
	{
		var so_opportunites = new SWFObject(src_flash_opportunites.value, "opportunites_flash", "210", "235", "8", "#ffffff");
		so_opportunites.addParam("loop", "true");
		so_opportunites.addParam("wmode", "transparent");
		so_opportunites.addParam("allowScriptAccess", "sameDomain");
		so_opportunites.write("opportunite");
		Event.observe($('opportunites_flash'), "mouseover", function(event) { montre('');}, false);
	}
	
	// Traitement du flash à la une ...
	var alaune = $('alaune');
	var src_flash_alaune = $('src_flash_alaune');
	if (alaune && src_flash_alaune)
	{
		var so_alaune = new SWFObject(src_flash_alaune.value, "alaune_flash", "555", "210", "8", "#ffffff");
		so_alaune.addParam("loop", "true");
		so_alaune.addParam("allowScriptAccess", "sameDomain");
		so_alaune.addParam("wmode", "transparent");
		so_alaune.write("alaune");
		Event.observe($('alaune_flash'), "mouseover", function(event) { montre('');}, false);
	}
	
	//Traitement du flash dans la banniere sur la page d'accueil
	var centre_home = $('showbanner');
	var src_flash_centre_home = $('src_flash_banniere');
	var width_flash_centre_home = $('width_flash_banniere');
	var height_flash_centre_home = $('height_flash_banniere');
	var align_flash_centre_home = $('align_flash_banniere');
	var name_flash_centre_home = $('name_flash_banniere');
	if (centre_home && src_flash_centre_home)
	{
		var so_banniere = new SWFObject(src_flash_centre_home.value, name_flash_centre_home.value, width_flash_centre_home.value, height_flash_centre_home.value, "8", "");
		so_banniere.addParam("loop", "true");
		so_banniere.addParam("allowScriptAccess", "sameDomain");
		so_banniere.addParam("scale", "exactfit");
		so_banniere.addParam("wmode", "transparent");
		so_banniere.write("showbanner");
		
	}
	
	//Traitement du flash dans les opportunités sur la page d'accueil
	/*var centre_home = $('flash_centre_home');
	var src_flash_centre_home = $('src_flash_banniere');
	var width_flash_centre_home = $('width_flash_banniere');
	var height_flash_centre_home = $('height_flash_banniere');
	var align_flash_centre_home = $('align_flash_banniere');
	var name_flash_centre_home = $('name_flash_banniere');
	if (centre_home && src_flash_centre_home)
	{
		var so_banniere = new SWFObject(src_flash_centre_home.value, name_flash_centre_home.value, width_flash_centre_home.value, height_flash_centre_home.value, "8", "");
		so_banniere.addParam("loop", "true");
		so_banniere.addParam("allowScriptAccess", "sameDomain");
		so_banniere.addParam("scale", "exactfit");
		so_banniere.addParam("wmode", "opaque");
		so_banniere.write("flash_centre_home");
		
	}*/
	
	//Traitement du flash en bas à droite
	var flash_droite = $('showroom');
	var src_flash_droite = $('src_flash_droite');
	var config = $('config');	
	if (flash_droite && src_flash_droite)
	{
		var so_showroom = new SWFObject(src_flash_droite.value, "name", "212", "249", "8", "");
		so_showroom.addParam("loop", "true");
		so_showroom.addParam("allowScriptAccess", "sameDomain");
		so_showroom.addParam("FlashVars", config.value);	
		so_showroom.addParam("scale", "exactfit");
		so_showroom.addParam("wmode", "opaque");
		so_showroom.write("showroom");
	}
	// Traitement du flash dans la page c'est beau de vivre
	var cest_beau = $('contenu_flash_cest_beau');
	var src_flash_cest_beau = $('src_flash_banniere');
	if (cest_beau && src_flash_cest_beau)
	{
		var so_cest_beau = new SWFObject(src_flash_cest_beau.value, "c_est_beau", "781", "420", "7", "#094F82");
		so_cest_beau.addParam("loop", "true");
		so_cest_beau.addParam("allowScriptAccess", "sameDomain");
		so_cest_beau.addParam("align", "middle");
		so_cest_beau.addParam("wmode", "opaque");
		so_cest_beau.write("contenu_flash_cest_beau");
	}
	
	// Traitement du flash sur la page idéal investisseur
	var investir = $('contenu_flash_investir');
  var src_flash_investir = $('src_flash_investir');
  if (investir && src_flash_investir)
  {
    var so_investir = new SWFObject(src_flash_investir.value, "investir", "391", "155", "7", "#F4F4EA");
    so_investir.addParam("loop", "true");
    so_investir.addParam("allowScriptAccess", "sameDomain");
    so_investir.addParam("align", "middle");
    so_investir.addParam("wmode", "opaque");
    so_investir.write("contenu_flash_investir");
  }
  
  // Traitement du flash sur la page idéal investisseur
  var investir = $('contenu_flash_investir2');
  var src_flash_investir = $('src_flash_investir2');
  if (investir && src_flash_investir)
  {
    var so_investir = new SWFObject(src_flash_investir.value, "investir2", "163", "236", "7", "#DCDCE6");
    so_investir.addParam("loop", "true");
    so_investir.addParam("allowScriptAccess", "sameDomain");
    so_investir.addParam("align", "middle");
    so_investir.addParam("wmode", "opaque");
    so_investir.addParam('scale', 'exactfit');
    so_investir.addParam('quality', 'high');
    so_investir.write("contenu_flash_investir2");
  }
  
  
  var investir = $('contenu_flash_investir3');
  var src_flash_investir = $('src_flash_investir3');
  if (investir && src_flash_investir)
  {
    var so_investir = new SWFObject(src_flash_investir.value, "investir3", "163", "189", "7", "#2acad8");
    so_investir.addParam("loop", "true");
    so_investir.addParam("allowScriptAccess", "sameDomain");
    so_investir.addParam("align", "middle");
    so_investir.addParam("wmode", "transparent");
    so_investir.write("contenu_flash_investir3");
	redimensionne();
  }
  
  //Traitement du flash spécial Massy sur les pages de résultat
  var massy = $('contenu_flash_massy');
  var src_massy = $('src_flash_massy');
  if (massy && src_massy)
  {
	var so_investir = new SWFObject(src_massy.value, 'flash_massy', '163', '290', '7', '#2E3F8F');
	so_investir.addParam('loop', 'true');
	so_investir.addParam('allowScriptAccess', 'sameDomain');
	so_investir.addParam('align', 'middle');
	so_investir.addParam('wmode', 'opaque');
	so_investir.addParam('scale', 'exactfit');
	so_investir.addParam('quality', 'high');
	so_investir.write(massy.id);
  }
  
  // Flash transparent devant le site
  var flashTransparent = $('flashTransparent');
  if (flashTransparent)
  {
	
	iWidth = parseInt($('flashTransparentWidth').value, 10);
	iHeight = parseInt($('flashTransparentHeight').value, 10);
	
	hideSelect(false, 8);
	
	var swfFlashTransparent = new SWFObject($('flashTransparentSrc').value, 'flashIdTransparent', iWidth, iHeight, '7', $('flashTransparentColor').value);
	swfFlashTransparent.addParam('loop', 'false');
	swfFlashTransparent.addParam('allowScriptAccess', 'sameDomain');
	swfFlashTransparent.addParam('align', 'middle');
	swfFlashTransparent.addParam('wmode', $('flashTransparentColor').value);
	swfFlashTransparent.addParam('scale', 'exactfit');
	swfFlashTransparent.addParam('quality', 'high');
	swfFlashTransparent.write(flashTransparent.id);
	fixFlashTrans();
	initFlashTrans();
  }
}

var iWidth = null;
var iHeight = null;
var broswer = {};
var userAgent = navigator.userAgent.toLowerCase();
broswer.version = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1];
broswer.safari = /webkit/.test( userAgent );
broswer.opera = /opera/.test( userAgent );
broswer.msie = /msie/.test( userAgent ) && !/opera/.test( userAgent );
broswer.mozilla = /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent );

function initFlashTrans() {
	$('flashTransparent').style.marginLeft = Math.floor((iWidth / 2) * (- 1)) + 'px';
	window.onresize = fixFlashTrans;
}

function getViewport() {
	var viewportwidth;
	var viewportheight;
	if (typeof window.innerWidth != 'undefined')
	{
	     viewportwidth = window.innerWidth;
	     viewportheight = window.innerHeight;
	}
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
	{
	      viewportwidth = document.documentElement.clientWidth;
	      viewportheight = document.documentElement.clientHeight;
	}
	else
	{
	      viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
	      viewportheight = document.getElementsByTagName('body')[0].clientHeight;
	}
	return {width: viewportwidth, height: viewportheight};
}

function fixFlashTrans() {
	if ($('flashTransparent')) {
		var iDocumentWidth = getViewport().width;
		var iAnimationWidth = iWidth;
		
		if (iAnimationWidth > iDocumentWidth) {
			if (broswer.mozilla) {
				$('flashTransparent').style.width = Math.floor(iAnimationWidth  - ((iAnimationWidth - iDocumentWidth) / 2 ) - 8) + 'px';
			}
			else {
				$('flashTransparent').style.width = Math.floor(iAnimationWidth  - ((iAnimationWidth - iDocumentWidth) / 2 )) + 'px';
			}
		}
		else {
			$('flashTransparent').style.width = iWidth + 'px';
		}
	}
}

function endFlashTrans() {
	$('flashIdTransparent').style.display = 'none';
	$('flashTransparent').parentNode.removeChild($('flashTransparent'));
	hideSelect(true, 8);
}

function doPanorama()
{
	//new PeriodicalExecuter(function() {nextImg(); }, 5);
}

function afficheCarte(event)
{
	var carte = $('carte');
	var src_flash_carte = $('src_flash_carte');
	if (carte && src_flash_carte)
	{
		var so_carte = new SWFObject(src_flash_carte.value, "carte_flash", "700", "470", "8", "#FFFFFF");
		so_carte.addParam("wmode", "opaque");
		so_carte.write("carte");
		carte.style.display = "block";
		$('type_log').style.display = "none";
//		$('budg_min').style.display = "none";
//		$('budg_max').style.display = "none";
		$('sel_region').style.display = "none";
		$('sel_ville1').style.display = "none";
		$('sel_ville2').style.display = "none";
		$('sel_ville3').style.display = "none";
	}
}

function fermeFlash(){
	$('carte').innerHTML="";
	$('carte').style.display = "none";
	$('type_log').style.display = "inline";
//	$('budg_min').style.display = "inline";
//	$('budg_max').style.display = "inline";
	$('sel_region').style.display = "inline";
	$('sel_ville1').style.display = "inline";
	$('sel_ville2').style.display = "inline";
	$('sel_ville3').style.display = "inline";
}

function leChoixProg(x){
	var base = "http://www.cogedim-logement.com/immobilier/";
	var temp = "a" + x;
	if (tabListeProgramme[temp])
	{
		document.location = base + tabListeProgramme[temp];
	}
}

function leChoixDep(x){
	var temp="http://www.cogedim-logement.com/immobilier/recherche_immobilier_departement_" + x + "_fr.html";
	document.location=temp;
}
Event.observe(window, "load", ajouterGestionnaire, false);

