﻿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 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,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.send(null);}
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=520;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';}}
