<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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_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 MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

// begin absolutely positioned scrollable area object scripts 
// Extension developed by David G. Miles 
// Original Scrollable Area code developed by Thomas Brattli 
function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 
 
 
var speed=50 
 
var loop, timer 
 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
 
function MoveAreaDown(move, id){ 
	if(this.y>-this.scrollHeight+objContainer[id].clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+","+id+")",speed) 
	} 
} 
function MoveAreaUp(move, id){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+","+id+")",speed) 
	} 
} 
 
function PerformScroll(speed, id){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller[id].down(speed, id) 
		else objScroller[id].up(speed, id) 
	} 
} 
 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised = new Array();
var objScroller = new Array(); 
var objContainer = new Array(); 
function InitialiseScrollableArea(container, content, id){ 
    objContainer[id]=new ConstructObject(container) 
    objScroller[id]=new ConstructObject(content,container) 
    objScroller[id].MoveArea(0,0) 
    objContainer[id].css.visibility='visible' 
    initialised[id]=true; 
} 
// end absolutely positioned scrollable area object scripts 

function verif_frm()
	{
	return true;
	}

function ouvrirFichier(obj, width, height, src)
	{
	if (obj.selectedIndex > 0)
		MM_openBrWindow('zoom.php?id=../buisan_images/'+src+'/'+obj.options[obj.selectedIndex].value,'affichage','width='+width+',height='+height);
	}
	
function ouvrirFichier2(fic, width, height, src)
	{
	if (fic != '')
		MM_openBrWindow('zoom.php?id=../buisan_images/'+src+'/'+fic,'affichage','width='+width+',height='+height);
	}
	
function addList(txt, src, id)
	{
	var destinationList, count;
	if (src=='N')
		{
		destinationList = document.frm.image_news;
		count = destinationList.options.length;
		destinationList.options[count] = new Option(txt, txt);
		destinationList.selectedIndex = destinationList.length-1;
		previsu(destinationList,'news','img');
		}
	if (src=='B')
		{
		destinationList = document.frm.image_bien_1;
		count = destinationList.options.length;
		destinationList.options[count] = new Option(txt, txt);
		destinationList = document.frm.image_bien_2;
		count = destinationList.options.length;
		destinationList.options[count] = new Option(txt, txt);
		destinationList = document.frm.image_bien_3;
		count = destinationList.options.length;
		destinationList.options[count] = new Option(txt, txt);
		if (id=='1')
			destinationList = document.frm.image_bien_1;
		if (id=='2')
			destinationList = document.frm.image_bien_2;
		if (id=='3')
			destinationList = document.frm.image_bien_3;
		destinationList.selectedIndex = destinationList.length-1;
		previsu(destinationList,'a_vendre','img_'+id);
		}
	}
	
function centerPopup(windowWidth, windowHeight)
	{
	//if (parseInt(navigator.appVersion) >= 4) window.moveTo((screen.width/2)-(windowWidth/2+10),(screen.height/2)-(windowHeight/2+20));
	return;
	}

function redimPopup(width, height)
	{
	if (window.screen)
		{
    	//window.moveTo(0,0);
    	window.resizeTo(width+10, height+36);
		history.back();
		}
	}
	
function zoom_photo_bien(img)
	{
	if (img!="")
		MM_swapImage('imgZoom','','buisan_images/a_vendre/'+img,1);
	}
	
function news_popup(id)
	{
	MM_openBrWindow('news_popup.php?id='+id,'news','width=596, height=346, scrollbars=no');
	}
	
function plan_popup()
	{
	MM_openBrWindow('plan_popup.php','plan','width=400, height=403, scrollbars=no');
	}
	
function verif_recherche()
	{
	var objForm = document.frm;
	
	objForm.action = 'rechercher_bien_resultat.php';
	return true;
	}
	
function bien_popup(id)
	{
	MM_openBrWindow('bien_popup.php?id='+id,'bien','width=596, height=346, scrollbars=no');
	}
	
function contact(origine, id)
	{
	MM_openBrWindow('contact_popup.php?origine='+origine+'&id='+id,'contact','width=400, height=428, scrollbars=no');
	}
	
function verif_contact()
	{
	var objForm = document.frm;
	var ok = true;

	if (ok && (objForm.nom.value == ''))
		{
		obj = objForm.nom;
		msg = 'Le champ "Nom" est obligatoire...';
		ok = false;
		}
	if (ok && (objForm.prenom.value == ''))
		{
		obj = objForm.prenom;
		msg = 'Le champ "Prénom" est obligatoire...';
		ok = false;
		}
	if (ok && ((objForm.tel_domicile.value == '') && (objForm.tel_portable.value == '')))
		{
		obj = objForm.tel_domicile;
		msg = 'Le champ "Téléphone domicile" ou "Téléphone portable" est obligatoire...';
		ok = false;
		}

	if (ok)
		objForm.action = 'contact_popup_valid.php';
	else
		{
		obj.focus();
		alert(msg);
		}

	return ok;
	}

function verif_contact_bien()
	{
	var objForm = document.frm;
	var ok = true;

	if (ok)
		objForm.action = 'contact_popup_bien_valid.php';

	return ok;
	}
	
function previsu(obj, rep, dst)
	{
	if (obj.selectedIndex == 0)
		img = "../images/espaceur.gif";
	else
		img ='../buisan_images/'+rep+'/'+obj.options[obj.selectedIndex].value;
	MM_swapImage(dst,'',img,1);
	}
	
function verif_login()
	{
	var objForm = document.frm;
	if (objForm.login.value=='')
		{
		alert('Le champ "LOGIN" est obligatoire...');
		objForm.login.focus();
		return false;
		}
	if (objForm.password.value=='')
		{
		alert('Le champ "MOT DE PASSE" est obligatoire...');
		objForm.password.focus();
		return false;
		}

	return true;
	}

function tri_client(tri)
	{
	var objFrm = document.frm;
	
	objFrm.orderby.value = tri;
	objFrm.submit();
	}	
//-->

