// tittre principal du site
var ptitle = "Intramuros Immobilier à Reims (51), toutes transactions immobilières";
var bc = "index";
var nurl ="accueil/";
//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) document.formAcquereur.prenom.value=vprenom;
if (vnom != null) document.formAcquereur.nom.value=vnom;
if (vemail != null) 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' );

var monCookie = GetCookie('myvisit' );

if( ! monCookie ) {
   SetCookie( 'myvisit', '1' );
   var newVal = 0;
}
else {
  var newVal = parseInt( monCookie );
  newVal ++;
  SetCookie( 'myvisit', newVal );
}

if( newVal <= 2 ) {
// s'il s'agit de la première visite
}




// 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) { 
//default is 0; what loads is determined by OPTION SELECTED VALUE

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++) { };
                }   
                    
//parent.INDEXPAGE.location=form.select1.options[formindex].value; 
//loads into a frame called INDEXPAGE under the parent ( top) window

//windowname.location=form.select1.options[formindex].value; 
//loads into a named window. If there is not one by that name, it will be created

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;    

//parent.frame2.location=form.select1.options[formindex].value; 
//loads into a named frame under the parent ( top) window

//windowname.location=form.select1.options[formindex].value; 
//loads into a named window. If there is not one by that name, it will be created

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


