var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 20;
offsetY = -100;
var toolTipSTYLE="";
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}
function toolTip(msg,pos)
{
// positionnement bulle
offsetX = 20;
offsetY = -80;
if (pos == "left")
{offsetX = -100;
offsetY = -130;
}

  if(toolTip.arguments.length < 1) // hide
  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else // show
  {
    var content =
	'<TABLE width="200" border="1" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"><TR><TD class="texte" align="center" valign="top" >' + msg + '</TD></TR></TABLE>';
	if(ns4) { toolTipSTYLE.document.write(content); toolTipSTYLE.document.close();s
  toolTipSTYLE.visibility = "visible"; } if(ns6) { document.getElementById("toolTipLayer").innerHTML
  = content; toolTipSTYLE.display='block' } if(ie4) { document.all("toolTipLayer").innerHTML=content;
  toolTipSTYLE.display='block' } } } function moveToMouseLoc(e) { if(ns4||ns6)
  { x = e.pageX; y = e.pageY; } else { x = event.x + document.body.scrollLeft;
  y = event.y + document.body.scrollTop; } toolTipSTYLE.left = x + offsetX; toolTipSTYLE.top
  = y + offsetY; return true; 
}


function changeTitre(i) {
droite = "foto.php?n=" + i;
gauche = "rub.php?n=" + i;
ed = parent.document.getElementById("rubrique");
ed.setAttribute("src", gauche);
ed = parent.document.getElementById("photo");
ed.setAttribute("src", droite);
}


function testConfig()
{
 var hauteurEcran;
 var ecran=false;
 var navigateur=false;
 hauteurEcran=screen.height;

 if (hauteurEcran<768) ecran=true; // Test de la résolution < 1024/768
 if (navigator.appName.indexOf("Microsoft")==-1) navigateur=true;
 
 if (navigateur==true)
 window.open('navig.htm','ecran','width=150,height=130,top=200,left=300');
 if ((ecran==true) && (navigateur==false))
 window.open('config.htm','ecran','width=150,height=130,top=200,left=300');
}

function testNavig()
{
 if (navigator.appName.indexOf("Microsoft")==-1) { return true; } else {return false;}
}

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 mailpage()
{
 chaine_mail = "mailto:?subject=TERRAINS A VENDRE à Vielle St Girons et à DAX dans Les Landes"; 
 chaine_mail += "&body=Terrains à vendre, dans le lotissement Les Vignes, à Vielle St Girons et ";
 chaine_mail += "dans le lotissement du Gran Biaou, route de Tercis, à Dax, ";
 chaine_mail += "à l'adresse : " + "http://www.terrain-landes.com"; 
 location.href = chaine_mail;
}

function mailpage_EN()
{
 chaine_mail = "mailto:?subject=LAND FOR SALE in Landes"; 
 chaine_mail += "&body=Lands for sale in Landes ";
 chaine_mail += "http://www.terrain-landes.com/land"; 
 location.href = chaine_mail;
}

function mailpage_DE()
{
 chaine_mail = "mailto:?subject=Grundstücke zu verkaufen in Landes"; 
 chaine_mail += "&body=Grundstücke zu verkaufen in Landes ";
 chaine_mail += "http://www.terrain-landes.com/grundstuck"; 
 location.href = chaine_mail;
}

// création d'un tableau de n postes
function MakeArray(n){
this.length = n
for (var i=1; i<=n ; i++){
	this[i] = ""}
return this
}

// on indique la table qui va servir à rempir la liste et le poste de départ de la 
// table. C'est également celui qui sera préselectionné dans la liste. 
function Liste(tab, depart) {
for (var n=depart; n<=tab.length; n++){
	if (n==depart)
	document.write("<option value='" + n + "' selected>" + tab[n] + "</option>")
	else
	document.write("<option value='" + n + "'>" + tab[n] + "</option>")
	}
}

function choixListe(nomListe) {
for (var i = 0; i < nomListe.length; i++) {
      if (object.options[i].selected == true) {
         return i
      }
   }
}


// jour est au format Date
function DateJour(jour) {
datA = jour.getYear()
datA = (datA % 100) + 2000
numM = jour.getMonth()+1
datJ = jour.getDate()
numJ = jour.getDay()
}

// dateJ est une chaîne de caract au format aaaammjj
function AfficherJour(dateJ) {
	aaaa = eval(dateJ.substring(0,4))
	mm = eval(dateJ.substring(4,6)) - 1
	jj = eval(dateJ.substring(6,8))
	leJour = new Date(aaaa, mm, jj)
	numMM = leJour.getMonth()+ 1
	numJJ = leJour.getDay()
	document.write(jour[numJJ] + " " + jj + " " + mois[numMM] + " " + aaaa)
}

function ChampObligatoire(nomChamp)	 { 
     if (nomChamp.value.length > 0) 
	   return false
     else 
       return true 
}

function Bouton(s) {
    if ("INPUT"==event.srcElement.tagName)
      event.srcElement.className=s;
}

function ConvText(txt){
	while (txt.indexOf("<")>-1){
		 pos=txt.indexOf("<");
		 txt=txt.substring(0,pos)+"&lt;"+txt.substring(pos+1,txt.length); 
	}	
	while (txt.indexOf(">")>-1){
		pos=txt.indexOf(">");
		txt=txt.substring(0,pos)+"&gt;"+txt.substring(pos+1,txt.length);
	}
return txt;
}

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_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.0
  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 && document.getElementById) x=document.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() { //v3.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; }
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

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

