
<!--
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];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//fonctions récurrentes
function PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
function isEmpty(tmp_str)
{

	var new_msg = false;

	var inputStr = "";

	inputStr = ""+tmp_str;

    if (inputStr.length  <= 0)

	{

	    new_msg = true;

	}

	return (new_msg);

}

<!--
function Longueur(chaine){

	return chaine.length;

}



function RestreintCarateres(inChaine){

	var retour = true;

	var inputStr = inChaine.toString();

        for (var i = 0; i < inputStr.length; i++)

        {

                var oneChar = inputStr.charAt(i);

                if (testCarac(oneChar))

                {

                        retour = false;

                }

        }

        return (retour);

}

function change_surf(numeroMenu,res_id)
{
	for (i=document.form1.select_surf_code.options.length-1;i>0;i--)
	{
		document.form1.select_surf_code.options[i]=null;
	}
		
	for (i=0;i<menu[numeroMenu].length;i++)
	{
		document.form1.select_surf_code.options[i]=new Option(menu[numeroMenu][i].text,menu[numeroMenu][i].value)
	}
		
	document.form1.select_surf_code.selectedIndex=0
}

function selectmenu(theme_prin)
{
	
	if (theme_prin.select_res_id.options[theme_prin.select_res_id.selectedIndex].value == "null")
		{
		alert('Choisissez la surface');
		}
	else{
		window.top.location.href = theme_prin.select_res_id.options[theme_prin.select_res_id.selectedIndex].value;
		}
		

}
	
function destination()
{
	var destination = document.form1.select_res_id.options[document.form1.select_res_id.selectedIndex].value;
	var surface = document.form1.select_surf_code.options[document.form1.select_surf_code.selectedIndex].value;
	//var loyer = document.form1.fourchette_loyer.options[document.form1.fourchette_loyer.selectedIndex].value;

	if(destination=="#")
	    {
		alert('Veuillez saisir une destination valide!');
		document.getElementById('ac_select_ville').focus();
	     }
	else if(destination!="#")
	     {
				if(surface=="#")
				{
					alert('Veuillez saisir un type de surface!');
					document.getElementById('ac_select_surface').focus();
					return 0;
				}

				if(surface=="NC")
				{
					alert('Il n\'y a actuellement aucun logement de libre pour cette résidence!');
					document.getElementById('ac_select_surface').focus();
					
				}
				/*
				if(loyer=="#")
				{
					alert('Veuillez saisir une fourchette de prix pour le loyer');
					document.getElementById('ac_select_loyer').focus();
				}
				*/
	            else
				{
					var res_id = document.form1.select_res_id.value;
					var typsurf = document.form1.select_surf_code.value;
					//var fourchette_loyer = document.form1.fourchette_loyer.value;
					//+'&fourchette_loyer='+fourchette_loyer
					window.location.href = 'index.php?page=resultat_form&residence_id='+res_id+'&type_surf='+typsurf;
		         }				
	     }
}

function change_etat_ligne(type,ligne,id)
{
	if (type=="residence")
	{
		
			if (document.getElementById("tr_"+ligne+"_"+id).style.display=="none")
			{
			document.getElementById("tr_"+ligne+"_"+id).style.display = "block";
			}
			else if (document.getElementById("tr_"+ligne+"_"+id).style.display=="block")
			{
			document.getElementById("tr_"+ligne+"_"+id).style.display = "none";
			}
	}
	else if (type=="lot")
	{
			if (document.getElementById("tr_"+ligne+"_"+id).style.display=="none")
			{
			document.getElementById("tr_"+ligne+"_"+id).style.display = "block";
			}
			else if (document.getElementById("tr_"+ligne+"_"+id).style.display=="block")
			{
			document.getElementById("tr_"+ligne+"_"+id).style.display = "none";
			}
			
	}	
}
function verif_form_pros()
{
	var d = document.form2;

	if (d.pros_nom.value=="")
		{
		alert('Le champ nom est obligatoire');
  		d.pros_nom.focus();
  		return (false);
		}

	if (d.pros_prenom.value=="")
		{
		alert('Le champ prénom est obligatoire');
  		d.pros_prenom.focus();
  		return (false);
		}

		if (d.pros_mail.value=="")
			{
			alert('Le champ E-mail est obligatoire');
			d.pros_mail.focus();
			return (false);
			}
		else if (d.pros_mail.value.indexOf('@', 0) == -1) 
			{
		   alert("Votre E-mail n'est pas valide.");
		   d.pros_mail.focus();
		   return (false);
		    }
		else if (d.pros_mail.value.indexOf('.', 0) == -1) 
			{
		   alert("Votre E-mail n'est pas valide.");
		   d.pros_mail.focus();
		   return (false);
		    }
	if (d.pros_tel.value=="")
		{
		alert('Le champ Télephone est obligatoire');
  		d.pros_tel.focus();
  		return (false);
		}

else
	{
	return (true);	
	}

}
function chg_display(element)
{
	if (document.getElementById(element))
	{
		if (document.getElementById(element).style.display == "none")
			document.getElementById(element).style.display = "inline";
		else 
			document.getElementById(element).style.display = "none";
	}
}
//-->