// tittre principal du site
var ptitle = "groupe CONNEXION Immobilier, toutes transactions";

function goTo(url) {
var url2=url;
document.location=url2;
}
function goTo1(url) {
var url2=url+'&ml=1';
document.location=url2;
}
function goTo2(url) {
//var url2=url+'?ml=1';
document.location=url;
}


//cookies

function SetCookie ( name, value, expires, path, domain, secure) {
expires = new Date(2099,12,31);
         szCookie = name + "=" + escape (value) +
                  ((expires) ? "; expires=" + expires.toGMTString() :"") +
                  ((path) ? "; path=" + path : "") +
                  ((domain) ? "; domain=" + domain : "") +
                  ((secure) ? "; secure" : "");
                  document.cookie = szCookie;
}

function GetCookie (name) {
         if ( document.cookie) 
	 {
	  index = document.cookie.indexOf( name);
	  if ( index != -1) 
	  {
             nDeb = (document.cookie.indexOf( "=", index) + 1);
             nFin = document.cookie.indexOf( ";", index);
	     if (nFin == -1) 
	     {
	        nFin = document.cookie.length;
             }
	     return unescape(document.cookie.substring(nDeb, nFin));
          }
	 }
	 return null;
}

function RemoveCookie( name ) {
   maDate = new Date( 70, 01, 01 );
   alert( maDate.toGMTString() );
   SetCookie ( name, '', maDate  );
}


function fillform() {
if (vprenom != null) document.formAcquereur.prenom.value=vprenom;
if (vnom != null) document.formAcquereur.nom.value=vnom;
if (vemail != null) document.formAcquereur.email.value=vemail;
if (vtele != null) document.formAcquereur.tel.value=vtele;
}

function savedata() {
var vnom = document.formAcquereur.nom.value;
var vprenom = document.formAcquereur.prenom.value;
var vemail = document.formAcquereur.email.value;
var vtele = document.formAcquereur.tel.value;

  SetCookie( 'vnom', vnom );
  SetCookie( 'vprenom', vprenom );
  SetCookie( 'vemail', vemail );
  SetCookie( 'vtele', vtele );

}

function fillcontact() {
if (vprenom != null && vprenom != "") document.formAcquereur.prenom.value=vprenom;
if (vnom != null && vnom != "") document.formAcquereur.nom.value=vnom;
if (vemail != null && vemail != "") document.formAcquereur.email.value=vemail;
}

function savecontact() {
var vnom = document.formAcquereur.nom.value;
var vprenom = document.formAcquereur.prenom.value;
var vemail = document.formAcquereur.email.value;

  SetCookie( 'vnom', vnom );
  SetCookie( 'vprenom', vprenom );
  SetCookie( 'vemail', vemail );
}


// compteur e visites et mémorisation des coordonnées s'il a rempli un formulaire
var vnom = GetCookie('vnom' );
var vprenom = GetCookie('vprenom' );
var vemail = GetCookie('vemail' );
var vtele = GetCookie('vtele' );

// rollover
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++) 
if (x.alt != "active") {
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]; }
}

// lien cosmosoft
function sponz() {
window.open("http://www.cosmosoft.fr");
}



//popup pour voir les photos etc...
function viewpic(picurl) {
var url="aphoto.php?src="+picurl;
window.open(url, "Photo", "toolbar=no, location=no, directories=no, status=no, scrollbars=auto, resizable=no, copyhistory=no, width=440, height=360, left=50, top=50");
}
function viewvv(vvurl) {
var url=vvurl;
window.open(url, "VisiteVirtuelle", "toolbar=no, location=no, directories=no, status=no, scrollbars=auto, resizable=no, copyhistory=no, width=440, height=360, left=50, top=50");
}
function simula(pri) {
var url='../simulationachat/simulationachat.php?pb='+pri;
window.open(url, "SimulationAchat", "toolbar=no, location=no, directories=no, status=no, scrollbars=auto, resizable=no, copyhistory=no, width=620, height=480, left=50, top=50");
}
function popwin(url) {
//window.open(url, 'catalogue', 'width=370, height=350, toolbar=no, location=no, directories=no, status=no, scrollbars=1 resizable=yes, copyhistory=no');
window.open(url, 'envoi', 'width=370,height=350, scrollbars');
}
function popwin2(url) {
//window.open(url, 'catalogue', 'width=570, height=350, toolbar=no, location=no, directories=no, status=no, scrollbars=1 resizable=yes, copyhistory=no');
window.open(url, 'Catalogue', 'width=470,height=350, scrollbars');
}

// plan acces
function getsrc(s) {
if (s==2) {
document.getElementById("plan2").style.display="block";
document.getElementById("plan1").style.display="none";
}
if (s==1) {
document.getElementById('plan1').style.display='block';
document.getElementById('plan2').style.display='none';
}
}


// titre du bas de la fenêtre
window.status=ptitle;

// visio
var sid="mitnamdliw_wildmantim";

function selectaplace(form) { 

var appname= navigator.appName;             
var appversion=parseInt(navigator.appVersion);

         if (appname == "Netscape" && appversion >= 3){

        var formindex=form.select1.selectedIndex;
        var storage=form.select1.options[formindex].text;
        if (form.select1.options[formindex].value != "none") {
        var msg=storage+"                        You are now being transported to the -> "+storage;

                for (var spot=0;spot<msg.length-storage.length;spot++) {
                var x=msg.substring(spot,msg.length);
                form.select1.options[formindex].text=x;
                for(var d=0;d<150;d++) { };
                }   
                    

document.location=form.select1.options[formindex].value; 
//loads into the current window;

                form.select1[formindex].text=storage;
        } else  {
                form.select1[formindex].text="Not a real option!";
                for(var d=0;d<1250;d++) { };
                form.select1[formindex].text=storage;
        }
}

        else {//do this only for MSIE 3.0x
 
        var formindex=form.select1.selectedIndex;    


document.location=form.select1.options[formindex].value; 

} }


function grow(src,factor,line) {
if (src == 1) {
var div = "a"+line;
}
if (src == 2) {
var div = "b"+line;
}
if (src == 3) {
var div = "c"+line;
}
var img = 'i'+line+'m'+src;
var td = 'td'+src;
td = td+line;

var img1 = 'i'+line+'m1';
var img2 = 'i'+line+'m2';
var img3 = 'i'+line+'m3';
var img4 = 'i'+line+'m4';
var img6 = 'i'+line+'m6';

var div1 = 'a'+line;
var div2 = 'b'+line
var div3 = 'c'+line;
var div4 = 'd'+line;
var div6 = 'f'+line;

var td1 = 'td1'+line;
var td2 = 'td2'+line;
var td3 = 'td3'+line;
var td4 = 'td4'+line;
var td5 = 'td5'+line;
var td6 = 'td6'+line;


var ow=document.getElementById(img).width;
var oh=document.getElementById(img).height;

document.getElementById(div1).style.display="none";
document.getElementById(div2).style.display="none";
document.getElementById(div3).style.display="none";

document.getElementById(td1).style.width='7px';
document.getElementById(td2).style.width='7px';
document.getElementById(td3).style.width='7px';

document.getElementById(div).style.display="block";
document.getElementById(td).style.width='100px';
document.getElementById(td4).style.width='300px';
document.getElementById(td5).style.width='300px';

document.getElementById(img).width=ow*factor;
document.getElementById(img).height=oh*factor;
}

function shrink(src,line) {
var img = 'i'+line+'m'+src;
var td = 'td'+src;
td = td+line;

var img1 = 'i'+line+'m1';
var img2 = 'i'+line+'m2';
var img3 = 'i'+line+'m3';

var div1 = 'a'+line;
var div2 = 'b'+line
var div3 = 'c'+line;

var td1 = 'td1'+line;
var td2 = 'td2'+line;
var td3 = 'td3'+line;
var td4 = 'td4'+line;
var td5 = 'td5'+line;




document.getElementById(div1).style.display="block";
document.getElementById(div2).style.display="block";
document.getElementById(div3).style.display="block";

document.getElementById(td1).style.width='100px';
document.getElementById(td2).style.width='100px';
document.getElementById(td3).style.width='100px';
document.getElementById(td4).style.width='200px';
document.getElementById(td5).style.width='200px';

document.getElementById(img1).width=100;
document.getElementById(img1).height=75;
document.getElementById(img2).width=100;
document.getElementById(img2).height=75;
document.getElementById(img3).width=100;
document.getElementById(img3).height=75;

document.getElementById(img).width=100;
document.getElementById(img).height=75;
}
function iSwap(p,src) {
  var img = 'i'+p+'m1';
document.getElementById(img).src=src;
}
function uniSwap(p,src) {
  var img = 'i'+p+'m1';
document.getElementById(img).src=src;
}


