<!--
var idTimeout = null;
var oldId = null;

function montre(id) {
	clearTimeout(idTimeout);
	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';}
}

function cache() {
	idTimeout = setTimeout('timeout();', 500);
}

function timeout(){
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
	
	idTimeout = null;
}

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];}
}

function iFrameHeight() {
        var h = 0;
        if ( !document.all ) {
            h = top.document.getElementById('middle').contentDocument.height;
	    h = h+10;	
	    w = top.document.getElementById('middle').contentDocument.width;
		
            document.getElementById('middle').style.height = h + 'px';
            document.getElementById('middle').style.width = w + 'px';
        } else if( document.all ) {
            h = top.document.frames('middle').document.body.scrollHeight;
            h= h+10;
            top.document.all.middle.style.height = h + 'px';
            w = top.document.frames('middle').document.body.scrollWidth;
					
            top.document.all.middle.style.width = w + 'px';
        }
    //if( h < 630)
    //    top.document.all.middle.style.height = 630+ 'px'; /*cette condition sert ŕ mettre une taille minimum*/
    }
function turnImgRadio(objRadio)
{

    var t_img = document.getElementById('conteneurRadio').getElementsByTagName('img');

    for (var i = 0; i < t_img.length; i++)
    {
        t_img[i].src = 'images/radio1.gif';
    }
    
    var img = document.getElementById('img_radio_' + objRadio.id);
    img.src = 'images/radio2.gif';
}
function verif_choix(){
	if(document.forms['moteur_colocation'].choix_coloc.value==0) alert("Merci de choisir votre type de recherche");
	else window.document.moteur_colocation.submit();
}


function writediv_ville(texte)
{
document.getElementById("zone_resultat").innerHTML = texte;
}

function recherche_ville(ville)
{
 if(texte = file('js/search_ville.php?ville='+escape(ville)))
	{
	writediv_ville(texte);
	}
}

function writediv_alert_mail(texte)
{
document.getElementById("alert_mail").innerHTML = texte;
}

function enregistrer_mail(mail,ville,prix)
{
texte = file('js/search_ville.php?ville='+escape(ville));
	if(texte=="")
	{
	 if(texte = file('js/inscription_mail.php?mail='+escape(mail)+'&ville='+escape(ville)+'&prix='+escape(prix)))
		{
		writediv_alert_mail(texte);
		}
	}
	else {
		document.getElementById('loading').style.display='none';
		recherche_ville(ville);
	}
}
function bulle_loyer(ville,type,surface)
{
texte = file('js/chercher_prix.php?ville='+escape(ville)+'&type='+escape(type)+'&surface='+escape(surface));
	if(texte)
	{
	document.getElementById("commentaire").innerHTML = texte;
	document.getElementById('commentaire_loyer').style.display='block';
	}
	else
{
	document.getElementById('commentaire_loyer').style.display='none';
}
}


//trouvé sur: www.portugal-tchat.com//
var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}
//trouvé sur: www.portugal-tchat.com//

function displaylimit(thename, theid, thelimit){
var theform=theid!=""? document.getElementById(theid) : thename
var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> caracteres maximum.'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true);
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
}
}


//-->