﻿function MM_preloadImages(){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 ereg_replace(tx,rg,ch){var regEx=new RegExp(rg,"g");return tx.replace(regEx,ch);}
function urlencode(ch){ch=ch.replace(/[ ]/g,"+");return escape(ch);}
function httpSelection(url)
{
	var xhr_object;
	if(window.XMLHttpRequest)
		xhr_object=new XMLHttpRequest();
	else if(window.ActiveXObject)
		xhr_object=new ActiveXObject("Microsoft.XMLHTTP");
	else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
	//alert(url.substr(0,url.indexOf('?')));
	xhr_object.open('POST',url.substr(0,url.indexOf('?')),true);
	xhr_object.onreadystatechange=function(){
		if(xhr_object.readyState==4)
		{
			reponsepanier=xhr_object.responseText;
			//alert(reponsepanier);
			document.getElementById('PanierDiv').innerHTML=reponsepanier;
			$("#sliderPanier").easySlider({prevId:'prevBtnpanier',nextId:'nextBtnpanier',continuous:true});
		}
	}
	xhr_object.setRequestHeader('Content-Type','application/x-www-form-urlencoded;charset=UTF-8');
	var data=url.substr(url.indexOf('?')+1,url.length-url.indexOf('?')-1)+'&VoirSelection=ok';
	//alert(data);
	xhr_object.send(data);
}
function httpCompteur()
{
	var xhr_object;
	if(window.XMLHttpRequest)
		xhr_object=new XMLHttpRequest();
	else if(window.ActiveXObject)
		xhr_object=new ActiveXObject("Microsoft.XMLHTTP");
	else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
	//alert(url.substr(0,url.indexOf('?')));
	xhr_object.open('POST','/offres/CompteurCarte.asp',true);
	xhr_object.send();
}
function ChgmtRech(TypeDuBien)
{document.getElementById('BoutonB').className="";document.getElementById('BoutonE').className="";document.getElementById('BoutonA').className="";document.getElementById('BoutonI').className="";document.getElementById('BoutonC').className="";document.getElementById('Bouton'+TypeDuBien).className="active";var XHRChgmtRech;if(window.XMLHttpRequest)XHRChgmtRech=new XMLHttpRequest();else if(window.ActiveXObject)XHRChgmtRech=new ActiveXObject('Microsoft.XMLHTTP');else alert('JavaScript : votre navigateur ne supporte pas les objets XMLHttpRequest...');XHRChgmtRech.open('POST','ChangementMenu.asp',true);XHRChgmtRech.onreadystatechange=function()
{if(XHRChgmtRech.readyState==4)
{retourchgmt=XHRChgmtRech.responseText;tabretourchgmt=retourchgmt.split('######');document.getElementById('ChangementRechRapide').innerHTML=tabretourchgmt[0];document.getElementById('ChangementRechRapidePortail').innerHTML=tabretourchgmt[1];}
else
{document.getElementById('ChangementRechRapide').innerHTML='<span class="wait">Recherche en cours...</span>';}}
XHRChgmtRech.setRequestHeader('Content-Type','application/x-www-form-urlencoded;charset=UTF-8');var data='TypeDuBien='+urlencode(TypeDuBien);XHRChgmtRech.send(data);}
function ChgmtRechPortail(TypeDuBien,CpTitreVille,NomTitreVille)
{document.getElementById('BoutonB').className="";document.getElementById('BoutonE').className="";document.getElementById('BoutonA').className="";document.getElementById('BoutonI').className="";document.getElementById('BoutonC').className="";document.getElementById('Bouton'+TypeDuBien).className="active";var XHRChgmtRech;if(window.XMLHttpRequest)XHRChgmtRech=new XMLHttpRequest();else if(window.ActiveXObject)XHRChgmtRech=new ActiveXObject('Microsoft.XMLHTTP');else alert('JavaScript : votre navigateur ne supporte pas les objets XMLHttpRequest...');XHRChgmtRech.open('POST','/location-vente-bureaux/ChangementMenuPortail.asp',true);XHRChgmtRech.onreadystatechange=function()
{if(XHRChgmtRech.readyState==4)
{retourchgmt=XHRChgmtRech.responseText;document.getElementById('ChangementRechRapide').innerHTML=retourchgmt;}
else
{document.getElementById('ChangementRechRapide').innerHTML='<span class="wait">Recherche en cours...</span>';}}
XHRChgmtRech.setRequestHeader('Content-Type','application/x-www-form-urlencoded;charset=UTF-8');var data='TypeDuBien='+urlencode(TypeDuBien)+'&CpTitreVille='+CpTitreVille+'&NomTitreVille='+urlencode(NomTitreVille);XHRChgmtRech.send(data);}
function httptest(url)
{var xhr_object=null;if(window.XMLHttpRequest)
xhr_object=new XMLHttpRequest();else if(window.ActiveXObject)
xhr_object=new ActiveXObject("Microsoft.XMLHTTP");else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
xhr_object.open('POST',url.substr(0,url.indexOf('?')),true);xhr_object.onreadystatechange=function(){if(xhr_object.readyState==4)
{reponsepanier=xhr_object.responseText;$.fn.colorbox({html:'<div>'+reponsepanier+'</div>',width:"650px",open:true});}}
xhr_object.setRequestHeader('Content-Type','application/x-www-form-urlencoded;charset=UTF-8');var data=url.substr(url.indexOf('?')+1,url.length-url.indexOf('?')-1);xhr_object.send(data);}
function AjoutAlerte(url)
{if(url!=null&&url!=''){var XHR;if(window.XMLHttpRequest)XHR=new XMLHttpRequest();else if(window.ActiveXObject)XHR=new ActiveXObject('Microsoft.XMLHTTP');else alert('JavaScript : votre navigateur ne supporte pas les objets XMLHttpRequest...');XHR.open('GET',url,true);XHR.onreadystatechange=function()
{if(XHR.readyState==4)
$.fn.colorbox({html:'<div>'+XHR.responseText+'</div>',open:true});}
XHR.send(null);}}
var NomDiv='DivCachee';var PropRight=360;var PropBottom=130;var VitesseOuverture=60;var Incrementation=25;var ouverture;var fermeture;var dejafermer=false;function ouvrir(DivType)
{if(DivType=="Publicite")
{NomDiv='Publicite2';PropRight=635;PropBottom=485;VitesseOuverture=20;Incrementation=20;window.document.getElementById(NomDiv).style.clip="rect(auto, 0px, 0px, auto)";window.document.getElementById(NomDiv).style.display='block';ouverture=window.setInterval("aggrandissement()",VitesseOuverture);}
else
{if(DivType=="PubliciteEchos")
{NomDiv='Publicite2';PropRight=682;PropBottom=475;VitesseOuverture=20;Incrementation=20;window.document.getElementById(NomDiv).style.clip="rect(auto, 0px, 0px, auto)";window.document.getElementById(NomDiv).style.display='block';ouverture=window.setInterval("aggrandissement()",VitesseOuverture);}
else
{NomDiv='DivCachee';VitesseOuverture=60;Incrementation=25;PropRight=360;PropBottom=130;window.document.getElementById(NomDiv).style.clip="rect(auto, 0px, 0px, auto)";window.document.getElementById(NomDiv).style.display='block';ouverture=window.setInterval("aggrandissement()",VitesseOuverture);}}}
function refermerDiv(DivType)
{NomDiv='Publicite2';VitesseOuverture=2;Incrementation=10;window.document.getElementById(NomDiv).style.clip="rect(auto, 482px, 435px, auto)";fermeture=window.setInterval("rapetissement()",VitesseOuverture);}
function aggrandissement()
{chainesplit=window.document.getElementById(NomDiv).style.clip;if(chainesplit.indexOf(" ")<0)
{clipProp=chainesplit.split(",");var pixel="px";}
else
{clipProp=chainesplit.split(" ");var pixel="px";if(!document.all)
pixel+=",";}
theRight=new Number(clipProp[1].replace(new RegExp(pixel),''));theBottom=new Number(clipProp[2].replace(new RegExp(pixel),''));if(theBottom<PropBottom)theBottom=theBottom+Incrementation;if(theRight<PropRight)
theRight=theRight+Incrementation;else{window.clearInterval(ouverture);}
window.document.getElementById(NomDiv).style.clip="rect(auto, "+theRight+"px, "+theBottom+"px, auto)";}
function rapetissement()
{chainesplit=window.document.getElementById(NomDiv).style.clip;if(chainesplit.indexOf(" ")<0)
{clipProp=chainesplit.split(",");var pixel="px";}
else
{clipProp=chainesplit.split(" ");var pixel="px";if(!document.all)
pixel+=",";}
theRight=new Number(clipProp[1].replace(new RegExp(pixel),''));theBottom=new Number(clipProp[2].replace(new RegExp(pixel),''));if(theBottom>19)theBottom=theBottom-Incrementation;if(theRight>24)
theRight=theRight-Incrementation;else{window.clearInterval(fermeture);window.document.getElementById(NomDiv).style.display='none';document.getElementById('PubInterstitiel').src="/images/PubInterstitiel.gif";}
window.document.getElementById(NomDiv).style.clip="rect(auto, "+theRight+"px, "+theBottom+"px, auto)";}
function cacheBloc()
{window.document.getElementById(NomDiv).style.display='none';}
function isNumcp(thisObject,min,nom_objet){var almsg;var str;str=thisObject.value;if(str==""){almsg="Vous devez saisir "+nom_objet+"\n";return almsg;}
if(isNaN(str)){almsg=nom_objet+" doit être un nombre entier\n";return almsg;}
num=str;if(num+0<=min){almsg=nom_objet+" doit être un nombre entier positif\n";return almsg;}
return""}
function VerifMinMax(MinAVerifie,MaxAVerifie)
{if(!isNaN(MinAVerifie)&&!isNaN(MaxAVerifie))
{if(eval(MinAVerifie)>eval(MaxAVerifie))
{return true;}}
return false;}
function ChangementMultiSimple(TypeChangement)
{if(TypeChangement==1)
{document.getElementById('RechMultiCP').style.display='block';document.getElementById('RechMultiCP0').style.display='none';document.getElementById('cp').value='';document.getElementById('nomvilleselect').value='';document.getElementById('ChoixCommuneOK').value='0';document.getElementById('search').value='code postal, commune, département';}
else
{document.getElementById('RechMultiCP0').style.display='block';document.getElementById('RechMultiCP').style.display='none';document.getElementById('RechMultiCP1').value='CP 1';document.getElementById('RechMultiCP2').value='CP 2';document.getElementById('RechMultiCP3').value='CP 3';document.getElementById('RechMultiCP4').value='CP 4';document.getElementById('RechMultiCP5').value='CP 5';document.getElementById('RechMultiCP6').value='CP 6';}}
function ValiderRecherche(formulaire)
{var ChoixCommuneOK=formulaire.ChoixCommuneOK;var Min=formulaire.min;var Max=formulaire.max;var LocationOK=document.getElementById("location").checked;var VenteOK=document.getElementById("vente").checked;var EntrepotOK=document.getElementById("typeEnt").checked;var ActiviteOK=document.getElementById("typeAct").checked;if(ChoixCommuneOK.value!=0&&Min.value!=""&&Max.value!=""&&(LocationOK||VenteOK)&&(EntrepotOK||ActiviteOK)){formulaire.submit();}
else
{if(ChoixCommuneOK.value==0){formulaire.search.className="ElementManquant";if(document.getElementById('search').value==""){document.getElementById('search').value="code postal, commune, département";}else{document.getElementById('search').focus();}}
else
{formulaire.search.className="";}
if(Min.value==""){document.getElementById('Divsurfmin').className="ElementManquant";}
else
{document.getElementById('Divsurfmin').className="";}
if(Max.value==""){document.getElementById('Divsurfmax').className="ElementManquant";}
else
{document.getElementById('Divsurfmax').className="";}
if(!LocationOK&&!VenteOK){document.getElementById("Divchkboxlocationvente1").className="ElementManquantchkbox";document.getElementById("Divchkboxlocationvente2").className="ElementManquantchkbox";}
else
{document.getElementById("Divchkboxlocationvente1").className="left";document.getElementById("Divchkboxlocationvente2").className="left";}
if(!EntrepotOK&&!ActiviteOK){document.getElementById("Divchkboxentrepotactivite1").className="ElementManquantchkbox";document.getElementById("Divchkboxentrepotactivite2").className="ElementManquantchkbox";}
else
{document.getElementById("Divchkboxentrepotactivite1").className="left";document.getElementById("Divchkboxentrepotactivite2").className="left";}}}
$(document).ready(function(){$("a[rel='imagesite']").colorbox();$(".colorbox").colorbox();$(".colorboxFixedHeight").colorbox({height:"500px"});$(".colorboxFixed").colorbox({width:"600px"});$(".modInfosPerso").colorbox({width:"600px",inline:true,href:"#infosperso"});$(".ajouterProfil").colorbox({width:"600px",inline:true,href:"#nouveauProfil"});$(".abo-offres5000").colorbox({width:"600px",inline:true,href:"#offres5000"});$(".panier").colorbox({width:"600px",inline:true});$(".unsub").colorbox({width:"600px",inline:true,href:"#desinscription"});$(".recupPswd").colorbox({width:"600px",inline:true,href:"#lostPswd"});$(".affAlerte").colorbox({width:"600px",inline:true,href:"#condAlerte"});$(".inscAlerte").colorbox({width:"600px",inline:true,href:"#inscAlerte"});$(".ContacterLogo").colorbox({width:"650px",inline:true,href:"#DivContacterLogo"});});$(document).ready(function(){$(".main_image .desc").show();$(".main_image .block").animate({opacity:0.85},1);$(".image_thumb ul li:first").addClass('active');$(".image_thumb ul li:first").find('.block').find('a').attr({rel:""});$(".image_thumb ul li").click(function(){$(".image_thumb .block a").attr({rel:"imagesite"});$(this).find('.block').find('a').attr({rel:""});var imgAlt=$(this).find('img').attr("alt");var imgTitle=$(this).find('a').attr("href");var imgTitle2=$(this).find('.block').find('a').attr("href");var imgDesc=$(this).find('.block').html();var imgDescHeight=$(".main_image").find('.block').height();if($(this).is(".active")){return false;}else{$(".main_image .block").animate({opacity:0,marginBottom:-imgDescHeight},250,function(){$(".main_image img").attr({src:imgTitle,alt:imgAlt});$(".main_image .block").animate({opacity:0.85,marginBottom:"0"},250);$(".main_image .block a").attr({href:imgTitle2});});}
$(".image_thumb ul li").removeClass('active');$(this).addClass('active');return false;}).hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});});
function VerifIfCP()
{if(document.SelectFrom.zone.value==''&&document.SelectFrom.cp.value=='')
{return false;}
else
{return true;}}
function ValiderSelection(numann,URLAnnonce)
{document.getElementById('SelectFromannonceID').value=numann;document.SelectFrom.action=URLAnnonce;document.SelectFrom.submit();}
function ChangerSurface()
{if(!isNaN(document.FormChangementSurf.Min.value)&&!isNaN(document.FormChangementSurf.Max.value)&&document.FormChangementSurf.Min.value!=''&&document.FormChangementSurf.Max.value!='')
{if(VerifMinMax(document.FormChangementSurf.Min.value,document.FormChangementSurf.Max.value))
{document.SelectFrom.Min.value=document.FormChangementSurf.Max.value;document.SelectFrom.Max.value=document.FormChangementSurf.Min.value;}
else
{document.SelectFrom.Min.value=document.FormChangementSurf.Min.value;document.SelectFrom.Max.value=document.FormChangementSurf.Max.value;}
if(VerifIfCP()){document.SelectFrom.submit();}
else
{alert('Vous devez avoir au moins une commune!');}}
else
{alert('Les valeurs de Surface doivent être des nombres !');}}
function RetirerCPSelection(communearetirer,nomvillearetirer)
{ListeCommune=document.SelectFrom.cp.value;tabListeCommune=ListeCommune.split(',');tabcommunearetirer=communearetirer.split(',');NewListe='';for(varListeCommune in tabListeCommune){isgood=0;for(varcommunearetirer in tabcommunearetirer){if(tabListeCommune[varListeCommune]==tabcommunearetirer[varcommunearetirer])
{isgood=1;}}
if(!isgood)
{if(NewListe=='')
{NewListe=tabListeCommune[varListeCommune];}
else
{NewListe+=','+tabListeCommune[varListeCommune];}}}
ListeCommune=document.SelectFrom.nomvilleselect.value;tabListeCommune=ListeCommune.split(',');NewListenomville='';for(varListeCommune in tabListeCommune){if(tabListeCommune[varListeCommune]!=nomvillearetirer)
{if(NewListenomville!=''){NewListenomville+=',';}
NewListenomville+=tabListeCommune[varListeCommune];}}
if(NewListe=='')
{alert('Vous ne pouvez pas retirer toutes les communes!');}
else
{document.SelectFrom.cp.value=NewListe;document.SelectFrom.nomvilleselect.value=NewListenomville;document.SelectFrom.submit();}}
function RetirerzoneSelection(zonearetirer)
{Listezone=document.SelectFrom.zone.value;tabListezone=Listezone.split(',');tabzonearetirer=zonearetirer.split(',');NewListe='';for(varListeCommune in tabListezone){isgood=0;for(varcommunearetirer in tabzonearetirer){if(tabListezone[varListeCommune]==tabzonearetirer[varcommunearetirer])
{isgood=1;}}
if(!isgood)
{if(NewListe=='')
{NewListe=tabListezone[varListeCommune];}
else
{NewListe+=','+tabListezone[varListeCommune];}}}
if(NewListe==''&&document.SelectFrom.cp.value=='')
{alert('Vous ne pouvez pas retirer toutes les zones!');}
else
{document.SelectFrom.zone.value=NewListe;document.SelectFrom.submit();}}
function RetirerTypeBienSelection(TypeBienaretirer)
{ListeTypeBien=document.SelectFrom.TypeBien.value;tabTypeBien=ListeTypeBien.split(',');NewListe='';for(varListeCommune in tabTypeBien){if(tabTypeBien[varListeCommune]!=TypeBienaretirer)
{if(NewListe=='')
{NewListe=tabTypeBien[varListeCommune];}
else
{NewListe+=','+tabTypeBien[varListeCommune];}}}
if(NewListe=='')
{alert('Vous ne pouvez pas retirer toutes les communes!');}
else
{document.SelectFrom.TypeBien.value=NewListe;if(VerifIfCP()){document.SelectFrom.submit();}
else
{alert('Vous devez avoir au moins une commune!');}}}
function AjouterCPSelection(cp,nomville)
{if(cp!='')
{lstCP=cp.split(',');Memolistecp='';for(variableindice in lstCP){if(!isNaN(lstCP[variableindice]))
{if(Memolistecp!=''){Memolistecp=Memolistecp+',';}
Memolistecp=Memolistecp+lstCP[variableindice];}}
document.SelectFrom.nomvilleselect.value=document.SelectFrom.nomvilleselect.value+','+nomville;if(document.SelectFrom.cp.value=='')
{document.SelectFrom.cp.value=Memolistecp;}
else
{document.SelectFrom.cp.value=document.SelectFrom.cp.value+','+Memolistecp;}
document.SelectFrom.submit();}}
var map=null;var geocoder=null;var contenu='';function load(balise){if(GBrowserIsCompatible()){if(balise=="map")
{document.getElementById("Mapgoogle2").style.display="none";document.getElementById("Mapgoogle4").style.display="none";}
else
{document.getElementById("Mapgoogle4").style.display="block";document.getElementById("Mapgoogle2").style.display="block";map=new GMap2(document.getElementById("Mapgoogle2"));map.enableDoubleClickZoom();map.addControl(new GSmallZoomControl());map.addControl(new GScaleControl());map.addControl(new GMapTypeControl());map.setCenter(new GLatLng(46.225453,2.197266),4);geocoder=new GClientGeocoder();}}}
function showAddress(){LngLat=document.getElementById("AdresseGoogle").value;tableaulnglat=LngLat.split(",");Contenu=document.getElementById("DescripGoogle").value;var point=new GLatLng(tableaulnglat[0],tableaulnglat[1]);var marker=new GMarker(point);map.setCenter(point,13);map.addOverlay(marker);marker.openInfoWindowHtml(Contenu);GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml(Contenu);});}
function ChangerAnnonce(urlannonce)
{document.FormulaireRetour.action=urlannonce;document.FormulaireRetour.submit();}
function Imprimer(annonce)
{window.open('/offres/annonceDetails.asp?annonceID='+annonce+'&forPrint=yes','ImpressionAnnonce','width=670,height=768, scrollbars=yes');}
function FormulaireContact(FormulaireContactadh,FormulaireContactmand,FormulaireContactlogo,positionmandataire,NombreMandataire)
{document.FormulaireRetour.NombreMandataire.value=NombreMandataire;document.FormulaireRetour.PositionMandataire.value=positionmandataire;document.FormulaireRetour.adherentID.value=FormulaireContactadh;document.FormulaireRetour.MandataireID.value=FormulaireContactmand;document.FormulaireRetour.Logoadh.value=FormulaireContactlogo;document.FormulaireRetour.action='/infosDemande/infosDemande.asp';document.FormulaireRetour.submit();}
function ouvrirdetailphoto(urlphoto)
{$.fn.colorbox({href:urlphoto,open:true});}
